SettlementChecklist.cs 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  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", Global.inf.interfaceDr.ToString());
  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. [STAThread]
  558. private void preview()
  559. {
  560. //Report report = new Report();
  561. //try
  562. //{
  563. // var json = JsonConvert.DeserializeObject<Root>(getPatCheckList().ToString());
  564. // report.RegisterData(json.result.data.classification, "classification");
  565. // report.RegisterData(json.result.data.settlement, "settlement");
  566. // report.RegisterData(json.result.data.reginfo, "reginfo");
  567. // report.RegisterData(json.result.data.patinsuinfo, "patinsuinfo");
  568. //}
  569. //catch (Exception ex)
  570. //{
  571. // MessageBox.Show(ex.Message);
  572. // return;
  573. //}
  574. ////report.Design();
  575. //report.Load(Global.curEvt.path + "\\frx\\湖北武汉结算单.frx");
  576. ////report.Show();
  577. //PrintPreview preview1 = new PrintPreview();
  578. //preview1.Show();
  579. //report.Preview = preview1.previewControl1;
  580. //report.Prepare(); //准备
  581. //report.ShowPrepared(); //显示
  582. //preview1.Show();
  583. }
  584. private void uiButton2_Click(object sender, EventArgs e)
  585. {
  586. Close();
  587. }
  588. public void btnPrint_Click(object sender, EventArgs e)
  589. {
  590. string errorMsg;
  591. int iHis = dgvSettlRecord.CurrentRow.Index;
  592. String BType = dgvSettlRecord.Rows[iHis].Cells["BillType"].Value.ToString();
  593. Global.pat.admType =int.Parse(dgvSettlRecord.Rows[iHis].Cells["admType"].Value.ToString());
  594. JObject joData = new JObject();
  595. joData.Add("mdtrt_id", dgvSettlRecord.Rows[iHis].Cells["MdtrtID"].Value.ToString());
  596. joData.Add("setl_id", dgvSettlRecord.Rows[iHis].Cells["SettlementID"].Value.ToString());
  597. joData.Add("psn_no", dgvSettlRecord.Rows[iHis].Cells["PersonnelNO"].Value.ToString());
  598. joData.Add("med_type", dgvSettlRecord.Rows[iHis].Cells["MedicalType"].Value.ToString());
  599. JObject joInput = new JObject();
  600. joInput.Add("data", joData);
  601. Global.pat.insuplc_admdvs = dgvSettlRecord.Rows[iHis].Cells["insuplc_admdvs"].Value.ToString();//更新参保地
  602. if (BType == "1") {
  603. #region【调用医保交易YH03打印】
  604. InvokeHelper invoker = new InvokeHelper();
  605. JObject joRtn = invoker.invokeCenterService("YH03", JsonHelper.setCenterInpar("YH03", joInput));
  606. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  607. {
  608. MessageBox.Show("打印失败:" + errorMsg);
  609. return;
  610. }
  611. #endregion
  612. }
  613. else if (BType == "-1")
  614. {
  615. #region【调用FastRepor打印】
  616. try
  617. {
  618. //Thread thread = new Thread(new ThreadStart(print));
  619. //thread.SetApartmentState(ApartmentState.STA); //重点
  620. //thread.Start();
  621. //thread.Join();
  622. print();
  623. }
  624. catch (Exception ex)
  625. {
  626. Global.writeLog("结算单打印异常:" + ex.Message);
  627. MessageBox.Show("打印异常:" + ex.Message);
  628. }
  629. #endregion
  630. }
  631. }
  632. public void btnDesign_Click(object sender, EventArgs e)
  633. {
  634. //try
  635. //{
  636. // Thread thread = new Thread(new ThreadStart(design));
  637. // thread.SetApartmentState(ApartmentState.STA); //重点
  638. // thread.Start();
  639. // thread.Join();
  640. //}
  641. //catch (Exception ex)
  642. //{
  643. // Global.writeLog("结算单设计预览异常:" + ex.Message);
  644. // MessageBox.Show("设计预览异常:" + ex.Message);
  645. //}
  646. if (dgvSettlRecord.RowCount <= 0)
  647. {
  648. MessageBox.Show("请先查询结算数据!");
  649. return;
  650. }
  651. try
  652. {
  653. int i = dgvSettlRecord.CurrentRow.Index;
  654. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  655. Global.pat.admType = int.Parse(dgvSettlRecord.Rows[i].Cells["admType"].Value.ToString());
  656. string AdmID = dt.Rows[i]["AdmID"].ToString();
  657. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  658. string ValidFlag = dt.Rows[i]["ValidFlag"].ToString();
  659. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  660. string BillType = dt.Rows[i]["BillType"].ToString();
  661. JObject joRtn = GetFastReportParams("Y", AdmID, MdtrtID, SettlementID, ValidFlag, BillType);
  662. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  663. {
  664. MessageBox.Show("获取FastReport入参失败:" + errMsg);
  665. return;
  666. }
  667. string sFastReportParam = JsonHelper.getDestValue(joRtn, "result");
  668. if (FastReportPrint(sFastReportParam, out errMsg) != 0)
  669. {
  670. MessageBox.Show("调用FastReport设计失败!" + errMsg);
  671. return;
  672. }
  673. }
  674. catch (Exception ex)
  675. {
  676. MessageBox.Show(ex.Message);
  677. return;
  678. }
  679. }
  680. private void SettlementChecklist_FormClosed(object sender, FormClosedEventArgs e)
  681. {
  682. Dispose();
  683. }
  684. //市医保进销存992001结算信息上传
  685. private void JXCJSToolStripMenuItem_Click(object sender, EventArgs e)
  686. {
  687. if (dgvSettlRecord.RowCount <= 0)
  688. {
  689. MessageBox.Show("请先查询结算数据!");
  690. return;
  691. }
  692. string sqlStr;
  693. try
  694. {
  695. int m = dgvSettlRecord.CurrentRow.Index;
  696. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  697. string msgid = dt.Rows[m]["msgid"].ToString();
  698. string SettlementID = dt.Rows[m]["SettlementID"].ToString();
  699. string ValidFlag = dt.Rows[m]["ValidFlag"].ToString();
  700. string MdtrtID = dt.Rows[m]["MdtrtID"].ToString();
  701. string BillType = dt.Rows[m]["BillType"].ToString();
  702. string AdmID= dt.Rows[m]["AdmID"].ToString();
  703. string billID = dt.Rows[m]["billID"].ToString();
  704. string recordID = dt.Rows[m]["recordID"].ToString();
  705. Global.pat.adm_Dr = int.Parse(AdmID);
  706. Global.pat.billID = billID;
  707. Global.pat.recordID = recordID;
  708. if (BillType == "-1")
  709. {
  710. MessageBox.Show("请选择结算正记录!该记录为退费记录");
  711. }
  712. sqlStr = "SELECT * FROM BS_MedInsuTransactionLog WHERE MSGID='" + msgid + "'";
  713. JObject joSqlstr = new JObject();
  714. joSqlstr.Add("sqlStr", sqlStr);
  715. JObject joRtn = mIS.QueryTransactionLog(joSqlstr);
  716. if (joRtn["result"]["data"].ToString() == "[]")
  717. {
  718. MessageBox.Show("查询结果为空!");
  719. return;
  720. }
  721. //DataTable dtlog = (DataTable)joRtn["result"]["data"][0].ToObject(typeof(DataTable));
  722. JObject Outlog = JObject.Parse(joRtn["result"]["data"][0]["OutparamPlain"].ToString());
  723. dynamic setlinfo = new JObject();//结算信息节点
  724. setlinfo.setl_id = Outlog["setl_id"];//结算ID
  725. setlinfo.mdtrt_id = Outlog["mdtrt_id"];//就诊ID
  726. setlinfo.psn_no = Outlog["psn_no"];//人员编号
  727. setlinfo.psn_name = Outlog["psn_name"];//人员姓名
  728. setlinfo.psn_cert_type = Outlog["psn_cert_type"];//凭证类型
  729. setlinfo.certno = Outlog["certno"];//证件号码
  730. setlinfo.gend = Outlog["gend"];//性别
  731. setlinfo.naty = Outlog["naty"];//民族
  732. setlinfo.brdy = Outlog["brdy"];//出生日期
  733. setlinfo.age = Outlog["age"];//年龄
  734. setlinfo.insutype = Outlog["insutype"];//险种类型
  735. setlinfo.psn_type = Outlog["psn_type"];//人员类别
  736. setlinfo.cvlserv_flag = Outlog["cvlserv_flag"];//公务员标志
  737. setlinfo.setl_time = Outlog["setl_time"];//结算时间
  738. setlinfo.mdtrt_cert_type = Outlog["mdtrt_cert_type"];//就诊凭证类型
  739. setlinfo.med_type = Outlog["med_type"];//医疗类别
  740. setlinfo.medfee_sumamt = Outlog["medfee_sumamt"];//医疗费总额
  741. setlinfo.fulamt_ownpay_amt = Outlog["fulamt_ownpay_amt"];//全自费金额
  742. setlinfo.overlmt_selfpay = Outlog["overlmt_selfpay"];//超限价自费费用
  743. setlinfo.preselfpay_amt = Outlog["preselfpay_amt"];//先行自付金额
  744. setlinfo.inscp_scp_amt = Outlog["inscp_scp_amt"];//符合政策范围金额
  745. setlinfo.act_pay_dedc = Outlog["act_pay_dedc"];//实际支付起付线
  746. setlinfo.hifp_pay = Outlog["hifp_pay"];//基本医疗保险统筹基金支出
  747. setlinfo.pool_prop_selfpay = Outlog["pool_prop_selfpay"];//基本医疗保险统筹基金支付比例
  748. setlinfo.cvlserv_pay = Outlog["cvlserv_pay"];//公务员医疗补助资金支出
  749. setlinfo.hifes_pay = Outlog["hifes_pay"];//企业补充医疗保险基金支出
  750. setlinfo.hifmi_pay = Outlog["hifmi_pay"];//居民大病保险资金支出
  751. setlinfo.hifob_pay = Outlog["hifob_pay"];//职工大额医疗费用补助基金支出
  752. setlinfo.maf_pay = Outlog["maf_pay"];//医疗救助基金支出
  753. setlinfo.oth_pay = Outlog["oth_pay"];//结算ID
  754. setlinfo.fund_pay_sumamt = Outlog["fund_pay_sumamt"];//基金支付总额
  755. setlinfo.psn_part_amt = Outlog["psn_part_amt"];//个人负担总金额
  756. setlinfo.acct_pay = Outlog["acct_pay"];//个人账户支出
  757. setlinfo.psn_cash_pay = Outlog["psn_cash_pay"];//个人现金支出
  758. setlinfo.balc = Outlog["balc"];//余额
  759. setlinfo.acct_mulaid_pay = Outlog["acct_mulaid_pay"];//个人账户共济支付金额
  760. setlinfo.medins_setl_id = Outlog["medins_setl_id"];//医药机构结算结算ID
  761. setlinfo.clr_optins = Outlog["clr_optins"];//clr_optins
  762. setlinfo.clr_way = Outlog["clr_way"];//clr_way
  763. setlinfo.clr_type = Outlog["clr_type"];//clr_type
  764. setlinfo.exp_content = Outlog["exp_content"];//exp_content
  765. setlinfo.hosp_part_amt = Outlog["hosp_part_amt"];//医院负担金额
  766. setlinfo.hifdm_pay = 0;//伤残人员医疗保障基金支出
  767. string outParam = "";
  768. //获取IS费用
  769. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  770. {
  771. MessageBox.Show("获取HIS费用失败");
  772. }
  773. //调用医保平台转换HIS费用(转换医保编码等)
  774. JObject joHisFee = JObject.Parse(outParam);
  775. if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  776. {
  777. MessageBox.Show("获取HIS费用医保对照关系失败");
  778. }
  779. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  780. JObject jaFeeOne=new JObject();
  781. for (int i = 0; i < jaFeeDetail.Count; i++)
  782. {
  783. jaFeeOne.Add("feedetl_sn", jaFeeDetail[i]["feedetl_sn"]);//费用明细流水号
  784. jaFeeOne.Add("rxno", "");//处方号
  785. if (string.IsNullOrEmpty(jaFeeDetail[i]["rx_circ_flag"].ToString()))
  786. {
  787. jaFeeOne.Add("rx_circ_flag", "");//外购处方标志
  788. }
  789. else
  790. {
  791. jaFeeOne.Add("rx_circ_flag", jaFeeDetail[i]["rx_circ_flag"]);//外购处方标志
  792. }
  793. jaFeeOne.Add("fee_ocur_time", jaFeeDetail[i]["fee_ocur_time"]);
  794. jaFeeOne.Add("med_list_codg", jaFeeDetail[i]["med_list_codg"]);
  795. jaFeeOne.Add("medins_list_codg", jaFeeDetail[i]["medins_list_codg"]);
  796. jaFeeOne.Add("medins_list_name", jaFeeDetail[i]["medins_list_desc"]);
  797. jaFeeOne.Add("prodname", jaFeeDetail[i]["medins_list_desc"]);
  798. if (string.IsNullOrEmpty(jaFeeDetail[i]["spec"].ToString()))
  799. {
  800. jaFeeOne.Add("spec", "");
  801. }
  802. else
  803. {
  804. jaFeeOne.Add("spec", jaFeeDetail[i]["spec"]);
  805. }
  806. if (string.IsNullOrEmpty(jaFeeDetail[i]["doseForm"].ToString()))
  807. {
  808. jaFeeOne.Add("dosform_name", "");
  809. }
  810. else
  811. {
  812. jaFeeOne.Add("dosform_name", jaFeeDetail[i]["doseForm"]);
  813. }
  814. jaFeeOne.Add(" det_item_fee_sumamt", jaFeeDetail[i]["det_item_fee_sumamt"]);
  815. jaFeeOne.Add("cnt", jaFeeDetail[i]["cnt"]);
  816. jaFeeOne.Add("pric", jaFeeDetail[i]["pric"]);
  817. if (string.IsNullOrEmpty(jaFeeDetail[i]["sin_dos_dscr"].ToString()))
  818. {
  819. jaFeeOne.Add("sin_dos_dscr", "");
  820. }
  821. else
  822. {
  823. jaFeeOne.Add("sin_dos_dscr", jaFeeDetail[i]["sin_dos_dscr"]);
  824. }
  825. if (string.IsNullOrEmpty(jaFeeDetail[i]["used_frqu_dscr"].ToString()))
  826. {
  827. jaFeeOne.Add("used_frqu_dscr", "");
  828. }
  829. else
  830. {
  831. jaFeeOne.Add("used_frqu_dscr", jaFeeDetail[i]["used_frqu_dscr"]);
  832. }
  833. if (string.IsNullOrEmpty(jaFeeDetail[i]["prd_days"].ToString()))
  834. {
  835. jaFeeOne.Add("prd_days", "");
  836. }
  837. else
  838. {
  839. jaFeeOne.Add("prd_days", jaFeeDetail[i]["prd_days"]);
  840. }
  841. MessageBox.Show("555");
  842. if (string.IsNullOrEmpty(jaFeeDetail[i]["medc_way_dscr"].ToString()))
  843. {
  844. jaFeeOne.Add("medc_way_dscr", "");
  845. }
  846. else
  847. {
  848. jaFeeOne.Add("medc_way_dscr", jaFeeDetail[i]["medc_way_dscr"]);
  849. }
  850. if (string.IsNullOrEmpty(jaFeeDetail[i]["bilg_dr_codg"].ToString()))
  851. {
  852. jaFeeOne.Add("bilg_dr_codg", "");
  853. }
  854. else
  855. {
  856. jaFeeOne.Add("bilg_dr_codg", jaFeeDetail[i]["bilg_dr_codg"]);
  857. }
  858. if (string.IsNullOrEmpty(jaFeeDetail[i]["bilg_dr_name"].ToString()))
  859. {
  860. jaFeeOne.Add("bilg_dr_name", "");
  861. }
  862. else
  863. {
  864. jaFeeOne.Add("bilg_dr_name", jaFeeDetail[i]["bilg_dr_name"]);
  865. }
  866. MessageBox.Show("666");
  867. jaFeeOne.Add("phar_name", "");
  868. jaFeeOne.Add("phar_prac_cert_no", "");
  869. jaFeeOne.Add("tcmdrug_used_way", ""); //中药使用方式 1复方 2单方 必填
  870. jaFeeOne.Add("trdn_flag", "1");//拆零标志 必填 0否 1是
  871. jaFeeDetail.Add(jaFeeOne);
  872. jaFeeOne = new JObject();
  873. MessageBox.Show("777");
  874. }
  875. JObject Jo992001 = new JObject();
  876. Jo992001.Add("setlinfo",JObject.Parse(setlinfo));//结算信息节点
  877. Jo992001.Add("drugdetail", jaFeeDetail);//购药明细节点
  878. MessageBox.Show("上传开始:" + Jo992001.ToString());
  879. JObject OutJo = invoker.invokeCenterServiceJXC("992001", JObject.Parse(JsonHelper.setCenterInpar("992001", Jo992001)));
  880. MessageBox.Show("上传返回:" + OutJo.ToString());
  881. }
  882. catch (Exception ex)
  883. {
  884. MessageBox.Show(ex.Message);
  885. return;
  886. }
  887. }
  888. }
  889. // Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
  890. public class Classification
  891. {
  892. public string cwfSummat { get; set; }
  893. public string cwfInScope { get; set; }
  894. public string cwfPreSelfPay { get; set; }
  895. public string cwfOverLimit { get; set; }
  896. public string cwfFullOwnPay { get; set; }
  897. public string zcfSummat { get; set; }
  898. public string zcfInScope { get; set; }
  899. public string zcfPreSelfPay { get; set; }
  900. public string zcfOverLimit { get; set; }
  901. public string zcfFullOwnPay { get; set; }
  902. public string jcfSummat { get; set; }
  903. public string jcfInScope { get; set; }
  904. public string jcfPreSelfPay { get; set; }
  905. public string jcfOverLimit { get; set; }
  906. public string jcfFullOwnPay { get; set; }
  907. public string hyfSummat { get; set; }
  908. public string hyfInScope { get; set; }
  909. public string hyfPreSelfPay { get; set; }
  910. public string hyfOverLimit { get; set; }
  911. public string hyfFullOwnPay { get; set; }
  912. public string zlfSummat { get; set; }
  913. public string zlfInScope { get; set; }
  914. public string zlfPreSelfPay { get; set; }
  915. public string zlfOverLimit { get; set; }
  916. public string zlfFullOwnPay { get; set; }
  917. public string ssfSummat { get; set; }
  918. public string ssfInScope { get; set; }
  919. public string ssfPreSelfPay { get; set; }
  920. public string ssfOverLimit { get; set; }
  921. public string ssfFullOwnPay { get; set; }
  922. public string hlfSummat { get; set; }
  923. public string hlfInScope { get; set; }
  924. public string hlfPreSelfPay { get; set; }
  925. public string hlfOverLimit { get; set; }
  926. public string hlfFullOwnPay { get; set; }
  927. public string wsclfSummat { get; set; }
  928. public string wsclfInScope { get; set; }
  929. public string wsclfPreSelfPay { get; set; }
  930. public string wsclfOverLimit { get; set; }
  931. public string wsclfFullOwnPay { get; set; }
  932. public string xyfSummat { get; set; }
  933. public string xyfInScope { get; set; }
  934. public string xyfPreSelfPay { get; set; }
  935. public string xyfOverLimit { get; set; }
  936. public string xyfFullOwnPay { get; set; }
  937. public string zyypfSummat { get; set; }
  938. public string zyypfInScope { get; set; }
  939. public string zyypfPreSelfPay { get; set; }
  940. public string zyypfOverLimit { get; set; }
  941. public string zyypfFullOwnPay { get; set; }
  942. public string zcyfSummat { get; set; }
  943. public string zcyfInScope { get; set; }
  944. public string zcyfPreSelfPay { get; set; }
  945. public string zcyfOverLimit { get; set; }
  946. public string zcyfFullOwnPay { get; set; }
  947. public string ybzlfSummat { get; set; }
  948. public string ybzlfInScope { get; set; }
  949. public string ybzlfPreSelfPay { get; set; }
  950. public string ybzlfOverLimit { get; set; }
  951. public string ybzlfFullOwnPay { get; set; }
  952. public string ghfSummat { get; set; }
  953. public string ghfInScope { get; set; }
  954. public string ghfPreSelfPay { get; set; }
  955. public string ghfOverLimit { get; set; }
  956. public string ghfFullOwnPay { get; set; }
  957. public string qtSummat { get; set; }
  958. public string qtInScope { get; set; }
  959. public string qtPreSelfPay { get; set; }
  960. public string qtOverLimit { get; set; }
  961. public string qtFullOwnPay { get; set; }
  962. public string totalSummat { get; set; }
  963. public string totalInScope { get; set; }
  964. public string totalPreSelfPay { get; set; }
  965. public string totalOverLimit { get; set; }
  966. public string totalFullOwnPay { get; set; }
  967. }
  968. public class Data
  969. {
  970. public List<Classification> classification { get; set; }
  971. public List<Settlement> settlement { get; set; }
  972. public List<Reginfo> reginfo { get; set; }
  973. public List<Patinsuinfo> patinsuinfo { get; set; }
  974. }
  975. public class Patinsuinfo
  976. {
  977. public string PsnCertType { get; set; }
  978. public string PsnCertNO { get; set; }
  979. public string Gend { get; set; }
  980. public string Naty { get; set; }
  981. public string Brdy { get; set; }
  982. public string Age { get; set; }
  983. public string Balc { get; set; }
  984. public string PsnType { get; set; }
  985. public string Cvlservflag { get; set; }
  986. public string insuplcAdmdvs { get; set; }
  987. public string EmpName { get; set; }
  988. public string PsnIdettype { get; set; }
  989. public string PsnTypeLv { get; set; }
  990. }
  991. public class Reginfo
  992. {
  993. public string AttendDoctorNO { get; set; }
  994. public string ChiefPhyDocName { get; set; }
  995. public string AdmitDepartmentCode { get; set; }
  996. public string AdmitDepartmentName { get; set; }
  997. public string AdmBed { get; set; }
  998. public string MainDiagCode { get; set; }
  999. public string MainDiagName { get; set; }
  1000. public string RegDate { get; set; }
  1001. public string ConerName { get; set; }
  1002. public string Tel { get; set; }
  1003. }
  1004. public class Result
  1005. {
  1006. public Data data { get; set; }
  1007. }
  1008. public class Root
  1009. {
  1010. public Result result { get; set; }
  1011. public int errorCode { get; set; }
  1012. public string errorMessage { get; set; }
  1013. }
  1014. public class Settlement
  1015. {
  1016. public string AdmID { get; set; }
  1017. public string MdtrtID { get; set; }
  1018. public string SettlementID { get; set; }
  1019. public string PersonnelNO { get; set; }
  1020. public string PatientName { get; set; }
  1021. public string birth { get; set; }
  1022. public string CertificateNO { get; set; }
  1023. public string Gender { get; set; }
  1024. public string InsuranceType { get; set; }
  1025. public string PersonType { get; set; }
  1026. public string CivilserviceFlag { get; set; }
  1027. public string SettlementTime { get; set; }
  1028. public string MedicalType { get; set; }
  1029. public string Sumamt { get; set; }
  1030. public string OwnPayAmount { get; set; }
  1031. public string OverLimitAmount { get; set; }
  1032. public string PreSelfPayAmount { get; set; }
  1033. public string InPolicyRangeAmount { get; set; }
  1034. public double ActualPayDeductible { get; set; }
  1035. public string HealthInsurancePay { get; set; }
  1036. public string HealthInsuranceRatio { get; set; }
  1037. public double CivilserviceAllowancePay { get; set; }
  1038. public string EnterpriseSupplementPay { get; set; }
  1039. public string SeriousIllnessPay { get; set; }
  1040. public string LargeExpensesSupplementPay { get; set; }
  1041. public string MedicalAssistPay { get; set; }
  1042. public string HospitalPartAmount { get; set; }
  1043. public string OtherPay { get; set; }
  1044. public string FundPaySumamt { get; set; }
  1045. public string PersonPaySumamt { get; set; }
  1046. public string AccountPaySumamt { get; set; }
  1047. public string PersonCashPay { get; set; }
  1048. public string Balance { get; set; }
  1049. public string AccountMutualAidAmount { get; set; }
  1050. public string OrganSettlementID { get; set; }
  1051. public string ClearingOrgan { get; set; }
  1052. public string ClearingWay { get; set; }
  1053. public string ClearingType { get; set; }
  1054. public string ValidFlag { get; set; }
  1055. public string msgid { get; set; }
  1056. public string HospitalizationsTimes { get; set; }
  1057. public string HospitalizationsDays { get; set; }
  1058. public string HISAdmTime { get; set; }
  1059. public string HISDischargeTime { get; set; }
  1060. public int BillType { get; set; }
  1061. public string BillID { get; set; }
  1062. public string admType { get; set; }
  1063. public string RecordID { get; set; }
  1064. public string insuplc_admdvs { get; set; }
  1065. }
  1066. }