MMR04002.js 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. /* SAPS 상세 관련
  2. 개발자:이윤주 */
  3. function fIni()
  4. {
  5. var pid = opener.window.javascript.getParameter("SMMMR04002_pid");
  6. var hngnm = opener.window.javascript.getParameter("SMMMR04002_hngnm");
  7. var orddd = opener.window.javascript.getParameter("SMMMR04002_orddd");
  8. var cretno = opener.window.javascript.getParameter("SMMMR04002_cretno");
  9. var fromdd = opener.window.javascript.getParameter("SMMMR04002_fromdd");
  10. var ipsildt = opener.window.javascript.getParameter("SMMMR04002_ipsildt");
  11. var recflag = "DI02";
  12. model.makeValue("/root/init/pid",pid);
  13. model.makeValue("/root/init/hngnm",hngnm);
  14. model.makeValue("/root/init/orddd",orddd);
  15. model.makeValue("/root/init/cretno",cretno);
  16. model.makeValue("/root/init/fromdd",fromdd);
  17. model.makeValue("/root/init/recflag",recflag);
  18. model.makeValue("/root/init/ipsildt",ipsildt);
  19. fSearch();
  20. }
  21. function fSearch()
  22. {
  23. model.makeValue("/root/cond/search/pid",model.getValue("/root/init/pid"));
  24. model.makeValue("/root/cond/search/orddd",model.getValue("/root/init/orddd"));
  25. model.makeValue("/root/cond/search/fromdd",model.getValue("/root/init/fromdd"));
  26. model.makeValue("/root/cond/search/cretno",model.getValue("/root/init/cretno"));
  27. model.makeValue("/root/cond/search/recflag",model.getValue("/root/init/recflag"));
  28. model.makeValue("/root/cond/search/ipsildt",model.getValue("/root/init/ipsildt"));
  29. model.makeValue("/root/cond/search/chosflag","Z");
  30. submit("TRMMR04003");
  31. model.makeValue("/root/init/sapsscore",model.getValue("/root/main/detlinfo/formdetl/sapsscore"));
  32. model.makeValue("/root/init/pom",model.getValue("/root/main/detlinfo/formdetl/pom"));
  33. model.refresh();
  34. }
  35. function fGetData()
  36. {
  37. if (submit("TRMMR04004")) {
  38. model.makeValue("/root/init/sapsscore","");
  39. model.makeValue("/root/init/pom","");
  40. }
  41. model.refresh();
  42. }
  43. function fSave()
  44. {
  45. if (fSaveChk() == false) {
  46. return;
  47. }
  48. //점수계산
  49. fCalc();
  50. if (submit("TXMMR04002")) {
  51. var cnt = model.getValue("/root/hidden/savedetl/rslt/cnt");
  52. fSearch();
  53. if ( cnt > 0) {
  54. messageBox("정상적으로 저장되었습니다","I");
  55. }
  56. }
  57. }
  58. function fDel()
  59. {
  60. if ( 6 != messageBox("삭제 하시겠습니까","Q") ) {
  61. return;
  62. }
  63. model.makeValue("/root/cond/del/pid",model.getValue("/root/init/pid"));
  64. model.makeValue("/root/cond/del/orddd",model.getValue("/root/init/orddd"));
  65. model.makeValue("/root/cond/del/fromdd",model.getValue("/root/init/fromdd"));
  66. model.makeValue("/root/cond/del/cretno",model.getValue("/root/init/cretno"));
  67. model.makeValue("/root/cond/del/recflag",model.getValue("/root/init/recflag"));
  68. if (submit("TXMMR04003")) {
  69. var cnt = model.getValue("/root/hidden/savedetl/rslt/cnt");
  70. fSearch();
  71. if ( cnt > 0) {
  72. messageBox("정상적으로 삭제되었습니다","I");
  73. }
  74. }
  75. }
  76. function fSaveChk() {
  77. var cnt = getNodeSetCnt("/root/main/detlinfo/formdetl");
  78. for ( var i = 1; i<= cnt ; i++) {
  79. var itemval = model.getValue("/root/main/detlinfo/formdetl["+i+"]/itemval1");
  80. var itemcd = model.getValue("/root/main/detlinfo/formdetl["+i+"]/itemcd");
  81. if (itemval == "") {
  82. var headnm = model.getValue("/root/main/detlinfo/formdetl["+i+"]/headnm");
  83. messageBox("["+ headnm + "]값이 입력되지 않았습니다","I");
  84. return false;
  85. }
  86. }
  87. return true;
  88. }
  89. function fCalc(){
  90. var cnt = getNodeSetCnt("/root/main/detlinfo/formdetl");
  91. for ( var i = 1; i<= cnt ; i++) {
  92. var itemval = model.getValue("/root/main/detlinfo/formdetl["+i+"]/itemval1");
  93. var itemcd = model.getValue("/root/main/detlinfo/formdetl["+i+"]/itemcd");
  94. if (itemcd == "DI020005") {
  95. itemval = 0;
  96. }
  97. if (itemcd == "DI020015") {
  98. itemval = parseInt(itemval.substr(0,2));
  99. }
  100. if (itemcd == "DI020017") {
  101. itemval = parseInt(itemval.substr(1,1));
  102. }
  103. model.setValue("/root/main/detlinfo/formdetl["+i+"]/score",itemval);
  104. //model.makeValue("/root/main/sinfo/slist["+i+"]/score",itemval);
  105. }
  106. //예외처리
  107. var score15 = model.getValue("/root/main/detlinfo/formdetl[itemcd='DI020015']/score");
  108. var score18 = model.getValue("/root/main/detlinfo/formdetl[itemcd='DI020018']/score");
  109. if ( score15 == "-5" && score18 == "-4" ) {
  110. model.setValue("/root/main/detlinfo/formdetl[itemcd='DI020015']/score","0");
  111. model.setValue("/root/main/detlinfo/formdetl[itemcd='DI020018']/score","-4");
  112. }
  113. var score = 0;
  114. var scoreboard = "";
  115. var tmp = "";
  116. for ( var i = 1; i<= cnt ; i++) {
  117. tmp = model.getValue("/root/main/detlinfo/formdetl["+i+"]/score")
  118. score = score + parseInt(tmp);
  119. scoreboard = scoreboard + model.getValue("/root/main/detlinfo/formdetl["+i+"]/headnm")+":"+tmp+"\n" ;
  120. }
  121. model.setValue("/root/main/detlinfo/formdetl/sapsscore",score);
  122. model.setValue("/root/init/scoreboard",scoreboard);
  123. }
  124. function fPrint() {
  125. model.removenodeset("/root/main/report/detlinfo");
  126. model.makeNode("/root/main/report/detlinfo");
  127. //Box 1
  128. //var DI020001 = model.getValue("/root/main/detlinfo/formdetl[itemcd='DI020001']/itemval1"); //나이
  129. var DI020001 = combo2.label; //나이
  130. var DI020002 = combo29.label; //중환자실 입실 전 병실 입원 기간
  131. var DI020003 = combo30.label;; //중환자실 입실 전 체류한 곳
  132. var DI020004 = combo10.label; //암 치료 여부
  133. var DI020005 = combo3.label; //고형암 환자 여부
  134. var DI020007 = combo8.label; //혈액암 여부
  135. var DI020006 = combo1.label; //전이암 여부
  136. var DI020008 = combo4.label; //Chronic HF(NYHA IV) 여부
  137. var DI020009 = combo7.label; //Cirrhosis 여부
  138. var DI020010 = combo6.label; //AIDS 여부
  139. var DI020011 = combo5.label; //vasoactive dugs 사용(ex. dopamine, dobutamine, adrenaline or noradrenaline)
  140. //Box 2
  141. var DI020014 = combo12.label; //입원여부
  142. var DI020013 = combo11.label; //수술여부
  143. var DI020012 = combo9.label; //계획된 입원
  144. var DI020019 = combo17.label; //Anatomical site of surgery
  145. var DI020015 = combo13.label; //Cardiovascular
  146. var DI020016 = combo14.label; //Hepatic
  147. var DI020017 = combo15.label; //Digestive
  148. var DI020018 = combo16.label; //Neurologic
  149. var DI020020 = combo31.label; //Nosocomial infection(hospital-acquired)
  150. var DI020021 = combo18.label; //Respiratory infection
  151. //Box 3
  152. var DI020022 = combo19.label; //Glasgow coma Scale(GCS) (lowest)(points)
  153. var DI020030 = combo27.label; //Systolic blood pressure (lowest)
  154. var DI020026 = combo23.label; //Heart rate (highest)(beats/minute)
  155. var DI020024 = combo21.label; //Body temperature (highest)(℃)
  156. var DI020031 = combo28.label; //Oxygenation
  157. var DI020025 = combo22.label; //Serum Creatinine (highest)(mg/dl)
  158. var DI020023 = combo20.label; //Total bilirubin (highest)(mg/㎗)
  159. var DI020027 = combo24.label; //WBC (highest)(g/ℓ)
  160. var DI020029 = combo26.label; //Platelets (lowest)(mmHg)
  161. var DI020028 = combo25.label; //PH (lowest)
  162. var DI020032 = input5.value; //SAPS 점수
  163. var DI020033 = input6.value; //예측사망율(%)
  164. model.makeValue("/root/main/report/detlinfo/pid",model.getValue("/root/init/pid"));
  165. model.makeValue("/root/main/report/detlinfo/hngnm",model.getValue("/root/init/hngnm"));
  166. model.makeValue("/root/main/report/detlinfo/orddd",model.getValue("/root/init/orddd"));
  167. model.makeValue("/root/main/report/detlinfo/ipsildt",model.getValue("/root/init/ipsildt"));
  168. //Box 1
  169. model.makeValue("/root/main/report/detlinfo/DI020001",DI020001);
  170. model.makeValue("/root/main/report/detlinfo/DI020002",DI020002);
  171. model.makeValue("/root/main/report/detlinfo/DI020003",DI020003);
  172. model.makeValue("/root/main/report/detlinfo/DI020004",DI020004);
  173. model.makeValue("/root/main/report/detlinfo/DI020005",DI020005);
  174. model.makeValue("/root/main/report/detlinfo/DI020007",DI020007);
  175. model.makeValue("/root/main/report/detlinfo/DI020006",DI020006);
  176. model.makeValue("/root/main/report/detlinfo/DI020008",DI020008);
  177. model.makeValue("/root/main/report/detlinfo/DI020009",DI020009);
  178. model.makeValue("/root/main/report/detlinfo/DI020010",DI020010);
  179. model.makeValue("/root/main/report/detlinfo/DI020011",DI020011);
  180. //Box 2
  181. model.makeValue("/root/main/report/detlinfo/DI020014",DI020014);
  182. model.makeValue("/root/main/report/detlinfo/DI020013",DI020013);
  183. model.makeValue("/root/main/report/detlinfo/DI020012",DI020012);
  184. model.makeValue("/root/main/report/detlinfo/DI020019",DI020019);
  185. model.makeValue("/root/main/report/detlinfo/DI020015",DI020015);
  186. model.makeValue("/root/main/report/detlinfo/DI020016",DI020016);
  187. model.makeValue("/root/main/report/detlinfo/DI020017",DI020017);
  188. model.makeValue("/root/main/report/detlinfo/DI020018",DI020018);
  189. model.makeValue("/root/main/report/detlinfo/DI020020",DI020020);
  190. model.makeValue("/root/main/report/detlinfo/DI020021",DI020021);
  191. //Box 3
  192. model.makeValue("/root/main/report/detlinfo/DI020022",DI020022);
  193. model.makeValue("/root/main/report/detlinfo/DI020030",DI020030);
  194. model.makeValue("/root/main/report/detlinfo/DI020026",DI020026);
  195. model.makeValue("/root/main/report/detlinfo/DI020024",DI020024);
  196. model.makeValue("/root/main/report/detlinfo/DI020031",DI020031);
  197. model.makeValue("/root/main/report/detlinfo/DI020025",DI020025);
  198. model.makeValue("/root/main/report/detlinfo/DI020023",DI020023);
  199. model.makeValue("/root/main/report/detlinfo/DI020027",DI020027);
  200. model.makeValue("/root/main/report/detlinfo/DI020029",DI020029);
  201. model.makeValue("/root/main/report/detlinfo/DI020028",DI020028);
  202. model.makeValue("/root/main/report/detlinfo/DI020032",DI020032);
  203. model.makeValue("/root/main/report/detlinfo/DI020033",DI020033);
  204. //copyNodeType("/root/main/report/detlinfo", "/root/main/detlinfo/formdetl", "after");
  205. //copyNodesetType("/root/main/report/detlinfo", "/root/main/detlinfo/formdetl", "after");
  206. //출력
  207. exeReportPreview("RMMMR04002", "XMLSTR", "/root/main/report/detlinfo");
  208. }