| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764 | 
							- using Newtonsoft.Json;
 
- using Newtonsoft.Json.Linq;
 
- using PTMedicalInsurance.Business;
 
- using PTMedicalInsurance.Helper;
 
- using PTMedicalInsurance.Variables;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.ComponentModel;
 
- using System.Data;
 
- using System.Drawing;
 
- using System.IO;
 
- using System.Linq;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- using System.Windows.Forms;
 
- using PTMedicalInsurance.FormSetter;
 
- using PTMedicalInsurance.Common;
 
- namespace PTMedicalInsurance.Forms
 
- {
 
-     public partial class BasicData : Form
 
-     {
 
-         //设置实例
 
-         CenterBusiness cBus = new CenterBusiness();
 
-         HisMainBusiness hBus = new HisMainBusiness();
 
-         HisIrisServices hIS = new HisIrisServices();
 
-         MIIrisServices mIS = new MIIrisServices();
 
-         InvokeHelper invoker = new InvokeHelper();
 
-         InsuServices Iis = new InsuServices();
 
-         //1.声明自适应类实例
 
-         AutoResizeForm asc = new AutoResizeForm();
 
-         public JObject joSelectedInsuInfo;
 
-         public int insuInfoIndex = 0;
 
-         public int idInfoIndex = 0;
 
-         DataTable dtExport;
 
-         public BasicData()
 
-         {
 
-             InitializeComponent();
 
-             rbgDirecType.SelectedIndex = 0;
 
-             rbgDirecType_C.SelectedIndex = 0;
 
-             rbSingleDown.Checked = true;
 
-             this.rbgDirecType.ValueChanged += new Sunny.UI.UIRadioButtonGroup.OnValueChanged(this.rbgDirecType_ValueChanged);
 
-             this.pgDownload.PageChanged += new Sunny.UI.UIPagination.OnPageChangeEventHandler(this.pgDownload_PageChanged);
 
-             this.pgCenterDirect.PageChanged += new Sunny.UI.UIPagination.OnPageChangeEventHandler(this.pgCenterDirect_PageChanged);
 
-             Font rowFont = new Font("UTF-8", 8);
 
-             Font columnFont = new Font("UTF-8", 9);
 
-             rbgDirecType.SelectedIndex = 8;
 
-             rbAll.Checked = true;
 
-             //tabControl1.SelectedIndex = 1;
 
-             //this.StartPosition = FormStartPosition.CenterParent;
 
-             asc.controllInitializeSize(this);
 
-             asc.controlAutoSize(this);
 
-         }
 
-         #region  函数封装
 
-         private void queryInsuDirectory(int currentPage, int pageSize, int directoryType, int interfaceDr, string code)
 
-         {
 
-             try
 
-             {
 
-                 string dirCode = "";
 
-                 string dirName = "";
 
-                 string approvalNO = "";
 
-                 string manufacturer = "";
 
-                 Sunny.UI.UIDataGridView dgv;
 
-                 Sunny.UI.UIPagination pg;
 
-                 if (tabControl1.SelectedIndex == 0)
 
-                 {
 
-                     dirCode = tbDirectoryCode.Text;
 
-                     dirName = tbDircetoryName.Text;                    
 
-                     approvalNO = "";
 
-                     dgv = dgvDirectoy;
 
-                     pg = pgDownload;
 
-                 }
 
-                 else
 
-                 {
 
-                     dirName = tbCenterDirectoryFilter.Text;
 
-                     dirCode = tbInsuCode.Text;
 
-                     dgv = dgvCenterDirectory;
 
-                     approvalNO = tbApprovalNO.Text;
 
-                     pg = pgCenterDirect;
 
-                     manufacturer = tbManufacturer.Text;
 
-                 }
 
-                 JObject joInput = new JObject {
 
-                     { "currentPage" , currentPage },
 
-                     { "pageSize" , pageSize },
 
-                     { "serviceCode" , code },
 
-                     { "directoryType" , directoryType },
 
-                     { "directoryCode" , dirCode },
 
-                     { "directoryName" , dirName },
 
-                     { "approvalNO" , approvalNO },
 
-                     { "manufacturer" , manufacturer },
 
-                     { "directoryDr" , interfaceDr }
 
-                 };
 
-                 JObject joRtn = mIS.getMIDirectoryByPagination(joInput);
 
-                 if (joRtn["errorCode"].ToString() != "0")
 
-                 {
 
-                     MessageBox.Show("IRIS数据返回错误:" + joRtn["errorMessage"].ToString());
 
-                     return;
 
-                 }
 
-                 if (joRtn["result"]["rows"] == null)
 
-                 {
 
-                     MessageBox.Show("该节点不存在");
 
-                     return;
 
-                 }
 
-                 if (joRtn["result"]["total"].ToString() == "0")
 
-                 {
 
-                     MessageBox.Show("未查询到数据");
 
-                     dgv.DataSource = null;
 
-                     return;
 
-                 }
 
-                 DataTable dt = (DataTable)joRtn["result"]["rows"].ToObject(typeof(DataTable));
 
-                 int totalCount = int.Parse(joRtn["result"]["total"].ToString());
 
-                 pg.TotalCount = totalCount;
 
-                 pg.PageSize = pageSize;
 
-                 dgv.DataSource = dt;
 
-                 dgv.Columns[0].ReadOnly = true;
 
-             }
 
-             catch (Exception ex)
 
-             {
 
-                 MessageBox.Show("查询异常:" + ex.Message);
 
-             }
 
-         }
 
-         private void setHeaderTxt(int directoryType, Sunny.UI.UIDataGridView dgv)
 
-         {
 
-             GridViewSetter gvdSetter = new GridViewSetter();
 
-             switch (directoryType)
 
-             {
 
-                 case 0://药品
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfDrug(dgv);
 
-                         break;
 
-                     }
 
-                 case 1://诊疗
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfMedicalService(dgv);
 
-                         break;
 
-                     }
 
-                 case 2://材料
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfMaterials(dgv);
 
-                         break;
 
-                     }
 
-                 case 3://疾病诊断
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfDiagnose(dgv);
 
-                         break;
 
-                     }
 
-                 case 4://手术
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfDiagnose(dgv);
 
-                         break;
 
-                     }
 
-                 case 5://慢性病
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfDiagnose(dgv);
 
-                         break;
 
-                     }
 
-                 case 6://DRGs
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfDiagnose(dgv);
 
-                         break; ;
 
-                     }
 
-                 case 7://日间手术
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfDiagnose(dgv);
 
-                         break; ;
 
-                     }
 
-                 case 8://字典表
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfDictionary(dgv);
 
-                         break;
 
-                     }
 
-                 case 9://中药饮片下载
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfChineseMedicine(dgv);
 
-                         break;
 
-                     }
 
-                 case 10://医药机构制剂目录下载
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfPreparation(dgv);
 
-                         break;
 
-                     }
 
-                 case 11://肿瘤形态学下载
 
-                     {
 
-                         gvdSetter.SetHeaderTextOfTumorMorphology(dgv);
 
-                         break;
 
-                     }
 
-                 case 12://中医疾病下载
 
-                     {
 
-                         gvdSetter.GetChineseDiagnoseJsonByTxt(dgv);
 
-                         break;
 
-                     }
 
-                 case 13://中医证候下载
 
-                     {
 
-                         gvdSetter.GetTCMSyndromeJsonByTxt(dgv);
 
-                         break;
 
-                     }
 
-                 case 14://民族药品
 
-                     {
 
-                         gvdSetter.GetEthnicMedicineJsonByTxt(dgv);
 
-                         break;
 
-                     }
 
-                 case 15://目录信息查询
 
-                     {
 
-                         gvdSetter.GetMedInsuCatalogJsonByTxt(dgv);
 
-                         break;
 
-                     }
 
-                 case 16://医疗与医保目录匹配关系查询
 
-                     {
 
-                         gvdSetter.GetMedInsuCorrespondencJsonByTxt(dgv);
 
-                         break;
 
-                     }
 
-                 case 17://医药机构目录匹配查询
 
-                     {
 
-                         gvdSetter.GetMedInstCorrespondencJsonByTxt(dgv);
 
-                         break;
 
-                     }
 
-                 case 18://医保目录限价查询
 
-                     {
 
-                         gvdSetter.GetMedInsuFixedPriceJsonByTxt(dgv);
 
-                         break;
 
-                     }
 
-                 case 19://医保目录先自付比例下载
 
-                     {
 
-                         gvdSetter.GetMedInsuFirstPayProportionJsonByTxt(dgv);
 
-                         break;
 
-                     }
 
-                 case 20://医药机构信息
 
-                     {
 
-                         gvdSetter.GetMedicalInstitutionJsonByTxt(dgv);
 
-                         break;
 
-                     }
 
-             }
 
-             gvdSetter.DatagridviewColumnWidthAdaptation(dgv);
 
-         }
 
-         private void queryHISInsuDirectory(int directoryType, int pageIndex, int count, Sunny.UI.UIDataGridView dgv, int interfaceDr)
 
