BasicData.cs 92 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401
  1. using Newtonsoft.Json;
  2. using Newtonsoft.Json.Linq;
  3. using PTMedicalInsurance.Business;
  4. using PTMedicalInsurance.Helper;
  5. using PTMedicalInsurance.Variables;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.IO;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Threading.Tasks;
  15. using System.Windows.Forms;
  16. using PTMedicalInsurance.FormSetter;
  17. using PTMedicalInsurance.Common;
  18. namespace PTMedicalInsurance.Forms
  19. {
  20. public partial class BasicData : Form
  21. {
  22. //设置实例
  23. CenterBusiness cBus = new CenterBusiness();
  24. HisMainBusiness hBus = new HisMainBusiness();
  25. HisIrisServices hIS = new HisIrisServices();
  26. MIIrisServices mIS = new MIIrisServices();
  27. InvokeHelper invoker = new InvokeHelper();
  28. InsuServices Iis = new InsuServices();
  29. //1.声明自适应类实例
  30. AutoResizeForm asc = new AutoResizeForm();
  31. public JObject joSelectedInsuInfo;
  32. public int insuInfoIndex = 0;
  33. public int idInfoIndex = 0;
  34. int currentPageIndex = 0;
  35. DataTable dtExport;
  36. public BasicData()
  37. {
  38. InitializeComponent();
  39. rbgDirecType.SelectedIndex = 0;
  40. rbgDirecType_C.SelectedIndex = 0;
  41. rbSingleDown.Checked = true;
  42. rbOnlyName.Checked = true;
  43. this.rbgDirecType.ValueChanged += new Sunny.UI.UIRadioButtonGroup.OnValueChanged(this.rbgDirecType_ValueChanged);
  44. this.pgDownload.PageChanged += new Sunny.UI.UIPagination.OnPageChangeEventHandler(this.pgDownload_PageChanged);
  45. this.pgCenterDirect.PageChanged += new Sunny.UI.UIPagination.OnPageChangeEventHandler(this.pgCenterDirect_PageChanged);
  46. Font rowFont = new Font("UTF-8", 8);
  47. Font columnFont = new Font("UTF-8", 9);
  48. rbgDirecType.SelectedIndex = 8;
  49. rbAll.Checked = true;
  50. //tabControl1.SelectedIndex = 1;
  51. //this.StartPosition = FormStartPosition.CenterParent;
  52. asc.controllInitializeSize(this);
  53. asc.controlAutoSize(this);
  54. TextCbd.Text = Global.inf.areaCode;
  55. }
  56. #region 函数封装
  57. private void queryInsuDirectory(int currentPage, int pageSize, int directoryType, int interfaceDr, string code)
  58. {
  59. try
  60. {
  61. string dirCode = "";
  62. string dirName = "";
  63. string approvalNO = "";
  64. string DosageForm = "";
  65. string Specifications = "";
  66. string manufacturers = "";
  67. Sunny.UI.UIDataGridView dgv;
  68. Sunny.UI.UIPagination pg;
  69. if (tabControl1.SelectedIndex == 0)
  70. {
  71. dirCode = tbDirectoryCode.Text;
  72. dirName = tbDircetoryName.Text;
  73. approvalNO = "";
  74. dgv = dgvDirectoy;
  75. pg = pgDownload;
  76. }
  77. else
  78. {
  79. dirName = tbCenterDirectoryFilter.Text;
  80. dirCode = tbInsuCode.Text;
  81. dgv = dgvCenterDirectory;
  82. approvalNO = tbApprovalNO.Text;
  83. pg = pgCenterDirect;
  84. manufacturers = tbManufacturer.Text;
  85. DosageForm = tbDosageForm.Text;
  86. Specifications = tbSpecifications.Text;
  87. }
  88. JObject joInput = new JObject {
  89. { "currentPage" , currentPage },
  90. { "pageSize" , pageSize },
  91. { "serviceCode" , code },
  92. { "directoryType" , directoryType },
  93. { "directoryCode" , dirCode },
  94. { "directoryName" , dirName },
  95. { "approvalNO" , approvalNO },
  96. { "dosageForm" , DosageForm },
  97. { "specifications" , Specifications },
  98. { "manufacturers" , manufacturers },
  99. { "directoryDr" , interfaceDr }
  100. };
  101. JObject joRtn = mIS.getMIDirectoryByPagination(joInput);
  102. if (joRtn["errorCode"].ToString() != "0")
  103. {
  104. MessageBox.Show("IRIS数据返回错误:" + joRtn["errorMessage"].ToString());
  105. return;
  106. }
  107. if (joRtn["result"]["rows"] == null)
  108. {
  109. MessageBox.Show("该节点不存在");
  110. return;
  111. }
  112. if (joRtn["result"]["total"].ToString() == "0")
  113. {
  114. MessageBox.Show("未查询到数据");
  115. dgv.DataSource = null;
  116. return;
  117. }
  118. DataTable dt = (DataTable)joRtn["result"]["rows"].ToObject(typeof(DataTable));
  119. int totalCount = int.Parse(joRtn["result"]["total"].ToString());
  120. pg.TotalCount = totalCount;
  121. pg.PageSize = pageSize;
  122. dgv.DataSource = dt;
  123. dgv.Columns[0].ReadOnly = true;
  124. }
  125. catch (Exception ex)
  126. {
  127. MessageBox.Show("查询异常:" + ex.Message);
  128. }
  129. }
  130. private void setHeaderTxt(int directoryType, Sunny.UI.UIDataGridView dgv)
  131. {
  132. GridViewSetter gvdSetter = new GridViewSetter();
  133. switch (directoryType)
  134. {
  135. case 0://药品
  136. {
  137. gvdSetter.SetHeaderTextOfDrug(dgv);
  138. break;
  139. }
  140. case 1://诊疗
  141. {
  142. gvdSetter.SetHeaderTextOfMedicalService(dgv);
  143. break;
  144. }
  145. case 2://材料
  146. {
  147. gvdSetter.SetHeaderTextOfMaterials(dgv);
  148. break;
  149. }
  150. case 3://疾病诊断
  151. {
  152. gvdSetter.SetHeaderTextOfDiagnose(dgv);
  153. break;
  154. }
  155. case 4://手术
  156. {
  157. gvdSetter.SetHeaderTextOfDiagnose(dgv);
  158. break;
  159. }
  160. case 5://慢性病
  161. {
  162. gvdSetter.SetHeaderTextOfDiagnose(dgv);
  163. break;
  164. }
  165. case 6://DRGs
  166. {
  167. gvdSetter.SetHeaderTextOfDiagnose(dgv);
  168. break; ;
  169. }
  170. case 7://日间手术
  171. {
  172. gvdSetter.SetHeaderTextOfDiagnose(dgv);
  173. break; ;
  174. }
  175. case 8://字典表
  176. {
  177. gvdSetter.SetHeaderTextOfDictionary(dgv);
  178. break;
  179. }
  180. case 9://中药饮片下载
  181. {
  182. gvdSetter.SetHeaderTextOfChineseMedicine(dgv);
  183. break;
  184. }
  185. case 10://医药机构制剂目录下载
  186. {
  187. gvdSetter.SetHeaderTextOfPreparation(dgv);
  188. break;
  189. }
  190. case 11://肿瘤形态学下载
  191. {
  192. gvdSetter.SetHeaderTextOfTumorMorphology(dgv);
  193. break;
  194. }
  195. case 12:
  196. {
  197. //中医疾病下载
  198. gvdSetter.GetChineseDiagnoseJsonByTxt(dgv);
  199. // ICPC3
  200. //gvdSetter.SetICPCAdmReasonHeader(dgv);
  201. break;
  202. }
  203. case 13:
  204. {
  205. //中医证候下载
  206. gvdSetter.GetTCMSyndromeJsonByTxt(dgv);
  207. // ICPC3
  208. //gvdSetter.SetICPCTreatmentHeader(dgv);
  209. break;
  210. }
  211. case 14://民族药品
  212. {
  213. gvdSetter.GetEthnicMedicineJsonByTxt(dgv);
  214. break;
  215. }
  216. case 15://目录信息查询
  217. {
  218. gvdSetter.GetMedInsuCatalogJsonByTxt(dgv);
  219. break;
  220. }
  221. case 16://医疗与医保目录匹配关系查询
  222. {
  223. gvdSetter.GetMedInsuCorrespondencJsonByTxt(dgv);
  224. break;
  225. }
  226. case 17://医药机构目录匹配查询
  227. {
  228. gvdSetter.GetMedInstCorrespondencJsonByTxt(dgv);
  229. break;
  230. }
  231. case 18://医保目录限价查询
  232. {
  233. gvdSetter.GetMedInsuFixedPriceJsonByTxt(dgv);
  234. break;
  235. }
  236. case 19://医保目录先自付比例下载
  237. {
  238. gvdSetter.GetMedInsuFirstPayProportionJsonByTxt(dgv);
  239. break;
  240. }
  241. case 20://医药机构信息
  242. {
  243. gvdSetter.GetMedicalInstitutionJsonByTxt(dgv);
  244. break;
  245. }
  246. }
  247. gvdSetter.DatagridviewColumnWidthAdaptation(dgv);
  248. }
  249. private void queryHISInsuDirectory(int directoryType, int pageIndex, int count, Sunny.UI.UIDataGridView dgv, int interfaceDr)
  250. {
  251. string code = "09010042";
  252. if (tabControl1.SelectedIndex == 0)
  253. {
  254. if (rbgDirecType.SelectedIndex == 20)
  255. {
  256. code = "090100XX";
  257. }
  258. else if (rbgDirecType.SelectedIndex == 8)
  259. {
  260. code = "09010043";
  261. }
  262. else
  263. {
  264. code = "09010042";
  265. }
  266. if (rbgDirecType.SelectedIndex <= 13)
  267. {
  268. queryInsuDirectory(pageIndex, count, directoryType + 1, interfaceDr, code);
  269. setHeaderTxt(directoryType, dgv);
  270. }
  271. else //几个医保查询该部分数据不存数据库只是临时查询(除医疗机构信息查询外)
  272. {
  273. //生成DataView列
  274. //setHeaderTxt(directoryType, dgv);
  275. string pages, recordCounts, errorMessage, sOutpar;
  276. dynamic joData = GetInput(rbgDirecType.SelectedIndex, out TradeEnum trade);
  277. JObject joRtn = cBus.InvokeMedicalInsuranceInquiry(trade, joData);
  278. if (joRtn["infcode"].ToString() == "0")
  279. {
  280. try
  281. {
  282. Sunny.UI.UIPagination pg;
  283. dgv = dgvDirectoy;
  284. pg = pgDownload;
  285. DataTable dt;
  286. if (rbgDirecType.SelectedIndex == 20)
  287. {
  288. dt = (DataTable)joRtn["output"]["medinsinfo"].ToObject(typeof(DataTable));
  289. if (joRtn["output"]["medinsinfo"].ToString() == "")
  290. {
  291. MessageBox.Show("查询成功,但返回结果集为空!");
  292. //return;
  293. }
  294. pg.TotalCount = 50;
  295. pg.PageSize = 50;
  296. }
  297. else
  298. {
  299. pages = joRtn["output"]["pages"].ToString(); //页数
  300. recordCounts = joRtn["output"]["recordCounts"].ToString(); //总记录条数
  301. dt = (DataTable)joRtn["output"]["data"].ToObject(typeof(DataTable));
  302. if (recordCounts == "0")
  303. {
  304. MessageBox.Show("查询成功,但返回结果集为空!");
  305. //return;
  306. }
  307. pg.TotalCount = int.Parse(recordCounts);
  308. pg.PageSize = int.Parse(TexBYSJL.Text); //int.Parse(pages);
  309. }
  310. dgv.DataSource = dt;
  311. dgv.Columns[0].ReadOnly = true;
  312. }
  313. catch (Exception ex)
  314. {
  315. MessageBox.Show("查询异常:" + ex.Message);
  316. }
  317. }
  318. else
  319. {
  320. errorMessage = "调用交易" + trade.GetCode() + "出现错误,请查看日志!"; //joImportRtn["errorMessage"].ToString();
  321. MessageBox.Show(errorMessage);
  322. return;
  323. }
  324. }
  325. }
  326. else
  327. {
  328. queryInsuDirectory(pageIndex, count, directoryType + 1, interfaceDr, code);
  329. setHeaderTxt(directoryType, dgv);
  330. }
  331. GridViewSetter gridSetter = new GridViewSetter();
  332. gridSetter.DatagridviewColumnWidthAdaptation(dgvCenterDirectory);
  333. }
  334. private int queryHISDirectory(int currentPage, int pageSize, out string errMsg)
  335. {
  336. errMsg = "";
  337. string directoryType = string.Empty;
  338. switch (rbgDirecType_C.SelectedIndex)
  339. {
  340. case 0:
  341. {
  342. directoryType = "drugs";
  343. break;
  344. }
  345. case 1:
  346. {
  347. directoryType = "diagnosi";
  348. break;
  349. }
  350. case 2:
  351. {
  352. directoryType = "consumables";
  353. break;
  354. }
  355. }
  356. JObject joHISRtn = new JObject();
  357. JObject joRtn = new JObject();
  358. InvokeHelper invoker = new InvokeHelper();
  359. string flag = "";
  360. //全部是先调HIS,然后再匹配医保平台的对照关系
  361. if (rbAll.Checked)
  362. {
  363. JArray jaPagination = new JArray();
  364. JArray jaParams = new JArray();
  365. flag = "All";
  366. dynamic joParam = new JObject();
  367. joParam.code = "";
  368. joParam.descripts = "";
  369. joParam.FindType = new JArray();
  370. joParam.TypeID = "";
  371. joParam.alias = tbHISDirectoryFilter.Text;
  372. joParam.include = "Hosp";
  373. joParam.groupID = "324";
  374. joParam.hospID = Global.inf.hisHospitalDr;
  375. joParam.interfaceDr = Global.inf.interfaceDr;
  376. joParam.type = directoryType;
  377. joParam.flag = flag;
  378. joParam.specInput = txtSpecFilter.Text.Trim();
  379. jaParams.Add(joParam);
  380. dynamic joPagination = new JObject();
  381. joPagination.pageSize = pageSize;
  382. //joPagination.pageSize = 2;
  383. joPagination.currentPage = currentPage;
  384. joPagination.sortColumn = "Code";
  385. joPagination.sortOrder = "asc";
  386. jaPagination.Add(joPagination);
  387. //该服务需要改写,需要跟(CloudMedicalInsurancePlatform.Tables.MapRelation)进行关联
  388. //joInParams.code = "09010038";
  389. if (hIS.getHISDir(jaPagination, jaParams, out joHISRtn, out errMsg) != 0)
  390. {
  391. return -1;
  392. }
  393. joRtn = mIS.ConvertHISDir(joHISRtn);
  394. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  395. {
  396. return -1;
  397. }
  398. }
  399. //已对照是先调云医保,然后再匹配HIS
  400. if (rbMaped.Checked)
  401. {
  402. JArray jaPagination = new JArray();
  403. JArray jaParams = new JArray();
  404. flag = "Maped";
  405. dynamic joParam = new JObject();
  406. joParam.alias = tbHISDirectoryFilter.Text;
  407. joParam.HospitalDr = Global.inf.hospitalDr;
  408. joParam.InterfaceDr = Global.inf.interfaceDr;
  409. joParam.hisType = directoryType;
  410. jaParams.Add(joParam);
  411. dynamic joPagination = new JObject();
  412. joPagination.pageSize = pageSize;
  413. joPagination.currentPage = currentPage;
  414. joPagination.sortColumn = "HisCode";
  415. joPagination.sortOrder = "asc";
  416. jaPagination.Add(joPagination);
  417. JObject joMIRtn = mIS.GetMappedHISDir(jaPagination, jaParams);
  418. if (JsonHelper.parseIrisRtnValue(joMIRtn, out errMsg) != 0)
  419. {
  420. return -1;
  421. }
  422. //传给HIS,进行匹配
  423. joParam = new JObject();
  424. joParam.TotalCount = joMIRtn["result"]["TotalCount"];
  425. joParam.type = directoryType;
  426. joParam.flag = flag;
  427. joParam.hospID = Global.inf.hisHospitalDr;
  428. joParam.interfaceDr = Global.inf.interfaceDr;
  429. joParam.alias = tbHISDirectoryFilter.Text;
  430. joParam.include = "Hosp";
  431. joParam.groupID = "324";
  432. joParam.compareArr = joMIRtn["result"]["Data"];
  433. jaParams = new JArray();
  434. jaParams.Add(joParam);
  435. if (hIS.getHISDir(jaPagination, jaParams, out joRtn, out errMsg) != 0)
  436. {
  437. return -1;
  438. }
  439. }
  440. //if (rbNoMaped.Checked) { flag = "NoMaped"; }
  441. if (rbNoMaped.Checked)
  442. {
  443. JArray jaPagination = new JArray();
  444. JArray jaParams = new JArray();
  445. flag = "All";
  446. dynamic joParam = new JObject();
  447. joParam.code = "";
  448. joParam.descripts = "";
  449. joParam.FindType = new JArray();
  450. joParam.TypeID = "";
  451. joParam.alias = tbHISDirectoryFilter.Text;
  452. joParam.include = "Hosp";
  453. joParam.groupID = "324";
  454. joParam.hospID = Global.inf.hisHospitalDr;
  455. joParam.interfaceDr = Global.inf.interfaceDr;
  456. joParam.type = directoryType;
  457. joParam.flag = flag;
  458. joParam.specInput = "";
  459. jaParams.Add(joParam);
  460. dynamic joPagination = new JObject();
  461. joPagination.pageSize = pageSize;
  462. //joPagination.pageSize = 2;
  463. joPagination.currentPage = currentPage;
  464. joPagination.sortColumn = "Code";
  465. joPagination.sortOrder = "asc";
  466. jaPagination.Add(joPagination);
  467. //1.获取全部HIS目录
  468. if (hIS.getHISDir(jaPagination, jaParams, out joHISRtn, out errMsg) != 0)
  469. {
  470. return -1;
  471. }
  472. joRtn = mIS.GetNoMappHISDir(joHISRtn);
  473. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  474. {
  475. return -1;
  476. }
  477. }
  478. DataTable dt = (DataTable)joRtn["result"]["Data"].ToObject(typeof(DataTable));
  479. dtExport = dt;
  480. int totalCount = int.Parse(joRtn["result"]["TotalCount"].ToString());
  481. pgHISDirect.TotalCount = totalCount;
  482. //if (rbNoMaped.Checked)
  483. // pgHISDirect.PageSize = pageSize;
  484. //else
  485. // pgHISDirect.PageSize = 50;
  486. pgHISDirect.PageSize = pageSize;
  487. dgvHISDirectory.DataSource = null;
  488. dgvHISDirectory.DataSource = dt;
  489. dgvHISDirectory.Columns[0].ReadOnly = true;
  490. GridViewSetter gridSetter = new GridViewSetter();
  491. gridSetter.SetHeaderTextOfMapping_HisDirectory(dgvHISDirectory);
  492. gridSetter.DatagridviewColumnWidthAdaptation(dgvHISDirectory);
  493. return 0;
  494. }
  495. private int queryMapeDirectory(int currentPage, int pageSize, out string errMsg)
  496. {
  497. errMsg = "";
  498. string directoryType = string.Empty;
  499. switch (rbgDirecType_C.SelectedIndex)
  500. {
  501. case 0:
  502. {
  503. directoryType = "drugs";
  504. break;
  505. }
  506. case 1:
  507. {
  508. directoryType = "diagnosi";
  509. break;
  510. }
  511. case 2:
  512. {
  513. directoryType = "consumables";
  514. break;
  515. }
  516. }
  517. JObject joHISRtn = new JObject();
  518. JObject joRtn = new JObject();
  519. InvokeHelper invoker = new InvokeHelper();
  520. string flag = "";
  521. JArray jaPagination = new JArray();
  522. JArray jaParams = new JArray();
  523. flag = "Maped";
  524. dynamic joParam = new JObject();
  525. joParam.alias = tbHISDirectoryFilter.Text;
  526. joParam.HospitalDr = Global.inf.hospitalDr;
  527. joParam.InterfaceDr = Global.inf.interfaceDr;
  528. joParam.hisType = directoryType;
  529. jaParams.Add(joParam);
  530. dynamic joPagination = new JObject();
  531. joPagination.pageSize = 3000;
  532. joPagination.currentPage = 1;
  533. joPagination.sortColumn = "HisCode";
  534. joPagination.sortOrder = "asc";
  535. jaPagination.Add(joPagination);
  536. JObject joMIRtn = mIS.GetMappedHISDir(jaPagination, jaParams);
  537. if (JsonHelper.parseIrisRtnValue(joMIRtn, out errMsg) != 0)
  538. {
  539. return -1;
  540. }
  541. //传给HIS,进行匹配
  542. joParam = new JObject();
  543. joParam.TotalCount = joMIRtn["result"]["TotalCount"];
  544. joParam.type = directoryType;
  545. joParam.flag = flag;
  546. joParam.hospID = Global.inf.hisHospitalDr;
  547. joParam.interfaceDr = Global.inf.interfaceDr;
  548. joParam.alias = tbHISDirectoryFilter.Text;
  549. joParam.include = "Hosp";
  550. joParam.groupID = "324";
  551. joParam.compareArr = joMIRtn["result"]["Data"];
  552. jaParams = new JArray();
  553. jaParams.Add(joParam);
  554. if (hIS.getHISDir(jaPagination, jaParams, out joRtn, out errMsg) != 0)
  555. {
  556. return -1;
  557. }
  558. dtExport = (DataTable)joRtn["result"]["Data"].ToObject(typeof(DataTable));
  559. //if (rbNoMaped.Checked)
  560. // pgHISDirect.PageSize = pageSize;
  561. //else
  562. // pgHISDirect.PageSize = 50;
  563. return 0;
  564. }
  565. private int queryNoMappDirectory(int currentPage, int pageSize, out string errMsg)
  566. {
  567. errMsg = "";
  568. string directoryType = string.Empty;
  569. switch (rbgDirecType_C.SelectedIndex)
  570. {
  571. case 0:
  572. {
  573. directoryType = "drugs";
  574. break;
  575. }
  576. case 1:
  577. {
  578. directoryType = "diagnosi";
  579. break;
  580. }
  581. case 2:
  582. {
  583. directoryType = "consumables";
  584. break;
  585. }
  586. }
  587. JObject joHISRtn = new JObject();
  588. JObject joRtn = new JObject();
  589. InvokeHelper invoker = new InvokeHelper();
  590. string flag = "";
  591. JArray jaPagination = new JArray();
  592. JArray jaParams = new JArray();
  593. flag = "All";
  594. dynamic joParam = new JObject();
  595. joParam.code = "";
  596. joParam.descripts = "";
  597. joParam.FindType = new JArray();
  598. joParam.TypeID = "";
  599. joParam.alias = tbHISDirectoryFilter.Text;
  600. joParam.include = "Hosp";
  601. joParam.groupID = "324";
  602. joParam.hospID = Global.inf.hisHospitalDr;
  603. joParam.interfaceDr = Global.inf.interfaceDr;
  604. joParam.type = directoryType;
  605. joParam.flag = flag;
  606. joParam.specInput = "";
  607. jaParams.Add(joParam);
  608. dynamic joPagination = new JObject();
  609. joPagination.pageSize = pageSize;
  610. //joPagination.pageSize = 2;
  611. joPagination.currentPage = currentPage;
  612. joPagination.sortColumn = "Code";
  613. joPagination.sortOrder = "asc";
  614. jaPagination.Add(joPagination);
  615. //1.获取全部HIS目录
  616. if (hIS.getHISDir(jaPagination, jaParams, out joHISRtn, out errMsg) != 0)
  617. {
  618. return -1;
  619. }
  620. joRtn = mIS.GetNoMappHISDir(joHISRtn);
  621. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  622. {
  623. return -1;
  624. }
  625. dtExport = (DataTable)joRtn["result"]["Data"].ToObject(typeof(DataTable));
  626. //if (rbNoMaped.Checked)
  627. // pgHISDirect.PageSize = pageSize;
  628. //else
  629. // pgHISDirect.PageSize = 50;
  630. return 0;
  631. }
  632. private void queryCenterDirectory_09010012(int currentPage, int pageSize)
  633. {
  634. string directoryType = string.Empty;
  635. switch (rbgDirecType_C.SelectedIndex)
  636. {
  637. case 0:
  638. {
  639. directoryType = "drugs";
  640. break;
  641. }
  642. case 1:
  643. {
  644. directoryType = "diagnosi";
  645. break;
  646. }
  647. case 2:
  648. {
  649. directoryType = "consumables";
  650. break;
  651. }
  652. }
  653. dynamic joInParams = new JObject();
  654. joInParams.pagination = new JArray() as dynamic;
  655. joInParams.session = new JArray() as dynamic;
  656. JArray jaParams = new JArray();
  657. dynamic joParams = new JObject();
  658. joParams.code = "";
  659. joParams.descripts = "";
  660. joParams.FindType = new JArray();
  661. joParams.TypeID = "";
  662. joParams.alias = "";
  663. joParams.include = "Hosp";
  664. joParams.groupID = "324";
  665. joParams.hospID = "25";
  666. joParams.type = directoryType;
  667. joParams.specInput = "";
  668. jaParams.Add(joParams);
  669. joInParams.Add("params", JArray.FromObject(jaParams));
  670. dynamic joSession = new JObject();
  671. joSession.userID = "";
  672. joSession.locID = "";
  673. joSession.groupID = "";
  674. joSession.hospID = "";
  675. joSession.sessionID = "";
  676. joSession.hospCode = "";
  677. joSession.language = "";
  678. joSession.hostName = "";
  679. joSession.ipv4 = "";
  680. joSession.ipv6 = "";
  681. joSession.mac = "";
  682. joInParams.session.Add(joSession);
  683. dynamic joPagination = new JObject();
  684. joPagination.pageSize = pageSize;
  685. joPagination.currentPage = currentPage;
  686. joPagination.sortColumn = "Code";
  687. joPagination.sortOrder = "asc";
  688. joInParams.pagination.Add(joPagination);
  689. joInParams.code = "09010012";
  690. string sInput = joInParams.ToString();
  691. string sRtn = invoker.invokeInsuService(joInParams, "");
  692. JObject jsonRtn = JObject.Parse(sRtn);
  693. if (jsonRtn["result"]["Data"] == null)
  694. {
  695. MessageBox.Show("该节点不存在");
  696. return;
  697. }
  698. JObject joRtn = JObject.Parse(sRtn);
  699. DataTable dt = (DataTable)joRtn["result"]["Data"].ToObject(typeof(DataTable));
  700. int totalCount = int.Parse(joRtn["result"]["TotalCount"].ToString());
  701. pgCenterDirect.TotalCount = totalCount;
  702. pgCenterDirect.PageSize = 50;
  703. dgvCenterDirectory.DataSource = dt;
  704. }
  705. private void Mapping()
  706. {
  707. int iHis = dgvHISDirectory.CurrentRow.Index;
  708. if (dgvCenterDirectory.CurrentRow == null)
  709. {
  710. MessageBox.Show("请查询中心目录");
  711. return;
  712. }
  713. int iCenter = dgvCenterDirectory.CurrentRow.Index;
  714. DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
  715. DataTable dtCenter = (DataTable)dgvCenterDirectory.DataSource;
  716. dgvHISDirectory.Rows[iHis].Cells["insuCode"].Value = dgvCenterDirectory.Rows[iCenter].Cells["Code"].Value.ToString();
  717. dgvHISDirectory.Rows[iHis].Cells["insuName"].Value = dgvCenterDirectory.Rows[iCenter].Cells["Name"].Value.ToString();
  718. int hisType = rbgDirecType_C.SelectedIndex + 1;
  719. string hisTypeName = rbgDirecType_C.Items[hisType - 1].ToString(); ;
  720. JArray jaParams = new JArray();
  721. dynamic jsonTemp = new JObject();
  722. jsonTemp.ID = dtHis.Rows[iHis]["MapID"];
  723. jsonTemp.HospitalDr = Global.inf.hospitalDr;
  724. jsonTemp.updateUserID = Global.user.ID;
  725. jsonTemp.InterfaceDr = Global.inf.interfaceDr;
  726. jsonTemp.HISCode = dgvHISDirectory.Rows[iHis].Cells["itemCode"].Value;
  727. jsonTemp.HISName = dgvHISDirectory.Rows[iHis].Cells["itemDesc"].Value;
  728. jsonTemp.ChargeItemDr = dtHis.Rows[iHis]["ID"];
  729. jsonTemp.DiretoryDr = dtCenter.Rows[iCenter]["medInsuDirectoryID"];
  730. //1.已对照 2.已对照但未上传 3 已对照且已上传
  731. jsonTemp.State = 1;
  732. jsonTemp.HisType = hisType;
  733. jsonTemp.HisTypeName = hisTypeName;
  734. jsonTemp.InsuCode = dgvCenterDirectory.Rows[dgvCenterDirectory.CurrentRow.Index].Cells["Code"].Value;
  735. jsonTemp.InsuName = dgvCenterDirectory.Rows[dgvCenterDirectory.CurrentRow.Index].Cells["Name"].Value;
  736. jsonTemp.UpdateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  737. jaParams.Add(jsonTemp);
  738. JObject joIn = new JObject();
  739. joIn.Add(new JProperty("params", jaParams));
  740. joIn.Add("code", "09010040");
  741. InvokeHelper invoker = new InvokeHelper();
  742. JObject joRtn = invoker.invokeInsuService(joIn.ToString(), "插入对照信息");
  743. //JObject joRtn = JObject.Parse(irisRtn);
  744. if ((int)joRtn["errorCode"] == 0)
  745. {
  746. dgvHISDirectory.Rows[iHis].Cells["flag"].Value = "已对照";
  747. }
  748. else
  749. {
  750. dgvHISDirectory.Rows[iHis].Cells["flag"].Value = "对照失败";
  751. }
  752. }
  753. private void CancleMapping()
  754. {
  755. int iHis = dgvHISDirectory.CurrentRow.Index;
  756. DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
  757. JArray jaParams = new JArray();
  758. dynamic jsonTemp = new JObject();
  759. jsonTemp.ID = dtHis.Rows[iHis]["MapID"];
  760. jsonTemp.HospitalDr = Global.inf.hospitalDr;
  761. jsonTemp.updateUserID = Global.user.ID;
  762. jsonTemp.InterfaceDr = Global.inf.interfaceDr;
  763. jsonTemp.HISCode = dgvHISDirectory.Rows[iHis].Cells["itemCode"].Value;
  764. jsonTemp.UpdateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  765. jaParams.Add(jsonTemp);
  766. JObject joIn = new JObject();
  767. joIn.Add(new JProperty("params", jaParams));
  768. joIn.Add("code", "09010041");
  769. InvokeHelper invoker = new InvokeHelper();
  770. JObject joRtn = invoker.invokeInsuService(joIn.ToString(), "取消对照");
  771. if ((int)joRtn["errorCode"] == 0)
  772. {
  773. dgvHISDirectory.Rows[iHis].Cells["insuCode"].Value = "";
  774. dgvHISDirectory.Rows[iHis].Cells["insuName"].Value = "";
  775. dgvHISDirectory.Rows[iHis].Cells["flag"].Value = "";
  776. }
  777. else
  778. {
  779. dgvHISDirectory.Rows[iHis].Cells["flag"].Value = "取消失败";
  780. }
  781. }
  782. public void loadTextDebug()
  783. {
  784. DataImoport bus = new DataImoport();
  785. string txtPath = @"E:\insu\Demo\bin\Debug\20230101535395327567680436.txt";
  786. JObject joImportRtn = bus.importDataToIrisByTxt(txtPath, 50, 2, uiProcessBar1);
  787. }
  788. /// <summary>
  789. /// 医保目录单个版本号的下载
  790. /// </summary>
  791. /// <param name="ver"></param>
  792. /// <param name="directoryType"></param>
  793. /// <param name="uiProcessBar"></param>
  794. /// <param name="errorMessage"></param>
  795. /// <returns></returns>
  796. public int downloadDicionary(JObject joData, Sunny.UI.UIProcessBar uiProcessBar, string dictCode,out string errorMessage)
  797. {
  798. errorMessage = "";
  799. int iResult = -1;
  800. try
  801. {
  802. JObject joRtn = cBus.DownDictionay(joData);
  803. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMessage) == 0)
  804. {
  805. DataImoport DI = new DataImoport();
  806. JArray jaList = JArray.Parse(JsonHelper.getDestValue(joRtn, "output.list"));
  807. JObject joImportRtn = DI.importDictionary(uiProcessBar, jaList, dictCode);
  808. if (JsonHelper.parseIrisRtnValue(joImportRtn, out errorMessage) == 0)
  809. {
  810. iResult = 0;
  811. }
  812. else
  813. {
  814. errorMessage = "导入数据出现错误,请查看日志!" + errorMessage;
  815. }
  816. }
  817. return iResult;
  818. }
  819. catch (Exception ex)
  820. {
  821. errorMessage = "downloadDicionary提示:" + ex.Message;
  822. return -1;
  823. }
  824. }
  825. #endregion
  826. private void Form1_Load(object sender, EventArgs e)
  827. {
  828. this.WindowState = FormWindowState.Maximized;
  829. rbgDirecType.ValueChanged += new Sunny.UI.UIRadioButtonGroup.OnValueChanged(rbgDirecType_ValueChanged);
  830. LabExplain.Visible = false;
  831. }
  832. private void btnDownload_Click(object sender, EventArgs e)
  833. {
  834. string errorMessage = string.Empty;
  835. string ver = tbVer.Text;
  836. JObject input = new JObject();
  837. input["ver"] = ver;
  838. // 目录查询
  839. switch(rbgDirecType.SelectedIndex)
  840. {
  841. case 15:
  842. break;
  843. case 8: //字典
  844. {
  845. if (tbDicDate.Text == "")
  846. {
  847. MessageBox.Show("请输入查询日期!");
  848. return;
  849. }
  850. // 支持批量
  851. string[] dictText = tbDicType.Text.Trim().Split(",".ToCharArray());
  852. dictText.ToList().ForEach((dict) =>
  853. {
  854. this.downloadDict(dict);
  855. });
  856. break;
  857. }
  858. //case 12:
  859. // {
  860. // downloadMedData(TradeEnum.ICPC3AdmReason, ver, uiProcessBar1);
  861. // break;
  862. // }
  863. //case 13:
  864. // {
  865. // downloadMedData(TradeEnum.ICPC3Treatment, ver, uiProcessBar1);
  866. // break;
  867. // }
  868. default:
  869. {
  870. MedDirDownloadProcess mp = new MedDirDownloadProcess();
  871. if (rbSingleDown.Checked)
  872. {
  873. if (mp.SingleDownload(ver, rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
  874. {
  875. MessageBox.Show("医保目录下载失败:" + errorMessage);
  876. return;
  877. }
  878. }
  879. if (rbAutoDown.Checked)
  880. {
  881. mp.VerChangeEvent += Mp_VerChangeEvent;
  882. if (mp.AutoDownload(rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
  883. {
  884. MessageBox.Show("医保目录下载失败:" + errorMessage);
  885. return;
  886. }
  887. }
  888. break;
  889. }
  890. }
  891. btnQuery_Click(sender, e);
  892. }
  893. private void Mp_VerChangeEvent(object sender, string ver)
  894. {
  895. tbVer.Text = ver;
  896. }
  897. private void downloadDict(string dictCode)
  898. {
  899. try
  900. {
  901. string errorMessage = "";
  902. dynamic joData = new JObject();
  903. joData.type = dictCode; //字典类型
  904. joData.parentValue = ""; //父字典键值
  905. joData.admdvs = Global.inf.areaCode; //行政区划 就医地
  906. joData.date = tbDicDate.Text; //查询日期
  907. joData.vali_flag = "1"; //有效标志
  908. if (downloadDicionary(joData, uiProcessBar1,dictCode, out errorMessage) != 0)
  909. {
  910. MessageBox.Show("医保字典下载失败:" + errorMessage);
  911. }
  912. }
  913. catch (Exception e)
  914. {
  915. }
  916. }
  917. private int downloadMedData(TradeEnum trade,string version,Sunny.UI.UIProcessBar uiProcessBar)
  918. {
  919. string errorMessage = "";
  920. if (rbAutoDown.Checked)
  921. {
  922. JObject joMaxVerNO = mIS.getDirectoryMaxVersionNO(rbgDirecType.SelectedIndex);
  923. string ver = joMaxVerNO["result"]["MaxVersionNO"].ToString();
  924. if (!string.IsNullOrEmpty(ver))
  925. {
  926. version = ver;
  927. tbVer.Text = ver;
  928. }
  929. }
  930. JObject joRtn = cBus.DownDirecotry(trade, version);
  931. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMessage) == 0)
  932. {
  933. //解析
  934. DataImoport DI = new DataImoport();
  935. JObject joImportRtn = DI.importMedDataToIris(trade,joRtn,uiProcessBar);
  936. if (JsonHelper.parseIrisRtnValue(joImportRtn, out errorMessage) == 0)
  937. {
  938. //递归调用
  939. if (rbAutoDown.Checked)
  940. {
  941. downloadMedData(trade, version, uiProcessBar);
  942. }
  943. }
  944. return 0;
  945. }
  946. MessageBox.Show(errorMessage);
  947. return -1;
  948. }
  949. private void btnQuery_Click(object sender, EventArgs e)
  950. {
  951. #region 校验查询条件
  952. if ((rbgDirecType.SelectedIndex < 0) || (rbgDirecType.SelectedIndex > 20))
  953. {
  954. MessageBox.Show("请先选择查询类型!");
  955. return;
  956. }
  957. if (rbgDirecType.SelectedIndex > 13)
  958. {
  959. if (rbgDirecType.SelectedIndex != 20)
  960. {
  961. if ((TexDate.Text == "") || (TexDate.Text == "输入日期 2021-01-01"))
  962. {
  963. MessageBox.Show("查询条件-请输入查询日期!");
  964. return;
  965. }
  966. if ((TexDQYS.Text == "") || (TexDQYS.Text == "当前页数"))
  967. {
  968. MessageBox.Show("查询条件-请输入当前页数!");
  969. return;
  970. }
  971. if ((TexBYSJL.Text == "") || (TexBYSJL.Text == "本页数据量"))
  972. {
  973. MessageBox.Show("查询条件-请输入本页数据量!");
  974. return;
  975. }
  976. }
  977. else
  978. {
  979. if ((TexYYMC.Text == "") || (TexYYMC.Text == "输入医院名称模糊查找"))
  980. {
  981. MessageBox.Show("查询条件-请输入医院名称模糊查找!");
  982. return;
  983. }
  984. }
  985. }
  986. #endregion
  987. queryHISInsuDirectory(rbgDirecType.SelectedIndex, 1, 20, dgvDirectoy, Global.inf.interfaceDr);
  988. }
  989. private void btnQueryHISDirectory_Click(object sender, EventArgs e)
  990. {
  991. //this.dgvHISDirectory.SelectionChanged -= this.dgvHISDirectory_SelectionChanged;
  992. int iCount = 50;
  993. if (rbNoMaped.Checked)
  994. {
  995. iCount = 300;
  996. }
  997. string errMsg;
  998. if (queryHISDirectory(1, iCount, out errMsg) != 0)
  999. {
  1000. MessageBox.Show(errMsg);
  1001. return;
  1002. }
  1003. //注释前 切换页码会出现 创建字段不存在的报错
  1004. // this.dgvHISDirectory.SelectionChanged += this.dgvHISDirectory_SelectionChanged;
  1005. }
  1006. private void btnQueryCenterDirectory_Click(object sender, EventArgs e)
  1007. {
  1008. if ((tbCenterDirectoryFilter.Text == "") && (tbInsuCode.Text == "") && (tbApprovalNO.Text == "") &&
  1009. (tbManufacturer.Text == "") && (tbSpecifications.Text == "") && (tbDosageForm.Text == ""))
  1010. {
  1011. return;
  1012. }
  1013. //查询区域通用目录
  1014. JObject joRtn = mIS.getInterface_TY(Global.inf.interfaceDr.ToString(), "");
  1015. string InsuCurrencyCataLogue = JsonHelper.getDestValue(joRtn, "InsuCurrencyCataLogue"); //通用目录编码 6
  1016. string InterfaceName_TY = JsonHelper.getDestValue(joRtn, "InterfaceName_TY"); //通用目录名称
  1017. string HospName = JsonHelper.getDestValue(joRtn, "HospitalName"); //目录名称
  1018. if (InsuCurrencyCataLogue != "")
  1019. {
  1020. queryHISInsuDirectory(rbgDirecType_C.SelectedIndex, 1, 50, dgvCenterDirectory, int.Parse(InsuCurrencyCataLogue));
  1021. LabExplain.Visible = true;
  1022. LabExplain.Text = "当前接口已设置区域通用目录,数据源:" + InterfaceName_TY + " ,如果没有所查目录请联系数据源医院新增维护!";
  1023. }
  1024. else
  1025. {
  1026. queryHISInsuDirectory(rbgDirecType_C.SelectedIndex, 1, 50, dgvCenterDirectory, Global.inf.interfaceDr);
  1027. LabExplain.Visible = true;
  1028. LabExplain.Text = "当前接口未设置区域通用目录,数据源:" + HospName;
  1029. }
  1030. GridViewSetter gridSetter = new GridViewSetter();
  1031. gridSetter.DatagridviewColumnWidthAdaptation(dgvCenterDirectory);
  1032. }
  1033. private void pgDownload_PageChanged(object sender, object pagingSource, int pageIndex, int count)
  1034. {
  1035. queryHISInsuDirectory(rbgDirecType.SelectedIndex, pageIndex, count, dgvDirectoy, Global.inf.interfaceDr);
  1036. }
  1037. private void pgHISDirect_PageChanged(object sender, object pagingSource, int pageIndex, int count)
  1038. {
  1039. string errMsg;
  1040. int iCount = 50;
  1041. if (rbNoMaped.Checked) iCount = 300;
  1042. if (queryHISDirectory(pageIndex, iCount, out errMsg) != 0)
  1043. {
  1044. MessageBox.Show(errMsg);
  1045. return;
  1046. }
  1047. }
  1048. private void pgCenterDirect_PageChanged(object sender, object pagingSource, int pageIndex, int count)
  1049. {
  1050. queryHISInsuDirectory(rbgDirecType_C.SelectedIndex, pageIndex, count, dgvCenterDirectory, Global.inf.interfaceDr);
  1051. }
  1052. private void rbgDirecType_ValueChanged(object sender, int index, string text)
  1053. {
  1054. //选定项不同调用的接口也不相同,Index值大于
  1055. if (rbgDirecType.SelectedIndex > 13)
  1056. {
  1057. uiGroupBox1.Visible = false;
  1058. uiGroupBox5.Visible = false;
  1059. uiGroupBox2.Visible = true;
  1060. //uiGroupBox3.Visible = true;
  1061. uiProcessBar1.Visible = false;
  1062. uiGroupBox2.Left = rbgDirecType.Width + rbgDirecType.Left + 5;
  1063. uiGroupBox3.Left = uiGroupBox2.Width+rbgDirecType.Width + rbgDirecType.Left + 10;
  1064. dgvDirectoy.DataSource = null;
  1065. }
  1066. else
  1067. {
  1068. uiGroupBox1.Visible = true;
  1069. uiGroupBox5.Visible = true;
  1070. uiGroupBox2.Visible = true;
  1071. //uiGroupBox3.Visible = false;
  1072. uiProcessBar1.Visible = true;
  1073. uiGroupBox1.Left = rbgDirecType.Width + rbgDirecType.Left + 5;
  1074. uiGroupBox5.Left = uiGroupBox1.Width + rbgDirecType.Width + rbgDirecType.Left + 10;
  1075. uiGroupBox2.Left = uiGroupBox5.Width + uiGroupBox1.Width + rbgDirecType.Width + rbgDirecType.Left + 15;
  1076. uiGroupBox3.Left = uiGroupBox2.Width + uiGroupBox5.Width + uiGroupBox1.Width + rbgDirecType.Width + rbgDirecType.Left + 20;
  1077. uiProcessBar1.Left = rbgDirecType.Width + rbgDirecType.Left + 5;
  1078. uiProcessBar1.Width = uiGroupBox1.Width + uiGroupBox5.Width + uiGroupBox2.Width + 10;
  1079. }
  1080. setHeaderTxt(rbgDirecType.SelectedIndex, dgvDirectoy);
  1081. }
  1082. private void toolStripMenuItem2_Click(object sender, EventArgs e)
  1083. {
  1084. CancleMapping();
  1085. }
  1086. private void tsmiMapping_Click(object sender, EventArgs e)
  1087. {
  1088. Mapping();
  1089. }
  1090. private void dgvHISDirectory_DoubleClick(object sender, EventArgs e)
  1091. {
  1092. //int currentPage = pgHISDirect.ActivePage;
  1093. //string flag = dgvHISDirectory.Rows[dgvHISDirectory.CurrentRow.Index].Cells["flag"].Value.ToString();
  1094. //if (flag == "未对照")
  1095. //{
  1096. // Mapping();
  1097. //}
  1098. //else
  1099. //if (flag == "已对照")
  1100. //{
  1101. // CancleMapping();
  1102. //}
  1103. //if (rbAll.Checked)
  1104. //{
  1105. // string errMsg;
  1106. // if (queryHISDirectory(1, 50, out errMsg) != 0)
  1107. // {
  1108. // MessageBox.Show(errMsg);
  1109. // return;
  1110. // }
  1111. //}
  1112. }
  1113. private void dgvDirectoy_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  1114. {
  1115. }
  1116. private void dgvDirectoy_CellContentClick(object sender, DataGridViewCellEventArgs e)
  1117. {
  1118. }
  1119. private void uiRadioButton1_CheckedChanged(object sender, EventArgs e)
  1120. {
  1121. }
  1122. private void dgvDirectoy_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
  1123. {
  1124. //自动编号,与数据无关
  1125. Rectangle rectangle = new Rectangle(e.RowBounds.Location.X,
  1126. e.RowBounds.Location.Y,
  1127. dgvDirectoy.RowHeadersWidth - 4,
  1128. e.RowBounds.Height);
  1129. TextRenderer.DrawText(e.Graphics,
  1130. (e.RowIndex + 1).ToString(),
  1131. dgvDirectoy.RowHeadersDefaultCellStyle.Font,
  1132. rectangle,
  1133. dgvDirectoy.RowHeadersDefaultCellStyle.ForeColor,
  1134. TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
  1135. }
  1136. private void rbAll_ValueChanged(object sender, bool value)
  1137. {
  1138. //if (rbAll.Checked)
  1139. //{
  1140. // btnQueryHISDirectory_Click(null, new EventArgs());
  1141. //}
  1142. }
  1143. private void rbMaped_CheckedChanged(object sender, EventArgs e)
  1144. {
  1145. //if (rbMaped.Checked)
  1146. //{
  1147. // string errMsg;
  1148. // if (queryHISDirectory(1, 50, out errMsg) != 0)
  1149. // {
  1150. // MessageBox.Show(errMsg);
  1151. // return;
  1152. // }
  1153. //}
  1154. }
  1155. private void btAddDir_Click(object sender, EventArgs e)
  1156. {
  1157. AddSingleDirectory addDirectory = new AddSingleDirectory(rbgDirecType.SelectedIndex);
  1158. if (addDirectory.ShowDialog() == DialogResult.OK)
  1159. {
  1160. JObject joRtn = mIS.UpdateDirectoryBySelf(addDirectory.joPamam);
  1161. string error = "";
  1162. if (JsonHelper.parseIrisRtnValue(joRtn, out error) != 0)
  1163. {
  1164. MessageBox.Show("新增失败:" + error);
  1165. }
  1166. else
  1167. {
  1168. MessageBox.Show("新增成功");
  1169. }
  1170. }
  1171. }
  1172. private void btEditDir_Click(object sender, EventArgs e)
  1173. {
  1174. DataTable dt = (DataTable)dgvDirectoy.DataSource;
  1175. if ((dt == null) || (dt.Rows.Count < 1))
  1176. {
  1177. MessageBox.Show("表中无数据,请检查!");
  1178. return;
  1179. }
  1180. DataRow dr = dt.Rows[dgvDirectoy.CurrentRow.Index];
  1181. AddSingleDirectory addDirectory = new AddSingleDirectory(rbgDirecType.SelectedIndex, dr);
  1182. if (addDirectory.ShowDialog() == DialogResult.OK)
  1183. {
  1184. JObject joRtn = mIS.UpdateDirectoryBySelf(addDirectory.joPamam);
  1185. string error = "";
  1186. if (JsonHelper.parseIrisRtnValue(joRtn, out error) != 0)
  1187. {
  1188. MessageBox.Show("修改失败:" + error);
  1189. }
  1190. else
  1191. {
  1192. MessageBox.Show("修改成功");
  1193. }
  1194. }
  1195. }
  1196. private void btnExit_Click(object sender, EventArgs e)
  1197. {
  1198. Close();
  1199. }
  1200. /// <summary>
  1201. /// 几个医保查询的交易组织入参
  1202. /// </summary>
  1203. /// <param name="Index"></param>
  1204. /// <param name="funNo"></param>
  1205. /// <returns></returns>
  1206. private JObject GetInput(int Index, out TradeEnum trade)
  1207. {
  1208. trade = TradeEnum.MedicalServiceDirectory;
  1209. dynamic joData = new JObject();
  1210. switch (Index)
  1211. {
  1212. case 14://民族药品目
  1213. {
  1214. trade = TradeEnum.NationalityDrug;
  1215. joData.med_list_codg = tbDirectoryCode.Text; //医疗目录编码
  1216. joData.genname_codg = ""; //通用名编号
  1217. joData.drug_genname = ""; //药品通用名
  1218. joData.drug_prodname = tbDircetoryName.Text; //药品商品名
  1219. joData.reg_name = ""; //注册名称
  1220. joData.tcmherb_name = ""; //中草药名称
  1221. joData.mlms_name = ""; //药材名称
  1222. joData.vali_flag = ""; //有效标志
  1223. joData.rid = ""; //唯一记录号
  1224. joData.ver = ""; //版本号
  1225. joData.ver_name = ""; //版本名称
  1226. joData.opt_begn_time = ""; //经办开始时间
  1227. joData.opt_end_time = ""; //经办结束时间
  1228. joData.updt_time = TexDate.Text; //更新时间
  1229. joData.page_num = TexDQYS.Text; //当前页数
  1230. joData.page_size = TexBYSJL.Text; //本页数据量
  1231. break;
  1232. }
  1233. case 15://目录信息查询
  1234. {
  1235. trade = TradeEnum.InsuDirectory;
  1236. joData.query_date = ""; //查询时间点
  1237. joData.hilist_code = tbDirectoryCode.Text; //医保目录编码
  1238. joData.insu_admdvs = TextCbd.Text; //参保机构医保区划
  1239. joData.begndate = ""; //开始日期
  1240. joData.hilist_name = tbDircetoryName.Text; //医保目录名称
  1241. joData.wubi = ""; //五笔助记码
  1242. joData.pinyin = ""; //拼音助记码
  1243. joData.med_chrgitm_type = ""; //医疗收费项目类别
  1244. joData.chrgitm_lv = ""; //收费项目等级
  1245. joData.lmt_used_flag = ""; //限制使用标志
  1246. joData.list_type = ""; //目录类别
  1247. joData.med_use_flag = ""; //医疗使用标志
  1248. joData.matn_used_flag = ""; //生育使用标志
  1249. joData.hilist_use_type = ""; //医保目录使用类别
  1250. joData.lmt_cpnd_type = ""; //限复方使用类型
  1251. joData.vali_flag = ""; //有效标志
  1252. joData.updt_time = TexDate.Text; //更新时间
  1253. joData.page_num = TexDQYS.Text; //当前页数
  1254. joData.page_size = TexBYSJL.Text; //本页数据量
  1255. break;
  1256. }
  1257. case 16://医疗与医保目录匹配
  1258. {
  1259. trade = TradeEnum.MedicalAndInsuDirectory;
  1260. joData.query_date = ""; //查询时间点
  1261. joData.medins_list_codg = ""; //定点医药机构目录编号
  1262. joData.hilist_code = tbDirectoryCode.Text; //医保目录编码
  1263. joData.list_type = ""; //目录类别
  1264. joData.insu_admdvs = TextCbd.Text; //参保机构医保区划
  1265. joData.begndate = ""; //开始日期
  1266. joData.vali_flag = ""; //有效标志
  1267. joData.updt_time = TexDate.Text; //更新时间
  1268. joData.page_num = TexDQYS.Text; //当前页数
  1269. joData.page_size = TexBYSJL.Text; //本页数据量
  1270. break;
  1271. }
  1272. case 17://医药机构目录匹配
  1273. {
  1274. trade = TradeEnum.MedcineOrgDirectory;
  1275. joData.query_date = ""; //查询时间点
  1276. joData.fixmedins_code = ""; //定点医药机构编号
  1277. joData.medins_list_codg = ""; //定点医药机构目录编号
  1278. joData.medins_list_name = ""; //定点医药机构目录名称
  1279. joData.insu_admdvs = TextCbd.Text; //参保机构医保区划
  1280. joData.list_type = ""; //目录类别
  1281. joData.med_list_codg = tbDirectoryCode.Text; //医疗目录编码
  1282. joData.begndate = ""; //开始日期
  1283. joData.vali_flag = ""; //有效标志
  1284. joData.updt_time = TexDate.Text; //更新时间
  1285. joData.page_num = TexDQYS.Text; //当前页数
  1286. joData.page_size = TexBYSJL.Text; //本页数据量
  1287. break;
  1288. }
  1289. case 18://医保目录限价
  1290. {
  1291. trade = TradeEnum.InsuPriceLimitDirectory;
  1292. joData.query_date = ""; //查询时间点
  1293. joData.hilist_code = tbDirectoryCode.Text; //医保目录编码
  1294. joData.hilist_lmtpric_type = ""; //医保目录限价类型
  1295. joData.overlmt_dspo_way = ""; //医保目录超限处理方式
  1296. joData.insu_admdvs = TextCbd.Text; //参保机构医保区划
  1297. joData.begndate = ""; //开始日期
  1298. joData.enddate = ""; //结束日期
  1299. joData.vali_flag = ""; //有效标志
  1300. joData.rid = ""; //唯一记录号
  1301. joData.tabname = ""; //表名
  1302. joData.poolarea_no = ""; //统筹区
  1303. joData.updt_time = TexDate.Text; //更新时间
  1304. joData.page_num = TexDQYS.Text; //当前页数
  1305. joData.page_size = TexBYSJL.Text; //本页数据量
  1306. break;
  1307. }
  1308. case 19://医保目录先自付比例
  1309. {
  1310. trade = TradeEnum.PrepayPercentDirectory;
  1311. joData.query_date = ""; //查询时间点
  1312. joData.hilist_code = tbDirectoryCode.Text; //医保目录编码
  1313. joData.selfpay_prop_psn_type = "";//医保目录自付比例人员类别
  1314. joData.selfpay_prop_type = ""; //目录自付比例类别
  1315. joData.insu_admdvs = TextCbd.Text; //参保机构医保区划
  1316. joData.begndate = ""; //开始日期
  1317. joData.enddate = ""; //结束日期
  1318. joData.vali_flag = ""; //有效标志
  1319. joData.rid = ""; //唯一记录号
  1320. joData.tabname = ""; //表名
  1321. joData.poolarea_no = ""; //统筹区
  1322. joData.updt_time = TexDate.Text; //更新时间
  1323. joData.page_num = TexDQYS.Text; //当前页数
  1324. joData.page_size = TexBYSJL.Text; //本页数据量
  1325. break;
  1326. }
  1327. case 20://医药机构信息
  1328. {
  1329. trade = TradeEnum.MedicalOrgination;
  1330. joData.fixmedins_type = "1"; //定点医疗服务机构类型 1定点医疗机构,2定点零售药店,3工伤定点康复机构,4辅助器具配置机构,5计划生育服务机构
  1331. joData.fixmedins_name = TexYYMC.Text; //定点医药机构名称
  1332. joData.fixmedins_code = ""; //定点医药机构编号
  1333. break;
  1334. }
  1335. }
  1336. return joData;
  1337. }
  1338. private void uiButton1_Click(object sender, EventArgs e)
  1339. {
  1340. Close();
  1341. }
  1342. /// <summary>
  1343. /// 单条上传目录对照关系
  1344. /// </summary>
  1345. private void SingleUpload()
  1346. {
  1347. if ((dgvHISDirectory.CurrentRow == null))
  1348. {
  1349. MessageBox.Show("请查询HIS目录对照关系");
  1350. return;
  1351. }
  1352. string errorMsg = "", sMLLX = "";
  1353. //单条目录对照关系上传
  1354. int iHis = dgvHISDirectory.CurrentRow.Index;
  1355. DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
  1356. int hisType = rbgDirecType_C.SelectedIndex + 1; //1药品 2诊疗 3材料
  1357. //string hisTypeName = rbgDirecType_C.Items[hisType - 1].ToString();
  1358. if (hisType == 1)
  1359. {
  1360. sMLLX = "101"; //101西药中成药 102中药饮片 103自制剂 104民族药 201医疗服务项目 301医用耗材 501长护服务项目 105其他
  1361. }
  1362. else if (hisType == 2)
  1363. {
  1364. sMLLX = "201";
  1365. }
  1366. else if (hisType == 3)
  1367. {
  1368. sMLLX = "301";
  1369. }
  1370. string InsuCode = dtHis.Rows[iHis]["InsuCode"].ToString();
  1371. string InsuName = dtHis.Rows[iHis]["InsuName"].ToString();
  1372. string HisCode = dtHis.Rows[iHis]["itemCode"].ToString();
  1373. string HisName = dtHis.Rows[iHis]["itemDesc"].ToString();
  1374. string UpdateDate = DateTime.Now.ToString("yyyy-MM-dd");
  1375. string MapId = dtHis.Rows[iHis]["MapID"].ToString();
  1376. JArray dataArray = new JArray();
  1377. //调用3301目录对照上传
  1378. JObject joData = new JObject();
  1379. joData.Add("fixmedins_hilist_id", HisCode);
  1380. joData.Add("fixmedins_hilist_name", HisName);
  1381. joData.Add("list_type", sMLLX); //目录类别
  1382. joData.Add("med_list_codg", InsuCode); //医疗目录编码
  1383. joData.Add("begndate", "2023-10-01"); //开始日期
  1384. joData.Add("enddate", UpdateDate); //结束日期
  1385. joData.Add("aprvno", "");
  1386. joData.Add("dosform", "");
  1387. joData.Add("exct_cont", "");
  1388. joData.Add("item_cont", "");
  1389. joData.Add("prcunt", "");
  1390. joData.Add("spec", "");
  1391. joData.Add("pacspec", "");
  1392. joData.Add("memo", "");
  1393. dataArray.Add(joData);
  1394. // 单条与多条保持一致
  1395. JObject joInput = new JObject();
  1396. joInput.Add("data", dataArray);
  1397. InvokeHelper invoker = new InvokeHelper();
  1398. Global.pat.insuplc_admdvs = Global.inf.areaCode;
  1399. JObject joRtn = invoker.invokeCenterService(TradeEnum.DirectoryContrastUpload, joInput);
  1400. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  1401. {
  1402. MessageBox.Show("目录对照关系上传失败:" + errorMsg);
  1403. }
  1404. else
  1405. {
  1406. UpdateUploadStatus(MapId, 3);
  1407. MessageBox.Show("目录对照关系上传成功!");
  1408. }
  1409. }
  1410. /// <summary>
  1411. /// 单条撤销目录对照关系上传
  1412. /// </summary>
  1413. private void SingleCancelUpload()
  1414. {
  1415. if ((dgvHISDirectory.CurrentRow == null) || (rbMaped.Checked != true))
  1416. {
  1417. MessageBox.Show("请查询HIS目录对照关系");
  1418. return;
  1419. }
  1420. string errorMsg = "", sMLLX = "";
  1421. //撤销目录对照关系
  1422. DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
  1423. int iHis = dgvHISDirectory.CurrentRow.Index;
  1424. string InsuCode = dtHis.Rows[iHis]["InsuCode"].ToString();
  1425. string HisCode = dtHis.Rows[iHis]["HisCode"].ToString();
  1426. string MapId = dtHis.Rows[iHis]["MapID"].ToString();
  1427. int hisType = rbgDirecType_C.SelectedIndex + 1; //1药品 2诊疗 3材料
  1428. //string hisTypeName = rbgDirecType_C.Items[hisType - 1].ToString();
  1429. if (hisType == 1)
  1430. {
  1431. sMLLX = "101"; //101西药中成药 102中药饮片 103自制剂 104民族药 201医疗服务项目 301医用耗材 501长护服务项目 105其他
  1432. }
  1433. else if (hisType == 2)
  1434. {
  1435. sMLLX = "201";
  1436. }
  1437. else if (hisType == 3)
  1438. {
  1439. sMLLX = "301";
  1440. }
  1441. //调用3302目录对照撤销
  1442. JObject joData = new JObject();
  1443. joData.Add("fixmedins_code", Global.inf.hospitalNO);
  1444. joData.Add("fixmedins_hilist_id", HisCode);
  1445. joData.Add("list_type", sMLLX); //目录类别
  1446. joData.Add("med_list_codg", InsuCode); //医疗目录编码
  1447. JObject joInput = new JObject();
  1448. joInput.Add("data", joData);
  1449. InvokeHelper invoker = new InvokeHelper();
  1450. Global.pat.insuplc_admdvs = Global.inf.areaCode;
  1451. JObject joRtn = invoker.invokeCenterService(TradeEnum.DirectoryContrastCancel, joInput);
  1452. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  1453. {
  1454. MessageBox.Show("目录对照撤销失败:" + errorMsg);
  1455. }
  1456. else
  1457. {
  1458. UpdateUploadStatus(MapId, 2);
  1459. MessageBox.Show("目录对照撤销成功!");
  1460. }
  1461. }
  1462. /// <summary>
  1463. /// 全部上传目录对照关系
  1464. /// </summary>
  1465. private void AllUpLoad()
  1466. {
  1467. if ((dgvHISDirectory.CurrentRow == null))
  1468. {
  1469. MessageBox.Show("请查询HIS目录对照关系");
  1470. return;
  1471. }
  1472. string sInputStr = "", sMLLX = "", errorMsg = "", Msg = "";
  1473. Boolean bOk = true;
  1474. JObject InputjoRtn = new JObject();
  1475. string UpdateDate = DateTime.Now.ToString("yyyy-MM-dd");
  1476. int hisType = rbgDirecType_C.SelectedIndex + 1; //1药品 2诊疗 3材料
  1477. if (hisType == 1)
  1478. {
  1479. sMLLX = "101"; //101西药中成药 102中药饮片 103自制剂 104民族药 201医疗服务项目 301医用耗材 501长护服务项目 105其他
  1480. }
  1481. else if (hisType == 2)
  1482. {
  1483. sMLLX = "201";
  1484. }
  1485. else if (hisType == 3)
  1486. {
  1487. sMLLX = "301";
  1488. }
  1489. List<String> mapIdList = new List<string>();
  1490. DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
  1491. JArray dataArray = new JArray();
  1492. for (int i = 0; i < dtHis.Rows.Count; i++)
  1493. {
  1494. string InsuCode = dtHis.Rows[i]["InsuCode"].ToString(); //医保目录编码
  1495. string InsuName = dtHis.Rows[i]["InsuName"].ToString(); //医保目录名称
  1496. string HisCode = dtHis.Rows[i]["itemCode"].ToString(); //HIS目录编码
  1497. string HisName = dtHis.Rows[i]["itemDesc"].ToString(); //HIS目录名称
  1498. mapIdList.Add(dtHis.Rows[i]["MapID"].ToString()); //ID
  1499. //调用3301目录对照上传
  1500. JObject joData = new JObject();
  1501. joData.Add("fixmedins_hilist_id", HisCode);
  1502. joData.Add("fixmedins_hilist_name", HisName);
  1503. joData.Add("list_type", sMLLX); //目录类别
  1504. joData.Add("med_list_codg", InsuCode); //医疗目录编码
  1505. joData.Add("begndate", "2023-10-01"); //开始日期
  1506. joData.Add("enddate", UpdateDate); //结束日期
  1507. joData.Add("aprvno", "");
  1508. joData.Add("dosform", "");
  1509. joData.Add("exct_cont", "");
  1510. joData.Add("item_cont", "");
  1511. joData.Add("prcunt", "");
  1512. joData.Add("spec", "");
  1513. joData.Add("pacspec", "");
  1514. joData.Add("memo", "");
  1515. dataArray.Add(joData);
  1516. }
  1517. JObject joInput = new JObject();
  1518. joInput.Add("data", dataArray);
  1519. Global.pat.insuplc_admdvs = Global.inf.areaCode;
  1520. InvokeHelper invoker = new InvokeHelper();
  1521. JObject joRtn = invoker.invokeCenterService(TradeEnum.DirectoryContrastUpload, joInput);
  1522. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  1523. {
  1524. bOk = false;
  1525. Msg = Msg + "<" + joInput.ToString() + ":" + errorMsg + ">";
  1526. }
  1527. if (bOk == false)
  1528. {
  1529. MessageBox.Show("全部目录对照关系上传成功,部分上传异常:" + Msg);
  1530. }
  1531. else
  1532. {
  1533. UpdateUploadStatus(string.Join(",",mapIdList.ToArray()),3);
  1534. MessageBox.Show("全部目录对照关系上传成功!");
  1535. }
  1536. }
  1537. private void UpdateUploadStatus(string ids, int state)
  1538. {
  1539. if (string.IsNullOrEmpty(ids)) return;
  1540. dynamic joInput = new JObject();
  1541. joInput.HospitalDr = Global.inf.hospitalDr;
  1542. joInput.InterfaceDr = Global.inf.interfaceDr;
  1543. joInput.ID = ids;
  1544. joInput.state = state;
  1545. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010103", joInput).ToString(), "更新上传状态");
  1546. if (joRtn["errorCode"].Text() != "0")
  1547. {
  1548. Global.writeLog("更新状态失败!" + joRtn["errorMessage"].ToString());
  1549. }
  1550. }
  1551. /// <summary>
  1552. /// 全部撤销目录对照关系上传
  1553. /// </summary>
  1554. private void AllCancelUpload()
  1555. {
  1556. if ((dgvHISDirectory.CurrentRow == null) || (rbMaped.Checked != true))
  1557. {
  1558. MessageBox.Show("请查询HIS目录对照关系");
  1559. return;
  1560. }
  1561. string sMLLX = "", errorMsg = "", Msg = "";
  1562. Boolean bOk = true;
  1563. string UpdateDate = DateTime.Now.ToString("yyyy-MM-dd");
  1564. int hisType = rbgDirecType_C.SelectedIndex + 1; //1药品 2诊疗 3材料
  1565. if (hisType == 1)
  1566. {
  1567. sMLLX = "101"; //101西药中成药 102中药饮片 103自制剂 104民族药 201医疗服务项目 301医用耗材 501长护服务项目 105其他
  1568. }
  1569. else if (hisType == 2)
  1570. {
  1571. sMLLX = "201";
  1572. }
  1573. else if (hisType == 3)
  1574. {
  1575. sMLLX = "301";
  1576. }
  1577. DataTable dtHis = (DataTable)dgvHISDirectory.DataSource;
  1578. List<String> mapIdList = new List<string>();
  1579. for (int i = 0; i < dtHis.Rows.Count; i++)
  1580. {
  1581. string InsuCode = dtHis.Rows[i]["InsuCode"].ToString();
  1582. string HisCode = dtHis.Rows[i]["HisCode"].ToString();
  1583. mapIdList.Add(dtHis.Rows[i]["MapID"].ToString()); //ID
  1584. //调用3302目录对照撤销
  1585. JObject joData = new JObject();
  1586. joData.Add("fixmedins_code", Global.inf.hospitalNO);
  1587. joData.Add("fixmedins_hilist_id", HisCode);
  1588. joData.Add("list_type", sMLLX); //目录类别
  1589. joData.Add("med_list_codg", InsuCode); //医疗目录编码
  1590. JObject joInput = new JObject();
  1591. joInput.Add("data", joData);
  1592. InvokeHelper invoker = new InvokeHelper();
  1593. JObject joRtn = invoker.invokeCenterService(TradeEnum.DirectoryContrastCancel, joInput);
  1594. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  1595. {
  1596. bOk = false;
  1597. Msg = Msg + "<" + joInput.ToString()+":" + errorMsg + ">";
  1598. }
  1599. }
  1600. if (bOk == false)
  1601. {
  1602. MessageBox.Show("全部撤销目录对照关系上传成功,部分撤销异常:" + Msg);
  1603. }
  1604. else
  1605. {
  1606. UpdateUploadStatus(string.Join(",", mapIdList.ToArray()), 2);
  1607. MessageBox.Show("全部撤销目录对照关系上传成功!");
  1608. }
  1609. }
  1610. private void ToolStripMenuItem_Upload_Click(object sender, EventArgs e)
  1611. {
  1612. SingleUpload();
  1613. }
  1614. private void ToolStripMenuItem_CancelUpload_Click(object sender, EventArgs e)
  1615. {
  1616. SingleCancelUpload();
  1617. }
  1618. private void rbgDirecType_C_ValueChanged(object sender, int index, string text)
  1619. {
  1620. tbHISDirectoryFilter.Text = "";
  1621. uiTextBox1.Text = "";
  1622. rbAll.Checked = true;
  1623. rbMaped.Checked = false;
  1624. rbNoMaped.Checked = false;
  1625. tbCenterDirectoryFilter.Text = "";
  1626. tbInsuCode.Text = "";
  1627. tbApprovalNO.Text = "";
  1628. dgvCenterDirectory.DataSource = null;
  1629. btnQueryHISDirectory_Click(null, new EventArgs());
  1630. }
  1631. private void rbNoMaped_CheckedChanged(object sender, EventArgs e)
  1632. {
  1633. //if (rbNoMaped.Checked)
  1634. //{
  1635. // string errMsg;
  1636. // if (queryHISDirectory(1, 300, out errMsg) != 0)
  1637. // {
  1638. // MessageBox.Show(errMsg);
  1639. // return;
  1640. // }
  1641. //}
  1642. }
  1643. private void dgvHISDirectory_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
  1644. {
  1645. e.Row.HeaderCell.Value = string.Format("{0}", e.Row.Index + 1);
  1646. }
  1647. private void dgvCenterDirectory_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
  1648. {
  1649. e.Row.HeaderCell.Value = string.Format("{0}", e.Row.Index + 1);
  1650. }
  1651. private void updateLimitPrice()
  1652. {
  1653. SelfpayPercentForm selfpay = new SelfpayPercentForm();
  1654. selfpay.CenterCode = dgvDirectoy.Rows[dgvDirectoy.SelectedIndex].Cells["Code"].Value + "";
  1655. selfpay.ShowDialog();
  1656. }
  1657. private void btSignIn_Click(object sender, EventArgs e)
  1658. {
  1659. if (mIS.isSigned(ref Global.curEvt.signno) != true)
  1660. {
  1661. JObject joRtn = new JObject();
  1662. CallResult callResult = new SignInProcess().Process(joRtn);
  1663. string error = "";
  1664. if (JsonHelper.parseIrisRtnValue(JObject.FromObject(callResult.PureData), out error) != 0)
  1665. {
  1666. MessageBox.Show($"签到失败!{error}");
  1667. }
  1668. else
  1669. {
  1670. MessageBox.Show("签到成功!");
  1671. }
  1672. }
  1673. else
  1674. {
  1675. MessageBox.Show("今日已签到!");
  1676. }
  1677. }
  1678. private void tsmiSingleUpdateAuxInfo_Click(object sender, EventArgs e)
  1679. {
  1680. string error;
  1681. int iDir = dgvDirectoy.CurrentRow.Index;
  1682. if (dgvDirectoy.CurrentRow == null)
  1683. {
  1684. MessageBox.Show("请查询中心目录");
  1685. return;
  1686. }
  1687. JObject jo = new JObject();
  1688. jo.Add("code", dgvDirectoy.Rows[iDir].Cells["code"].Value.ToString());
  1689. jo.Add("HisType", rbgDirecType.SelectedIndex + 1);
  1690. if (updateAuxInfo(jo,out error) != 0)
  1691. {
  1692. MessageBox.Show(error);
  1693. }
  1694. else
  1695. {
  1696. MessageBox.Show(error);
  1697. }
  1698. }
  1699. public string getDataRowValue(DataRow dr, string columnName)
  1700. {
  1701. if (!dr.Table.Columns.Contains(columnName))
  1702. {
  1703. return "";
  1704. }
  1705. else
  1706. {
  1707. return dr[columnName].ToString();
  1708. }
  1709. }
  1710. //更新目录信息(附属信息)
  1711. private int updateAuxInfo(JObject jo,out string err)
  1712. {
  1713. err = "";
  1714. tbDirectoryCode.Text = JsonHelper.getDestValue(jo,"code");
  1715. dynamic joData = GetInput(15, out TradeEnum trade);
  1716. JObject joRtn = cBus.InvokeMedicalInsuranceInquiry(trade, joData);
  1717. if (joRtn["infcode"].ToString() == "0")
  1718. {
  1719. DataTable dtAuxInfo = (DataTable)joRtn["output"]["data"].ToObject(typeof(DataTable));
  1720. DateTime dtToday = DateTime.Today;
  1721. string chrgitm_lv = "";
  1722. string begndate = "";
  1723. string enddate = "";
  1724. string list_type = "";
  1725. string med_chrgitm_type = "";
  1726. int iAdpater = 0;
  1727. foreach (DataRow dr in dtAuxInfo.Rows)
  1728. {
  1729. DateTime dtBegin = getDataRowValue(dr, "begndate") == "" ? Convert.ToDateTime("2000-01-01 00:00:00") : Convert.ToDateTime(getDataRowValue(dr, "begndate"));
  1730. DateTime dtEnd = getDataRowValue(dr, "enddate") == "" ? Convert.ToDateTime("2099-01-01 00:00:00") : Convert.ToDateTime(getDataRowValue(dr, "enddate"));
  1731. if ((dtBegin < dtToday) && (dtToday < dtEnd))
  1732. {
  1733. iAdpater++;
  1734. chrgitm_lv = dr["chrgitm_lv"].ToString();
  1735. begndate = dr["begndate"].ToString();
  1736. enddate = dr["enddate"].ToString();
  1737. list_type = dr["list_type"].ToString();
  1738. med_chrgitm_type = dr["med_chrgitm_type"].ToString();
  1739. }
  1740. }
  1741. //有且只能有一条数据符合
  1742. if (iAdpater == 1)
  1743. {
  1744. JObject joPamam = new JObject();
  1745. joPamam.Add("Code", JsonHelper.getDestValue(jo, "code"));
  1746. joPamam.Add("HisType", JsonHelper.getDestValue(jo, "HisType"));
  1747. joPamam.Add("StartDate", begndate);
  1748. joPamam.Add("EndDate", enddate);
  1749. joPamam.Add("ChargeItemLevel", chrgitm_lv);
  1750. joPamam.Add("ListType", list_type);
  1751. joPamam.Add("ChargeItemType", med_chrgitm_type);
  1752. JObject joUpdateRtn = mIS.UpdateDirectoryBySelf(joPamam);
  1753. string error = "";
  1754. if (JsonHelper.parseIrisRtnValue(joUpdateRtn, out error) != 0)
  1755. {
  1756. err = "修改失败:" + error;
  1757. return -1;
  1758. }
  1759. else
  1760. {
  1761. err = "修改成功";
  1762. return 0;
  1763. }
  1764. }
  1765. else
  1766. {
  1767. err = "中心返回符合条数的记录不唯一或者为空,请检查!";
  1768. return -1;
  1769. }
  1770. }
  1771. else
  1772. {
  1773. err = "查询中心数据出错,请检查!";
  1774. return -1;
  1775. }
  1776. }
  1777. //更新目录信息(附属信息)
  1778. private int updateCellingPrice(JObject jo, out string err)
  1779. {
  1780. err = "";
  1781. tbDirectoryCode.Text = JsonHelper.getDestValue(jo, "code");
  1782. dynamic joData = GetInput(18, out TradeEnum trade);
  1783. JObject joRtn = cBus.InvokeMedicalInsuranceInquiry(trade, joData);
  1784. if (joRtn["infcode"].ToString() == "0")
  1785. {
  1786. DataTable dtAuxInfo = (DataTable)joRtn["output"]["data"].ToObject(typeof(DataTable));
  1787. DateTime dtToday = DateTime.Today;
  1788. string cellingPrice = "";
  1789. string begndate = "";
  1790. string enddate = "";
  1791. int iAdpater = 0;
  1792. foreach (DataRow dr in dtAuxInfo.Rows)
  1793. {
  1794. DateTime dtBegin = getDataRowValue(dr, "begndate") == "" ? Convert.ToDateTime("2000-01-01 00:00:00") : Convert.ToDateTime(getDataRowValue(dr, "begndate"));
  1795. DateTime dtEnd = getDataRowValue(dr, "enddate") == "" ? Convert.ToDateTime("2099-01-01 00:00:00") : Convert.ToDateTime(getDataRowValue(dr, "enddate"));
  1796. if ((dtBegin < dtToday) && (dtToday < dtEnd))
  1797. {
  1798. iAdpater++;
  1799. cellingPrice = dr["hilist_pric_uplmt_amt"].ToString();
  1800. begndate = dr["begndate"].ToString();
  1801. enddate = dr["enddate"].ToString();
  1802. }
  1803. }
  1804. //有且只能有一条数据符合
  1805. if (iAdpater == 1)
  1806. {
  1807. JObject joPamam = new JObject();
  1808. joPamam.Add("Code", JsonHelper.getDestValue(jo, "code"));
  1809. joPamam.Add("HisType", JsonHelper.getDestValue(jo, "HisType"));
  1810. joPamam.Add("StartDate", begndate);
  1811. joPamam.Add("EndDate", enddate);
  1812. joPamam.Add("CeilingPrice", cellingPrice);
  1813. JObject joUpdateRtn = mIS.UpdateDirectoryBySelf(joPamam);
  1814. string error = "";
  1815. if (JsonHelper.parseIrisRtnValue(joUpdateRtn, out error) != 0)
  1816. {
  1817. err = "修改失败:" + error;
  1818. return -1;
  1819. }
  1820. else
  1821. {
  1822. err = "修改成功";
  1823. return 0;
  1824. }
  1825. }
  1826. else
  1827. {
  1828. err = "中心返回符合条数的记录不唯一或者为空,请检查!";
  1829. return -1;
  1830. }
  1831. }
  1832. else
  1833. {
  1834. err = "查询中心数据出错,请检查!";
  1835. return -1;
  1836. }
  1837. }
  1838. private void tsmiUpdateCellingPrice_Click(object sender, EventArgs e)
  1839. {
  1840. string error;
  1841. int iDir = dgvDirectoy.CurrentRow.Index;
  1842. if (dgvDirectoy.CurrentRow == null)
  1843. {
  1844. MessageBox.Show("请查询中心目录");
  1845. return;
  1846. }
  1847. JObject jo = new JObject();
  1848. jo.Add("code", dgvDirectoy.Rows[iDir].Cells["code"].Value.ToString());
  1849. jo.Add("HisType", rbgDirecType.SelectedIndex + 1);
  1850. if (updateCellingPrice(jo,out error) != 0)
  1851. {
  1852. MessageBox.Show(error);
  1853. }
  1854. else
  1855. {
  1856. MessageBox.Show(error);
  1857. }
  1858. }
  1859. private void btTripMenu_Click(object sender, EventArgs e)
  1860. {
  1861. uiContextMenuStrip1.Show(((Sunny.UI.UIButton)sender), new Point(0, btTripMenu.Height));
  1862. }
  1863. private void tsmExportAllMappedData_Click(object sender, EventArgs e)
  1864. {
  1865. if (queryMapeDirectory(1, 3000, out string errMsg) != 0)
  1866. {
  1867. MessageBox.Show(errMsg);
  1868. return;
  1869. }
  1870. if (dtExport.Rows.Count > 0)
  1871. {
  1872. string directoryType = string.Empty;
  1873. string sBZ = "";
  1874. switch (rbgDirecType_C.SelectedIndex)
  1875. {
  1876. case 0:
  1877. {
  1878. directoryType = "药品";
  1879. break;
  1880. }
  1881. case 1:
  1882. {
  1883. directoryType = "诊疗";
  1884. break;
  1885. }
  1886. case 2:
  1887. {
  1888. directoryType = "材料";
  1889. break;
  1890. }
  1891. }
  1892. if (rbAll.Checked) sBZ = "全部";
  1893. else
  1894. if (rbMaped.Checked) sBZ = "已对照";
  1895. else
  1896. if (rbNoMaped.Checked) sBZ = "未对照";
  1897. string LSH = DateTime.Now.ToString("yyyy-MM-dd"); //DateTime.Now.ToString("MMddHHmmssffff");
  1898. string sFliePathName = @"D:\" + LSH + "(" + directoryType + ")医保目录" + sBZ + "信息.xls";
  1899. string ReturnFileName = ExportToExcel.DataTabletoCSV(dtExport, sFliePathName);
  1900. }
  1901. }
  1902. private void tsmUploadAllMappedData_Click(object sender, EventArgs e)
  1903. {
  1904. AllUpLoad();
  1905. }
  1906. private void tsmCancelAllUploadedData_Click(object sender, EventArgs e)
  1907. {
  1908. AllCancelUpload();
  1909. }
  1910. private void tsmUpdateCellPriceOfAllMapped_Click(object sender, EventArgs e)
  1911. {
  1912. updateMappedInsuInfo(updateCellPriceWrapper);
  1913. }
  1914. private void tsmUpdateAllMapped_Click(object sender, EventArgs e)
  1915. {
  1916. updateMappedInsuInfo(updateAuxAndCellPriceWrapper);
  1917. }
  1918. private void updateMappedInsuInfo(Func<JObject,OutParamWrapper,int> action)
  1919. {
  1920. string sqlStr = $"select InsuCode,HisType from HB_MedInsuMapRelation where Interface_Dr='{Global.inf.interfaceDr}' and Hospital_Dr ='{Global.inf.hospitalDr}'";
  1921. JObject joSqlstr = new JObject();
  1922. joSqlstr.Add("sqlStr", sqlStr);
  1923. JObject joRtn = mIS.QueryMappedData(joSqlstr, "查询所有已对照数据");
  1924. DataTable dt = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  1925. int iFalse = 0;
  1926. int iCount = 0;
  1927. foreach (DataRow dr in dt.Rows)
  1928. {
  1929. JObject jo = new JObject();
  1930. jo.Add("code", dr["InsuCode"].ToString());
  1931. jo.Add("HisType", dr["HisType"].ToString());
  1932. OutParamWrapper outParWarp = new OutParamWrapper();
  1933. if (action(jo, outParWarp) != 0)
  1934. {
  1935. iFalse++;
  1936. Global.writeLog(outParWarp.Value);
  1937. }
  1938. }
  1939. if (iFalse != 0)
  1940. {
  1941. MessageBox.Show($"总共{iCount}条数据更新完成,但有{iFalse}条更新发生错误!");
  1942. }
  1943. else
  1944. {
  1945. MessageBox.Show("全部数据更新完成");
  1946. }
  1947. }
  1948. private int updateAuxAndCellPriceWrapper(JObject jo, OutParamWrapper outParamWrapper)
  1949. {
  1950. string err;
  1951. int iresult = updateAuxAndCellPrice(jo, out err);
  1952. outParamWrapper.Value = err;
  1953. return iresult;
  1954. }
  1955. private int updateCellPriceWrapper(JObject jo, OutParamWrapper outParamWrapper)
  1956. {
  1957. string err;
  1958. int iresult = updateCellingPrice(jo, out err);
  1959. outParamWrapper.Value = err;
  1960. return iresult;
  1961. }
  1962. private int updateAuxInfoWrapper(JObject jo, OutParamWrapper outParamWrapper)
  1963. {
  1964. string err;
  1965. int iresult = updateAuxInfo(jo, out err);
  1966. outParamWrapper.Value = err;
  1967. return iresult;
  1968. }
  1969. private int updateAuxAndCellPrice(JObject jo, out string error)
  1970. {
  1971. string err ="";
  1972. int iResult=0;
  1973. error = "";
  1974. if (updateAuxInfo(jo, out err) != 0)
  1975. {
  1976. error = $"更新目录信息失败{err}";
  1977. iResult--;
  1978. }
  1979. err = "";
  1980. if (updateCellingPrice(jo, out err) != 0)
  1981. {
  1982. error = $"{error};更新限价信息失败{err}";
  1983. iResult--;
  1984. }
  1985. return iResult;
  1986. }
  1987. private void tsmUpdateLevelTypeOfAllMappedData_Click(object sender, EventArgs e)
  1988. {
  1989. updateMappedInsuInfo(updateAuxInfoWrapper);
  1990. }
  1991. private void tsmSingleUpdateInsuInfo_Click(object sender, EventArgs e)
  1992. {
  1993. if ((dgvHISDirectory.CurrentRow == null) || (rbMaped.Checked != true))
  1994. {
  1995. MessageBox.Show("请查询HIS目录对照关系,注意选择已对照!");
  1996. return;
  1997. }
  1998. int iMapped = dgvHISDirectory.CurrentRow.Index;
  1999. string insuCode = dgvHISDirectory.Rows[iMapped].Cells["insuCode"].Value.ToString();
  2000. if (string.IsNullOrEmpty(insuCode))
  2001. {
  2002. MessageBox.Show("未检测到对应的医保目录,请检查该目录是否已对照!");
  2003. return;
  2004. }
  2005. JObject jo = new JObject();
  2006. jo.Add("code", dgvHISDirectory.Rows[iMapped].Cells["insuCode"].Value.ToString());
  2007. jo.Add("HisType", rbgDirecType_C.SelectedIndex + 1);
  2008. string error;
  2009. if (updateAuxAndCellPrice(jo, out error) != 0)
  2010. {
  2011. MessageBox.Show($"更新失败{error}");
  2012. }
  2013. else
  2014. {
  2015. MessageBox.Show("更新成功!");
  2016. }
  2017. }
  2018. private void dgvHISDirectory_SelectionChanged(object sender, EventArgs e)
  2019. {
  2020. int i = dgvHISDirectory.CurrentRow.Index;
  2021. if (dgvHISDirectory.Rows[i].Cells["insuCode"].Value.ToString() != "")
  2022. {
  2023. tbInsuCode.Text = dgvHISDirectory.Rows[i].Cells["insuCode"].Value.ToString();
  2024. tbCenterDirectoryFilter.Text = "";
  2025. tbApprovalNO.Text = "";
  2026. }
  2027. else
  2028. {
  2029. tbInsuCode.Text = "";
  2030. if (rbOnlyName.Checked)
  2031. {
  2032. tbInsuCode.Text = "";
  2033. tbApprovalNO.Text = "";
  2034. tbCenterDirectoryFilter.Text = "%" + dgvHISDirectory.Rows[i].Cells["itemDesc"].Value.ToString() + "%";
  2035. }
  2036. if (rbOnlyApprNO.Checked)
  2037. {
  2038. tbCenterDirectoryFilter.Text = "";
  2039. tbInsuCode.Text = "";
  2040. tbApprovalNO.Text = "%" + dgvHISDirectory.Rows[i].Cells["pprovalNo"].Value.ToString() + "%";
  2041. }
  2042. if (rbBoth.Checked)
  2043. {
  2044. tbInsuCode.Text = "";
  2045. tbCenterDirectoryFilter.Text = "%" + dgvHISDirectory.Rows[i].Cells["itemDesc"].Value.ToString() + "%";
  2046. tbApprovalNO.Text = "%" + dgvHISDirectory.Rows[i].Cells["pprovalNo"].Value.ToString() + "%";
  2047. }
  2048. }
  2049. }
  2050. private void uiButton2_Click(object sender, EventArgs e)
  2051. {
  2052. Close();
  2053. }
  2054. private void tsmExportAllData_Click(object sender, EventArgs e)
  2055. {
  2056. if (queryHISDirectory(1, 5000, out string errMsg) != 0)
  2057. {
  2058. MessageBox.Show(errMsg);
  2059. return;
  2060. }
  2061. if (dtExport.Rows.Count > 0)
  2062. {
  2063. string Maped = "";
  2064. if (rbAll.Checked) Maped = "全部";
  2065. if (rbMaped.Checked) Maped = "已对照";
  2066. if (rbNoMaped.Checked) Maped = "未对照";
  2067. string directoryType = string.Empty;
  2068. switch (rbgDirecType_C.SelectedIndex)
  2069. {
  2070. case 0:
  2071. {
  2072. directoryType = "药品";
  2073. break;
  2074. }
  2075. case 1:
  2076. {
  2077. directoryType = "诊疗";
  2078. break;
  2079. }
  2080. case 2:
  2081. {
  2082. directoryType = "材料";
  2083. break;
  2084. }
  2085. }
  2086. string LSH = DateTime.Now.ToString("yyyyMMddHHMMss"); //DateTime.Now.ToString("MMddHHmmssffff");
  2087. string sFliePathName = @"D:\" + LSH + "【" + directoryType + "】医保目录【" + Maped + "】信息.xls";
  2088. string ReturnFileName = ExportToExcel.DataTabletoCSV(dtExport, sFliePathName);
  2089. }
  2090. }
  2091. private void dgvHISDirectory_CellClick(object sender, DataGridViewCellEventArgs e)
  2092. {
  2093. }
  2094. private void tsmExportMappedDataByLeft_Click(object sender, EventArgs e)
  2095. {
  2096. if (queryNoMappDirectory(1, 3000, out string errMsg) != 0)
  2097. {
  2098. MessageBox.Show(errMsg);
  2099. return;
  2100. }
  2101. if (dtExport.Rows.Count > 0)
  2102. {
  2103. string directoryType = string.Empty;
  2104. switch (rbgDirecType_C.SelectedIndex)
  2105. {
  2106. case 0:
  2107. {
  2108. directoryType = "药品";
  2109. break;
  2110. }
  2111. case 1:
  2112. {
  2113. directoryType = "诊疗";
  2114. break;
  2115. }
  2116. case 2:
  2117. {
  2118. directoryType = "材料";
  2119. break;
  2120. }
  2121. }
  2122. string LSH = DateTime.Now.ToString("yyyy-MM-dd"); //DateTime.Now.ToString("MMddHHmmssffff");
  2123. string sFliePathName = @"D:\" + LSH + "(" + directoryType + ")医保目录未对照信息.xls";
  2124. string ReturnFileName = ExportToExcel.DataTabletoCSV(dtExport, sFliePathName);
  2125. }
  2126. }
  2127. }
  2128. public class OutParamWrapper
  2129. {
  2130. public string Value { get; set; }
  2131. }
  2132. }