SettlementChecklist.cs 95 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using PTMedicalInsurance.Helper;
  11. using PTMedicalInsurance.Common;
  12. using Newtonsoft.Json.Linq;
  13. using PTMedicalInsurance.FormSetter;
  14. using PTMedicalInsurance.Variables;
  15. using FastReport;
  16. using Newtonsoft.Json;
  17. using System.Threading;
  18. using FastReportFrom;
  19. using PTMedicalInsurance.Business;
  20. using FastReportFunction = FastReport.FastReportFunction;
  21. using System.IO;
  22. using FastReport.Export.Dbf;
  23. using Sunny.UI;
  24. using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
  25. using System.Drawing.Drawing2D;
  26. using FastReport.Editor;
  27. namespace PTMedicalInsurance.Forms
  28. {
  29. public partial class SettlementChecklist : Form
  30. {
  31. private int hospitalDr;
  32. private int interfaceDr;
  33. private string hospitalNO;
  34. private string interfaceNO;
  35. private string hospitalName;
  36. private string hospitalAreaCode;
  37. private bool disposed = false;
  38. private HisIrisServices hIS = new HisIrisServices();
  39. private MIIrisServices mIS = new MIIrisServices();
  40. Thread thread_test;
  41. private InvokeHelper invoker = new InvokeHelper();
  42. public SettlementChecklist()
  43. {
  44. InitializeComponent();
  45. hospitalDr = Global.inf.hospitalDr;
  46. hospitalNO = Global.inf.hospitalNO;
  47. hospitalName = Global.inf.hospitalName;
  48. hospitalAreaCode = Global.inf.areaCode;
  49. interfaceDr = Global.inf.interfaceDr;
  50. }
  51. public SettlementChecklist(JObject joParam)
  52. {
  53. InitializeComponent();
  54. hospitalDr = Global.inf.hospitalDr;
  55. hospitalNO = Global.inf.hospitalNO;
  56. hospitalName = Global.inf.hospitalName;
  57. hospitalAreaCode = Global.inf.areaCode;
  58. if (joParam == null) return;
  59. string setl_id = JsonHelper.getDestValue(joParam, "setl_id");
  60. if (setl_id == "")
  61. {
  62. MessageBox.Show("根据传入的结算编号为查询到相关信息,请手动输入查询!");
  63. return;
  64. }
  65. string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE Hospital_Dr=" + Global.inf.hospitalDr;
  66. sqlStr = sqlStr + " and SettlementID='" + setl_id + "'";
  67. JObject joSqlstr = new JObject();
  68. joSqlstr.Add("sqlStr", sqlStr);
  69. JArray jaParam = new JArray();
  70. jaParam.Add(joSqlstr);
  71. JObject joSettlQuery = new JObject();
  72. joSettlQuery.Add("params", jaParam);
  73. joSettlQuery.Add("code", "09010059");
  74. InvokeHelper invoker = new InvokeHelper();
  75. JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询结算信息");
  76. DataTable dt = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  77. dgvSettlRecord.DataSource = dt;
  78. }
  79. public void Dispose()
  80. {
  81. Dispose1(true);
  82. GC.SuppressFinalize(this);
  83. }
  84. protected virtual void Dispose1(bool disposing)
  85. {
  86. if (thread_test == null) return;
  87. if (disposed == false)
  88. {
  89. if (disposing == true)
  90. {
  91. Thread.Sleep(100);
  92. Global.writeLog("Main - aborting my thread.");
  93. thread_test.Abort();//终止线程myThread
  94. thread_test.Join();//等待线程myThread结束
  95. Global.writeLog("Main - ending.");
  96. }
  97. //释放托管资源的代码
  98. }
  99. disposed = true;
  100. }
  101. private void rbgDirecType_ValueChanged(object sender, int index, string text)
  102. {
  103. }
  104. private void btnQuery_Click(object sender, EventArgs e)
  105. {
  106. }
  107. private void btnQuery_Click_1(object sender, EventArgs e)
  108. {
  109. string sqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE Hospital_Dr=" + hospitalDr ;
  110. sqlStr = sqlStr + " and OccurTime>'" + dpST.Text + "'";
  111. sqlStr = sqlStr + " and OccurTime<'" + dpED.Text + "'";
  112. if (tbName.Text != "")
  113. {
  114. sqlStr = sqlStr + " and PatientName='" + tbName.Text + "'";
  115. }
  116. if (tbPatSettlID.Text != "")
  117. {
  118. sqlStr = sqlStr + " and SettlementID='" + tbPatSettlID.Text + "'";
  119. }
  120. if (tbHisNO.Text != "")
  121. {
  122. sqlStr = sqlStr + " and Adm_Dr='" + tbHisNO.Text + "'";
  123. }
  124. if (cbxInterface.Text != "")
  125. {
  126. sqlStr = sqlStr + " and Interface_Dr=" + Global.inf.interfaceDr + "";
  127. }
  128. if (rbgAdmType.SelectedIndex == 1)
  129. {
  130. sqlStr = sqlStr + " and AdmType=2";
  131. }
  132. if (rbgAdmType.SelectedIndex == 2)
  133. {
  134. sqlStr = sqlStr + " and AdmType=1";
  135. }
  136. if (rbgBillType.SelectedIndex == 1)
  137. {
  138. sqlStr = sqlStr + " and BillType=1 and ValidFlag=1 ";
  139. }
  140. if (rbgBillType.SelectedIndex == 2)
  141. {
  142. sqlStr = sqlStr + " and BillType=-1 and ValidFlag=0 ";
  143. }
  144. JObject joSqlstr = new JObject();
  145. joSqlstr.Add("sqlStr", sqlStr);
  146. JArray jaParam = new JArray();
  147. jaParam.Add(joSqlstr);
  148. JObject joSettlQuery = new JObject();
  149. joSettlQuery.Add("params", jaParam);
  150. joSettlQuery.Add("code", "09010059");
  151. JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询结算信息");
  152. DataTable dt = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  153. dgvSettlRecord.DataSource = dt;
  154. }
  155. private void SettlementChecklist_Load(object sender, EventArgs e)
  156. {
  157. dpST.Text = DateTime.Now.ToString("yyyy-MM-dd 00:00:00");
  158. dpED.Text = DateTime.Now.ToString("yyyy-MM-dd 23:59:59");
  159. ComboxSetter cbxSetter = new ComboxSetter();
  160. cbxSetter.setCbxInterfaceDataSource(cbxInterface);
  161. GridViewSetter grdSetter = new GridViewSetter();
  162. grdSetter.SetHeaderTextOfSettlList(dgvSettlRecord);
  163. rbgAdmType.SelectedIndex = 0;
  164. rbgBillType.SelectedIndex = 1;
  165. btnDesign.Visible = true;
  166. cbxInterface.SelectedValueChanged += new EventHandler(cbxInterface_SelectedValueChanged);
  167. }
  168. private void cbxInterface_SelectedValueChanged(object sender, EventArgs e)
  169. {
  170. DataTable dt = (DataTable)cbxInterface.DataSource;
  171. int i = cbxInterface.SelectedIndex;
  172. //赋值
  173. hospitalNO = dt.Rows[i]["HospitalNO"].ToString();
  174. //MessageBox.Show(dt.Rows[i]["HospitalDr"].ToString());
  175. //MessageBox.Show(dt.Rows[i]["HospitalDr"].ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
  176. hospitalDr = int.Parse(dt.Rows[i]["HospitalDr"].ToString());
  177. interfaceNO = dt.Rows[i]["InterfaceNO"].ToString();
  178. interfaceDr = int.Parse(dt.Rows[i]["ID"].ToString());
  179. hospitalAreaCode = dt.Rows[i]["AreaCode"].ToString();
  180. //Global.inf.centerURL = dt.Rows[i]["CenterURL"].ToString();
  181. //Global.inf.businessDllName = dt.Rows[i]["DLLName"].ToString();
  182. //Global.inf.patientAreaCode = dt.Rows[i]["AreaCode"].ToString();
  183. }
  184. private JObject getPatCheckList()
  185. {
  186. try
  187. {
  188. int i = dgvSettlRecord.CurrentRow.Index;
  189. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  190. JObject joSettel = new JObject();
  191. joSettel.Add("HospitalDr", Global.inf.hospitalDr);
  192. joSettel.Add("interfaceDr", Global.inf.interfaceDr);
  193. joSettel.Add("admID", dt.Rows[i]["AdmID"].ToString());
  194. joSettel.Add("SettlementID", dt.Rows[i]["SettlementID"].ToString());
  195. joSettel.Add("ValidFlag", dt.Rows[i]["ValidFlag"].ToString());
  196. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010066", joSettel).ToString(), "获取结算单信息");
  197. return joRtn;
  198. }
  199. catch (Exception ex)
  200. {
  201. JObject joRtn = new JObject();
  202. joRtn.Add("errorCode", -1);
  203. joRtn.Add("errorMessage", ex.Message);
  204. return joRtn;
  205. }
  206. }
  207. private void uiPanel1_Click(object sender, EventArgs e)
  208. {
  209. }
  210. [STAThread]
  211. public void design()
  212. {
  213. //try
  214. //{
  215. // string chineseSimpleFrl = Global.curEvt.path + @"\Chinese (Simplified).frl";
  216. // FastReport.Utils.Res.LoadLocale(chineseSimpleFrl);
  217. // JObject joSettleCheckList = getPatCheckList();
  218. // string errMsg;
  219. // if (JsonHelper.parseIrisRtnValue(joSettleCheckList, out errMsg) != 0)
  220. // {
  221. // MessageBox.Show("查询结算信息异常:" + errMsg);
  222. // return;
  223. // }
  224. // Report report = new Report();
  225. // try
  226. // {
  227. // var json = JsonConvert.DeserializeObject<Root>(getPatCheckList().ToString());
  228. // report.RegisterData(json.result.data.classification, "classification");
  229. // report.RegisterData(json.result.data.settlement, "settlement");
  230. // report.RegisterData(json.result.data.reginfo, "reginfo");
  231. // report.RegisterData(json.result.data.patinsuinfo, "patinsuinfo");
  232. // }
  233. // catch (Exception ex)
  234. // {
  235. // MessageBox.Show(ex.Message);
  236. // return;
  237. // }
  238. // report.Load(Global.curEvt.path + "\\frx\\河南郑州结算单.frx");
  239. // PrintDesign pf = new PrintDesign();
  240. // pf.designerControl1.Report = report;
  241. // report.Design();
  242. // pf.WindowState = FormWindowState.Maximized;
  243. // pf.ShowDialog();
  244. //}
  245. //catch (Exception ex)
  246. //{
  247. // MessageBox.Show(ex.Message);
  248. //}
  249. }
  250. [STAThread]
  251. private void print()
  252. {
  253. //string chineseSimpleFrl = Global.curEvt.path + @"\Chinese (Simplified).frl";
  254. //FastReport.Utils.Res.LoadLocale(chineseSimpleFrl);
  255. //JObject joSettleCheckList = getPatCheckList();
  256. //string errMsg;
  257. //if (JsonHelper.parseIrisRtnValue(joSettleCheckList, out errMsg) != 0)
  258. //{
  259. // MessageBox.Show("查询结算信息异常:" + errMsg);
  260. // return;
  261. //}
  262. //Report report = new Report();
  263. //try
  264. //{
  265. // var json = JsonConvert.DeserializeObject<Root>(getPatCheckList().ToString());
  266. // report.RegisterData(json.result.data.classification, "classification");
  267. // report.RegisterData(json.result.data.settlement, "settlement");
  268. // report.RegisterData(json.result.data.reginfo, "reginfo");
  269. // report.RegisterData(json.result.data.patinsuinfo, "patinsuinfo");
  270. //}
  271. //catch (Exception ex)
  272. //{
  273. // MessageBox.Show(ex.Message);
  274. // return;
  275. //}
  276. ////report.Design();
  277. //report.Load(Global.curEvt.path + "\\frx\\河南郑州结算单.frx");
  278. //this.ShowInTaskbar = true;
  279. //PrintPreview pf = new PrintPreview();
  280. //report.Preview = pf.previewControl1;
  281. //report.Show();
  282. //pf.WindowState = FormWindowState.Maximized;
  283. //pf.ShowDialog();
  284. try
  285. {
  286. int i = dgvSettlRecord.CurrentRow.Index;
  287. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  288. string AdmID = dt.Rows[i]["AdmID"].ToString();
  289. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  290. string ValidFlag = dt.Rows[i]["ValidFlag"].ToString();
  291. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  292. string BillType = dt.Rows[i]["BillType"].ToString();
  293. JObject joRtn = GetFastReportParams("", AdmID, MdtrtID, SettlementID, ValidFlag, BillType);
  294. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  295. {
  296. MessageBox.Show("获取FastReport入参失败:" + errMsg);
  297. return;
  298. }
  299. string sFastReportParam = JsonHelper.getDestValue(joRtn, "result");
  300. if (FastReportPrint(sFastReportParam, out errMsg) != 0)
  301. {
  302. MessageBox.Show("调用FastReport打印失败!" + errMsg);
  303. return;
  304. }
  305. }
  306. catch (Exception ex)
  307. {
  308. MessageBox.Show(ex.Message);
  309. return;
  310. }
  311. }
  312. public int FastReportPrint(string InParams, out string OutMsg)
  313. {
  314. Global.writeLog("调用FastReport入参:" + InParams);
  315. try
  316. {
  317. #region【调用正版FastReport打印】
  318. FastReportFrom.FastReportDll FrDll = new FastReportFrom.FastReportDll();
  319. string sRtnFr = FrDll.FastReport(InParams);
  320. JObject joRetObj = JObject.Parse(sRtnFr);
  321. if (JsonHelper.parseIrisRtnValue(joRetObj, out string errMsg) != 0)
  322. {
  323. OutMsg = "调用FastReport打印失败!" + errMsg;
  324. return -1;
  325. }
  326. else
  327. {
  328. OutMsg = "";
  329. return 0;
  330. }
  331. #endregion
  332. }
  333. catch (Exception ex)
  334. {
  335. OutMsg = "调用FastReport打印失败!" + ex.Message;
  336. return -1;
  337. }
  338. }
  339. public JObject GetFastReportParams(string designFlag, string admID, string MdtrtID, string settlementID, string validFlag,string BillType)
  340. {
  341. try
  342. {
  343. if (designFlag == "") { designFlag = "N"; }
  344. #region【获取HIS医保结算信息】
  345. JObject joSettel = new JObject();
  346. joSettel.Add("HospitalDr", Global.inf.hospitalDr);
  347. joSettel.Add("interfaceDr", Global.inf.interfaceDr);
  348. joSettel.Add("admID", admID);
  349. joSettel.Add("SettlementID", settlementID);
  350. joSettel.Add("ValidFlag", validFlag);
  351. joSettel.Add("BillType", BillType);
  352. joSettel.Add("MdtrtID", MdtrtID);
  353. JObject joRtnSettle = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010066", joSettel).ToString(), "获取结算单信息");
  354. if (JsonHelper.parseIrisRtnValue(joRtnSettle, out string errMsg) != 0)
  355. {
  356. JObject joRtnSet = new JObject();
  357. joRtnSet.Add("errorCode", -1);
  358. joRtnSet.Add("errorMessage", errMsg);
  359. joRtnSet.Add("result", "");
  360. return joRtnSet;
  361. }
  362. #endregion
  363. #region【获取住院号】
  364. JObject joTmp = new JObject();
  365. joTmp.Add("admID", joRtnSettle["result"]["data"]["settlement"][0]["AdmID"]);
  366. joTmp.Add("psn_no", joRtnSettle["result"]["data"]["settlement"][0]["PersonnelNO"]);
  367. //JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110001", joTmp).ToString(), "获取诊断信息");
  368. JObject joRtnDiag = invoker.invokeHISService(JsonHelper.setIrisInpar("05110014", joTmp).ToString(), "获取诊断信息");
  369. string medrcdno = "";
  370. if (JsonHelper.parseIrisRtnValue(joRtnSettle, out errMsg) == 0)
  371. {
  372. medrcdno = joRtnDiag["mdtrtinfo"]["medrcdno"].ToString();
  373. }
  374. #endregion
  375. #region【数据转换】
  376. if (joRtnSettle["result"]["data"]["settlement"][0]["Gender"].ToString() == "1")
  377. {
  378. joRtnSettle["result"]["data"]["settlement"][0]["Gender"] = "男";
  379. }
  380. else
  381. {
  382. joRtnSettle["result"]["data"]["settlement"][0]["Gender"] = "女";
  383. }
  384. DateTime startDate = (DateTime)joRtnSettle["result"]["data"]["reginfo"][0]["RegDate"];
  385. DateTime endDate = (DateTime)joRtnSettle["result"]["data"]["settlement"][0]["SettlementTime"];
  386. int diffInDays = (int)(endDate - startDate).TotalDays;
  387. if (diffInDays == 0)
  388. {
  389. diffInDays = 1;
  390. }
  391. joRtnSettle["result"]["data"]["settlement"][0]["HospitalizationsDays"] = diffInDays;
  392. string str = joRtnSettle["result"]["data"]["patinsuinfo"][0]["Age"].ToString();
  393. if (str.Contains("."))
  394. {
  395. joRtnSettle["result"]["data"]["patinsuinfo"][0]["Age"] = str.Split('.')[0] + "岁";
  396. }
  397. else
  398. {
  399. joRtnSettle["result"]["data"]["patinsuinfo"][0]["Age"] = str + "岁";
  400. }
  401. #endregion
  402. #region【组织FastReport调用入参】
  403. JArray jachargeItemLvFee = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.chargeItemLvFee"));
  404. JArray jaClassification = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.classification"));
  405. JArray jaSettlement = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement"));
  406. JArray jaReginfo = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.reginfo"));
  407. JArray japatinsuinfo = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.patinsuinfo"));
  408. //转换金额大写
  409. string Sumamt = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Sumamt").ToString());
  410. string HealthInsurancePay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HealthInsurancePay").ToString());
  411. string ActualPayDeductible = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].ActualPayDeductible").ToString());
  412. string PersonCashPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonCashPay").ToString());
  413. string AccountPaySumamt = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt").ToString());
  414. string FundPaySumamt = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].FundPaySumamt").ToString());
  415. string LargeExpensesSupplementPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].LargeExpensesSupplementPay").ToString());
  416. string SeriousIllnessPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].SeriousIllnessPay").ToString());
  417. string CivilserviceAllowancePay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].CivilserviceAllowancePay").ToString());
  418. string MedicalAssistPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].MedicalAssistPay").ToString());
  419. string OtherPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OtherPay").ToString());
  420. string HospitalPartAmount = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HospitalPartAmount").ToString());
  421. string AccountMutualAidAmount = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount").ToString());
  422. string InPolicyRangeAmount = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].InPolicyRangeAmount").ToString());
  423. //退费前卡余额
  424. decimal BalanceBefore = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Balance")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt")) + Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount"));
  425. //退费撤销结算单负数显示
  426. decimal LSumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Sumamt")) * -1;
  427. decimal LHealthInsurancePay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HealthInsurancePay")) * -1;
  428. decimal LAccountPaySumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt")) * -1;
  429. decimal LFundPaySumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].FundPaySumamt")) * -1;
  430. decimal LCivilserviceAllowancePay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].CivilserviceAllowancePay")) * -1;
  431. decimal LMedicalAssistPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].MedicalAssistPay")) * -1;
  432. decimal LPersonCashPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonCashPay")) * -1;
  433. decimal LAccountMutualAidAmount = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount")) * -1;
  434. decimal LBlZf = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonPaySumamt")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OwnPayAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PreSelfPayAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OverLimitAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].ActualPayDeductible"));
  435. //string BeginDate = JsonHelper.getDestValue(joRtnSettle, "result.data.reginfo[0].RegDate").ToString();
  436. //string EndDate = JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HISDischargeTime").ToString();
  437. //string InHosDays = FastReportFunction.DateDiff(Convert.ToDateTime(BeginDate), Convert.ToDateTime(EndDate));
  438. JObject jaAmountChiness = new JObject();
  439. jaAmountChiness.Add("Sumamt", Sumamt);
  440. jaAmountChiness.Add("HealthInsurancePay", HealthInsurancePay);
  441. jaAmountChiness.Add("ActualPayDeductible", ActualPayDeductible);
  442. jaAmountChiness.Add("PersonCashPay", PersonCashPay);
  443. jaAmountChiness.Add("AccountPaySumamt", AccountPaySumamt);
  444. jaAmountChiness.Add("FundPaySumamt", FundPaySumamt);
  445. jaAmountChiness.Add("LargeExpensesSupplementPay", LargeExpensesSupplementPay);
  446. jaAmountChiness.Add("SeriousIllnessPay", SeriousIllnessPay);
  447. jaAmountChiness.Add("CivilserviceAllowancePay", CivilserviceAllowancePay);
  448. jaAmountChiness.Add("MedicalAssistPay", MedicalAssistPay);
  449. jaAmountChiness.Add("OtherPay", OtherPay);
  450. jaAmountChiness.Add("HospitalPartAmount", HospitalPartAmount);
  451. jaAmountChiness.Add("AccountMutualAidAmount", AccountMutualAidAmount);
  452. jaAmountChiness.Add("InPolicyRangeAmount", InPolicyRangeAmount); //合规费用
  453. jaAmountChiness.Add("SettlOpter", Global.user.name);
  454. jaAmountChiness.Add("medrcdno", medrcdno);
  455. //其他自定义处理字段
  456. jaAmountChiness.Add("BalanceBefore", BalanceBefore);//结算前卡余额
  457. jaAmountChiness.Add("LSumamt", LSumamt);
  458. jaAmountChiness.Add("LHealthInsurancePay", LHealthInsurancePay);
  459. jaAmountChiness.Add("LAccountPaySumamt", LAccountPaySumamt);
  460. jaAmountChiness.Add("LFundPaySumamt", LFundPaySumamt);
  461. jaAmountChiness.Add("LCivilserviceAllowancePay", LCivilserviceAllowancePay);
  462. jaAmountChiness.Add("LMedicalAssistPay", LMedicalAssistPay);
  463. jaAmountChiness.Add("LPersonCashPay", LPersonCashPay);
  464. jaAmountChiness.Add("LAccountMutualAidAmount", LAccountMutualAidAmount);
  465. jaAmountChiness.Add("LBlZf", LBlZf);
  466. JArray jachinessParams = new JArray();
  467. jachinessParams.Add(jaAmountChiness);
  468. JObject joDataResult = new JObject();
  469. joDataResult.Add("SettlementInfo", jaSettlement);
  470. joDataResult.Add("ChargeItemLvFee", jachargeItemLvFee);
  471. joDataResult.Add("ClassificationInfo", jaClassification);
  472. joDataResult.Add("RegInfo", jaReginfo);
  473. joDataResult.Add("Patinsuinfo", japatinsuinfo);
  474. joDataResult.Add("ChinessSummat", jachinessParams);
  475. #region【门诊撤销结算单打印需要体现费用信息】
  476. String outParam;
  477. JObject joRtnRis = new JObject();
  478. JObject joHisFee = new JObject();
  479. if (Global.pat.admType == 1)
  480. {
  481. Global.pat.adm_Dr = int.Parse(joRtnSettle["result"]["data"]["settlement"][0]["AdmID"].ToString());
  482. Global.pat.billID = "";
  483. Global.pat.recordID = joRtnSettle["result"]["data"]["settlement"][0]["RecordID"].ToString();
  484. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  485. {
  486. JObject joRtnSet = new JObject();
  487. joRtnSet.Add("errorCode", -1);
  488. joRtnSet.Add("errorMessage", "获取HIS费用失败");
  489. joRtnSet.Add("result", "");
  490. return joRtnSet;
  491. }
  492. else
  493. {
  494. joRtnRis = JObject.Parse(outParam);
  495. }
  496. joHisFee = JObject.Parse(outParam);
  497. if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  498. {
  499. JObject joRtnSet = new JObject();
  500. joRtnSet.Add("errorCode", -1);
  501. joRtnSet.Add("errorMessage", "医保平台转换费用失败");
  502. joRtnSet.Add("result", "");
  503. return joRtnSet;
  504. }
  505. joDataResult.Add("Feeinfo", JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data")));
  506. }
  507. #endregion【门诊撤销结算单打印需要体现费用信息】
  508. JObject joParams = new JObject();
  509. if (Global.pat.admType == 1)
  510. {
  511. joParams.Add("fastReportCode", "SP14"); //这个要从表取值
  512. }else
  513. {
  514. joParams.Add("fastReportCode", "SP11"); //湖北普瑞门诊结算单撤销结算单从SP14打印
  515. }
  516. joParams.Add("hospID", Global.inf.hisHospitalDr.ToString());
  517. joParams.Add("printCode", "14");
  518. joParams.Add("templateID", "");
  519. JArray jaParams = new JArray();
  520. jaParams.Add(joParams);
  521. JObject joReportParams = new JObject();
  522. joReportParams.Add("params", jaParams);
  523. joReportParams.Add("code", "01040306");
  524. JObject joParam = new JObject();
  525. joParam.Add("designFlag", designFlag);
  526. joParam.Add("logFlag", "N");
  527. joParam.Add("dataParams", "");
  528. joParam.Add("pdfName", "");
  529. joParam.Add("reportparams", joReportParams);
  530. joParam.Add("dataResult", joDataResult);
  531. JObject joDataURL = new JObject();
  532. joDataURL.Add("dataIP", Global.hisConfig.ip);
  533. joDataURL.Add("urlAddress", Global.hisConfig.url);
  534. joDataURL.Add("authorization", Global.hisConfig.authorization);
  535. joParam.Add("dataURL", joDataURL);
  536. JArray jaParam = new JArray();
  537. jaParam.Add(joParam);
  538. JObject joInparam = new JObject();
  539. joInparam.Add("params", JArray.FromObject(jaParam));
  540. joInparam.Add("session", Global.curEvt.jaSession);
  541. #endregion
  542. JObject joRtn = new JObject();
  543. joRtn.Add("errorCode", 0);
  544. joRtn.Add("errorMessage", "");
  545. joRtn.Add("result", joInparam.ToString());
  546. return joRtn;
  547. }
  548. catch (Exception ex)
  549. {
  550. JObject joRtnEx = new JObject();
  551. joRtnEx.Add("errorCode", -1);
  552. joRtnEx.Add("errorMessage", ex.Message);
  553. joRtnEx.Add("result", "");
  554. return joRtnEx;
  555. }
  556. }
  557. //湖北市医保单独fastReport打印方法
  558. [STAThread]
  559. private void cityPrint()
  560. {
  561. try
  562. {
  563. int i = dgvSettlRecord.CurrentRow.Index;
  564. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  565. string AdmID = dt.Rows[i]["AdmID"].ToString();
  566. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  567. string ValidFlag = dt.Rows[i]["ValidFlag"].ToString();
  568. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  569. string BillType = dt.Rows[i]["BillType"].ToString();
  570. JObject pJoInparm = new JObject();
  571. pJoInparm.Add("MdtrtCertType", dt.Rows[i]["MdtrtCertType"].ToString());
  572. JObject joRtn = cityGetFastReportParams("", AdmID, MdtrtID, SettlementID, ValidFlag, BillType, pJoInparm);
  573. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  574. {
  575. MessageBox.Show("获取FastReport入参失败:" + errMsg);
  576. return;
  577. }
  578. string sFastReportParam = JsonHelper.getDestValue(joRtn, "result");
  579. if (FastReportPrint(sFastReportParam, out errMsg) != 0)
  580. {
  581. MessageBox.Show("调用FastReport打印失败!" + errMsg);
  582. return;
  583. }
  584. }
  585. catch (Exception ex)
  586. {
  587. MessageBox.Show(ex.Message);
  588. return;
  589. }
  590. }
  591. //湖北市医保单独获取fastReport打印入参
  592. public JObject cityGetFastReportParams(string designFlag, string admID, string MdtrtID, string settlementID, string validFlag, string BillType, JObject pJoInparm)
  593. {
  594. try
  595. {
  596. if (designFlag == "") { designFlag = "N"; }
  597. //string sqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE SettlementID='" + settlementID + "'";
  598. //sqlStr = sqlStr + " and Adm_Dr='" + admID + "'";
  599. //sqlStr = sqlStr + " and ValidFlag='" + validFlag + "'";
  600. //sqlStr = sqlStr + " and BillType='" + BillType + "'";
  601. //JObject joSqlstr = new JObject();
  602. //joSqlstr.Add("sqlStr", sqlStr);
  603. //JArray jaParam = new JArray();
  604. //jaParam.Add(joSqlstr);
  605. //JObject joSettlQuery = new JObject();
  606. //joSettlQuery.Add("params", jaParam);
  607. //joSettlQuery.Add("code", "09010059");
  608. //JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询结算信息");
  609. //DataTable dt = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  610. #region【获取HIS医保结算信息】
  611. JObject joSettel = new JObject();
  612. joSettel.Add("HospitalDr", Global.inf.hospitalDr);
  613. joSettel.Add("interfaceDr", Global.inf.interfaceDr);
  614. joSettel.Add("admID", admID);
  615. joSettel.Add("SettlementID", settlementID);
  616. joSettel.Add("ValidFlag", validFlag);
  617. joSettel.Add("BillType", BillType);
  618. joSettel.Add("MdtrtID", MdtrtID);
  619. JObject joRtnSettle = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010066", joSettel).ToString(), "获取结算单信息");
  620. if (JsonHelper.parseIrisRtnValue(joRtnSettle, out string errMsg) != 0)
  621. {
  622. JObject joRtnSet = new JObject();
  623. joRtnSet.Add("errorCode", -1);
  624. joRtnSet.Add("errorMessage", errMsg);
  625. joRtnSet.Add("result", "");
  626. return joRtnSet;
  627. }
  628. #endregion
  629. #region【获取住院号】
  630. JObject joTmp = new JObject();
  631. joTmp.Add("admID", joRtnSettle["result"]["data"]["settlement"][0]["AdmID"]);
  632. joTmp.Add("psn_no", joRtnSettle["result"]["data"]["settlement"][0]["PersonnelNO"]);
  633. //JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110001", joTmp).ToString(), "获取诊断信息");
  634. JObject joRtnDiag = invoker.invokeHISService(JsonHelper.setIrisInpar("05110014", joTmp).ToString(), "获取诊断信息");
  635. string medrcdno = "";
  636. string mdtrtCertType = "";//医保使用凭证 电子凭证 身份证 社保卡
  637. string adtime = JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].SettlementTime").ToString();
  638. string distime = "";
  639. int billtype = int.Parse(BillType);
  640. //取就诊日期日期部分
  641. DateTime addateTime;
  642. if (DateTime.TryParse(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].SettlementTime").ToString(), out addateTime))
  643. {
  644. distime = addateTime.Date.ToString("yyyy-MM-dd"); // 格式化输出日期部分
  645. adtime = addateTime.Date.ToString("yyyy-MM-dd"); // 格式化输出日期部分
  646. }
  647. if (JsonHelper.parseIrisRtnValue(joRtnSettle, out errMsg) == 0)
  648. {
  649. medrcdno = joRtnDiag["mdtrtinfo"]["medrcdno"].ToString();
  650. }
  651. #endregion
  652. #region【数据转换】
  653. if (joRtnSettle["result"]["data"]["settlement"][0]["Gender"].ToString() == "1")
  654. {
  655. joRtnSettle["result"]["data"]["settlement"][0]["Gender"] = "男";
  656. }
  657. else
  658. {
  659. joRtnSettle["result"]["data"]["settlement"][0]["Gender"] = "女";
  660. }
  661. if (pJoInparm["MdtrtCertType"].ToString() == "01")
  662. {
  663. mdtrtCertType = "医保电子凭证";
  664. }
  665. else if (pJoInparm["MdtrtCertType"].ToString() == "02")
  666. {
  667. mdtrtCertType = "居民身份证";
  668. }
  669. else if (pJoInparm["MdtrtCertType"].ToString() == "03")
  670. {
  671. mdtrtCertType = "社保卡";
  672. }
  673. DateTime startDate = (DateTime)joRtnSettle["result"]["data"]["reginfo"][0]["RegDate"];
  674. DateTime endDate = (DateTime)joRtnSettle["result"]["data"]["settlement"][0]["SettlementTime"];
  675. int diffInDays = (int)(endDate - startDate).TotalDays;
  676. if (diffInDays == 0)
  677. {
  678. diffInDays = 1;
  679. }
  680. joRtnSettle["result"]["data"]["settlement"][0]["HospitalizationsDays"] = diffInDays;
  681. string str = joRtnSettle["result"]["data"]["patinsuinfo"][0]["Age"].ToString();
  682. if (str.Contains("."))
  683. {
  684. joRtnSettle["result"]["data"]["patinsuinfo"][0]["Age"] = str.Split('.')[0] + "岁";
  685. }
  686. else
  687. {
  688. joRtnSettle["result"]["data"]["patinsuinfo"][0]["Age"] = str + "岁";
  689. }
  690. string ISCX = "";
  691. if (BillType == "-1")
  692. {
  693. ISCX = "撤销";
  694. }
  695. #endregion
  696. #region【组织FastReport调用入参】
  697. JArray jachargeItemLvFee = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.chargeItemLvFee"));
  698. JArray jaClassification = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.classification"));
  699. JArray jaSettlement = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement"));
  700. JArray jaReginfo = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.reginfo"));
  701. JArray japatinsuinfo = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.patinsuinfo"));
  702. //退费前卡余额
  703. decimal BalanceBefore = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Balance")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt")) + Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount"));
  704. //退费撤销结算单负数显示
  705. decimal LSumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Sumamt")) * billtype;
  706. decimal LFundPaySumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].FundPaySumamt")) * billtype;
  707. decimal LHealthInsurancePay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HealthInsurancePay")) * billtype;
  708. decimal LLargeExpensesSupplementPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].LargeExpensesSupplementPay")) * billtype;
  709. decimal LSeriousIllnessPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].SeriousIllnessPay")) * billtype;
  710. decimal LMedicalAssistPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].MedicalAssistPay")) * billtype;
  711. decimal LEnterpriseSupplementPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].EnterpriseSupplementPay")) * billtype;
  712. decimal LOtherPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OtherPay")) * billtype;
  713. decimal LCivilserviceAllowancePay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].CivilserviceAllowancePay")) * billtype;
  714. decimal LDEZF = LLargeExpensesSupplementPay + LSeriousIllnessPay;
  715. decimal LHospitalPartAmount = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HospitalPartAmount")) * billtype;
  716. decimal LPersonPaySumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonPaySumamt")) * billtype;
  717. decimal LAccountPaySumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt")) * billtype;
  718. decimal LPersonCashPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonCashPay")) * billtype;
  719. decimal LAccountMutualAidAmount = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount")) * billtype;
  720. decimal LBlZf = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonPaySumamt")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OwnPayAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PreSelfPayAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OverLimitAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].ActualPayDeductible"));
  721. //转换金额大写
  722. string Sumamt = FastReportFunction.MoneyToUpper(LSumamt.ToString());
  723. string HealthInsurancePay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HealthInsurancePay").ToString());
  724. string ActualPayDeductible = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].ActualPayDeductible").ToString());
  725. string PersonCashPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonCashPay").ToString());
  726. string AccountPaySumamt = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt").ToString());
  727. string FundPaySumamt = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].FundPaySumamt").ToString());
  728. string LargeExpensesSupplementPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].LargeExpensesSupplementPay").ToString());
  729. string SeriousIllnessPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].SeriousIllnessPay").ToString());
  730. string CivilserviceAllowancePay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].CivilserviceAllowancePay").ToString());
  731. string MedicalAssistPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].MedicalAssistPay").ToString());
  732. string OtherPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OtherPay").ToString());
  733. string HospitalPartAmount = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HospitalPartAmount").ToString());
  734. string AccountMutualAidAmount = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount").ToString());
  735. string InPolicyRangeAmount = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].InPolicyRangeAmount").ToString());
  736. //string BeginDate = JsonHelper.getDestValue(joRtnSettle, "result.data.reginfo[0].RegDate").ToString();
  737. //string EndDate = JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HISDischargeTime").ToString();
  738. //string InHosDays = FastReportFunction.DateDiff(Convert.ToDateTime(BeginDate), Convert.ToDateTime(EndDate));
  739. JObject jaAmountChiness = new JObject();
  740. jaAmountChiness.Add("Sumamt", Sumamt);
  741. jaAmountChiness.Add("HealthInsurancePay", HealthInsurancePay);
  742. jaAmountChiness.Add("ActualPayDeductible", ActualPayDeductible);
  743. jaAmountChiness.Add("PersonCashPay", PersonCashPay);
  744. jaAmountChiness.Add("AccountPaySumamt", AccountPaySumamt);
  745. jaAmountChiness.Add("FundPaySumamt", FundPaySumamt);
  746. jaAmountChiness.Add("LargeExpensesSupplementPay", LargeExpensesSupplementPay);
  747. jaAmountChiness.Add("SeriousIllnessPay", SeriousIllnessPay);
  748. jaAmountChiness.Add("CivilserviceAllowancePay", CivilserviceAllowancePay);
  749. jaAmountChiness.Add("MedicalAssistPay", MedicalAssistPay);
  750. jaAmountChiness.Add("OtherPay", OtherPay);
  751. jaAmountChiness.Add("HospitalPartAmount", HospitalPartAmount);
  752. jaAmountChiness.Add("AccountMutualAidAmount", AccountMutualAidAmount);
  753. jaAmountChiness.Add("InPolicyRangeAmount", InPolicyRangeAmount); //合规费用
  754. jaAmountChiness.Add("SettlOpter", Global.user.name);
  755. jaAmountChiness.Add("medrcdno", medrcdno);
  756. jaAmountChiness.Add("mdtrtCertType", mdtrtCertType);
  757. jaAmountChiness.Add("hospitalNO",Global.inf.hospitalNO);
  758. jaAmountChiness.Add("hospitalName", Global.inf.hospitalName);
  759. //其他自定义处理字段
  760. jaAmountChiness.Add("BalanceBefore", BalanceBefore);//结算前卡余额
  761. jaAmountChiness.Add("LSumamt", LSumamt);
  762. jaAmountChiness.Add("LFundPaySumamt", LFundPaySumamt);
  763. jaAmountChiness.Add("LHealthInsurancePay", LHealthInsurancePay);
  764. jaAmountChiness.Add("LMedicalAssistPay", LMedicalAssistPay);
  765. jaAmountChiness.Add("LCivilserviceAllowancePay", LCivilserviceAllowancePay);
  766. jaAmountChiness.Add("LLargeExpensesSupplementPay", LLargeExpensesSupplementPay);
  767. jaAmountChiness.Add("LSeriousIllnessPay", LSeriousIllnessPay);
  768. jaAmountChiness.Add("LEnterpriseSupplementPay", LEnterpriseSupplementPay);
  769. jaAmountChiness.Add("LOtherPay", LOtherPay);
  770. jaAmountChiness.Add("LDEZF", LDEZF);
  771. jaAmountChiness.Add("LHospitalPartAmount", LHospitalPartAmount);
  772. jaAmountChiness.Add("LPersonPaySumamt", LPersonPaySumamt);
  773. jaAmountChiness.Add("LAccountPaySumamt", LAccountPaySumamt);
  774. jaAmountChiness.Add("LPersonCashPay", LPersonCashPay);
  775. jaAmountChiness.Add("LAccountMutualAidAmount", LAccountMutualAidAmount);
  776. jaAmountChiness.Add("LBlZf", LBlZf);
  777. jaAmountChiness.Add("adtime", adtime);
  778. jaAmountChiness.Add("distime", distime);
  779. jaAmountChiness.Add("iscx", ISCX);
  780. JArray jachinessParams = new JArray();
  781. jachinessParams.Add(jaAmountChiness);
  782. JObject joDataResult = new JObject();
  783. joDataResult.Add("SettlementInfo", jaSettlement);
  784. joDataResult.Add("ChargeItemLvFee", jachargeItemLvFee);
  785. joDataResult.Add("ClassificationInfo", jaClassification);
  786. joDataResult.Add("RegInfo", jaReginfo);
  787. joDataResult.Add("Patinsuinfo", japatinsuinfo);
  788. joDataResult.Add("ChinessSummat", jachinessParams);
  789. JObject joParams = new JObject();
  790. joParams.Add("fastReportCode", "printSettlementList"); //这个要从表取值
  791. joParams.Add("hospID", Global.inf.hisHospitalDr.ToString());
  792. joParams.Add("printCode", "City");
  793. joParams.Add("templateID", "");
  794. JArray jaParams = new JArray();
  795. jaParams.Add(joParams);
  796. JObject joReportParams = new JObject();
  797. joReportParams.Add("params", jaParams);
  798. joReportParams.Add("code", "01040306");
  799. JObject joParam = new JObject();
  800. joParam.Add("designFlag", designFlag);
  801. joParam.Add("logFlag", "N");
  802. joParam.Add("dataParams", "");
  803. joParam.Add("pdfName", "");
  804. joParam.Add("reportparams", joReportParams);
  805. joParam.Add("dataResult", joDataResult);
  806. JObject joDataURL = new JObject();
  807. joDataURL.Add("dataIP", Global.hisConfig.ip);
  808. joDataURL.Add("urlAddress", Global.hisConfig.url);
  809. joDataURL.Add("authorization", Global.hisConfig.authorization);
  810. joParam.Add("dataURL", joDataURL);
  811. JArray jaParam = new JArray();
  812. jaParam.Add(joParam);
  813. JObject joInparam = new JObject();
  814. joInparam.Add("params", JArray.FromObject(jaParam));
  815. joInparam.Add("session", Global.curEvt.jaSession);
  816. #endregion
  817. JObject joRtn = new JObject();
  818. joRtn.Add("errorCode", 0);
  819. joRtn.Add("errorMessage", "");
  820. joRtn.Add("result", joInparam.ToString());
  821. return joRtn;
  822. }
  823. catch (Exception ex)
  824. {
  825. JObject joRtnEx = new JObject();
  826. joRtnEx.Add("errorCode", -1);
  827. joRtnEx.Add("errorMessage", ex.Message);
  828. joRtnEx.Add("result", "");
  829. return joRtnEx;
  830. }
  831. }
  832. [STAThread]
  833. private void preview()
  834. {
  835. //Report report = new Report();
  836. //try
  837. //{
  838. // var json = JsonConvert.DeserializeObject<Root>(getPatCheckList().ToString());
  839. // report.RegisterData(json.result.data.classification, "classification");
  840. // report.RegisterData(json.result.data.settlement, "settlement");
  841. // report.RegisterData(json.result.data.reginfo, "reginfo");
  842. // report.RegisterData(json.result.data.patinsuinfo, "patinsuinfo");
  843. //}
  844. //catch (Exception ex)
  845. //{
  846. // MessageBox.Show(ex.Message);
  847. // return;
  848. //}
  849. ////report.Design();
  850. //report.Load(Global.curEvt.path + "\\frx\\湖北武汉结算单.frx");
  851. ////report.Show();
  852. //PrintPreview preview1 = new PrintPreview();
  853. //preview1.Show();
  854. //report.Preview = preview1.previewControl1;
  855. //report.Prepare(); //准备
  856. //report.ShowPrepared(); //显示
  857. //preview1.Show();
  858. }
  859. private void uiButton2_Click(object sender, EventArgs e)
  860. {
  861. Close();
  862. }
  863. public void btnPrint_Click(object sender, EventArgs e)
  864. {
  865. string errorMsg;
  866. int iHis = dgvSettlRecord.CurrentRow.Index;
  867. String BType = dgvSettlRecord.Rows[iHis].Cells["BillType"].Value.ToString();
  868. Global.pat.admType =int.Parse(dgvSettlRecord.Rows[iHis].Cells["admType"].Value.ToString());
  869. JObject joData = new JObject();
  870. joData.Add("mdtrt_id", dgvSettlRecord.Rows[iHis].Cells["MdtrtID"].Value.ToString());
  871. joData.Add("setl_id", dgvSettlRecord.Rows[iHis].Cells["SettlementID"].Value.ToString());
  872. joData.Add("psn_no", dgvSettlRecord.Rows[iHis].Cells["PersonnelNO"].Value.ToString());
  873. joData.Add("med_type", dgvSettlRecord.Rows[iHis].Cells["MedicalType"].Value.ToString());
  874. JObject joInput = new JObject();
  875. joInput.Add("data", joData);
  876. Global.pat.insuplc_admdvs = dgvSettlRecord.Rows[iHis].Cells["insuplc_admdvs"].Value.ToString();//更新参保地
  877. if (BType == "1") {
  878. #region【调用医保交易YH03打印】
  879. InvokeHelper invoker = new InvokeHelper();
  880. JObject joRtn = invoker.invokeCenterService("YH03", JsonHelper.setCenterInpar("YH03", joInput));
  881. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  882. {
  883. MessageBox.Show("打印失败:" + errorMsg);
  884. return;
  885. }
  886. #endregion
  887. }
  888. else if (BType == "-1")
  889. {
  890. #region【调用FastRepor打印】
  891. try
  892. {
  893. //Thread thread = new Thread(new ThreadStart(print));
  894. //thread.SetApartmentState(ApartmentState.STA); //重点
  895. //thread.Start();
  896. //thread.Join();
  897. print();
  898. }
  899. catch (Exception ex)
  900. {
  901. Global.writeLog("结算单打印异常:" + ex.Message);
  902. MessageBox.Show("打印异常:" + ex.Message);
  903. }
  904. #endregion
  905. }
  906. }
  907. public void btnDesign_Click(object sender, EventArgs e)
  908. {
  909. //try
  910. //{
  911. // Thread thread = new Thread(new ThreadStart(design));
  912. // thread.SetApartmentState(ApartmentState.STA); //重点
  913. // thread.Start();
  914. // thread.Join();
  915. //}
  916. //catch (Exception ex)
  917. //{
  918. // Global.writeLog("结算单设计预览异常:" + ex.Message);
  919. // MessageBox.Show("设计预览异常:" + ex.Message);
  920. //}
  921. if (dgvSettlRecord.RowCount <= 0)
  922. {
  923. MessageBox.Show("请先查询结算数据!");
  924. return;
  925. }
  926. try
  927. {
  928. int i = dgvSettlRecord.CurrentRow.Index;
  929. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  930. Global.pat.admType = int.Parse(dgvSettlRecord.Rows[i].Cells["admType"].Value.ToString());
  931. string AdmID = dt.Rows[i]["AdmID"].ToString();
  932. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  933. string ValidFlag = dt.Rows[i]["ValidFlag"].ToString();
  934. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  935. string BillType = dt.Rows[i]["BillType"].ToString();
  936. JObject joRtn = GetFastReportParams("Y", AdmID, MdtrtID, SettlementID, ValidFlag, BillType);
  937. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  938. {
  939. MessageBox.Show("获取FastReport入参失败:" + errMsg);
  940. return;
  941. }
  942. string sFastReportParam = JsonHelper.getDestValue(joRtn, "result");
  943. if (FastReportPrint(sFastReportParam, out errMsg) != 0)
  944. {
  945. MessageBox.Show("调用FastReport设计失败!" + errMsg);
  946. return;
  947. }
  948. }
  949. catch (Exception ex)
  950. {
  951. MessageBox.Show(ex.Message);
  952. return;
  953. }
  954. }
  955. private void SettlementChecklist_FormClosed(object sender, FormClosedEventArgs e)
  956. {
  957. Dispose();
  958. }
  959. //市医保进销存992001结算信息上传
  960. private void JXCJSToolStripMenuItem_Click(object sender, EventArgs e)
  961. {
  962. if (dgvSettlRecord.RowCount <= 0)
  963. {
  964. MessageBox.Show("请先查询结算数据!");
  965. return;
  966. }
  967. string sqlStr;
  968. try
  969. {
  970. int m = dgvSettlRecord.CurrentRow.Index;
  971. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  972. string msgid = dt.Rows[m]["msgid"].ToString();
  973. string SettlementID = dt.Rows[m]["SettlementID"].ToString();
  974. string ValidFlag = dt.Rows[m]["ValidFlag"].ToString();
  975. string MdtrtID = dt.Rows[m]["MdtrtID"].ToString();
  976. string BillType = dt.Rows[m]["BillType"].ToString();
  977. string AdmID= dt.Rows[m]["AdmID"].ToString();
  978. string billID = dt.Rows[m]["billID"].ToString();
  979. string recordID = dt.Rows[m]["recordID"].ToString();
  980. Global.pat.adm_Dr = int.Parse(AdmID);
  981. Global.pat.billID = billID;
  982. Global.pat.recordID = recordID;
  983. if (BillType == "-1")
  984. {
  985. MessageBox.Show("请选择结算正记录!该记录为退费记录");
  986. }
  987. sqlStr = "SELECT * FROM BS_MedInsuTransactionLog WHERE MSGID='" + msgid + "'";
  988. JObject joSqlstr = new JObject();
  989. joSqlstr.Add("sqlStr", sqlStr);
  990. JObject joRtn = mIS.QueryTransactionLog(joSqlstr);
  991. if (joRtn["result"]["data"].ToString() == "[]")
  992. {
  993. MessageBox.Show("查询结果为空!");
  994. return;
  995. }
  996. //DataTable dtlog = (DataTable)joRtn["result"]["data"][0].ToObject(typeof(DataTable));
  997. JObject Outlog = JObject.Parse(joRtn["result"]["data"][0]["OutparamPlain"].ToString());
  998. dynamic setlinfo = new JObject();//结算信息节点
  999. setlinfo.setl_id = Outlog["setl_id"];//结算ID
  1000. setlinfo.mdtrt_id = Outlog["mdtrt_id"];//就诊ID
  1001. setlinfo.psn_no = Outlog["psn_no"];//人员编号
  1002. setlinfo.psn_name = Outlog["psn_name"];//人员姓名
  1003. setlinfo.psn_cert_type = Outlog["psn_cert_type"];//凭证类型
  1004. setlinfo.certno = Outlog["certno"];//证件号码
  1005. setlinfo.gend = Outlog["gend"];//性别
  1006. setlinfo.naty = Outlog["naty"];//民族
  1007. setlinfo.brdy = Outlog["brdy"];//出生日期
  1008. setlinfo.age = Outlog["age"];//年龄
  1009. setlinfo.insutype = Outlog["insutype"];//险种类型
  1010. setlinfo.psn_type = Outlog["psn_type"];//人员类别
  1011. setlinfo.cvlserv_flag = Outlog["cvlserv_flag"];//公务员标志
  1012. setlinfo.setl_time = Outlog["setl_time"];//结算时间
  1013. setlinfo.mdtrt_cert_type = Outlog["mdtrt_cert_type"];//就诊凭证类型
  1014. setlinfo.med_type = Outlog["med_type"];//医疗类别
  1015. setlinfo.medfee_sumamt = Outlog["medfee_sumamt"];//医疗费总额
  1016. setlinfo.fulamt_ownpay_amt = Outlog["fulamt_ownpay_amt"];//全自费金额
  1017. setlinfo.overlmt_selfpay = Outlog["overlmt_selfpay"];//超限价自费费用
  1018. setlinfo.preselfpay_amt = Outlog["preselfpay_amt"];//先行自付金额
  1019. setlinfo.inscp_scp_amt = Outlog["inscp_scp_amt"];//符合政策范围金额
  1020. setlinfo.act_pay_dedc = Outlog["act_pay_dedc"];//实际支付起付线
  1021. setlinfo.hifp_pay = Outlog["hifp_pay"];//基本医疗保险统筹基金支出
  1022. setlinfo.pool_prop_selfpay = Outlog["pool_prop_selfpay"];//基本医疗保险统筹基金支付比例
  1023. setlinfo.cvlserv_pay = Outlog["cvlserv_pay"];//公务员医疗补助资金支出
  1024. setlinfo.hifes_pay = Outlog["hifes_pay"];//企业补充医疗保险基金支出
  1025. setlinfo.hifmi_pay = Outlog["hifmi_pay"];//居民大病保险资金支出
  1026. setlinfo.hifob_pay = Outlog["hifob_pay"];//职工大额医疗费用补助基金支出
  1027. setlinfo.maf_pay = Outlog["maf_pay"];//医疗救助基金支出
  1028. setlinfo.oth_pay = Outlog["oth_pay"];//结算ID
  1029. setlinfo.fund_pay_sumamt = Outlog["fund_pay_sumamt"];//基金支付总额
  1030. setlinfo.psn_part_amt = Outlog["psn_part_amt"];//个人负担总金额
  1031. setlinfo.acct_pay = Outlog["acct_pay"];//个人账户支出
  1032. setlinfo.psn_cash_pay = Outlog["psn_cash_pay"];//个人现金支出
  1033. setlinfo.balc = Outlog["balc"];//余额
  1034. setlinfo.acct_mulaid_pay = Outlog["acct_mulaid_pay"];//个人账户共济支付金额
  1035. setlinfo.medins_setl_id = Outlog["medins_setl_id"];//医药机构结算结算ID
  1036. setlinfo.clr_optins = Outlog["clr_optins"];//clr_optins
  1037. setlinfo.clr_way = Outlog["clr_way"];//clr_way
  1038. setlinfo.clr_type = Outlog["clr_type"];//clr_type
  1039. setlinfo.exp_content = Outlog["exp_content"];//exp_content
  1040. setlinfo.hosp_part_amt = Outlog["hosp_part_amt"];//医院负担金额
  1041. setlinfo.hifdm_pay = 0;//伤残人员医疗保障基金支出
  1042. //string outParam = "";
  1043. ////获取IS费用
  1044. //if (hIS.getHisFee(Global.pat, out outParam) != 0)
  1045. //{
  1046. // MessageBox.Show("获取HIS费用失败");
  1047. //}
  1048. ////调用医保平台转换HIS费用(转换医保编码等)
  1049. //JObject joHisFee = JObject.Parse(outParam);
  1050. //if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  1051. //{
  1052. // MessageBox.Show("获取HIS费用医保对照关系失败");
  1053. //}
  1054. //JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  1055. // JObject jaFeeOne=new JObject();
  1056. //for (int i = 0; i < jaFeeDetail.Count; i++)
  1057. //{
  1058. // jaFeeOne.Add("feedetl_sn", jaFeeDetail[i]["feedetl_sn"]);//费用明细流水号
  1059. // jaFeeOne.Add("rxno", "");//处方号
  1060. // if (string.IsNullOrEmpty(jaFeeDetail[i]["rx_circ_flag"].ToString()))
  1061. // {
  1062. // jaFeeOne.Add("rx_circ_flag", "");//外购处方标志
  1063. // }
  1064. // else
  1065. // {
  1066. // jaFeeOne.Add("rx_circ_flag", jaFeeDetail[i]["rx_circ_flag"]);//外购处方标志
  1067. // }
  1068. // jaFeeOne.Add("fee_ocur_time", jaFeeDetail[i]["fee_ocur_time"]);
  1069. // jaFeeOne.Add("med_list_codg", jaFeeDetail[i]["med_list_codg"]);
  1070. // jaFeeOne.Add("medins_list_codg", jaFeeDetail[i]["medins_list_codg"]);
  1071. // jaFeeOne.Add("medins_list_name", jaFeeDetail[i]["medins_list_desc"]);
  1072. // jaFeeOne.Add("prodname", jaFeeDetail[i]["medins_list_desc"]);
  1073. // if (string.IsNullOrEmpty(jaFeeDetail[i]["spec"].ToString()))
  1074. // {
  1075. // jaFeeOne.Add("spec", "");
  1076. // }
  1077. // else
  1078. // {
  1079. // jaFeeOne.Add("spec", jaFeeDetail[i]["spec"]);
  1080. // }
  1081. // if (string.IsNullOrEmpty(jaFeeDetail[i]["doseForm"].ToString()))
  1082. // {
  1083. // jaFeeOne.Add("dosform_name", "");
  1084. // }
  1085. // else
  1086. // {
  1087. // jaFeeOne.Add("dosform_name", jaFeeDetail[i]["doseForm"]);
  1088. // }
  1089. // jaFeeOne.Add(" det_item_fee_sumamt", jaFeeDetail[i]["det_item_fee_sumamt"]);
  1090. // jaFeeOne.Add("cnt", jaFeeDetail[i]["cnt"]);
  1091. // jaFeeOne.Add("pric", jaFeeDetail[i]["pric"]);
  1092. // if (string.IsNullOrEmpty(jaFeeDetail[i]["sin_dos_dscr"].ToString()))
  1093. // {
  1094. // jaFeeOne.Add("sin_dos_dscr", "");
  1095. // }
  1096. // else
  1097. // {
  1098. // jaFeeOne.Add("sin_dos_dscr", jaFeeDetail[i]["sin_dos_dscr"]);
  1099. // }
  1100. // if (string.IsNullOrEmpty(jaFeeDetail[i]["used_frqu_dscr"].ToString()))
  1101. // {
  1102. // jaFeeOne.Add("used_frqu_dscr", "");
  1103. // }
  1104. // else
  1105. // {
  1106. // jaFeeOne.Add("used_frqu_dscr", jaFeeDetail[i]["used_frqu_dscr"]);
  1107. // }
  1108. // if (string.IsNullOrEmpty(jaFeeDetail[i]["prd_days"].ToString()))
  1109. // {
  1110. // jaFeeOne.Add("prd_days", "");
  1111. // }
  1112. // else
  1113. // {
  1114. // jaFeeOne.Add("prd_days", jaFeeDetail[i]["prd_days"]);
  1115. // }
  1116. // MessageBox.Show("555");
  1117. // if (string.IsNullOrEmpty(jaFeeDetail[i]["medc_way_dscr"].ToString()))
  1118. // {
  1119. // jaFeeOne.Add("medc_way_dscr", "");
  1120. // }
  1121. // else
  1122. // {
  1123. // jaFeeOne.Add("medc_way_dscr", jaFeeDetail[i]["medc_way_dscr"]);
  1124. // }
  1125. // if (string.IsNullOrEmpty(jaFeeDetail[i]["bilg_dr_codg"].ToString()))
  1126. // {
  1127. // jaFeeOne.Add("bilg_dr_codg", "");
  1128. // }
  1129. // else
  1130. // {
  1131. // jaFeeOne.Add("bilg_dr_codg", jaFeeDetail[i]["bilg_dr_codg"]);
  1132. // }
  1133. // if (string.IsNullOrEmpty(jaFeeDetail[i]["bilg_dr_name"].ToString()))
  1134. // {
  1135. // jaFeeOne.Add("bilg_dr_name", "");
  1136. // }
  1137. // else
  1138. // {
  1139. // jaFeeOne.Add("bilg_dr_name", jaFeeDetail[i]["bilg_dr_name"]);
  1140. // }
  1141. // MessageBox.Show("666");
  1142. // jaFeeOne.Add("phar_name", "");
  1143. // jaFeeOne.Add("phar_prac_cert_no", "");
  1144. // jaFeeOne.Add("tcmdrug_used_way", ""); //中药使用方式 1复方 2单方 必填
  1145. // jaFeeOne.Add("trdn_flag", "1");//拆零标志 必填 0否 1是
  1146. // jaFeeDetail.Add(jaFeeOne);
  1147. // jaFeeOne = new JObject();
  1148. // MessageBox.Show("777");
  1149. //}
  1150. JObject Jo992001 = new JObject();
  1151. //Jo992001.Add("setlinfo",JObject.Parse(setlinfo));//结算信息节点
  1152. Jo992001.Add("setlinfo", setlinfo);//结算信息节点
  1153. //Jo992001.Add("drugdetail", jaFeeDetail);//购药明细节点
  1154. JObject OutJo = invoker.invokeCenterServiceJXC("992001", JObject.Parse(JsonHelper.setCenterInpar("992001", Jo992001)));
  1155. MessageBox.Show("上传成功!!!,上传返回:" + OutJo.ToString());
  1156. }
  1157. catch (Exception ex)
  1158. {
  1159. MessageBox.Show(ex.Message);
  1160. return;
  1161. }
  1162. }
  1163. private void SYBJXCTFToolStripMenuItem_Click(object sender, EventArgs e)
  1164. {
  1165. if (dgvSettlRecord.RowCount <= 0)
  1166. {
  1167. MessageBox.Show("请先查询结算数据!");
  1168. return;
  1169. }
  1170. string sqlStr;
  1171. try
  1172. {
  1173. int m = dgvSettlRecord.CurrentRow.Index;
  1174. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  1175. string msgid = dt.Rows[m]["msgid"].ToString();
  1176. string SettlementID = dt.Rows[m]["SettlementID"].ToString();
  1177. string ValidFlag = dt.Rows[m]["ValidFlag"].ToString();
  1178. string MdtrtID = dt.Rows[m]["MdtrtID"].ToString();
  1179. string BillType = dt.Rows[m]["BillType"].ToString();
  1180. string AdmID = dt.Rows[m]["AdmID"].ToString();
  1181. string billID = dt.Rows[m]["billID"].ToString();
  1182. string recordID = dt.Rows[m]["recordID"].ToString();
  1183. Global.pat.adm_Dr = int.Parse(AdmID);
  1184. Global.pat.billID = billID;
  1185. Global.pat.recordID = recordID;
  1186. if (BillType == "1")
  1187. {
  1188. MessageBox.Show("请选择退费负记录!该记录为正交易记录");
  1189. }
  1190. sqlStr = "SELECT * FROM BS_MedInsuTransactionLog WHERE MSGID='" + msgid + "'";
  1191. JObject joSqlstr = new JObject();
  1192. joSqlstr.Add("sqlStr", sqlStr);
  1193. JObject joRtn = mIS.QueryTransactionLog(joSqlstr);
  1194. if (joRtn["result"]["data"].ToString() == "[]")
  1195. {
  1196. MessageBox.Show("查询结果为空!");
  1197. return;
  1198. }
  1199. //DataTable dtlog = (DataTable)joRtn["result"]["data"][0].ToObject(typeof(DataTable));
  1200. JObject Outlog = JObject.Parse(joRtn["result"]["data"][0]["OutparamPlain"].ToString());
  1201. dynamic setlinfo = new JObject();//结算信息节点
  1202. setlinfo.setl_id = Outlog["output"]["setlinfo"]["setl_id"];//结算ID
  1203. setlinfo.init_setl_id = "";//原结算ID
  1204. setlinfo.setl_time = Outlog["output"]["setlinfo"]["setl_time"];//结算退费时间
  1205. setlinfo.mdtrt_id = Outlog["output"]["setlinfo"]["mdtrt_id"];//就诊ID
  1206. setlinfo.psn_no = Outlog["output"]["setlinfo"]["psn_no"];//人员编号
  1207. setlinfo.exp_content = "";
  1208. string mdtrt_id = Outlog["output"]["setlinfo"]["mdtrt_id"].ToString();
  1209. sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE billType = 1 ";
  1210. sqlStr = sqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  1211. sqlStr = sqlStr + " AND MdtrtID ='" + mdtrt_id + "'";
  1212. JObject joSql = new JObject();
  1213. joSql.Add("sqlStr", sqlStr);
  1214. JObject joSettlInfo = mIS.QuerySettlementInfo(joSql);
  1215. //查询结算信息
  1216. JObject Outpam = JObject.Parse(joSettlInfo["result"]["data"][0].ToString());
  1217. setlinfo.init_setl_id = Outpam["SettlementID"];//ADMID
  1218. setlinfo.psn_no = Outpam["PersonnelNO"];
  1219. JObject joParam992002 = new JObject();
  1220. joParam992002.Add("data", setlinfo);//结算信息节点
  1221. JObject OutJo = invoker.invokeCenterServiceJXC("992002", JObject.Parse(JsonHelper.setCenterInpar("992002", joParam992002)));
  1222. MessageBox.Show("上传成功+"+ OutJo.ToString());
  1223. }
  1224. catch (Exception ex)
  1225. {
  1226. MessageBox.Show(ex.Message);
  1227. return;
  1228. }
  1229. }
  1230. private void FYMXToolStripMenuItem_Click(object sender, EventArgs e)
  1231. {
  1232. if (dgvSettlRecord.RowCount <= 0)
  1233. {
  1234. MessageBox.Show("请先查询结算数据!");
  1235. return;
  1236. }
  1237. string sqlStr;
  1238. try
  1239. {
  1240. int m = dgvSettlRecord.CurrentRow.Index;
  1241. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  1242. string msgid = dt.Rows[m]["msgid"].ToString();
  1243. string SettlementID = dt.Rows[m]["SettlementID"].ToString();
  1244. string ValidFlag = dt.Rows[m]["ValidFlag"].ToString();
  1245. string MdtrtID = dt.Rows[m]["MdtrtID"].ToString();
  1246. string BillType = dt.Rows[m]["BillType"].ToString();
  1247. string AdmID = dt.Rows[m]["AdmID"].ToString();
  1248. string billID = dt.Rows[m]["billID"].ToString();
  1249. string recordID = dt.Rows[m]["recordID"].ToString();
  1250. Global.pat.adm_Dr = int.Parse(AdmID);
  1251. Global.pat.billID = billID;
  1252. Global.pat.recordID = recordID;
  1253. //if (BillType == "-1")
  1254. //{
  1255. // MessageBox.Show("请选择结算正记录!该记录为退费记录");
  1256. //}
  1257. sqlStr = "SELECT * FROM BS_MedInsuTransactionLog WHERE MSGID='" + msgid + "'";
  1258. JObject joSqlstr = new JObject();
  1259. joSqlstr.Add("sqlStr", sqlStr);
  1260. JObject joRtn = mIS.QueryTransactionLog(joSqlstr);
  1261. if (joRtn["result"]["data"].ToString() == "[]")
  1262. {
  1263. MessageBox.Show("查询结果为空!");
  1264. return;
  1265. }
  1266. //DataTable dtlog = (DataTable)joRtn["result"]["data"][0].ToObject(typeof(DataTable));
  1267. JObject Outlog = JObject.Parse(joRtn["result"]["data"][0]["OutparamPlain"].ToString());
  1268. dynamic setlinfo = new JObject();//结算信息节点
  1269. setlinfo.setl_id = Outlog["output"]["setlinfo"]["setl_id"];//结算ID
  1270. //setlinfo.mdtrt_id = Outlog["output"]["setlinfo"]["mdtrt_id"];//就诊ID
  1271. //setlinfo.psn_no = Outlog["output"]["setlinfo"]["psn_no"];//人员编号
  1272. //setlinfo.psn_name = Outlog["output"]["setlinfo"]["psn_name"];//人员姓名
  1273. //setlinfo.psn_cert_type = Outlog["output"]["setlinfo"]["psn_cert_type"];//凭证类型
  1274. //setlinfo.certno = Outlog["output"]["setlinfo"]["certno"];//证件号码
  1275. //setlinfo.gend = Outlog["output"]["setlinfo"]["gend"];//性别
  1276. //setlinfo.naty = Outlog["output"]["setlinfo"]["naty"];//民族
  1277. //setlinfo.brdy = Outlog["output"]["setlinfo"]["brdy"];//出生日期
  1278. //setlinfo.age = Outlog["output"]["setlinfo"]["age"];//年龄
  1279. //setlinfo.insutype = Outlog["output"]["setlinfo"]["insutype"];//险种类型
  1280. //setlinfo.psn_type = Outlog["output"]["setlinfo"]["psn_type"];//人员类别
  1281. //setlinfo.cvlserv_flag = Outlog["output"]["setlinfo"]["cvlserv_flag"];//公务员标志
  1282. setlinfo.setl_time = Outlog["output"]["setlinfo"]["setl_time"];//结算时间
  1283. //setlinfo.mdtrt_cert_type = Outlog["output"]["setlinfo"]["mdtrt_cert_type"];//就诊凭证类型
  1284. //setlinfo.med_type = Outlog["output"]["setlinfo"]["med_type"];//医疗类别
  1285. //setlinfo.medfee_sumamt = Outlog["output"]["setlinfo"]["medfee_sumamt"];//医疗费总额
  1286. //setlinfo.fulamt_ownpay_amt = Outlog["output"]["setlinfo"]["fulamt_ownpay_amt"];//全自费金额
  1287. //setlinfo.overlmt_selfpay = Outlog["output"]["setlinfo"]["overlmt_selfpay"];//超限价自费费用
  1288. //setlinfo.preselfpay_amt = Outlog["output"]["setlinfo"]["preselfpay_amt"];//先行自付金额
  1289. //setlinfo.inscp_scp_amt = Outlog["output"]["setlinfo"]["inscp_scp_amt"];//符合政策范围金额
  1290. //setlinfo.act_pay_dedc = Outlog["output"]["setlinfo"]["act_pay_dedc"];//实际支付起付线
  1291. //setlinfo.hifp_pay = Outlog["output"]["setlinfo"]["hifp_pay"];//基本医疗保险统筹基金支出
  1292. //setlinfo.pool_prop_selfpay = Outlog["output"]["setlinfo"]["pool_prop_selfpay"];//基本医疗保险统筹基金支付比例
  1293. //setlinfo.cvlserv_pay = Outlog["output"]["setlinfo"]["cvlserv_pay"];//公务员医疗补助资金支出
  1294. //setlinfo.hifes_pay = Outlog["output"]["setlinfo"]["hifes_pay"];//企业补充医疗保险基金支出
  1295. //setlinfo.hifmi_pay = Outlog["output"]["setlinfo"]["hifmi_pay"];//居民大病保险资金支出
  1296. //setlinfo.hifob_pay = Outlog["output"]["setlinfo"]["hifob_pay"];//职工大额医疗费用补助基金支出
  1297. //setlinfo.maf_pay = Outlog["output"]["setlinfo"]["maf_pay"];//医疗救助基金支出
  1298. //setlinfo.oth_pay = Outlog["output"]["setlinfo"]["oth_pay"];//结算ID
  1299. //setlinfo.fund_pay_sumamt = Outlog["output"]["setlinfo"]["fund_pay_sumamt"];//基金支付总额
  1300. //setlinfo.psn_part_amt = Outlog["output"]["setlinfo"]["psn_part_amt"];//个人负担总金额
  1301. //setlinfo.acct_pay = Outlog["output"]["setlinfo"]["acct_pay"];//个人账户支出
  1302. //setlinfo.psn_cash_pay = Outlog["output"]["setlinfo"]["psn_cash_pay"];//个人现金支出
  1303. //setlinfo.balc = Outlog["output"]["setlinfo"]["balc"];//余额
  1304. //setlinfo.acct_mulaid_pay = Outlog["output"]["setlinfo"]["acct_mulaid_pay"];//个人账户共济支付金额
  1305. //setlinfo.medins_setl_id = Outlog["output"]["setlinfo"]["medins_setl_id"];//医药机构结算结算ID
  1306. //setlinfo.clr_optins = Outlog["output"]["setlinfo"]["clr_optins"];//clr_optins
  1307. //setlinfo.clr_way = Outlog["output"]["setlinfo"]["clr_way"];//clr_way
  1308. //setlinfo.clr_type = Outlog["output"]["setlinfo"]["clr_type"];//clr_type
  1309. //// setlinfo.exp_content = Outlog["output"]["setlinfo"]["exp_content"];//exp_content
  1310. //setlinfo.exp_content = "";//exp_content
  1311. //setlinfo.hosp_part_amt = Outlog["output"]["setlinfo"]["hosp_part_amt"];//医院负担金额
  1312. //setlinfo.hifdm_pay = 0;//伤残人员医疗保障基金支出
  1313. string outParam = "";
  1314. //获取IS费用
  1315. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  1316. {
  1317. MessageBox.Show("获取HIS费用失败");
  1318. }
  1319. //调用医保平台转换HIS费用(转换医保编码等)
  1320. JObject joHisFee = JObject.Parse(outParam);
  1321. if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  1322. {
  1323. MessageBox.Show("获取HIS费用医保对照关系失败");
  1324. }
  1325. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  1326. JArray jaFeeDetail1 = new JArray();
  1327. ; JObject jaFeeOne = new JObject();
  1328. for (int k = 0; k < jaFeeDetail.Count; k++)
  1329. { if (!(jaFeeDetail[k]["med_list_codg"].ToString().Substring(0, 1) == "X" || jaFeeDetail[k]["med_list_codg"].ToString().Substring(0, 1) == "Z")) continue;
  1330. jaFeeOne.Add("feedetl_sn", jaFeeDetail[k]["feedetl_sn"]);//费用明细流水号
  1331. jaFeeOne.Add("rxno", "");//处方号
  1332. if (string.IsNullOrEmpty(jaFeeDetail[i]["rx_circ_flag"].ToString()))
  1333. {
  1334. jaFeeOne.Add("rx_circ_flag", "0");//外购处方标志
  1335. }
  1336. else
  1337. {
  1338. jaFeeOne.Add("rx_circ_flag", jaFeeDetail[k]["rx_circ_flag"].ToString());//外购处方标志
  1339. }
  1340. if (BillType == "-1")
  1341. {
  1342. jaFeeOne.Add("fee_ocur_time", setlinfo.setl_time);
  1343. }
  1344. else{
  1345. jaFeeOne.Add("fee_ocur_time", jaFeeDetail[k]["fee_ocur_time"]);
  1346. }
  1347. jaFeeOne.Add("med_list_codg", jaFeeDetail[k]["med_list_codg"]);
  1348. jaFeeOne.Add("medins_list_codg", jaFeeDetail[i]["medins_list_codg"]);
  1349. jaFeeOne.Add("medins_list_name", jaFeeDetail[i]["medins_list_desc"]);
  1350. jaFeeOne.Add("prodname", jaFeeDetail[i]["medins_list_desc"]);
  1351. if (string.IsNullOrEmpty(jaFeeDetail[i]["spec"].ToString()))
  1352. {
  1353. jaFeeOne.Add("spec", "");
  1354. }
  1355. else
  1356. {
  1357. jaFeeOne.Add("spec", jaFeeDetail[i]["spec"]);
  1358. }
  1359. if (string.IsNullOrEmpty(jaFeeDetail[i]["doseForm"].ToString()))
  1360. {
  1361. jaFeeOne.Add("dosform_name", "");
  1362. }
  1363. else
  1364. {
  1365. jaFeeOne.Add("dosform_name", jaFeeDetail[i]["doseForm"]);
  1366. }
  1367. jaFeeOne.Add("det_item_fee_sumamt", decimal.Parse(jaFeeDetail[k]["det_item_fee_sumamt"].ToString()));
  1368. jaFeeOne.Add("cnt", decimal.Parse(jaFeeDetail[k]["cnt"].ToString()));
  1369. jaFeeOne.Add("pric", decimal.Parse(jaFeeDetail[k]["pric"].ToString()));
  1370. if (string.IsNullOrEmpty(jaFeeDetail[i]["sin_dos_dscr"].ToString()))
  1371. {
  1372. jaFeeOne.Add("sin_dos_dscr", "");
  1373. }
  1374. else
  1375. {
  1376. jaFeeOne.Add("sin_dos_dscr", jaFeeDetail[i]["sin_dos_dscr"]);
  1377. }
  1378. if (string.IsNullOrEmpty(jaFeeDetail[i]["used_frqu_dscr"].ToString()))
  1379. {
  1380. jaFeeOne.Add("used_frqu_dscr", "");
  1381. }
  1382. else
  1383. {
  1384. jaFeeOne.Add("used_frqu_dscr", jaFeeDetail[i]["used_frqu_dscr"]);
  1385. }
  1386. if (string.IsNullOrEmpty(jaFeeDetail[i]["prd_days"].ToString()))
  1387. {
  1388. jaFeeOne.Add("prd_days", 1);
  1389. }
  1390. else
  1391. {
  1392. jaFeeOne.Add("prd_days", decimal.Parse(jaFeeDetail[k]["prd_days"].ToString()));
  1393. }
  1394. MessageBox.Show("555");
  1395. if (string.IsNullOrEmpty(jaFeeDetail[i]["medc_way_dscr"].ToString()))
  1396. {
  1397. jaFeeOne.Add("medc_way_dscr", "");
  1398. }
  1399. else
  1400. {
  1401. jaFeeOne.Add("medc_way_dscr", jaFeeDetail[i]["medc_way_dscr"]);
  1402. }
  1403. if (string.IsNullOrEmpty(jaFeeDetail[i]["bilg_dr_codg"].ToString()))
  1404. {
  1405. jaFeeOne.Add("bilg_dr_codg", "");
  1406. }
  1407. else
  1408. {
  1409. jaFeeOne.Add("bilg_dr_codg", jaFeeDetail[i]["bilg_dr_codg"]);
  1410. }
  1411. if (string.IsNullOrEmpty(jaFeeDetail[i]["bilg_dr_name"].ToString()))
  1412. {
  1413. jaFeeOne.Add("bilg_dr_name", "");
  1414. }
  1415. else
  1416. {
  1417. jaFeeOne.Add("bilg_dr_name", jaFeeDetail[i]["bilg_dr_name"]);
  1418. }
  1419. MessageBox.Show("666");
  1420. jaFeeOne.Add("phar_name", "");
  1421. jaFeeOne.Add("phar_prac_cert_no", "");
  1422. jaFeeOne.Add("tcmdrug_used_way", "1"); //中药使用方式 1复方 2单方 必填
  1423. jaFeeOne.Add("trdn_flag", joHisFee["result"][k]["outApartFlag"].ToString());//拆零标志 必填 0否 1是
  1424. jaFeeDetail1.Add(jaFeeOne);
  1425. jaFeeOne = new JObject();
  1426. MessageBox.Show("777");
  1427. }
  1428. JObject Jo992004 = new JObject();
  1429. // JObject Jo992001 = new JObject();
  1430. //Jo992001.Add("setlinfo",JObject.Parse(setlinfo));//结算信息节点
  1431. Jo992004.Add("setlinfo", setlinfo);
  1432. Jo992004.Add("drugdetail", jaFeeDetail1);//结算信息节点
  1433. //Jo992001.Add("drugdetail", jaFeeDetail);//购药明细节点
  1434. MessageBox.Show("上传开始:" + Jo992004.ToString());
  1435. JObject OutJo = invoker.invokeCenterServiceJXC("9920004", JObject.Parse(JsonHelper.setCenterInpar("992004", Jo992004)));
  1436. MessageBox.Show("上传返回:" + OutJo.ToString());
  1437. }
  1438. catch (Exception ex)
  1439. {
  1440. MessageBox.Show(ex.Message);
  1441. return;
  1442. }
  1443. }
  1444. private void cityDesignToolStripMenuItem_Click(object sender, EventArgs e)
  1445. {
  1446. //try
  1447. //{
  1448. // Thread thread = new Thread(new ThreadStart(design));
  1449. // thread.SetApartmentState(ApartmentState.STA); //重点
  1450. // thread.Start();
  1451. // thread.Join();
  1452. //}
  1453. //catch (Exception ex)
  1454. //{
  1455. // Global.writeLog("结算单设计预览异常:" + ex.Message);
  1456. // MessageBox.Show("设计预览异常:" + ex.Message);
  1457. //}
  1458. if (dgvSettlRecord.RowCount <= 0)
  1459. {
  1460. MessageBox.Show("请先查询结算数据!");
  1461. return;
  1462. }
  1463. try
  1464. {
  1465. int i = dgvSettlRecord.CurrentRow.Index;
  1466. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  1467. Global.pat.admType = int.Parse(dgvSettlRecord.Rows[i].Cells["admType"].Value.ToString());
  1468. string AdmID = dt.Rows[i]["AdmID"].ToString();
  1469. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  1470. string ValidFlag = dt.Rows[i]["ValidFlag"].ToString();
  1471. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  1472. string BillType = dt.Rows[i]["BillType"].ToString();
  1473. JObject pJoInparm= new JObject();
  1474. pJoInparm.Add("MdtrtCertType", dt.Rows[i]["MdtrtCertType"].ToString());
  1475. JObject joRtn = cityGetFastReportParams("Y", AdmID, MdtrtID, SettlementID, ValidFlag, BillType, pJoInparm);
  1476. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  1477. {
  1478. MessageBox.Show("获取FastReport入参失败:" + errMsg);
  1479. return;
  1480. }
  1481. string sFastReportParam = JsonHelper.getDestValue(joRtn, "result");
  1482. if (FastReportPrint(sFastReportParam, out errMsg) != 0)
  1483. {
  1484. MessageBox.Show("调用FastReport设计失败!" + errMsg);
  1485. return;
  1486. }
  1487. }
  1488. catch (Exception ex)
  1489. {
  1490. MessageBox.Show(ex.Message);
  1491. return;
  1492. }
  1493. }
  1494. private void cityToolStripMenuItem_Click(object sender, EventArgs e)
  1495. {
  1496. string errorMsg;
  1497. int iHis = dgvSettlRecord.CurrentRow.Index;
  1498. String BType = dgvSettlRecord.Rows[iHis].Cells["BillType"].Value.ToString();
  1499. Global.pat.admType = int.Parse(dgvSettlRecord.Rows[iHis].Cells["admType"].Value.ToString());
  1500. JObject joData = new JObject();
  1501. joData.Add("mdtrt_id", dgvSettlRecord.Rows[iHis].Cells["MdtrtID"].Value.ToString());
  1502. joData.Add("setl_id", dgvSettlRecord.Rows[iHis].Cells["SettlementID"].Value.ToString());
  1503. joData.Add("psn_no", dgvSettlRecord.Rows[iHis].Cells["PersonnelNO"].Value.ToString());
  1504. joData.Add("med_type", dgvSettlRecord.Rows[iHis].Cells["MedicalType"].Value.ToString());
  1505. JObject joInput = new JObject();
  1506. joInput.Add("data", joData);
  1507. Global.pat.insuplc_admdvs = dgvSettlRecord.Rows[iHis].Cells["insuplc_admdvs"].Value.ToString();//更新参保地
  1508. #region【调用FastRepor打印】
  1509. try
  1510. {
  1511. //Thread thread = new Thread(new ThreadStart(print));
  1512. //thread.SetApartmentState(ApartmentState.STA); //重点
  1513. //thread.Start();
  1514. //thread.Join();
  1515. cityPrint();
  1516. }
  1517. catch (Exception ex)
  1518. {
  1519. Global.writeLog("结算单打印异常:" + ex.Message);
  1520. MessageBox.Show("打印异常:" + ex.Message);
  1521. }
  1522. #endregion
  1523. }
  1524. }
  1525. // Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
  1526. public class Classification
  1527. {
  1528. public string cwfSummat { get; set; }
  1529. public string cwfInScope { get; set; }
  1530. public string cwfPreSelfPay { get; set; }
  1531. public string cwfOverLimit { get; set; }
  1532. public string cwfFullOwnPay { get; set; }
  1533. public string zcfSummat { get; set; }
  1534. public string zcfInScope { get; set; }
  1535. public string zcfPreSelfPay { get; set; }
  1536. public string zcfOverLimit { get; set; }
  1537. public string zcfFullOwnPay { get; set; }
  1538. public string jcfSummat { get; set; }
  1539. public string jcfInScope { get; set; }
  1540. public string jcfPreSelfPay { get; set; }
  1541. public string jcfOverLimit { get; set; }
  1542. public string jcfFullOwnPay { get; set; }
  1543. public string hyfSummat { get; set; }
  1544. public string hyfInScope { get; set; }
  1545. public string hyfPreSelfPay { get; set; }
  1546. public string hyfOverLimit { get; set; }
  1547. public string hyfFullOwnPay { get; set; }
  1548. public string zlfSummat { get; set; }
  1549. public string zlfInScope { get; set; }
  1550. public string zlfPreSelfPay { get; set; }
  1551. public string zlfOverLimit { get; set; }
  1552. public string zlfFullOwnPay { get; set; }
  1553. public string ssfSummat { get; set; }
  1554. public string ssfInScope { get; set; }
  1555. public string ssfPreSelfPay { get; set; }
  1556. public string ssfOverLimit { get; set; }
  1557. public string ssfFullOwnPay { get; set; }
  1558. public string hlfSummat { get; set; }
  1559. public string hlfInScope { get; set; }
  1560. public string hlfPreSelfPay { get; set; }
  1561. public string hlfOverLimit { get; set; }
  1562. public string hlfFullOwnPay { get; set; }
  1563. public string wsclfSummat { get; set; }
  1564. public string wsclfInScope { get; set; }
  1565. public string wsclfPreSelfPay { get; set; }
  1566. public string wsclfOverLimit { get; set; }
  1567. public string wsclfFullOwnPay { get; set; }
  1568. public string xyfSummat { get; set; }
  1569. public string xyfInScope { get; set; }
  1570. public string xyfPreSelfPay { get; set; }
  1571. public string xyfOverLimit { get; set; }
  1572. public string xyfFullOwnPay { get; set; }
  1573. public string zyypfSummat { get; set; }
  1574. public string zyypfInScope { get; set; }
  1575. public string zyypfPreSelfPay { get; set; }
  1576. public string zyypfOverLimit { get; set; }
  1577. public string zyypfFullOwnPay { get; set; }
  1578. public string zcyfSummat { get; set; }
  1579. public string zcyfInScope { get; set; }
  1580. public string zcyfPreSelfPay { get; set; }
  1581. public string zcyfOverLimit { get; set; }
  1582. public string zcyfFullOwnPay { get; set; }
  1583. public string ybzlfSummat { get; set; }
  1584. public string ybzlfInScope { get; set; }
  1585. public string ybzlfPreSelfPay { get; set; }
  1586. public string ybzlfOverLimit { get; set; }
  1587. public string ybzlfFullOwnPay { get; set; }
  1588. public string ghfSummat { get; set; }
  1589. public string ghfInScope { get; set; }
  1590. public string ghfPreSelfPay { get; set; }
  1591. public string ghfOverLimit { get; set; }
  1592. public string ghfFullOwnPay { get; set; }
  1593. public string qtSummat { get; set; }
  1594. public string qtInScope { get; set; }
  1595. public string qtPreSelfPay { get; set; }
  1596. public string qtOverLimit { get; set; }
  1597. public string qtFullOwnPay { get; set; }
  1598. public string totalSummat { get; set; }
  1599. public string totalInScope { get; set; }
  1600. public string totalPreSelfPay { get; set; }
  1601. public string totalOverLimit { get; set; }
  1602. public string totalFullOwnPay { get; set; }
  1603. }
  1604. public class Data
  1605. {
  1606. public List<Classification> classification { get; set; }
  1607. public List<Settlement> settlement { get; set; }
  1608. public List<Reginfo> reginfo { get; set; }
  1609. public List<Patinsuinfo> patinsuinfo { get; set; }
  1610. }
  1611. public class Patinsuinfo
  1612. {
  1613. public string PsnCertType { get; set; }
  1614. public string PsnCertNO { get; set; }
  1615. public string Gend { get; set; }
  1616. public string Naty { get; set; }
  1617. public string Brdy { get; set; }
  1618. public string Age { get; set; }
  1619. public string Balc { get; set; }
  1620. public string PsnType { get; set; }
  1621. public string Cvlservflag { get; set; }
  1622. public string insuplcAdmdvs { get; set; }
  1623. public string EmpName { get; set; }
  1624. public string PsnIdettype { get; set; }
  1625. public string PsnTypeLv { get; set; }
  1626. }
  1627. public class Reginfo
  1628. {
  1629. public string AttendDoctorNO { get; set; }
  1630. public string ChiefPhyDocName { get; set; }
  1631. public string AdmitDepartmentCode { get; set; }
  1632. public string AdmitDepartmentName { get; set; }
  1633. public string AdmBed { get; set; }
  1634. public string MainDiagCode { get; set; }
  1635. public string MainDiagName { get; set; }
  1636. public string RegDate { get; set; }
  1637. public string ConerName { get; set; }
  1638. public string Tel { get; set; }
  1639. }
  1640. public class Result
  1641. {
  1642. public Data data { get; set; }
  1643. }
  1644. public class Root
  1645. {
  1646. public Result result { get; set; }
  1647. public int errorCode { get; set; }
  1648. public string errorMessage { get; set; }
  1649. }
  1650. public class Settlement
  1651. {
  1652. public string AdmID { get; set; }
  1653. public string MdtrtID { get; set; }
  1654. public string SettlementID { get; set; }
  1655. public string PersonnelNO { get; set; }
  1656. public string PatientName { get; set; }
  1657. public string birth { get; set; }
  1658. public string CertificateNO { get; set; }
  1659. public string Gender { get; set; }
  1660. public string InsuranceType { get; set; }
  1661. public string PersonType { get; set; }
  1662. public string CivilserviceFlag { get; set; }
  1663. public string SettlementTime { get; set; }
  1664. public string MedicalType { get; set; }
  1665. public string Sumamt { get; set; }
  1666. public string OwnPayAmount { get; set; }
  1667. public string OverLimitAmount { get; set; }
  1668. public string PreSelfPayAmount { get; set; }
  1669. public string InPolicyRangeAmount { get; set; }
  1670. public double ActualPayDeductible { get; set; }
  1671. public string HealthInsurancePay { get; set; }
  1672. public string HealthInsuranceRatio { get; set; }
  1673. public double CivilserviceAllowancePay { get; set; }
  1674. public string EnterpriseSupplementPay { get; set; }
  1675. public string SeriousIllnessPay { get; set; }
  1676. public string LargeExpensesSupplementPay { get; set; }
  1677. public string MedicalAssistPay { get; set; }
  1678. public string HospitalPartAmount { get; set; }
  1679. public string OtherPay { get; set; }
  1680. public string FundPaySumamt { get; set; }
  1681. public string PersonPaySumamt { get; set; }
  1682. public string AccountPaySumamt { get; set; }
  1683. public string PersonCashPay { get; set; }
  1684. public string Balance { get; set; }
  1685. public string AccountMutualAidAmount { get; set; }
  1686. public string OrganSettlementID { get; set; }
  1687. public string ClearingOrgan { get; set; }
  1688. public string ClearingWay { get; set; }
  1689. public string ClearingType { get; set; }
  1690. public string ValidFlag { get; set; }
  1691. public string msgid { get; set; }
  1692. public string HospitalizationsTimes { get; set; }
  1693. public string HospitalizationsDays { get; set; }
  1694. public string HISAdmTime { get; set; }
  1695. public string HISDischargeTime { get; set; }
  1696. public int BillType { get; set; }
  1697. public string BillID { get; set; }
  1698. public string admType { get; set; }
  1699. public string RecordID { get; set; }
  1700. public string insuplc_admdvs { get; set; }
  1701. }
  1702. }