/** * ÆÄ ÀÏ ¸í : SPADT61400.js * ¼³ ¸í : (ÆË¾÷)¿ø³»ºÀÅõÃâ·Â Javascriot * ¼³ °è ÀÚ : °øµÎ°æ * ÀÛ ¼º ÀÚ : °øµÎ°æ * ¼öÁ¤ÀÌ·Â : 2007.09.20 / ÃÖÃÊÀÛ¼º / °øµÎ°æ */ var sSndMsg = ""; //¶óº§Ãâ·Â³»¿ë var iPoint = 0; //¶óº§Ãâ·Ârow var iCnt = 0; //¶óº§Ãâ·Â¸Å¼ö var iPageCnt = 1; //ÆäÀÌÁö¹øÈ£ Á¶È¸ /** * ÃʱâÈ­ */ function fInit() { var sParam = model.getAttribute("params"); model.makeValue("/root/send/prcpinfo/drugdd", astfMatrixData(sParam, 1, 0)); model.makeValue("/root/send/prcpinfo/drugno", astfMatrixData(sParam, 1, 1)); model.makeValue("/root/send/prcpinfo/ioflag", astfMatrixData(sParam, 1, 2)); model.makeValue("/root/send/prcpinfo/lblflag", astfMatrixData(sParam, 1, 3)); model.makeValue("/root/send/prcpinfo/liquidflag", astfMatrixData(sParam, 1, 4)); model.makeValue("/root/send/prcpinfo/reprintyn", astfMatrixData(sParam, 1, 5)); model.makeValue("/root/send/prcpinfo/autoinprntyn", astfMatrixData(sParam, 1, 6)); model.makeValue("/root/send/prcpinfo/atclblyn", astfMatrixData(sParam, 1, 8)); model.makeValue("/root/send/prcpinfo/prntflag", "O"); model.refresh(); submit("TRADT61301"); //fLBLPrint_knu("B"); fLBLPrint(); model.refresh(); window.close(); } /** * */ function fStopTimer() { window.clearinterval(gTimer); } function fSleep(numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; while (true) { now = new Date(); if (now.getTime() > exitTime) return; } } /** * ¶óº§Ãâ·Â */ function fLBLPrint() { /* ¶óº§ Sorting ·ÎÁ÷ //mgt¿¡¼­ vo·Î ¸®ÅÏ ´ëºÐ·ù - ³»º¹¾à, ¿Ü¿ë¾à, ÁÖ»ç, Ç×¾ÏÁ¦, TPN, ¸¶¾à, Áߺзù - ¹æ¹ýÄÚµå ¼ÒºÐ·ù - ³»º¹¾à,¿Ü¿ë¾à(¹æ¹ýÄÚµå), ÁÖ»ç,¸¶¾à,Ç×¾ÏÁ¦(mix) web js Ãâ·Â·ÎÁ÷ 1 ¾àÁ¾·ù(³»º¹¾à/ÁÖ»ç¾à/¿Ü¿ë¾à) 1.1 ¹æ¹ýÄÚµå 1.2 󹿼ö·® */ PrnKind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/prntkind"); PrnMarginLeft = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/blank/left"); PrnMarginTop = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/blank/top"); var commkind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/commkind"); for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){ // 20110519_laboru_¶óº§Ãâ·Â¿©ºÎ¿¡ µû¶ó var lblprntyn = model.getValue("/root/main/lbllist/lbllist["+ iPoint+"]/lblprntyn"); if(lblprntyn == "N") { model.removeNodeset("/root/main/lbllist/lbllist["+ iPoint +"]"); } else { var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls"); var mthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd"); var prcpmixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno"); // 20110414_laboru_°æºÏ´ëº´¿ø_ºÐ¸®¹øÈ£°¡ ´Üµ¶ ¿©ºÎº¸´Ù ¸ÕÀú üũ µÇ¾î¾ß ÇÔ. //var prcpmixno2 = model.getValue("/root/main/lbllist/lbllist["+parseInt(iPoint) + parseInt(1) +"]/prcpmixno"); // 20110414_laboru_°æºÏ´ëº´¿ø_ºÐ¸®¹øÈ£°¡ ´Üµ¶ ¿©ºÎº¸´Ù ¸ÕÀú üũ µÇ¾î¾ß ÇÔ. var atc_kind = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind"); if (mthdcd == "ZZZ" || mthdcd == "A10PQ") { //±âŸ¿ë¹ýÀ̰ųª 'ÇÊ¿ä½Ã º¹¿ëÇϽʽÿÀ' ¿ë¹ýÀÎ °æ¿ìµµ ´Üµ¶¶óº§Ãâ·Â sumcls = mthdcd; } //alert(fChkSumcls(iPoint)); if( fChkSumcls(iPoint) ){ //´Üµ¶¶óº§Ãâ·Â fIndependPrint(); } else { //ÀϹݶóº§Ãâ·Â fGnrlPrint(); } } } iPageCnt = 0; makeReportPreview(0,0,10, 10, ""); model.makeNode("/root/main/barcdprntsetup/prntsetupinfo"); model.copyNode("/root/main/barcdprntsetup/prntsetupinfo","/root/init/barcdprntsetup/prntsetupinfo"); fPrintRexbar("RFADT61400"); model.refresh(); } /** * */ function fIndependPrint() { model.makeNode("/root/main/prnt/lbllist[" +iPageCnt+ "]"); model.copyNode("/root/main/prnt/lbllist[" +iPageCnt+ "]", "/root/main/lbllist/lbllist["+iPoint+"]"); var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"); var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty"); var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty"); var qtyunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqtyunit"); var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims"); var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); //ó¹æÀϼö var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //¿ë¹ýÀϼö var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //¾àǰ¸¶½ºÅÍÀÇ ¼ö·®´ÜÀ§ var modprcpqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/modprcpqty"); // 20110425_laboru_¼öÁ¤µÈ 1ÀÏ ¼ö·® if(mthddayno == "" || mthddayno == 0) { mthddayno = 1;} model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", tims+"ȸ "+(dayno*mthddayno)+"ÀϺÐ"); if (drugkindnm == "[ÁÖ»ç¾à]"){ model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "ÁÖ»ç"); model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4")); } else if (drugkindnm == "[¿Ü¿ë¾à]"){ model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "¿Ü¿ë"); var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"); model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", val); } else if (drugkindnm == "[³»º¹¾à]"){ model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "³»º¹"); var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") ; var strchk = val.substring(val.length - 1, val.length); //alert(strchk); if(strchk == "ÈÄ" || strchk == "½Ã" || strchk == "°£" || strchk == "Áß" || strchk == "ºÐ") { val += "¿¡ "; } else { val += " "; } var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls"); if(modprcpqty != qty) { qty = modprcpqty; // 20110425_laboru_°æºÏ´ëº´¿ø_¿øÃ³¹æ ¼ö·®°ú ¼öÁ¤µÈ ó¹æ ¼ö·®ÀÌ ´Ù¸£¸é ¼öÁ¤µÈ °ÍÀ¸·Î Ãâ·ÂÇÔ } if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX" || sumcls == "DG" ){ //20091110 À̼±°æ ¼öÁ¤ : ¶óº§±×·ìÀÌ ¸¶¾à(°æ±¸), ¼öÁ¦, ptp, ±âŸ¾àÀϰæ¿ì ¾àǰ¸¶½ºÅÍÀÇ ¼ö·®´ÜÀ§¸¦ Ãâ·Â 20110512_laboru_pack Ãß°¡ var tmpqty = Math.round(qty * 10) / 10; if(packunit == "T" || packunit == "C") { model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", val + " " +fChkFloat(qty)+"Á¤¾¿ " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4")); } else { if(packunit == "cap" || packunit == "tab") { packunit = "¾Ë"; // 20110413_laboru_°æºÏ´ëº´¿ø_´ÜÀ§°¡ cap, tab À϶§ ¾Ë·Î ¹Ù²Ù±â } model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", val + " " +fChkFloat(tmpqty)+ packunit +"¾¿ " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4")); } } else { model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", val + " " +fChkFloat(qty)+"Æ÷[Á¤]¾¿ " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4")); } } var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1"); model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/lblcnts1", lblcnts1); var prcpqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims"); prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ; var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm") + " " + qty + " " + + tims + " " + + dayno + " " + + Math.round(qty*tims*dayno*1000)/1000 ; model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drug1", val); iPageCnt++; } /** * */ function fGnrlPrint() { model.makeNode("/root/main/prnt/lbllist[" +iPageCnt+ "]"); model.copyNode("/root/main/prnt/lbllist[" +iPageCnt+ "]", "/root/main/lbllist/lbllist["+iPoint+"]"); var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"); var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");//ȸ¼ö·® var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");//Àϼö·® var qtyunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqtyunit");//¼ö·®´ÜÀ§ var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");//Ƚ¼ö var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); //ó¹æÀϼö var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //¿ë¹ýÀϼö var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //¾àǰ¸¶½ºÅÍÀÇ ¼ö·®´ÜÀ§ var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"); var dayno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); var mthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1"); var mthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2"); var mthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3"); var mthdcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd"); var mthdcdfive1 = mthdcd1.substring(4,5); var mthdcdthree1 = 0; var cntpatt1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/cntpatt"); var mthdcntsno = iPageCnt; var mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"); var mthdcd5nm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd5nm"); //¾àǰÄÚµå5¹øÂ°ÀÚ¸®¸íĪ (¿ë¹ý¼¼ºÐ·ù) var prcpmixno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno"); if (drugkindnm == "[ÁÖ»ç¾à]"){ model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "ÁÖ»ç"); model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4")); if(mthddayno == "" || mthddayno == 0) { mthddayno = 1;} model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", tims+"ȸ "+(dayno*mthddayno)+"ÀϺÐ"); } else if (drugkindnm == "[¿Ü¿ë¾à]"){ model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "¿Ü¿ë"); model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4")); if(mthddayno == "" || mthddayno == 0) { mthddayno = 1;} model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", tims+"ȸ "+(dayno*mthddayno)+"ÀϺÐ"); } else if (drugkindnm == "[³»º¹¾à]"){ model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "³»º¹"); var lbltims =0; var mthdcnts = ""; var mthdcnts1 = 0; //¾ÆÄ§ var mthdcnts2 = 0; //Á¡½É var mthdcnts3 = 0; //Àú³á var mthdcnts4 = 0; //ÃëħÀü var mthdcnts5 = 0; //Ư¼ö¿ë¹ý var mthdtims = 0; //¿ë¹ýȽ¼ö lbl_tims = mthd2.split(","); if ( mthdcd1 == "ZZZ" ){ lbltims = tims; } else if ( mthd3.indexOf("Ãëħ") > -1 ) { lbltims = lbl_tims.length +1; } else if(mthd2.indexOf("¸¶´Ù") > -1){ lbltims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims"); } else { lbltims = lbl_tims.length; } tims = lbltims; if(mthddayno == "" || mthddayno == 0) { mthddayno = 1;}; //var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " // + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") ; if(lbltims == 1) { if(mthd2.indexOf("¸¶´Ù") == -1) { model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", lbltims+ "ȸ " +(dayno * mthddayno)+"ÀϺÐ"); } else { model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", tims+ "ȸ " +(dayno*mthddayno)+"ÀϺÐ"); } } else { model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", lbltims+ "ȸ " +(dayno*mthddayno)+"ÀϺÐ"); } mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"); if(cntpatt1.substring(0,1) == "1" && mthdcnts1 == 0) {//¾ÆÄ§ mthdcnts1++; mthdtims++; } if(cntpatt1.substring(1,2) == "1" && mthdcnts2 == 0) {//Á¡½É mthdcnts2++; mthdtims++; } if(cntpatt1.substring(2,3) == "1" && mthdcnts3 == 0) {//Àú³á mthdcnts3++; mthdtims++; } if(cntpatt1.substring(3,4) == "1" && mthdcnts4 == 0) {//ÃëħÀü mthdcnts4++; mthdtims++; } if(cntpatt1.substring(4,5) == "1") {//Ư¼ö¿ë¹ý mthdcnts5++; } if(mthdtims == 0) { mthdtims = tims; } var drugcnt = 1; for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){ var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm"); var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno"); var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1"); var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2"); var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3"); var mthdcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd"); var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+j+"]/atc_drugkind"); var mthdcdfive2 = mthdcd2.substring(4,5); var prcptims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims"); var cntpatt2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntpatt"); var qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty"); // 20110413_laboru_°æºÏ´ëº´¿ø 1 ȸ¼ö·® var prcpmixno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpmixno"); //if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6) // && !fChkSumcls(j)){ if( atc_drugkind == "p") { if(dayno1 == dayno2 && (mthdcd1 == mthdcd2 || (mthdcdfive1 == "P" && (mthdcd2 == "A11D" || mthdcd2 == "A11DI") ) ) && prcpmixno1 == prcpmixno2) { //20110102 À̼±°æ ¼öÁ¤ : ¶óº§Ãâ·Â½Ã ¹­¾îÁÖ´Â ±âÁØÀº ¿ë¹ýÄÚµå 5¹øÂ°ÀÚ¸®(½ÄÈÄ30ºÐÈÄ..)¿Í Àϼö //¿¹¿ÜÀûÀ¸·Î Àϼö°¡ °°°í ½ÄÈÄ30ºÐ°ú ÃëħÀü¿ë¹ýÀº °°ÀÌ ¹­¾îÁÜ var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims"); prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ; //¿ë¹ýÄÚµåÀÇ ¾ÆÄ§, Á¡½É, Àú³á, ÃëħÀü Ãâ·Â if(cntpatt2.substring(0,1) == "1" && mthdcnts1 == 0) { mthdcnts1++; mthdtims++; } if(cntpatt2.substring(1,2) == "1" && mthdcnts2 == 0) { mthdcnts2++; mthdtims++; } if(cntpatt2.substring(2,3) == "1" && mthdcnts3 == 0) { mthdcnts3++; mthdtims++; } if(cntpatt2.substring(3,4) == "1" && mthdcnts4 == 0) { mthdcnts4++; mthdtims++; } //¿ë¹ýÄÚµåÀÇ ÃÖ´ëȽ¼ö Ãâ·ÂÇÔ if(mthdtims == 0) { mthdtims = 1;} model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", mthdtims+ "ȸ " +(dayno*mthddayno)+"ÀϺÐ"); var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") + " " + qty + " " + + prcptims + " " + + dayno2 + " " + + Math.round(qty*prcptims*dayno2*1000)/1000 ; model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drug" + drugcnt, val); drugcnt++; iPoint = j; } else { iPageCnt++; iPoint = j - 1; break; } } else if((mthdcdfive1 == mthdcdfive2 && dayno1 == dayno2 && !( fChkSumcls(j) && atc_drugkind != "p") && prcpmixno1 == prcpmixno2) // fChkSumcls(j) && || (dayno1 == dayno2 && mthdcdfive1 == "P" && (mthdcd2 == "A11D" || mthdcd2 == "A11DI") && prcpmixno1 == prcpmixno2) ) { // 20110412_laboru_°æºÏ´ëº´¿ø_¾ÆÄ§ ½ÄÈÄ 30ºÐ + ÃëħÀü // || (dayno1 == dayno2 && mthdcdfive2 == "P" && mthdcd1 == "A11D" && prcpmixno1 == prcpmixno2) ) { // 20110412_laboru_°æºÏ´ëº´¿ø_ÃëħÀü + ¾ÆÄ§ ½ÄÈÄ 30ºÐ //20110102 À̼±°æ ¼öÁ¤ : ¶óº§Ãâ·Â½Ã ¹­¾îÁÖ´Â ±âÁØÀº ¿ë¹ýÄÚµå 5¹øÂ°ÀÚ¸®(½ÄÈÄ30ºÐÈÄ..)¿Í Àϼö //¿¹¿ÜÀûÀ¸·Î Àϼö°¡ °°°í ½ÄÈÄ30ºÐ°ú ÃëħÀü¿ë¹ýÀº °°ÀÌ ¹­¾îÁÜ var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims"); prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ; //¿ë¹ýÄÚµåÀÇ ¾ÆÄ§, Á¡½É, Àú³á, ÃëħÀü Ãâ·Â if(cntpatt2.substring(0,1) == "1" && mthdcnts1 == 0) { mthdcnts1++; mthdtims++; } if(cntpatt2.substring(1,2) == "1" && mthdcnts2 == 0) { mthdcnts2++; mthdtims++; } if(cntpatt2.substring(2,3) == "1" && mthdcnts3 == 0) { mthdcnts3++; mthdtims++; } if(cntpatt2.substring(3,4) == "1" && mthdcnts4 == 0) { mthdcnts4++; mthdtims++; } //¿ë¹ýÄÚµåÀÇ ÃÖ´ëȽ¼ö Ãâ·ÂÇÔ if(mthdtims == 0) { mthdtims = 1;} model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", mthdtims+ "ȸ " +(dayno*mthddayno)+"ÀϺÐ"); var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") + " " + qty + " " + + prcptims + " " + + dayno2 + " " + + Math.round(qty*prcptims*dayno2*1000)/1000 ; model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drug" + drugcnt, val); drugcnt++; iPoint = j; } else { iPageCnt++; iPoint = j - 1; break; } if(drugcnt == 17){ iPageCnt++; iPoint = j - 1; break; } } /* ¾ÆÄ§, Á¡½É, Àú³á, ÃëħÀü ÂïÁö ¾Ê´Â ¿¹¿Ü ¿ë¹ý 1. Ƚ¼ö ÆÐÅÏ 5¹øÂ° ÀÚ¸®°ªÀÌ 1ÀÎ °æ¿ì 2. ¿ë¹ýÄÚµå 4¹øÂ° ÀÚ¸®°ªÀÌ E (½Ã°£¸¶´Ù) ÀÎ °æ¿ì 3. ¿ë¹ýÄÚµå 4¹øÂ° ÀÚ¸®°ªÀÌ D (ÀÇ»çÁö½Ã´ë·Î) ÀÎ °æ¿ì 4. ¿ë¹ýÄÚµå 5¹øÂ° ÀÚ¸®°ªÀÌ Q (ÀÇ»çÁö½Ã´ë·Î) ÀÎ °æ¿ì */ if(mthdcnts5 > 0 || mthdcd1.substring(3,4) == "E" || (mthdcd1.substring(3,4) == "D" && mthdcnts4 < 1) || mthdcd1.substring(4,5) == "Q") { mthdcnts = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"); } /*if(mthdcdfive1 == "P" && prcpmixno1 != "-") { mthdcnts = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"); } */ else { if(mthdcnts1 > 0) { mthdcnts = "¾ÆÄ§ "; } if(mthdcnts2 > 0) { mthdcnts += "Á¡½É "; } if(mthdcnts3 > 0) { mthdcnts += "Àú³á "; } if(mthdcdfive1 == "P" ) { mthdcnts += "½ÄÈÄ30ºÐ"; // 20110412_laboru_ } if(mthdcdfive1 == "I" ) { mthdcnts += "½ÄÈÄÁï½Ã"; // 20110412_laboru_ } if(mthdcdfive1 == "B" ) { mthdcnts += "½ÄÀü10ºÐ"; // 20110412_laboru_ } if(mthdcdfive1 == "A" ) { mthdcnts += "½ÄÀü30ºÐ"; // 20110412_laboru_ } if(mthdcdfive1 == "C" ) { mthdcnts += "½ÄÀü1½Ã°£"; // 20110412_laboru_ } if(mthdcdfive1 == "D" ) { mthdcnts += "½ÄÀü2½Ã°£"; // 20110412_laboru_ } if(mthdcdfive1 == "E" ) { mthdcnts += "°øº¹"; // 20110412_laboru_ } if(mthdcdfive1 == "M" ) { mthdcnts += "½Ä»çµµÁß"; // 20110412_laboru_ } if(mthdcdfive1 == "W" ) { mthdcnts += "½Ä»ç¿Í ÇÔ²²"; // 20110412_laboru_ } if(mthdcdfive1 == "T" ) { mthdcnts += "½ÄÈÄ2½Ã°£"; // 20110412_laboru_ } if(mthdcnts_end == "ÃëħÀü¿¡") { //mthdcnts += mthdcd5nm; } else { //mthdcnts += mthdcnts_end; } if(mthdcnts4 > 0) { if(mthdcnts != "" ) { mthdcnts += "°ú ÃëħÀü¿¡ "; } else { mthdcnts = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"); } } else { mthdcnts += "¿¡ "; } } for(var p = mthdcntsno ; p <= getNodesetCount("/root/main/prnt/lbllist") ; p++){ //alert(p + " " + getNodesetCount("/root/main/prnt/lbllist") + "/////" + mthdcnts); if(mthdcnts == "") { model.makeValue("/root/main/prnt/lbllist[" +p+ "]/drugmthddesc", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " +model.getValue("/root/main/lbllist/lbllist["+p+"]/mthdcnts3") + model.getValue("/root/main/lbllist/lbllist["+p+"]/mthdcnts4")); } else { model.makeValue("/root/main/prnt/lbllist[" +p+ "]/drugmthddesc", mthdcnts + " 1Æ÷¾¿ " + model.getValue("/root/main/lbllist/lbllist["+p+"]/mthdcnts4")); } } mthdcnts = ""; } } /** * */ function fGetImage() { var pImage = ""; iImageCnt++; if(iImageCnt > 99){ pImage = "GRAPH"+iImageCnt; } else if(iImageCnt > 9){ pImage = "GRAPH0"+iImageCnt; } else { pImage = "GRAPH00"+iImageCnt; } return pImage } /** * */ function fDateFormat(sDD) { return sDD.substr(0,4)+"/"+sDD.substr(4,2)+"/"+sDD.substr(6,2); } /** * */ function fChkFloat(qty) { var fQty = parseFloat(qty); var fRst = ""; if(fQty%1 == 0){ fRst = parseInt(qty); } else { fRst = qty; } return fRst; } /** * */ function fChkSumcls(cnt) { var chk = false; var sSumcls = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/sumcls"); var sSnglyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/atcifsnglyn"); var sDrugindependpackflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/drugindependpackflag"); if(sSumcls == "DI" || sSumcls == "DS"|| sSumcls == "DX"|| sSumcls == "DT" || sSumcls == "DM" || sSumcls == "IH"|| sSumcls == "IO" || sSumcls == "DG" //20110512_laboru_pack Ãß°¡ || sSumcls == "IS"|| sSumcls == "IX"|| sSumcls == "X" || sSumcls == "ZZZ" || sSumcls == "A10PQ" || sSumcls == "I"){ chk = true; } if ( sSumcls == "D" && sSnglyn =="Y" ) { chk = true; } if ( sDrugindependpackflag =="Y"){ chk = true; } return chk; } function fPrntTime(sDD, sTM) { if(PrnKind == "2") { return sDD.substr(4,2)+"/"+sDD.substr(6,2)+" "+sTM.substr(0,2)+":"+sTM.substr(2,2)+":"+sTM.substr(4,2); } else { return sDD.substr(4,2)+" / "+sDD.substr(6,2)+" "+sTM.substr(0,2)+":"+sTM.substr(2,2)+":"+sTM.substr(4,2); } }