SPMNR05900_SJH.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. /*
  2. ITEM전체조회(SPMNR05900.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var sDelItemCd = "";
  7. var sDelItemIdex = "";
  8. var sDelRow = "";
  9. var sDelCol = "";
  10. /**
  11. * @group :
  12. * @ver : 2008.07.28
  13. * @by : 양천덕
  14. * @---------------------------------------------------
  15. * @type : function
  16. * @access : public
  17. * @desc : 화면 초기화
  18. * @param :
  19. * @return :
  20. * @---------------------------------------------------
  21. */
  22. function fInitialize(){
  23. var sSetItemInfo = "";
  24. var sSetItemInfoList = "";
  25. model.removenode("/root/main/totalitem");
  26. model.removenodeSet("/root/main/duplchoiitemlist/duplchoiitem");
  27. model.removenodeSet("/root/main/patsetitemlist/patsetitem");
  28. sSetItemInfo = opener.javascript.getParameter("SPMNR05900_ParamPat");
  29. //sSetItemInfo = opener.javascript.getParameter("SPMNR05900_ParamItemInfo");
  30. //sSetItemInfoList = sSetItemInfo.split("▩");
  31. //환자별 세팅 Param 설정
  32. //model.setValue("/root/cond/pid", "19082270");
  33. //model.setValue("/root/cond/orddd", "20080323");
  34. //model.setValue("/root/cond/cretno", "800474049");
  35. model.setValue("/root/cond/pid" , getArrayData(sSetItemInfo, 1, 0));
  36. model.setValue("/root/cond/orddd" , getArrayData(sSetItemInfo, 1, 1));
  37. model.setValue("/root/cond/cretno" , getArrayData(sSetItemInfo, 1, 2));
  38. model.copyNode("/root/send", "/root/cond");
  39. //submit("TRMNR05901");
  40. submit("TRMNR05901_SJH");
  41. //ITEM LIST 세팅 func 호출
  42. fSettingItemList();
  43. //환자별 세팅 화면의 설정 데이터 체크 func 호출
  44. fSettingPatItemChk();
  45. //ITEM LIST Style 적용 func 호출
  46. fSettingStyle();
  47. }
  48. /**
  49. * @group :
  50. * @ver : 2008.07.28
  51. * @by : 양천덕
  52. * @---------------------------------------------------
  53. * @type : function
  54. * @access : public
  55. * @desc : ITEM LIST 세팅
  56. * @param :
  57. * @return :
  58. * @---------------------------------------------------
  59. */
  60. function fSettingItemList(){
  61. var j = 0;
  62. var i = 1;
  63. var k = 1;
  64. var sGridWith = 0;
  65. var sColWith = 0;
  66. for(var tRow = 1 ; tRow <= getNodesetCount("/root/main/totalitem/itemlist") ; tRow ++){
  67. /* 순서별 List 조회 *//*
  68. if(tRow <= 31*k ){
  69. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemnm"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemnm"));
  70. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemcd"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemcd"));
  71. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemindex"+j, tRow);
  72. i++;
  73. if(tRow == 31*k){
  74. j++;
  75. k++;
  76. i = 1;
  77. grd_itemlist.addColumn("ref:itemnm"+j, false);
  78. grd_itemlist.addColumn("ref:itemcd"+j+"; visibility:hidden", false);
  79. grd_itemlist.addColumn("ref:itemindex"+j+"; visibility:hidden", false);
  80. }
  81. }
  82. */
  83. /* 분류별 리스트 조회(행변환) *//*
  84. if(model.getValue("/root/main/totalitem/itemlist["+tRow+"]/supcd") == "*"){
  85. if(tRow != 1){
  86. i = 1;
  87. j++;
  88. grd_itemlist.addColumn("ref:itemnm"+j, false);
  89. grd_itemlist.addColumn("ref:itemcd"+j+"; visibility:hidden", false);
  90. grd_itemlist.addColumn("ref:itemindex"+j+"; visibility:hidden", false);
  91. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemnm"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemnm"));
  92. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemcd"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemcd"));
  93. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemindex"+j, tRow);
  94. i++;
  95. }else{
  96. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemnm"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemnm"));
  97. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemcd"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemcd"));
  98. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemindex"+j, tRow);
  99. i++;
  100. }
  101. }else{
  102. if(i <= 31){
  103. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemnm"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemnm"));
  104. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemcd"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemcd"));
  105. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemindex"+j, tRow);
  106. if(i == 31){
  107. j++;
  108. i = 1;
  109. grd_itemlist.addColumn("ref:itemnm"+j, false);
  110. grd_itemlist.addColumn("ref:itemcd"+j+"; visibility:hidden", false);
  111. grd_itemlist.addColumn("ref:itemindex"+j+"; visibility:hidden", false);
  112. }else{
  113. i++;
  114. }
  115. }
  116. }
  117. */
  118. /* 분류별 리스트 조회 (행변환없음) */
  119. if(model.getValue("/root/main/totalitem/itemlist["+tRow+"]/supcd") == "*"){
  120. if(tRow != 1){
  121. i = 1;
  122. j++;
  123. }
  124. grd_itemlist.addColumn("ref:itemnm"+j, false);
  125. //grd_itemlist.addColumn("ref:itemcd"+j+"; visibility:hidden", false);
  126. grd_itemlist.addColumn("ref:itemindex"+j+"; visibility:hidden", false);
  127. //데이터 검증
  128. //grd_itemlist.addColumn("ref:itemindex"+j, false);
  129. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemnm"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemnm"));
  130. //model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemcd"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemcd"));
  131. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemindex"+j, tRow);
  132. i++;
  133. /* }else{
  134. grd_itemlist.addColumn("ref:itemnm"+j, false);
  135. grd_itemlist.addColumn("ref:itemindex"+j, false);
  136. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemnm"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemnm"));
  137. //model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemcd"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemcd"));
  138. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemindex"+j, tRow);
  139. i++;
  140. }
  141. */
  142. }else{
  143. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemnm"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemnm"));
  144. //model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemcd"+j, model.getValue("/root/main/totalitem/itemlist["+tRow+"]/itemcd"));
  145. model.makeValue("/root/main/itemtotallist/itemtotalinfo["+i+"]/itemindex"+j, tRow);
  146. i++;
  147. }
  148. }
  149. //sGridWith = eval(grd_itemlist.cols) * 40 + 2
  150. sColWith = 190;//(1190 - 8) / eval(grd_itemlist.cols) * 2 ;
  151. for(var icol = grd_itemlist.fixedcols ; icol < grd_itemlist.cols ; icol ++){
  152. grd_itemlist.colWidth(icol) = sColWith;
  153. }
  154. grd_itemlist.attribute("style") = "left:0px; top:0px; width:"+1190+"px; height:721px; font-size:9pt; ";
  155. //grd_itemlist.attribute("colwidth") = sColWith;
  156. grd_itemlist.refresh();
  157. }
  158. /**
  159. * @group :
  160. * @ver : 2008.07.29
  161. * @by : 양천덕
  162. * @---------------------------------------------------
  163. * @type : function
  164. * @access : public
  165. * @desc : ITEM LIST Style 적용
  166. * @param :
  167. * @return :
  168. * @---------------------------------------------------
  169. */
  170. function fSettingStyle(){
  171. for(var iRow = 0 ; iRow < grd_itemlist.rows ; iRow++){
  172. for(var iCol = 0 ; iCol < (grd_itemlist.cols / 2) ; iCol++ ){
  173. var sItemIndex = grd_itemlist.valueMatrix( iRow, grd_itemlist.colRef("itemindex"+iCol));
  174. if(sItemIndex != ""){
  175. if(model.getValue("/root/main/totalitem/itemlist["+sItemIndex+"]/supcd") == "*"){
  176. grd_itemlist.cellStyle("background-color", iRow, grd_itemlist.colRef("itemnm"+iCol), iRow, grd_itemlist.colRef("itemnm"+iCol)) = "#b7daff";
  177. grd_itemlist.cellStyle("font-weight", iRow, grd_itemlist.colRef("itemnm"+iCol), iRow, grd_itemlist.colRef("itemnm"+iCol)) = "bold";
  178. }
  179. if(model.getValue("/root/main/totalitem/itemlist["+sItemIndex+"]/insyn") == "Y"){
  180. grd_itemlist.cellStyle("background-color", iRow, grd_itemlist.colRef("itemnm"+iCol), iRow, grd_itemlist.colRef("itemnm"+iCol)) = "#b7f9aa";
  181. }
  182. if(model.getValue("/root/main/totalitem/itemlist["+sItemIndex+"]/extyn") == "Y"){
  183. grd_itemlist.cellStyle("background-image", iRow, grd_itemlist.colRef("itemnm"+iCol)) = "../../../com/commonweb/images/input_essential.gif";
  184. grd_itemlist.cellStyle("background-position", iRow, grd_itemlist.colRef("itemnm"+iCol)) = "top right";
  185. }
  186. if(model.getValue("/root/main/totalitem/itemlist["+sItemIndex+"]/supsetno") != ""){
  187. grd_itemlist.cellStyle("background-image", iRow, grd_itemlist.colRef("itemnm"+iCol)) = "../../../com/commonweb/images/input_s_essential.gif";
  188. grd_itemlist.cellStyle("background-position", iRow, grd_itemlist.colRef("itemnm"+iCol)) = "top right";
  189. }
  190. }
  191. }
  192. }
  193. grd_itemlist.frozenRows = 1;
  194. }
  195. /**
  196. * @group :
  197. * @ver : 2008.07.29
  198. * @by : 양천덕
  199. * @---------------------------------------------------
  200. * @type : function
  201. * @access : public
  202. * @desc : 마우스 포커스 시점 Item Name 표시
  203. * @param :
  204. * @return :
  205. * @---------------------------------------------------
  206. */
  207. function fSettingItemNm(obj){
  208. // model.setValue("/root/stay/itemnm" , "");
  209. iRow = obj.mouseRow - obj.fixedrows;
  210. iCol = obj.mouseCol;
  211. var itemnm = obj.valueMatrix(iRow, iCol);
  212. var supsetno = model.getValue("/root/main/totalitem/itemlist[itemnm='" + itemnm + "']/supsetno");
  213. if(supsetno != "") {
  214. grd_setlist.visible= true;
  215. grd_setlist.nodeset = "/root/main/totalitem/setlist[supsetno='" + supsetno + "']";
  216. grd_setlist.refresh();
  217. //alert(instance1.selectNodesXml("/root/main/totalitem/setlist[supsetno='" + supsetno + "']"));
  218. } else {
  219. grd_setlist.visible= false;
  220. }
  221. var wid = grd_setlist.attribute("width").split("px");
  222. var ht = grd_setlist.attribute("height").split("px");
  223. var lf = event.clientX + 10 + parseInt(wid[0]);
  224. var tp = event.clientY + parseInt(ht[0]);
  225. if(lf > 1191) {
  226. lf = event.clientX - 10 - parseInt(wid[0]);
  227. } else {
  228. lf = event.clientX + 10;
  229. }
  230. if(tp > 768) {
  231. tp = event.clientY - parseInt(ht[0]) -10;
  232. } else {
  233. tp = event.clientY - 40;
  234. }
  235. grd_setlist.attribute("left") = lf;
  236. grd_setlist.attribute("top") = tp;
  237. caption10.value = itemnm;
  238. caption10.refresh();
  239. }
  240. /**
  241. * @group :
  242. * @ver : 2008.07.29
  243. * @by : 양천덕
  244. * @---------------------------------------------------
  245. * @type : function
  246. * @access : public
  247. * @desc : 마우스 더블 클릭시 데이터 임시 설정
  248. * @param :null, search : item 검색후의 그리드에서 선택시 전체아이템 리스트의 컬럼과 로우를 찾아서 넘겨준다.
  249. * @return :
  250. * @---------------------------------------------------
  251. */
  252. function fSelectionItem(pFlag, pRow, pCol){
  253. iRow = 0;
  254. iCol = 0;
  255. iIndexCol = 0;
  256. if ( pFlag =="search" ){
  257. iRow = pRow;
  258. iCol = pCol;
  259. iIndexCol = (eval(pCol) + 1);
  260. }else {
  261. iRow = grd_itemlist.row;
  262. iCol = grd_itemlist.col;
  263. iIndexCol = eval(grd_itemlist.col) + 1;
  264. }
  265. var sColNm = grd_itemlist.colAttribute(iCol, "ref");
  266. var sIndexInfo = grd_itemlist.valueMatrix(iRow, iIndexCol);
  267. if(iRow < 1 || sIndexInfo == ""){
  268. return;
  269. }
  270. var sItemCd = model.getValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/itemcd");
  271. var sRtrnMsg = "";
  272. if(sItemCd == ""){
  273. return;
  274. }
  275. //기록구분, 확장항목여부, 저장여부, 중복선택여부
  276. var sMainRecFlag = model.getValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/mainrecflag");
  277. var sExtYn = model.getValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/extyn");
  278. var sInsYn = model.getValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/insyn");
  279. var sChoiYn = model.getValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/choiyn");
  280. var sLnkBizCd = model.getValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/lnkbizcd");
  281. //기 선택 및 환자세팅 항목일 경우
  282. if(sInsYn == "Y" || sChoiYn == "Y" ){
  283. //확장항목일 경우
  284. if(sExtYn == "Y" && sMainRecFlag == "B"){
  285. fSettingParam("duplextitem", sItemCd, sIndexInfo);
  286. //기구 및 삽관기록 주체일 경우
  287. }else if(sMainRecFlag == "D" || sMainRecFlag == "G" || (sMainRecFlag == "E" && sExtYn == "Y")){
  288. fSettingParam("dupllocitem", sItemCd, sIndexInfo);
  289. }else{
  290. messageBox("이미등록된 아이템","E008");
  291. return;
  292. }
  293. //기 선택 및 환자세팅 항목이 아닐 경우
  294. }else{
  295. //확장항목일 경우
  296. if(sExtYn == "Y" || sMainRecFlag == "D" || sMainRecFlag == "G"){
  297. var sParamFlag = "locitem";
  298. if( (sExtYn == "Y" && sMainRecFlag == "E") || sMainRecFlag == "D" || sMainRecFlag == "G" ){
  299. sParamFlag = "locitem";
  300. }else{
  301. sParamFlag = "extitem";
  302. }
  303. if(fSettingParam(sParamFlag, sItemCd, sIndexInfo) == true){
  304. model.setValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/choiyn", "Y");
  305. grd_itemlist.cellStyle("background-color", iRow, iCol, iRow, iCol) = "#f4a6ee";
  306. grd_itemlist.focusColor = "#f4a6ee";
  307. }else{
  308. fParamInit();
  309. }
  310. }else{
  311. model.setValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/choiyn", "Y");
  312. grd_itemlist.cellStyle("background-color", iRow, iCol, iRow, iCol) = "#f4a6ee";
  313. grd_itemlist.focusColor = "#f4a6ee";
  314. fSettingChoiItem(sItemCd, "", sIndexInfo);
  315. }
  316. }
  317. }
  318. /**
  319. * @group :
  320. * @ver : 2008.07.29
  321. * @by : 양천덕
  322. * @---------------------------------------------------
  323. * @type : function
  324. * @access : public
  325. * @desc : 중복입력 Paramter 설정
  326. * @param :
  327. * @return :
  328. * @---------------------------------------------------
  329. */
  330. function fSettingParam(pFlag, pItemCd, pIndex){
  331. /**
  332. <addon>
  333. *개발일시: 2010.03.04
  334. *개발자: 양천덕
  335. *요청병원: 세종병원
  336. *요청파트: 간호
  337. *개발내용: 수액 항목 입력 화면 호출에 따른 변경 작업
  338. </addon>
  339. */
  340. var rtnVal = false;
  341. var sPid = model.getValue("/root/cond/pid");
  342. var sOrddd = model.getValue("/root/cond/orddd");
  343. var sCretno = model.getValue("/root/cond/cretno");
  344. var sParamMsg = "";
  345. var sParamMsgFlag = "";
  346. var sParamMsgHeader ="";
  347. var sItemNm = model.getValue("/root/main/totalitem/itemlist[itemcd='"+pItemCd+"']/itemnm");
  348. var sItemLnkBizCd = model.getValue("/root/main/totalitem/itemlist[itemcd='"+pItemCd+"']/lnkbizcd");
  349. sParamMsgHeader = "itemcd▦itemnm▦chngitemnm▩";
  350. sParamMsg = "";
  351. sParamMsgFlag = "flag▦itemcd▦itemnm▦pid▦orddd▦cretno▦lnkbizcd▩"
  352. + pFlag+"▦"+pItemCd+"▦"+sItemNm+"▦"+sPid+"▦"+sOrddd+"▦"+sCretno+"▦"+sItemLnkBizCd+"▩";
  353. if(pFlag == "duplextitem" || pFlag == "dupllocitem"){
  354. for(var i = 1 ; i <= getNodesetCount("/root/main/patsetitemlist/patitemlist") ; i ++){
  355. if(model.getValue("/root/main/patsetitemlist/patitemlist["+i+"]/itemcd") == pItemCd){
  356. sParamMsg += pItemCd +"▦"
  357. + model.getValue("/root/main/patsetitemlist/patitemlist["+i+"]/itemnm") + "▦"
  358. + model.getValue("/root/main/patsetitemlist/patitemlist["+i+"]/chngitemnm") + "▩" ;
  359. }
  360. }
  361. for(var i = 1 ; i <= getNodesetCount("/root/main/duplchoiitemlist/duplchoiitem") ; i ++){
  362. if(model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/itemcd") == pItemCd){
  363. sParamMsg += pItemCd +"▦"
  364. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/itemnm") + "▦"
  365. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/chngitemnm") + "▩" ;
  366. }
  367. }
  368. }
  369. setParameter("SPMNR06000_ParamFlag", sParamMsgFlag);
  370. if(sParamMsg != ""){
  371. setParameter("SPMNR06000_Param", sParamMsgHeader+sParamMsg);
  372. }
  373. if(sItemLnkBizCd == "12"){
  374. modal("SPMNR06001");
  375. }else{
  376. modal("SPMNR06000");
  377. }
  378. sRtrnMsg = getParameter("SPMNR06000_RtrnParam");
  379. if(sRtrnMsg == ""){
  380. rtnVal = false;
  381. }else{
  382. if(sRtrnMsg == "&empty"){
  383. sRtrnMsg = "";
  384. }
  385. rtnVal = true;
  386. fSettingChoiItem(pItemCd, sRtrnMsg, pIndex);
  387. }
  388. return rtnVal;
  389. }
  390. /**
  391. * @group :
  392. * @ver : 2008.07.29
  393. * @by : 양천덕
  394. * @---------------------------------------------------
  395. * @type : function
  396. * @access : public
  397. * @desc : 설정 Item Node에 반영
  398. * @param :
  399. * @return :
  400. * @---------------------------------------------------
  401. */
  402. function fSettingChoiItem(pItem, pName, pIndex){
  403. InsRow = eval(getNodesetCount("/root/main/duplchoiitemlist/duplchoiitem"))+1;
  404. model.makeNode("/root/main/duplchoiitemlist/duplchoiitem["+InsRow+"]");
  405. model.copyNode("/root/main/duplchoiitemlist/duplchoiitem["+InsRow+"]", "/root/main/totalitem/itemlist["+pIndex+"]");
  406. model.setValue("/root/main/duplchoiitemlist/duplchoiitem["+InsRow+"]/chngitemnm", getArrayData(pName, 0, 0));
  407. model.makeValue("/root/main/duplchoiitemlist/duplchoiitem["+InsRow+"]/recfluidunit", getArrayData(pName, 0, 1));
  408. fParamInit();
  409. }
  410. /**
  411. * @group :
  412. * @ver : 2008.07.30
  413. * @by : 양천덕
  414. * @---------------------------------------------------
  415. * @type : function
  416. * @access : public
  417. * @desc : Parameter 초기화 부분
  418. * @param :
  419. * @return :
  420. * @---------------------------------------------------
  421. */
  422. function fParamInit(){
  423. clearParameter("SPMNR06000_Param");
  424. clearParameter("SPMNR06000_ParamFlag");
  425. clearParameter("SPMNR06000_RtrnParam");
  426. }
  427. /**
  428. * @group :
  429. * @ver : 2008.07.28
  430. * @by : 양천덕
  431. * @---------------------------------------------------
  432. * @type : function
  433. * @access : public
  434. * @desc : item 선택 정보를 환자별 세팅 화면으로 보냄
  435. * @param :
  436. * @return :
  437. * @---------------------------------------------------
  438. */
  439. function fSaveChoiItem(){
  440. var sParamHader = "itemcd▦itemnm▦supcd▦supnm▦clincobs▦clincobsprcpyn▦intake▦output▦catheter▦cathprcpyn▦careexec▦careexecprcpyn▦mainrecflag▦chngitemnm▦itemorigincd▦instru▦instruprcpyn▦supsetno▦recfluidunit▩";
  441. var sParamValue = "";
  442. for(var i = 1 ; i <= getNodesetCount("/root/main/duplchoiitemlist/duplchoiitem") ; i ++){
  443. var sSubCd = model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/supcd");
  444. var sItemOrigin = "00";
  445. if(model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/extyn") == "Y" &&
  446. model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/mainrecflag") != "D" &&
  447. model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/mainrecflag") != "E" &&
  448. model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/mainrecflag") != "G" ){//기구도 삽관과 같이 중복가능
  449. sItemOrigin = "04";
  450. }
  451. sParamValue += model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/itemcd") + "▦"
  452. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/itemnm") + "▦"
  453. + sSubCd + "▦"
  454. + model.getValue("/root/main/totalitem/itemlist[itemcd ='"+sSubCd+"']/itemnm") + "▦"
  455. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/clincobs") + "▦"
  456. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/clincobsprcpyn") + "▦"
  457. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/intake") + "▦"
  458. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/output") + "▦"
  459. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/catheter") + "▦"
  460. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/cathprcpyn") + "▦"
  461. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/careexec") + "▦"
  462. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/careexecprcpyn") + "▦"
  463. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/mainrecflag") + "▦"
  464. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/chngitemnm") + "▦"
  465. + sItemOrigin + "▦"
  466. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/instru") + "▦"
  467. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/instruprcpyn") + "▦"
  468. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/supsetno") + "▦"
  469. + model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/recfluidunit") + "▩";
  470. }
  471. opener.javascript.setParameter("SPMNR05900_RtnRaram",sParamHader + sParamValue);
  472. window.close();
  473. }
  474. /**
  475. * @group :
  476. * @ver : 2008.07.28
  477. * @by : 양천덕
  478. * @---------------------------------------------------
  479. * @type : function
  480. * @access : public
  481. * @desc : 환자별 세팅 화면의 기 선택 데이터 체크
  482. * @param :
  483. * @return :
  484. * @---------------------------------------------------
  485. */
  486. function fSettingPatItemChk(){
  487. var ChkRow = getNodesetCount("/root/main/patsetitemlist/patitemlist");
  488. if(ChkRow < 1){
  489. return;
  490. }else{
  491. for(var i = 1 ; i <= ChkRow ; i++){
  492. sItemCd = model.getValue("/root/main/patsetitemlist/patitemlist["+i+"]/itemcd");
  493. if(model.getValue("/root/main/totalitem/itemlist[itemcd='"+sItemCd+"']/itemcd") != ""){
  494. model.setValue("/root/main/totalitem/itemlist[itemcd='"+sItemCd+"']/insyn", "Y");
  495. }
  496. }
  497. }
  498. }
  499. /**
  500. * @group :
  501. * @ver : 2008.07.28
  502. * @by : 양천덕
  503. * @---------------------------------------------------
  504. * @type : function
  505. * @access : public
  506. * @desc : 셀선택시 셀의 포커스 컬러 변경
  507. * @param :
  508. * @return :
  509. * @---------------------------------------------------
  510. */
  511. function fChangeFocusColor(){
  512. iRow = grd_itemlist.row;
  513. iCol = grd_itemlist.col;
  514. grd_itemlist.focusColor = grd_itemlist.cellStyle("background-color", iRow, iCol, iRow, iCol);
  515. }
  516. /**
  517. * @group :
  518. * @ver : 2008.07.28
  519. * @by : 양천덕
  520. * @---------------------------------------------------
  521. * @type : function
  522. * @access : public
  523. * @desc : Setting Item 삭제
  524. * @param :
  525. * @return :
  526. * @---------------------------------------------------
  527. */
  528. function fPopupDelItem(){
  529. sDelItemCd = "";
  530. sDelRow = "";
  531. sDelCol = "";
  532. grd_itemlist.row = grd_itemlist.mouseRow;
  533. grd_itemlist.col = grd_itemlist.mouseCol;
  534. if( event.button == 3 ){
  535. sCnt = 0;
  536. sDelRow = grd_itemlist.row;
  537. sDelCol = grd_itemlist.col;
  538. iIndexCol = eval(sDelCol) + 1;
  539. // if(iRow < 1 || iIndexCol == ""){
  540. // return;
  541. // }
  542. // var sIndexInfo = grd_itemlist.valueMatrix(sDelRow, iIndexCol);
  543. // if(sIndexInfo == ""){
  544. // return;
  545. // }
  546. // sDelItemCd = model.getValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/itemcd");
  547. // var sDelItemNm = model.getValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/itemnm");
  548. if(grd_itemlist.isCell(event.target) && grd_itemlist.mouseRow >= 1 && sDelRow > 0 && iIndexCol != "" ){
  549. var sIndexInfo = grd_itemlist.valueMatrix(sDelRow, iIndexCol);
  550. if((grd_itemlist.cellStyle("background-color", sDelRow, sDelCol, sDelRow, sDelCol) == "#f4a6ee" ||
  551. grd_itemlist.cellStyle("background-color", sDelRow, sDelCol, sDelRow, sDelCol) == "#b7f9aa") && sIndexInfo != ""){
  552. sDelItemCd = model.getValue("/root/main/totalitem/itemlist["+sIndexInfo+"]/itemcd");
  553. //추가선택 중 여러개 등록 가능한 아이템 존재시
  554. for(var i =1 ; i <= getNodesetCount("/root/main/duplchoiitemlist/duplchoiitem") ; i ++){
  555. if(model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/itemcd") == sDelItemCd ){
  556. sCnt ++;
  557. }
  558. }
  559. if(sCnt > 1 ){
  560. window.setPopupMenu(true, "/root/init/popmenu1/itemmenu", "name", "func", false);
  561. }else if(grd_itemlist.cellStyle("background-color", sDelRow, sDelCol, sDelRow, sDelCol) == "#b7f9aa" && sCnt > 0){
  562. window.setPopupMenu(true, "/root/init/popmenu1/itemmenu", "name", "func", false);
  563. }else if(sCnt == 1){
  564. window.setPopupMenu(true, "/root/init/popmenu2/itemmenu", "name", "func", false);
  565. }else{
  566. window.setPopupMenu(false);
  567. sDelItemCd = "";
  568. sDelRow = "";
  569. sDelCol = "";
  570. }
  571. }else{
  572. window.setPopupMenu(false);
  573. sDelItemCd = "";
  574. sDelRow = "";
  575. sDelCol = "";
  576. }
  577. }else{
  578. window.setPopupMenu(false);
  579. sDelItemCd = "";
  580. sDelRow = "";
  581. sDelCol = "";
  582. }
  583. }
  584. }
  585. /**
  586. * @group :
  587. * @ver : 2008.07.28
  588. * @by : 양천덕
  589. * @---------------------------------------------------
  590. * @type : function
  591. * @access : public
  592. * @desc : Setting Item 삭제(다중 세팅 아이템)
  593. * @param :
  594. * @return :
  595. * @---------------------------------------------------
  596. */
  597. function fDelItemList(){
  598. var msg = messageBox("여러 개의 설정 아이템이 존재합니다.\n단 등록 및 기 선택된 아이템은 해제되지 않습니다.\n계속", "Q004");//실행 하시겠습니까? yes=6, no=7
  599. if(Number(msg) == 6){//예
  600. sCnt = 0 ;
  601. for(var i = getNodesetCount("/root/main/duplchoiitemlist/duplchoiitem") ; i > 0 ; i --){
  602. if(model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/itemcd") == sDelItemCd ){
  603. model.removenodeSet("/root/main/duplchoiitemlist/duplchoiitem["+i+"]");
  604. }
  605. }
  606. if(grd_itemlist.cellStyle("background-color", sDelRow, sDelCol, sDelRow, sDelCol) == "#f4a6ee"){
  607. model.setValue("/root/main/totalitem/itemlist[itemcd ='"+sDelItemCd+"']/choiyn", "N");
  608. grd_itemlist.cellStyle("background-color", sDelRow, sDelCol, sDelRow, sDelCol) = "#ffffff";
  609. }
  610. sDelItemCd = "";
  611. sDelRow = "";
  612. sDelCol = "";
  613. grd_itemlist.col = sDelCol+1;
  614. //fChangeFocusColor();
  615. }
  616. }
  617. /**
  618. * @group :
  619. * @ver : 2008.07.28
  620. * @by : 양천덕
  621. * @---------------------------------------------------
  622. * @type : function
  623. * @access : public
  624. * @desc : Setting Item 삭제(싱글 세팅 아이템)
  625. * @param :
  626. * @return :
  627. * @---------------------------------------------------
  628. */
  629. function fDelItem(){
  630. sCnt = 0 ;
  631. for(var i = getNodesetCount("/root/main/duplchoiitemlist/duplchoiitem") ; i > 0 ; i --){
  632. if(model.getValue("/root/main/duplchoiitemlist/duplchoiitem["+i+"]/itemcd") == sDelItemCd ){
  633. model.removenodeSet("/root/main/duplchoiitemlist/duplchoiitem["+i+"]");
  634. grd_itemlist.cellStyle("background-color", sDelRow, sDelCol, sDelRow, sDelCol) = "#ffffff";
  635. }
  636. }
  637. model.setValue("/root/main/totalitem/itemlist[itemcd ='"+sDelItemCd+"']/choiyn", "N");
  638. sDelItemCd = "";
  639. sDelRow = "";
  640. sDelCol = "";
  641. grd_itemlist.col = sDelCol+1;
  642. //fChangeFocusColor();
  643. }
  644. /**
  645. * @group :
  646. * @ver : 2008.07.28
  647. * @by : 양천덕
  648. * @---------------------------------------------------
  649. * @type : function
  650. * @access : public
  651. * @desc : item search
  652. * @param :
  653. * @return :
  654. * @---------------------------------------------------
  655. */
  656. function fSearchItem(){
  657. var itemcd ="";
  658. model.setValue("/root/send/recflag", model.getValue("/root/cond/recflag"));
  659. model.setValue("/root/send/itemnm", model.getValue("/root/cond/itemnm"));
  660. model.setValue("/root/send/clscd", model.getValue("/root/cond/clscd"));
  661. model.setValue("/root/send/srchflag", "G");
  662. if ( isNull(model.getValue("/root/cond/itemnm")) || model.getValue("/root/cond/itemnm").length < 2) {
  663. messageBox("검색하고자 하는 아이템명을 2자 이상 ","C001");
  664. return;
  665. }
  666. if(submit("TRMNR05902")){
  667. for( var idx = 1 ; idx <= getNodesetCount("/root/main/searchinfo/itemlist") ; idx++ ){
  668. if ( model.getValue("/root/main/searchinfo/itemlist["+ idx +"]/depth") > "1" ){
  669. itemcd = model.getValue("/root/main/searchinfo/itemlist["+ idx +"]/itemcd");
  670. if ( isNull(model.getValue("/root/main/patsetitemlist/patitemlist[itemcd = '"+ itemcd +"']/itemcd")) ){
  671. grd_srchitem.cellStyle("background-color", (idx-1), 0, (idx-1),0) = "#FFFFFF";
  672. } else {
  673. grd_srchitem.cellStyle("background-color", (idx-1), 0, (idx-1),0) = "#B7F9AA";
  674. }
  675. } else {
  676. grd_srchitem.cellStyle("background-color", (idx-1), 0, (idx-1),0) = "#b7daff";
  677. }
  678. }
  679. }
  680. }
  681. /**
  682. * @group :
  683. * @ver : 2008.07.28
  684. * @by : 양천덕
  685. * @---------------------------------------------------
  686. * @type : function
  687. * @access : public
  688. * @desc : 검색한 아이템 선택
  689. * @param :
  690. * @return :
  691. * @---------------------------------------------------
  692. */
  693. function fSettingItemSearch(){
  694. var supcd = model.getValue("/root/main/searchinfo/itemlist["+ (eval(grd_srchitem.mouseRow) + 1) +"]/supcd");
  695. var itemnm = model.getValue("/root/main/searchinfo/itemlist["+ (eval(grd_srchitem.mouseRow) + 1) +"]/itemnm");
  696. var supitemnm = model.getValue("/root/main/searchinfo/itemlist[ itemcd = '"+ supcd +"']/itemnm");
  697. var searchCol = 0;
  698. var searchRow = 0;
  699. for( var idx = 0 ; idx < grd_itemlist.cols ; idx++ ){
  700. if ( grd_itemlist.valueMatrix(0,idx) == supitemnm ){
  701. searchCol = idx;
  702. break;
  703. }
  704. }
  705. searchRow = grd_itemlist.findRow(itemnm, 1, searchCol);
  706. //fSelectionItem(pFlag, pRow, pCol)
  707. grd_itemlist.row = searchRow;
  708. grd_itemlist.col = searchCol;
  709. fSelectionItem("search", searchRow, searchCol );
  710. fCloseSearch();
  711. grd_itemlist.bottomRow = searchRow;
  712. }
  713. /**
  714. * @group :
  715. * @ver : 2008.07.28
  716. * @by : 양천덕
  717. * @---------------------------------------------------
  718. * @type : function
  719. * @access : public
  720. * @desc : open search
  721. * @param :
  722. * @return :
  723. * @---------------------------------------------------
  724. */
  725. function fOpenSearch(){
  726. grp_search.visible = true;
  727. grp_biz.attribute("style")="left:0px; top:40px; width:1031px; height:722px; " ;
  728. grd_itemlist.attribute("style")="left:0px; top:0px; width:"+1030+"px; height:721px; font-size:9pt; " ;
  729. model.setFocus("ipt_searchnm");
  730. }
  731. /**
  732. * @group :
  733. * @ver : 2008.07.28
  734. * @by : 양천덕
  735. * @---------------------------------------------------
  736. * @type : function
  737. * @access : public
  738. * @desc : close search
  739. * @param :
  740. * @return :
  741. * @---------------------------------------------------
  742. */
  743. function fCloseSearch(){
  744. grp_search.visible = false;
  745. grp_biz.attribute("style")="left:0px; top:40px; width:1191px; height:722px;" ;
  746. grd_itemlist.attribute("style")="left:0px; top:0px; width:"+1190+"px; height:721px; font-size:9pt; " ;
  747. }