PatientInfoCtrl.cs.svn-base 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. #region Copyright © 2015 CLIPSOFT Co.,Ltd. All Rights Reserved.
  2. //
  3. // All rights are reserved. Reproduction or transmission in whole or in part,
  4. // in any form or by any means, electronic, mechanical or otherwise, is
  5. // prohibited without the prior written consent of the copyright owner.
  6. //
  7. // Filename:PatientInfoCtrl.cs
  8. //
  9. #endregion
  10. using System;
  11. using System.ComponentModel;
  12. using System.Windows.Forms;
  13. using System.Collections.Generic;
  14. using ClipSoft.Exceptions;
  15. using CLIP.eForm.Consent.UI.HospitalSvcRef;
  16. using System.Linq;
  17. namespace CLIP.eForm.Consent.UI {
  18. /// <summary>
  19. /// 동의서 조회 컨트롤의 환자 정보 탭 클래스
  20. /// </summary>
  21. /// <remarks>
  22. /// <p>[설계자]</p>
  23. /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
  24. /// <p>[원본 작성자]</p>
  25. /// <p> 클립소프트 기술부 이창훈 (chlee@clipsoft.co.kr)</p>
  26. /// <p>[수정 작성자]</p>
  27. /// <p> 클립소프트 기술부 이인희</p>
  28. /// <p>----------------------------------------------------------------------------------------</p>
  29. /// <p>[HISTORY]</p>
  30. /// <p> 2016-06-21 : 최초작성</p>
  31. /// <p>----------------------------------------------------------------------------------------</p>
  32. /// </remarks>
  33. public partial class PatientInfoCtrl : PatientInfoCtrlBase {
  34. private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
  35. IConsentMain consentMain = null;
  36. ConsentCommandCtrl commandControl = null;
  37. public PatientInfoCtrl() {
  38. InitializeComponent();
  39. }
  40. public void SetPatientInfo() {
  41. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  42. SetPatientBasicInfo(consentMain);
  43. SetClnDateItem();
  44. }
  45. private void PatientInfoCtrl_Load(object sender, EventArgs e) {
  46. if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime) {
  47. return;
  48. }
  49. consentMain = ConsentMainControl.GetConsentMainInterface(this);
  50. commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  51. consentMain.OnLoadPartControls += ConsentMain_OnLoadPartControls;
  52. hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
  53. }
  54. private void ConsentMain_OnLoadPartControls(object sender, EventArgs e) {
  55. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  56. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  57. try {
  58. SetEndUser(consentMain);
  59. SetPatientBasicInfo(consentMain);
  60. SetClnDateItem();
  61. if (comboTrmtPrd.Items.Count > 0) comboTrmtPrd.SelectedIndex = 0;
  62. // 로딩 될 때 발행리스트 탭이 갱신 되어야 한다.
  63. consentMain.ConsentListCtrl.consentSelectTabPageAllRefresh();
  64. } catch (UserException uex) {
  65. MessageBox.Show(string.Format(uex.Message)
  66. , string.Format(Properties.Resources.msg_caption_fail),
  67. MessageBoxButtons.OK, MessageBoxIcon.Error);
  68. consentMain.TerminateConsentMain();
  69. }
  70. }
  71. // 작성자 정보 셋팅
  72. private void SetEndUser(IConsentMain consentMain) {
  73. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  74. GetUserDetailInfo(consentMain.ConsentExecuteInfo["userId"]
  75. , consentMain.ConsentExecuteInfo["dutinstcd"]
  76. , consentMain.ConsentExecuteInfo["userDeptCd"]
  77. , commandControl);
  78. }
  79. private void GetUserDetailInfo(string userid, string dutinstcd, string dutplcecd, ConsentCommandCtrl commandControl) {
  80. UserVO userVO = (UserVO) this.hospitalWebService.GetUserInfo(userid, dutinstcd, dutplcecd);
  81. if (userVO == null) {
  82. if (!string.IsNullOrEmpty(consentMain.ConsentExecuteInfo["userDeptCd"])) {
  83. // 실행 정보에 있는 사용자 정보 설정
  84. commandControl.CurrentEndUser = new EndUser();
  85. commandControl.CurrentEndUser.userId = this.labelUserNo.Text = consentMain.ConsentExecuteInfo["userId"];
  86. commandControl.CurrentEndUser.userName = this.labelUserNm.Text = consentMain.ConsentExecuteInfo["userName"];
  87. commandControl.CurrentEndUser.Password = "";
  88. commandControl.CurrentEndUser.deptcd = consentMain.ConsentExecuteInfo["userDeptCd"];
  89. commandControl.CurrentEndUser.supportDeptcd = consentMain.ConsentExecuteInfo["userSupportDeptCd"];
  90. commandControl.CurrentEndUser.supportBaseCd = consentMain.ConsentExecuteInfo["supportBaseCd"];
  91. commandControl.CurrentEndUser.depthngnm = this.labelUserDept.Text = consentMain.ConsentExecuteInfo["userDeptName"];
  92. //commandControl.CurrentEndUser.UserGroupCode = "";
  93. commandControl.CurrentEndUser.instcd = consentMain.ConsentExecuteInfo["dutinstcd"];
  94. commandControl.CurrentEndUser.userTelNo = "";
  95. commandControl.CurrentEndUser.jobkindcd = userVO.jobKindCd;
  96. commandControl.CurrentEndUser.jobkindnm = userVO.jobKindNm;
  97. commandControl.CurrentEndUser.drkind = userVO.drKind;
  98. } else {
  99. string _msg = string.Format("[{0}] 에 해당하는 의사정보가 없습니다.", userid);
  100. MessageBox.Show(_msg);
  101. throw new Exception(_msg);
  102. }
  103. } else {
  104. commandControl.CurrentEndUser = new EndUser();
  105. commandControl.CurrentEndUser.userId = this.labelUserNo.Text = userVO.userId;
  106. commandControl.CurrentEndUser.userName = this.labelUserNm.Text = userVO.userName;
  107. commandControl.CurrentEndUser.deptcd = userVO.userDeptcd;
  108. commandControl.CurrentEndUser.supportDeptcd = userVO.userSupportDeptCd;
  109. commandControl.CurrentEndUser.supportBaseCd = userVO.userSupportBaseCd;
  110. commandControl.CurrentEndUser.depthngnm = this.labelUserDept.Text = userVO.userDepthngnm;
  111. //commandControl.CurrentEndUser.UserGroupCode = userVO.UserGroupCode;
  112. //commandControl.CurrentEndUser.supportBaseCd = userVO.;
  113. commandControl.CurrentEndUser.instcd = consentMain.ConsentExecuteInfo["dutinstcd"];
  114. commandControl.CurrentEndUser.userTelNo = userVO.userTelNo;
  115. commandControl.CurrentEndUser.jobkindcd = userVO.jobKindCd;
  116. commandControl.CurrentEndUser.jobkindnm = userVO.jobKindNm;
  117. commandControl.CurrentEndUser.ioflag = userVO.ioFlag ?? "";
  118. commandControl.CurrentEndUser.drkind = userVO.drKind;
  119. consentMain.ConsentExecuteInfo["userIOFlag"] = commandControl.CurrentEndUser.ioflag;
  120. }
  121. }
  122. // 환자 정보 셋팅
  123. private void SetPatientBasicInfo(IConsentMain consentMain) {
  124. PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(consentMain.ConsentExecuteInfo["patientId"]
  125. , consentMain.ConsentExecuteInfo["patientClnDate"]
  126. , consentMain.ConsentExecuteInfo["patientOrdtype"]
  127. , consentMain.ConsentExecuteInfo["patientClnDept"]
  128. , consentMain.ConsentExecuteInfo["cretno"]
  129. , consentMain.ConsentExecuteInfo["dutinstcd"]
  130. , consentMain.ConsentExecuteInfo["opRsrvNo"]);
  131. // 환자 정보가 없는 경우
  132. if (patientVOList == null || patientVOList.Length == 0) {
  133. commandControl.CurrentTargetPatient = new TargetPatient();
  134. } else {
  135. PatientVO vo = patientVOList[0];
  136. this.labelPtntNm.Text = vo.patientName;
  137. this.labelPtntNo.Text = vo.pid;
  138. commandControl.CurrentTargetPatient = new TargetPatient();
  139. SetTargetPatientInfo(vo);
  140. }
  141. }
  142. /// <summary>
  143. /// PatientVO 정보를 이용해서 CurrentTargetPatient 정보 SET
  144. /// </summary>
  145. /// <param name="vo">설정할 PatientVO 클래스의 인스턴스</param>
  146. private void SetTargetPatientInfo(PatientVO vo) {
  147. var ordtypeHngnm = "";
  148. if (!string.IsNullOrEmpty(vo.ordType)) {
  149. switch (vo.ordType) {
  150. case "I":
  151. ordtypeHngnm = "입원";
  152. break;
  153. case "O":
  154. ordtypeHngnm = "외래";
  155. break;
  156. case "E":
  157. ordtypeHngnm = "응급";
  158. break;
  159. case "OP":
  160. ordtypeHngnm = "수술";
  161. break;
  162. }
  163. }
  164. // TODO 검증 필요
  165. commandControl.CurrentTargetPatient.instcd = consentMain.ConsentExecuteInfo["dutinstcd"];
  166. commandControl.CurrentTargetPatient.name = vo.patientName;
  167. commandControl.CurrentTargetPatient.pid = vo.pid;
  168. commandControl.CurrentTargetPatient.sa = vo.sa;
  169. commandControl.CurrentTargetPatient.jumin = vo.juminNo;
  170. commandControl.CurrentTargetPatient.birthDd = vo.patientBirthDd;
  171. commandControl.CurrentTargetPatient.ordtype = vo.ordType;
  172. commandControl.CurrentTargetPatient.ordtypeHngnm = ordtypeHngnm;
  173. commandControl.CurrentTargetPatient.cretno = vo.cretNo.ToString();
  174. commandControl.CurrentTargetPatient.Dschdd = vo.dSchDd.Replace("-", "").Replace("/", "");
  175. commandControl.CurrentTargetPatient.clnDate = vo.inDd.Replace("-", "").Replace("/", "");
  176. commandControl.CurrentTargetPatient.clnDeptEngNm = vo.deptEngNm;
  177. commandControl.CurrentTargetPatient.clnDeptCode = vo.ordDeptCd;
  178. commandControl.CurrentTargetPatient.clnDeptName = vo.deptNm;
  179. commandControl.CurrentTargetPatient.clnDxNm = vo.diagHngNm;
  180. commandControl.CurrentTargetPatient.mainDrId = vo.mainDrId;
  181. commandControl.CurrentTargetPatient.mainDrNm = vo.mainDrNm;
  182. commandControl.CurrentTargetPatient.ward = vo.ward;
  183. commandControl.CurrentTargetPatient.roomno = vo.roomCd;
  184. //commandControl.CurrentTargetPatient.orderno = vo.IO_OrderNo;
  185. commandControl.CurrentTargetPatient.opDrId = vo.opDoctorId;
  186. commandControl.CurrentTargetPatient.opDrNm = vo.opDoctorNm;
  187. commandControl.CurrentTargetPatient.opDeptCd = vo.opDeptCd;
  188. commandControl.CurrentTargetPatient.opDeptNm = vo.opDeptNm;
  189. commandControl.CurrentTargetPatient.addr = vo.patientAddr;
  190. commandControl.CurrentTargetPatient.telno = vo.patientMobileNo;
  191. //commandControl.CurrentTargetPatient.Insukind = vo.IO_Insukind;
  192. // 수술 정보
  193. commandControl.CurrentTargetPatient.OpRsrvNo = vo.opRsrvNo;
  194. commandControl.CurrentTargetPatient.OpCnfmDate = vo.opCnFmDd;
  195. commandControl.CurrentTargetPatient.OpName = vo.opNm;
  196. commandControl.CurrentTargetPatient.OpremFact = vo.opremFact;
  197. /// TODO 필요시 구현 구현
  198. //commandControl.CurrentTargetPatient.OpDiagName = vo.OpDiagName;
  199. //commandControl.CurrentTargetPatient.OpName = vo.OpName;
  200. //commandControl.CurrentTargetPatient.AnstDrName1 = vo.AnstDrName1;
  201. //commandControl.CurrentTargetPatient.AnstDrFlag1 = vo.AnstDrFlag1;
  202. //commandControl.CurrentTargetPatient.AnstDeptName1 = vo.AnstDeptName1;
  203. //commandControl.CurrentTargetPatient.AnstDrName2 = vo.AnstDrName2;
  204. //commandControl.CurrentTargetPatient.AnstDrFlag2 = vo.AnstDrFlag2;
  205. //commandControl.CurrentTargetPatient.AnstDeptName2 = vo.AnstDeptName2;
  206. //commandControl.CurrentTargetPatient.AnstDrName3 = vo.AnstDrName3;
  207. //commandControl.CurrentTargetPatient.AnstDrFlag3 = vo.AnstDrFlag3;
  208. //commandControl.CurrentTargetPatient.AnstDeptName3 = vo.AnstDeptName3;
  209. }
  210. /// <summary>
  211. /// 진료일 범위 설정
  212. /// </summary>
  213. private void SetClnDateItem() {
  214. Dictionary<string, string> comboItems = new Dictionary<string, string>();
  215. comboItems.Add(" - ", "");
  216. // 환자 선택 시 수진 이력이 자동으로 갱신되게끔 변경
  217. // 수진 이력 기간 조회 시 현재 일자가 아니라 선택된 진료일, 혹은 입원일을 기준으로 기간이 설정되게끔 수정
  218. if (commandControl.CurrentTargetPatient != null && !string.IsNullOrEmpty(commandControl.CurrentTargetPatient.clnDate)) {
  219. for (int i = 1; i < 4; i++) {
  220. comboItems.Add(i.ToString() + "개월", commandControl.CurrentTargetPatient.clnDate);
  221. }
  222. } else {
  223. for (int i = 1; i < 4; i++) {
  224. comboItems.Add(i.ToString() + "개월", DateTime.Now.AddMonths(-i).ToShortDateString().Replace("-", ""));
  225. }
  226. }
  227. comboTrmtPrd.DataSource = new BindingSource(comboItems, null);
  228. comboTrmtPrd.DisplayMember = "Key";
  229. comboTrmtPrd.ValueMember = "Value";
  230. }
  231. /// <summary>
  232. /// 진료일 범위 선택했을때, 해당하는 진료일 조회하여 바인딩
  233. /// </summary>
  234. /// <param name="sender">The source of the event.</param>
  235. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  236. private void comboTrmtPrd_SelectedIndexChanged(object sender, EventArgs e) {
  237. Dictionary<string, string> comboItems = new Dictionary<string, string>();
  238. if (comboTrmtPrd.SelectedIndex == 0) {
  239. //초기 넘겨준 특정 진료일을 바인딩
  240. comboItems = GetClnDateSearchList(commandControl.CurrentTargetPatient.pid
  241. , commandControl.CurrentTargetPatient.clnDate
  242. , "="
  243. , commandControl.CurrentTargetPatient.clnDeptCode);
  244. } else {
  245. //진료일 범위에 해당하는 진료일자 조회하여 바인딩
  246. comboItems = GetClnDateSearchList(commandControl.CurrentTargetPatient.pid
  247. , comboTrmtPrd.SelectedValue.ToString()
  248. , ">="
  249. , commandControl.CurrentTargetPatient.clnDeptCode);
  250. }
  251. if (comboItems.Count > 0) {
  252. comboTrmtDate.DataSource = new BindingSource(comboItems, null);
  253. comboTrmtDate.DisplayMember = "Key";
  254. comboTrmtDate.ValueMember = "Value";
  255. comboTrmtDate.Tag = consentMain.ConsentExecuteInfo["patientId"];
  256. if (comboTrmtDate.Items.Count > 0) {
  257. if (comboTrmtDate.SelectedIndex == 0) { }
  258. //GetTrmtInfo();
  259. else
  260. comboTrmtDate.SelectedIndex = 0;
  261. }
  262. } else {
  263. comboTrmtDate.DataSource = null;
  264. }
  265. }
  266. /// <summary>
  267. /// 검색된 진료일 값을 컨트롤에 바인딩
  268. /// </summary>
  269. /// <param name="patientNo">환자번호</param>
  270. /// <param name="clnDate">진료일자</param>
  271. /// <param name="searchType">검색일자</param>
  272. /// <param name="orddeptcd">진단부서</param>
  273. /// <returns></returns>
  274. private Dictionary<string, string> GetClnDateSearchList(string patientNo, string clnDate, string searchType, string orddeptcd) {
  275. Dictionary<string, string> comboDates = new Dictionary<string, string>();
  276. // 환자의 주진단 정보를 조회
  277. ClnDateForDropdownVO[] clnDateList = this.hospitalWebService.GetTrmtDateList(patientNo
  278. , clnDate
  279. , searchType
  280. , orddeptcd
  281. , consentMain.ConsentExecuteInfo["dutinstcd"]
  282. , consentMain.ConsentExecuteInfo["patientOrdtype"]);
  283. if (clnDateList != null && clnDateList.Length > 0) {
  284. foreach (ClnDateForDropdownVO vDate in clnDateList) {
  285. comboDates.Add(string.Format("{0} / {1} / {2} / {3} / {4}", vDate.VisitTypeName, vDate.ClnFormatDate, vDate.ClnDeptName, vDate.orddrid, vDate.CretNo),
  286. string.Format("{0} / {1} / {2} / {3} / {4}", vDate.ClnDate, vDate.VisitType, vDate.ClnDeptCode, vDate.CretNo, vDate.DeptCd));
  287. }
  288. }
  289. return comboDates;
  290. }
  291. private void comboTrmtDate_SelectedIndexChanged(object sender, EventArgs e) {
  292. GetTrmtInfo();
  293. }
  294. /// <summary>
  295. /// 환자 선택시 수진일자별 진단 데이터 조회하여 환자명과 내원번호를 설정하고
  296. /// 현재 선택된 한자로 설정한다
  297. /// </summary>
  298. /// <exception cref="UserException"></exception>
  299. private void GetTrmtInfo() {
  300. //수진일자를 변경했을때 환자의 주진단 정보를 재조회한다.
  301. if (commandControl.CurrentTargetPatient != null && comboTrmtDate.SelectedItem != null) {
  302. string[] clnDate = ((KeyValuePair<string, string>) comboTrmtDate.SelectedItem).Value.Split('/');
  303. if (clnDate != null && clnDate.Length == 5) {
  304. // 환자 선택시 수진일자별 진단 데이터 조회
  305. PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(consentMain.ConsentExecuteInfo["patientId"]
  306. , clnDate[0].Trim()
  307. , clnDate[1].Trim()
  308. , clnDate[4].Trim()
  309. , clnDate[3].Trim()
  310. , this.consentMain.ConsentExecuteInfo["dutinstcd"]
  311. , this.consentMain.ConsentExecuteInfo["opRsrvNo"]);
  312. if (patientVOList == null || patientVOList.Length == 0) {
  313. throw new UserException(string.Format(Properties.Resources.msg_error_get_patient
  314. , consentMain.ConsentExecuteInfo["patientId"]));
  315. } else {
  316. PatientVO vo = patientVOList[0];
  317. // 환자명과 내원번호 설정
  318. this.labelPtntNm.Text = vo.patientName;
  319. this.labelPtntNo.Text = vo.pid;
  320. //현재 선택된 환자로 설정
  321. commandControl.CurrentTargetPatient = new TargetPatient();
  322. SetTargetPatientInfo(vo);
  323. }
  324. }
  325. }
  326. }
  327. /// <summary>
  328. /// 환자목록에서 더블클릭했을 경우, 선택된 환자 정보로 상단정보를 재조회한다.
  329. /// </summary>
  330. /// <param name="visitType">방문 타입</param>
  331. public override void OnRefeashPartControls(string visitType) {
  332. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  333. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  334. try {
  335. SetEndUser(consentMain);
  336. SetPatientBasicInfo(consentMain);
  337. SetClnDateItem();
  338. if (comboTrmtPrd.SelectedIndex > 0) {
  339. comboTrmtPrd.SelectedIndex = 0;
  340. } else {
  341. comboTrmtPrd_SelectedIndexChanged(null, null);
  342. }
  343. } catch (UserException uex) {
  344. MessageBox.Show(string.Format(uex.Message)
  345. , string.Format(Properties.Resources.msg_caption_fail),
  346. MessageBoxButtons.OK, MessageBoxIcon.Error);
  347. consentMain.TerminateConsentMain();
  348. }
  349. }
  350. /// <summary>
  351. /// 동의서명을 설정
  352. /// </summary>
  353. /// <param name="documentName">Name of the document.</param>
  354. public override void SetConsentDocumentName(string documentName) {
  355. this.labelDocName.Text = documentName;
  356. }
  357. /// <summary>
  358. /// 작성자 정보를 설정
  359. /// </summary>
  360. /// <param name="userid">The userid.</param>
  361. /// <param name="dutinstcd">The dutinstcd.</param>
  362. /// <param name="dutplcecd">The dutplcecd.</param>
  363. public override void SetConsentUserInfo(string userid, string dutinstcd, string dutplcecd) {
  364. ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  365. GetUserDetailInfo(userid, dutinstcd, dutplcecd, commandControl);
  366. }
  367. /// <summary>
  368. /// 상단의 진료일과 작성자 정보로 설정 (수진일자를 변경했을때 환자의 주진단 정보를 재조회한다.)
  369. /// </summary>
  370. /// <exception cref="UserException"></exception>
  371. public override void SetBasicPatientInfo() {
  372. if (commandControl.CurrentTargetPatient != null && comboTrmtDate.SelectedValue != null) {
  373. string[] clnDate = ((KeyValuePair<string, string>) comboTrmtDate.SelectedItem).Value.Split('/');
  374. if (clnDate != null && clnDate.Length == 4) {
  375. PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(consentMain.ConsentExecuteInfo["patientId"]
  376. , clnDate[0].Trim()
  377. , clnDate[1].Trim()
  378. , clnDate[2].Trim()
  379. , clnDate[3].Trim()
  380. , consentMain.ConsentExecuteInfo["dutinstcd"]
  381. , consentMain.ConsentExecuteInfo["opRsrvNo"]);
  382. if (patientVOList == null || patientVOList.Length == 0) {
  383. throw new UserException(string.Format(Properties.Resources.msg_error_get_patient
  384. , consentMain.ConsentExecuteInfo["patientId"]));
  385. } else {
  386. PatientVO vo = patientVOList[0];
  387. commandControl.CurrentTargetPatient = new TargetPatient();
  388. SetTargetPatientInfo(vo);
  389. }
  390. }
  391. }
  392. }
  393. /// <summary>
  394. /// 동의서 정보로 환자 주진단 정보 설정 (ConsentVO 데이터로 PatientVO 조회)
  395. /// </summary>
  396. /// <param name="orderDate">The order date.</param>
  397. /// <param name="orderType">Type of the order.</param>
  398. /// <param name="orderDeptCd">The order dept cd.</param>
  399. /// <param name="cretno">The cretno.</param>
  400. /// <exception cref="UserException"></exception>
  401. public override void SetPatientByConsentInfo(string orderDate, string orderType, string orderDeptCd, string cretno) {
  402. PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(commandControl.CurrentTargetPatient.pid
  403. , orderDate.Replace("-", "")
  404. , orderType
  405. , orderDeptCd
  406. , cretno
  407. , this.consentMain.ConsentExecuteInfo["dutinstcd"]
  408. , this.consentMain.ConsentExecuteInfo["opRsrvNo"]);
  409. if (patientVOList == null || patientVOList.Length == 0) {
  410. throw new UserException(string.Format(Properties.Resources.msg_error_get_patient
  411. , consentMain.ConsentExecuteInfo["patientId"]));
  412. } else {
  413. PatientVO vo = patientVOList[0];
  414. commandControl.CurrentTargetPatient = new TargetPatient();
  415. SetTargetPatientInfo(vo);
  416. }
  417. }
  418. }
  419. }