SMMNV11000.js 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /* ---------------------------------------------------------------------
  2. 대기안내 환자진행현황 (대기안내공통 - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By YeoWon Lim
  6. : 2015.05.02
  7. ----------------------------------------------------------------------*/
  8. var inquiryTime = 5 * 1000 ; // 5초 (재조회시간)
  9. var clockTime = 1000 ; // 1초 (시계)
  10. var clockID ;
  11. var inquiryID;
  12. /**
  13. * @group :
  14. * @ver : 2008.02.13
  15. * @by : 임여원
  16. * @---------------------------------------------------
  17. * @type : function
  18. * @access : public
  19. * @desc : 대기안내 환자조회화면초기화
  20. * @param :
  21. * @param :
  22. * @return :
  23. * @---------------------------------------------------
  24. */
  25. function fInitialize(){
  26. fSetTimer();
  27. }
  28. /**
  29. * @group :
  30. * @ver : 2007.10.09
  31. * @by : 문창곤
  32. * @---------------------------------------------------
  33. * @type : function
  34. * @access : public
  35. * @desc : 지정된 시간간격마다 그리드데이터 조회(화면 호출시 처음만 호출된다)
  36. * @param :
  37. * @param :
  38. * @return :
  39. * @---------------------------------------------------
  40. */
  41. function fSetTimer(){
  42. clockID = window.setInterval("clock();" , clockTime); //1초
  43. inquiryID = window.setInterval("fGetTestRoomInfo();" , inquiryTime); //5초
  44. }
  45. /* --------------------------------------------------*/
  46. /* type : function */
  47. /* access : public */
  48. /* desc : 외래 진료실 진행현황 조회 */
  49. /* --------------------------------------------------*/
  50. function fGetTestRoomInfo(){
  51. var sPath = "/root/main/opdinfo";
  52. model.setValue("/root/main/cond/bizdd", getCurrentDate());
  53. model.removenode("/root/send");
  54. model.makeValue("/root/send/bizdd", model.getValue("/root/main/cond/bizdd"));
  55. model.makeValue("/root/send/centcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/centcd"));
  56. model.makeValue("/root/send/orddeptcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptcd"));
  57. model.makeValue("/root/send/ordroomcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomcd"));
  58. setErrorOff();
  59. if (submit("TRMNV11001",false)) {
  60. var i;
  61. var j = 2;
  62. var patstat = true;
  63. for(i = 1; i <= getNodesetCount("/root/main/ordroominfo/ordroompatlist") && j <= 6; i++ ) {
  64. if(model.getValue("/root/main/ordroominfo/ordroompatlist[" + i + "]/patstat") == "A") {
  65. document.all.item("rsrvtm1").value = model.getValue("/root/main/ordroominfo/ordroompatlist[" + i + "]/rsrvtm");
  66. document.all.item("patnm1").value = model.getValue("/root/main/ordroominfo/ordroompatlist[" + i + "]/patnm");
  67. patstat = false;
  68. } else {
  69. if (j < 4 ) {
  70. document.all.item("rsrvtm" + j).value = model.getValue("/root/main/ordroominfo/ordroompatlist[" + i + "]/rsrvtm");
  71. document.all.item("patnm" + j).value = model.getValue("/root/main/ordroominfo/ordroompatlist[" + i + "]/patnm");
  72. j++;
  73. } else {
  74. document.all.item("genpatnm" + j).value = model.getValue("/root/main/ordroominfo/ordroompatlist[" + i + "]/genpatnm");
  75. j++;
  76. }
  77. }
  78. }
  79. if(patstat) {
  80. document.all.item("rsrvtm1").value = "-";
  81. document.all.item("patnm1").value = "-";
  82. }
  83. for(; j <= 6; j++ ) {
  84. if (j < 4 ) {
  85. document.all.item("rsrvtm" + j).value = "-";
  86. document.all.item("patnm" + j).value = "-";
  87. } else {
  88. document.all.item("genpatnm" + j).value = "-";
  89. }
  90. }
  91. model.refresh();
  92. } else {
  93. model.setValue("/root/init/grdStatus","grd:장애");
  94. model.removeNodeset(sPath);
  95. model.refresh();
  96. }
  97. }
  98. /**
  99. * @group :
  100. * @ver : 2007.10.09
  101. * @by : 문창곤
  102. * @---------------------------------------------------
  103. * @type : function
  104. * @access : public
  105. * @desc : DataTime 조회.
  106. * @param :
  107. * @param :
  108. * @return :
  109. * @---------------------------------------------------
  110. */
  111. function clock() {
  112. var tdate = getCurrentDateTime().substring(0, 4) + "년 "
  113. + getCurrentDateTime().substring(4, 6) + "월 "
  114. + getCurrentDateTime().substring(6, 8) + "일 "
  115. + getCurrentDate().toDate().getDayOfWeek("K") + "요일 ";
  116. var ttime = getCurrentDateTime().substring(8, 11) + ":"
  117. + getCurrentDateTime().substring(11, 13);
  118. model.setValue("/root/hidden/date", tdate) ;
  119. model.setValue("/root/hidden/time", ttime) ;
  120. model.refresh();
  121. }
  122. /**
  123. * @group :
  124. * @ver : 2007.10.09
  125. * @by : 문창곤
  126. * @---------------------------------------------------
  127. * @type : function
  128. * @access : public
  129. * @desc : 'ESC' or 'Q' 키를 누르면 타이머 해제 및 윈도우 닫기
  130. * @param :
  131. * @param :
  132. * @return :
  133. * @---------------------------------------------------
  134. */
  135. function fClearTimer(){
  136. var keyPressed = event.keyCode ;
  137. if(keyPressed == 27 || keyPressed == 81) // 'ESC' or 'Q' 키가 눌려진 경우
  138. {
  139. var answer = messageBox("진행현황 안내 프로그램 종료합니다.", "I") ;
  140. if(answer == 1) {
  141. fCloseBoard();
  142. }
  143. }
  144. }
  145. function fCloseBoard(){
  146. if (clockID != "") window.clearInterval(clockID);
  147. if (inquiryID != "") window.clearInterval(inquiryID);
  148. model.close();
  149. }