BasicData.cs 115 KB

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