SMMNV00202.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /* ---------------------------------------------------------------------
  2. 대기안내 환자진행현황 (대기안내 시력검사실 )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By sonickth
  6. : 2010.07.05
  7. ----------------------------------------------------------------------*/
  8. var clockID ; // 하단줄의 시간 interval
  9. var grdintervalID ; // 그리드 조회 interval
  10. var grdToggle;
  11. /**
  12. * @group :
  13. * @ver : 2010.07.05
  14. * @by : sonickth
  15. * @---------------------------------------------------
  16. * @type : function
  17. * @access : public
  18. * @desc : 검사실 대기안내(시력검사실) 환자조회화면초기화
  19. * @param :
  20. * @param :
  21. * @return :
  22. * @---------------------------------------------------
  23. */
  24. function fInitialize(){
  25. model.setValue("/root/main/cond/bizdd", getCurrentDate());
  26. /* if(model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/centcd") == "-" ) {
  27. model.setValue("/root/main/waitroominfo/waitroomtitle/deptnm", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptnm"));
  28. } else {
  29. model.setValue("/root/main/waitroominfo/waitroomtitle/deptnm", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/centnm"));
  30. }
  31. */
  32. model.removenode("/root/main/waitroominfo/waitroominfolist");
  33. model.refresh();
  34. fSetTimer();
  35. }
  36. /**
  37. * @group :
  38. * @ver : 2010.07.05
  39. * @by : sonickth
  40. * @---------------------------------------------------
  41. * @type : function
  42. * @access : public
  43. * @desc : 지정된 시간간격마다 그리드데이터 조회(화면 호출시 처음만 호출된다)
  44. * @param :
  45. * @param :
  46. * @return :
  47. * @---------------------------------------------------
  48. */
  49. function fSetTimer(){
  50. clockID = window.setInterval("clock();" , 1000); //1초
  51. grdintervalID = window.setInterval("fGetOpdWaitRoomInfo();", 8000);
  52. }
  53. /* --------------------------------------------------*/
  54. /* type : function */
  55. /* access : public */
  56. /* desc : 외래 대기실 진행현황 조회 */
  57. /* --------------------------------------------------*/
  58. var maxGroup = 30; //대대기에 표시할 검사실 최대 개수
  59. var perGroup = 3; //대대기 한 화면에 표시할 진료실 개수
  60. function fGetOpdWaitRoomInfo(){
  61. var sPath = "/root/main/opdinfo";
  62. model.removenode("/root/send");
  63. model.makeValue("/root/send/bizdd", model.getValue("/root/main/cond/bizdd"));
  64. model.makeValue("/root/send/subdeptcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/subdeptcd"));
  65. model.makeValue("/root/send/centcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/centcd"));
  66. model.makeValue("/root/send/orddeptcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/orddeptcd"));
  67. // model.makeValue("/root/send/centcd", '-');
  68. model.makeValue("/root/send/orddeptcd", '2120000000');
  69. model.makeValue("/root/send/ordroomcd", model.getValue("/root/hidden/wgopeninfo/wgopeninfolist/ordroomcd"));
  70. model.makeValue("/root/send/orddrid", model.getValue("/root/main/ordroominfo/ordroominfolist/orddrid"));
  71. setErrorOff();
  72. if (submit("TRMNV00202", false)) {
  73. model.setValue("/root/main/cond/bizdd", getCurrentDate());
  74. document.all.item("room1").visible = true;
  75. var i, z, y;
  76. var itemid;
  77. var patnm, chgpatnm;
  78. itemid = "room1";
  79. patnm = ""; //환자명사이에 space를 넣어서 조회되게
  80. chgpatnm = ""; //환자명사이에 space를 넣어서 조회되게
  81. var k = 1;
  82. for(j = 1; j <= getNodesetCount("/root/main/waitroominfo/waitroompatlist"); j++ ) {
  83. if(k <=10) { // 한그룹에 표시되는 환자수
  84. //환자명사이에 space를 넣어서 조회되게
  85. patnm = model.getValue("/root/main/waitroominfo/waitroompatlist[" + j + "]/patnm");
  86. for(y = 0; y < patnm.length; y++){
  87. if(y + 1 == patnm.length){
  88. chgpatnm = chgpatnm + patnm.substring(y , y + 1);
  89. }else{
  90. chgpatnm = chgpatnm + patnm.substring(y , y + 1) + " ";
  91. }
  92. }
  93. document.all.item(itemid+"_pat"+k).value = chgpatnm;
  94. patnm = "";
  95. chgpatnm = "";
  96. document.all.item(itemid+"_pid"+k).value = model.getValue("/root/main/waitroominfo/waitroompatlist[" + j + "]/pid");
  97. k = k+1;
  98. }
  99. }
  100. } else {
  101. model.setValue("/root/init/grdStatus","grd:장애");
  102. model.removeNodeset(sPath);
  103. model.refresh();
  104. }
  105. }
  106. /**
  107. * @group :
  108. * @ver : 2010.07.05
  109. * @by : sonickth
  110. * @---------------------------------------------------
  111. * @type : function
  112. * @access : public
  113. * @desc : DataTime 조회.
  114. * @param :
  115. * @param :
  116. * @return :
  117. * @---------------------------------------------------
  118. */
  119. function clock() {
  120. var tdate = getCurrentDateTime().substring(0, 4) + "년 "
  121. + getCurrentDateTime().substring(4, 6) + "월 "
  122. + getCurrentDateTime().substring(6, 8) + "일 "
  123. + getCurrentDate().toDate().getDayOfWeek("K") + "요일 "
  124. var ttime = getCurrentDateTime().substring(8, 11) + ":"
  125. + getCurrentDateTime().substring(11, 13)
  126. model.setValue("/root/hidden/date", tdate) ;
  127. model.setValue("/root/hidden/time", ttime) ;
  128. model.refresh();
  129. }
  130. /**
  131. * @group :
  132. * @ver : 2010.07.05
  133. * @by : sonickth
  134. * @---------------------------------------------------
  135. * @type : function
  136. * @access : public
  137. * @desc : 'ESC' or 'Q' 키를 누르면 타이머 해제 및 윈도우 닫기
  138. * @param :
  139. * @param :
  140. * @return :
  141. * @---------------------------------------------------
  142. */
  143. function fClearTimer(){
  144. var keyPressed = event.keyCode ;
  145. if(keyPressed == 27 || keyPressed == 81) // 'ESC' or 'Q' 키가 눌려진 경우
  146. {
  147. var answer = messageBox("진행현황 안내 프로그램 종료합니다.", "I") ;
  148. if(answer == 1) {
  149. fCloseBoard();
  150. }
  151. }
  152. }
  153. function fCloseBoard(){
  154. if (clockID != "") window.clearInterval(clockID);
  155. if (grdintervalID != "") window.clearInterval(grdintervalID);
  156. if (grdToggle != "") window.clearInterval(grdToggle);
  157. model.close() ;
  158. }