SPMRI02700.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. /**
  2. * @desc : 화면 초기화
  3. * @
  4. * @param :
  5. * @return :
  6. * @author : HIT EMR Team
  7. * @---------------------------------------------------
  8. */
  9. function fInitialize(){
  10. model.removeNodeset("/root/main/unpreplist");
  11. //미비과 조회
  12. // zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"), "orduseyn", "D", "/root/hidden/deptlist", "depthngnm", "asc");
  13. /*
  14. zbcfGetDeptCodeList("012", "orduseyn", "D", "/root/hidden/deptlist", "depthngnm", "asc");
  15. addComboItem("cmb_deptcd","전체","-");
  16. var fDate = getCurrentDate();
  17. var fgetdd = fDate.toDate();
  18. var isDate = fgetdd.getAddDate(-1);
  19. model.setValue("/root/main/condition/fromdd",isDate.getDateFormat());
  20. model.setValue("/root/main/condition/todd", getCurrentDate());
  21. */
  22. fDocInfoSetting(); //로그인한 미비의사id적용
  23. model.refresh();
  24. }
  25. /**
  26. * @desc : 미비 리스트 조회
  27. * @
  28. * @param :
  29. * @return :
  30. * @author : HIT EMR Team
  31. * @---------------------------------------------------
  32. */
  33. function fSrchUnprepList()
  34. {
  35. model.copyNode("/root/send" , "/root/main/condition");
  36. submit("TRMRI02701");
  37. }
  38. /**
  39. * @desc : 엑셀로 저장
  40. * @
  41. * @param :
  42. * @return :
  43. * @author : HIT EMR Team
  44. * @---------------------------------------------------
  45. */
  46. func
  47. function fSaveExcel(){
  48. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  49. if (fileName != "")
  50. {
  51. grd_unpreplist.saveExcel(fileName, "SheetName", true, true, "", "", "false");
  52. }
  53. }
  54. /**
  55. * @desc : 사용자 정보 얻기
  56. * @id :
  57. * @event : xforms-select
  58. * @return : void
  59. * @author : HIT EMR Team
  60. * @---------------------------------------------------
  61. */
  62. function fGetUserInfo(userid,usernm,deptcd ,instcd){
  63. model.makeValue("/root/temp/userinfo/userid", userid);
  64. model.makeValue("/root/temp/userinfo/usernm", usernm.getTrim());
  65. model.makeValue("/root/temp/userinfo/deptcd", deptcd);
  66. model.makeValue("/root/temp/userinfo/instcd", instcd);
  67. }
  68. /**
  69. * @---------------------------------------------------
  70. * @desc : 문자열 앞뒤에있는 공백 제거
  71. * @param : N/A
  72. * @return : 공백을 제거한 결과 문자열
  73. * @---------------------------------------------------
  74. */
  75. String.prototype.getTrim = function()
  76. {
  77. var startPoint = 0; // subString 하기 위한 시작 포인트
  78. var endPoint = this.length; // subString 하기 위한 끝 포인트
  79. //문자열앞에 공백문자가 들어 있는 Index 추출
  80. while( (startPoint < endPoint) && (this.charCodeAt(startPoint) == 32) )
  81. {
  82. startPoint++;
  83. }
  84. //문자열뒤에 공백문자가 들어 있는 Index 추출
  85. while( (startPoint < endPoint) && (this.charCodeAt(endPoint-1) == 32) )
  86. {
  87. endPoint--;
  88. }
  89. // 공백을 제거했으면 subString하여 결과문자열을 리턴하고 제거한 내용이 없으면 그대로 리턴
  90. return ( (startPoint > 0) || (endPoint < this.length) ) ? this.substring(startPoint, endPoint) : this;
  91. }
  92. /**
  93. * @desc : 기록지에 setParameter
  94. * @
  95. * @param :
  96. * @return :
  97. * @author : HIT EMR Team
  98. * @---------------------------------------------------
  99. */
  100. function fSetParamFormRec(){
  101. var curRow = grd_unpreplist.row - grd_unpreplist.fixedRows + 1;
  102. if(curRow < 1){
  103. return;
  104. }
  105. var pid = model.getValue("/root/main/unpreplist["+ curRow +"]/pid");
  106. var orddd = model.getValue("/root/main/unpreplist["+ curRow +"]/orddd");
  107. var cretno = model.getValue("/root/main/unpreplist["+ curRow +"]/cretno");
  108. var ioflag = model.getValue("/root/main/unpreplist["+ curRow +"]/indschflag");
  109. var orddrid = model.getValue("/root/main/unpreplist["+ curRow +"]/unprepdrid");
  110. var formcd = model.getValue("/root/main/unpreplist["+ curRow +"]/formcd");
  111. var orddeptcd = model.getValue("/root/main/unpreplist["+ curRow +"]/indschdeptcd");
  112. var formrecseq = model.getValue("/root/main/unpreplist["+ curRow +"]/formrecseq");
  113. var formrecdd = model.getValue("/root/main/unpreplist["+ curRow +"]/formrecdd");
  114. var dschdd = model.getValue("/root/main/unpreplist["+ curRow +"]/dschdd");
  115. //var dschdd = "20080201";
  116. /* 2월 1일부터 적용
  117. var sDate = 20080202;
  118. if(Number(dschdd) < sDate ){
  119. messageBox("종이기록으로 작성하시어 의료정보팀으로 내려주세요. 종이기록으로 작성하셔야하는 환자", "E008");
  120. return;
  121. }*/
  122. setParameter("pid", pid);
  123. setParameter("orddd", orddd);
  124. setParameter("cretno", cretno);
  125. setParameter("ioflag", ioflag);
  126. setParameter("orddeptcd", orddeptcd);
  127. setParameter("orddrid", orddrid);
  128. setParameter("SSMMR01100_formrecdd", formrecdd);
  129. if(formrecseq == "" || formrecseq == 0){
  130. setParameter("openmode", "newform"); //오픈모드는 “recform”
  131. setParameter("formcd", formcd);
  132. }else{
  133. setParameter("openmode", "recform"); //오픈모드는 "recform"
  134. setParameter("formrecseq", formrecseq); //서식기록테이블의 formrecseq(기록순번)
  135. }
  136. modal("SSMMR01100", 1, 0, 0 ,"", "", "");
  137. //기록순번
  138. var sFormRecSeq = getParameter("SSMMR01100_formrecseq");
  139. var currentDt = getCurrentDate()+getCurrentTime();
  140. //alert("currow->"+curRow +"=sFormRecSeq="+sFormRecSeq);
  141. if (sFormRecSeq != "")
  142. {
  143. model.setValue("/root/main/unpreplist["+ curRow +"]/formrecseq", sFormRecSeq);
  144. model.setValue("/root/main/unpreplist["+ curRow +"]/statcert", "2");
  145. model.setValue("/root/main/unpreplist["+ curRow +"]/drcnfmdt", currentDt.substring(0, 14)); //의사확인일시
  146. model.setValue("/root/main/unpreplist["+ curRow +"]/drflag", "drflag"); //의사확인일시구분
  147. grd_unpreplist.rowStatus(curRow) = 2;
  148. // 저장
  149. fSetUnprepRec();
  150. }
  151. model.refresh();
  152. clearParameter("SSMMR01100_formrecseq");
  153. }
  154. /**
  155. * @desc : 출력기능
  156. * @
  157. * @param :
  158. * @return :
  159. * @author : HIT EMR Team
  160. * @---------------------------------------------------
  161. */
  162. function fPrintBtn(){
  163. exeReportPreview("RPMRI01800", "XMLSTR");
  164. //exeReportPreview("RPMRI01800", "XMLSTR", "", "", "true", "", "", "", "", "true");
  165. }
  166. /**
  167. * @desc : 의사정보 셋팅
  168. * @
  169. * @param :
  170. * @return :
  171. * @author : HIT EMR Team
  172. * @---------------------------------------------------
  173. */
  174. function fDocInfoSetting(){
  175. //alert(1);
  176. if(getUserInfo("jobkindcd") == "0330" ){
  177. //if((getUserInfo("jobkindcd") == "0330") || (getUserInfo("jobkindcd") == "0332")){
  178. //alert(2);
  179. model.setValue("/root/main/condition/drnm", getUserInfo("usernm"));
  180. model.setValue("/root/main/condition/drid", getUserInfo("userid"));
  181. model.refresh();
  182. }
  183. }