PatientInfoCtrl.cs 25 KB

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