SMMQI03000.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. /*function list
  2. /*
  3. 작성자:이윤주
  4. 목적:임상 질 지표 화면 개발
  5. */
  6. function fIni() {
  7. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/hardcd", 5700);
  8. zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"),"orduseyn","W","/root/init/wardcdlsit","depthngnm","asc");
  9. zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"),"orduseyn","D","/root/init/orddeptlist","depthngnm","asc");
  10. addComboItem("cmb_deptcd", "전체", "ALL");
  11. addComboItem("cmb_wardcd", "전체", "ALL");
  12. submit("TRMQI03006");
  13. model.setValue("/root/main/cond/searchkind","CI01");
  14. model.setValue("/root/main/cond/ddflag","D");
  15. model.setValue("/root/main/cond/fromdd",getCurrentDate());
  16. model.setValue("/root/main/cond/todd",getCurrentDate());
  17. model.setValue("/root/main/cond/status", "ALL");
  18. model.setValue("/root/main/cond/orddeptcd", "ALL");
  19. model.setValue("/root/main/cond/wardcd", "ALL");
  20. model.refresh();
  21. }
  22. function fSearch() {
  23. if (combo2.value == "T") {
  24. messageBox("[전과/전실]은 생성조건이며, 조회조건으로 사용하실 수 없습니다.", "E999");
  25. return;
  26. }
  27. submit("TRMQI03000");
  28. model.setValue("/root/temp/gridcimasterflag","true");
  29. model.refresh();
  30. }
  31. function fDetl() {
  32. model.setValue("/root/main/applycount", "");
  33. var selectedRow = grd_cimaster.row;
  34. fGetCIDetailInfo(selectedRow);
  35. }
  36. function fCreate() {
  37. if ( 6 != messageBox("날짜 구간이 길면 늦어질 수 있습니다 진행할까요?","Q999"))
  38. {
  39. return;
  40. }
  41. // if (model.getValue("/root/main/cond/searchkind") == "CI01" && model.getValue("/root/main/cond/ddflag") == "I") {
  42. // messageBox("폐렴환자 마스터 생성기준은 퇴원일자로 해주시기 바랍니다.", "E999");
  43. // model.setFocus("combo2");
  44. // return;
  45. // }
  46. //
  47. // if (model.getValue("/root/main/cond/searchkind") == "CI02" && (model.getValue("/root/main/cond/ddflag") == "I" || model.getValue("/root/main/cond/ddflag") == "D" )) {
  48. // if (messageBox("중환자 마스터 생성기준은 중환자실 전과/전실일자로 설정됩니다. 전과/전실일자로 생성하시겠습니까?", "Q999") == "6") {
  49. // combo2.value = "T";
  50. // } else {
  51. // model.setFocus("combo2");
  52. // return;
  53. // }
  54. // }
  55. if (submit("TXMQI00200")) {
  56. var iCnt = model.getValue("/root/create/rslt/cnt");
  57. messageBox("["+iCnt + "]건 생성되었습니다.","I999");
  58. }
  59. }
  60. function fOpenCreatePopUp(){
  61. modal("SPMQI03000");
  62. }
  63. /**
  64. * 현재 질지표 Detail 정보 저장
  65. */
  66. function fSaveDetail() {
  67. if (grd_cimaster.row < 1 || model.getValue("/root/main/cimast/instcd") == "") //디테일이 선택되었는지 체크.
  68. return;
  69. if (combo3.value == "A" && model.getValue(grd_cimaster.nodeset+"[pid='"+ model.getValue("/root/main/cimast/pid")+"']/status") == "A") { //선정인 상태에서 저장이면 "저장" 상태로 자동 변경.. 나머진. 선택한 값으로 변경
  70. combo3.value = "C";
  71. }
  72. copyNodesetType("/root/main/detlinfo/formdetl", "/root/main/detlinfo/formdetl", "replace", model, iviewer_detl.model);
  73. model.makeValue("/root/main/detlinfo/cimast", getPrcpNodeListCSV(instance1.selectNodes("/root/main/cimast")));
  74. /*
  75. model.makeNode("/root/main/detlinfo/cimast");
  76. copyNodesetType("/root/main/detlinfo/cimast", "/root/main/cimast", "replace", model, model);
  77. model.makeValue("/root/main/detlinfo/formdetl", getNodeListCSV(iviewer_detl.instance1.selectSingleNode("/root/main/detlinfo")));
  78. */
  79. if (submit("TXMQI00201")) {
  80. fSearch();
  81. }
  82. }
  83. function fAuto() {
  84. var nTotalCount = eval(grd_cimaster.rows - 1 );
  85. var count;
  86. var nTrueCount = 0;
  87. for(var i = 1; i <= nTotalCount; i ++) {
  88. if(model.getValue("/root/main/ciinfo/cilist[" + i + "]/flag") == "true"){
  89. nTrueCount++;
  90. }
  91. }
  92. if(messageBox(nTrueCount + "건의 질지표 대상을 일괄저장을","Q004") == 6){
  93. model.setValue("/root/main/applycount", "");
  94. for (count = 1; count <= nTotalCount; count++) {
  95. if(model.getValue("/root/main/ciinfo/cilist[" + count + "]/flag") == "true"){
  96. if(!fGetCIDetailInfo(count)){
  97. return;
  98. }
  99. combo3.value = "C";
  100. copyNodesetType("/root/main/detlinfo/formdetl", "/root/main/detlinfo/formdetl", "replace", model, iviewer_detl.model);
  101. model.makeValue("/root/main/detlinfo/cimast", getPrcpNodeListCSV(instance1.selectNodes("/root/main/cimast")));
  102. if(!submit("TXMQI00201")) {
  103. messageBox("작업시 에러발생","I");
  104. return;
  105. }
  106. model.setValue("/root/main/applycount", "[ " + count + " / " + nTotalCount + " ]");
  107. cap_count.refresh();
  108. }
  109. }
  110. messageBox("질지표 대상의 일괄저장을", "I002");
  111. fSearch();
  112. }
  113. }
  114. function fGetiViewerDetlSrc(){
  115. var recflag = model.getValue("/root/main/cimast/recflag");
  116. var sSrc = "SMMQI03900_임상질지표_빈화면.xrw";
  117. return sSrc;
  118. }
  119. function fGetCIDetailInfo(nNodeNum){
  120. model.copyNode("/root/main/cimast", "/root/main/ciinfo/cilist[" + nNodeNum + "]");
  121. iviewer_detl.src = fGetiViewerDetlSrc();
  122. var recflag = model.getValue("/root/main/cond/searchkind");
  123. model.makeValue("/root/send/condition/hardcdno", fGetHardcdno_title(recflag));
  124. if(!submit("TRMQI00104")){
  125. messageBox("TRMQI00104 에러발생", "I");
  126. return false ;
  127. }
  128. model.makeNode("/root/main/headinfo");
  129. copyNodesetType("/root/main/headinfo", "/root/hidden/headinfo","replace", iviewer_detl.model, model);
  130. iviewer_detl.model.refresh();
  131. model.makeValue("/root/main/cimast/hardcdno", fGetHardcdno_title(recflag));
  132. if(!submit("TRMQI03001")){
  133. messageBox("TRMQI03001 에러발생", "I");
  134. return false;
  135. }
  136. copyNodesetType("/root/main/detlinfo", "/root/main/detlinfo", "replace", iviewer_detl.model, model);
  137. iviewer_detl.model.refresh();
  138. model.refresh();
  139. return true;
  140. }
  141. function fSetGridCimasterFlag(){
  142. var nTotalCount = eval(grd_cimaster.rows - 1 );
  143. var sFlag = "false"
  144. if(nTotalCount > 0){
  145. if(model.getValue("/root/temp/gridcimasterflag") == "true"){
  146. sFlag = "true";
  147. }
  148. for(var i = 1; i <= nTotalCount; i ++) {
  149. model.setValue("/root/main/ciinfo/cilist[" + i + "]/flag", sFlag);
  150. }
  151. }
  152. }
  153. function fSetCIMasterStatus(flag){
  154. var nTotalCount = eval(grd_cimaster.rows - 1 );
  155. var que ="선정상태로 변경하시겠습니까?";
  156. model.setValue("/root/main/applycount", "");
  157. if(nTotalCount > 0){
  158. var nTrueCount = 0;
  159. for(var i = 1; i <= nTotalCount; i ++) {
  160. if(model.getValue("/root/main/ciinfo/cilist[" + i + "]/flag") == "true"){
  161. nTrueCount++;
  162. }
  163. }
  164. if (flag == "D") {
  165. que = "삭제하시겠습니까?";
  166. }
  167. if(messageBox(nTrueCount + "건의 질지표 대상을 "+que,"Q") == 6){
  168. for (var j = 1; j <= nTotalCount; j++) {
  169. if(model.getValue("/root/main/ciinfo/cilist[" + j + "]/flag") == "true"){
  170. model.resetInstanceNode("/root/send/reqdata");
  171. model.copyNode("/root/send/reqdata", "/root/main/ciinfo/cilist[" + j + "]");
  172. model.makeValue("/root/send/reqdata/status", flag);
  173. submit("TXMQI00202");
  174. }
  175. }
  176. messageBox("정상적으로 처리되었습니다", "I");
  177. fSearch();
  178. }
  179. }
  180. }
  181. function fGetHardcdno_title(recflag){
  182. var hardcdno;
  183. switch (recflag) {
  184. case "CI01": //[폐렴]]
  185. hardcdno = 5640 ;
  186. sTitle = "폐렴 일괄목록";
  187. break;
  188. case "CI02": //[중환자]]
  189. hardcdno = 5641 ;
  190. sTitle = "중환자 일괄목록";
  191. break;
  192. case "CI03": //[수술 감염 예방적 항생제]]
  193. hardcdno = 5642 ;
  194. sTitle = "수술 감염 예방적 항생제 일괄목록";
  195. break;
  196. case "CI04": //[CABG]]
  197. hardcdno = 5643 ;
  198. sTitle = "CABG 일괄목록";
  199. break;
  200. case "CI05": //[급성심근경색증]]
  201. hardcdno = 5644 ;
  202. sTitle = "급성심근경색증 일괄목록";
  203. break;
  204. case "CI06": //[PCI]]
  205. hardcdno = 5645 ;
  206. sTitle = "PCI 일괄목록";
  207. break;
  208. case "CI07":
  209. hardcdno = 5646 ;
  210. sTitle = "일괄목록";
  211. break;
  212. case "CI08":
  213. hardcdno = 5647 ;
  214. sTitle = "일괄목록";
  215. break;
  216. case "CI09": //[폐암]]
  217. hardcdno = 5648 ;
  218. sTitle = "폐암일괄목록";
  219. break;
  220. case "CI10": //[폐암(수술환자대상)]]
  221. hardcdno = 5649 ;
  222. sTitle = "폐암(수술환자대상)일괄목록";
  223. break;
  224. case "CI11": //[유방암]]
  225. hardcdno = 5663 ;
  226. sTitle = "유뱡암일괄목록";
  227. break;
  228. case "CI12": //[폐렴(본원)]]
  229. hardcdno = 5639 ;
  230. sTitle = "폐렴(본원)일괄목록";
  231. break;
  232. }
  233. return hardcdno;
  234. }