SPMNR05900.xjs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[/*
  3. ITEM전체조회(SPMNR05900.xfm - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. */
  7. var sDelItemCd = "";
  8. var sDelItemIdex = "";
  9. var sDelRow = "";
  10. var sDelCol = "";
  11. var screenX;
  12. var screenY;
  13. //화면 초기화
  14. function fInitialize()
  15. {
  16. var sSetItemInfo = "";
  17. var sSetItemInfoList = "";
  18. ds_totalitem_setlist.clearData();
  19. ds_duplchoiitemlist_duplchoiitem.clearData();
  20. ds_patsetitemlist.clearData();
  21. sSetItemInfo = opener.frmf_getParameter("SPMNR05900_ParamPat");
  22. ds_cond.setColumn(0, "pid" , lf_getArrayData(sSetItemInfo, 1, 0, "▩", "▦"));
  23. ds_cond.setColumn(0, "orddd" , lf_getArrayData(sSetItemInfo, 1, 1, "▩", "▦"));
  24. ds_cond.setColumn(0, "cretno" , lf_getArrayData(sSetItemInfo, 1, 2, "▩", "▦"));
  25. var oParam = {};
  26. oParam.id = "TRMNR05901_SJH";
  27. oParam.service = "carerecapp.RecItemMngt";
  28. oParam.method = "reqGetTotalItemList";
  29. oParam.inds = "reqCond=ds_cond";
  30. oParam.outds = "ds_totalitem_itemlist=itemlist ds_totalitem_setlist=setlist";
  31. oParam.async = false;
  32. tranf_submit(oParam);
  33. if( utlf_isNull(ds_totalitem_itemlist.getColumnInfo("choiyn")) ){
  34. ds_totalitem_itemlist.addColumn("choiyn", "string");
  35. }
  36. //ITEM LIST 세팅 func 호출
  37. fSettingItemList();
  38. //환자별 세팅 화면의 설정 데이터 체크 func 호출
  39. fSettingPatItemChk();
  40. //ITEM LIST Style 적용 func 호출
  41. fSettingStyle();
  42. }
  43. //ITEM LIST 세팅
  44. function fSettingItemList()
  45. {
  46. var j = 0;
  47. var i = 0;
  48. var k = 1;
  49. var sGridWith = 0;
  50. var sColWith = 0;
  51. for(var tRow = 0; tRow < ds_totalitem_itemlist.rowcount; tRow++)
  52. {
  53. /* 분류별 리스트 조회 (행변환없음) */
  54. if(ds_totalitem_itemlist.getColumn(tRow, "supcd") == "*")
  55. {
  56. if(tRow != 0)
  57. {
  58. i = 0;
  59. j++;
  60. }
  61. var colID = "itemnm" + eval(j);
  62. ds_itemtotallist_itemtotalinfo.addColumn("colBack"+j, "string");
  63. grp_biz.grd_itemlist.insertContentsCol("body", j);
  64. grp_biz.grd_itemlist.setFormatColProperty(j, "size", 160);
  65. grp_biz.grd_itemlist.setCellProperty("Head", j, "text", ds_totalitem_itemlist.getColumn(tRow, "itemnm"));
  66. grp_biz.grd_itemlist.setCellProperty("body", j, "text", "bind:" + colID);
  67. grp_biz.grd_itemlist.setCellProperty("body", j, "background", "EXPR(colBack"+j+")");
  68. grp_biz.grd_itemlist.setCellProperty("body", j, "background2", "EXPR(colBack"+j+")");
  69. grp_biz.grd_itemlist.scrollpixel = "all";
  70. }
  71. else
  72. {
  73. dsf_makeValue(ds_itemtotallist_itemtotalinfo, "itemnm" + eval(j), "string", ds_totalitem_itemlist.getColumn(tRow, "itemnm"), i);
  74. dsf_makeValue(ds_itemtotallist_itemtotalinfo, "itemindex" + eval(j), "string", tRow, i);
  75. i++;
  76. }
  77. }
  78. grp_biz.grd_itemlist.position2 = "absolute l:0 w:1190 t:0 h:721";
  79. }
  80. //환자별 세팅 화면의 기 선택 데이터 체크
  81. function fSettingPatItemChk()
  82. {
  83. var ChkRow = opener.ds_patsetting_patiteminfo_patitemlist.rowcount;
  84. if(ChkRow < 1)
  85. {
  86. return;
  87. }
  88. else
  89. {
  90. for(var i = 0 ; i < ChkRow ; i++)
  91. {
  92. sItemCd = opener.ds_patsetting_patiteminfo_patitemlist.getColumn(i, "itemcd");
  93. if(!utlf_isNull(ds_totalitem_itemlist.lookup("itemcd", sItemCd, "itemcd")))
  94. {
  95. ds_totalitem_itemlist.filter("itemcd == '"+ sItemCd +"'");
  96. ds_totalitem_itemlist.setColumn(0, "insyn", "Y");
  97. ds_totalitem_itemlist.filter("");
  98. }
  99. }
  100. }
  101. }
  102. //ITEM LIST Style 적용
  103. function fSettingStyle()
  104. {
  105. var ExprArray = new Array(ds_itemtotallist_itemtotalinfo.colcount / 3);
  106. var ExprArrayImage = new Array(ds_itemtotallist_itemtotalinfo.colcount / 3);
  107. var ExprArrayImage2 = new Array(ds_itemtotallist_itemtotalinfo.colcount / 3);
  108. for(var iRow = 0 ; iRow < ds_itemtotallist_itemtotalinfo.rowcount; iRow++)
  109. {
  110. for(var iCol = 0 ; iCol < grp_biz.grd_itemlist.getCellCount("Body")-1 ; iCol++ )
  111. {
  112. var sItemIndex = ds_itemtotallist_itemtotalinfo.getColumn(iRow, "itemindex"+iCol);
  113. if(!utlf_isNull(sItemIndex))
  114. {
  115. if(ds_totalitem_itemlist.getColumn(sItemIndex, "supcd") == "*")
  116. {
  117. if(utlf_isNull(ExprArray[iCol]))
  118. {
  119. ExprArray[iCol] = "EXPR(";
  120. }
  121. ds_itemtotallist_itemtotalinfo.setColumn(iRow, "colBack"+iCol, "#b7daff");
  122. //ExprArray[iCol] += "currow == " + iRow + " ? '#b7daff' : ";
  123. }
  124. if(ds_totalitem_itemlist.getColumn(sItemIndex, "insyn") == "Y")
  125. {
  126. if(iCol ==0){
  127. ExprArray[iCol] = "EXPR(";
  128. }
  129. if(utlf_isNull(ExprArray[iCol]))
  130. {
  131. ExprArray[iCol] = "EXPR(";
  132. }
  133. ds_itemtotallist_itemtotalinfo.setColumn(iRow, "colBack"+iCol, "#b7f9aa");
  134. //ExprArray[iCol] += "currow == " + iRow + " ? '#b7f9aa' : ";
  135. }
  136. if(!utlf_isNull(ds_totalitem_itemlist.getColumn(sItemIndex, "supsetno")))
  137. {
  138. if(utlf_isNull(ExprArrayImage[iCol]))
  139. {
  140. ExprArrayImage[iCol] = "EXPR(";
  141. }
  142. ExprArrayImage[iCol] += "currow == " + iRow + " ? 'show' : ";
  143. if(utlf_isNull(ExprArrayImage2[iCol]))
  144. {
  145. ExprArrayImage2[iCol] = "EXPR(";
  146. }
  147. //ExprArrayImage2[iCol] += "currow == " + iRow + " ? '../../../com/commonxp/images/input_s_essential.gif' : ";
  148. ExprArrayImage2[iCol] += "currow == " + iRow + " ? 'IMG::com/input_s_essential.png' : ";
  149. //IMG::com/input_s_essential.png
  150. }else if(ds_totalitem_itemlist.getColumn(sItemIndex, "extyn") == "Y")
  151. {
  152. if(utlf_isNull(ExprArrayImage[iCol]))
  153. {
  154. ExprArrayImage[iCol] = "EXPR(";
  155. }
  156. ExprArrayImage[iCol] += "currow == " + iRow + " ? 'show' : ";
  157. if(utlf_isNull(ExprArrayImage2[iCol]))
  158. {
  159. ExprArrayImage2[iCol] = "EXPR(";
  160. }
  161. //ExprArrayImage2[iCol] += "currow == " + iRow + " ? '../../../com/commonxp/images/input_essential.gif' : ";
  162. ExprArrayImage2[iCol] += "currow == " + iRow + " ? 'IMG::com/input_essential.png' : ";
  163. //IMG::emr/MR/input_essential.png
  164. }
  165. }
  166. }
  167. }
  168. for(var i = 0 ; i < grp_biz.grd_itemlist.getCellCount("Body") ;i++)
  169. {
  170. grp_biz.grd_itemlist.setCellProperty("Body", i, "align", "'left'");
  171. if (!utlf_isNull(ExprArray[i]) && ExprArray[i].length > 7)
  172. {
  173. ExprArray[i] += "'')";
  174. // grp_biz.grd_itemlist.setCellProperty("Body", i, "background", ExprArray[i]);
  175. // grp_biz.grd_itemlist.setCellProperty("Body", i, "background2", ExprArray[i]);
  176. }
  177. if (!utlf_isNull(ExprArrayImage[i]) && ExprArrayImage[i].length > 7)
  178. {
  179. ExprArrayImage[i] += "'')";
  180. grp_biz.grd_itemlist.setCellProperty("Body", i, "expandshow", ExprArrayImage[i]);
  181. }
  182. if (!utlf_isNull(ExprArrayImage2[i]) && ExprArrayImage2[i].length > 7)
  183. {
  184. ExprArrayImage2[i] += "'')";
  185. grp_biz.grd_itemlist.setCellProperty("Body", i, "expandimage", ExprArrayImage2[i]);
  186. }
  187. }
  188. //grd_itemlist.frozenRows = 1;
  189. }
  190. //마우스 더블 클릭시 데이터 임시 설정
  191. function fSelectionItem(pFlag, pRow, pCol)
  192. {
  193. iRow = 0;
  194. iCol = 0;
  195. iIndexCol = 0;
  196. if ( pFlag == "search" )
  197. {
  198. iRow = pRow;
  199. iCol = pCol;
  200. iIndexCol = (eval(pCol) * 3 + 2);//(eval(pCol) + 1);
  201. }
  202. else
  203. {
  204. iRow = grp_biz.grd_itemlist.currentrow;
  205. iCol = grp_biz.grd_itemlist.currentcol;
  206. iIndexCol = eval(grp_biz.grd_itemlist.currentcol) * 3 + 2;
  207. }
  208. //var sColNm = grd_itemlist.colAttribute(iCol, "ref");
  209. var sIndexInfo = ds_itemtotallist_itemtotalinfo.getColumn(iRow, iIndexCol);
  210. if(iRow < 0 || utlf_isNull(sIndexInfo))
  211. {
  212. return;
  213. }
  214. var sItemCd = ds_totalitem_itemlist.getColumn(sIndexInfo, "itemcd");
  215. var sRtrnMsg = "";
  216. if(utlf_isNull(sItemCd))
  217. {
  218. return;
  219. }
  220. //기록구분, 확장항목여부, 저장여부, 중복선택여부
  221. var sMainRecFlag = ds_totalitem_itemlist.getColumn(sIndexInfo, "mainrecflag");
  222. var sExtYn = ds_totalitem_itemlist.getColumn(sIndexInfo, "extyn");
  223. var sInsYn = ds_totalitem_itemlist.getColumn(sIndexInfo, "insyn");
  224. var sChoiYn = ds_totalitem_itemlist.getColumn(sIndexInfo, "choiyn");
  225. var sLnkBizCd = ds_totalitem_itemlist.getColumn(sIndexInfo, "lnkbizcd");
  226. //기 선택 및 환자세팅 항목일 경우
  227. if(sInsYn == "Y" || sChoiYn == "Y" )
  228. {
  229. //확장항목일 경우
  230. if(sExtYn == "Y" && sMainRecFlag == "B")
  231. {
  232. fSettingParam("duplextitem", sItemCd, sIndexInfo);
  233. //기구 및 삽관기록 주체일 경우
  234. }
  235. else if(sMainRecFlag == "D" || sMainRecFlag == "G" || (sMainRecFlag == "E" && sExtYn == "Y"))
  236. {
  237. fSettingParam("dupllocitem", sItemCd, sIndexInfo);
  238. }
  239. else
  240. {
  241. sysf_messageBox("이미등록된 아이템","E008");
  242. return;
  243. }
  244. //기 선택 및 환자세팅 항목이 아닐 경우
  245. }
  246. else
  247. {
  248. //확장항목일 경우
  249. if(sExtYn == "Y" || sMainRecFlag == "D" || sMainRecFlag == "G"){
  250. var sParamFlag = "locitem";
  251. if( (sExtYn == "Y" && sMainRecFlag == "E") || sMainRecFlag == "D" || sMainRecFlag == "G" )
  252. {
  253. sParamFlag = "locitem";
  254. }
  255. else
  256. {
  257. sParamFlag = "extitem";
  258. }
  259. if(fSettingParam(sParamFlag, sItemCd, sIndexInfo) == true)
  260. {
  261. dsf_makeValue(ds_totalitem_itemlist, "choiyn", "string", "Y", sIndexInfo);
  262. var expr = grp_biz.grd_itemlist.getCellProperty("Body", iCol, "background");
  263. if(expr.length > 7)
  264. {
  265. expr = expr.replace("'')", "");
  266. ds_itemtotallist_itemtotalinfo.setColumn(iRow, "colBack"+iCol, "#f4a6ee");
  267. //expr += "currow == " + iRow + " ? '#f4a6ee' : ";
  268. expr += "'')";
  269. }
  270. else
  271. {
  272. expr = "EXPR(";
  273. ds_itemtotallist_itemtotalinfo.setColumn(iRow, "colBack"+iCol, "#f4a6ee");
  274. //expr += "currow == " + iRow + " ? '#f4a6ee' : ";
  275. expr += "'')";
  276. }
  277. // grp_biz.grd_itemlist.setCellProperty("Body", iCol, "background", expr);
  278. // grp_biz.grd_itemlist.setCellProperty("Body", iCol, "background2", expr);
  279. //grd_itemlist.cellStyle("background-color", iRow, iCol, iRow, iCol) = "#f4a6ee";
  280. //grd_itemlist.focusColor = "#f4a6ee";
  281. }
  282. else
  283. {
  284. fParamInit();
  285. }
  286. }
  287. else
  288. {
  289. dsf_makeValue(ds_totalitem_itemlist, "choiyn", "string", "Y", sIndexInfo);
  290. var expr = grp_biz.grd_itemlist.getCellProperty("Body", iCol, "background");
  291. if(expr.length > 7)
  292. {
  293. expr = expr.replace("'')", "");
  294. ds_itemtotallist_itemtotalinfo.setColumn(iRow, "colBack"+iCol, "#f4a6ee");
  295. //expr += "currow == " + iRow + " ? '#f4a6ee' : ";
  296. expr += "'')";
  297. }
  298. else
  299. {
  300. expr = "EXPR(";
  301. ds_itemtotallist_itemtotalinfo.setColumn(iRow, "colBack"+iCol, "#f4a6ee");
  302. //expr += "currow == " + iRow + " ? '#f4a6ee' : ";
  303. expr += "'')";
  304. }
  305. // grp_biz.grd_itemlist.setCellProperty("Body", iCol, "background", expr);
  306. // grp_biz.grd_itemlist.setCellProperty("Body", iCol, "background2", expr);
  307. //grd_itemlist.cellStyle("background-color", iRow, iCol, iRow, iCol) = "#f4a6ee";
  308. //grd_itemlist.focusColor = "#f4a6ee";
  309. fSettingChoiItem(sItemCd, "", sIndexInfo);
  310. }
  311. }
  312. ds_itemtotallist_itemtotalinfo.rowposition = -1;
  313. }
  314. //중복입력 Paramter 설정
  315. function fSettingParam(pFlag, pItemCd, pIndex)
  316. {
  317. /**
  318. <addon>
  319. *개발일시: 2010.03.04
  320. *개발자: 양천덕
  321. *요청병원: 세종병원
  322. *요청파트: 간호
  323. *개발내용: 수액 항목 입력 화면 호출에 따른 변경 작업
  324. </addon>
  325. */
  326. var rtnVal = false;
  327. var sPid = ds_cond.getColumn(0, "pid");
  328. var sOrddd = ds_cond.getColumn(0, "orddd");
  329. var sCretno = ds_cond.getColumn(0, "cretno");
  330. var sParamMsg = "";
  331. var sParamMsgFlag = "";
  332. var sParamMsgHeader ="";
  333. var sItemNm = ds_totalitem_itemlist.lookup("itemcd", pItemCd, "itemnm");
  334. var sItemLnkBizCd = ds_totalitem_itemlist.lookup("itemcd", pItemCd, "lnkbizcd");
  335. sParamMsgHeader = "itemcd▦itemnm▦chngitemnm▩";
  336. sParamMsg = "";
  337. sParamMsgFlag = "flag▦itemcd▦itemnm▦pid▦orddd▦cretno▦lnkbizcd▩"
  338. + pFlag+"▦"+pItemCd+"▦"+sItemNm+"▦"+sPid+"▦"+sOrddd+"▦"+sCretno+"▦"+sItemLnkBizCd+"▩";
  339. if(pFlag == "duplextitem" || pFlag == "dupllocitem")
  340. {
  341. for(var i = 0 ; i < opener.ds_patsetting_patiteminfo_patitemlist.rowcount; i ++)
  342. {
  343. if(opener.ds_patsetting_patiteminfo_patitemlist.getColumn(i, "itemcd") == pItemCd)
  344. {
  345. sParamMsg += utlf_transNullToEmpty(pItemCd) +"▦"
  346. + utlf_transNullToEmpty(opener.ds_patsetting_patiteminfo_patitemlist.getColumn(i, "itemnm")) + "▦"
  347. + utlf_transNullToEmpty(opener.ds_patsetting_patiteminfo_patitemlist.getColumn(i, "chngitemnm")) + "▩" ;
  348. }
  349. }
  350. /*
  351. for(var i = 0 ; i < ds_patsetitemlist_patitemlist.rowcount; i ++)
  352. {
  353. if(ds_patsetitemlist_patitemlist.getColumn(i, "itemcd") == pItemCd)
  354. {
  355. sParamMsg += pItemCd +"▦"
  356. + ds_patsetitemlist_patitemlist.getColumn(i, "itemnm") + "▦"
  357. + ds_patsetitemlist_patitemlist.getColumn(i, "chngitemnm") + "▩" ;
  358. }
  359. }
  360. */
  361. for(var i = 0 ; i < ds_duplchoiitemlist_duplchoiitem.rowcount; i ++)
  362. {
  363. if(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "itemcd") == pItemCd)
  364. {
  365. sParamMsg += utlf_transNullToEmpty(pItemCd) +"▦"
  366. + utlf_transNullToEmpty(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "itemnm")) + "▦"
  367. + utlf_transNullToEmpty(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "chngitemnm")) + "▩" ;
  368. }
  369. }
  370. }
  371. sysf_trace(sParamMsg);
  372. frmf_setParameter("SPMNR06000_ParamFlag", sParamMsgFlag);
  373. if(!utlf_isNull(sParamMsg))
  374. {
  375. frmf_setParameter("SPMNR06000_Param", sParamMsgHeader+sParamMsg);
  376. }
  377. trace("sItemLnkBizCd ================== " + sItemLnkBizCd)
  378. if(sItemLnkBizCd == "12")
  379. {
  380. //modal("SPMNR06001");
  381. //수정
  382. frmf_modal("SPMNR06001", "SPMNR06001", "", null, "", "", "", null, null, null, null, null, "M");
  383. }
  384. else
  385. {
  386. //modal("SPMNR06000");
  387. //수정
  388. frmf_modal("SPMNR06000", "SPMNR06000", "", null, "", "", "", null, null, null, null, null, "M");
  389. }
  390. sRtrnMsg = frmf_getParameter("SPMNR06000_RtrnParam");
  391. if(utlf_isNull(sRtrnMsg))
  392. {
  393. rtnVal = false;
  394. }
  395. else
  396. {
  397. if(sRtrnMsg == "&empty")
  398. {
  399. sRtrnMsg = "";
  400. }
  401. rtnVal = true;
  402. fSettingChoiItem(pItemCd, sRtrnMsg, pIndex);
  403. }
  404. return rtnVal;
  405. }
  406. //설정 Item Node에 반영
  407. function fSettingChoiItem(pItem, pName, pIndex)
  408. {
  409. InsRow = ds_duplchoiitemlist_duplchoiitem.rowcount;
  410. ds_duplchoiitemlist_duplchoiitem.addRow();
  411. ds_duplchoiitemlist_duplchoiitem.copyRow(InsRow, ds_totalitem_itemlist, pIndex);
  412. //model.copyNode("/root/main/duplchoiitemlist/duplchoiitem["+InsRow+"]", "/root/main/totalitem/itemlist["+pIndex+"]");
  413. dsf_makeValue(ds_duplchoiitemlist_duplchoiitem, "chngitemnm", "string", lf_getArrayData(pName, 0, 0, "▩", "▦"), InsRow);
  414. dsf_makeValue(ds_duplchoiitemlist_duplchoiitem, "recfluidunit", "string", lf_getArrayData(pName, 0, 1, "▩", "▦"), InsRow);
  415. fParamInit();
  416. }
  417. //Parameter 초기화 부분
  418. function fParamInit()
  419. {
  420. frmf_clearParameter("SPMNR06000_Param");
  421. frmf_clearParameter("SPMNR06000_ParamFlag");
  422. frmf_clearParameter("SPMNR06000_RtrnParam");
  423. }
  424. //Setting Item 삭제
  425. function fPopupDelItem()
  426. {
  427. var GridExpr = "";
  428. sDelItemCd = "";
  429. sDelRow = "";
  430. sDelCol = "";
  431. sCnt = 0;
  432. sDelRow = grp_biz.grd_itemlist.currentrow;
  433. sDelCol = grp_biz.grd_itemlist.currentcol;
  434. iIndexCol = eval(sDelCol) * 3 + 2;
  435. if(sDelRow > -1 && !utlf_isNull(iIndexCol))
  436. {
  437. var sIndexInfo = ds_itemtotallist_itemtotalinfo.getColumn(sDelRow, iIndexCol);
  438. GridExpr = grp_biz.grd_itemlist.getCellProperty("Body", sDelCol, "background");
  439. // if(!utlf_isNull(GridExpr) && GridExpr.length > 5)
  440. // {
  441. if( (ds_itemtotallist_itemtotalinfo.getColumn(sDelRow, "colBack"+sDelCol) == "#f4a6ee" ||//GridExpr.indexOf("currow == " + sDelRow + " ? '#f4a6ee' : ") > -1 ||
  442. ds_itemtotallist_itemtotalinfo.getColumn(sDelRow, "colBack"+sDelCol) == "#b7f9aa") &&//GridExpr.indexOf("currow == " + sDelRow + " ? '#b7f9aa' : ") > -1) &&
  443. !utlf_isNull(sIndexInfo) )
  444. {
  445. sDelItemCd = ds_totalitem_itemlist.getColumn(sIndexInfo, "itemcd");
  446. //추가선택 중 여러개 등록 가능한 아이템 존재시
  447. for(var i = 0 ; i < ds_duplchoiitemlist_duplchoiitem.rowcount; i ++)
  448. {
  449. if(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "itemcd") == sDelItemCd )
  450. {
  451. sCnt++;
  452. }
  453. }
  454. if(sCnt > 1 )
  455. {
  456. pop_grd_itemlist.trackPopup(screenX, screenY);
  457. }
  458. else if(ds_itemtotallist_itemtotalinfo.getColumn(sDelRow, "colBack"+sDelCol) == "#b7f9aa" && sCnt > 0)//GridExpr.indexOf("currow == " + sDelRow + " ? '#b7f9aa' : ") > -1 && sCnt > 0)
  459. {
  460. pop_grd_itemlist.trackPopup(screenX, screenY);
  461. }
  462. else if(sCnt == 1)
  463. {
  464. pop_grd_itemlist2.trackPopup(screenX, screenY);
  465. }
  466. else
  467. {
  468. sDelItemCd = "";
  469. sDelRow = "";
  470. sDelCol = "";
  471. }
  472. }
  473. //}
  474. else
  475. {
  476. sDelItemCd = "";
  477. sDelRow = "";
  478. sDelCol = "";
  479. }
  480. }
  481. else
  482. {
  483. //window.setPopupMenu(false);
  484. sDelItemCd = "";
  485. sDelRow = "";
  486. sDelCol = "";
  487. }
  488. }
  489. //Setting Item 삭제(다중 세팅 아이템)
  490. function fDelItemList()
  491. {
  492. var msg = sysf_messageBox("여러 개의 설정 아이템이 존재합니다.\n단 등록 및 기 선택된 아이템은 해제되지 않습니다.\n계속", "Q004");//실행 하시겠습니까? yes=6, no=7
  493. if(Number(msg) == 6)//예
  494. {
  495. sCnt = 0 ;
  496. for(var i = ds_duplchoiitemlist_duplchoiitem.rowcount - 1; i >= 0 ; i--)
  497. {
  498. if(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "itemcd") == sDelItemCd )
  499. {
  500. ds_duplchoiitemlist_duplchoiitem.deleteRow(i);
  501. }
  502. }
  503. var GridExpr = grp_biz.grd_itemlist.getCellProperty("Body", sDelCol, "background");
  504. if(ds_itemtotallist_itemtotalinfo.getColumn(sDelRow, "colBack"+sDelCol) == "#f4a6ee")//GridExpr.indexOf("currow == " + sDelRow + " ? '#f4a6ee' : ") > -1)
  505. {
  506. ds_totalitem_itemlist.filter("itemcd == '" + sDelItemCd + "'");
  507. ds_totalitem_itemlist.setColumn(0, "choiyn", "N");
  508. ds_totalitem_itemlist.filter("");
  509. ds_itemtotallist_itemtotalinfo.setColumn(sDelRow, "colBack"+sDelCol, "");
  510. // GridExpr = GridExpr.replace("currow == " + sDelRow + " ? '#f4a6ee' : ", "");
  511. // grp_biz.grd_itemlist.setCellProperty("Body", sDelCol, "background", GridExpr);
  512. // grp_biz.grd_itemlist.setCellProperty("Body", sDelCol, "background2", GridExpr);
  513. //grd_itemlist.cellStyle("background-color", sDelRow, sDelCol, sDelRow, sDelCol) = "#ffffff";
  514. }
  515. sDelItemCd = "";
  516. sDelRow = "";
  517. sDelCol = "";
  518. grp_biz.grd_itemlist.currentcol = sDelCol+1;
  519. }
  520. }
  521. //Setting Item 삭제(싱글 세팅 아이템)
  522. function fDelItem()
  523. {
  524. sCnt = 0 ;
  525. var GridExpr = grp_biz.grd_itemlist.getCellProperty("Body", sDelCol, "background");
  526. for(var i = ds_duplchoiitemlist_duplchoiitem.rowcount - 1; i >= 0 ; i --)
  527. {
  528. if(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "itemcd") == sDelItemCd )
  529. {
  530. ds_duplchoiitemlist_duplchoiitem.deleteRow(i);
  531. ds_itemtotallist_itemtotalinfo.setColumn(sDelRow, "colBack"+sDelCol, "");
  532. // GridExpr = GridExpr.replace("currow == " + sDelRow + " ? '#f4a6ee' : ", "");
  533. // grp_biz.grd_itemlist.setCellProperty("Body", sDelCol, "background", GridExpr);
  534. // grp_biz.grd_itemlist.setCellProperty("Body", sDelCol, "background2", GridExpr);
  535. }
  536. }
  537. ds_totalitem_itemlist.filter("itemcd == '" + sDelItemCd + "'");
  538. ds_totalitem_itemlist.setColumn(0, "choiyn", "N");
  539. ds_totalitem_itemlist.filter("");
  540. sDelItemCd = "";
  541. sDelRow = "";
  542. sDelCol = "";
  543. grp_biz.grd_itemlist.col = sDelCol+1;
  544. ds_itemtotallist_itemtotalinfo.rowposition = -1;
  545. }
  546. //open search
  547. function fOpenSearch()
  548. {
  549. grp_search.visible = true;
  550. grp_biz.position2 = "absolute l:0 w:1300 t:45 h:740";
  551. grp_biz.grd_itemlist.position2 = "absolute l:0 w:1030 t:0 h:720";
  552. grp_search.ipt_searchnm.setFocus();
  553. }
  554. //item search
  555. function fSearchItem()
  556. {
  557. var itemcd ="";
  558. ds_send.copyData(ds_cond);
  559. dsf_makeValue(ds_send, "srchflag", "string", "G");
  560. if ( utlf_isNull(ds_cond.getColumn(0, "itemnm")) || ds_cond.getColumn(0, "itemnm").length < 2)
  561. {
  562. sysf_messageBox("검색하고자 하는 아이템명을 2자 이상 ","C001");
  563. return;
  564. }
  565. var oParam = {};
  566. oParam.id = "TRMNR05902";
  567. oParam.service = "carerecapp.RecItemMngt";
  568. oParam.method = "reqGetItemSrcList";
  569. oParam.inds = "iteminfo=ds_cond";
  570. oParam.outds = "ds_searchinfo_itemlist=itemlist";
  571. oParam.async = false;
  572. oParam.callback = "cf_TRMNR05902";
  573. tranf_submit(oParam);
  574. }
  575. function cf_TRMNR05902(sSvcId, nErrorCode, sErrorMsg)
  576. {
  577. if(nErrorCode < 0) return;
  578. var strExpr = "EXPR(";
  579. ds_searchinfo_itemlist.addColumn("colBack"+0, "string");
  580. for( var idx = 0 ; idx < ds_searchinfo_itemlist.rowcount ; idx++ )
  581. {//ds_searchinfo_itemlist
  582. if ( ds_searchinfo_itemlist.getColumn(idx, "depth") > "1" )
  583. {
  584. itemcd = ds_searchinfo_itemlist.getColumn(idx, "itemcd");
  585. if ( utlf_isNull(opener.ds_patsetting_patiteminfo_patitemlist.lookup("itemcd", itemcd, "itemcd")) )
  586. {
  587. ds_searchinfo_itemlist.setColumn(idx, "colBack"+0, "");
  588. //strExpr += "currow == " + idx + " ? '#FFFFFF' : ";
  589. }
  590. else
  591. {
  592. ds_searchinfo_itemlist.setColumn(idx, "colBack"+0, "#b7f9aa");
  593. //strExpr += "currow == " + idx + " ? '#b7f9aa' : ";
  594. }
  595. }
  596. else
  597. {
  598. ds_searchinfo_itemlist.setColumn(idx, "colBack"+0, "#b7daff");
  599. //strExpr += "currow == " + idx + " ? '#b7daff' : ";
  600. }
  601. }
  602. if(strExpr.length > 7)
  603. {
  604. strExpr += "'')";
  605. // grp_search.grd_srchitem.setCellProperty("Body", 0, "background", strExpr);
  606. // grp_search.grd_srchitem.setCellProperty("Body", 0, "background2", strExpr);
  607. }
  608. }
  609. //item 선택 정보를 환자별 세팅 화면으로 보냄
  610. function fSaveChoiItem()
  611. {
  612. var sParamHader = "itemcd▦itemnm▦supcd▦supnm▦clincobs▦clincobsprcpyn▦intake▦output▦catheter▦cathprcpyn▦careexec▦careexecprcpyn▦mainrecflag▦chngitemnm▦itemorigincd▦instru▦instruprcpyn▦supsetno▦recfluidunit▩";
  613. var sParamValue = "";
  614. for(var i = 0 ; i < ds_duplchoiitemlist_duplchoiitem.rowcount ; i ++)
  615. {
  616. var sSubCd = ds_duplchoiitemlist_duplchoiitem.getColumn(i, "supcd");
  617. var sItemOrigin = "00";
  618. if(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "extyn") == "Y" &&
  619. ds_duplchoiitemlist_duplchoiitem.getColumn(i, "mainrecflag") != "D" &&
  620. ds_duplchoiitemlist_duplchoiitem.getColumn(i, "mainrecflag") != "E" &&
  621. ds_duplchoiitemlist_duplchoiitem.getColumn(i, "mainrecflag") != "G" )
  622. {//기구도 삽관과 같이 중복가능
  623. sItemOrigin = "04";
  624. }
  625. sParamValue += ds_duplchoiitemlist_duplchoiitem.getColumn(i, "itemcd") + "▦"
  626. + ds_duplchoiitemlist_duplchoiitem.getColumn(i, "itemnm") + "▦"
  627. + sSubCd + "▦"
  628. + ds_totalitem_itemlist.lookup("itemcd", sSubCd, "itemnm") + "▦"
  629. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "clincobs")) + "▦"
  630. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "clincobsprcpyn")) + "▦"
  631. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "intake")) + "▦"
  632. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "output")) + "▦"
  633. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "catheter")) + "▦"
  634. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "cathprcpyn")) + "▦"
  635. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "careexec")) + "▦"
  636. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "careexecprcpyn")) + "▦"
  637. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "mainrecflag")) + "▦"
  638. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "chngitemnm")) + "▦"
  639. + sItemOrigin + "▦"
  640. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "instru")) + "▦"
  641. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "instruprcpyn")) + "▦"
  642. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "supsetno")) + "▦"
  643. + changeNull(ds_duplchoiitemlist_duplchoiitem.getColumn(i, "recfluidunit")) + "▩";
  644. }
  645. opener.frmf_setParameter("SPMNR05900_RtnRaram",sParamHader + sParamValue);
  646. this.close();
  647. }
  648. function changeNull(strText)
  649. {
  650. if (utlf_isNull(strText))
  651. {
  652. strText = "";
  653. }
  654. return strText;
  655. }
  656. /**
  657. * @group :
  658. * @ver : 2008.07.28
  659. * @by : 양천덕
  660. * @---------------------------------------------------
  661. * @type : function
  662. * @access : public
  663. * @desc : 검색한 아이템 선택
  664. * @param :
  665. * @return :
  666. * @---------------------------------------------------
  667. */
  668. function fSettingItemSearch(){
  669. var supcd = ds_searchinfo_itemlist.getColumn(ds_searchinfo_itemlist.rowposition, "supcd");
  670. var itemnm = ds_searchinfo_itemlist.getColumn(ds_searchinfo_itemlist.rowposition, "itemnm");
  671. var supitemnm = ds_searchinfo_itemlist.getColumn(ds_searchinfo_itemlist.findRowExpr("itemcd =='"+supcd+"'"), "itemnm");
  672. var searchCol = 0;
  673. var searchRow = 0;
  674. var temprow = 0;
  675. for( var idx = 0 ; idx < ds_temp_data.colcount ; idx++ ){
  676. if ( ds_temp_data.getColumn(0, "itemnm"+searchCol) == supitemnm ){
  677. searchCol += searchCol;
  678. temprow = idx;
  679. break;
  680. }
  681. searchCol++;
  682. }
  683. searchRow = ds_grid_grd_itemlist.findRow("itemnm"+temprow, itemnm);
  684. fSelectionItem("search", searchRow, searchCol);
  685. fCloseSearch();
  686. }]]></Script>