PatientSelectTabExam.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Drawing;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using CLIP.eForm.Consent.UI.HospitalSvcRef;
  11. namespace CLIP.eForm.Consent.UI {
  12. public partial class PatientSelectTabExam : UserControl {
  13. private IConsentMain consentMain = null;
  14. private ConsentCommandCtrl commandControl = null;
  15. private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
  16. private string userSelectedBaseCds = string.Empty;
  17. public PatientSelectTabExam() {
  18. InitializeComponent();
  19. }
  20. /// <summary>
  21. /// UserControl 페이지 로드 이벤트
  22. /// </summary>
  23. /// <param name="sender"></param>
  24. /// <param name="e"></param>
  25. private void PatientSelectTabExam_Load(object sender, EventArgs e) {
  26. if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime) {
  27. return;
  28. }
  29. consentMain = ConsentMainControl.GetConsentMainInterface(this);
  30. commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  31. hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
  32. // todt 를 오늘 날자로 설정
  33. this.todt.Value = DateTime.Now;
  34. this.fromdt.Value = DateTime.Now;
  35. initGrid();
  36. }
  37. private void initGrid() {
  38. this.gridPatientList.AutoGenerateColumns = false;
  39. this.gridPatientList.AllowUserToAddRows = false;
  40. CommonUtil.AddNewColumnToDataGridView(this.gridPatientList, "등록번호", "pid", true, 80);
  41. CommonUtil.AddNewColumnToDataGridView(this.gridPatientList, "성명", "hngnm", true, 60);
  42. CommonUtil.AddNewColumnToDataGridView(this.gridPatientList, "진료/입원일", "indd", true, 100);
  43. CommonUtil.AddNewColumnToDataGridView(this.gridPatientList, "진료과", "deptnm", true, 100);
  44. CommonUtil.AddNewColumnToDataGridView(this.gridPatientList, "진료의", "doctornm", true, 80);
  45. CommonUtil.AddNewColumnToDataGridView(this.gridPatientList, "ER접수과", "erorddeptnm", false, 100);
  46. CommonUtil.AddNewColumnToDataGridView(this.gridPatientList, "ER진료의", "ermedispclnm", false, 80);
  47. //dataGridViewPatientSelectResult.Columns["colCheck"].Visible = false;
  48. }
  49. /// <summary>
  50. /// 지원부서설정 버튼 클릭 이벤트
  51. /// 팝업창을 호출하여 사용자가 선택한 지원부서를 저장한다.
  52. /// </summary>
  53. /// <param name="sender"></param>
  54. /// <param name="e"></param>
  55. private void setSupportDepts_Click(object sender, EventArgs e) {
  56. // 지원부서설정 폼 호출
  57. using(var supportDeptsForm = new SetSupportDeptsForm(consentMain.ConsentExecuteInfo["dutinstcd"],
  58. commandControl.CurrentEndUser.userId,
  59. commandControl.CurrentEndUser.supportDeptcd,
  60. commandControl.CurrentEndUser.supportBaseCd,
  61. consentMain.ConsentExecuteInfo["sysInstNm"])) {
  62. var result = supportDeptsForm.ShowDialog();
  63. if(result == DialogResult.OK) {
  64. // 사용자가 저장한 지원부서 목록을 설정
  65. commandControl.CurrentEndUser.supportBaseCd = supportDeptsForm.supportBaseCd;
  66. commandControl.CurrentEndUser.supportDeptcd = supportDeptsForm.supportDeptCd;
  67. }
  68. }
  69. }
  70. public Hashtable getQueryString() {
  71. //var result = new {
  72. // fromdd = dateTimePickerClnDate.Value.ToString("yyyyMMdd"),
  73. // wardcd = (this.comboWard.Items.Count > 0) ? this.comboWard.SelectedValue.ToString().Trim() : "",
  74. // deptcd = (this.comboDept.Items.Count > 0) ? this.comboDept.SelectedValue.ToString().Trim() : "",
  75. // doctorId = (this.comboDoctor.Items.Count > 0) ? this.comboDoctor.SelectedValue.ToString().Trim() : ""
  76. //};
  77. string fromdt = this.fromdt.Value.ToString("yyyyMMdd");
  78. string todt = this.todt.Value.ToString("yyyyMMdd");
  79. string pid = this.txtBoxPid.Text;
  80. string mainDr = this.mainDr.Text;
  81. string strGubun = "";
  82. string mainDrChecked = "Y";
  83. string supportBaseCd = commandControl.CurrentEndUser.supportBaseCd;
  84. string supportDeptcd = commandControl.CurrentEndUser.supportDeptcd;
  85. if (this.radioGubunAll.Checked) {
  86. strGubun = "";
  87. } else {
  88. RadioButton rdoTemp = null;
  89. if (this.radioGubunOut.Checked) {
  90. rdoTemp = radioGubunOut;
  91. } else if (this.radioGubunIn.Checked) {
  92. rdoTemp = radioGubunIn;
  93. } else if (this.radioGubunEx.Checked) {
  94. rdoTemp = radioGubunEx;
  95. }
  96. strGubun = rdoTemp.Tag.ToString();
  97. }
  98. if (this.chkIsMainD.Checked == true) {
  99. // 대가대 요청사항
  100. mainDrChecked = "N";
  101. }
  102. Hashtable result = new Hashtable();
  103. result.Add("pid", pid);
  104. result.Add("srchDd", fromdt);
  105. result.Add("toDd", todt);
  106. result.Add("mainDr", mainDr);
  107. result.Add("mainDrChecked", mainDrChecked);
  108. result.Add("supportBaseCd", supportBaseCd);
  109. result.Add("supportDeptCd", supportDeptcd);
  110. result.Add("patientState", strGubun);
  111. result.Add("ordType", "EX");
  112. return result;
  113. }
  114. /// <summary>
  115. /// 키보드 입력
  116. /// </summary>
  117. /// <param name="sender"></param>
  118. /// <param name="e"></param>
  119. private void textBoxSearchText_KeyDown(object sender, KeyEventArgs e) {
  120. if (e.KeyCode == Keys.Enter) {
  121. buttonPatientSelect.PerformClick();
  122. }
  123. }
  124. private string getSelectedPatientState() {
  125. RadioButton rdoTemp = null;
  126. if (this.radioGubunAll.Checked) {
  127. rdoTemp = radioGubunAll;
  128. }
  129. else if (this.radioGubunIn.Checked) {
  130. rdoTemp = radioGubunIn;
  131. } else if (this.radioGubunOut.Checked) {
  132. rdoTemp = radioGubunOut;
  133. } else if (this.radioGubunEx.Checked) {
  134. rdoTemp = radioGubunEx;
  135. }
  136. return rdoTemp.Tag.ToString();
  137. }
  138. /// <summary>
  139. /// 검사실 환자 목록 조회
  140. /// </summary>
  141. /// <param name="sender"></param>
  142. /// <param name="e"></param>
  143. private void buttonPatientSelect_Click(object sender, EventArgs e) {
  144. var pid = this.txtBoxPid.Text.Trim();
  145. var patientState = getSelectedPatientState();
  146. var maindDrStr = this.mainDr.Text.Trim();
  147. var isMaindD = this.chkIsMainD.Checked; // true 면 cnfmmaind, false 면 cnfmmaind2 비교
  148. var isMaindDParam = "Y";
  149. if (isMaindD) {
  150. isMaindDParam = "N";
  151. }
  152. Cursor currentCursor = this.Cursor;
  153. this.Cursor = Cursors.WaitCursor;
  154. PatListVO[] patlistVos = null;
  155. try {
  156. patlistVos = hospitalWebService.GetPatientExListPC("EX",
  157. this.todt.Value.ToString("yyyyMMdd"),
  158. this.fromdt.Value.ToString("yyyyMMdd"),
  159. commandControl.CurrentEndUser.supportBaseCd,
  160. commandControl.CurrentEndUser.supportDeptcd,
  161. pid,
  162. patientState,
  163. isMaindDParam,
  164. maindDrStr
  165. );
  166. }
  167. catch(Exception ex) {
  168. }
  169. finally {
  170. this.Cursor = currentCursor;
  171. }
  172. if (patlistVos == null) {
  173. return;
  174. }
  175. this.gridPatientList.DataSource = new SortableBindingList<PatListVO>(patlistVos);
  176. }
  177. /// <summary>
  178. /// 환자를 선택 시 CurrentTargetPatient 로 설정해 준다
  179. /// </summary>
  180. /// <param name="sender"></param>
  181. /// <param name="e"></param>
  182. private void gridPatientList_CellContentClick(object sender, DataGridViewCellEventArgs e) {
  183. if (e.RowIndex > -1) {
  184. PatListVO vo = this.gridPatientList.Rows[e.RowIndex].DataBoundItem as PatListVO;
  185. consentMain.PatientListCtrl.SetChangePID(vo);
  186. }
  187. }
  188. }
  189. }