SPMNR05900.js 27 KB

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