SPMMO14800.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 입원예약내역 (SPMMO14800_입원예약내역.xrw - JScript )
  4. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  5. */
  6. var sINREQFRMINFO_PATH = "/root/main/inreqfrminfo/inreqfrminfo";
  7. var sINREQHISTLIST_PATH = "/root/main/inreqhistinfo/inreqhistlist";
  8. /**
  9. * @desc : 입원결정서 내역 조회
  10. * @
  11. * @param :
  12. * @return :
  13. * @author : 오지훈
  14. * @---------------------------------------------------
  15. */
  16. function fInitialize_SPMMO14800(){
  17. model.removeNodeset("/root/main/inreqhistinfo/inreqhistlist");
  18. zbcfGetCodeList(new Array("P0020", "P0378"), new Array("/root/init/inrsrvcnclresn", "/root/init/specroomyn"));
  19. mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/orddept", "D");
  20. model.setValue("/root/main/cond/year" , getCurrentDate().substr(0, 4)); //year
  21. model.setValue("/root/main/cond/month", getCurrentDate().substr(4, 2)); //month
  22. grd_calendar.dataheight = 31; // grid data height default set
  23. fReqInReqCalendar(); //달력조회
  24. }
  25. /**
  26. * @desc : 입원결정서 내역 조회
  27. * @
  28. * @param : pid - 등록번호
  29. * : inrsrvacptseqno- 입원예약번호
  30. * @return :
  31. * @author : 오지훈
  32. * @---------------------------------------------------
  33. */
  34. function fReqInReqHistList(pid, inrsrvacptdd, orddeptcd, inrsrvacptseqno){
  35. model.removeNodeset("/root/send/reqdata");
  36. model.makeValue("/root/send/reqdata/pid" , pid);
  37. model.makeValue("/root/send/reqdata/inrsrvacptdd" , inrsrvacptdd);
  38. model.makeValue("/root/send/reqdata/orddeptcd" , orddeptcd);
  39. model.makeValue("/root/send/reqdata/inrsrvacptseqno" , inrsrvacptseqno);
  40. model.makeValue("/root/send/reqdata/queryflag", "nurse"); //간호 조회용 쿼리, 미래일자 입원결정서는 조회하지 않는다.
  41. if(submit("TRMMO00109")){
  42. fDispInReqHistInfo(1);
  43. }
  44. fReqInReqDiagOpList(); //입원결정서 진단,수술조회
  45. }
  46. /**
  47. * @desc : 입원내역 리스트 클릭시 -> 입원내역 정보 display
  48. * @
  49. * @param :
  50. * @return :
  51. * @author : 오지훈
  52. * @---------------------------------------------------
  53. */
  54. function fDispInReqHistInfo(currow){
  55. var orddeptcd = model.getValue(sINREQHISTLIST_PATH + "[" + currow + "]/orddeptcd");
  56. if(orddeptcd == ""){
  57. return;
  58. }
  59. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", orddeptcd, "0330");
  60. model.copyNode(sINREQFRMINFO_PATH, sINREQHISTLIST_PATH + "[" + currow + "]");
  61. model.refresh();
  62. }
  63. /**
  64. * @desc : 입원의뢰서 진단,수술 리스트 조회
  65. * @
  66. * @param :
  67. * @return :
  68. * @author : 오지훈
  69. * @---------------------------------------------------
  70. */
  71. function fReqInReqDiagOpList(){
  72. model.removeNodeset("/root/send/reqdata");
  73. var pid = model.getValue(sINREQFRMINFO_PATH + "/pid");
  74. var inhopedd = model.getValue(sINREQFRMINFO_PATH + "/inhopedd");
  75. var orddeptcd= model.getValue(sINREQFRMINFO_PATH + "/orddeptcd");
  76. var orddrid = model.getValue(sINREQFRMINFO_PATH + "/orddrid");
  77. if(pid == "" || inhopedd == "" || orddeptcd == "" || orddrid == ""){ //입원결정서가 없는 경우,
  78. return; //입원결정서 진단을 조회하지 않는다.
  79. }
  80. model.makeValue("/root/send/reqdata/pid" , pid);
  81. model.makeValue("/root/send/reqdata/orddd" , inhopedd); //입원희망일자
  82. model.makeValue("/root/send/reqdata/cretno" , 0);
  83. model.makeValue("/root/send/reqdata/orddeptcd", orddeptcd);
  84. model.makeValue("/root/send/reqdata/orddrid" , orddrid);
  85. if(submit("TRMMO00112")){
  86. }
  87. }
  88. /**
  89. * @desc : 입원의뢰서 달력 조회
  90. * @
  91. * @param :
  92. * @return :
  93. * @author : 오지훈
  94. * @---------------------------------------------------
  95. */
  96. function fReqInReqCalendar(){
  97. model.removeNodeset("/root/main/week/week");
  98. model.removeNodeset("/root/main/calendar/calendar");
  99. model.refresh();
  100. var year = model.getValue("/root/main/cond/year");
  101. var month = model.getValue("/root/main/cond/month");
  102. var orgyear = year;
  103. var orgmonth = month;
  104. model.removeNodeset("/root/send/reqdata");
  105. model.makeValue("/root/send/reqdata/fromdd" , year + "-" + month + "-" + "01");
  106. if(month == 12){ //12월인 경우, 해를 넘겨서 계산한다.
  107. year++;
  108. month = "01";
  109. }else{
  110. month = eval(month) + 1;
  111. if(month < 10){month = "0".concat(month);}
  112. }
  113. model.makeValue("/root/send/reqdata/todd" , year + "-" + month + "-" + "01");
  114. model.makeValue("/root/send/reqdata/basedd" , ("" + orgyear + "").concat(orgmonth));
  115. model.makeValue("/root/send/reqdata/orddeptcd", model.getValue(sINREQFRMINFO_PATH + "/orddeptcd"));
  116. if(submit("TRMMO00110")){
  117. fMakeCalendar(); //조회 후 달력 값을 설정
  118. }
  119. }
  120. /**
  121. * @desc : 달력값 설정
  122. * @
  123. * @param :
  124. * @return :
  125. * @author : 오지훈
  126. * @---------------------------------------------------
  127. */
  128. function fMakeCalendar(){
  129. model.refresh();
  130. grd_calendar.addRow(false, true);
  131. var row = 0;
  132. var col = 0;
  133. var patsum = 0;
  134. var totcnt = getNodeSetCnt("/root/main/calendar/calendar");
  135. for(var i = 1; i <= totcnt ; i++){
  136. row = model.getValue("/root/main/calendar/calendar[" + i + "]/week");
  137. col = model.getValue("/root/main/calendar/calendar[" + i + "]/day") - 1;
  138. patsum = model.getValue("/root/main/calendar/calendar[" + i + "]/patsum");
  139. dutflag = model.getValue("/root/main/calendar/calendar[" + i + "]/dutflag");
  140. if(dutflag == 4){ //토
  141. grd_calendar.cellstyle("color", row, col) = "#0000FF";
  142. }else if(dutflag == 8){ //일
  143. grd_calendar.cellstyle("color", row, col) = "#FF0000";
  144. }else{ //휴일
  145. grd_calendar.cellstyle("color", row, col) = "#000000";
  146. }
  147. grd_calendar.valueMatrix(row, col) = i + "\n(" + patsum + ")";
  148. if(col == 6){
  149. grd_calendar.addRow(false, true);
  150. }
  151. }
  152. grd_calendar.rebuild();
  153. }
  154. /**
  155. * @desc : 달력 년도 변경 버튼 클릭
  156. * @
  157. * @param : pflag - bf 이전 해
  158. * - af 다음 해
  159. * @return :
  160. * @author : 오지훈
  161. * @---------------------------------------------------
  162. */
  163. function fClkBtnYear(pflag){
  164. model.removeNodeset("/root/main/week/week");
  165. var year = model.getValue("/root/main/cond/year");
  166. if(pflag == "bf"){
  167. model.setValue("/root/main/cond/year", --year);
  168. }else if(pflag == "af"){
  169. model.setValue("/root/main/cond/year", ++year);
  170. }
  171. model.refresh();
  172. fReqInReqCalendar();
  173. }
  174. /**
  175. * @desc : 당력 월 변경 버튼 클릭
  176. * @
  177. * @param : pflag - bf 이전 해
  178. * - af 다음 해
  179. * @return :
  180. * @author : 오지훈
  181. * @---------------------------------------------------
  182. */
  183. function fClkBtnMonth(pflag){
  184. model.removeNodeset("/root/main/week/week");
  185. var year = model.getValue("/root/main/cond/year");
  186. var month = model.getValue("/root/main/cond/month");
  187. if(pflag == "af"){
  188. month = eval(month) + 1;
  189. if(month == 13){
  190. year = eval(year) + 1;
  191. month = "01";
  192. }else if(month < 10){ //2자리가 아닌 경우, 앞자리에 0을 붙인다.
  193. month = "0".concat(month);
  194. }
  195. }else if(pflag == "bf"){
  196. month -= 1;
  197. if(month == 0){
  198. year -= 1;
  199. month = 12;
  200. }else if(month < 10){ //2자리가 아닌 경우, 앞자리에 0을 붙인다.
  201. month = "0".concat(month);
  202. }
  203. }
  204. model.setValue("/root/main/cond/year", year);
  205. model.setValue("/root/main/cond/month", month);
  206. model.refresh();
  207. fReqInReqCalendar();
  208. }
  209. function fReqPatInfo(pid){
  210. if(pid != ""){
  211. fReqInReqHistList(pid); //입원내역조회
  212. fReqInReqDiagOpList(); //입원결정서 진단,수술조회
  213. }
  214. }