-         {
 
-             string code = "09010042";
 
-             //目录下载页面
 
-             if (tabControl1.SelectedIndex == 0)
 
-             {
 
-                 if (rbgDirecType.SelectedIndex == 20)
 
-                 {
 
-                     code = "090100XX";
 
-                 }
 
-                 else if (rbgDirecType.SelectedIndex == 8)
 
-                 {
 
-                     code = "09010043";
 
-                 }
 
-                 else
 
-                 {
 
-                     code = "09010042";
 
-                 }
 
-                 if (rbgDirecType.SelectedIndex <= 13)
 
-                 {
 
-                     queryInsuDirectory(pageIndex, count, directoryType + 1, interfaceDr, code);
 
-                     setHeaderTxt(directoryType, dgv);
 
-                 }
 
-                 else  //几个医保查询该部分数据不存数据库只是临时查询(除医疗机构信息查询外)
 
-                 {
 
-                     //生成DataView列
 
-                     //setHeaderTxt(directoryType, dgv);
 
-                     string pages, recordCounts, errorMessage, sOutpar;
 
-                     dynamic joData = GetInput(rbgDirecType.SelectedIndex, out string funNo);
 
-                     JObject joRtn = cBus.InvokeMedicalInsuranceInquiry(funNo, joData);
 
-                     if (joRtn["infcode"].ToString() == "0")
 
-                     {
 
-                         try
 
-                         {
 
-                             Sunny.UI.UIPagination pg;
 
-                             dgv = dgvDirectoy;
 
-                             pg = pgDownload;
 
-                             DataTable dt;
 
-                             if (rbgDirecType.SelectedIndex == 20)
 
-                             {
 
-                                 dt = (DataTable)joRtn["output"]["medinsinfo"].ToObject(typeof(DataTable));
 
-                                 if (joRtn["output"]["medinsinfo"].ToString() == "")
 
-                                 {
 
-                                     MessageBox.Show("查询成功,但返回结果集为空!");
 
-                                     //return;
 
-                                 }
 
-                                 pg.TotalCount = 50;
 
-                                 pg.PageSize = 50;
 
-                             }
 
-                             else
 
-                             {
 
-                                 pages = joRtn["output"]["pages"].ToString();                 //页数
 
-                                 recordCounts = joRtn["output"]["recordCounts"].ToString();   //总记录条数
 
-                                 dt = (DataTable)joRtn["output"]["data"].ToObject(typeof(DataTable));
 
-                                 if (recordCounts == "0")
 
-                                 {
 
-                                     MessageBox.Show("查询成功,但返回结果集为空!");
 
-                                     //return;
 
-                                 }
 
-                                 pg.TotalCount = int.Parse(recordCounts);
 
-                                 pg.PageSize = int.Parse(TexBYSJL.Text); //int.Parse(pages);
 
-                             }
 
-                             dgv.DataSource = dt;
 
-                             dgv.Columns[0].ReadOnly = true;
 
-                         }
 
-                         catch (Exception ex)
 
-                         {
 
-                             MessageBox.Show("查询异常:" + ex.Message);
 
-                         }
 
-                     }
 
-                     else
 
-                     {
 
-                         errorMessage = "调用交易" + funNo + "出现错误,请查看日志!"; //joImportRtn["errorMessage"].ToString();
 
-                         MessageBox.Show(errorMessage);
 
-                         return;
 
-                     }
 
-                 }
 
-             }
 
-             else //目录对照页面
 
-             {
 
-                 queryInsuDirectory(pageIndex, count, directoryType + 1, interfaceDr, code);
 
-                 setHeaderTxt(directoryType, dgv);
 
-             }
 
-         }
 
-         private int queryHISDirectory(int currentPage, int pageSize, out string errMsg)
 
-         {
 
-             errMsg = "";
 
-             string directoryType = string.Empty;
 
-             switch (rbgDirecType_C.SelectedIndex)
 
-             {
 
-                 case 0:
 
-                     {
 
-                         directoryType = "drugs";
 
-                         break;
 
-                     }
 
-                 case 1:
 
-                     {
 
-                         directoryType = "diagnosi";
 
-                         break;
 
-                     }
 
-                 case 2:
 
-                     {
 
-                         directoryType = "consumables";
 
-                         break;
 
-                     }
 
-             }
 
-             JObject joHISRtn = new JObject();
 
-             JObject joRtn = new JObject();
 
-             InvokeHelper invoker = new InvokeHelper();
 
-             string flag = "";
 
-             //全部是先调HIS,然后再匹配医保平台的对照关系
 
-             if (rbAll.Checked)
 
-             {                
 
-                 JArray jaPagination = new JArray();
 
-                 JArray jaParams = new JArray();
 
-                 flag = "All";
 
-                 dynamic joParam = new JObject();
 
-                 joParam.code = "";
 
-                 joParam.descripts = "";
 
-                 joParam.FindType = new JArray();
 
-                 joParam.TypeID = "";
 
-                 joParam.alias = tbHISDirectoryFilter.Text;
 
-                 joParam.include = "Hosp";
 
-                 joParam.groupID = "324";
 
-                 joParam.hospID = Global.inf.hisHospitalDr;
 
-                 joParam.interfaceDr = Global.inf.interfaceDr;
 
-                 joParam.type = directoryType;
 
-                 joParam.flag = flag;
 
-                 joParam.specInput = "";
 
-                 jaParams.Add(joParam);
 
-                 dynamic joPagination = new JObject();
 
-                 joPagination.pageSize = pageSize;
 
-                 //joPagination.pageSize = 2;
 
-                 joPagination.currentPage = currentPage;
 
-                 joPagination.sortColumn = "Code";
 
-                 joPagination.sortOrder = "asc";
 
-                 jaPagination.Add(joPagination);
 
-                 //该服务需要改写,需要跟(CloudMedicalInsurancePlatform.Tables.MapRelation)进行关联
 
-                 //joInParams.code = "09010038";
 
-                 if (hIS.getHISDir(jaPagination, jaParams, out joHISRtn, out errMsg) != 0)
 
-                 {
 
-                     return -1;
 
-                 }
 
-                 joRtn = mIS.ConvertHISDir(joHISRtn);
 
-                 if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
 
-                 {
 
-                     return -1;
 
-                 }
 
-             }
 
-             //已对照是先调云医保,然后再匹配HIS
 
-             if (rbMaped.Checked)
 
-             {                
 
-                 JArray jaPagination = new JArray();
 
-                 JArray jaParams = new JArray();
 
-                 flag = "Maped";
 
-                 dynamic joParam = new JObject();
 
-                 joParam.alias = tbHISDirectoryFilter.Text;
 
-                 joParam.HospitalDr = Global.inf.hospitalDr;
 
-                 joParam.InterfaceDr = Global.inf.interfaceDr;
 
-                 joParam.hisType = directoryType;
 
-                 jaParams.Add(joParam);
 
-                 dynamic joPagination = new JObject();
 
-                 joPagination.pageSize = pageSize;
 
-                 joPagination.currentPage = currentPage;
 
-                 joPagination.sortColumn = "HisCode";
 
-                 joPagination.sortOrder = "asc";
 
-                 jaPagination.Add(joPagination);
 
-                 JObject joMIRtn = mIS.GetMappedHISDir(jaPagination, jaParams);
 
-                 if (JsonHelper.parseIrisRtnValue(joMIRtn, out errMsg) != 0)
 
-                 {
 
-                     return -1;
 
-                 }
 
-                 //传给HIS,进行匹配
 
-                 joParam = new JObject();
 
-                 joParam.TotalCount = joMIRtn["result"]["TotalCount"];
 
-                 joParam.type = directoryType;
 
-                 joParam.flag = flag;
 
-                 joParam.hospID = Global.inf.hisHospitalDr;
 
-                 joParam.interfaceDr = Global.inf.interfaceDr;
 
-                 joParam.alias = tbHISDirectoryFilter.Text;
 
-                 joParam.include = "Hosp";
 
-                 joParam.groupID = "324";
 
-                 joParam.compareArr = joMIRtn["result"]["Data"];
 
-                 jaParams = new JArray();
 
-                 jaParams.Add(joParam);
 
-                 if (hIS.getHISDir(jaPagination, jaParams, out joRtn, out errMsg) != 0)
 
-                 {
 
-                     return -1;
 
-                 }
 
-             }
 
-             //if (rbNoMaped.Checked) { flag = "NoMaped"; }
 
-             if (rbNoMaped.Checked)
 
-             {                
 
-                 JArray jaPagination = new JArray();
 
-                 JArray jaParams = new JArray();
 
-                 flag = "All";
 
-                 dynamic joParam = new JObject();
 
-                 joParam.code = "";
 
-                 joParam.descripts = "";
 
-                 joParam.FindType = new JArray();
 
-                 joParam.TypeID = "";
 
-                 joParam.alias = tbHISDirectoryFilter.Text;
 
-                 joParam.include = "Hosp";
 
-                 joParam.groupID = "324";
 
-                 joParam.hospID = Global.inf.hisHospitalDr;
 
-                 joParam.interfaceDr = Global.inf.interfaceDr;
 
-                 joParam.type = directoryType;
 
-                 joParam.flag = flag;
 
-                 joParam.specInput = "";
 
-                 jaParams.Add(joParam);
 
-                 dynamic joPagination = new JObject();
 
-                 joPagination.pageSize = pageSize; //pageSize;
 
-                 //joPagination.pageSize = 2;
 
-                 joPagination.currentPage = currentPage;
 
-                 joPagination.sortColumn = "Code";
 
-                 joPagination.sortOrder = "asc";
 
-                 jaPagination.Add(joPagination);
 
-                 //1.获取全部HIS目录
 
-                 if (hIS.getHISDir(jaPagination, jaParams, out joHISRtn, out errMsg) != 0)
 
-                 {
 
-                     return -1;
 
-                 }
 
-                 joRtn = mIS.GetNoMappHISDir(joHISRtn);
 
-                 if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
 
-                 {
 
-                     return -1;
 
-                 }
 
-             }
 
-             DataTable dt = (DataTable)joRtn["result"]["Data"].ToObject(typeof(DataTable));
 
-             dtExport = dt;
 
-             int totalCount = int.Parse(joRtn["result"]["TotalCount"].ToString());
 
-             pgHISDirect.TotalCount = totalCount;
 
-             if (rbNoMaped.Checked)
 
-                 pgHISDirect.PageSize = pageSize;
 
-             else
 
-                 pgHISDirect.PageSize = 50;
 
-             dgvHISDirectory.DataSource = null;
 
-             dgvHISDirectory.DataSource = dt;
 
-             dgvHISDirectory.Columns[0].ReadOnly = true;
 
-             GridViewSetter gridSetter = new GridViewSetter();
 
-             gridSetter.SetHeaderTextOfMapping_HisDirectory(dgvHISDirectory);
 
-             gridSetter.DatagridviewColumnWidthAdaptation(dgvHISDirectory);
 
-             return 0;
 
-         }
 
