SPMNR04800.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /*
  2. 지시처방 불러오기(SPMNR04800.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xDoctPrcpListPath = "/root/main/prcpinfo/doctprcplist";
  7. var xCarePrcpListPath = "/root/main/prcpinfo/careprcplist";
  8. /**
  9. * @group :
  10. * @ver : 2007.08.01
  11. * @by : 이은영
  12. * @---------------------------------------------------
  13. * @type : function
  14. * @access : public
  15. * @desc : 화면 초기화
  16. * @param :
  17. * @return :
  18. * @---------------------------------------------------
  19. */
  20. function fInitialize(){
  21. var iRow = 0;
  22. model.makeValue("/root/send/deptcd","all");
  23. if(submit("TRMNR04801")){
  24. model.copyNode("/root/temp/prcpinfo","/root/main/prcpinfo");
  25. setTree(grd_doctprcplist,5,2,false);
  26. setTree(grd_careprcplist,9,2,false);
  27. for(iRow =grd_doctprcplist.fixedrows; iRow <= grd_doctprcplist.rows-grd_doctprcplist.fixedrows; iRow++){
  28. grd_doctprcplist.rowStatus(iRow) = 0;
  29. if(model.getValue(xDoctPrcpListPath+"["+iRow+"]/depth") == "1"){
  30. grd_doctprcplist.isReadOnly(iRow,1) = true;
  31. }
  32. }
  33. for(iRow =grd_careprcplist.fixedrows; iRow <= grd_careprcplist.rows-grd_careprcplist.fixedrows; iRow++){
  34. grd_careprcplist.rowStatus(iRow) = 0;
  35. if(model.getValue(xCarePrcpListPath+"["+iRow+"]/depth") == "1"){
  36. grd_careprcplist.isReadOnly(iRow,1) = true;
  37. }
  38. }
  39. }
  40. }
  41. /**
  42. * @group :
  43. * @ver : 2007.08.01
  44. * @by : 이은영
  45. * @---------------------------------------------------
  46. * @type : function
  47. * @access : public
  48. * @desc :그리드 클릭시
  49. * @param :
  50. * @return :
  51. * @---------------------------------------------------
  52. */
  53. function fClinckGridRow(pFlag){
  54. var sDepth = 0;
  55. var iRow = 0;
  56. var iCol = 0;
  57. switch(pFlag){
  58. case "doct" :
  59. iRow = grd_doctprcplist.row;
  60. iCol = grd_doctprcplist.col;
  61. if(iRow < 1) return;
  62. if(iCol == 1) return;
  63. sDepth = eval(model.getValue(xDoctPrcpListPath+"["+iRow+"]/depth"));
  64. if(sDepth == 1) return;
  65. if(model.getValue(xDoctPrcpListPath+"["+iRow+"]/check") == "true"){
  66. model.setValue(xDoctPrcpListPath+"["+iRow+"]/check","false");
  67. }else{
  68. model.setValue(xDoctPrcpListPath+"["+iRow+"]/check","true");
  69. }
  70. break;
  71. case "care" :
  72. iRow = grd_careprcplist.row;
  73. iCol = grd_careprcplist.col;
  74. if(iRow < 1) return;
  75. if(iCol == 1) return;
  76. sDepth = model.getValue(xCarePrcpListPath+"["+iRow+"]/depth");
  77. if(sDepth == 1) return;
  78. if(model.getValue(xCarePrcpListPath+"["+iRow+"]/check") == "true"){
  79. model.setValue(xCarePrcpListPath+"["+iRow+"]/check","false");
  80. fDelGridRow();
  81. }else{
  82. model.setValue(xCarePrcpListPath+"["+iRow+"]/check","true");
  83. fDelGridRow();
  84. }
  85. break;
  86. }
  87. }
  88. /**
  89. * @group :
  90. * @ver : 2007.08.01
  91. * @by : 이은영
  92. * @---------------------------------------------------
  93. * @type : function
  94. * @access : public
  95. * @desc : 처방 선택 이동
  96. * @param :
  97. * @return :
  98. * @---------------------------------------------------
  99. */
  100. function fSendPrcpList(){
  101. var iCarePrcpRow = -1;
  102. var sPrcpCD = "";
  103. var sPrcpClsCD1 = "";
  104. var sPrcpClsCD2 = "";
  105. var sPrcpClsCD3 = "";
  106. var iPrcpClsCD1 = "";
  107. var iPrcpClsCD2 = "";
  108. var iPrcpClsCD3 = "";
  109. for(var iRow=grd_doctprcplist.fixedrows; iRow<=grd_doctprcplist.rows-grd_doctprcplist.fixedrows; iRow++){
  110. if(model.getValue(xDoctPrcpListPath+"["+iRow+"]/check") == "true"){
  111. sPrcpCD = model.getValue(xDoctPrcpListPath+"["+iRow+"]/prcpcd");
  112. model.setValue(xDoctPrcpListPath+"["+iRow+"]/check","false");
  113. if(model.getValue(xCarePrcpListPath+"[prcpcd ='"+sPrcpCD+"']/prcpcd") != "") continue;
  114. grd_careprcplist.addRow(false);
  115. iCarePrcpRow = grd_careprcplist.rows - grd_careprcplist.fixedrows;
  116. model.setValue(xCarePrcpListPath+"["+iCarePrcpRow+"]/prcpnm", model.getValue(xDoctPrcpListPath+"["+iRow+"]/prcpnm"));
  117. model.setValue(xCarePrcpListPath+"["+iCarePrcpRow+"]/prcpcd", model.getValue(xDoctPrcpListPath+"["+iRow+"]/prcpcd"));
  118. model.setValue(xCarePrcpListPath+"["+iCarePrcpRow+"]/instcd", model.getValue(xDoctPrcpListPath+"["+iRow+"]/instcd"));
  119. model.setValue(xCarePrcpListPath+"["+iCarePrcpRow+"]/deptcd", "all");
  120. model.setValue(xCarePrcpListPath+"["+iCarePrcpRow+"]/prcpclscd1", model.getValue(xDoctPrcpListPath+"["+iRow+"]/prcpclscd1"));
  121. model.setValue(xCarePrcpListPath+"["+iCarePrcpRow+"]/prcpclscd2", model.getValue(xDoctPrcpListPath+"["+iRow+"]/prcpclscd2"));
  122. model.setValue(xCarePrcpListPath+"["+iCarePrcpRow+"]/prcpclscd3", model.getValue(xDoctPrcpListPath+"["+iRow+"]/prcpclscd3"));
  123. model.setValue(xCarePrcpListPath+"["+iCarePrcpRow+"]/depth", 2);
  124. }
  125. }
  126. grd_careprcplist.refresh();
  127. }
  128. /**
  129. * @group :
  130. * @ver : 2007.08.06
  131. * @by : 이은영
  132. * @---------------------------------------------------
  133. * @type : function
  134. * @access : public
  135. * @desc : 간호setting 지시처방 삭제
  136. * @param :
  137. * @return :
  138. * @---------------------------------------------------
  139. */
  140. function fDelGridRow(){
  141. var sCheck = "";
  142. var sStatus = 0;
  143. var iRow = grd_careprcplist.row;
  144. sCheck = model.getValue(xCarePrcpListPath+"["+iRow+"]/check");
  145. if(sCheck == "true"){
  146. sStatus = grd_careprcplist.rowStatus(iRow);
  147. if(sStatus == 1 || sStatus == 3){
  148. grd_careprcplist.deleteRow(iRow,false);
  149. }else{
  150. grd_careprcplist.rowStatus(iRow)=4;
  151. }
  152. }else{
  153. grd_careprcplist.rowStatus(iRow)=0;
  154. }
  155. }
  156. /**
  157. * @group :
  158. * @ver : 2007.08.06
  159. * @by : 이은영
  160. * @---------------------------------------------------
  161. * @type : function
  162. * @access : public
  163. * @desc : 간호setting 지시처방 저장
  164. * @param :
  165. * @return :
  166. * @---------------------------------------------------
  167. */
  168. function fSave(){
  169. var sSaveData = grd_careprcplist.getUpdateData();
  170. if(getArrayData(sSaveData,1,4) == ""){
  171. messageBox("저장할 데이터가","I004");
  172. return;
  173. }
  174. model.removenode("/root/send");
  175. model.makeValue("/root/send/careprcplist",sSaveData);
  176. if(submit("TXMNR04801")){
  177. opener.javascript.setParameter("SMMNR04800_SaveFlag","Y");
  178. window.close();
  179. }
  180. }