OutpatientRegistrationRegisterOP.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. using Newtonsoft.Json;
  2. using Newtonsoft.Json.Linq;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. using PTMedicalInsurance.Common;
  13. using PTMedicalInsurance.Helper;
  14. using PTMedicalInsurance.Variables;
  15. namespace PTMedicalInsurance.Forms
  16. {
  17. public partial class OutpatientRegistrationRegisterOP : Form
  18. {
  19. public OutpatientRegistrationRegisterOP(JObject joPatInfo, int iOtherProvLocal)
  20. {
  21. InitializeComponent();
  22. this.StartPosition = FormStartPosition.CenterParent;
  23. string sqlCondition = " and A.Interface_Dr = '" + Global.inf.interfaceDr.ToString() + "'";
  24. if (Global.pat.RYorCY == "2")
  25. {
  26. string sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr "
  27. + " WHERE B.Code='" + Global.pat.insuType + "' and A.InsuCode = 'BAE059'" + sqlCondition;
  28. SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
  29. sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr"
  30. + " WHERE B.Code='" + Global.pat.medType + "' and A.InsuCode = 'AKA130'" + sqlCondition;
  31. SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
  32. }
  33. else
  34. {
  35. string sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr "
  36. + " WHERE A.InsuCode = 'BAE059'" + sqlCondition;
  37. SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
  38. sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr "
  39. + " WHERE A.InsuCode = 'AKA130'" + sqlCondition;
  40. SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
  41. }
  42. cbxAccountPay.Checked = true;
  43. personAccountUsedFlag = "1";
  44. #region【赋值医保人员参保信息】
  45. string persontype, sex, hospflag, isyt, jclevel, fundtype, ServantFlag, PoorFlag, InHospitalNumber, AreaCode;
  46. string isspecifiedhosp = "", isinredlist = "", ischronichosp = "";
  47. //解析返回值
  48. if (iOtherProvLocal == 0) //本地
  49. {
  50. this.TitleText.Text = "医保中心返回参保人员信息(本地)";
  51. this.edt_YBBH.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.ic_no");
  52. persontype = JsonHelper.getDestValue(joPatInfo, "root.output.net.persontype");
  53. isspecifiedhosp = JsonHelper.getDestValue(joPatInfo, "root.output.net.isspecifiedhosp");
  54. ischronichosp = JsonHelper.getDestValue(joPatInfo, "root.output.net.ischronichosp");
  55. isinredlist = JsonHelper.getDestValue(joPatInfo, "root.output.net.isinredlist");
  56. sex = JsonHelper.getDestValue(joPatInfo, "root.output.ic.sex");
  57. hospflag = JsonHelper.getDestValue(joPatInfo, "root.output.ic.hospflag");
  58. isyt = JsonHelper.getDestValue(joPatInfo, "root.output.ic.isyt");
  59. jclevel = JsonHelper.getDestValue(joPatInfo, "root.output.ic.jclevel");
  60. fundtype = JsonHelper.getDestValue(joPatInfo, "root.output.ic.fundtype");
  61. this.edt_XM.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.personname");
  62. this.edt_KH.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.card_no");
  63. this.edt_SFZH.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.id_no");
  64. this.edt_CSRQ.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.birthday");
  65. this.edt_ZZSX.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.fromhospdate");
  66. this.edt_ZZYYBM.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.fromhosp");
  67. this.edt_MBBM.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.chroniccode"); //慢病编码
  68. this.edt_ZHYE.Text = JsonHelper.getDestValue(joPatInfo, "root.output.net.personcount");
  69. }
  70. else
  71. {
  72. this.TitleText.Text = "医保中心返回参保人员信息(异地)";
  73. this.edt_YBBH.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.Person_manage");
  74. persontype = JsonHelper.getDestValue(joPatInfo, "root.output.ic.persontype");
  75. sex = JsonHelper.getDestValue(joPatInfo, "root.output.ic.sex");
  76. hospflag = JsonHelper.getDestValue(joPatInfo, "root.output.ic.hospflag");
  77. isyt = JsonHelper.getDestValue(joPatInfo, "root.output.ic.isyt");
  78. jclevel = JsonHelper.getDestValue(joPatInfo, "root.output.ic.jclevel");
  79. fundtype = JsonHelper.getDestValue(joPatInfo, "root.output.ic.fundtype");
  80. ServantFlag = JsonHelper.getDestValue(joPatInfo, "root.output.ic.ServantFlag");
  81. PoorFlag = JsonHelper.getDestValue(joPatInfo, "root.output.ic.PoorFlag");
  82. InHospitalNumber = JsonHelper.getDestValue(joPatInfo, "root.output.ic.InHospitalNumber");
  83. AreaCode = JsonHelper.getDestValue(joPatInfo, "root.output.ic.AreaCode");
  84. this.edt_XM.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.personname");
  85. this.edt_KH.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.card_no");
  86. this.edt_SFZH.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.id_no");
  87. this.edt_CSRQ.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.birthday");
  88. this.edt_ZZSX.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.fromhospdate");
  89. this.edt_ZZYYBM.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.fromhosp");
  90. this.edt_ZHYE.Text = JsonHelper.getDestValue(joPatInfo, "root.output.ic.personcount");
  91. this.edt_AreaCode.Text = AreaCode;
  92. Global.pat.insuplc_admdvs = AreaCode; //参保地行政区划
  93. }
  94. Global.pat.psn_no = this.edt_YBBH.Text;
  95. switch (persontype)
  96. {
  97. case "10":
  98. {
  99. this.edt_RYLB.Text = "本市复读的学生";
  100. break;
  101. }
  102. case "11":
  103. {
  104. this.edt_RYLB.Text = "在职职工";
  105. break;
  106. }
  107. case "12":
  108. {
  109. this.edt_RYLB.Text = "在职长期驻外";
  110. break;
  111. }
  112. case "21":
  113. {
  114. this.edt_RYLB.Text = "退休";
  115. break;
  116. }
  117. case "22":
  118. {
  119. this.edt_RYLB.Text = "退休异地安置";
  120. break;
  121. }
  122. case "31":
  123. {
  124. this.edt_RYLB.Text = "离休";
  125. break;
  126. }
  127. case "32":
  128. {
  129. this.edt_RYLB.Text = "二等乙级伤残军人";
  130. break;
  131. }
  132. case "33":
  133. {
  134. this.edt_RYLB.Text = "离休异地安置";
  135. break;
  136. }
  137. case "41":
  138. {
  139. this.edt_RYLB.Text = "遗孀";
  140. break;
  141. }
  142. case "91":
  143. {
  144. this.edt_RYLB.Text = "其他人员";
  145. break;
  146. }
  147. }
  148. Global.pat.psnTypeName = this.edt_RYLB.Text;
  149. if (sex == "1")
  150. this.edt_XB.Text = "男";
  151. else
  152. this.edt_XB.Text = "女";
  153. if (isinredlist == "true")
  154. this.edt_SFHMD.Text = "是";
  155. else
  156. this.edt_SFHMD.Text = "不在红名单";
  157. if (isspecifiedhosp == "0")
  158. {
  159. this.edt_BRDDYY.Text = "本地红名单,默认为定点医院";
  160. }
  161. else if (isspecifiedhosp == "1")
  162. {
  163. this.edt_BRDDYY.Text = "是本人定点医院";
  164. }
  165. else if (isspecifiedhosp == "2")
  166. {
  167. this.edt_BRDDYY.Text = "不是本人定点医院";
  168. }
  169. else if (isspecifiedhosp == "3")
  170. {
  171. this.edt_BRDDYY.Text = "转诊医院";
  172. }
  173. switch (fundtype)
  174. {
  175. case "1":
  176. {
  177. this.edt_XZLX.Text = "基本养老保险";
  178. break;
  179. }
  180. case "2":
  181. {
  182. this.edt_XZLX.Text = "失业保险";
  183. break;
  184. }
  185. case "3":
  186. {
  187. this.edt_XZLX.Text = "基本医疗保险";
  188. break;
  189. }
  190. case "4":
  191. {
  192. this.edt_XZLX.Text = "工伤保险";
  193. break;
  194. }
  195. case "5":
  196. {
  197. this.edt_XZLX.Text = "生育保险";
  198. break;
  199. }
  200. case "6":
  201. {
  202. this.edt_XZLX.Text = "企业补充养老保险";
  203. break;
  204. }
  205. case "7":
  206. {
  207. this.edt_XZLX.Text = "个人储蓄性养老保险";
  208. break;
  209. }
  210. case "8":
  211. {
  212. this.edt_XZLX.Text = "预提补充医疗保险";
  213. break;
  214. }
  215. case "81":
  216. {
  217. this.edt_XZLX.Text = "退休人员统一补充医疗保险";
  218. break;
  219. }
  220. case "20":
  221. {
  222. this.edt_XZLX.Text = "大额医疗互助";
  223. break;
  224. }
  225. case "30":
  226. {
  227. this.edt_XZLX.Text = "公务员医疗补助";
  228. break;
  229. }
  230. case "31":
  231. {
  232. this.edt_XZLX.Text = "离休医疗费统筹";
  233. break;
  234. }
  235. case "32":
  236. {
  237. this.edt_XZLX.Text = "公费医疗";
  238. break;
  239. }
  240. case "33":
  241. {
  242. this.edt_XZLX.Text = "征地超转人员医疗保险";
  243. break;
  244. }
  245. case "91":
  246. {
  247. this.edt_XZLX.Text = "学生儿童大病医疗保险";
  248. break;
  249. }
  250. case "92":
  251. {
  252. this.edt_XZLX.Text = "城镇无保障老年人大病医疗保险";
  253. break;
  254. }
  255. case "93":
  256. {
  257. this.edt_XZLX.Text = "城镇居民基本医疗保险";
  258. break;
  259. }
  260. case "310":
  261. {
  262. this.edt_XZLX.Text = "职工基本医疗保险";
  263. break;
  264. }
  265. case "320":
  266. {
  267. this.edt_XZLX.Text = "公务员医疗补助";
  268. break;
  269. }
  270. case "330":
  271. {
  272. this.edt_XZLX.Text = "大额医疗费用补助";
  273. break;
  274. }
  275. case "340":
  276. {
  277. this.edt_XZLX.Text = "离休人员医疗保障";
  278. break;
  279. }
  280. case "350":
  281. {
  282. this.edt_XZLX.Text = "一至六级残废军人医疗补助";
  283. break;
  284. }
  285. case "360":
  286. {
  287. this.edt_XZLX.Text = "老红军医疗保障";
  288. break;
  289. }
  290. case "370":
  291. {
  292. this.edt_XZLX.Text = "企业补充医疗保险";
  293. break;
  294. }
  295. case "380":
  296. {
  297. this.edt_XZLX.Text = "新型农村合作医疗";
  298. break;
  299. }
  300. case "390":
  301. {
  302. this.edt_XZLX.Text = "城乡居民基本医疗保险";
  303. break;
  304. }
  305. case "391":
  306. {
  307. this.edt_XZLX.Text = "城镇居民基本医疗保险";
  308. break;
  309. }
  310. case "392":
  311. {
  312. this.edt_XZLX.Text = "城乡居民大病医疗保险";
  313. break;
  314. }
  315. case "399":
  316. {
  317. this.edt_XZLX.Text = "其他特殊人员医疗保障";
  318. break;
  319. }
  320. case "510":
  321. {
  322. this.edt_XZLX.Text = "生育保险";
  323. break;
  324. }
  325. case "410":
  326. {
  327. this.edt_XZLX.Text = "长期照护保险";
  328. break;
  329. }
  330. case "39906":
  331. {
  332. this.edt_XZLX.Text = "意外伤害保险";
  333. break;
  334. }
  335. }
  336. Global.pat.insuTypeName = this.edt_XZLX.Text;
  337. if (isyt == "0")
  338. this.edt_YTRYBS.Text = "普通人员";
  339. else
  340. this.edt_YTRYBS.Text = "预提人员";
  341. switch (hospflag)
  342. {
  343. case "0":
  344. {
  345. this.edt_ZYBS.Text = "未住院状态";
  346. break;
  347. }
  348. case "1":
  349. {
  350. this.edt_ZYBS.Text = "住院状态";
  351. break;
  352. }
  353. case "2":
  354. {
  355. this.edt_ZYBS.Text = "急诊留观";
  356. break;
  357. }
  358. case "3":
  359. {
  360. this.edt_ZYBS.Text = "家庭病床";
  361. break;
  362. }
  363. case "4":
  364. {
  365. this.edt_ZYBS.Text = "住院计划生育手术";
  366. break;
  367. }
  368. case "41":
  369. {
  370. this.edt_ZYBS.Text = "工伤保险住院状态";
  371. break;
  372. }
  373. case "51":
  374. {
  375. this.edt_ZYBS.Text = "生育保险住院状态";
  376. break;
  377. }
  378. }
  379. switch (jclevel)
  380. {
  381. case "0":
  382. {
  383. this.edt_JCDJ.Text = "不享受伤残待遇";
  384. break;
  385. }
  386. case "1":
  387. {
  388. this.edt_JCDJ.Text = "享受一级伤残待遇";
  389. break;
  390. }
  391. case "2":
  392. {
  393. this.edt_JCDJ.Text = "享受二级伤残待遇";
  394. break;
  395. }
  396. case "3":
  397. {
  398. this.edt_JCDJ.Text = "享受三级伤残待遇";
  399. break;
  400. }
  401. case "4":
  402. {
  403. this.edt_JCDJ.Text = "享受四级伤残待遇";
  404. break;
  405. }
  406. case "5":
  407. {
  408. this.edt_JCDJ.Text = "享受五级伤残待遇";
  409. break;
  410. }
  411. case "6":
  412. {
  413. this.edt_JCDJ.Text = "享受六级伤残待遇";
  414. break;
  415. }
  416. }
  417. if (ischronichosp == "true")
  418. this.edt_MXBDDYY.Text = "是";
  419. else
  420. this.edt_MXBDDYY.Text = "否";
  421. #endregion
  422. }
  423. private DataTable dtDisease;
  424. private DataTable dtDiseaseType;
  425. private DataTable dtInsuranceType;
  426. private DataTable dtMedicalType;
  427. private DataTable dtOperation;
  428. private DataTable dtSettelmentType;
  429. //险种
  430. public string insuType { get; set; }
  431. public string insuTypeName { get; set; }
  432. //医疗类别
  433. public string med_type { get; set; }
  434. public string med_type_name { get; set; }
  435. //诊断
  436. public string diseCodg { get; set; }
  437. public string diseName { get; set; }
  438. //手术
  439. public string oprn_oprt_code { get; set; }
  440. public string oprn_oprt_name { get; set; }
  441. //病种
  442. public string dise_type_code { get; set; }
  443. public string dise_type_name { get; set; }
  444. //结算方式
  445. public string psn_setlway { get; set; }
  446. public string psn_setlway_name { get; set; }
  447. public DataTable DtDiagnose { get; set; }
  448. public string personAccountUsedFlag = "0";
  449. private DataTable GetDBLKComboxTable(string sqlStr)
  450. {
  451. InvokeHelper invoker = new InvokeHelper();
  452. dynamic joInparm = new JObject();
  453. dynamic joTmp = new JObject();
  454. joTmp.sqlStr = sqlStr;
  455. JArray jaParams = new JArray();
  456. jaParams.Add(joTmp);
  457. joInparm.Add("params", JArray.FromObject(jaParams));
  458. joInparm.code = "09010014";
  459. string inParam = joInparm.ToString();
  460. JObject joRtn = invoker.invokeInsuService(inParam, "获取下拉框消息");
  461. //dynamic jsonRtn = JsonConvert.DeserializeObject(strRtn);
  462. DataTable dt = (DataTable)joRtn["result"].ToObject(typeof(DataTable));
  463. //dt.Columns[0].ColumnName = "编码";
  464. //dt.Columns[1].ColumnName = "名称";
  465. //dt.Columns[2].ColumnName = "拼音查找码";
  466. return dt;
  467. }
  468. private void SetDBLKCombox(ref PTControl.DBLookupCombox dblcbx, string sqlStr)
  469. {
  470. dblcbx.sDisplayField = "Code,Name,SearchCode";
  471. dblcbx.sDisplayMember = "名称";
  472. dblcbx.sKeyWords = "Code,SearchCode";
  473. dblcbx.DataSource = GetDBLKComboxTable(sqlStr);
  474. dblcbx.RowFilterVisible = true;
  475. dblcbx.TextBox.Width = 400;
  476. dblcbx.DataGridView.Width = 400;
  477. dblcbx.DataGridView.Columns[0].Name = "编码";
  478. dblcbx.DataGridView.Columns[1].Name = "名称";
  479. dblcbx.DataGridView.Columns[2].Name = "查找码";
  480. dblcbx.DataGridView.Columns[0].Width = 100;
  481. dblcbx.DataGridView.Columns[1].Width = 200;
  482. }
  483. private void OutpatientRegistrationRegisterOP_Load(object sender, EventArgs e)
  484. {
  485. dgvDiagnose.AutoGenerateColumns = false;
  486. dgvDiagnose.DataSource = DtDiagnose;
  487. //DtDiagnose.AcceptChanges();
  488. dgvDiagnose.ReadOnly = true;
  489. }
  490. private void btnOK_Click(object sender, EventArgs e)
  491. {
  492. if (cbxAccountPay.Checked)
  493. {
  494. personAccountUsedFlag = "1";
  495. Global.pat.personAccountUsedFlag = 1;
  496. }
  497. else
  498. {
  499. personAccountUsedFlag = "0";
  500. Global.pat.personAccountUsedFlag = 0;
  501. }
  502. if (chk_SJDSFBZ.Checked)
  503. Global.pat.relttpflag = 1;
  504. else
  505. Global.pat.relttpflag = 0;
  506. if (chk_WSBZ.Checked)
  507. Global.pat.trumflag = 1;
  508. else
  509. Global.pat.trumflag = 0;
  510. if (cbb_JZRQLX.SelectedIndex >= 0)
  511. Global.pat.mdtrtgrptype = cbb_JZRQLX.Text.Trim().Substring(0, 1);
  512. this.DialogResult = DialogResult.OK;
  513. }
  514. private void dblkcbxInsuranceType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  515. {
  516. DataGridViewRow row = e.Value as DataGridViewRow;
  517. DataRowView dataRow = row.DataBoundItem as DataRowView;
  518. insuType = dataRow["Code"].ToString().Trim();
  519. insuTypeName = dataRow["Name"].ToString().Trim();
  520. Global.pat.insuType = insuType;
  521. }
  522. private void dblkcbxMedicalType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  523. {
  524. DataGridViewRow row = e.Value as DataGridViewRow;
  525. DataRowView dataRow = row.DataBoundItem as DataRowView;
  526. med_type = dataRow["Code"].ToString().Trim();
  527. med_type_name = dataRow["Name"].ToString().Trim();
  528. Global.pat.medType = med_type;
  529. Global.pat.medTypeName = med_type_name;
  530. }
  531. private void btnCancel_Click(object sender, EventArgs e)
  532. {
  533. this.DialogResult = DialogResult.Cancel;
  534. }
  535. }
  536. }