SMADM00400.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. var admissionPath = "/root/admission";
  2. var outsidePath = "/root/outside";
  3. /*
  4. 외래 : 투약내역 화면 초기화
  5. */
  6. function fOutSideInitialize() {
  7. model.setValue(outsidePath+"/send/search/type", "0");
  8. model.setValue(outsidePath+"/send/search/begindate", getNewDate().getAddDate(-7, "D").getDateFormat("YYYYMMDD"));
  9. model.setValue(outsidePath+"/send/search/enddate", getCurrentDate());
  10. model.removenode(outsidePath+"/main/druglist/item");
  11. model.removenode(outsidePath+"/main/patientlist/item");
  12. //진료과 콤보
  13. submit("TRADM00202");
  14. }
  15. /*
  16. 외래 : 약품 리스트
  17. */
  18. function fOutSideSearch() {
  19. var begindate = model.getValue("/root/outside/send/search/begindate");
  20. var enddate = model.getValue("/root/outside/send/search/enddate");
  21. if (begindate == "") {
  22. messageBox("조회기간 시작날짜는 ", "I003");
  23. model.setFocus("ipt_begindate");
  24. return;
  25. }
  26. if (enddate == "") {
  27. messageBox("조회기간 종료날짜는 ", "I003");
  28. model.setFocus("ipt_enddate");
  29. return;
  30. }
  31. submit('TRADM00401');
  32. model.removenode("/root/outside/main/patientlist");
  33. model.makeNode("/root/outside/main/patientlist");
  34. grd_patient.refresh();
  35. if (model.getXPathValue("count(/root/outside/main/druglist/item)") == 0) {
  36. messageBox("", "E013");
  37. }
  38. }
  39. /*
  40. 외래/입원 : 조회 조건 약품 팝업
  41. */
  42. function fSearchDrugOpt(dtype) {
  43. var tmpPath = "";
  44. if (dtype == "outside") {
  45. tmpPath = outsidePath;
  46. } else if (dtype == "admission") {
  47. tmpPath = admissionPath;
  48. }
  49. model.setValue(tmpPath+"/temp/receivedata/receiveref", tmpPath+"/temp/usrSelectDrugcd");
  50. modal( "SPADB60100", 0, 100, 150, "SPADB60100", tmpPath+"/temp/receivedata", "/root/temp/receivedata" );
  51. var selectCd = model.getValue(tmpPath+"/temp/usrSelectDrugcd");
  52. var cd = model.getValue(tmpPath+"/send/search/drugcds");
  53. var nm = model.getValue(tmpPath+"/send/search/drugnm");
  54. if (selectCd != "") {
  55. model.setValue(tmpPath+"/send/usrSelectDrugcd", selectCd);
  56. TRADM00302.attribute("ref") = tmpPath+"/send";
  57. TRADM00302.attribute("resultref") = tmpPath+"/temp/tmpDrugDetail";
  58. submit("TRADM00302");
  59. var detailPath = tmpPath+"/temp/tmpDrugDetail/resultVal";
  60. var selectNm = model.getValue(detailPath+"/hngnm");
  61. var delimeter = "";
  62. if (cd != "") {
  63. delimeter = " | "
  64. }
  65. cd += delimeter + selectCd;
  66. nm += delimeter + selectNm;
  67. } else {
  68. cd = "";
  69. nm = "";
  70. }
  71. model.setValue(tmpPath+"/send/search/drugcds", cd);
  72. model.setValue(tmpPath+"/send/search/drugnm", nm);
  73. model.setValue(tmpPath+"/temp/usrSelectDrugcd", "");
  74. opt_goodcd.refresh();
  75. opt_goodnm.refresh();
  76. opt_admission_drugcd.refresh();
  77. opt_admission_drugnm.refresh();
  78. }
  79. /*
  80. 외래 : 환자 목록 조회
  81. */
  82. function fOutSideSearchPatient() {
  83. if (grd_druglist.isCell(event.target) && grd_druglist.row > 0) {
  84. var searchPath = "/root/outside/send/searchPatient";
  85. var conditionPath = "/root/outside/main/druglist/condition";
  86. var selBeginDate = model.getValue(conditionPath+"/begindate");
  87. var selEndDate = model.getValue(conditionPath+"/enddate");
  88. var selDeptcd = model.getValue(conditionPath+"/deptcd");
  89. var selType = model.getValue(conditionPath+"/type");
  90. var selDrugcd = model.getValue("/root/outside/main/druglist/item["+grd_druglist.row+"]/prcpcd");
  91. model.setValue(searchPath+"/begindate", selBeginDate);
  92. model.setValue(searchPath+"/enddate", selEndDate);
  93. model.setValue(searchPath+"/deptcd", selDeptcd);
  94. model.setValue(searchPath+"/type", selType);
  95. model.setValue(searchPath+"/drugcd", selDrugcd);
  96. submit("TRADM00402");
  97. }
  98. }
  99. /*
  100. 외래 : 엑셀 저장
  101. */
  102. function fOutSideSaveExcel() {
  103. var files = window.fileDialog("save","|", true,"","xls","Excel Files(*.xls)|*.xls");
  104. if (files !="") {
  105. if (model.getXPathValue("count(/root/outside/main/patientlist/item)") > 0) {
  106. grd_patient.saveExcel(files);
  107. } else {
  108. grd_druglist.saveExcel(files);
  109. }
  110. }
  111. }
  112. /*
  113. 입원 : 화면 초기화
  114. */
  115. function fAdmissionInitialize() {
  116. var chkCnt = model.getXPathValue("count(/root/admission/init/deptlist/item)");
  117. if (chkCnt == 0) {
  118. model.copyNode(admissionPath+"/init/deptlist", outsidePath+"/init/deptlist");
  119. model.setValue(admissionPath+"/send/search/begindate", getNewDate().getAddDate(-7, "D").getDateFormat("YYYYMMDD"));
  120. model.setValue(admissionPath+"/send/search/enddate", getCurrentDate());
  121. model.removeNode(admissionPath+"/main/admissionlist");
  122. btn_admission_dept.refresh();
  123. ipt_admission_begindate.refresh();
  124. ipt_admission_enddate.refresh();
  125. grd_admission.refresh();
  126. }
  127. }
  128. function fAdmissionSearchPidOpt() {
  129. model.makeValue("/root/send/srchcond","2");
  130. modal("SPPMC02500", "", "200", "200", "SPPMC02500",admissionPath+"/temp","/root/send");
  131. var flag = model.getValue("/root/main/popupendflag");
  132. var pids = model.getValue(admissionPath+"/send/search/pids");
  133. var pidn = model.getValue(admissionPath+"/send/search/pidsnm");
  134. if (flag == "cancel") {
  135. pids = "";
  136. pidn = "";
  137. } else {
  138. var tmpId = model.getValue("/root/main/patinfo/patinfolist/pid");
  139. var tmpnm = model.getValue("/root/main/patinfo/patinfolist/hngnm");
  140. if (pids == "") {
  141. pids = tmpId;
  142. pidn = tmpnm;
  143. } else {
  144. pids += " | "+tmpId;
  145. pidn += " | "+tmpnm;
  146. }
  147. }
  148. model.setValue(admissionPath+"/send/search/pids", pids);
  149. model.setValue(admissionPath+"/send/search/pidsnm", pidn);
  150. opt_pids.refresh();
  151. opt_pidn.refresh();
  152. model.removeNode("/root/main/patinfo/patinfolist");
  153. model.makeNode("/root/main/patinfo/patinfolist");
  154. }
  155. function fAdmissionSearch() {
  156. submit("TRADM00403");
  157. }
  158. function fAdmissionType1Chk() {
  159. var chkVal = model.getValue(admissionPath+"/send/search/type1");
  160. if (chkVal == "A0") {
  161. chk_type2.visible = false;
  162. model.setValue(admissionPath+"/send/search/type2", "");
  163. } else {
  164. chk_type2.visible = true;
  165. }
  166. }
  167. function fAdmissionType2Chk() {
  168. var chkVal = model.getValue(admissionPath+"/send/search/type2");
  169. if (chkVal.indexOf("A1") > -1 && chkVal.indexOf("A2") > -1 && chkVal.indexOf("A3") > -1) {
  170. model.setValue(admissionPath+"/send/search/type2", "");
  171. chk_type2.visible = false;
  172. model.setValue(admissionPath+"/send/search/type1", "A0");
  173. chk_type1.refresh();
  174. }
  175. }