/* - ¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì ¸¶ÃëȯÀÚ±â·Ï ( SPMMR06000_¸¶ÃëȯÀÚ±â·ÏPCA.xrw - JScript ) - Version : 1) : Ver.1.00.01 2008-07-05 - ¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì */ var instcd = "012"; var anstrecno = ""; var currentdate = ""; /** * @desc : ÆûÃʱâÈ­ ( PCA TYPE , PCA MODE , 󹿏ñ·Ï °¡Á®¿À±â ) * @ * @param : * @return : * @--------------------------------------------------- */ function fFormInit() { anstrecno = window.opener.iv_anstinfo.model.getValue("/root/main/anstinfo/anstrecno"); // ÇöÀçÀϽà currentdate = getCurrentDate() + getCurrentTime(); model.setValue("/root/send/reqdata/currentdate" , currentdate); // PCA TYPE ¸ñ·Ï (SET) model.setValue("/root/send/reqdata/settype", "P"); model.setValue("/root/send/reqdata/clscd", "5"); submit("TRMMR06000","","/root/send/reqdata", "/root/init/pcatypelist/item"); // PCA MODE ¸ñ·Ï (°øÅëÄÚµå) zbcfGetCodeList(new Array("M0482"), new Array("/root/init/M0482")); model.refresh(); // ¿ë¹ý °¡Á®¿À±â.. copyNodeset("/root/hidden/tmedmthd/tmedmthdlist", "/root/hidden/tmedmthd/tmedmthdlist", "replace", model, window.parent.iv_anstprcp.model); model.refresh(); // ¸¶ÃëȯÀÚÀÇ PCA type, mode, total vol Á¤º¸¸¦ °¡Á®¿È var pcatypecd = window.opener.iv_anstinfo.model.getValue("/root/main/anstinfo/pcatypecd"); var pcamodecd = window.opener.iv_anstinfo.model.getValue("/root/main/anstinfo/pcamodecd"); var pcatotvol = window.opener.iv_anstinfo.model.getValue("/root/main/anstinfo/pcatotvol"); model.setValue("/root/main/pcainfo/pcatypecd", pcatypecd); model.setValue("/root/main/pcainfo/pcamodecd", pcamodecd); model.setValue("/root/main/pcainfo/pcatotvol", pcatotvol); model.setValue("/root/send/reqdata/pcatypecd", pcatypecd); model.setValue("/root/send/reqdata/pcamodecd", pcamodecd); model.refresh(); // PCA type ¿¡ µû¸¥ ó¹æ¼Â Á¶È¸ fPrcpSetItemDisplay(); // ¸¶ÃëȯÀÚÀÇ PCA ó¹æ Á¤º¸¸¦ °¡Á®¿È copyNodeset("/root/main/prcplist/item", "/root/main/anstprcp/item[pcaflag='Y']", "replace", model, window.parent.iv_anstprcp.model); model.refresh(); // Àüü ¼±ÅÃÀ» À§ÇÑ ±×¸®µå ¼Â.. grd_prcpset.fixedcellcheckbox(0,0) = true; // »ç¿ëÀÚ Á÷Á¾¿¡ µû¸¥ ±ÇÇÑ ¹öư ó¸®. // ÀÇ»ç : 0330 // 1. ÀúÀå¹öư var drChkFlag = fGetHardCDList("1"); if (drChkFlag == "true") { grp_pca.disabled = false; } } /** * @group : PCA TYPE ¸ñ·Ï ¼±Åýà SET ¾ÆÀÌÅÛ º¸¿©ÁÖ±â * @ver : 2007-08-24 * @by : ÀÌÀº¿µ * @--------------------------------------------------- * @type : function * @access : public * @desc : * @--------------------------------------------------- */ function fPrcpSetItemDisplay() { model.setValue("/root/send/setinfo/setcd",cbo_pcatype.value); // ÇöÀçÀϽà currentdate = getCurrentDate() + getCurrentTime(); model.setValue("/root/send/setinfo/currentdate" , currentdate); // ¸¶Ãëó¹æ SET ¾ÆÀÌÅÛ Á¶È¸Çϱâ.. submit("TRMMR04206"); } /** * @desc : ³ëµå¼Â °¹¼ö ±¸Çϱâ * @ * @param : * @ * @return : * @author : * @--------------------------------------------------- */ function getNodeList(strPath) { var node = instance1.selectNodes(strPath); if(node == null) return 0; return node; } /** * @desc : ¸¶¿ì½º ¿À¸¥ÂÊ ¹öư ÆË¾÷â * @ * @param : * @return : * @--------------------------------------------------- * */ function fMouseRghtBtnPopup(gridObj, job) { if (event.button == 3) { if (gridObj.isCell(event.target)) { if (job == "prcp") { window.setPopupMenu(true, "/root/hidden/menu6/menu", "label", "func", false); } } else { window.setPopupMenu(false); } } else { window.setPopupMenu(false); } } /** * @desc : Àû¿ë ¹öư Ŭ¸¯ * @param : * @ * @return : * @author : * @--------------------------------------------------- */ function fAddBtnClick(prcptype, clscd) { // type, mode var pcatypecd = model.getValue("/root/send/reqdata/pcatypecd"); var pcamodecd = model.getValue("/root/send/reqdata/pcamodecd"); model.setValue("/root/main/pcainfo/pcatypecd", pcatypecd); model.setValue("/root/main/pcainfo/pcamodecd", pcamodecd); model.refresh(); // type, mode ÀϹÝÁ¤º¸¿¡ set Çϱâ window.parent.iv_anstinfo.model.makeValue("/root/main/anstinfo/pcatypecd", pcatypecd); window.parent.iv_anstinfo.model.makeValue("/root/main/anstinfo/pcamodecd", pcamodecd); window.parent.iv_anstinfo.model.refresh(); fAddAnstPrcp(grd_prcpset,"/root/main/prcpsetitem/item"); copyNodeset("/root/main/prcplist/item", "/root/main/anstprcp/item[pcaflag='Y']", "replace", model, window.parent.iv_anstprcp.model); model.refresh(); } /** * @desc : type, mode, totvol Á¤º¸ ³Ñ°ÜÁÖ±â * @ * @param : * @return : * @author : * @--------------------------------------------------- */ function fSendData() { var pcatypecd = model.getValue("/root/main/pcainfo/pcatypecd"); var pcamodecd = model.getValue("/root/main/pcainfo/pcamodecd"); var pcatotvol = model.getValue("/root/main/pcainfo/pcatotvol"); window.opener.iv_anstinfo.model.makeValue("/root/main/anstinfo/pcatypecd", pcatypecd); window.opener.iv_anstinfo.model.makeValue("/root/main/anstinfo/pcamodecd", pcamodecd); window.opener.iv_anstinfo.model.makeValue("/root/main/anstinfo/pcatotvol", pcatotvol); window.opener.iv_anstinfo.model.refresh(); window.close(); } /** * @desc : ó¹æÃß°¡ ¹öư Ŭ¸¯½Ã 󹿏ñ·Ï¿¡ Ãß°¡ÇÑ´Ù. * @param : * @ * @return : * @author : * @--------------------------------------------------- */ function fAddAnstPrcp(gridObj, ref) { // 󹿏ñ·Ï ³ëµå var AddRef = "/root/main/anstprcp/item"; // ³ëµå °¹¼ö¸¦ °¡Á®¿ÂÈÄ ³ëµå Çϳª¸¦ Ãß°¡ÇÑ´Ù. var dataCnt = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef); // agent, drug, fluid, blood, prog for (var i=1 ; i < gridObj.rows ; i++) { var checked = model.getValue(ref+"[" + i + "]/checked"); if (checked == "true") { var prcpcd = model.getValue(ref+"[" + i + "]/prcpcd"); if (prcpcd != "" && prcpcd != null) { var prcptype = model.getValue(ref+"[" + i + "]/prcptype"); var clscd = model.getValue(ref+"[" + i + "]/clscd"); var prcpnm = model.getValue(ref+"[" + i + "]/prcpnm"); var abbrnm = model.getValue(ref+"[" + i + "]/abbrnm"); var prcpvol = model.getValue(ref+"[" + i + "]/prcpvol"); var prcpvolunitnm = model.getValue(ref+"[" + i + "]/prcpvolunitnm"); var drugmthdcd = model.getValue(ref+"[" + i + "]/drugmthdcd"); var prcpappyn = model.getValue(ref+"[" + i + "]/prcpappyn"); var totvolyn = model.getValue(ref+"[" + i + "]/totvolyn"); var sortno = model.getValue(ref+"[" + i + "]/sortno"); model.setValue(ref+"[" + i + "]/checked", "false"); // 󹿏ñ·Ï¿¡ ó¹æÄڵ尡 Àִ°¡? var cntprcpcd = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef+"[prcpcd = '" + prcpcd + "']"); if (cntprcpcd > 0 && prcptype != "F") { alert("ÀÌ¹Ì Ãß°¡µÇ¾ú½À´Ï´Ù. - [" + prcpnm+ "]"); /** ó¹æÀº Çѹø¸¸ ÇÑ´Ù..................................2007.10.09. // ó¹æÄڵ尡 ÀÖ´Ù¸é ¿ë·®¸¸ ´õÇÏÀÚ.. for (var j=1 ; j <= dataCnt ; j++) { var tmpprcpcd = model.getValue(AddRef+"[" + j + "]/prcpcd"); if (prcpcd == tmpprcpcd) { var tmpprcpvol = model.getValue(AddRef+"["+ j +"]/prcpvol"); prcpvol = Number(prcpvol) + Number(tmpprcpvol); model.setValue(AddRef+"["+ j +"]/prcpvol", prcpvol); break; } } */ } else { // ó¹æÄڵ尡 ¾ø´Ù¸é Ãß°¡ÇÏÀÚ.. var checkValue = window.parent.iv_anstprcp.model.getValue(AddRef+"["+dataCnt+"]/prcpnm"); if (checkValue != "" || dataCnt == "0") { dataCnt = dataCnt + 1; } // 2008.09.23. ¾î·Æ´Ù.. var prcpseqno = 0; for (var j=1 ; j <= dataCnt ; j++) { var tmp = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpcd"); if (tmp == prcpcd) { prcpseqno = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpseqno"); } } prcpseqno = parseInt(prcpseqno) + 1; window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpcd" , prcpcd); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcptype" , prcptype); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvol" , ""); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm" , prcpvolunitnm); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm2", prcpvolunitnm); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpnm" , prcpnm); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/abbrnm" , abbrnm); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/drugmthdcd" , drugmthdcd); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/recvol" , ""); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/remark" , ""); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/clscd" , clscd); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpappyn" , prcpappyn); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/totvolyn" , totvolyn); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/sortno" , sortno); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/pcaflag" , "Y"); window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/checked" , checked); // 2008.09.23. 2°³ÀÌ»ó ó¹æÄÚµå Ãß°¡ ±â·ÏÇϱâ.. (fluidÀ϶§) window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpseqno" , prcpseqno); window.parent.iv_anstprcp.model.refresh(); window.parent.javascript.fAddRow(prcptype, prcpcd, sortno, prcpseqno); } } } } // ±×¸®µå Á¤·ÄÈÄ ³ëµå¼Â Á¤·Ä window.parent.iv_anstprcp.window.javascript.fSetAnstPrcp(); // ¸ÞÀÎ ±×¸®µå Á¤·Ä window.parent.javascript.fGridSort(); } /** * @desc : PCA ¸ñ·Ï »èÁ¦ ¸Þ´º Ŭ¸¯½Ã 󹿏ñ·Ï¿¡¼­ »èÁ¦ÇÏ°í ¸ÞÀÎ ±×¸®µå¿¡¼­ »èÁ¦ÇÑ´Ù. * @ * @param : * @return : * @--------------------------------------------------- */ function fDelPrcpList() { var gridObj = grd_anstprcp; var ref = "/root/main/prcplist/item"; if (gridObj.row > 0 && gridObj.row < gridObj.rows) { var prcptype = model.getValue(ref+"["+ gridObj.row +"]/prcptype"); var prcpcd = model.getValue(ref+"["+ gridObj.row +"]/prcpcd"); // 2008.09.23. 2°³ÀÌ»ó ó¹æÄÚµå Ãß°¡ ±â·ÏÇϱâ.. (fluidÀ϶§) var prcpseqno = model.getValue(ref+"["+ gridObj.row +"]/prcpseqno"); // ³ëµå °¹¼ö¸¦ °¡Á®¿ÂÈÄ ³ëµå Çϳª¸¦ Ãß°¡ÇÑ´Ù. var dataCnt = getNodesetCnt(window.parent.iv_anstprcp.model, "/root/main/anstprcp/item"); for (var i = 1 ; i <= dataCnt ; i++) { var tmpprcpcd = window.parent.iv_anstprcp.model.getValue("/root/main/anstprcp/item["+ i +"]/prcpcd"); var tmpprcpseqno = window.parent.iv_anstprcp.model.getValue("/root/main/anstprcp/item["+ i +"]/prcpseqno"); if (tmpprcpcd == prcpcd && tmpprcpseqno == prcpseqno) { window.parent.iv_anstprcp.window.grd_anstprcp.row = i; window.parent.iv_anstprcp.window.javascript.fDelPrcpList(); break; } } } copyNodeset("/root/main/prcplist/item", "/root/main/anstprcp/item[pcaflag='Y']", "replace", model, window.parent.iv_anstprcp.model); model.refresh(); }