SMMNR03100_SJH.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162
  1. /*
  2. FlowSheet_간호Item 관리(SMMNR10200.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var idx = 0;
  7. var treedepthcol = grd_srchitem.colRef("depth");
  8. var treetargetcol = grd_srchitem.colRef("itemnm");
  9. var xItemSrchPath = "/root/main/itemsrch/itemlist";
  10. var xAttrSrchPath = "/root/main/srchinfo/attrsrch/attrlist"; // 속성상세내역
  11. var xAttrListPath = "/root/main/recinfo/attrinfo/attrlist"; // 속성정보
  12. var xHiddenAttrListPath = "/root/temp/recinfo/attrlist"; // 속성정보
  13. var xRecItemAnptListPath = "/root/main/recinfo/recitemanptlist"; // 기록지연계정보
  14. var xHiddenRecItemAnptListPath = "/root/temp/recinfo/recitemanptlist";
  15. var xItemInfoPath = "/root/main/recinfo/iteminfo"; // Item 상세 정보
  16. var xHiddenItemInfoPath = "/root/temp/recinfo/iteminfo";
  17. var xICNPInfoPath = "/root/main/recinfo/icnpmngt/icnpinfo";
  18. var xCondPath = "/root/main/cond"; // 조건 정보
  19. var xPrcpInfoPath = "/root/main/recinfo/prcpinfo/prcplist"; // 처방조회
  20. var xRecFlagListPath = "/root/init/M0198list/M0198"; // 기록지구분
  21. var xPrcpSrchPath = "/root/main/srchinfo/prcpsrch/prcplist"; // 처방검색
  22. var flag = "1";
  23. var cnt = 0;
  24. /**
  25. * @group :
  26. * @ver : 2007.03.12
  27. * @by : ??????
  28. * @---------------------------------------------------
  29. * @type : function
  30. * @access : public
  31. * @desc : 초기화 작업 및 기본 select
  32. * @param :
  33. * @return :
  34. * @---------------------------------------------------
  35. */
  36. function fInit(){
  37. treedepthcol = grd_srchitem.colRef("depth");
  38. treetargetcol = grd_srchitem.colRef("itemnm");
  39. var iItemRow = 0;
  40. submit("TRMNR03108_SJH", false);
  41. zbcfGetCodeList(new Array("M0198"), new Array("/root/init/M0198list")); // 기록지구분(M0198)
  42. model.removenodeset("/root/main/itemsrch/itemlist");
  43. model.removenodeset(xRecItemAnptListPath);
  44. model.removenodeset(xPrcpSrchPath);
  45. grd_recitemanptinfo.rebuild();
  46. grd_prcpsrchinfo.rebuild();
  47. model.removenode("/root/send");
  48. fClearValue();
  49. fSearchItemLis();
  50. }
  51. function fSearchItemLis() {
  52. model.makeValue("/root/send/delinclyn", "Y");
  53. if (submit("TRMNR03101")){
  54. grd_srchitem.allStyle("data", "background-color") = "#FFFFFF";
  55. var setuseyn = "";
  56. var elmtdefineyn = "";
  57. var setyn = "";
  58. var useflag = "";
  59. for(var iRow = grd_srchitem.fixedRows; iRow < grd_srchitem.rows; iRow++) {
  60. setuseyn = model.getValue(grd_srchitem.nodeset + "[" + iRow + "]/setuseyn");
  61. elmtdefineyn = model.getValue(grd_srchitem.nodeset + "[" + iRow + "]/elmtdefineyn");
  62. setyn = model.getValue(grd_srchitem.nodeset + "[" + iRow + "]/setyn");
  63. useflag = model.getValue(grd_srchitem.nodeset + "[" + iRow + "]/useflag");
  64. if(setuseyn == "Y") {
  65. grd_srchitem.cellStyle("background-image", iRow, grd_srchitem.colRef("itemnm")) = "../../../com/commonweb/images/input_essential.gif";
  66. grd_srchitem.cellStyle("background-position", iRow, grd_srchitem.colRef("itemnm")) = "top right";
  67. }
  68. if(setyn == "Y") {
  69. grd_srchitem.cellStyle("background-image", iRow, grd_srchitem.colRef("itemnm")) = "../../../com/commonweb/images/input_s_essential.gif";
  70. grd_srchitem.cellStyle("background-position", iRow, grd_srchitem.colRef("itemnm")) = "top right";
  71. }
  72. if(elmtdefineyn == "N") {
  73. grd_srchitem.rowStyle(iRow, "data", "background-color") = "#c0c0c0";
  74. }
  75. if(useflag == "I") {
  76. grd_srchitem.rowStyle(iRow, "data", "background-color") = "#ffeca2";
  77. }
  78. }
  79. if(cnt == 0) {
  80. setTree(grd_srchitem,treedepthcol,treetargetcol,true); //트리구조 만들기
  81. cnt++;
  82. } else {
  83. setTree(grd_srchitem,treedepthcol,treetargetcol,true); //트리구조 만들기
  84. }
  85. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  86. }
  87. grd_srchitem.refresh();
  88. }
  89. /**
  90. * @group :
  91. * @ver : 2007.04.04
  92. * @by :
  93. * @---------------------------------------------------
  94. * @type : function
  95. * @access : public
  96. * @desc : 초기화 버튼 클릭시 값을 지움
  97. * @param : pFlag ( G : 분류명 입력여부 선택시, N : 신규버튼 클릭시)
  98. * @return :
  99. * @---------------------------------------------------
  100. */
  101. function fClearValue(pFlag){
  102. if(pFlag == null || pFlag == "" ){
  103. pFlag = "N";
  104. }
  105. switch(pFlag){
  106. case "ttl" :
  107. model.resetInstanceNode(xItemInfoPath);
  108. model.removenodeset(xICNPInfoPath);
  109. model.removenodeset(xAttrListPath);
  110. model.removenodeset(xAttrSrchPath);
  111. cmb_clscd.disabled = false;
  112. btn_saveprcpinfo.disabled = true;
  113. btn_delprcpinfo.disabled = true;
  114. rdo_cathflag.disabled = true;
  115. btn_srchprcp.disabled = true;
  116. ipt_prcpnm.disabled = true;
  117. btn_rgstprcp.disabled = true;
  118. break;
  119. case "N" :
  120. model.removeNodeset(xRecItemAnptListPath);
  121. grd_recitemanptinfo.refresh();
  122. for(var iRow = 1; iRow <= getNodesetCnt(model,xRecFlagListPath); iRow++){
  123. grd_recitemanptinfo.addRow(false);
  124. iItemRow = grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows;
  125. model.setValue(xRecItemAnptListPath+"["+iItemRow+"]/status","I");
  126. model.setValue(xRecItemAnptListPath+"["+iItemRow+"]/recflag", model.getValue(xRecFlagListPath+"["+iRow+"]/cdid"));
  127. model.setValue(xRecItemAnptListPath+"["+iItemRow+"]/itemcd", model.getValue(xItemInfoPath+"]/itemcd"));
  128. fCtrlRecLnkGrid(model.getValue(xRecFlagListPath+"["+iRow+"]/cdid"), iRow);
  129. }
  130. case "G" :
  131. var sClsYN = model.getValue(xCondPath+"/clsyn");
  132. var sClsCD = model.getValue(xCondPath+"/clscd");
  133. var sItemCD = model.getValue(xItemInfoPath+"/itemcd");
  134. var sSupCD = model.getValue(xItemInfoPath+"/supcd");
  135. model.resetInstanceNode(xItemInfoPath);
  136. model.removenodeset(xICNPInfoPath);
  137. model.removenodeset(xAttrListPath);
  138. model.removenodeset(xAttrSrchPath);
  139. for(var iRow = grd_recitemanptinfo.fixedrows;iRow <= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; iRow++){
  140. model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag","");
  141. model.setValue(xRecItemAnptListPath+"["+iRow+"]/prcpyn","");
  142. model.setValue(xRecItemAnptListPath+"["+iRow+"]/itemcd","");
  143. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","I");
  144. fCtrlRecLnkGrid(model.getValue(xRecItemAnptListPath+"["+iRow+"]/recflag"), iRow);
  145. }
  146. model.resetInstanceNode(xCondPath);
  147. if(pFlag == "N"){
  148. if(sClsCD == "" && sSupCD == "*"){
  149. model.setValue(xCondPath+"/clscd",sItemCD);
  150. model.setValue(xItemInfoPath+"/supcd",sItemCD);
  151. }else{
  152. model.setValue(xCondPath+"/clscd",sClsCD);
  153. model.setValue(xItemInfoPath+"/supcd",sClsCD);
  154. }
  155. }else{
  156. if(pFlag == "G"){
  157. model.setValue(xCondPath+"/clsyn",sClsYN);
  158. }
  159. model.setValue(xItemInfoPath+"/supcd","*");
  160. }
  161. cmb_clscd.disabled = false;
  162. btn_saveprcpinfo.disabled = true;
  163. btn_delprcpinfo.disabled = true;
  164. rdo_cathflag.disabled = true;
  165. btn_srchprcp.disabled = true;
  166. ipt_prcpnm.disabled = true;
  167. btn_rgstprcp.disabled = true;
  168. fSrchPrcpInfo(); // 처방 매핑 부분
  169. model.setValue(xItemInfoPath+"/status","I");
  170. model.setValue(xItemInfoPath+"/refseq",0);
  171. // model.setValue(xItemInfoPath+"/timesetting","");
  172. model.setValue(xItemInfoPath+"/elmtdefineyn","Y");
  173. model.copyNode(xHiddenItemInfoPath, xItemInfoPath);
  174. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  175. break;
  176. case "prcp" :
  177. var iRow = grd_recitemanptinfo.row;
  178. if(model.getValue(xCondPath+"/recflag") == model.getValue(xRecItemAnptListPath+"["+iRow+"]/recflag")){
  179. return;
  180. }
  181. model.removenodeset(xPrcpInfoPath);
  182. model.removenodeset(xPrcpSrchPath);
  183. model.setValue(xCondPath+"/recflag","");
  184. grd_prcpinfo.rebuild();
  185. grd_prcpsrchinfo.rebuild();
  186. cmb_recflag.refresh();
  187. break;
  188. }
  189. }
  190. /**
  191. * @group :
  192. * @ver : 2007.05.04
  193. * @by : 이은영
  194. * @---------------------------------------------------
  195. * @type : function
  196. * @access : public
  197. * @desc : 저장
  198. * @param : pFlag ( item : 아이템 저장,)
  199. * @return :
  200. * @---------------------------------------------------
  201. */
  202. function fSave(pFlag){
  203. model.removenode("/root/send");
  204. var sSaveDataHeader = "supcd▦itemcd▦itemnm▦elmtdefineyn▦status▦refseq▦tmapntyn▦itemdescspec▦grupflag▦refseq▦lnkbizcd▦comnyn▦drainchk▦useflag▩";
  205. var sSaveData = ""; // 저장 Data
  206. var iICNPRow = 1;
  207. var sClsYN = ""; // 분류 구분
  208. var sItemNM = ""; // 항목명
  209. var sMainRecCharFlagYN = "N"; // 주체 존재 여부
  210. var sMainRecCharFlagCnt = 0; // 주체 갯수
  211. var sRecItemAnptChk = "N"; // 기록지연계정보 수정여부
  212. var sAttrInfoChk = "N"; // 속성정보 수정여부
  213. var xSaveICNPInfoPath = "/root/temp/icnpinfo";
  214. var sICNPChk = false; // ICNP 존재 여부
  215. var sStatus = ""; // 상태
  216. var sSupCD = ""; // 상위코드
  217. var sItemCD = ""; // 항목코드
  218. var iRow = 0;
  219. switch(pFlag){
  220. case "item" : // 항목 저장
  221. if(model.getValue(xItemInfoPath+"/drainchk") == "Y"){ // 배액감시조회여부
  222. if(model.getValue(xItemInfoPath+"/supcd")!= "IT000009"){ // 삽관인경우에만 배액감시조회여부 선택 가능
  223. messageBox("배액감시조회는 삽관인 경우에만 가능합니다.","I");
  224. return;
  225. }
  226. }
  227. sClsYN = model.getValue(xCondPath+"/clsyn");
  228. if(sClsYN == "Y"){
  229. sItemNM = model.getValue(xCondPath+"/clscd");
  230. if(sItemNM == ""){
  231. model.setValue(xItemInfoPath+"/status","-");
  232. }else{
  233. model.setValue(xItemInfoPath+"/itemnm",sItemNM);
  234. }
  235. for(var iRow = grd_recitemanptinfo.fixedrows; iRow<= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; iRow++){
  236. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","-");
  237. }
  238. }else{
  239. sSupCD = model.getValue(xItemInfoPath+"/supcd");
  240. sItemNM = model.getValue(xItemInfoPath+"/itemnm");
  241. if(model.getValue(xItemInfoPath+"/itemnm") == ""){
  242. messageBox("항목명을 입력하지","E007");
  243. return;
  244. }
  245. // 분류에는 기록지 연계 내역이 없음.
  246. if(sSupCD != "*"){
  247. for(var iRow = grd_recitemanptinfo.fixedrows; iRow<= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; iRow++){
  248. sStatus = model.getValue(xRecItemAnptListPath+"["+iRow+"]/status");
  249. if(model.getValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag") == "A"){
  250. sMainRecCharFlagYN = "Y";
  251. sMainRecCharFlagCnt++;
  252. }
  253. if(sStatus == "I" && model.getValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag") == ""){
  254. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","-");
  255. }else{
  256. if(sStatus == "I" || sStatus == "U" || sStatus == "D"){
  257. sRecItemAnptChk = "Y";
  258. }
  259. }
  260. }
  261. if(sMainRecCharFlagYN == "N"){
  262. messageBox("주체를 하나","C002");
  263. return;
  264. }
  265. if(sMainRecCharFlagCnt > 1){
  266. window.alert( "주체는 하나만 존재해야 합니다.", "오류", "16" );
  267. return;
  268. }
  269. for(var iRow = grd_attrinfo.fixedrows; iRow<=grd_attrinfo.rows-grd_attrinfo.fixedrows;iRow++){
  270. //if(model.getValue(xAttrListPath+"["+iRow+"]/check") == "true" && model.getValue(xAttrListPath+"["+iRow+"]/status") != "-"){
  271. if(model.getValue(xAttrListPath+"["+iRow+"]/status") != "-"){
  272. sAttrInfoChk = "Y";
  273. break;
  274. }
  275. }
  276. }else{
  277. for(var iRow = grd_recitemanptinfo.fixedrows; iRow<= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; iRow++){
  278. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","-");
  279. }
  280. }
  281. // ICNP 정보
  282. for(var iRow=grd_icnpinfo.fixedrows; iRow<=grd_icnpinfo.rows-grd_icnpinfo.fixedrows; iRow++){
  283. if(model.getValue(xICNPInfoPath+"["+iRow+"]/check") == "true"){
  284. model.setValue(xICNPInfoPath+"["+iRow+"]/itemcd", model.getValue(xItemInfoPath+"/itemcd"));
  285. grd_icnpinfo.rowStatus(iRow) = 1;
  286. sICNPChk = true;
  287. }
  288. }
  289. if(instance1.selectSingleNode(xItemInfoPath).xml == instance1.selectSingleNode(xHiddenItemInfoPath).xml && sRecItemAnptChk == "N"
  290. && sICNPChk == false && sAttrInfoChk == "N"){ // 변경된 데이터가 있는 여부를 체크
  291. messageBox("변경된 데이터가","I004");
  292. return;
  293. }
  294. if(instance1.selectSingleNode(xItemInfoPath).xml == instance1.selectSingleNode(xHiddenItemInfoPath).xml){
  295. model.setValue(xItemInfoPath+"/status","-");
  296. }
  297. }
  298. // 트리 펼치기
  299. setTree(grd_srchitem,treedepthcol,treetargetcol,false);
  300. //tree 및 레벨설정
  301. /*for(var i = grd_srchitem.fixedRows; i < grd_srchitem.rows; i++)
  302. {
  303. grd_srchitem.outlinelevel(i)=grd_srchitem.valuematrix(i, 12); //인스턴스 levl 값임
  304. }
  305. // tree 대상 컬럼 및 형태 설정
  306. grd_srchitem.outlinecol=2; //연결선이 표현되는 컬럼
  307. grd_srchitem.outlinebar=2; //연결선 형태 설정 (+ , - , 사각형 안보이게 하려면 0 으로 세팅)
  308. grd_srchitem.treecolor="#948777"
  309. for(var i = grd_srchitem.fixedrows; i <grd_srchitem.rows; i++)
  310. {
  311. grd_srchitem.iscollapsed(i)=false; //자식 트리 접기
  312. }*/
  313. sSaveData += model.getValue(xItemInfoPath+"/supcd")+"▦"
  314. + model.getValue(xItemInfoPath+"/itemcd")+"▦"
  315. + model.getValue(xItemInfoPath+"/itemnm")+"▦"
  316. + model.getValue(xItemInfoPath+"/elmtdefineyn")+"▦"
  317. + model.getValue(xItemInfoPath+"/status")+"▦0▦"
  318. + model.getValue(xItemInfoPath+"/tmapntyn")+"▦"
  319. + model.getValue(xItemInfoPath+"/itemdescspec")+"▦"
  320. + model.getValue(xItemInfoPath+"/grupflag")+"▦"
  321. + ipt_refseq.value +"▦"
  322. + cmb_lnkbiz.value +"▦"
  323. + model.getValue(xItemInfoPath+"/comnyn")+"▦"
  324. + cmb_drainchk.value + "▦"
  325. + cmb_useflag.value + "▩";
  326. model.makeValue("/root/send/iteminfo",sSaveDataHeader+sSaveData);
  327. model.makeValue("/root/send/attrinfo", grd_attrinfo.getUpdateDataAll("i"));
  328. model.makeValue("/root/send/recitemanptlist", grd_recitemanptinfo.getUpdateDataAll("i"));
  329. model.makeValue("/root/send/icnpinfo", grd_icnpinfo.getUpdateData());
  330. if(submit("TXMNR03101_SJH")){
  331. fClearValue();
  332. //if(sClsYN != "Y"){
  333. // iRow = grd_srchitem.findRow(sItemNM,1,3);
  334. // sSupCD = model.getValue(xItemSrchPath+"["+iRow+"]/supcd");
  335. // //tree 및 레벨설정
  336. // for(var i = grd_srchitem.fixedRows; i < grd_srchitem.rows; i++)
  337. // {
  338. // //gridObj.issubtotal(i) = true;
  339. // grd_srchitem.outlinelevel(i)=grd_srchitem.valuematrix(i, treedepthcol); //인스턴스 levl 값임
  340. // }
  341. // // tree 대상 컬럼 및 형태 설정
  342. // grd_srchitem.outlinecol=3; //연결선이 표현되는 컬럼
  343. // grd_srchitem.outlinebar=2; //연결선 형태 설정 (+ , - , 사각형 안보이게 하려면 0 으로 세팅)
  344. // grd_srchitem.treecolor="#948777"
  345. //
  346. // for(var i = grd_srchitem.fixedrows; i <grd_srchitem.rows; i++)
  347. // {
  348. // if(model.getValue(xItemSrchPath+"["+i+"]/itemcd") == sSupCD || model.getValue(xItemSrchPath+"["+i+"]/supcd") == sSupCD){
  349. // grd_srchitem.iscollapsed(i)=false; //자식 트리 접기
  350. // }else{
  351. // grd_srchitem.iscollapsed(i)=true; //자식 트리 접기
  352. // }
  353. // }
  354. // iRow = grd_srchitem.findRow(sItemNM,1,3);
  355. // grd_srchitem.row = iRow;
  356. // fClickedGridRow("item");
  357. //}else{
  358. // setTree(grd_srchitem,treedepthcol,treetargetcol,true); // 트리구조 만들기
  359. //}
  360. fSearchItemLis();
  361. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  362. model.refresh();
  363. }
  364. break;
  365. case "prcp" :
  366. model.removenode("/root/send");
  367. model.makeValue("/root/send/prcpinfo", grd_prcpinfo.getUpdateDataAll("i"));
  368. if(submit("TXMNR03102")){
  369. iRow = grd_srchitem.findRow(model.getValue(xCondPath+"/itemcd"),1,2);
  370. grd_srchitem.row = iRow;
  371. fClickedGridRow("item");
  372. iRow = grd_recitemanptinfo.findRow(model.getValue(xCondPath+"/recflag"),1,1);
  373. grd_detlattrinfo.row = iRow;
  374. fDblClickedGrid("prcp",true);
  375. }
  376. break;
  377. }
  378. }
  379. /**
  380. * @group :
  381. * @ver : 2007.05.08
  382. * @by : 이은영
  383. * @---------------------------------------------------
  384. * @type : function
  385. * @access : public
  386. * @desc : Item 삭제
  387. * @param :
  388. * @return :
  389. * @---------------------------------------------------
  390. */
  391. function fDelItemInfo(){
  392. model.setValue(xItemInfoPath+"/elmtdefineyn","N");
  393. model.setValue(xItemInfoPath+"/status","D");
  394. fSave("item");
  395. }
  396. /**
  397. * @group :
  398. * @ver : 2007.03.22
  399. * @by : 신혁춘
  400. * @---------------------------------------------------
  401. * @type : function
  402. * @access : public
  403. * @desc : 그리드 클릭시..
  404. * @param : pFlag ( prcp : 처방조회), pReSrchYN : 저장 후 재조회여부
  405. * @return :
  406. * @---------------------------------------------------
  407. */
  408. function fDblClickedGrid(pFlag,pReSrchYN){
  409. var iRow = 0;
  410. var sItemCD = "";
  411. switch(pFlag){
  412. case "prcp" :
  413. iRow = grd_recitemanptinfo.row;
  414. var sStatus = model.getValue(xRecItemAnptListPath+"["+iRow+"]/status");
  415. var sRecFlag = model.getValue(xRecItemAnptListPath+"["+iRow+"]/recflag");
  416. var sRecCharFlag = model.getValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag");
  417. sItemCD = model.getValue(xRecItemAnptListPath+"["+iRow+"]/itemcd");
  418. if(pReSrchYN == null){
  419. fSrchPrcpInfo();
  420. btn_saveprcpinfo.disabled = true;
  421. btn_delprcpinfo.disabled = true;
  422. rdo_cathflag.disabled = true;
  423. btn_srchprcp.disabled = true;
  424. ipt_prcpnm.disabled = true;
  425. btn_rgstprcp.disabled = true;
  426. if(sRecCharFlag == ""){
  427. messageBox("현재 기록지 등록이 되어있지","E007");
  428. return;
  429. }
  430. if(sItemCD == "" && sRecCharFlag != ""){
  431. messageBox("항목 저장이 된 상태에서만 등록할 수 있습니다. 현재 저장하지","E007");
  432. return;
  433. }
  434. if(instance1.selectSingleNode("/root/main/recinfo").xml != instance1.selectSingleNode("/root/temp/main/recinfo").xml){
  435. sRtn = messageBox("변경된 데이터가 있습니다. 계속 진행시 저장이 되지 않습니다.","Q003");
  436. if(sRtn != 6){
  437. return;
  438. }
  439. }
  440. if(sRecFlag == "B" || sRecFlag == "C"){
  441. messageBox("Intake 와 Output은 처방 등록을 할 수","I004");
  442. return;
  443. }
  444. model.setValue(xCondPath+"/recflag",sRecFlag);
  445. btn_saveprcpinfo.disabled = false;
  446. btn_delprcpinfo.disabled = false;
  447. btn_srchprcp.disabled = false;
  448. ipt_prcpnm.disabled = false;
  449. btn_rgstprcp.disabled = false;
  450. if(sRecFlag == "D"){
  451. rdo_cathflag.disabled = false;
  452. model.setValue(xCondPath+"/cathflag","A");
  453. }else{
  454. rdo_cathflag.disabled = true;
  455. }
  456. model.toggle("prcpmapping");
  457. btn_prcpmapping.selected = true;
  458. }
  459. model.removenode("/root/send");
  460. model.makeValue("/root/send/itemcd",sItemCD);
  461. model.makeValue("/root/send/recflag",sRecFlag);
  462. if(submit("TRMNR03106")){
  463. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  464. model.removenodeset(xPrcpSrchPath);
  465. grd_prcpsrchinfo.rebuild();
  466. }
  467. model.refresh();
  468. break;
  469. case "detlattr":
  470. iRow = grd_attrinfo.row;
  471. if (iRow < 1 ){
  472. if(grd_attrinfo.rows < 1){
  473. return;
  474. }else{
  475. iRow = 1;
  476. }
  477. }
  478. if(model.getValue(xAttrListPath+"["+iRow+"]/attrcd") != ""){
  479. model.makeValue("/root/send/attrcd", model.getValue(xAttrListPath+"["+iRow+"]/attrcd"));
  480. submit("TRMNR03105");
  481. }
  482. break;
  483. }
  484. }
  485. /**
  486. * @group :
  487. * @ver : 2007.05.04
  488. * @by : 이은영
  489. * @---------------------------------------------------
  490. * @type : function
  491. * @access : public
  492. * @desc : 그리드 클릭시..
  493. * @param : pFlag ( item : 상세 항목 조회)
  494. * @return :
  495. * @---------------------------------------------------
  496. */
  497. function fClickedGridRow(pFlag){
  498. var iRow = 0;
  499. var sDepth = 0;
  500. var sItemCD = "";
  501. var sRecFlag = ""; // 기록구분
  502. var sBoolStatus = true; //
  503. var iDepth = 0;
  504. var sLnkbizcd = "";
  505. var sComnyn = "";
  506. switch(pFlag){
  507. case "item":
  508. iRow = grd_srchitem.row;
  509. if(iRow < 1 || !grd_srchitem.isCell(event.target)) return;
  510. fClearValue("ttl");
  511. sDepth = eval(model.getValue(xItemSrchPath+"["+iRow+"]/depth"));
  512. sItemCD = model.getValue(xItemSrchPath+"["+iRow+"]/itemcd");
  513. sLnkbizcd = model.getValue(xItemSrchPath+"["+iRow+"]/lnkbizcd");
  514. sComnyn = model.getValue(xItemSrchPath+"["+iRow+"]/comnyn");
  515. model.setValue(xCondPath+"/itemcd",sItemCD);
  516. model.removenode("/root/send");
  517. model.makeValue("/root/send/itemcd", sItemCD);
  518. model.makeValue("/root/send/delinclyn", "Y");
  519. // 트리 변경
  520. if(grd_srchitem.iscollapsed(iRow) == true){
  521. sBoolStatus = false;
  522. }else{
  523. sBoolStatus = true;
  524. }
  525. for(var i=iRow; i<=grd_srchitem.rows - grd_srchitem.fixedrows; i++){
  526. iDepth = eval(model.getValue(xItemSrchPath+"["+i+"]/depth"));
  527. if(i==iRow){
  528. grd_srchitem.iscollapsed(i) = sBoolStatus;
  529. }else if(i != iRow && sDepth < iDepth){
  530. grd_srchitem.iscollapsed(i) = sBoolStatus;
  531. }else{
  532. break;
  533. }
  534. }
  535. if(submit("TRMNR03101_SJH", false)){
  536. model.copyNode(xItemInfoPath, xHiddenItemInfoPath);
  537. copyNodeset(xAttrListPath,"/root/temp/recinfo/attrlist");
  538. copyNodeset(xICNPInfoPath,"/root/temp/recinfo/icnpinfo");
  539. if(sDepth == 1){ // 분류
  540. model.setValue(xCondPath+"/clscd", "");
  541. cmb_clscd.disabled = true;
  542. }else{
  543. model.setValue(xCondPath+"/clscd", model.getValue(xItemInfoPath+"/supcd"));
  544. }
  545. if(model.getValue(xItemInfoPath+"/supcd") == "IT000009"){ //삽관인 경우만 배액감시조회여부 선택 가능
  546. cmb_drainchk.disabled = false;
  547. }else{
  548. cmb_drainchk.disabled = true;
  549. }
  550. model.refresh();
  551. for(var i = grd_recitemanptinfo.fixedrows; i <= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; i++){
  552. sRecFlag = model.getValue(xRecItemAnptListPath+"["+i+"]/recflag");
  553. model.setValue(xRecItemAnptListPath+"["+i+"]/reccharflag" , model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/reccharflag"));
  554. model.setValue(xRecItemAnptListPath+"["+i+"]/prcpyn" , model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/prcpyn"));
  555. model.setValue(xRecItemAnptListPath+"["+i+"]/maintotalyn" , model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/maintotalyn"));
  556. model.setValue(xRecItemAnptListPath+"["+i+"]/maintotalcd" , model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/maintotalcd"));
  557. model.setValue(xRecItemAnptListPath+"["+i+"]/subtotalyn" , model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/subtotalyn"));
  558. model.setValue(xRecItemAnptListPath+"["+i+"]/subtotalnm" , model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/subtotalnm"));
  559. model.setValue(xRecItemAnptListPath+"["+i+"]/runtotalyn" , model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/runtotalyn"));
  560. model.setValue(xRecItemAnptListPath+"["+i+"]/runtotalnm" , model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/runtotalnm"));
  561. model.setValue(xRecItemAnptListPath+"["+i+"]/style" , model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/style"));
  562. fCtrlRecLnkGrid(sRecFlag, i);
  563. if(model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/reccharflag") != "") model.setValue(xRecItemAnptListPath+"["+i+"]/status","-");
  564. model.setValue(xRecItemAnptListPath+"["+i+"]/itemcd", sItemCD);
  565. }
  566. grd_recitemanptinfo.row = 0;
  567. model.recalculate();
  568. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  569. fSrchPrcpInfo(); // 처방 매핑 정보
  570. }
  571. //fDblClickedGrid("detlattr");
  572. break;
  573. }
  574. }
  575. /**
  576. * @group :
  577. * @ver : 2007.05.04
  578. * @by : 이은영
  579. * @---------------------------------------------------
  580. * @type : function
  581. * @access : public
  582. * @desc : 찾기
  583. * @param : pFlag ( term : 용어찾기, attr : 속성찾기, detlattr : 상세속성검색)
  584. * @return :
  585. * @---------------------------------------------------
  586. */
  587. function fSrchItemInfo(pFlag){
  588. model.removenode("/root/send");
  589. var sItemNM = ""; //항목명
  590. var sItemCD = ""; //항목코드
  591. var sSupCD = ""; //상위코드
  592. switch(pFlag){
  593. case "term":
  594. sItemNM = model.getValue(xItemInfoPath+"/itemnm");
  595. if(sItemNM == ""){
  596. messageBox("Item명을 먼저","C001");
  597. return;
  598. }
  599. model.makeValue("/root/send/itemnm", sItemNM);
  600. submit("TRMNR03103");
  601. break;
  602. case "attr":
  603. sItemNM = model.getValue(xItemInfoPath+"/itemnm");
  604. sItemCD = model.getValue(xItemInfoPath+"/itemcd");
  605. sSupCD = model.getValue(xItemInfoPath+"/supcd");
  606. if(sSupCD == "*"){
  607. messageBox("분류명은 속성을 등록할 수","I004");
  608. return;
  609. }
  610. if(sItemNM == ""){
  611. messageBox("Item명을 먼저","C001");
  612. return;
  613. }
  614. model.removenodeset(xAttrSrchPath);
  615. model.makeValue("/root/send/itemnm", sItemNM);
  616. model.makeValue("/root/send/itemcd", sItemCD);
  617. submit("TRMNR03104");
  618. break;
  619. }
  620. }
  621. /**
  622. * @group :
  623. * @ver : 2007.05.04
  624. * @by : 이은영
  625. * @---------------------------------------------------
  626. * @type : function
  627. * @access : public
  628. * @desc : 팝업창 호출
  629. * @param : pFlag ( attr : 속성등록, icnp: icnp 용어등록)
  630. * @return :
  631. * @---------------------------------------------------
  632. */
  633. function fCallPopUp(pFlag){
  634. var xpos = event.screenX-500;
  635. var ypos = event.screenY-300;
  636. switch(pFlag){
  637. case "attr":
  638. var sSupCD = model.getValue(xItemInfoPath+"/supcd");
  639. if(sSupCD == "*"){
  640. messageBox("분류명은 속성을 등록할 수","I004");
  641. return;
  642. }
  643. model.makeValue("/root/temp/refinfo/flag","p");
  644. //modal("SMMNR01700",1, xpos, ypos,"SMMNR01700","/root/temp/refinfo","/root/temp/refinfo");
  645. modal("SMMNR01700",1, xpos, ypos,"SMMNR01700","/root/temp/refinfo","/root/hidden/refinfo");
  646. var sAttrInfo = getParameter("SMMNR01700_Retrun").split("▩");
  647. setParameter("SMMNR01700_Retrun", "");
  648. if(sAttrInfo == "") return;
  649. var sValue = sAttrInfo[1].split("▦");
  650. if(model.getValue(xAttrListPath+"[attrcd = '"+sValue[0]+"']/attrcd") != "") return;
  651. grd_attrinfo.addItem();
  652. iRow = grd_attrinfo.rows - grd_attrinfo.fixedrows;
  653. model.setValue(xAttrListPath+"["+iRow+"]/status", "I");
  654. model.setValue(xAttrListPath+"["+iRow+"]/attrcd", sValue[0]);
  655. model.setValue(xAttrListPath+"["+iRow+"]/attrnm", sValue[1]);
  656. model.setValue(xAttrListPath+"["+iRow+"]/attrflag", sValue[2]);
  657. model.setValue(xAttrListPath+"["+iRow+"]/plnumchoiyn", sValue[3]);
  658. model.setValue(xAttrListPath+"["+iRow+"]/refseq", sValue[4]);
  659. model.setValue(xAttrListPath+"["+iRow+"]/check", "true");
  660. model.setValue(xAttrListPath+"["+iRow+"]/itemcd", model.getValue(xItemInfoPath+"/itemcd"));
  661. grd_attrinfo.rebuild();
  662. break;
  663. case "icnp":
  664. var iRow = grd_icnpinfo.row;
  665. if(iRow < 1){
  666. messageBox("ICNP 매핑할 용어가","I004");
  667. return;
  668. }
  669. model.makeValue("/root/temp/refinfo/flag","p");
  670. modal("SMMNR01200",1, xpos, ypos,"SMMNR01200","/root/temp/refinfo","/root/hidden/refinfo");
  671. var sTermInfo = getParameter("terminfo");
  672. var sValue = sTermInfo.split("▦");
  673. model.setValue(xICNPInfoPath+"["+iRow+"]/smnttypenm", sValue[0]);
  674. model.setValue(xICNPInfoPath+"["+iRow+"]/termcd", sValue[1]);
  675. model.setValue(xICNPInfoPath+"["+iRow+"]/icnphngterm", sValue[2]);
  676. model.setValue(xICNPInfoPath+"["+iRow+"]/icnpengterm", sValue[3]);
  677. grd_icnpinfo.rebuild();
  678. break;
  679. case "prcp" :
  680. if(model.getValue(xCondPath+"/prcpnm") == ""){
  681. messageBox("검색어를","C001");
  682. return;
  683. }
  684. var iRow = 0;
  685. setParameter("prcpsrchflag","nm");
  686. setParameter("srchtextval",model.getValue(xCondPath+"/prcpnm"));
  687. setParameter("scrnflag","rec");
  688. setParameter("srchParam","srchSET");
  689. setParameter("rtnpath","/root/main/srchinfo/prcpsrch");
  690. modal("SPMNW11100");
  691. grd_prcpsrchinfo.rebuild();
  692. iRow = grd_prcpsrchinfo.rows - grd_prcpsrchinfo.fixedrows;
  693. model.makeNode(xPrcpSrchPath+"["+iRow+"]/check");
  694. model.setValue(xCondPath+"/prcpnm","");
  695. grd_prcpsrchinfo.rebuild();
  696. model.refresh();
  697. break;
  698. }
  699. }
  700. /**
  701. * @group :
  702. * @ver : 2007.05.04
  703. * @by : 이은영
  704. * @---------------------------------------------------
  705. * @type : function
  706. * @access : public
  707. * @desc : 그리드 삭제
  708. * @param : pFlag ( attr : 속성찾기, rec: 기록지연계정보)
  709. * @return :
  710. * @---------------------------------------------------
  711. */
  712. function fDelGridRow(pFlag){
  713. var iRow = 0;
  714. var sStatus = "";
  715. switch(pFlag){
  716. case "attr": // 속성
  717. iRow = grd_attrinfo.row;
  718. if(iRow < 1) return;
  719. sStatus = model.getValue(xAttrListPath+"["+iRow+"]/status");
  720. if(sStatus == "I"){
  721. grd_attrinfo.deleteItem(iRow);
  722. model.removenodeset(xAttrSrchPath);
  723. grd_detlattrinfo.rebuild();
  724. }else if(sStatus == "D"){
  725. model.setValue(xAttrListPath+"["+iRow+"]/status","-");
  726. model.setValue(xAttrListPath+"["+iRow+"]/check","true");
  727. }else{
  728. model.setValue(xAttrListPath+"["+iRow+"]/status","D");
  729. model.setValue(xAttrListPath+"["+iRow+"]/check","false");
  730. }
  731. break;
  732. case "prcp":
  733. iRow = grd_prcpinfo.row;
  734. if(iRow < 1) return;
  735. sStatus = model.getValue(xPrcpInfoPath+"["+iRow+"]/status");
  736. if(sStatus == "I"){
  737. grd_prcpinfo.deleteItem(iRow);
  738. }else if(sStatus == "D"){
  739. model.setValue(xPrcpInfoPath+"["+iRow+"]/status","-");
  740. }else{
  741. model.setValue(xPrcpInfoPath+"["+iRow+"]/status","D");
  742. }
  743. grd_prcpinfo.rebuild();
  744. break;
  745. }
  746. }
  747. /**
  748. * @group :
  749. * @ver : 2007.05.04
  750. * @by : 이은영
  751. * @---------------------------------------------------
  752. * @type : function
  753. * @access : public
  754. * @desc : 그리드 추가
  755. * @param : pFlag ( item : 기록지 연계 정보, prcp : 처방정보)
  756. * @return :
  757. * @---------------------------------------------------
  758. */
  759. function fAddGridRow(pFlag){
  760. var iRow = 0;
  761. switch(pFlag){
  762. case "prcp":
  763. var sSetNo = "";
  764. var sSetTypeCd = "";
  765. var sSetCdNo = "";
  766. var sPrcpcd = "";
  767. var sPrcpPkSpec;
  768. var sItemCD = model.getValue(xCondPath+"/itemcd");
  769. var sRecFlag = model.getValue(xCondPath+"/recflag");
  770. var sCathFlag = model.getValue(xCondPath+"/cathflag");
  771. var sInsLastRow = 0;
  772. if(sRecFlag == ""){
  773. messageBox("기록지를 먼저", "C002");
  774. return;
  775. }
  776. if(sRecFlag == "D" && sCathFlag ==""){
  777. messageBox("Catheter 기록은 Catheter 구분은", "I003");
  778. return;
  779. }
  780. for(var iRow = grd_prcpsrchinfo.fixedrows; iRow<= (grd_prcpsrchinfo.rows-grd_prcpsrchinfo.fixedrows); iRow++){
  781. if(model.getValue(xPrcpSrchPath+"["+iRow+"]/check") == "true"){
  782. sPrcpPkSpec = model.getValue(xPrcpSrchPath+"["+iRow+"]/prcppkspec").split("|");
  783. sSetNo = sPrcpPkSpec[0];
  784. sSetTypeCd = sPrcpPkSpec[1];
  785. sSetCdNo = sPrcpPkSpec[2];
  786. sPrcpcd = model.getValue(xPrcpSrchPath+"["+iRow+"]/prcpcd");
  787. if(model.getValue(xPrcpInfoPath+"[prcpcd='"+sPrcpcd+"' and cateprcpflag='"+sCathFlag+"' and recflag='"+sRecFlag+"']/prcpcd") == ""){
  788. grd_prcpinfo.addItem();
  789. sRow = grd_prcpinfo.rows - grd_prcpinfo.fixedrows;
  790. model.setValue(xPrcpInfoPath+"["+sRow+"]/status","I");
  791. model.setValue(xPrcpInfoPath+"["+sRow+"]/itemcd",sItemCD); // 항목코드
  792. model.setValue(xPrcpInfoPath+"["+sRow+"]/recflag",sRecFlag); // 기록구분
  793. model.setValue(xPrcpInfoPath+"["+sRow+"]/prcpcd",model.getValue(xPrcpSrchPath+"["+iRow+"]/prcpcd")); // 처방코드
  794. model.setValue(xPrcpInfoPath+"["+sRow+"]/cateprcpflag",model.getValue(xCondPath+"/cathflag")); // catheter 구분
  795. model.setValue(xPrcpInfoPath+"["+sRow+"]/prcpnm",model.getValue(xPrcpSrchPath+"["+iRow+"]/prcpnm")); // 처방명
  796. model.setValue(xPrcpInfoPath+"["+sRow+"]/drugmthdspccd",model.getValue(xPrcpSrchPath+"["+iRow+"]/drugmthdspccd")); // 규격
  797. sInsLastRow = sRow;
  798. }
  799. }
  800. }
  801. grd_prcpinfo.rebuild();
  802. if(sInsLastRow > 0 ){
  803. grd_prcpinfo.topRow = sInsLastRow;
  804. }
  805. break;
  806. }
  807. }
  808. /**
  809. * @group :
  810. * @ver : 2007.05.04
  811. * @by : 이은영
  812. * @---------------------------------------------------
  813. * @type : function
  814. * @access : public
  815. * @desc : 그리드 값 변경시
  816. * @param :
  817. * @return :
  818. * @---------------------------------------------------
  819. */
  820. function fChangedGridRow(pFlag){
  821. var iRow = 0;
  822. var sCheck = "";
  823. var sStatus = "";
  824. var sSupCD = ""; // 상위코드
  825. switch(pFlag){
  826. case "attr" : // 속성
  827. iRow = grd_attrinfo.row;
  828. if(iRow < 1) return;
  829. var attrcd = model.getValue(xAttrListPath+"["+iRow+"]/attrcd");
  830. var sRefSeq = model.getValue(xAttrListPath+"["+iRow+"]/refseq");
  831. sCheck = model.getValue(xAttrListPath+"["+iRow+"]/check");
  832. sStatus = model.getValue(xAttrListPath+"["+iRow+"]/status");
  833. if(sCheck == "false" && (sStatus == "-" || sStatus == "U")){
  834. model.setValue(xAttrListPath+"["+iRow+"]/status","D");
  835. }else if(sCheck == "true" && sStatus == "D"){
  836. model.setValue(xAttrListPath+"["+iRow+"]/status","-");
  837. }
  838. if(sRefSeq != model.getValue(xHiddenAttrListPath+"[attrcd='"+attrcd+"']/refseq")){
  839. if(model.getValue(xAttrListPath+"["+iRow+"]/status") == "-"){
  840. model.setValue(xAttrListPath+"["+iRow+"]/status","U");
  841. model.setValue(xAttrListPath+"["+iRow+"]/check","true");
  842. }
  843. }
  844. grd_attrinfo.rebuild();
  845. break;
  846. case "rec" :
  847. iRow = grd_recitemanptinfo.row;
  848. if(iRow < 1) return;
  849. sSupCD = model.getValue(xItemInfoPath+"/supcd");
  850. if(sSupCD == "*"){
  851. messageBox("분류명은 기록지 연계 정보를 입력할 수","I004");
  852. model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag","");
  853. grd_recitemanptinfo.refresh();
  854. return;
  855. }
  856. sStatus = model.getValue(xRecItemAnptListPath+"["+iRow+"]/status");
  857. var sRecFlag = model.getValue(xRecItemAnptListPath+"["+iRow+"]/recflag");
  858. //수정 2008-05-28
  859. //var sRecCharFlag = grd_recitemanptinfo.combo.input.currentText;
  860. var sRecCharFlag = grd_recitemanptinfo.valueMatrix(iRow, grd_recitemanptinfo.colRef("reccharflag"));
  861. for(var iRecRow=grd_recitemanptinfo.fixedrows; iRecRow<= grd_recitemanptinfo.rows-grd_recitemanptinfo.fixedrows; iRecRow++){
  862. if(iRecRow == iRow) continue;
  863. if(sRecCharFlag == "A" && sRecCharFlag == model.getValue(xRecItemAnptListPath+"["+iRecRow+"]/reccharflag")){ // 주체는 한개만 존재
  864. messageBox("주체는 두개 이상을 입력","E001");
  865. model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag", "");
  866. //2008-05-28 수정
  867. // if(sStatus == "I"){
  868. // model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag", "");
  869. // }else{
  870. // model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag", model.getValue(xHiddenRecItemAnptListPath+"[recflag='"+sRecFlag+"']/reccharflag"));
  871. // }
  872. grd_recitemanptinfo.refresh();
  873. return;
  874. }
  875. }
  876. if(sStatus == "I") return;
  877. if(sRecCharFlag == ""){
  878. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","D");
  879. }else{
  880. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","U");
  881. }
  882. model.setFocus("body");
  883. model.setFocus("grd_recitemanptinfo");
  884. break;
  885. }
  886. }
  887. /**
  888. * @group :
  889. * @ver : 2007.05.07
  890. * @by : 이은영
  891. * @---------------------------------------------------
  892. * @type : function
  893. * @access : public
  894. * @desc : 분류명 변경시
  895. * @param :
  896. * @return :
  897. * @---------------------------------------------------
  898. */
  899. function fChangedItem(){
  900. var sNewClsCD = model.getValue(xCondPath+"/clscd");
  901. var sClsCD = model.getValue(xItemSrchPath+"[itemcd ='"+sNewClsCD+"']/itemcd");
  902. var sClsYN = model.getValue(xCondPath+"/clsyn");
  903. if(sClsYN != "Y" && sClsCD == ""){
  904. messageBox("등록되어 있는 분류명을","C002" );
  905. model.setValue(xCondPath+"/clscd", model.getValue(xItemInfoPath+"/supcd"));
  906. cmb_clscd.refresh();
  907. }else if(sClsYN == "Y" && sNewClsCD == sClsCD){
  908. messageBox("이미 등록된 분류명","E008" );
  909. model.setValue(xCondPath+"/clscd", "");
  910. cmb_clscd.refresh();
  911. }
  912. if(sClsYN != "Y"){
  913. model.setValue(xItemInfoPath+"/supcd",sNewClsCD);
  914. }
  915. }
  916. /**
  917. * @group :
  918. * @ver : 2007.05.10
  919. * @by : 이은영
  920. * @---------------------------------------------------
  921. * @type : function
  922. * @access : public
  923. * @desc : 처방 매핑 정보
  924. * @param :
  925. * @return :
  926. * @---------------------------------------------------
  927. */
  928. function fSrchPrcpInfo(){
  929. var idx = swt_prcpinfo.selectedIndex;
  930. switch(idx){
  931. case 0: // 처방Mapping
  932. var iRow = grd_recitemanptinfo.row;
  933. if(iRow < 1){
  934. model.removeNodeset(xPrcpInfoPath);
  935. model.setValue(xCondPath+"/recflag","");
  936. model.setValue(xCondPath+"/cathflag","");
  937. model.setValue(xCondPath+"/prcpautogenr","");
  938. model.copyNode("/root/temp/main/recinfo/prcpinfo","/root/main/recinfo/prcpinfo");
  939. grd_prcpinfo.rebuild();
  940. model.refresh();
  941. }
  942. break;
  943. case 1: // Mapping내역조회
  944. var sItemcd = model.getValue(xCondPath+"/itemcd");
  945. if(sItemcd == ""){
  946. model.removenodeset("/root/main/srchinfo/prcpmappinfo");
  947. grd_prcpmappinfo.rebuild();
  948. return;
  949. }
  950. model.removenode("/root/send");
  951. model.makeValue("/root/send/itemcd",sItemcd);
  952. submit("TRMNR03107");
  953. break;
  954. }
  955. }
  956. /**
  957. * @group :
  958. * @ver : 2007.05.10
  959. * @by : 이은영
  960. * @---------------------------------------------------
  961. * @type : function
  962. * @access : public
  963. * @desc : 팝업 메뉴 SETTING
  964. * @param :
  965. * @return :
  966. * @---------------------------------------------------
  967. */
  968. function fSettingPopUpMenu(){
  969. if(event.button == 3){
  970. if(grd_srchitem.isCell(event.target) && grd_srchitem.mouseRow >= grd_srchitem.fixedrows){
  971. window.setPopupMenu(true, "/root/temp/popmenu/careitem/menu", "name", "func", false);
  972. }else{
  973. window.setPopupMenu(false);
  974. }
  975. }
  976. }
  977. /**
  978. * @group :
  979. * @ver : 2007.05.14
  980. * @by : 이은영
  981. * @---------------------------------------------------
  982. * @type : function
  983. * @access : public
  984. * @desc : 신규 항목 추가시
  985. * @param :
  986. * @return :
  987. * @---------------------------------------------------
  988. */
  989. function fAddItem(){
  990. var iRow = grd_srchitem.row;
  991. var sRtn = 0;
  992. var sItemCD = "";
  993. var sDepth = 0;
  994. var sSupCD = "";
  995. var sItemCD = "";
  996. var sRefSeq = 0;
  997. if(iRow < 1) return;
  998. if(instance1.selectSingleNode("/root/main/recinfo").xml != instance1.selectSingleNode("/root/temp/main/recinfo").xml){
  999. sRtn = messageBox("변경된 데이터가 있습니다.","Q003");
  1000. if(sRtn != 6){
  1001. sItemCD = model.getValue(xCondPath+"/itemcd");
  1002. iRow = grd_srchitem.findRow(sItemCD,1,2);
  1003. grd_srchitem.isSelected(iRow)=true;
  1004. return;
  1005. }
  1006. }
  1007. sDepth = eval(model.getValue(xItemSrchPath+"["+iRow+"]/depth"));
  1008. sSupCD = model.getValue(xItemSrchPath+"["+iRow+"]/supcd");
  1009. sItemCD = model.getValue(xItemSrchPath+"["+iRow+"]/itemcd");
  1010. sRefSeq = parseInt(model.getValue(xItemSrchPath+"["+iRow+"]/refseq")) + 1;
  1011. fClearValue();
  1012. if(sDepth == 1){
  1013. model.setValue(xItemInfoPath+"/supcd",sItemCD);
  1014. model.setValue(xCondPath+"/clscd",sItemCD);
  1015. model.setValue(xItemInfoPath+"/refseq", 0);
  1016. }else{
  1017. model.setValue(xItemInfoPath+"/supcd", sSupCD);
  1018. model.setValue(xCondPath+"/clscd",sSupCD);
  1019. model.setValue(xItemInfoPath+"/refseq",sRefSeq);
  1020. }
  1021. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  1022. model.refresh();
  1023. }
  1024. /**
  1025. * @group :
  1026. * @ver : 2010.01.19
  1027. * @by : 양천덕
  1028. * @---------------------------------------------------
  1029. * @type : function
  1030. * @access : public
  1031. * @desc : 기록지 연계 정보 그리드 변경시 호출
  1032. * @param : pRecFlag -> 기록구분
  1033. * pRow -> Row정보
  1034. * @return :
  1035. * @---------------------------------------------------
  1036. */
  1037. function fCtrlRecLnkGrid(pRecFlag, pRow){
  1038. //기록구분이 임상관찰, intake, output에 해당함.
  1039. if((pRecFlag == "A" || pRecFlag == "B" || pRecFlag == "C") && model.getValue(xRecItemAnptListPath+"[recflag = '"+pRecFlag+"']/reccharflag") != ""){
  1040. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("style"), pRow, grd_recitemanptinfo.colRef("maintotalyn")) = false;
  1041. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("style") , pRow, grd_recitemanptinfo.colRef("subtotalyn") ) = false;
  1042. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("style") , pRow, grd_recitemanptinfo.colRef("runtotalyn") ) = false;
  1043. if(model.getValue(xRecItemAnptListPath+"[recflag = '"+pRecFlag+"']/maintotalyn") == "Y"){
  1044. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("maintotalcd"), pRow, grd_recitemanptinfo.colRef("maintotalcd")) = false;
  1045. if(pRecFlag != model.getValue("/root/init/itemgrpmapinfo/itemgrpmaplist[cdid ='" + grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("maintotalcd")) + "']/recflag") &&
  1046. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("maintotalcd")) != "-" ){
  1047. messageBox("Total Group 매핑 Item 분류와 기록구분이 동일해야 합니다.", "E000");
  1048. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("maintotalcd")) = "-";
  1049. return;
  1050. }
  1051. }else{
  1052. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("maintotalcd")) = "-";
  1053. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("maintotalcd"), pRow, grd_recitemanptinfo.colRef("maintotalcd")) = true;
  1054. }
  1055. if(model.getValue(xRecItemAnptListPath+"[recflag = '"+pRecFlag+"']/subtotalyn") == "Y"){
  1056. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("subtotalnm"), pRow, grd_recitemanptinfo.colRef("subtotalnm")) = false;
  1057. }else{
  1058. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("subtotalnm" )) = "" ;
  1059. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("subtotalnm"), pRow, grd_recitemanptinfo.colRef("subtotalnm")) = true;
  1060. }
  1061. if(model.getValue(xRecItemAnptListPath+"[recflag = '"+pRecFlag+"']/runtotalyn") == "Y"){
  1062. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("runtotalnm"), pRow, grd_recitemanptinfo.colRef("runtotalnm")) = false;
  1063. }else{
  1064. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("runtotalnm" )) = "" ;
  1065. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("runtotalnm"), pRow, grd_recitemanptinfo.colRef("runtotalnm")) = true;
  1066. }
  1067. }else{
  1068. grd_recitemanptinfo.isReadOnly(pRow, grd_recitemanptinfo.colRef("style"), pRow, grd_recitemanptinfo.colRef("runtotalnm")) = true;
  1069. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("style" )) = "" ;
  1070. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("maintotalyn")) = "N";
  1071. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("subtotalyn" )) = "N";
  1072. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("runtotalyn" )) = "N";
  1073. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("maintotalcd")) = "-";
  1074. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("subtotalnm" )) = "" ;
  1075. grd_recitemanptinfo.valueMatrix(pRow, grd_recitemanptinfo.colRef("runtotalnm" )) = "" ;
  1076. }
  1077. }