SettlementChecklist.cs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  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 PTMedicalInsurance.Business;
  19. namespace PTMedicalInsurance.Forms
  20. {
  21. public partial class SettlementChecklist : Form
  22. {
  23. private int hospitalDr;
  24. private int interfaceDr;
  25. private string hospitalNO;
  26. private string interfaceNO;
  27. private string hospitalName;
  28. private string hospitalAreaCode;
  29. private bool disposed = false;
  30. Thread thread_test;
  31. private InvokeHelper invoker = new InvokeHelper();
  32. public SettlementChecklist()
  33. {
  34. InitializeComponent();
  35. hospitalDr = Global.inf.hospitalDr;
  36. hospitalNO = Global.inf.hospitalNO;
  37. hospitalName = Global.inf.hospitalName;
  38. hospitalAreaCode = Global.inf.areaCode;
  39. interfaceDr = Global.inf.interfaceDr;
  40. }
  41. public SettlementChecklist(JObject joParam)
  42. {
  43. InitializeComponent();
  44. hospitalDr = Global.inf.hospitalDr;
  45. hospitalNO = Global.inf.hospitalNO;
  46. hospitalName = Global.inf.hospitalName;
  47. hospitalAreaCode = Global.inf.areaCode;
  48. if (joParam == null) return;
  49. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joParam, "insuplc_admdvs");
  50. string setl_id = JsonHelper.getDestValue(joParam, "setl_id");
  51. if (setl_id == "")
  52. {
  53. MessageBox.Show("根据传入的结算编号为查询到相关信息,请手动输入查询!");
  54. return;
  55. }
  56. string sqlStr = "SELECT * FROM SQLUser.BS_MedInsuSettlement WHERE Hospital_Dr=" + Global.inf.hospitalDr;
  57. sqlStr = sqlStr + " and SettlementID='" + setl_id + "'";
  58. JObject joSqlStr = new JObject();
  59. joSqlStr.Add("sqlStr", sqlStr);
  60. MIIrisServices mIS = new MIIrisServices();
  61. JObject joRtn = mIS.QuerySettlementInfo(joSqlStr);
  62. DataTable dt = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  63. dgvSettlRecord.DataSource = dt;
  64. }
  65. private string getTemplatePath()
  66. {
  67. if (Utils.isOtherCity())
  68. {
  69. return Global.curEvt.path + "\\frx\\settlement_other.frx";
  70. }
  71. return Global.curEvt.path + "\\frx\\settlement.frx";
  72. }
  73. public void Dispose()
  74. {
  75. Dispose1(true);
  76. GC.SuppressFinalize(this);
  77. }
  78. protected virtual void Dispose1(bool disposing)
  79. {
  80. if (thread_test == null) return;
  81. if (disposed == false)
  82. {
  83. if (disposing == true)
  84. {
  85. Thread.Sleep(100);
  86. Global.writeLog("Main - aborting my thread.");
  87. thread_test.Abort();//终止线程myThread
  88. thread_test.Join();//等待线程myThread结束
  89. Global.writeLog("Main - ending.");
  90. }
  91. //释放托管资源的代码
  92. }
  93. disposed = true;
  94. }
  95. private void rbgDirecType_ValueChanged(object sender, int index, string text)
  96. {
  97. }
  98. private void btnQuery_Click(object sender, EventArgs e)
  99. {
  100. }
  101. private void btnQuery_Click_1(object sender, EventArgs e)
  102. {
  103. string sqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE Hospital_Dr=" + hospitalDr;
  104. sqlStr = sqlStr + " and OccurTime>'" + dpST.Text + "'";
  105. sqlStr = sqlStr + " and OccurTime<'" + dpED.Text + "'";
  106. if (tbName.Text != "")
  107. {
  108. sqlStr = sqlStr + " and PatientName='" + tbName.Text + "'";
  109. }
  110. if (tbPatSettlID.Text != "")
  111. {
  112. sqlStr = sqlStr + " and SettlementID='" + tbPatSettlID.Text + "'";
  113. }
  114. if (tbHisNO.Text != "")
  115. {
  116. sqlStr = sqlStr + " and Adm_Dr='" + tbHisNO.Text + "'";
  117. }
  118. if (cbxInterface.Text != "")
  119. {
  120. sqlStr = sqlStr + " and Interface_Dr=" + Global.inf.interfaceDr + "";
  121. }
  122. if (rbgAdmType.SelectedIndex == 1)
  123. {
  124. sqlStr = sqlStr + " and AdmType=2";
  125. }
  126. if (rbgAdmType.SelectedIndex == 2)
  127. {
  128. sqlStr = sqlStr + " and AdmType=1";
  129. }
  130. if (rbgBillType.SelectedIndex == 1)
  131. {
  132. sqlStr = sqlStr + " and BillType=1 and ValidFlag=1 ";
  133. }
  134. if (rbgBillType.SelectedIndex == 2)
  135. {
  136. sqlStr = sqlStr + " and BillType=-1 and ValidFlag=0 ";
  137. }
  138. JObject joSqlStr = new JObject();
  139. joSqlStr.Add("sqlStr", sqlStr);
  140. MIIrisServices mIS = new MIIrisServices();
  141. JObject joRtn = mIS.QuerySettlementInfo(joSqlStr);
  142. DataTable dt = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  143. dgvSettlRecord.DataSource = dt;
  144. }
  145. private void SettlementChecklist_Load(object sender, EventArgs e)
  146. {
  147. dpST.Text = DateTime.Now.ToString("yyyy-MM-dd 00:00:00");
  148. dpED.Text = DateTime.Now.ToString("yyyy-MM-dd 23:59:59");
  149. ComboxSetter cbxSetter = new ComboxSetter();
  150. cbxSetter.setCbxInterfaceDataSource(cbxInterface);
  151. GridViewSetter grdSetter = new GridViewSetter();
  152. grdSetter.SetHeaderTextOfSettlList(dgvSettlRecord);
  153. rbgAdmType.SelectedIndex = 0;
  154. rbgBillType.SelectedIndex = 1;
  155. cbxInterface.SelectedValueChanged += new EventHandler(cbxInterface_SelectedValueChanged);
  156. }
  157. private void cbxInterface_SelectedValueChanged(object sender, EventArgs e)
  158. {
  159. DataTable dt = (DataTable)cbxInterface.DataSource;
  160. int i = cbxInterface.SelectedIndex;
  161. //赋值
  162. hospitalNO = dt.Rows[i]["HospitalNO"].ToString();
  163. //MessageBox.Show(dt.Rows[i]["HospitalDr"].ToString());
  164. //MessageBox.Show(dt.Rows[i]["HospitalDr"].ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
  165. hospitalDr = int.Parse(dt.Rows[i]["HospitalDr"].ToString());
  166. interfaceNO = dt.Rows[i]["InterfaceNO"].ToString();
  167. interfaceDr = int.Parse(dt.Rows[i]["ID"].ToString());
  168. hospitalAreaCode = dt.Rows[i]["AreaCode"].ToString();
  169. //Global.inf.centerURL = dt.Rows[i]["CenterURL"].ToString();
  170. //Global.inf.businessDllName = dt.Rows[i]["DLLName"].ToString();
  171. //Global.inf.patientAreaCode = dt.Rows[i]["AreaCode"].ToString();
  172. }
  173. private JObject getPatCheckList()
  174. {
  175. try
  176. {
  177. if (dgvSettlRecord.CurrentRow == null)
  178. {
  179. // mock data
  180. var root = new Root();
  181. root.result = new Result();
  182. root.result.data = new Data();
  183. root.result.data.classification = new List<Classification>() { new Classification() };
  184. root.result.data.settlement = new List<Settlement>() { new Settlement() };
  185. root.result.data.reginfo = new List<Reginfo>() { new Reginfo() };
  186. root.result.data.patinsuinfo = new List<Patinsuinfo>() { new Patinsuinfo() };
  187. return JObject.Parse(JsonHelper.toJsonString(root));
  188. }
  189. int i = dgvSettlRecord.CurrentRow.Index;
  190. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  191. JObject joSettel = new JObject();
  192. joSettel.Add("HospitalDr", Global.inf.hospitalDr);
  193. joSettel.Add("interfaceDr", Global.inf.interfaceDr);
  194. joSettel.Add("admID", dt.Rows[i]["AdmID"].ToString());
  195. joSettel.Add("SettlementID", dt.Rows[i]["SettlementID"].ToString());
  196. joSettel.Add("ValidFlag", dt.Rows[i]["ValidFlag"].ToString());
  197. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010066", joSettel).ToString(), "获取结算单信息");
  198. return joRtn;
  199. }
  200. catch (Exception ex)
  201. {
  202. JObject joRtn = new JObject();
  203. joRtn.Add("errorCode", -1);
  204. joRtn.Add("errorMessage", ex.Message);
  205. return joRtn;
  206. }
  207. }
  208. private void uiPanel1_Click(object sender, EventArgs e)
  209. {
  210. }
  211. [STAThread]
  212. public void design()
  213. {
  214. try
  215. {
  216. FastReportFunction.Register();
  217. string chineseSimpleFrl = Global.curEvt.path + @"\Chinese (Simplified).frl";
  218. FastReport.Utils.Res.LoadLocale(chineseSimpleFrl);
  219. //string errMsg;
  220. //if (JsonHelper.parseIrisRtnValue(joSettleCheckList, out errMsg) != 0)
  221. //{
  222. // MessageBox.Show("查询结算信息异常:" + errMsg);
  223. // return;
  224. //}
  225. Report report = new Report();
  226. try
  227. {
  228. var json = JsonConvert.DeserializeObject<Root>(getPatCheckList().ToString());
  229. report.RegisterData(json.result.data.classification, "classification");
  230. report.RegisterData(json.result.data.settlement, "settlement");
  231. report.RegisterData(json.result.data.reginfo, "reginfo");
  232. report.RegisterData(json.result.data.patinsuinfo, "patinsuinfo");
  233. }
  234. catch (Exception ex)
  235. {
  236. MessageBox.Show(ex.Message);
  237. return;
  238. }
  239. report.Load(getTemplatePath());
  240. PrintDesign pf = new PrintDesign();
  241. pf.designerControl1.Report = report;
  242. report.Design();
  243. pf.WindowState = FormWindowState.Maximized;
  244. pf.ShowDialog();
  245. }
  246. catch (Exception ex)
  247. {
  248. MessageBox.Show(ex.Message);
  249. }
  250. }
  251. [STAThread]
  252. private void print()
  253. {
  254. try
  255. {
  256. FastReportFunction.Register();
  257. string chineseSimpleFrl = Global.curEvt.path + @"\Chinese (Simplified).frl";
  258. FastReport.Utils.Res.LoadLocale(chineseSimpleFrl);
  259. JObject joSettleCheckList = getPatCheckList();
  260. string errMsg;
  261. if (JsonHelper.parseIrisRtnValue(joSettleCheckList, out errMsg) != 0)
  262. {
  263. MessageBox.Show("查询结算信息异常:" + errMsg);
  264. return;
  265. }
  266. Report report = new Report();
  267. var json = JsonConvert.DeserializeObject<Root>(getPatCheckList().ToString());
  268. report.RegisterData(json.result.data.classification, "classification");
  269. report.RegisterData(json.result.data.settlement, "settlement");
  270. report.RegisterData(json.result.data.reginfo, "reginfo");
  271. report.RegisterData(json.result.data.patinsuinfo, "patinsuinfo");
  272. report.Load(getTemplatePath());
  273. this.ShowInTaskbar = true;
  274. PrintPreview pf = new PrintPreview();
  275. report.Preview = pf.previewControl1;
  276. report.Show();
  277. pf.WindowState = FormWindowState.Maximized;
  278. pf.ShowDialog();
  279. }
  280. catch (Exception ex)
  281. {
  282. MessageBox.Show(ex.Message);
  283. return;
  284. }
  285. }
  286. [STAThread]
  287. private void preview()
  288. {
  289. FastReportFunction.Register();
  290. Report report = new Report();
  291. try
  292. {
  293. var json = JsonConvert.DeserializeObject<Root>(getPatCheckList().ToString());
  294. report.RegisterData(json.result.data.classification, "classification");
  295. report.RegisterData(json.result.data.settlement, "settlement");
  296. report.RegisterData(json.result.data.reginfo, "reginfo");
  297. report.RegisterData(json.result.data.patinsuinfo, "patinsuinfo");
  298. }
  299. catch (Exception ex)
  300. {
  301. MessageBox.Show(ex.Message);
  302. return;
  303. }
  304. //report.Design();
  305. report.Load(getTemplatePath());
  306. //report.Show();
  307. PrintPreview preview1 = new PrintPreview();
  308. preview1.Show();
  309. report.Preview = preview1.previewControl1;
  310. report.Prepare(); //准备
  311. report.ShowPrepared(); //显示
  312. preview1.Show();
  313. }
  314. private void uiButton2_Click(object sender, EventArgs e)
  315. {
  316. Close();
  317. }
  318. /// <summary>
  319. /// 点击打印
  320. /// </summary>
  321. /// <param name="sender"></param>
  322. /// <param name="e"></param>
  323. public void btnPrint_Click(object sender, EventArgs e)
  324. {
  325. try
  326. {
  327. //Thread thread = new Thread(new ThreadStart(print));
  328. Thread thread = new Thread(new ThreadStart(printReportCloud));
  329. thread.SetApartmentState(ApartmentState.STA); //重点
  330. thread.Start();
  331. thread.Join();
  332. }
  333. catch (Exception ex)
  334. {
  335. Global.writeLog("结算单打印异常:" + ex.Message);
  336. MessageBox.Show("打印异常:" + ex.Message);
  337. }
  338. //printReport();
  339. }
  340. /// <summary>
  341. /// 调用正版FastReport打印
  342. /// </summary>
  343. private void printReportCloud()
  344. {
  345. if (dgvSettlRecord.RowCount <= 0)
  346. {
  347. MessageBox.Show("请先查询结算数据!");
  348. return;
  349. }
  350. try
  351. {
  352. int i = dgvSettlRecord.CurrentRow.Index;
  353. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  354. string AdmID = dt.Rows[i]["AdmID"].ToString();
  355. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  356. string ValidFlag = dt.Rows[i]["ValidFlag"].ToString();
  357. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  358. JObject joRtn = GetFastReportParams("", AdmID, MdtrtID, SettlementID, ValidFlag);
  359. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  360. {
  361. MessageBox.Show("获取FastReport入参失败:" + errMsg);
  362. return;
  363. }
  364. string sFastReportParam = JsonHelper.getDestValue(joRtn, "result");
  365. if (FastReportPrint(sFastReportParam, out errMsg) != 0)
  366. {
  367. MessageBox.Show("调用FastReport打印失败!" + errMsg);
  368. return;
  369. }
  370. }
  371. catch (Exception ex)
  372. {
  373. MessageBox.Show(ex.Message);
  374. return;
  375. }
  376. }
  377. /// <summary>
  378. /// 组织正版FastReport需要的参数
  379. /// </summary>
  380. /// <param name="designFlag"></param>
  381. /// <param name="admID"></param>
  382. /// <param name="MdtrtID"></param>
  383. /// <param name="settlementID"></param>
  384. /// <param name="validFlag"></param>
  385. /// <returns></returns>
  386. public JObject GetFastReportParams(string designFlag, string admID, string MdtrtID, string settlementID, string validFlag)
  387. {
  388. try
  389. {
  390. if (designFlag == "") { designFlag = "N"; }
  391. #region【获取HIS医保结算信息】
  392. JObject joSettel = new JObject();
  393. joSettel.Add("HospitalDr", Global.inf.hospitalDr);
  394. joSettel.Add("interfaceDr", Global.inf.interfaceDr);
  395. joSettel.Add("admID", admID);
  396. joSettel.Add("SettlementID", settlementID);
  397. joSettel.Add("ValidFlag", validFlag);
  398. joSettel.Add("MdtrtID", MdtrtID);
  399. JObject joRtnSettle = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010066", joSettel).ToString(), "获取结算单信息");
  400. if (JsonHelper.parseIrisRtnValue(joRtnSettle, out string errMsg) != 0)
  401. {
  402. JObject joRtnSet = new JObject();
  403. joRtnSet.Add("errorCode", -1);
  404. joRtnSet.Add("errorMessage", errMsg);
  405. joRtnSet.Add("result", "");
  406. return joRtnSet;
  407. }
  408. #endregion
  409. #region【组织FastReport调用入参】
  410. JArray jachargeItemLvFee = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.chargeItemLvFee"));
  411. JArray jaClassification = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.classification"));
  412. JArray jaSettlement = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement"));
  413. JArray jaReginfo = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.reginfo"));
  414. JArray japatinsuinfo = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.patinsuinfo"));
  415. JObject joDataResult = new JObject();
  416. joDataResult.Add("SettlementInfo", jaSettlement);
  417. joDataResult.Add("ChargeItemLvFee", jachargeItemLvFee);
  418. joDataResult.Add("ClassificationInfo", jaClassification);
  419. joDataResult.Add("RegInfo", jaReginfo);
  420. joDataResult.Add("Patinsuinfo", japatinsuinfo);
  421. JObject joParams = new JObject();
  422. joParams.Add("fastReportCode", "SP11"); //这个要从表取值
  423. joParams.Add("hospID", Global.inf.hisHospitalDr.ToString());
  424. joParams.Add("printCode", Global.inf.interfaceDr.ToString());
  425. joParams.Add("templateID", "");
  426. JArray jaParams = new JArray();
  427. jaParams.Add(joParams);
  428. JObject joReportParams = new JObject();
  429. joReportParams.Add("params", jaParams);
  430. joReportParams.Add("code", "01040306");
  431. JObject joParam = new JObject();
  432. joParam.Add("designFlag", designFlag);
  433. joParam.Add("logFlag", "N");
  434. joParam.Add("dataParams", "");
  435. joParam.Add("pdfName", "");
  436. joParam.Add("reportparams", joReportParams);
  437. joParam.Add("dataResult", joDataResult);
  438. JObject joDataURL = new JObject();
  439. joDataURL.Add("dataIP", Global.hisConfig.ip);
  440. joDataURL.Add("urlAddress", Global.hisConfig.url);
  441. joDataURL.Add("authorization", Global.hisConfig.authorization);
  442. joParam.Add("dataURL", joDataURL);
  443. JArray jaParam = new JArray();
  444. jaParam.Add(joParam);
  445. JObject joInparam = new JObject();
  446. joInparam.Add("params", JArray.FromObject(jaParam));
  447. joInparam.Add("session", Global.curEvt.jaSession);
  448. #endregion
  449. JObject joRtn = new JObject();
  450. joRtn.Add("errorCode", 0);
  451. joRtn.Add("errorMessage", "");
  452. joRtn.Add("result", joInparam.ToString());
  453. return joRtn;
  454. }
  455. catch (Exception ex)
  456. {
  457. JObject joRtnEx = new JObject();
  458. joRtnEx.Add("errorCode", -1);
  459. joRtnEx.Add("errorMessage", ex.Message);
  460. joRtnEx.Add("result", "");
  461. return joRtnEx;
  462. }
  463. }
  464. /// <summary>
  465. /// FastReport正版打印开始
  466. /// </summary>
  467. /// <param name="InParams"></param>
  468. /// <param name="OutMsg"></param>
  469. /// <returns></returns>
  470. public int FastReportPrint(string InParams, out string OutMsg)
  471. {
  472. Global.writeLog("调用FastReport入参:" + InParams);
  473. try
  474. {
  475. #region【调用正版FastReport打印】
  476. FastReportFrom.FastReportDll FrDll = new FastReportFrom.FastReportDll();
  477. string sRtnFr = FrDll.FastReport(InParams);
  478. JObject joRetObj = JObject.Parse(sRtnFr);
  479. if (JsonHelper.parseIrisRtnValue(joRetObj, out string errMsg) != 0)
  480. {
  481. OutMsg = "调用FastReport打印失败!" + errMsg;
  482. return -1;
  483. }
  484. else
  485. {
  486. OutMsg = "";
  487. return 0;
  488. }
  489. #endregion
  490. }
  491. catch (Exception ex)
  492. {
  493. OutMsg = "调用FastReport打印失败!" + ex.Message;
  494. return -1;
  495. }
  496. }
  497. /// <summary>
  498. /// 调用正版FastReport的设计模式
  499. /// </summary>
  500. private void designReport()
  501. {
  502. if (dgvSettlRecord.RowCount <= 0)
  503. {
  504. MessageBox.Show("请先查询结算数据!");
  505. return;
  506. }
  507. try
  508. {
  509. int i = dgvSettlRecord.CurrentRow.Index;
  510. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  511. string AdmID = dt.Rows[i]["AdmID"].ToString();
  512. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  513. string ValidFlag = dt.Rows[i]["ValidFlag"].ToString();
  514. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  515. JObject joRtn = GetFastReportParams("Y", AdmID, MdtrtID, SettlementID, ValidFlag);
  516. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  517. {
  518. MessageBox.Show("获取FastReport入参失败:" + errMsg);
  519. return;
  520. }
  521. string sFastReportParam = JsonHelper.getDestValue(joRtn, "result");
  522. if (FastReportPrint(sFastReportParam, out errMsg) != 0)
  523. {
  524. MessageBox.Show("调用FastReport设计失败!" + errMsg);
  525. return;
  526. }
  527. }
  528. catch (Exception ex)
  529. {
  530. MessageBox.Show(ex.Message);
  531. return;
  532. }
  533. }
  534. /// <summary>
  535. /// 点击设计
  536. /// </summary>
  537. /// <param name="sender"></param>
  538. /// <param name="e"></param>
  539. private void btnDesign_Click(object sender, EventArgs e)
  540. {
  541. thread_test = new Thread(new ThreadStart(design));
  542. thread_test.SetApartmentState(ApartmentState.STA); //重点
  543. thread_test.Start();
  544. }
  545. private void SettlementChecklist_FormClosed(object sender, FormClosedEventArgs e)
  546. {
  547. Dispose();
  548. }
  549. }
  550. // Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
  551. public class Classification
  552. {
  553. public string cwfSummat { get; set; }
  554. public string cwfInScope { get; set; }
  555. public string cwfPreSelfPay { get; set; }
  556. public string cwfOverLimit { get; set; }
  557. public string cwfFullOwnPay { get; set; }
  558. public string zcfSummat { get; set; }
  559. public string zcfInScope { get; set; }
  560. public string zcfPreSelfPay { get; set; }
  561. public string zcfOverLimit { get; set; }
  562. public string zcfFullOwnPay { get; set; }
  563. public string jcfSummat { get; set; }
  564. public string jcfInScope { get; set; }
  565. public string jcfPreSelfPay { get; set; }
  566. public string jcfOverLimit { get; set; }
  567. public string jcfFullOwnPay { get; set; }
  568. public string hyfSummat { get; set; }
  569. public string hyfInScope { get; set; }
  570. public string hyfPreSelfPay { get; set; }
  571. public string hyfOverLimit { get; set; }
  572. public string hyfFullOwnPay { get; set; }
  573. public string zlfSummat { get; set; }
  574. public string zlfInScope { get; set; }
  575. public string zlfPreSelfPay { get; set; }
  576. public string zlfOverLimit { get; set; }
  577. public string zlfFullOwnPay { get; set; }
  578. public string ssfSummat { get; set; }
  579. public string ssfInScope { get; set; }
  580. public string ssfPreSelfPay { get; set; }
  581. public string ssfOverLimit { get; set; }
  582. public string ssfFullOwnPay { get; set; }
  583. public string hlfSummat { get; set; }
  584. public string hlfInScope { get; set; }
  585. public string hlfPreSelfPay { get; set; }
  586. public string hlfOverLimit { get; set; }
  587. public string hlfFullOwnPay { get; set; }
  588. public string wsclfSummat { get; set; }
  589. public string wsclfInScope { get; set; }
  590. public string wsclfPreSelfPay { get; set; }
  591. public string wsclfOverLimit { get; set; }
  592. public string wsclfFullOwnPay { get; set; }
  593. public string xyfSummat { get; set; }
  594. public string xyfInScope { get; set; }
  595. public string xyfPreSelfPay { get; set; }
  596. public string xyfOverLimit { get; set; }
  597. public string xyfFullOwnPay { get; set; }
  598. public string zyypfSummat { get; set; }
  599. public string zyypfInScope { get; set; }
  600. public string zyypfPreSelfPay { get; set; }
  601. public string zyypfOverLimit { get; set; }
  602. public string zyypfFullOwnPay { get; set; }
  603. public string zcyfSummat { get; set; }
  604. public string zcyfInScope { get; set; }
  605. public string zcyfPreSelfPay { get; set; }
  606. public string zcyfOverLimit { get; set; }
  607. public string zcyfFullOwnPay { get; set; }
  608. public string ybzlfSummat { get; set; }
  609. public string ybzlfInScope { get; set; }
  610. public string ybzlfPreSelfPay { get; set; }
  611. public string ybzlfOverLimit { get; set; }
  612. public string ybzlfFullOwnPay { get; set; }
  613. public string ghfSummat { get; set; }
  614. public string ghfInScope { get; set; }
  615. public string ghfPreSelfPay { get; set; }
  616. public string ghfOverLimit { get; set; }
  617. public string ghfFullOwnPay { get; set; }
  618. public string qtSummat { get; set; }
  619. public string qtInScope { get; set; }
  620. public string qtPreSelfPay { get; set; }
  621. public string qtOverLimit { get; set; }
  622. public string qtFullOwnPay { get; set; }
  623. public string totalSummat { get; set; }
  624. public string totalInScope { get; set; }
  625. public string totalPreSelfPay { get; set; }
  626. public string totalOverLimit { get; set; }
  627. public string totalFullOwnPay { get; set; }
  628. }
  629. public class Data
  630. {
  631. public List<Classification> classification { get; set; }
  632. public List<Settlement> settlement { get; set; }
  633. public List<Reginfo> reginfo { get; set; }
  634. public List<Patinsuinfo> patinsuinfo { get; set; }
  635. }
  636. public class Patinsuinfo
  637. {
  638. public string PsnCertType { get; set; }
  639. public string PsnCertNO { get; set; }
  640. public string Gend { get; set; }
  641. public string Naty { get; set; }
  642. public string Brdy { get; set; }
  643. public string Age { get; set; }
  644. public string Balc { get; set; }
  645. public string PsnType { get; set; }
  646. public string Cvlservflag { get; set; }
  647. public string insuplcAdmdvs { get; set; }
  648. public string EmpName { get; set; }
  649. public string PsnIdettype { get; set; }
  650. public string PsnTypeLv { get; set; }
  651. }
  652. public class Reginfo
  653. {
  654. public string AttendDoctorNO { get; set; }
  655. public string ChiefPhyDocName { get; set; }
  656. public string AdmitDepartmentCode { get; set; }
  657. public string AdmitDepartmentName { get; set; }
  658. public string AdmBed { get; set; }
  659. public string AdmNo { get; set; }
  660. public string MainDiagCode { get; set; }
  661. public string MainDiagName { get; set; }
  662. public string RegDate { get; set; }
  663. public string ConerName { get; set; }
  664. public string Tel { get; set; }
  665. }
  666. public class Result
  667. {
  668. public Data data { get; set; }
  669. }
  670. public class Root
  671. {
  672. public Result result { get; set; }
  673. public int errorCode { get; set; }
  674. public string errorMessage { get; set; }
  675. }
  676. public class Settlement
  677. {
  678. public string AdmID { get; set; }
  679. public string MdtrtID { get; set; }
  680. public string SettlementID { get; set; }
  681. public string PersonnelNO { get; set; }
  682. public string PatientName { get; set; }
  683. public string birth { get; set; }
  684. public string CertificateNO { get; set; }
  685. public string Gender { get; set; }
  686. public string InsuranceType { get; set; }
  687. public string PersonType { get; set; }
  688. public string CivilserviceFlag { get; set; }
  689. public string SettlementTime { get; set; }
  690. public string MedicalType { get; set; }
  691. public string Sumamt { get; set; }
  692. public string OwnPayAmount { get; set; }
  693. public string OverLimitAmount { get; set; }
  694. public string PreSelfPayAmount { get; set; }
  695. public string InPolicyRangeAmount { get; set; }
  696. public double ActualPayDeductible { get; set; }
  697. public string HealthInsurancePay { get; set; }
  698. public string HealthInsuranceRatio { get; set; }
  699. public double CivilserviceAllowancePay { get; set; }
  700. public string EnterpriseSupplementPay { get; set; }
  701. public string SeriousIllnessPay { get; set; }
  702. public string LargeExpensesSupplementPay { get; set; }
  703. public string MedicalAssistPay { get; set; }
  704. public string HospitalPartAmount { get; set; }
  705. public string OtherPay { get; set; }
  706. public string FundPaySumamt { get; set; }
  707. public string PersonPaySumamt { get; set; }
  708. public string AccountPaySumamt { get; set; }
  709. public string PersonCashPay { get; set; }
  710. public string Balance { get; set; }
  711. public string AccountMutualAidAmount { get; set; }
  712. public string OrganSettlementID { get; set; }
  713. public string ClearingOrgan { get; set; }
  714. public string ClearingWay { get; set; }
  715. public string ClearingType { get; set; }
  716. public string ValidFlag { get; set; }
  717. public string msgid { get; set; }
  718. public string HospitalizationsTimes { get; set; }
  719. public string HospitalizationsDays { get; set; }
  720. public string HISAdmTime { get; set; }
  721. public string HISDischargeTime { get; set; }
  722. public int BillType { get; set; }
  723. public string BillID { get; set; }
  724. public string admType { get; set; }
  725. public string RecordID { get; set; }
  726. public string insuplc_admdvs { get; set; }
  727. }
  728. }