SPMNR05000.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. /*
  2. SPMNR05000_간호Item 시간변경.xrw(SPMNR05000.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xPrcpInfoPath = "/root/main/prcpinfo";
  7. var xClsListPath = "/root/main/clsinfo/clslist";
  8. var xTimeListPath = "/root/main/timeinfo/timelist";
  9. var xSaveInfoPath = "/root/main/saveinfo";
  10. var sTimeColor = "#fcd2c1";
  11. var PageFlag = "";
  12. var sApntseqno = "";
  13. var sSelectRow = "";
  14. var sPrcpdd = "";
  15. var sPrcpno = "";
  16. var sPrcpHistNo = "";
  17. /**
  18. * @group :
  19. * @ver : 2007.08.08
  20. * @by : 이은영
  21. * @---------------------------------------------------
  22. * @type : function
  23. * @access : public
  24. * @desc : 화면 초기화
  25. * @param :
  26. * @return :
  27. * @---------------------------------------------------
  28. */
  29. function fInitialize(){
  30. var sParamMsg = "";
  31. var sApntTMSpecList=""; // 기준시간setting
  32. var sRemainder = 0; // 나머지
  33. var sCareItemCD = "";
  34. var sFlag = "";
  35. var iRow = 0;
  36. var sStatus = "";
  37. if(checkOpener()){
  38. submit("TRMNR04901");
  39. sParamMsg = opener.javascript.getParameter("SPMNR05000_Param");
  40. model.setValue( xPrcpInfoPath+"/prcpnm", getArrayData(sParamMsg,1,0));
  41. model.setValue( xPrcpInfoPath+"/prcpcd", getArrayData(sParamMsg,1,1));
  42. model.setValue( xPrcpInfoPath+"/careitemcd", getArrayData(sParamMsg,1,2));
  43. model.setValue( xPrcpInfoPath+"/apnttmspec", getArrayData(sParamMsg,1,3));
  44. model.setValue( xSaveInfoPath+"/apnttmspec", getArrayData(sParamMsg,1,3));
  45. model.setValue( xPrcpInfoPath+"/supcd", getArrayData(sParamMsg,1,4));
  46. sApntseqno = getArrayData(sParamMsg,1,6);
  47. PageFlag = getArrayData(sParamMsg,1,5);
  48. sStatus = getArrayData(sParamMsg,1,7);
  49. sSelectRow = getArrayData(sParamMsg,1,8);
  50. }
  51. fSearchItem();
  52. if(sStatus == "I"){
  53. if(PageFlag == "B"){
  54. ipt_prcpnm.disabled = false;
  55. }else{
  56. if(getArrayData(sParamMsg,1,4) != ""){
  57. cmb_itemcls.disabled = true;
  58. }
  59. }
  60. btn_change.disabled = true;
  61. }else{
  62. if(PageFlag == "B"){
  63. ipt_prcpnm.disabled = false;
  64. cmb_item.disabled = true;
  65. cmb_itemcls.disabled = true;
  66. }else{
  67. if(getArrayData(sParamMsg,1,4) != ""){
  68. cmb_itemcls.disabled = true;
  69. }
  70. if(getArrayData(sParamMsg,1,2) != "" && getArrayData(sParamMsg,1,2) != getArrayData(sParamMsg,1,4)){
  71. cmb_item.disabled = true;
  72. }
  73. }
  74. btn_add.disabled = true;
  75. }
  76. if(PageFlag == "B"){
  77. caption14.attribute("text") = "지시처방 직접입력";
  78. }else{
  79. sPrcpdd = getArrayData(sParamMsg,1,8);
  80. sPrcpno = getArrayData(sParamMsg,1,9);
  81. sPrcpHistNo = getArrayData(sParamMsg,1,10);
  82. }
  83. // 시간 세팅
  84. model.removenodeset(xTimeListPath);
  85. var i = 1;
  86. for(iRow=1; iRow<=4; iRow++){
  87. grd_timelist.addRow(false);
  88. for(var iCol=1; iCol<=6; iCol++){
  89. if(i == 24){
  90. i=0;
  91. }
  92. model.setValue(xTimeListPath+"["+iRow+"]/time"+iCol,i);
  93. i++;
  94. }
  95. }
  96. grd_timelist.rebuild();
  97. sApntTMSpecList = model.getValue(xPrcpInfoPath+"/apnttmspec");
  98. if( sApntTMSpecList != ""){
  99. var sApntTMSpec = sApntTMSpecList.split(",");
  100. for(i=0; i<sApntTMSpec.length; i++){
  101. sRemainder = eval(sApntTMSpec[i]) % 6;
  102. if(sRemainder == 0) sRemainder += 6;
  103. setCellStyle("grd_timelist","0",sApntTMSpec[i],"time"+sRemainder , "equal");
  104. }
  105. }
  106. model.refresh();
  107. }
  108. /**
  109. * @group :
  110. * @ver : 2007.08.08
  111. * @by : 이은영
  112. * @---------------------------------------------------
  113. * @type : function
  114. * @access : public
  115. * @desc : 그리드 클릭시
  116. * @param :
  117. * @return :
  118. * @---------------------------------------------------
  119. */
  120. function fClinckGridRow(){
  121. var iRow = grd_timelist.row;
  122. var iCol = grd_timelist.col;
  123. var sApntTMSpec = "";
  124. if(grd_timelist.cellStyle("background-color", iRow, iCol) == sTimeColor){
  125. grd_timelist.cellStyle("background-color", iRow, iCol) = "#ffffff";
  126. }else{
  127. grd_timelist.cellStyle("background-color", iRow, iCol) = sTimeColor;
  128. }
  129. for(var i = 1; i <= 4; i++){
  130. for(var j = 0; j < 6; j++){
  131. if(grd_timelist.cellStyle("background-color", i, j) == sTimeColor){
  132. if(sApntTMSpec == ""){
  133. sApntTMSpec = grd_timelist.labelmatrix(i,j);
  134. }else{
  135. sApntTMSpec += "," + grd_timelist.labelmatrix(i,j);
  136. }
  137. }
  138. }
  139. }
  140. model.setValue( xSaveInfoPath+"/apnttmspec", sApntTMSpec);
  141. grd_timelist.row = 0;
  142. grd_timelist.col = -1;
  143. model.refresh();
  144. }
  145. /**
  146. * @group :
  147. * @ver : 2007.08.08
  148. * @by : 이은영
  149. * @---------------------------------------------------
  150. * @type : function
  151. * @access : public
  152. * @desc : 간호Item 또는 시간 setting 초기화
  153. * @param : pFlag ( time : 시간setting, item : 간호 Item)
  154. * @return :
  155. * @---------------------------------------------------
  156. */
  157. function fClearGrid(){
  158. grd_timelist.allstyle( "all", "background-color" ) = "#FFFFFF";
  159. model.setValue( xSaveInfoPath+"/apnttmspec", "");
  160. model.refresh();
  161. }
  162. /**
  163. * @group :
  164. * @ver : 2007.08.08
  165. * @by : 이은영
  166. * @---------------------------------------------------
  167. * @type : function
  168. * @access : public
  169. * @desc : 간호Item 시간 Setting 전송
  170. * @param :
  171. * @return :
  172. * @---------------------------------------------------
  173. */
  174. function fSend(pFlag){
  175. var sApntTMSpec = model.getValue("/root/main/saveinfo/apnttmspec");
  176. var sCareItemCd = model.getValue("/root/main/prcpinfo/careitemcd");
  177. var sSupcd = model.getvalue("/root/main/prcpinfo/supcd");
  178. var sPrcpnm = model.getvalue("/root/main/prcpinfo/prcpnm");
  179. if(sApntTMSpec == ""){
  180. messageBox("시간을","C002");
  181. return;
  182. }
  183. if(sSupcd == ""){
  184. messageBox("간호 Item 분류를","C002");
  185. return;
  186. }
  187. var sCareItemNm = model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/itemnm");
  188. var sSupcdNm = model.getValue("/root/main/clsinfo/clslist[itemcd='"+sSupcd+"']/itemnm");
  189. if(PageFlag == "P"){
  190. var sReturnMsg = "flag▦careitemcd▦careitemnm▦apnttmspec▦supcd▦supnm▦apntflag▦prcpnm▦apntseqno▦rownum▦prcpdd▦prcpno▦prcphistno▩"+pFlag+"▦"+sCareItemCd+"▦"+sCareItemNm+"▦"+sApntTMSpec+"▦"+sSupcd+"▦"+sSupcdNm+"▦"+PageFlag+"▦"+"▦"+sApntseqno+"▦"+sSelectRow+"▦"+sPrcpdd+"▦"+sPrcpno+"▦"+sPrcpHistNo+"▩";
  191. var sReturnMsgItem = "careitemcd▦careitemnm▦supcd▦supnm▦clincobs▦intake▦output▦catheter▦careexec▦clincobsprcpyn▦cathprcpyn▦careexecprcpyn▦mainrecflag▦extyn▦itemorigincd▦instru▦instruprcpyn▦supsetno▩";
  192. sReturnMsgItem += sCareItemCd+"▦"+sCareItemNm+"▦"+sSupcd+"▦"+sSupcdNm+"▦"
  193. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/clincobs" )+"▦"
  194. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/intake" )+"▦"
  195. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/output" )+"▦"
  196. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/catheter" )+"▦"
  197. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/careexec" )+"▦"
  198. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/clincobsprcpyn" )+"▦"
  199. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/cathprcpyn" )+"▦"
  200. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/careexecprcpyn" )+"▦"
  201. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/mainrecflag" )+"▦"
  202. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/extyn" )+"▦"
  203. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/itemorigincd" )+"▦"
  204. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/instru" )+"▦"
  205. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/instruprcpyn" )+"▦"
  206. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/supsetno" )+"▩";
  207. opener.javascript.setParameter("SPMNR05000_Return",sReturnMsg);
  208. opener.javascript.setParameter("SPMNR05000_ReturnItem",sReturnMsgItem);
  209. window.close();
  210. }else{
  211. var sReturnMsg = "flag▦careitemcd▦careitemnm▦apnttmspec▦supcd▦supnm▦apntflag▦prcpnm▦apntseqno▦rownum▦prcpdd▦prcpno▦prcphistno▩"+pFlag+"▦"+sCareItemCd+"▦"+sCareItemNm+"▦"+sApntTMSpec+"▦"+sSupcd+"▦"+sSupcdNm+"▦"+PageFlag+"▦"+sPrcpnm+"▦"+sApntseqno+"▦"+sSelectRow+"▦"+"▦"+"▦"+"▩";
  212. var sReturnMsgItem = "careitemcd▦careitemnm▦supcd▦supnm▦clincobs▦intake▦output▦catheter▦careexec▦clincobsprcpyn▦cathprcpyn▦careexecprcpyn▦mainrecflag▦extyn▦itemorigincd▦instru▦instruprcpyn▦supsetno▩";
  213. sReturnMsgItem += sCareItemCd+"▦"+sCareItemNm+"▦"+sSupcd+"▦"+sSupcdNm+"▦"
  214. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/clincobs" )+"▦"
  215. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/intake" )+"▦"
  216. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/output" )+"▦"
  217. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/catheter" )+"▦"
  218. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/careexec" )+"▦"
  219. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/clincobsprcpyn" )+"▦"
  220. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/cathprcpyn" )+"▦"
  221. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/careexecprcpyn" )+"▦"
  222. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/mainrecflag" )+"▦"
  223. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/extyn" )+"▦"
  224. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/itemorigincd" )+"▦"
  225. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/instru" )+"▦"
  226. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/instruprcpyn" )+"▦"
  227. + model.getValue("/root/main/iteminfo/itemlist[itemcd='"+sCareItemCd+"']/supsetno" )+"▩";
  228. opener.javascript.setParameter("SPMNR05000_Return",sReturnMsg);
  229. opener.javascript.setParameter("SPMNR05000_ReturnItem",sReturnMsgItem);
  230. window.close();
  231. }
  232. }
  233. /**
  234. * @group :
  235. * @ver : 2007.08.08
  236. * @by : 이은영
  237. * @---------------------------------------------------
  238. * @type : function
  239. * @access : public
  240. * @desc : Interval지정 시간 계산
  241. * @param :
  242. * @return :
  243. * @---------------------------------------------------
  244. */
  245. function fIntervalCalculate(){
  246. grd_timelist.allstyle( "all", "background-color" ) = "#FFFFFF";
  247. var time = Number(model.getValue("/root/main/cond/time"));
  248. var interval = Number(model.getValue("/root/main/cond/interval"));
  249. if(time > 24 || time < 0){
  250. messageBox("시작시간 설정이 잘 못 되었습니다.", "I");
  251. model.setFocus("ipt_time");
  252. return;
  253. }
  254. if(interval < 1 || interval > 24){
  255. messageBox("Interval 설정이 잘 못 되었습니다.", "I");
  256. model.setFocus("ipt_interval");
  257. return;
  258. }
  259. if(time == 24){
  260. time = 0;
  261. }
  262. var curtime = time;
  263. var sApntTMSpecList = "";
  264. var cnt = 0;
  265. var sRemainder = "";
  266. while(curtime <= 24){
  267. if(cnt == 0){
  268. if(curtime == 24){
  269. sApntTMSpecList += "0";
  270. }else{
  271. sApntTMSpecList += curtime.toString();
  272. }
  273. }else{
  274. if(curtime == 24){
  275. if(time != 0 ){
  276. sApntTMSpecList += ",0";
  277. }
  278. }else{
  279. sApntTMSpecList += "," + curtime.toString();
  280. }
  281. }
  282. curtime += interval;
  283. cnt++;
  284. }
  285. if( sApntTMSpecList != ""){
  286. var sApntTMSpec = sApntTMSpecList.split(",");
  287. for(i=0; i<sApntTMSpec.length; i++){
  288. sRemainder = eval(sApntTMSpec[i]) % 6;
  289. if(sRemainder == 0) sRemainder += 6;
  290. setCellStyle("grd_timelist","0",sApntTMSpec[i],"time"+sRemainder , "equal");
  291. }
  292. }
  293. model.setValue(xSaveInfoPath + "/apnttmspec", sApntTMSpecList);
  294. model.refresh();
  295. }
  296. /**
  297. * @group :
  298. * @ver : 2008.06.10
  299. * @by : 양천덕
  300. * @---------------------------------------------------
  301. * @type : function
  302. * @access : public
  303. * @desc : 분류별 Item List 조회
  304. * @param :
  305. * @return :
  306. * @---------------------------------------------------
  307. */
  308. function fSearchItem(){
  309. model.makeValue("/root/send/itemcd" , cmb_itemcls.value );
  310. submit("TRMNR05001");
  311. }