SPMMO09500.js 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 예외환자관리 (SPMMO09500_예외환자 관리.xrw - JScript )
  4. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  5. */
  6. var sPAT_INFO_PATH = "/root/init/patinfo";
  7. var sEXPT_INFO_PATH = "/root/main/info/exptpatinfo";
  8. var sEXPT_LIST_PATH = "/root/main/list/exptpatlist"
  9. var sCONDITION_PATH = "/root/main/cond";
  10. /**
  11. * @desc : 화면 초기화
  12. * @
  13. * @param :
  14. * @return :
  15. * @---------------------------------------------------
  16. */
  17. function fInitialize(){
  18. mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/orddept", "O");
  19. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist1", getUserInfo("dutplcecd"), "0330"); // 조회 조건 적용의사
  20. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist2", getUserInfo("dutplcecd"), "0330"); // 조회 조건 적용의사
  21. addComboInstance("/root/init/orddept", "deptcd^depthngnm", "-^전체", "dept"); //부서 전체항목 추가
  22. addComboInstance("/root/init/userlist1", "userid^usernm", "-^전체", "usercombo"); //의사콤보 전체항목 추가
  23. addComboInstance("/root/init/userlist2", "userid^usernm", "-^전체", "usercombo"); //의사콤보 전체항목 추가
  24. zbcfGetCodeList(new Array("M0627" ), new Array("/root/init/M0627"));
  25. addComboInstance("/root/init/M0627", "cdid^cdnm", "ALL^전체", "M0627"); //예외분류 콤보 전체항목 추가
  26. model.setValue(sCONDITION_PATH + "/excpcls", "ALL");
  27. model.setValue(sCONDITION_PATH + "/srchflag", "");
  28. model.setValue(sCONDITION_PATH + "/deptcd", getUserInfo("dutplcecd"));
  29. model.setValue(sCONDITION_PATH + "/userid", getUserInfo("userid"));
  30. var sPid = getPatientInfo("pid");
  31. if(!isNull(sPid) ) {
  32. model.setValue(sCONDITION_PATH + "/pid", sPid);
  33. model.setValue(sPAT_INFO_PATH + "/pid", sPid);
  34. model.setValue(sPAT_INFO_PATH + "/hngnm", getPatientInfo("pname"));
  35. model.refreshpart(sPAT_INFO_PATH);
  36. }
  37. group_cond.refresh();
  38. fSearch();
  39. }
  40. /**
  41. * @desc : 예외환자 조회
  42. * @
  43. * @param :
  44. * @return :
  45. * @---------------------------------------------------
  46. */
  47. function fSearch(){
  48. model.copyNode("/root/send/reqdata", sCONDITION_PATH);
  49. if(submit("TRMMO09502")){
  50. model.resetInstanceNode(sEXPT_INFO_PATH);
  51. model.refreshpart(sEXPT_LIST_PATH);
  52. group_info.refresh();
  53. group_list.refresh();
  54. }
  55. }
  56. /**
  57. * @desc : 예외환자정보 선택 - 상세 정보를 보여줌, 수정할 수 있도록 처리함
  58. * @
  59. * @param :
  60. * @return :
  61. * @---------------------------------------------------
  62. */
  63. function fSelectExptPatInfo(){
  64. model.resetInstanceNode(sEXPT_INFO_PATH);
  65. var currow = grd_exptpatlist.row;
  66. model.copyNode(sEXPT_INFO_PATH, sEXPT_LIST_PATH + "[" + currow + "]");
  67. model.makeValue(sEXPT_INFO_PATH + "/status" , "U");
  68. var sUserid = model.getValue(sEXPT_INFO_PATH + "/userid");
  69. cmb_orddept2.dispatch("xforms-value-changed");
  70. model.setValue(sEXPT_INFO_PATH + "/userid", sUserid);
  71. group_info.refresh();
  72. }
  73. /**
  74. * @desc : 신규작성 버튼 클릭
  75. * @
  76. * @param :
  77. * @return :
  78. * @---------------------------------------------------
  79. */
  80. function fNewRgst(){
  81. model.resetInstanceNode(sEXPT_INFO_PATH);
  82. model.makeValue(sEXPT_INFO_PATH + "/status", "I");
  83. model.setValue(sEXPT_INFO_PATH + "/excpcls", "001");
  84. model.setValue(sEXPT_INFO_PATH + "/genrdd", getCurrentDate());
  85. model.setValue(sEXPT_INFO_PATH + "/genrno", "");
  86. model.setValue(sEXPT_INFO_PATH + "/histno", "0"); // 숫자 0
  87. model.setValue(sEXPT_INFO_PATH + "/histcd", "O"); // 문자 O
  88. model.setValue(sEXPT_INFO_PATH + "/excpcd", "999"); // 디폴트로 저장
  89. model.setValue(sEXPT_INFO_PATH + "/fromdd", getCurrentDate());
  90. model.setValue(sEXPT_INFO_PATH + "/todd", "99991231");
  91. model.setValue(sEXPT_INFO_PATH + "/histnm", "신규등록");
  92. model.removeNodeset("/root/init/userlist2");
  93. model.makeNode("/root/init/userlist2/usercombo");
  94. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist2", getUserInfo("dutplcecd"), "0330");
  95. addComboInstance("/root/init/userlist2", "userid^usernm", "-^전체", "usercombo"); //의사콤보 전체항목 추가
  96. model.setValue(sEXPT_INFO_PATH + "/deptcd", getUserInfo("dutplcecd"));
  97. cmb_orddept2.dispatch("xforms-value-changed");
  98. model.setValue(sEXPT_INFO_PATH + "/userid", getUserInfo("userid"));
  99. model.setValue(sEXPT_INFO_PATH + "/pid", model.getValue(sPAT_INFO_PATH + "/pid"));
  100. model.setValue(sEXPT_INFO_PATH + "/hngnm", model.getValue(sPAT_INFO_PATH + "/hngnm"));
  101. group_info.refresh();
  102. }
  103. /**
  104. * @desc : 환자 조회
  105. * @
  106. * @param :
  107. * @return :
  108. * @author : 엄영만
  109. * @---------------------------------------------------
  110. */
  111. function fPatSrch(){
  112. var sCurrentDate = getCurrentDate();
  113. clearParameter("SPMMO017300_fromdd" );
  114. clearParameter("SPMMO017300_todd" );
  115. clearParameter("SPMMO017300_pid" );
  116. clearParameter("SPMMO017300_hngnm" );
  117. clearParameter("SPMMO017300_orddd" );
  118. clearParameter("SPMMO017300_orddeptcd" );
  119. clearParameter("SPMMO017300_orddrid" );
  120. setParameter("SPMMO017300_fromdd", sCurrentDate);
  121. setParameter("SPMMO017300_todd", sCurrentDate);
  122. setParameter("SPMMO017300_pid", model.getValue(sEXPT_INFO_PATH + "/pid"));
  123. modal("SPMMO173000");
  124. var sPid = getParameter("SPMMO017300_pid");
  125. var sHngnm = getParameter("SPMMO017300_hngnm");
  126. var sOrddd = getParameter("SPMMO017300_orddd");
  127. var sOrddeptcd = getParameter("SPMMO017300_orddeptcd");
  128. var sOrddrid = getParameter("SPMMO017300_orddrid");
  129. model.resetInstanceNode(sEXPT_INFO_PATH);
  130. if(!isNull(sHngnm)) {
  131. model.makeValue(sEXPT_INFO_PATH + "/status", "I");
  132. model.setValue(sEXPT_INFO_PATH + "/excpcls", "001");
  133. model.setValue(sEXPT_INFO_PATH + "/genrdd", sCurrentDate);
  134. model.setValue(sEXPT_INFO_PATH + "/genrno", "");
  135. model.setValue(sEXPT_INFO_PATH + "/pid", sPid);
  136. model.setValue(sEXPT_INFO_PATH + "/hngnm", sHngnm);
  137. model.setValue(sEXPT_INFO_PATH + "/histno", "0"); // 숫자 0
  138. model.setValue(sEXPT_INFO_PATH + "/histcd", "O"); // 문자 O
  139. model.setValue(sEXPT_INFO_PATH + "/excpcd", "999"); // 디폴트로 저장
  140. model.setValue(sEXPT_INFO_PATH + "/fromdd", sOrddd);
  141. model.setValue(sEXPT_INFO_PATH + "/todd", sCurrentDate);
  142. model.setValue(sEXPT_INFO_PATH + "/histnm", "신규등록");
  143. model.removeNodeset("/root/init/userlist2");
  144. model.makeNode("/root/init/userlist2/usercombo");
  145. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist2", getUserInfo("dutplcecd"), "0330");
  146. addComboInstance("/root/init/userlist2", "userid^usernm", "-^전체", "usercombo"); //의사콤보 전체항목 추가
  147. model.setValue(sEXPT_INFO_PATH + "/deptcd", sOrddeptcd);
  148. cmb_orddept2.dispatch("xforms-value-changed");
  149. model.setValue(sEXPT_INFO_PATH + "/userid", sOrddrid);
  150. }
  151. group_info.refresh();
  152. }
  153. /**
  154. * @desc : 예외환자정보 저장
  155. * @
  156. * @param :
  157. * @return :
  158. * @---------------------------------------------------
  159. */
  160. function fSaveExptPatInfo(){
  161. var sStatus = model.getValue(sEXPT_INFO_PATH + "/status");
  162. if(sStatus != "I" && sStatus != "U" && sStatus != "D") {messageBox("처리할수 없는 작업 입니다. \n\n신규 작성 하시려면 신규작성 버튼 클릭후 저장 하세요.", "C999"); return; }
  163. var excpcls = model.getValue(sEXPT_INFO_PATH + "/excpcls");
  164. var sDutplcecd = getUserInfo("dutplcecd");
  165. var sUserId = getUserInfo("userid");
  166. if(excpcls == ""){
  167. messageBox("분류명을", "C001"); return;
  168. } else if (excpcls == "ALL") {
  169. messageBox("분류를 전체로 선택 하실수 없습니다.", "C999"); return;
  170. } else if ( (excpcls == "001")
  171. && (sDutplcecd == "4072000000" || sDutplcecd == "4070700000") ){ // 001: 산정특례
  172. messageBox("산정특례 분류는 심사실에서 등록/수정 할 수 없습니다.", "C999"); return;
  173. } else if ( (excpcls == "002" || excpcls == "003" || excpcls == "004" || excpcls == "005" || excpcls == "006")
  174. && (sDutplcecd != "4072000000" && sDutplcecd != "4070700000")
  175. && (sUserId != "EMR")){ // DUR(임부금기),DUR(최대용량금기),DUR(최대기간금기),DUR(병용금기),DUR(연령금기)
  176. messageBox("DUR 관련 분류는 심사실에서만 등록/수정 가능 합니다.", "C999"); return;
  177. } else if (excpcls == "007") {
  178. messageBox("임신부 분류는 등록/수정 할 수 없습니다.", "C999"); return;
  179. }
  180. var sPid = model.getValue(sEXPT_INFO_PATH + "/pid");
  181. if(sPid == ""){messageBox("등록번호를", "C001"); return;}
  182. var excptext = model.getValue(sEXPT_INFO_PATH + "/excptext");
  183. if(excpcls == "001" && excptext == ""){ messageBox("예외사유을", "C001"); return;}
  184. model.copyNode("/root/send/savedata", sEXPT_INFO_PATH);
  185. if(submit("TXMMO09501")){
  186. var rsltnode = model.instance1.selectNodes(sEXPT_LIST_PATH);
  187. if(rsltnode.length > 0){
  188. group_list.refresh();
  189. grd_exptpatlist.row = 1;
  190. fSelectExptPatInfo();
  191. }
  192. }
  193. }