-         private void queryCenterDirectory_09010012(int currentPage, int pageSize)
 
-         {
 
-             string directoryType = string.Empty;
 
-             switch (rbgDirecType_C.SelectedIndex)
 
-             {
 
-                 case 0:
 
-                     {
 
-                         directoryType = "drugs";
 
-                         break;
 
-                     }
 
-                 case 1:
 
-                     {
 
-                         directoryType = "diagnosi";
 
-                         break;
 
-                     }
 
-                 case 2:
 
-                     {
 
-                         directoryType = "consumables";
 
-                         break;
 
-                     }
 
-             }
 
-             dynamic joInParams = new JObject();
 
-             joInParams.pagination = new JArray() as dynamic;
 
-             joInParams.session = new JArray() as dynamic;
 
-             JArray jaParams = new JArray();
 
-             dynamic joParams = new JObject();
 
-             joParams.code = "";
 
-             joParams.descripts = "";
 
-             joParams.FindType = new JArray();
 
-             joParams.TypeID = "";
 
-             joParams.alias = "";
 
-             joParams.include = "Hosp";
 
-             joParams.groupID = "324";
 
-             joParams.hospID = "25";
 
-             joParams.type = directoryType;
 
-             joParams.specInput = "";
 
-             jaParams.Add(joParams);
 
-             joInParams.Add("params", JArray.FromObject(jaParams));
 
-             dynamic joSession = new JObject();
 
-             joSession.userID = "";
 
-             joSession.locID = "";
 
-             joSession.groupID = "";
 
-             joSession.hospID = "";
 
-             joSession.sessionID = "";
 
-             joSession.hospCode = "";
 
-             joSession.language = "";
 
-             joSession.hostName = "";
 
-             joSession.ipv4 = "";
 
-             joSession.ipv6 = "";
 
-             joSession.mac = "";
 
-             joInParams.session.Add(joSession);
 
-             dynamic joPagination = new JObject();
 
-             joPagination.pageSize = pageSize;
 
-             joPagination.currentPage = currentPage;
 
-             joPagination.sortColumn = "Code";
 
-             joPagination.sortOrder = "asc";
 
-             joInParams.pagination.Add(joPagination);
 
-             joInParams.code = "09010012";
 
-             string sInput = joInParams.ToString();
 
-             string sRtn = invoker.invokeInsuService(joInParams, "");
 
-             JObject jsonRtn = JObject.Parse(sRtn);
 
-             if (jsonRtn["result"]["Data"] == null)
 
-             {
 
-                 MessageBox.Show("该节点不存在");
 
-                 return;
 
-             }
 
-             JObject joRtn = JObject.Parse(sRtn);
 
-             DataTable dt = (DataTable)joRtn["result"]["Data"].ToObject(typeof(DataTable));
 
-             int totalCount = int.Parse(joRtn["result"]["TotalCount"].ToString());
 
-             pgCenterDirect.TotalCount = totalCount;
 
-             pgCenterDirect.PageSize = 50;
 
-             dgvCenterDirectory.DataSource = dt;
 
-         }
 
-         private void Mapping()
 
-         {
 
-             int iHis = dgvHISDirectory.CurrentRow.Index;
 
-             if (dgvCenterDirectory.CurrentRow == null)
 
-             {
 
-                 MessageBox.Show("请查询中心目录");
 
-                 return;
 
-             }
 
-             int iCenter = dgvCenterDirectory.CurrentRow.Index;
 
-             DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
 
-             DataTable dtCenter = (DataTable)dgvCenterDirectory.DataSource;
 
-             dgvHISDirectory.Rows[iHis].Cells["insuCode"].Value = dgvCenterDirectory.Rows[iCenter].Cells["Code"].Value.ToString();
 
-             dgvHISDirectory.Rows[iHis].Cells["insuName"].Value = dgvCenterDirectory.Rows[iCenter].Cells["Name"].Value.ToString();
 
-             int hisType = rbgDirecType_C.SelectedIndex + 1;
 
-             string hisTypeName = rbgDirecType_C.Items[hisType - 1].ToString(); ;
 
-             JArray jaParams = new JArray();
 
-             dynamic jsonTemp = new JObject();
 
-             jsonTemp.ID = dtHis.Rows[iHis]["MapID"];
 
-             jsonTemp.HospitalDr = Global.inf.hospitalDr;
 
-             jsonTemp.updateUserID = Global.user.ID;
 
-             jsonTemp.InterfaceDr = Global.inf.interfaceDr;
 
-             jsonTemp.HISCode = dgvHISDirectory.Rows[iHis].Cells["itemCode"].Value;
 
-             jsonTemp.HISName = dgvHISDirectory.Rows[iHis].Cells["itemDesc"].Value;
 
-             jsonTemp.ChargeItemDr = dtHis.Rows[iHis]["ID"];
 
-             jsonTemp.DiretoryDr = dtCenter.Rows[iCenter]["medInsuDirectoryID"];
 
-             //1.已对照  2.已对照但未上传  3 已对照且已上传
 
-             jsonTemp.State = 1;
 
-             jsonTemp.HisType = hisType;
 
-             jsonTemp.HisTypeName = hisTypeName;
 
-             jsonTemp.InsuCode = dgvCenterDirectory.Rows[dgvCenterDirectory.CurrentRow.Index].Cells["Code"].Value;
 
-             jsonTemp.InsuName = dgvCenterDirectory.Rows[dgvCenterDirectory.CurrentRow.Index].Cells["Name"].Value;
 
-             jsonTemp.UpdateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
 
-             jaParams.Add(jsonTemp);
 
-             JObject joIn = new JObject();
 
-             joIn.Add(new JProperty("params", jaParams));
 
-             joIn.Add("code", "09010040");
 
-             InvokeHelper invoker = new InvokeHelper();
 
-             JObject joRtn = invoker.invokeInsuService(joIn.ToString(), "插入对照信息");
 
-             //JObject joRtn = JObject.Parse(irisRtn);
 
-             if ((int)joRtn["errorCode"] == 0)
 
-             {
 
-                 dgvHISDirectory.Rows[iHis].Cells["flag"].Value = "已对照";
 
-             }
 
-             else
 
-             {
 
-                 dgvHISDirectory.Rows[iHis].Cells["flag"].Value = "对照失败";
 
-             }
 
-         }
 
-         private void CancleMapping()
 
