PatientInsuInfo.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 Newtonsoft.Json.Linq;
  11. using PTMedicalInsurance.Variables;
  12. namespace PTMedicalInsurance.Forms
  13. {
  14. public partial class PatientInsuInfo : Form
  15. {
  16. public DataTable dtDiseInfo;
  17. public DataTable dtTypeInfo;
  18. public JObject joSelectedInsuInfo;
  19. public DataTable dtPsnType;
  20. public PatientInsuInfo()
  21. {
  22. InitializeComponent();
  23. }
  24. public PatientInsuInfo(JObject jo)
  25. {
  26. InitializeComponent();
  27. if (jo["prm_ykc010"].HasValues)
  28. {
  29. if (jo["prm_ykc010"]["row"].Type == JTokenType.Array)
  30. {
  31. dtDiseInfo = (DataTable)jo["prm_ykc010"]["row"].ToObject(typeof(DataTable));
  32. }
  33. else
  34. {
  35. JArray jaYkc010 = new JArray();
  36. jaYkc010.Add(jo["prm_ykc010"]["row"]);
  37. dtDiseInfo = (DataTable)jaYkc010.ToObject(typeof(DataTable));
  38. }
  39. }
  40. else
  41. {
  42. JArray ja = new JArray();
  43. dtDiseInfo = (DataTable)ja.ToObject(typeof(DataTable));
  44. }
  45. if (jo["prm_ykc296"].HasValues)
  46. {
  47. if (jo["prm_ykc296"]["row"].Type == JTokenType.Array)
  48. {
  49. dtPsnType = (DataTable)jo["prm_ykc296"]["row"].ToObject(typeof(DataTable));
  50. }
  51. else
  52. {
  53. JArray jaYkc296 = new JArray();
  54. jaYkc296.Add(jo["prm_ykc296"]["row"]);
  55. dtPsnType = (DataTable)jaYkc296.ToObject(typeof(DataTable));
  56. }
  57. }
  58. else
  59. {
  60. JArray ja = new JArray();
  61. dtPsnType = (DataTable)ja.ToObject(typeof(DataTable));
  62. }
  63. //dtDiseInfo = (DataTable)jo["prm_ykc010"]["row"].ToObject(typeof(DataTable));
  64. //dtTypeInfo = (DataTable)jo["prm_ykc296>"]["row"].ToObject(typeof(DataTable));
  65. this.tbName.Text = jo["prm_aac003"].ToString();
  66. this.tbPsnNO.Text = jo["prm_aac001"].ToString();
  67. this.tbGend.Text = jo["prm_aac004"].ToString();
  68. this.tbBirthDay.Text = jo["prm_aac006"].ToString();
  69. //this.tbNaty.Text = jo["naty"].ToString();
  70. //this.tbCertType.Text = jo["psn_cert_type"].ToString();
  71. this.tbCertNO.Text = jo["prm_aac002"].ToString();
  72. this.tbAge.Text = jo["prm_akc023"].ToString();
  73. this.tbOrganizationNO.Text = jo["prm_aab001"].ToString();
  74. this.tbOrganizationName.Text = jo["prm_aab004"].ToString();
  75. this.tbInsuStatus.Text = jo["prm_aac031"].ToString();
  76. this.tbBalc.Text = jo["prm_akc087"].ToString();
  77. this.tbSubCenter.Text = jo["prm_yab003"].ToString();
  78. this.tbPMedType.Text = jo["prm_ykc280"].ToString();
  79. this.tbMedPsnType.Text = jo["prm_ykc281"].ToString();
  80. this.tbDuty.Text = jo["prm_aac020"].ToString();
  81. this.tbInHospState.Text = jo["prm_ykc023"].ToString();
  82. this.tbBusType.Text = jo["prm_ykc305"].ToString();
  83. this.tbPhone.Text = jo["prm_aae005"].ToString();
  84. this.tbAdress.Text = jo["prm_aae006"].ToString();
  85. this.tbMedCardNO.Text = jo["prm_yac005"].ToString();
  86. this.tbSpecDiseFlag.Text = jo["prm_symbol"].ToString();
  87. this.tbIsInWait.Text = jo["prm_ykc101"].ToString();
  88. //工伤无共济信息
  89. this.tbOutLimitPay.Text = jo["prm_yka128"].ToString();
  90. if (jo["prm_auther_no"] != null)
  91. this.tbMutualAiderNO.Text = jo["prm_auther_no"].ToString();
  92. if (jo["prm_auther_certno"] != null)
  93. this.tbMutualAiderCertNO.Text = jo["prm_auther_certno"].ToString();
  94. if (jo["prm_auther_name"] != null)
  95. this.tbMutualAiderName.Text = jo["prm_auther_name"].ToString();
  96. if (jo["prm_auther_insu_admdvs"] != null)
  97. this.tbMutualAiderDivision.Text = jo["prm_auther_insu_admdvs"].ToString();
  98. setDgvPsnType();
  99. setDgvDiseInfo();
  100. dgvDiseInfo.DataSource = dtDiseInfo;
  101. dgvPsnTypeInfo.DataSource = dtPsnType;
  102. }
  103. private void AddDGVColumn(DataGridView dgv, string headerText, string dataPropertyName, int width = 120)
  104. {
  105. DataGridViewColumn newColumn = new DataGridViewTextBoxColumn();
  106. newColumn.HeaderText = headerText;
  107. newColumn.Width = width;
  108. newColumn.DataPropertyName = dataPropertyName;
  109. newColumn.Name = dataPropertyName;
  110. dgv.Columns.Add(newColumn);
  111. }
  112. private void setDgvPsnType()
  113. {
  114. AddDGVColumn(dgvPsnTypeInfo, "城乡居民类别", "ykc296", 80);
  115. AddDGVColumn(dgvPsnTypeInfo, "城乡居民类别名称", "YKC297", 200);
  116. AddDGVColumn(dgvPsnTypeInfo, "开始时间", "AAE030");
  117. AddDGVColumn(dgvPsnTypeInfo, "结束时间", "AAE031");
  118. dgvPsnTypeInfo.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Bold);
  119. dgvPsnTypeInfo.ColumnHeadersHeight = 40;
  120. }
  121. private void setDgvDiseInfo()
  122. {
  123. AddDGVColumn(dgvDiseInfo, "医院编码", "akb020", 80);
  124. AddDGVColumn(dgvDiseInfo, "分中心", "YAB003", 200);
  125. AddDGVColumn(dgvDiseInfo, "疾病编码", "YKA026");
  126. AddDGVColumn(dgvDiseInfo, "病种名称", "YKA027");
  127. AddDGVColumn(dgvDiseInfo, "开始时间", "AAE030");
  128. AddDGVColumn(dgvDiseInfo, "结束时间", "AAE031");
  129. AddDGVColumn(dgvDiseInfo, "拼音助记码", "YKA260", 60);
  130. AddDGVColumn(dgvDiseInfo, "病种标志名称", "YKD112");
  131. AddDGVColumn(dgvDiseInfo, ">补助标准", "YKA068", 300);
  132. AddDGVColumn(dgvDiseInfo, ">病种标志编码", "YKD111", 300);
  133. dgvDiseInfo.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Bold);
  134. dgvDiseInfo.ColumnHeadersHeight = 40;
  135. }
  136. private void uiButton1_Click(object sender, EventArgs e)
  137. {
  138. joSelectedInsuInfo["prm_ykc296"] = "";
  139. if (dtPsnType.Rows.Count != 0)
  140. {
  141. Global.pat.patExtend.ykc296 = dtPsnType.Rows[dgvPsnTypeInfo.CurrentRow.Index]["ykc296"].ToString();
  142. joSelectedInsuInfo["prm_ykc296"] = Global.pat.patExtend.ykc296;
  143. }
  144. DialogResult = DialogResult.OK;
  145. }
  146. private void uiButton2_Click(object sender, EventArgs e)
  147. {
  148. DialogResult = DialogResult.Cancel;
  149. }
  150. }
  151. }