PatientInfoCtrl.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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. namespace CLIP.eForm.Consent.UI {
  17. /// <summary>
  18. /// 동의서 조회 컨트롤의 환자 정보 탭 클래스
  19. /// </summary>
  20. /// <remarks>
  21. /// <p>[설계자]</p>
  22. /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
  23. /// <p>[원본 작성자]</p>
  24. /// <p> 클립소프트 기술부 이창훈 (chlee@clipsoft.co.kr)</p>
  25. /// <p>[수정 작성자]</p>
  26. /// <p> 클립소프트 기술부 이인희</p>
  27. /// <p>----------------------------------------------------------------------------------------</p>
  28. /// <p>[HISTORY]</p>
  29. /// <p> 2016-06-21 : 최초작성</p>
  30. /// <p>----------------------------------------------------------------------------------------</p>
  31. /// </remarks>
  32. public partial class PatientInfoCtrl : PatientInfoCtrlBase {
  33. private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
  34. IConsentMain consentMain = null;
  35. ConsentCommandCtrl commandControl = null;
  36. public PatientInfoCtrl() {
  37. InitializeComponent();
  38. }
  39. public void SetPatientInfo() {
  40. if(consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  41. SetPatientBasicInfo(consentMain);
  42. SetClnDateItem();
  43. }
  44. private void PatientInfoCtrl_Load(object sender, EventArgs e) {
  45. if(this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime) {
  46. return;
  47. }
  48. consentMain = ConsentMainControl.GetConsentMainInterface(this);
  49. commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  50. consentMain.OnLoadPartControls += ConsentMain_OnLoadPartControls;
  51. hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
  52. }
  53. private void ConsentMain_OnLoadPartControls(object sender, EventArgs e) {
  54. if(consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  55. if(commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  56. try {
  57. SetEndUser(consentMain);
  58. SetPatientBasicInfo(consentMain);
  59. SetClnDateItem();
  60. if(comboTrmtPrd.Items.Count > 0) comboTrmtPrd.SelectedIndex = 0;
  61. // 로딩 될 때 발행리스트 탭이 갱신 되어야 한다.
  62. consentMain.ConsentListCtrl.consentSelectTabPageAllRefresh();
  63. }
  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["userNo"]
  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.UserNo = this.labelUserNo.Text = consentMain.ConsentExecuteInfo["userNo"];
  86. commandControl.CurrentEndUser.UserName = this.labelUserNm.Text = consentMain.ConsentExecuteInfo["userName"];
  87. // dbs227, password 를 왜 사용하지?
  88. //commandControl.CurrentEndUser.Password = "";
  89. //commandControl.CurrentEndUser.UserGroupCode = "";
  90. commandControl.CurrentEndUser.DeptCode = consentMain.ConsentExecuteInfo["userDeptCd"];
  91. commandControl.CurrentEndUser.DeptName = this.labelUserDept.Text = consentMain.ConsentExecuteInfo["userDeptName"];
  92. commandControl.CurrentEndUser.HosType = consentMain.ConsentExecuteInfo["dutinstcd"];
  93. commandControl.CurrentEndUser.UserTelNo = "";
  94. commandControl.CurrentEndUser.JobKindCd = "9999";
  95. commandControl.CurrentEndUser.JobKindNm = "";
  96. }
  97. else {
  98. string _msg = string.Format("[{0}] 에 해당하는 의사정보가 없습니다.", userid);
  99. MessageBox.Show(_msg);
  100. throw new Exception(_msg);
  101. }
  102. }
  103. else {
  104. commandControl.CurrentEndUser = new EndUser();
  105. commandControl.CurrentEndUser.UserNo = this.labelUserNo.Text = userVO.userId;
  106. commandControl.CurrentEndUser.UserName = this.labelUserNm.Text = userVO.userName;
  107. //commandControl.CurrentEndUser.Password = userVO.;
  108. //commandControl.CurrentEndUser.UserGroupCode = userVO.;
  109. commandControl.CurrentEndUser.DeptCode = userVO.userDeptCode;
  110. commandControl.CurrentEndUser.DeptName = this.labelUserDept.Text = userVO.userDeptName;
  111. commandControl.CurrentEndUser.HosType = userVO.instCd;
  112. commandControl.CurrentEndUser.UserTelNo = userVO.userTelNo;
  113. // 사용자의 직군코드가 없으면 9999 로 설정
  114. commandControl.CurrentEndUser.JobKindCd = string.IsNullOrEmpty(userVO.jobKindCd) ? "9999" : userVO.jobKindCd;
  115. commandControl.CurrentEndUser.JobKindNm = userVO.jobKindNm ?? "";
  116. commandControl.CurrentEndUser.IOFlag = userVO.ioFlag ?? "";
  117. consentMain.ConsentExecuteInfo["userIOFlag"] = commandControl.CurrentEndUser.IOFlag;
  118. }
  119. }
  120. // 환자 정보 셋팅
  121. private void SetPatientBasicInfo(IConsentMain consentMain) {
  122. PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(consentMain.ConsentExecuteInfo["patientNo"]
  123. , consentMain.ConsentExecuteInfo["clnDate"]
  124. , consentMain.ConsentExecuteInfo["visitType"]
  125. , consentMain.ConsentExecuteInfo["clnDept"]
  126. , consentMain.ConsentExecuteInfo["cretno"]
  127. , consentMain.ConsentExecuteInfo["dutinstcd"]
  128. , consentMain.ConsentExecuteInfo["opRsrvNo"]);
  129. // 환자 정보가 없는 경우
  130. if(patientVOList == null || patientVOList.Length == 0) {
  131. commandControl.CurrentTargetPatient = new TargetPatient();
  132. }
  133. else {
  134. PatientVO vo = patientVOList[0];
  135. this.labelPtntNm.Text = vo.patientName;
  136. this.labelPtntNo.Text = vo.pid;
  137. commandControl.CurrentTargetPatient = new TargetPatient();
  138. SetTargetPatientInfo(vo);
  139. }
  140. }
  141. /// <summary>
  142. /// PatientVO 정보를 이용해서 CurrentTargetPatient 정보 SET
  143. /// </summary>
  144. /// <param name="vo">설정할 PatientVO 클래스의 인스턴스</param>
  145. private void SetTargetPatientInfo(PatientVO vo) {
  146. commandControl.CurrentTargetPatient.HosType = vo.instCd;
  147. commandControl.CurrentTargetPatient.PatientName = vo.patientName;
  148. commandControl.CurrentTargetPatient.PatientCode = vo.pid;
  149. commandControl.CurrentTargetPatient.PatientSexAge = vo.sa;
  150. commandControl.CurrentTargetPatient.PatientJuminNo = vo.juminNo;
  151. commandControl.CurrentTargetPatient.PatientJuminNoOrg = vo.orgJuminNo;
  152. commandControl.CurrentTargetPatient.VisitType = vo.ordType;
  153. commandControl.CurrentTargetPatient.cretno = vo.cretNo;
  154. commandControl.CurrentTargetPatient.Dschdd = vo.dschDd.Replace("-", "");
  155. commandControl.CurrentTargetPatient.clnDate = vo.inDd;
  156. commandControl.CurrentTargetPatient.clnDeptCode = vo.ordDeptCd;
  157. commandControl.CurrentTargetPatient.clnDeptName = vo.deptEngAbbr;
  158. commandControl.CurrentTargetPatient.clnDxCd = vo.dxCd;
  159. commandControl.CurrentTargetPatient.clnDxNm = vo.dxNm;
  160. commandControl.CurrentTargetPatient.MainDrId = vo.mainDrId;
  161. commandControl.CurrentTargetPatient.MainDrNm = vo.mainDrName;
  162. commandControl.CurrentTargetPatient.Ward = vo.ward;
  163. commandControl.CurrentTargetPatient.RoomNo = vo.roomCd;
  164. commandControl.CurrentTargetPatient.OrderNo = vo.orderNo;
  165. commandControl.CurrentTargetPatient.OPdrId = vo.opDrId;
  166. commandControl.CurrentTargetPatient.OPdrNm = vo.opDrNm;
  167. commandControl.CurrentTargetPatient.OPdeptCode = vo.opDeptCd;
  168. commandControl.CurrentTargetPatient.OPdeptName = vo.opDeptNm;
  169. commandControl.CurrentTargetPatient.PatientAddr = vo.zipCdAddr;
  170. commandControl.CurrentTargetPatient.PatientTelNo = vo.telNum;
  171. commandControl.CurrentTargetPatient.Insukind = vo.insuKind;
  172. // 수술 정보
  173. commandControl.CurrentTargetPatient.OpRsrvNo = vo.opRsrvNo;
  174. commandControl.CurrentTargetPatient.OpCnfmDate = vo.opCnfmDd;
  175. commandControl.CurrentTargetPatient.PerfDrName = vo.perfDrNm;
  176. commandControl.CurrentTargetPatient.PerfDrFlag = vo.perfDrFlag;
  177. commandControl.CurrentTargetPatient.PerfDrDept = vo.perfDrDept;
  178. commandControl.CurrentTargetPatient.OpDiagName = vo.opDiagNm;
  179. commandControl.CurrentTargetPatient.OpName = vo.opNm;
  180. commandControl.CurrentTargetPatient.AnstDrName1 = vo.anstDrNm1;
  181. commandControl.CurrentTargetPatient.AnstDrFlag1 = vo.anstDrFlag1;
  182. commandControl.CurrentTargetPatient.AnstDeptName1 = vo.anstDeptNm1;
  183. commandControl.CurrentTargetPatient.AnstDrName2 = vo.anstDrNm2;
  184. commandControl.CurrentTargetPatient.AnstDrFlag2 = vo.anstDrFlag2;
  185. commandControl.CurrentTargetPatient.AnstDeptName2 = vo.anstDeptNm2;
  186. commandControl.CurrentTargetPatient.AnstDrName3 = vo.anstDrNm3;
  187. commandControl.CurrentTargetPatient.AnstDrFlag3 = vo.anstDrFlag3;
  188. commandControl.CurrentTargetPatient.AnstDeptName3 = vo.anstDeptNm3;
  189. commandControl.CurrentTargetPatient.Ex_bp = vo.bp;
  190. commandControl.CurrentTargetPatient.Ex_dm = vo.dm;
  191. commandControl.CurrentTargetPatient.Ex_heart = vo.heart;
  192. commandControl.CurrentTargetPatient.Ex_kidney = vo.kidney;
  193. commandControl.CurrentTargetPatient.Ex_respiration = vo.respiration;
  194. commandControl.CurrentTargetPatient.Ex_hx = vo.hx;
  195. commandControl.CurrentTargetPatient.Ex_allergy = vo.allergy;
  196. commandControl.CurrentTargetPatient.Ex_drug = vo.drug;
  197. commandControl.CurrentTargetPatient.Ex_smoking = vo.smoking;
  198. commandControl.CurrentTargetPatient.Ex_idio = vo.idio;
  199. commandControl.CurrentTargetPatient.Ex_nacrotics = vo.nacrotics;
  200. commandControl.CurrentTargetPatient.Ex_airway = vo.airway;
  201. commandControl.CurrentTargetPatient.Ex_hemorrhage = vo.hemorrhage;
  202. commandControl.CurrentTargetPatient.Ex_status_etc = vo.statusEtc;
  203. }
  204. /// <summary>
  205. /// 진료일 범위 설정
  206. /// </summary>
  207. private void SetClnDateItem() {
  208. Dictionary<string, string> comboItems = new Dictionary<string, string>();
  209. comboItems.Add(" - ", "");
  210. // 환자 선택 시 수진 이력이 자동으로 갱신되게끔 변경
  211. // 수진 이력 기간 조회 시 현재 일자가 아니라 선택된 진료일, 혹은 입원일을 기준으로 기간이 설정되게끔 수정
  212. if(commandControl.CurrentTargetPatient != null && !string.IsNullOrEmpty(commandControl.CurrentTargetPatient.clnDate)) {
  213. for(int i = 1; i < 4; i++) {
  214. comboItems.Add(i.ToString() + "개월", commandControl.CurrentTargetPatient.clnDate);
  215. }
  216. }
  217. else {
  218. for(int i = 1; i < 4; i++) {
  219. comboItems.Add(i.ToString() + "개월", DateTime.Now.AddMonths(-i).ToShortDateString().Replace("-", ""));
  220. }
  221. }
  222. comboTrmtPrd.DataSource = new BindingSource(comboItems, null);
  223. comboTrmtPrd.DisplayMember = "Key";
  224. comboTrmtPrd.ValueMember = "Value";
  225. }
  226. /// <summary>
  227. /// 진료일 범위 선택했을때, 해당하는 진료일 조회하여 바인딩
  228. /// </summary>
  229. /// <param name="sender">The source of the event.</param>
  230. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  231. private void comboTrmtPrd_SelectedIndexChanged(object sender, EventArgs e) {
  232. Dictionary<string, string> comboItems = new Dictionary<string, string>();
  233. int pos = 0;
  234. if(comboTrmtPrd.SelectedIndex == 0) {
  235. //초기 넘겨준 특정 진료일을 바인딩
  236. comboItems = GetClnDateSearchList(commandControl.CurrentTargetPatient.PatientCode
  237. , commandControl.CurrentTargetPatient.clnDate
  238. , "="
  239. , commandControl.CurrentTargetPatient.clnDeptCode
  240. ,out pos);
  241. }
  242. else {
  243. //진료일 범위에 해당하는 진료일자 조회하여 바인딩
  244. comboItems = GetClnDateSearchList(commandControl.CurrentTargetPatient.PatientCode
  245. , comboTrmtPrd.SelectedValue.ToString()
  246. , ">="
  247. , commandControl.CurrentTargetPatient.clnDeptCode
  248. , out pos);
  249. }
  250. if(comboItems.Count > 0) {
  251. comboTrmtDate.DataSource = new BindingSource(comboItems, null);
  252. comboTrmtDate.DisplayMember = "Key";
  253. comboTrmtDate.ValueMember = "Value";
  254. comboTrmtDate.Tag = consentMain.ConsentExecuteInfo["patientNo"];
  255. comboTrmtDate.SelectedIndex = pos;
  256. /*
  257. if(comboTrmtDate.Items.Count > 0) {
  258. if(comboTrmtDate.SelectedIndex == 0)
  259. GetTrmtInfo();
  260. else
  261. comboTrmtDate.SelectedIndex = 0;
  262. }*/
  263. }
  264. else {
  265. comboTrmtDate.DataSource = null;
  266. }
  267. }
  268. /// <summary>
  269. /// 검색된 진료일 값을 컨트롤에 바인딩
  270. /// </summary>
  271. /// <param name="patientNo">환자번호</param>
  272. /// <param name="clnDate">진료일자</param>
  273. /// <param name="searchType">검색일자</param>
  274. /// <param name="orddeptcd">진단부서</param>
  275. /// <returns></returns>
  276. private Dictionary<string, string> GetClnDateSearchList(string patientNo, string clnDate, string searchType, string orddeptcd, out int pos) {
  277. pos = 0;
  278. Dictionary<string, string> comboDates = new Dictionary<string, string>();
  279. // 환자의 주진단 정보를 조회
  280. ClnDateForDropdownVO[] clnDateList = this.hospitalWebService.GetTrmtDateList(patientNo
  281. , clnDate
  282. , searchType
  283. , orddeptcd
  284. , consentMain.ConsentExecuteInfo["dutinstcd"]
  285. , consentMain.ConsentExecuteInfo["visitType"]);
  286. if(clnDateList != null && clnDateList.Length > 0) {
  287. int i = 0;
  288. foreach(ClnDateForDropdownVO vDate in clnDateList) {
  289. comboDates.Add(string.Format("{0} / {1} / {2} / {3} / {4}", vDate.VisitTypeName, vDate.ClnFormatDate, vDate.ClnDeptName, vDate.orddrid, vDate.CretNo),
  290. string.Format("{0} / {1} / {2} / {3} / {4}", vDate.ClnDate, vDate.VisitType, vDate.ClnDeptCode, vDate.CretNo, vDate.DeptCd));
  291. if(vDate.CretNo == Int32.Parse(consentMain.ConsentExecuteInfo["cretno"]))
  292. {
  293. pos = i;
  294. }
  295. i++;
  296. }
  297. }
  298. return comboDates;
  299. }
  300. private void comboTrmtDate_SelectedIndexChanged(object sender, EventArgs e) {
  301. GetTrmtInfo();
  302. }
  303. /// <summary>
  304. /// 환자 선택시 수진일자별 진단 데이터 조회하여 환자명과 내원번호를 설정하고
  305. /// 현재 선택된 한자로 설정한다
  306. /// </summary>
  307. /// <exception cref="UserException"></exception>
  308. private void GetTrmtInfo() {
  309. //수진일자를 변경했을때 환자의 주진단 정보를 재조회한다.
  310. if(commandControl.CurrentTargetPatient != null && comboTrmtDate.SelectedItem != null) {
  311. string[] clnDate = ((KeyValuePair<string, string>)comboTrmtDate.SelectedItem).Value.Split('/');
  312. if(clnDate != null && clnDate.Length == 5) {
  313. // 환자 선택시 수진일자별 진단 데이터 조회
  314. PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(consentMain.ConsentExecuteInfo["patientNo"]
  315. , clnDate[0].Trim()
  316. , clnDate[1].Trim()
  317. , clnDate[4].Trim()
  318. , clnDate[3].Trim()
  319. , this.consentMain.ConsentExecuteInfo["dutinstcd"]
  320. , this.consentMain.ConsentExecuteInfo["opRsrvNo"]);
  321. if(patientVOList == null || patientVOList.Length == 0) {
  322. throw new UserException(string.Format(Properties.Resources.msg_error_get_patient
  323. , consentMain.ConsentExecuteInfo["patientNo"]));
  324. }
  325. else {
  326. PatientVO vo = patientVOList[0];
  327. // 환자명과 내원번호 설정
  328. this.labelPtntNm.Text = vo.patientName;
  329. this.labelPtntNo.Text = vo.pid;
  330. //현재 선택된 환자로 설정
  331. commandControl.CurrentTargetPatient = new TargetPatient();
  332. SetTargetPatientInfo(vo);
  333. }
  334. }
  335. }
  336. }
  337. /// <summary>
  338. /// 환자목록에서 더블클릭했을 경우, 선택된 환자 정보로 상단정보를 재조회한다.
  339. /// </summary>
  340. /// <param name="visitType">방문 타입</param>
  341. public override void OnRefeashPartControls(string visitType) {
  342. if(consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  343. if(commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  344. try {
  345. SetEndUser(consentMain);
  346. SetPatientBasicInfo(consentMain);
  347. SetClnDateItem();
  348. if(comboTrmtPrd.SelectedIndex > 0) {
  349. comboTrmtPrd.SelectedIndex = 0;
  350. }
  351. else {
  352. comboTrmtPrd_SelectedIndexChanged(null, null);
  353. }
  354. }
  355. catch(UserException uex) {
  356. MessageBox.Show(string.Format(uex.Message)
  357. , string.Format(Properties.Resources.msg_caption_fail),
  358. MessageBoxButtons.OK, MessageBoxIcon.Error);
  359. consentMain.TerminateConsentMain();
  360. }
  361. }
  362. /// <summary>
  363. /// 동의서명을 설정
  364. /// </summary>
  365. /// <param name="documentName">Name of the document.</param>
  366. public override void SetConsentDocumentName(string documentName) {
  367. this.labelDocName.Text = documentName;
  368. }
  369. /// <summary>
  370. /// 작성자 정보를 설정
  371. /// </summary>
  372. /// <param name="userid">The userid.</param>
  373. /// <param name="dutinstcd">The dutinstcd.</param>
  374. /// <param name="dutplcecd">The dutplcecd.</param>
  375. public override void SetConsentUserInfo(string userid, string dutinstcd, string dutplcecd) {
  376. ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  377. GetUserDetailInfo(userid, dutinstcd, dutplcecd, commandControl);
  378. }
  379. public override void SetConsentUserInfo(string userid, string dutinstcd, string dutplcecd, string temp) {
  380. ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  381. UserVO userVO = (UserVO) this.hospitalWebService.GetUserInfo(userid, dutinstcd, dutplcecd);
  382. if (userVO == null) {
  383. userVO = (UserVO) this.hospitalWebService.GetUserInfo(commandControl.CurrentEndUser.UserNo, dutinstcd, commandControl.CurrentEndUser.DeptCode);
  384. }
  385. commandControl.CurrentEndUser = new EndUser();
  386. commandControl.CurrentEndUser.UserNo = this.labelUserNo.Text = userVO.userId;
  387. commandControl.CurrentEndUser.UserName = this.labelUserNm.Text = userVO.userName;
  388. //commandControl.CurrentEndUser.Password = userVO.;
  389. //commandControl.CurrentEndUser.UserGroupCode = userVO.;
  390. commandControl.CurrentEndUser.DeptCode = userVO.userDeptCode;
  391. commandControl.CurrentEndUser.DeptName = this.labelUserDept.Text = userVO.userDeptName;
  392. commandControl.CurrentEndUser.HosType = userVO.instCd;
  393. commandControl.CurrentEndUser.UserTelNo = userVO.userTelNo;
  394. // 사용자의 직군코드가 없으면 9999 로 설정
  395. commandControl.CurrentEndUser.JobKindCd = userVO.jobKindCd ?? "9999";
  396. commandControl.CurrentEndUser.JobKindNm = userVO.jobKindNm ?? "";
  397. commandControl.CurrentEndUser.IOFlag = userVO.ioFlag ?? "";
  398. consentMain.ConsentExecuteInfo["userIOFlag"] = commandControl.CurrentEndUser.IOFlag;
  399. //GetUserDetailInfo(userid, dutinstcd, dutplcecd, commandControl);
  400. }
  401. /// <summary>
  402. /// 상단의 진료일과 작성자 정보로 설정 (수진일자를 변경했을때 환자의 주진단 정보를 재조회한다.)
  403. /// </summary>
  404. /// <exception cref="UserException"></exception>
  405. public override void SetBasicPatientInfo() {
  406. if(commandControl.CurrentTargetPatient != null && comboTrmtDate.SelectedValue != null) {
  407. string[] clnDate = ((KeyValuePair<string, string>)comboTrmtDate.SelectedItem).Value.Split('/');
  408. if(clnDate != null && clnDate.Length == 4) {
  409. PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(consentMain.ConsentExecuteInfo["patientNo"]
  410. , clnDate[0].Trim()
  411. , clnDate[1].Trim()
  412. , clnDate[2].Trim()
  413. , clnDate[3].Trim()
  414. , consentMain.ConsentExecuteInfo["dutinstcd"]
  415. , consentMain.ConsentExecuteInfo["opRsrvNo"]);
  416. if(patientVOList == null || patientVOList.Length == 0) {
  417. throw new UserException(string.Format(Properties.Resources.msg_error_get_patient
  418. , consentMain.ConsentExecuteInfo["patientNo"]));
  419. }
  420. else {
  421. PatientVO vo = patientVOList[0];
  422. commandControl.CurrentTargetPatient = new TargetPatient();
  423. SetTargetPatientInfo(vo);
  424. }
  425. }
  426. }
  427. }
  428. /// <summary>
  429. /// 동의서 정보로 환자 주진단 정보 설정 (ConsentVO 데이터로 PatientVO 조회)
  430. /// </summary>
  431. /// <param name="orderDate">The order date.</param>
  432. /// <param name="orderType">Type of the order.</param>
  433. /// <param name="orderDeptCd">The order dept cd.</param>
  434. /// <param name="cretno">The cretno.</param>
  435. /// <exception cref="UserException"></exception>
  436. public override void SetPatientByConsentInfo(string orderDate, string orderType, string orderDeptCd, string cretno) {
  437. PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(commandControl.CurrentTargetPatient.PatientCode
  438. , orderDate.Replace("-", "")
  439. , orderType
  440. , orderDeptCd
  441. , cretno
  442. , this.consentMain.ConsentExecuteInfo["dutinstcd"]
  443. , this.consentMain.ConsentExecuteInfo["opRsrvNo"]);
  444. if(patientVOList == null || patientVOList.Length == 0) {
  445. throw new UserException(string.Format(Properties.Resources.msg_error_get_patient
  446. , consentMain.ConsentExecuteInfo["patientNo"]));
  447. }
  448. else {
  449. PatientVO vo = patientVOList[0];
  450. commandControl.CurrentTargetPatient = new TargetPatient();
  451. SetTargetPatientInfo(vo);
  452. }
  453. }
  454. }
  455. }