-         {
 
-             int iHis = dgvHISDirectory.CurrentRow.Index;
 
-             DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
 
-             JArray jaParams = new JArray();
 
-             dynamic jsonTemp = new JObject();
 
-             jsonTemp.ID = dtHis.Rows[iHis]["MapID"];
 
-             jsonTemp.HospitalDr = Global.inf.hospitalDr;
 
-             jsonTemp.updateUserID = Global.user.ID;
 
-             jsonTemp.InterfaceDr = Global.inf.interfaceDr;
 
-             jsonTemp.HISCode = dgvHISDirectory.Rows[iHis].Cells["itemCode"].Value;
 
-             jsonTemp.UpdateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
 
-             jaParams.Add(jsonTemp);
 
-             JObject joIn = new JObject();
 
-             joIn.Add(new JProperty("params", jaParams));
 
-             joIn.Add("code", "09010041");
 
-             InvokeHelper invoker = new InvokeHelper();
 
-             JObject joRtn = invoker.invokeInsuService(joIn.ToString(), "取消对照");
 
-             if ((int)joRtn["errorCode"] == 0)
 
-             {
 
-                 dgvHISDirectory.Rows[iHis].Cells["insuCode"].Value = "";
 
-                 dgvHISDirectory.Rows[iHis].Cells["insuName"].Value = "";
 
-                 dgvHISDirectory.Rows[iHis].Cells["flag"].Value = "";
 
-             }
 
-             else
 
-             {
 
-                 dgvHISDirectory.Rows[iHis].Cells["flag"].Value = "取消失败";
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// 医保目录单个版本号的下载
 
-         /// </summary>
 
-         /// <param name="ver"></param>
 
-         /// <param name="directoryType"></param>
 
-         /// <param name="uiProcessBar"></param>
 
-         /// <param name="errorMessage"></param>
 
-         /// <returns></returns>
 
-         public int SingleDownload(string ver, int directoryType, Sunny.UI.UIProcessBar uiProcessBar, out string errorMessage)
 
-         {
 
-             string txtPath = string.Empty;
 
-             errorMessage = "";
 
-             int iResult = -1;
 
-             string funNo = "";
 
-             switch (directoryType)
 
-             {
 
-                 case 0://药品
 
-                     {
 
-                         funNo = "1301";   //"1301";
 
-                         break;
 
-                     }
 
-                 case 1://诊疗
 
-                     {
 
-                         funNo = "1305";
 
-                         break;
 
-                     }
 
-                 case 2://材料
 
-                     {
 
-                         funNo = "1306";
 
-                         break;
 
-                     }
 
-                 case 3://疾病诊断
 
-                     {
 
-                         funNo = "1307";
 
-                         break;
 
-                     }
 
-                 case 4://手术
 
-                     {
 
-                         funNo = "1308";
 
-                         break;
 
-                     }
 
-                 case 5://慢性病
 
-                     {
 
-                         funNo = "1309";
 
-                         break;
 
-                     }
 
-                 case 6://DRGs
 
-                     {
 
-                         funNo = "1310";
 
-                         break; ;
 
-                     }
 
-                 case 7://日间手术
 
-                     {
 
-                         funNo = "1311";
 
-                         break;
 
-                     }
 
-                 case 8://字典表
 
-                     {
 
-                         break;
 
-                     }
 
-                 case 9://中药饮片
 
-                     {
 
-                         funNo = "1302";
 
-                         break;
 
-                     }
 
-                 case 10://医药机构制剂
 
-                     {
 
-                         funNo = "1303";
 
-                         break;
 
-                     }
 
-             }
 
-             try
 
-             {
 
-                 JObject joRtn = hBus.DownloadDirectory(funNo, ver);
 
-                 //MessageBox.Show("往IRIS插入数据准备:" + joRtn.ToString());
 
-                 //if (JsonHelper.parseCenterRtnValue(joRtn, out errorMessage) == 0)
 
-                 if (JsonHelper.parseIrisRtnValue(joRtn, out errorMessage) == 0)
 
-                 {
 
-                     txtPath = joRtn["filePath"].ToString();
 
-                     //MessageBox.Show("获取txt数据往IRIS插入文件路径:"+ txtPath);
 
-                     DataImoport bus = new DataImoport();
 
-                     JObject joImportRtn = bus.importDataToIrisByTxt(txtPath, 50, directoryType + 1, uiProcessBar);
 
-                     //MessageBox.Show("往IRIS插入数据:" + joImportRtn.ToString());
 
-                     //if (JsonHelper.parseCenterRtnValue(joImportRtn, out errorMessage) == 0)
 
-                     if (JsonHelper.parseIrisRtnValue(joImportRtn, out errorMessage) == 0)
 
-                     {
 
-                         iResult = 0;
 
-                     }
 
-                     else
 
-                     {
 
-                         Global.writeLog(joImportRtn.ToString());
 
-                         errorMessage = "导入数据出现错误,请查看日志!";//joImportRtn["errorMessage"].ToString();
 
-                     }
 
-                 }
 
-                 return iResult;
 
-             }
 
-             catch (Exception ex)
 
-             {
 
-                 errorMessage = "SingleDownload提示:" + ex.Message;
 
-                 return -1;
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// 医保目录单个版本号的下载
 
-         /// </summary>
 
-         /// <param name="ver"></param>
 
-         /// <param name="directoryType"></param>
 
-         /// <param name="uiProcessBar"></param>
 
-         /// <param name="errorMessage"></param>
 
-         /// <returns></returns>
 
-         public int downloadDicionary(JObject joData, Sunny.UI.UIProcessBar uiProcessBar, out string errorMessage)
 
-         {
 
-             errorMessage = "";
 
-             int iResult = -1;
 
-             try
 
-             {
 
-                 JObject joRtn = cBus.DownDictionay(joData);
 
-                 if (JsonHelper.parseCenterRtnValue(joRtn, out errorMessage) == 0)
 
-                 {
 
-                     DataImoport DI = new DataImoport();
 
-                     JArray jaList = JArray.Parse(JsonHelper.getDestValue(joRtn, "output.list"));
 
-                     JObject joImportRtn = DI.importDictionary(uiProcessBar, jaList, tbDicType.Text);
 
-                     if (JsonHelper.parseIrisRtnValue(joImportRtn, out errorMessage) == 0)
 
-                     {
 
-                         iResult = 0;
 
-                     }
 
-                     else
 
-                     {
 
-                         errorMessage = "导入数据出现错误,请查看日志!" + errorMessage;
 
-                     }
 
-                 }
 
-                 return iResult;
 
-             }
 
-             catch (Exception ex)
 
-             {
 
-                 errorMessage = "downloadDicionary提示:" + ex.Message;
 
-                 return -1;
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// 自动下载医保目录,直到最新版本(返回报错)
 
-         /// </summary>
 
-         /// <param name="directoryType"></param>
 
-         /// <param name="uiProcessBar"></param>
 
-         /// <param name="errorMessage"></param>
 
-         /// <returns></returns>
 
-         public int AutoDownload(int directoryType, Sunny.UI.UIProcessBar uiProcessBar, out string errorMessage)
 
-         {
 
-             int iResult = 0;
 
-             errorMessage = "";
 
-             try
 
-             {
 
-                 while (iResult == 0)
 
-                 {
 
-                     JObject joMaxVerNO = mIS.getDirectoryMaxVersionNO(directoryType);
 
-                     string ver = joMaxVerNO["result"]["MaxVersionNO"].ToString();                    
 
-                     iResult = JsonHelper.parseIrisRtnValue(joMaxVerNO, out errorMessage);
 
-                     iResult = SingleDownload(ver, directoryType, uiProcessBar, out errorMessage);
 
-                 }
 
-                 return iResult;
 
-             }
 
-             catch (Exception ex)
 
-             {
 
-                 errorMessage = ex.Message;
 
-                 return -1;
 
-             }
 
-         }
 
-         #endregion
 
-         private void Form1_Load(object sender, EventArgs e)
 
-         {
 
-             this.WindowState = FormWindowState.Maximized;
 
-             rbgDirecType.ValueChanged += new Sunny.UI.UIRadioButtonGroup.OnValueChanged(rbgDirecType_ValueChanged);
 
-             LabExplain.Visible = false;
 
-         }
 
-         private void btnDownload_Click(object sender, EventArgs e)
 
-         {
 
-             string errorMessage = string.Empty;
 
-             //医保字典数据下载
 
-             if (rbgDirecType.SelectedIndex == 8)
 
-             {
 
-                 if (tbDicDate.Text == "")
 
-                 {
 
-                     MessageBox.Show("请输入查询日期!");
 
-                     return;
 
-                 }
 
-                 dynamic joData = new JObject();
 
-                 joData.type = tbDicType.Text;   //字典类型
 
-                 joData.parentValue = "";        //父字典键值 
 
-                 joData.admdvs = Global.inf.areaCode;        //行政区划  就医地
 
-                 joData.date = tbDicDate.Text;  //查询日期 
 
-                 joData.vali_flag = "1";   //有效标志 
 
-                 if (downloadDicionary(joData, uiProcessBar1, out errorMessage) != 0)
 
-                 {
 
-                     MessageBox.Show("医保字典下载失败:" + errorMessage);
 
-                     return;
 
-                 }
 
-             }
 
-             else if (rbgDirecType.SelectedIndex <=10)
 
-             {
 
-                 if (rbSingleDown.Checked)
 
-                 {
 
-                     string ver = tbVer.Text;
 
-                     if (tbVer.Text != "")
 
-                     {
 
-                         ver = tbVer.Text;
 
-                     }
 
-                     if (SingleDownload(ver, rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
 
-                     {
 
-                         MessageBox.Show("医保目录下载失败:" + errorMessage);
 
-                         return;
 
-                     }
 
-                 }
 
-                 if (rbAutoDown.Checked)
 
-                 {
 
-                     if (AutoDownload(rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
 
-                     {
 
-                         MessageBox.Show("医保目录下载失败:" + errorMessage);
 
-                         return;
 
-                     }
 
-                 }
 
-             }
 
-             btnQuery_Click(sender, e);
 
-         }
 
-         private void btnQuery_Click(object sender, EventArgs e)
 
-         {
 
-             #region 校验查询条件
 
-             if ((rbgDirecType.SelectedIndex < 0) || (rbgDirecType.SelectedIndex > 20))
 
-             {
 
-                 MessageBox.Show("请先选择查询类型!");
 
-                 return;
 
-             }
 
-             if (rbgDirecType.SelectedIndex > 13)
 
-             {
 
-                 if (rbgDirecType.SelectedIndex != 20)
 
-                 {
 
-                     if ((TexDate.Text == "") || (TexDate.Text == "输入日期 2021-01-01"))
 
-                     {
 
-                         MessageBox.Show("查询条件-请输入查询日期!");
 
-                         return;
 
-                     }
 
-                     if ((TexDQYS.Text == "") || (TexDQYS.Text == "当前页数"))
 
-                     {
 
-                         MessageBox.Show("查询条件-请输入当前页数!");
 
-                         return;
 
-                     }
 
-                     if ((TexBYSJL.Text == "") || (TexBYSJL.Text == "本页数据量"))
 
-                     {
 
-                         MessageBox.Show("查询条件-请输入本页数据量!");
 
-                         return;
 
-                     }
 
-                 }
 
-                 else
 
-                 {
 
-                     if ((TexYYMC.Text == "") || (TexYYMC.Text == "输入医院名称模糊查找"))
 
-                     {
 
-                         MessageBox.Show("查询条件-请输入医院名称模糊查找!");
 
-                         return;
 
-                     }
 
-                 }
 
-             }
 
-             #endregion
 
-             queryHISInsuDirectory(rbgDirecType.SelectedIndex, 1, 20, dgvDirectoy, Global.inf.interfaceDr);
 
-         }
 
-         private void btnQueryHISDirectory_Click(object sender, EventArgs e)
 
-         {
 
-             string errMsg;
 
-             int iCount = 50;
 
-             if (rbNoMaped.Checked) iCount = 300;
 
-             
 
-             if (queryHISDirectory(1, iCount, out errMsg) != 0)
 
-             {
 
-                 MessageBox.Show(errMsg);
 
-                 return;
 
-             }
 
-         }
 
-         private void btnQueryCenterDirectory_Click(object sender, EventArgs e)
 
-         {
 
-             if ((tbCenterDirectoryFilter.Text == "") && (tbInsuCode.Text == "") && (tbApprovalNO.Text == "") && (tbManufacturer.Text == ""))
 
-             {
 
-                 return;
 
-             }
 
-             //查询区域通用目录 
 
-             JObject joRtn = mIS.getInterface_TY(Global.inf.interfaceDr.ToString(),"");
 
-             string InsuCurrencyCataLogue = JsonHelper.getDestValue(joRtn, "InsuCurrencyCataLogue");    //通用目录编码 6
 
-             string InterfaceName_TY = JsonHelper.getDestValue(joRtn, "InterfaceName_TY");              //通用目录名称  
 
-             string HospName = JsonHelper.getDestValue(joRtn, "HospitalName");                          //目录名称                                                                                                     
 
-             if (InsuCurrencyCataLogue != "")
 
-             {
 
-                 queryHISInsuDirectory(rbgDirecType_C.SelectedIndex, 1, 50, dgvCenterDirectory, int.Parse(InsuCurrencyCataLogue));
 
-                 LabExplain.Visible = true;
 
-                 LabExplain.Text = "当前接口已设置区域通用目录,数据源:" + InterfaceName_TY+" ,如果没有所查目录请联系数据源医院新增维护!";
 
-             }
 
-             else
 
-             {
 
-                 queryHISInsuDirectory(rbgDirecType_C.SelectedIndex, 1, 50, dgvCenterDirectory, Global.inf.interfaceDr);
 
-                 LabExplain.Visible = true;
 
-                 LabExplain.Text = "当前接口未设置区域通用目录,数据源:" + HospName;
 
-             }
 
-             GridViewSetter gridSetter = new GridViewSetter();
 
-             gridSetter.DatagridviewColumnWidthAdaptation(dgvCenterDirectory);
 
-         }
 
-         private void pgDownload_PageChanged(object sender, object pagingSource, int pageIndex, int count)
 
-         {
 
-             queryHISInsuDirectory(rbgDirecType.SelectedIndex, pageIndex, count, dgvDirectoy, Global.inf.interfaceDr);
 
-         }
 
-         private void pgHISDirect_PageChanged(object sender, object pagingSource, int pageIndex, int count)
 
-         {
 
-             string errMsg;
 
-             int iCount = 50;
 
-             if (rbNoMaped.Checked) iCount = 300;
 
-             if (queryHISDirectory(pageIndex, iCount, out errMsg) != 0)
 
-             {
 
-                 MessageBox.Show(errMsg);
 
-                 return;
 
-             }
 
-         }
 
-         private void pgCenterDirect_PageChanged(object sender, object pagingSource, int pageIndex, int count)
 
-         {
 
-             queryHISInsuDirectory(rbgDirecType_C.SelectedIndex, pageIndex, count, dgvCenterDirectory, Global.inf.interfaceDr);
 
-         }
 
-         private void rbgDirecType_ValueChanged(object sender, int index, string text)
 
-         {
 
-             //选定项不同调用的接口也不相同,Index值大于
 
-             if (rbgDirecType.SelectedIndex > 13)
 
-             {
 
-                 uiGroupBox1.Visible = false;
 
-                 uiGroupBox5.Visible = false;
 
-                 uiGroupBox2.Visible = true;
 
-                 //uiGroupBox3.Visible = true;
 
-                 uiProcessBar1.Visible = false;
 
-                 uiGroupBox2.Left = rbgDirecType.Width + rbgDirecType.Left + 5;
 
-                 uiGroupBox3.Left = uiGroupBox2.Width+rbgDirecType.Width + rbgDirecType.Left + 10;
 
-                 dgvDirectoy.DataSource = null;
 
-             }
 
-             else
 
-             {
 
-                 uiGroupBox1.Visible = true;
 
-                 uiGroupBox5.Visible = true;
 
-                 uiGroupBox2.Visible = true;
 
-                 //uiGroupBox3.Visible = false;                
 
-                 uiProcessBar1.Visible = true;
 
-                 uiGroupBox1.Left = rbgDirecType.Width + rbgDirecType.Left + 5;
 
-                 uiGroupBox5.Left = uiGroupBox1.Width + rbgDirecType.Width + rbgDirecType.Left + 10;
 
-                 uiGroupBox2.Left = uiGroupBox5.Width + uiGroupBox1.Width + rbgDirecType.Width + rbgDirecType.Left + 15;
 
-                 uiGroupBox3.Left = uiGroupBox2.Width + uiGroupBox5.Width + uiGroupBox1.Width + rbgDirecType.Width + rbgDirecType.Left + 20;
 
-                 uiProcessBar1.Left = rbgDirecType.Width + rbgDirecType.Left + 5;
 
-                 uiProcessBar1.Width = uiGroupBox1.Width + uiGroupBox5.Width + uiGroupBox2.Width + 10;
 
-             }
 
-             setHeaderTxt(rbgDirecType.SelectedIndex, dgvDirectoy);
 
-         }
 
-         private void toolStripMenuItem2_Click(object sender, EventArgs e)
 
-         {
 
-             CancleMapping();
 
-         }
 
-         private void tsmiMapping_Click(object sender, EventArgs e)
 
-         {
 
-             Mapping();
 
-         }
 
-         private void dgvHISDirectory_DoubleClick(object sender, EventArgs e)
 
-         {
 
-             int currentPage = pgHISDirect.ActivePage;
 
-             string flag = dgvHISDirectory.Rows[dgvHISDirectory.CurrentRow.Index].Cells["flag"].Value.ToString();
 
-             if (flag == "未对照")
 
-             {
 
-                 Mapping();
 
-             }
 
-             else
 
-             if (flag == "已对照")
 
-             {
 
-                 CancleMapping();
 
-             }
 
-             if (rbAll.Checked)
 
-             {
 
-                 string errMsg;
 
-                 if (queryHISDirectory(1, 50, out errMsg) != 0)
 
-                 {
 
-                     MessageBox.Show(errMsg);
 
-                     return;
 
-                 }
 
-             }
 
-         }
 
-         private void dgvDirectoy_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 
-         {
 
-         }
 
-         private void dgvDirectoy_CellContentClick(object sender, DataGridViewCellEventArgs e)
 
-         {
 
-         }
 
-         private void uiRadioButton1_CheckedChanged(object sender, EventArgs e)
 
-         {
 
-         }
 
-         private void dgvDirectoy_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 
-         {
 
-             //自动编号,与数据无关
 
-             Rectangle rectangle = new Rectangle(e.RowBounds.Location.X,
 
-                e.RowBounds.Location.Y,
 
-                dgvDirectoy.RowHeadersWidth - 4,
 
-                e.RowBounds.Height);
 
-             TextRenderer.DrawText(e.Graphics,
 
-                   (e.RowIndex + 1).ToString(),
 
-                    dgvDirectoy.RowHeadersDefaultCellStyle.Font,
 
-                    rectangle,
 
-                    dgvDirectoy.RowHeadersDefaultCellStyle.ForeColor,
 
-                    TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
 
-         }
 
-         private void rbAll_ValueChanged(object sender, bool value)
 
-         {
 
-             //if (rbAll.Checked)
 
-             //{
 
-             //    btnExport.Visible = false;
 
-             //    btnQueryHISDirectory_Click(null, new EventArgs());
 
-             //}
 
-             if (rbAll.Checked) btnExport.Visible = true;
 
-         }
 
-         private void rbMaped_CheckedChanged(object sender, EventArgs e)
 
-         {
 
-             //if (rbMaped.Checked)
 
-             //{
 
-             //    string errMsg;
 
-             //    if (queryHISDirectory(1, 50, out errMsg) != 0)
 
-             //    {
 
-             //        MessageBox.Show(errMsg);
 
-             //        return;
 
-             //    }
 
-             //}
 
-             if (rbMaped.Checked) btnExport.Visible = true;
 
-         }
 
-         private void btAddDir_Click(object sender, EventArgs e)
 
-         {
 
-             AddSingleDirectory addDirectory = new AddSingleDirectory(rbgDirecType.SelectedIndex);
 
-             if (addDirectory.ShowDialog() == DialogResult.OK)
 
-             {
 
-                 JObject joRtn = mIS.UpdateDirectoryBySelf(addDirectory.joPamam);
 
-                 string error = "";
 
-                 if (JsonHelper.parseIrisRtnValue(joRtn, out error) != 0)
 
-                 {
 
-                     MessageBox.Show("新增失败:" + error);
 
-                 }
 
-                 else
 
-                 {
 
-                     MessageBox.Show("新增成功");
 
-                 }
 
-             }
 
-         }
 
-         private void btEditDir_Click(object sender, EventArgs e)
 
-         {
 
-             DataTable dt = (DataTable)dgvDirectoy.DataSource;
 
-             if ((dt == null) || (dt.Rows.Count < 1))
 
-             {
 
-                 MessageBox.Show("表中无数据,请检查!");
 
-                 return;
 
-             }
 
-             DataRow dr = dt.Rows[dgvDirectoy.CurrentRow.Index];
 
-             AddSingleDirectory addDirectory = new AddSingleDirectory(rbgDirecType.SelectedIndex, dr);
 
-             if (addDirectory.ShowDialog() == DialogResult.OK)
 
-             {
 
-                 JObject joRtn = mIS.UpdateDirectoryBySelf(addDirectory.joPamam);
 
-                 string error = "";
 
-                 if (JsonHelper.parseIrisRtnValue(joRtn, out error) != 0)
 
-                 {
 
-                     MessageBox.Show("修改失败:" + error);
 
-                 }
 
-                 else
 
-                 {
 
-                     MessageBox.Show("修改成功");
 
-                 }
 
-             }
 
-         }
 
-         private void btnExit_Click(object sender, EventArgs e)
 
-         {
 
-             Close();
 
-         }
 
-         /// <summary>
 
-         /// 几个医保查询的交易组织入参
 
-         /// </summary>
 
-         /// <param name="Index"></param>
 
-         /// <param name="funNo"></param>
 
-         /// <returns></returns>
 
-         private JObject GetInput(int Index, out string funNo)
 
-         {
 
-             funNo = "";
 
-             dynamic joData = new JObject();
 
-             switch (Index)
 
-             {
 
-                 case 14://民族药品目
 
-                     {
 
-                         funNo = "1304";
 
-                         joData.med_list_codg = tbDirectoryCode.Text; //医疗目录编码
 
-                         joData.genname_codg = "";  //通用名编号
 
-                         joData.drug_genname = "";  //药品通用名
 
-                         joData.drug_prodname = tbDircetoryName.Text; //药品商品名
 
-                         joData.reg_name = "";      //注册名称
 
-                         joData.tcmherb_name = "";  //中草药名称
 
-                         joData.mlms_name = "";     //药材名称
 
-                         joData.vali_flag = "";     //有效标志
 
-                         joData.rid = "";           //唯一记录号
 
-                         joData.ver = "";           //版本号
 
-                         joData.ver_name = "";      //版本名称
 
-                         joData.opt_begn_time = ""; //经办开始时间
 
-                         joData.opt_end_time = "";  //经办结束时间
 
-                         joData.updt_time = TexDate.Text;  //更新时间
 
-                         joData.page_num = TexDQYS.Text;   //当前页数
 
-                         joData.page_size = TexBYSJL.Text; //本页数据量                        
 
-                         break;
 
-                     }
 
-                 case 15://目录信息查询
 
-                     {
 
-                         funNo = "1312";
 
-                         joData.query_date = ""; //查询时间点
 
-                         joData.hilist_code = tbDirectoryCode.Text;  //医保目录编码
 
-                         joData.insu_admdvs = "";  //参保机构医保区划
 
-                         joData.begndate = ""; //开始日期
 
-                         joData.hilist_name = tbDircetoryName.Text;      //医保目录名称
 
-                         joData.wubi = "";  //五笔助记码
 
-                         joData.pinyin = "";     //拼音助记码
 
-                         joData.med_chrgitm_type = "";     //医疗收费项目类别
 
-                         joData.chrgitm_lv = "";           //收费项目等级
 
-                         joData.lmt_used_flag = "";           //限制使用标志
 
-                         joData.list_type = "";      //目录类别
 
-                         joData.med_use_flag = ""; //医疗使用标志
 
-                         joData.matn_used_flag = "";  //生育使用标志
 
-                         joData.hilist_use_type = "";  //医保目录使用类别
 
-                         joData.lmt_cpnd_type = "";  //限复方使用类型
 
-                         joData.vali_flag = "";  //有效标志
 
-                         joData.updt_time = TexDate.Text;  //更新时间
 
-                         joData.page_num = TexDQYS.Text;   //当前页数
 
-                         joData.page_size = TexBYSJL.Text; //本页数据量
 
-                         break;
 
-                     }
 
-                 case 16://医疗与医保目录匹配
 
-                     {
 
-                         funNo = "1316";
 
-                         joData.query_date = "";         //查询时间点
 
-                         joData.medins_list_codg = "";   //定点医药机构目录编号
 
-                         joData.hilist_code = tbDirectoryCode.Text;        //医保目录编码
 
-                         joData.list_type = "";          //目录类别
 
-                         joData.insu_admdvs = "";        //参保机构医保区划
 
-                         joData.begndate = "";           //开始日期
 
-                         joData.vali_flag = "";          //有效标志
 
-                         joData.updt_time = TexDate.Text;  //更新时间
 
-                         joData.page_num = TexDQYS.Text;   //当前页数
 
-                         joData.page_size = TexBYSJL.Text; //本页数据量
 
-                         break;
 
-                     }
 
-                 case 17://医药机构目录匹配
 
-                     {
 
-                         funNo = "1317";
 
-                         joData.query_date = "";         //查询时间点
 
-                         joData.fixmedins_code = "";     //定点医药机构编号
 
-                         joData.medins_list_codg = "";   //定点医药机构目录编号
 
-                         joData.medins_list_name = "";   //定点医药机构目录名称
 
-                         joData.insu_admdvs = "";        //参保机构医保区划   
 
-                         joData.list_type = "";          //目录类别
 
-                         joData.med_list_codg = tbDirectoryCode.Text;      //医疗目录编码
 
-                         joData.begndate = "";           //开始日期
 
-                         joData.vali_flag = "";          //有效标志
 
-                         joData.updt_time = TexDate.Text;  //更新时间
 
-                         joData.page_num = TexDQYS.Text;   //当前页数
 
-                         joData.page_size = TexBYSJL.Text; //本页数据量
 
-                         break;
 
-                     }
 
-                 case 18://医保目录限价
 
-                     {
 
-                         funNo = "1318";
 
-                         joData.query_date = "";           //查询时间点
 
-                         joData.hilist_code = tbDirectoryCode.Text;          //医保目录编码
 
-                         joData.hilist_lmtpric_type = "";  //医保目录限价类型
 
-                         joData.overlmt_dspo_way = "";     //医保目录超限处理方式
 
-                         joData.insu_admdvs = "";          //参保机构医保区划
 
-                         joData.begndate = "";             //开始日期
 
-                         joData.enddate = "";              //结束日期
 
-                         joData.vali_flag = "";            //有效标志
 
-                         joData.rid = "";                  //唯一记录号
 
-                         joData.tabname = "";              //表名
 
-                         joData.poolarea_no = "";          //统筹区
 
-                         joData.updt_time = TexDate.Text;  //更新时间
 
-                         joData.page_num = TexDQYS.Text;   //当前页数
 
-                         joData.page_size = TexBYSJL.Text; //本页数据量
 
-                         break;
 
-                     }
 
-                 case 19://医保目录先自付比例
 
-                     {
 
-                         funNo = "1319";
 
-                         joData.query_date = "";           //查询时间点
 
-                         joData.hilist_code = tbDirectoryCode.Text;          //医保目录编码
 
-                         joData.selfpay_prop_psn_type = "";//医保目录自付比例人员类别
 
-                         joData.selfpay_prop_type = "";    //目录自付比例类别
 
-                         joData.insu_admdvs = "";          //参保机构医保区划
 
-                         joData.begndate = "";             //开始日期
 
-                         joData.enddate = "";              //结束日期
 
-                         joData.vali_flag = "";            //有效标志
 
-                         joData.rid = "";                  //唯一记录号
 
-                         joData.tabname = "";              //表名
 
-                         joData.poolarea_no = "";          //统筹区
 
-                         joData.updt_time = TexDate.Text;  //更新时间
 
-                         joData.page_num = TexDQYS.Text;   //当前页数
 
-                         joData.page_size = TexBYSJL.Text; //本页数据量
 
-                         break;
 
-                     }
 
-                 case 20://医药机构信息
 
-                     {
 
-                         funNo = "1201";
 
-                         joData.fixmedins_type = "1"; //定点医疗服务机构类型 1定点医疗机构,2定点零售药店,3工伤定点康复机构,4辅助器具配置机构,5计划生育服务机构
 
-                         joData.fixmedins_name = TexYYMC.Text;  //定点医药机构名称 
 
-                         joData.fixmedins_code = "";  //定点医药机构编号 
 
-                         break;
 
-                     }
 
-             }
 
-             return joData;
 
-         }
 
-         private void chek_UporCancel_CheckedChanged(object sender, EventArgs e)
 
-         {
 
-   
 
-         }
 
-         private void uiButton1_Click(object sender, EventArgs e)
 
-         {
 
-             Close();
 
-         }
 
-         private void btnUpShip_Click(object sender, EventArgs e)
 
-         {
 
-             AllUpLoad();
 
-         }
 
-         private void btnCancelUpShip_Click(object sender, EventArgs e)
 
-         {
 
-             AllCancelUpload();
 
-         }
 
-         /// <summary>
 
-         /// 单条上传目录对照关系
 
-         /// </summary>
 
-         private void SingleUpload()
 
-         {
 
-             if ((dgvHISDirectory.CurrentRow == null) || (rbMaped.Checked != true))
 
-             {
 
-                 MessageBox.Show("请查询HIS目录对照关系");
 
-                 return;
 
-             }
 
-             string errorMsg = "", sMLLX = "";
 
-             //单条目录对照关系上传
 
-             int iHis = dgvHISDirectory.CurrentRow.Index;
 
-             DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
 
-             int hisType = rbgDirecType_C.SelectedIndex + 1;  //1药品 2诊疗 3材料
 
-             //string hisTypeName = rbgDirecType_C.Items[hisType - 1].ToString(); 
 
-             if (hisType == 1)
 
-             {
 
-                 sMLLX = "101"; //101西药中成药 102中药饮片 103自制剂 104民族药 201医疗服务项目 301医用耗材 501长护服务项目 105其他 
 
-             }
 
-             else if (hisType == 2)
 
-             {
 
-                 sMLLX = "201";
 
-             }
 
-             else if (hisType == 3)
 
-             {
 
-                 sMLLX = "301";
 
-             }
 
-             string InsuCode = dtHis.Rows[iHis]["InsuCode"].ToString();
 
-             string InsuName = dtHis.Rows[iHis]["InsuName"].ToString();
 
-             string HisCode = dtHis.Rows[iHis]["itemCode"].ToString();
 
-             string HisName = dtHis.Rows[iHis]["itemDesc"].ToString();
 
-             string UpdateDate = DateTime.Now.ToString("yyyy-MM-dd");
 
-             //调用3301目录对照上传
 
-             JObject joData = new JObject();
 
-             joData.Add("fixmedins_hilist_id", HisCode);
 
-             joData.Add("fixmedins_hilist_name", HisName);
 
-             joData.Add("list_type", sMLLX);            //目录类别
 
-             joData.Add("med_list_codg", InsuCode);     //医疗目录编码
 
-             joData.Add("begndate", "2022-10-01");      //开始日期
 
-             joData.Add("enddate", UpdateDate);         //结束日期
 
-             joData.Add("aprvno", "");
 
-             joData.Add("dosform", "");
 
-             joData.Add("exct_cont", "");
 
-             joData.Add("item_cont", "");
 
-             joData.Add("prcunt", "");
 
-             joData.Add("spec", "");
 
-             joData.Add("pacspec", "");
 
-             joData.Add("memo", "");
 
-             JObject joInput = new JObject();
 
-             joInput.Add("data", joData);
 
-             InvokeHelper invoker = new InvokeHelper();
 
-             JObject joRtn = invoker.invokeCenterService("3301", JsonHelper.setCenterInpar("3301", joInput));
 
-             if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
 
-             {
 
-                 MessageBox.Show("目录对照关系上传失败:" + errorMsg);
 
-             }
 
-             else
 
-             {
 
-                 MessageBox.Show("目录对照关系上传成功!");
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// 单条撤销目录对照关系上传
 
-         /// </summary>
 
-         private void SingleCancelUpload()
 
-         {
 
-             if ((dgvHISDirectory.CurrentRow == null) || (rbMaped.Checked != true))
 
-             {
 
-                 MessageBox.Show("请查询HIS目录对照关系");
 
-                 return;
 
-             }
 
-             string errorMsg = "", sMLLX = "";
 
-             //撤销目录对照关系
 
-             DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
 
-             int iHis = dgvHISDirectory.CurrentRow.Index;
 
-             string InsuCode = dtHis.Rows[iHis]["InsuCode"].ToString();
 
-             string HisCode = dtHis.Rows[iHis]["HisCode"].ToString();
 
-             int hisType = rbgDirecType_C.SelectedIndex + 1;  //1药品 2诊疗 3材料
 
-             //string hisTypeName = rbgDirecType_C.Items[hisType - 1].ToString(); 
 
-             if (hisType == 1)
 
-             {
 
-                 sMLLX = "101"; //101西药中成药 102中药饮片 103自制剂 104民族药 201医疗服务项目 301医用耗材 501长护服务项目 105其他 
 
-             }
 
-             else if (hisType == 2)
 
-             {
 
-                 sMLLX = "201";
 
-             }
 
-             else if (hisType == 3)
 
-             {
 
-                 sMLLX = "301";
 
-             }
 
-             //调用3302目录对照撤销
 
-             JObject joData = new JObject();
 
-             joData.Add("fixmedins_code", Global.inf.hospitalNO);
 
-             joData.Add("fixmedins_hilist_id", HisCode);
 
-             joData.Add("list_type", sMLLX);            //目录类别
 
-             joData.Add("med_list_codg", InsuCode);     //医疗目录编码          
 
-             JObject joInput = new JObject();
 
-             joInput.Add("data", joData);
 
-             InvokeHelper invoker = new InvokeHelper();
 
-             JObject joRtn = invoker.invokeCenterService("3302", JsonHelper.setCenterInpar("3302", joInput));
 
-             if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
 
-             {
 
-                 MessageBox.Show("目录对照撤销失败:" + errorMsg);
 
-             }
 
-             else
 
-             {
 
-                 MessageBox.Show("目录对照撤销成功!");
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// 全部上传目录对照关系
 
-         /// </summary>
 
-         private void AllUpLoad()
 
-         {
 
-             
 
-             if ((dgvHISDirectory.CurrentRow == null) || (rbMaped.Checked != true))
 
-             {
 
-                 MessageBox.Show("请查询HIS目录对照关系");
 
-                 return;
 
-             }
 
-             string sInputStr = "", sMLLX = "", errorMsg = "", Msg = "";
 
-             Boolean bOk = true;
 
-             JObject InputjoRtn = new JObject();
 
-             string UpdateDate = DateTime.Now.ToString("yyyy-MM-dd");
 
-             int hisType = rbgDirecType_C.SelectedIndex + 1;  //1药品 2诊疗 3材料
 
-             if (hisType == 1)
 
-             {
 
-                 sMLLX = "101"; //101西药中成药 102中药饮片 103自制剂 104民族药 201医疗服务项目 301医用耗材 501长护服务项目 105其他 
 
-             }
 
-             else if (hisType == 2)
 
-             {
 
-                 sMLLX = "201";
 
-             }
 
-             else if (hisType == 3)
 
-             {
 
-                 sMLLX = "301";
 
-             }
 
-             DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
 
-             for (int i = 0; i < dtHis.Rows.Count; i++)
 
-             {                
 
-                 string InsuCode = dtHis.Rows[i]["InsuCode"].ToString();  //医保目录编码
 
-                 string InsuName = dtHis.Rows[i]["InsuName"].ToString();  //医保目录名称
 
-                 string HisCode = dtHis.Rows[i]["itemCode"].ToString();   //HIS目录编码
 
-                 string HisName = dtHis.Rows[i]["itemDesc"].ToString();   //HIS目录名称
 
-                 //调用3301目录对照上传
 
-                 JObject joData = new JObject();
 
-                 joData.Add("fixmedins_hilist_id", HisCode);
 
-                 joData.Add("fixmedins_hilist_name", HisName);
 
-                 joData.Add("list_type", sMLLX);            //目录类别
 
-                 joData.Add("med_list_codg", InsuCode);     //医疗目录编码
 
-                 joData.Add("begndate", "2022-10-01");      //开始日期
 
-                 joData.Add("enddate", UpdateDate);         //结束日期
 
-                 joData.Add("aprvno", "");
 
-                 joData.Add("dosform", "");
 
-                 joData.Add("exct_cont", "");
 
-                 joData.Add("item_cont", "");
 
-                 joData.Add("prcunt", "");
 
-                 joData.Add("spec", "");
 
-                 joData.Add("pacspec", "");
 
-                 joData.Add("memo", "");
 
-                 JObject joInput = new JObject();
 
-                 joInput.Add("data", joData);
 
-                 InvokeHelper invoker = new InvokeHelper();
 
-                 JObject joRtn = invoker.invokeCenterService("3301", JsonHelper.setCenterInpar("3301", joInput));
 
-                 if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
 
-                 {
 
-                     bOk = false;                    
 
-                     Msg = Msg + "<" + joInput.ToString() + ":" + errorMsg + ">";
 
-                 }
 
-             }
 
-             if (bOk == false)
 
-             {
 
-                 MessageBox.Show("全部目录对照关系上传成功,部分上传异常:" + Msg);
 
-             }
 
-             else
 
-             {
 
-                 MessageBox.Show("全部目录对照关系上传成功!");
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// 全部撤销目录对照关系上传
 
-         /// </summary>
 
-         private void AllCancelUpload()
 
-         {
 
-             if ((dgvHISDirectory.CurrentRow == null) || (rbMaped.Checked != true))
 
-             {
 
-                 MessageBox.Show("请查询HIS目录对照关系");
 
-                 return;
 
-             }
 
-             string sMLLX = "", errorMsg = "", Msg = "";
 
-             Boolean bOk = true;
 
-             string UpdateDate = DateTime.Now.ToString("yyyy-MM-dd");
 
-             int hisType = rbgDirecType_C.SelectedIndex + 1;  //1药品 2诊疗 3材料
 
-             if (hisType == 1)
 
-             {
 
-                 sMLLX = "101"; //101西药中成药 102中药饮片 103自制剂 104民族药 201医疗服务项目 301医用耗材 501长护服务项目 105其他 
 
-             }
 
-             else if (hisType == 2)
 
-             {
 
-                 sMLLX = "201";
 
-             }
 
-             else if (hisType == 3)
 
-             {
 
-                 sMLLX = "301";
 
-             }
 
-             DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;                  
 
-             for (int i = 0; i < dtHis.Rows.Count; i++)
 
-             {                
 
-                 string InsuCode = dtHis.Rows[i]["InsuCode"].ToString();
 
-                 string HisCode = dtHis.Rows[i]["HisCode"].ToString();
 
-                 //调用3302目录对照撤销
 
-                 JObject joData = new JObject();
 
-                 joData.Add("fixmedins_code", Global.inf.hospitalNO);
 
-                 joData.Add("fixmedins_hilist_id", HisCode);
 
-                 joData.Add("list_type", sMLLX);            //目录类别
 
-                 joData.Add("med_list_codg", InsuCode);     //医疗目录编码          
 
-                 JObject joInput = new JObject();
 
-                 joInput.Add("data", joData);
 
-                 InvokeHelper invoker = new InvokeHelper();
 
-                 JObject joRtn = invoker.invokeCenterService("3302", JsonHelper.setCenterInpar("3302", joInput));
 
-                 if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
 
-                 {
 
-                     bOk = false;
 
-                     Msg = Msg + "<" + joInput.ToString()+":" + errorMsg + ">";
 
-                 }
 
-             }
 
-             if (bOk == false)
 
-             {
 
-                 MessageBox.Show("全部撤销目录对照关系上传成功,部分撤销异常:" + Msg);
 
-             }
 
-             else
 
-             {
 
-                 MessageBox.Show("全部撤销目录对照关系上传成功!");
 
-             }
 
-         }
 
-         private void ToolStripMenuItem_Upload_Click(object sender, EventArgs e)
 
-         {
 
-             SingleUpload();
 
-         }
 
-         private void ToolStripMenuItem_CancelUpload_Click(object sender, EventArgs e)
 
-         {
 
-             SingleCancelUpload();
 
-         }
 
-         private void rbgDirecType_C_ValueChanged(object sender, int index, string text)
 
-         {
 
-             tbHISDirectoryFilter.Text = "";
 
-             uiTextBox1.Text = "";
 
-             rbAll.Checked = true;
 
-             rbMaped.Checked = false;
 
-             rbNoMaped.Checked = false;
 
-             tbCenterDirectoryFilter.Text = "";
 
-             tbInsuCode.Text = "";
 
-             tbApprovalNO.Text = "";
 
-             dgvCenterDirectory.DataSource = null;
 
-             btnQueryHISDirectory_Click(null, new EventArgs());
 
-         }
 
-         private void btnExport_Click(object sender, EventArgs e)
 
-         {
 
-             //if (rbAll.Checked) return;
 
-             if (queryHISDirectory(1, 5000, out string errMsg) != 0)
 
-             {
 
-                 MessageBox.Show(errMsg);
 
-                 return;
 
-             }
 
-             if (dtExport.Rows.Count > 0)
 
-             {
 
-                 string Maped = "";
 
-                 if (rbAll.Checked) Maped = "全部";
 
-                 if (rbMaped.Checked) Maped = "已对照";
 
-                 if (rbNoMaped.Checked) Maped = "未对照";
 
-                 string directoryType = string.Empty;
 
-                 switch (rbgDirecType_C.SelectedIndex)
 
-                 {
 
-                     case 0:
 
-                         {
 
-                             directoryType = "药品";
 
-                             break;
 
-                         }
 
-                     case 1:
 
-                         {
 
-                             directoryType = "诊疗";
 
-                             break;
 
-                         }
 
-                     case 2:
 
-                         {
 
-                             directoryType = "材料";
 
-                             break;
 
-                         }
 
-                 }
 
-                 string LSH = DateTime.Now.ToString("yyyyMMddHHMMss"); //DateTime.Now.ToString("MMddHHmmssffff");
 
-                 string sFliePathName = @"D:\" + LSH +"【"+ directoryType + "】医保目录【"+ Maped + "】信息.xls";
 
-                 string ReturnFileName = ExportToExcel.DataTabletoExcel(dtExport, sFliePathName);
 
-                 if (ReturnFileName != "")
 
-                 {
 
-                     MessageBox.Show("导出成功,文件保存路径:【" + ReturnFileName + "】");
 
-                     System.Diagnostics.Process.Start(ReturnFileName); //打开excel文件                
 
-                 }
 
-                 else
 
-                 {
 
-                     MessageBox.Show("导出失败!");
 
-                 }
 
-             }
 
-         }
 
-         private void dgvCenterDirectory_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 
-         {
 
-             Rectangle rectangle = new Rectangle(e.RowBounds.Location.X,
 
-             e.RowBounds.Location.Y,
 
-             dgvCenterDirectory.RowHeadersWidth - 4,
 
-             e.RowBounds.Height);
 
-             TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
 
-             dgvCenterDirectory.RowHeadersDefaultCellStyle.Font,
 
-             rectangle,
 
-             dgvCenterDirectory.RowHeadersDefaultCellStyle.ForeColor,
 
-             TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
 
-         }
 
-         private void rbNoMaped_CheckedChanged(object sender, EventArgs e)
 
-         {
 
-             //if (rbNoMaped.Checked)
 
-             //{
 
-             //    string errMsg;
 
-             //    if (queryHISDirectory(1, 300, out errMsg) != 0)
 
-             //    {
 
-             //        MessageBox.Show(errMsg);
 
-             //        return;
 
-             //    }
 
-             //}
 
-             if (rbNoMaped.Checked) btnExport.Visible = true;
 
-         }
 
-     }
 
- }
 
 
  |