SMMNV09200.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /* ---------------------------------------------------------------------
  2. 대기안내 환자진행현황 (오전/오후별 산부인과 소대기 대기안내 - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By Sonjy
  6. : 2010.06.10
  7. ----------------------------------------------------------------------*/
  8. var submitIntervalTime = 5 * 1000 ; // 5초
  9. var showGrdTime = 4 * 1000 ; // 7초
  10. var showMsgTime = 10 * 1000 ; // 10초
  11. var clockID ; // 하단줄의 시간 interval
  12. var grdintervalID ; // 그리드 조회 interval
  13. var grdintervalIDTop ; // 그리드 상단 올리기 interval
  14. var grdintervalIDDelay ; // 지연
  15. var msgintervalID ; // msg 조회 interval
  16. var msgintervalIDTop ; // msg 상단 올리기 interval
  17. var msgintervalIDDelay ; // 지연
  18. var chngflag = "-" ; //한장치 다중과 사용 구분 ( N:단일사용, E: 2개과 공유시 )
  19. var chngindx = 1 ; //한장치 다중과 사용시 multi사용으로 다시 check해야 할때 다음 check index
  20. /**
  21. * @group :
  22. * @ver :
  23. * @by :
  24. * @---------------------------------------------------
  25. * @type : function
  26. * @access : public
  27. * @desc : 대기안내 환자조회화면초기화
  28. * @param :
  29. * @param :
  30. * @return :
  31. * @---------------------------------------------------
  32. */
  33. function fInitialize(reinityn){
  34. model.setValue("/root/main/cond/bizdd", getCurrentDate());
  35. model.setValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomnm", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomnm").replace('\n',''));
  36. model.setValue("/root/main/ordroominfo/ordroominfolist/deptnm", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptnm") + " (" + model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomnm") + ")");
  37. if(model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/centcd") == "-" ) {
  38. model.setValue("/root/main/ordroominfo/ordroominfolist/deptnm", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptnm") + " (" + model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomnm") + ")");
  39. } else if(model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/centcd") != "-" && model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptcd") == "-") {
  40. model.setValue("/root/main/ordroominfo/ordroominfolist/deptnm", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/centnm") + " (" + model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomnm") + ")");
  41. } else {
  42. model.setValue("/root/main/ordroominfo/ordroominfolist/deptnm", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptnm") + " (" + model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomnm") + ")");
  43. }
  44. model.refresh();
  45. if( reinityn != "N" ){
  46. fSetGrdTimer();
  47. }
  48. }
  49. /**
  50. * @group :
  51. * @ver :
  52. * @by :
  53. * @---------------------------------------------------
  54. * @type : function
  55. * @access : public
  56. * @desc : 지정된 시간간격마다 그리드데이터 조회(화면 호출시 처음만 호출된다)
  57. * @param :
  58. * @param :
  59. * @return :
  60. * @---------------------------------------------------
  61. */
  62. function fSetGrdTimer(){
  63. clockID = window.setInterval("clock();" , 1000); //1초
  64. grdintervalID = window.setInterval("fGetOpdOrdRoomInfo2();", submitIntervalTime); //5초
  65. }
  66. /* --------------------------------------------------*/
  67. /* type : function */
  68. /* access : public */
  69. /* desc : 산부인과외래 진료실 진행현황 조회 */
  70. /* --------------------------------------------------*/
  71. function fGetOpdOrdRoomInfo2(){
  72. /*
  73. * @ sonjy 2010.06.08
  74. * 한 진료실을 다른 부서에서 나눠서 사용할 경우 ( 한장비, 한진료실... )
  75. */
  76. //처음 로딩했거나 장치공유가 다중인경우 더 첵크해야 할 경우가 있을때
  77. if( chngflag != "N" && chngflag != "E" ) {
  78. var nodelist = model.instance1.selectNodes("/root/hidden/wgopeninfo/wgopendetlinfolist") ;
  79. if( nodelist != null && nodelist.length > 0 ) {
  80. var curTm = getCurrentTime();
  81. var chngtm = "";
  82. var i = chngindx ;
  83. for( i = chngindx ; i <= nodelist.length ; i++ ){
  84. alert( chngindx + "/" + model.getValue("/root/hidden/wgopeninfo/wgopendetlinfolist[" + i + "]/chng_ordflag" ) );
  85. chngtm = model.getValue("/root/hidden/wgopeninfo/wgopendetlinfolist[" + i + "]/chng_ordflag" ) ;
  86. if( !isNull(chngtm) && chngtm != "-" && ( parseInt(curTm) >= parseInt(chngtm )) ){
  87. chngindx = i;
  88. //공유장치
  89. model.makeValue("/root/hidden/wgopeninfo/wgopeninfolist/centcd" , model.getValue("/root/hidden/wgopeninfo/wgopendetlinfolist[" + chngindx + "]/chng_centcd"));
  90. model.makeValue("/root/hidden/wgopeninfo/wgopeninfolist/centnm" , model.getValue("/root/hidden/wgopeninfo/wgopendetlinfolist[" + chngindx + "]/chng_centnm"));
  91. model.makeValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptcd" , model.getValue("/root/hidden/wgopeninfo/wgopendetlinfolist[" + chngindx + "]/chng_orddeptcd"));
  92. model.makeValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptnm" , model.getValue("/root/hidden/wgopeninfo/wgopendetlinfolist[" + chngindx + "]/chng_orddeptnm"));
  93. model.makeValue("/root/hidden/wgopeninfo/wgopeninfolist/subdeptcd" , model.getValue("/root/hidden/wgopeninfo/wgopendetlinfolist[" + chngindx + "]/chng_subdeptcd"));
  94. model.makeValue("/root/hidden/wgopeninfo/wgopeninfolist/subdeptnm" , model.getValue("/root/hidden/wgopeninfo/wgopendetlinfolist[" + chngindx + "]/chng_subdeptnm"));
  95. chngflag = "E";
  96. fInitialize("Y"); //진료과명 초기화
  97. break;
  98. }
  99. }
  100. } else {
  101. chngflag = "N" ; //단일사용
  102. }
  103. }
  104. var sPath = "/root/main/opdinfo";
  105. model.removenode("/root/send");
  106. model.makeValue("/root/send/bizdd", model.getValue("/root/main/cond/bizdd"));
  107. model.makeValue("/root/send/centcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/centcd"));
  108. model.makeValue("/root/send/orddeptcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptcd"));
  109. model.makeValue("/root/send/subdeptcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/subdeptcd"));
  110. model.makeValue("/root/send/ordroomcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomcd"));
  111. model.makeValue("/root/send/orddrid", model.getValue("/root/main/ordroominfo/ordroominfolist/orddrid"));
  112. model.makeValue("/root/send/autoflag", model.getValue("/root/main/ordroominfo/ordroominfolist/autoflag"));
  113. setErrorOff();
  114. if (submit("TRMNV09001",false)) {
  115. model.setValue("/root/main/cond/bizdd", getCurrentDate());
  116. if(model.getValue("/root/main/ordroominfo/ordroominfolist/deptnm") == "-") {
  117. model.setValue("/root/main/ordroominfo/ordroominfolist/deptnm", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptnm") + " (" + model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomnm") + ")");
  118. }
  119. model.setValue("/root/main/ordroominfo/ordroominfolist/deptnm", model.getValue("/root/main/ordroominfo/ordroominfolist/deptnm").replace('\n',''));
  120. model.refresh();
  121. } else {
  122. model.setValue("/root/init/grdStatus","grd:장애");
  123. model.removeNodeset(sPath);
  124. model.refresh();
  125. }
  126. }
  127. /**
  128. * @group :
  129. * @ver :
  130. * @by :
  131. * @---------------------------------------------------
  132. * @type : function
  133. * @access : public
  134. * @desc : DataTime 조회.
  135. * @param :
  136. * @param :
  137. * @return :
  138. * @---------------------------------------------------
  139. */
  140. function clock() {
  141. var tdate = getCurrentDateTime().substring(0, 4) + "년 "
  142. + getCurrentDateTime().substring(4, 6) + "월 "
  143. + getCurrentDateTime().substring(6, 8) + "일 "
  144. + getCurrentDate().toDate().getDayOfWeek("K") + "요일 ";
  145. var ttime = getCurrentDateTime().substring(8, 11) + ":"
  146. + getCurrentDateTime().substring(11, 13);
  147. model.setValue("/root/hidden/date", tdate) ;
  148. model.setValue("/root/hidden/time", ttime) ;
  149. model.refresh();
  150. }
  151. /**
  152. * @group :
  153. * @ver :
  154. * @by :
  155. * @---------------------------------------------------
  156. * @type : function
  157. * @access : public
  158. * @desc : 'ESC' or 'Q' 키를 누르면 타이머 해제 및 윈도우 닫기
  159. * @param :
  160. * @param :
  161. * @return :
  162. * @---------------------------------------------------
  163. */
  164. function fClearTimer(){
  165. var keyPressed = event.keyCode ;
  166. if(keyPressed == 27 || keyPressed == 81) // 'ESC' or 'Q' 키가 눌려진 경우
  167. {
  168. var answer = messageBox("진행현황 안내 프로그램 종료합니다.", "I") ;
  169. if(answer == 1) {
  170. fCloseBoard();
  171. }
  172. }
  173. }
  174. function fCloseBoard(){
  175. if (clockID != "") window.clearInterval(clockID);
  176. if (msgintervalID != "") window.clearInterval(msgintervalID);
  177. if (grdintervalID != "") window.clearInterval(grdintervalID);
  178. if (msgintervalIDTop != "") window.clearInterval(msgintervalIDTop);
  179. if (grdintervalIDTop != "") window.clearInterval(grdintervalIDTop);
  180. model.close() ;
  181. }