/** * ÆÄ ÀÏ ¸í : SPADT62300.js * ¼³ ¸í : (ÆË¾÷)º´µ¿¶óº§Ãâ·Â Javascriot * ¼³ °è ÀÚ : °øµÎ°æ * ÀÛ ¼º ÀÚ : °øµÎ°æ * ¼öÁ¤ÀÌ·Â : 2007.09.17 / ÃÖÃÊÀÛ¼º / °øµÎ°æ */ var sSndMsg = ""; //¶óº§Ãâ·Â³»¿ë var iPoint = 1; //¶óº§Ãâ·Ârow var iCnt = 0; //¶óº§Ãâ·Â¸Å¼ö var iImageCnt = 0; //¶óº§±×·¡ÇÈÆùÆ®¼ö var gTimer = null; var pg =0; var totpg =0; var totcnt =0; var ordflag = ""; var bordflag = ""; var vcnt = 0; var nCnt = 0; var vlblcnt = false; var mlblcnt = false; var nextPage = false; /** * ÃʱâÈ­ */ function fInit() { //window.minimize(); 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/prcpdd", astfMatrixData(sParam, 1, 3)); model.makeValue("/root/send/prcpinfo/orddd", astfMatrixData(sParam, 1, 4)); model.makeValue("/root/send/prcpinfo/cretno", astfMatrixData(sParam, 1, 5)); model.makeValue("/root/send/prcpinfo/prcpgenrflag", astfMatrixData(sParam, 1, 6)); model.makeValue("/root/send/prcpinfo/pid", astfMatrixData(sParam, 1, 7)); model.makeValue("/root/send/prcpinfo/orddeptcd", astfMatrixData(sParam, 1, 8)); model.makeValue("/root/send/prcpinfo/wardcd", astfMatrixData(sParam, 1, 9)); model.makeValue("/root/send/prcpinfo/lblflag", astfMatrixData(sParam, 1, 10)); model.makeValue("/root/send/prcpinfo/prcpflag", astfMatrixData(sParam, 1, 11)); model.makeValue("/root/send/prcpinfo/prntflag", astfMatrixData(sParam, 1, 12)); model.makeValue("/root/send/prcpinfo/liquidflag", astfMatrixData(sParam, 1, 13)); model.makeValue("/root/send/prcpinfo/etcdescflag", astfMatrixData(sParam, 1, 14)); model.makeValue("/root/send/prcpinfo/lblkind", astfMatrixData(sParam, 1, 15)); model.makeValue("/root/send/prcpinfo/outlblyn", astfMatrixData(sParam, 1, 16)); model.makeValue("/root/send/prcpinfo/ptplblyn", astfMatrixData(sParam, 1, 17)); model.makeValue("/root/send/prcpinfo/reprintyn", astfMatrixData(sParam, 1, 18)); model.makeValue("/root/send/prcpinfo/lbltype", astfMatrixData(sParam, 1, 19)); model.makeValue("/root/send/prcpinfo/drugkind", astfMatrixData(sParam, 1, 20)); model.makeValue("/root/send/prcpinfo/autolblyn", astfMatrixData(sParam, 1, 21)); model.refresh(); submit("TRADT62301"); if(model.getValue("/root/main/lbllist/lbllist["+1+"]/drugkindnm") != ""){ if(model.getValue("/root/send/prcpinfo/liquidflag") == "Y" || model.getValue("/root/send/prcpinfo/outlblyn") == "Y"){ fLiquidLBLPrint(); } else if(model.getValue("/root/main/lbllist/lbllist["+1+"]/drugflag") == "E" || model.getValue("/root/main/lbllist/lbllist["+1+"]/drugflag") == "L" || model.getValue("/root/main/lbllist/lbllist["+1+"]/drugflag") == "G"){ fBigLBLPrint(); } else { fSmallLBLPrint(); } } model.refresh(); gTimer = window.setInterval("fStopTimer()",10000); 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 fSmallLBLPrint() { /* ¶óº§ Sorting ·ÎÁ÷ //mgt¿¡¼­ vo·Î ¸®ÅÏ ´ëºÐ·ù - ³»º¹¾à, ¿Ü¿ë¾à, ÁÖ»ç, Ç×¾ÏÁ¦, TPN, ¸¶¾à, Áߺзù - ¹æ¹ýÄÚµå ¼ÒºÐ·ù - ³»º¹¾à,¿Ü¿ë¾à(¹æ¹ýÄÚµå), ÁÖ»ç,¸¶¾à,Ç×¾ÏÁ¦(mix) web js Ãâ·Â·ÎÁ÷ °¡. Åð¿ø/¿Ü·¡/ÀÀ±Þ½Ç/¿Ü¹Ú/¿ÜÃâ : Å«»çÀÌÁî¶óº§ ¿Ü·¡±âÁØ ³ª. ±×¿Ü ÀÔ¿øÃ³¹æ 1. ¿Ü¿ë¾à ´Üµ¶Ãâ·Â 2. ³»º¹¾à ´Üµ¶Ãâ·Â µû·ÎÆ÷Àå º¹¿ë¹æ¹ý 3. ÁÖ»ç¾à ´Üµ¶Ãâ·Â mix³¢¸® °í°¡,ÇâÁ¤,º¸°üº¡¹ýÀÌ ½Ç¿ÂÀÌ ¾Æ´Ñ°æ¿ì ÀÚ°¡ÁÖ»çÀÎ °æ¿ì ´Üµ¶ ³ª¸ÓÁö */ // Comm ¼³Á¤ //CommAX.CommPort = "1"; // Ãâ·Â Port //CommAX.Settings = "9600,n,8,1"; // Comm ¼³Á¤ //CommAX.Settings = "127.0.0.1"; // Comm ¼³Á¤ 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") if ( PrnKind ==7 ) { CommAX.PrnKind =4; } else { CommAX.PrnKind =PrnKind; } if(commkind == "02") { CommAX.PortNm = 1; } else { CommAX.PortNm = 2; } if(commkind == "01") { CommAX.PrtNm = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval"); } //if ( CommAX.PortOpen() == true) { //alert("¶óº§ ÇÁ¸°Æ® Open"); //CommAX.SendMessage("^XA^SEE:UHANGUL.DAT^FS^CWQ,E:AAAAA.FNT^FS^CI26^FO100,50^AQN,40,40^FDÀÌÈÆÀçABCDEFGHI1234^FS^FO100,100^AQN,40,40^FD£¨ÁÖ£©ÇѱÛÀμâÅ×½ºÆ®£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£±£²£³£´^FS^FO100,150^AQN,40,40^FD A B C D E F G H I^FS^CI0^FO100,200^A0,50,50^FDPRINTING TEST^FS^FO100,250^BY2^B3N,N,100,Y,N,N^FD1232423423^FS^XZ"); //CommAX.SendMessage("^XA^LH0,0^PRB^CF0,89^FO10,05^FDSH07^FS^CF0,70^FO260,05^FD10/10^FS^CF0,89^FO50,80^FD- 234567^FS^CFA20,20^FO10,150^FD1234567890^FS~DGGRAPH001,00504,021,0078000000E00000800000F01E000C00201FFC0000003C0000007007FFC00000F01E000C00201FFC000000006000003003000000C0701C00180060180C03000FFFF00FFE3003000000C0701C00180060180C0300061000061C300300000300783C003001E0101800C0007E000018300300C00300783C003001E0101800C000C30000303001FFE006006C6C006003600018006001818000603000180006006C6C006003600018006000C30000C03000180004006C6C00C0066000300020007E0001803000180004006C6C00C006600030002000180003003000181E0C0066CC0180186000600030001800060030FFFFFF0C0066CC018018600060003000181E1800207000000C00638C0300306000C00030FFFFFF0000000000000C00638C0300306000C000307000000000000000000400638C060060600180002000000000FFF00038000400638C0600606001800020007E00006060007E000600610C0C007FFC0180006000C30000006000C3000600610C0C007FFC018000600181800000400181800300600C18000060018000C001818000FFE00181800300600C18000060018000C001818000600001818000C0F03E300001F80180030000C30000600000C30000C0F03E300001F801800300007E00006060007E00000000000000000000000000003800003FF0003800000000000000000000000000^FO140,150^XGGRAPH001,1,1^FS~DGGRAPH002,00216,009,0000700000000001C00000380000000000E00000180000000000600000180000000000600FFF1807FFE0000060060E180300C03FFC60001C180000C0181C60003018000080001C600060180FFFC000186000D018070000001860018C180300000C18600307180300C006106606031801FFE006207F18001800000006006000001801860006036000001800C300061C6000001000C300FFE06000E00000C30070006000300000C31E000060003000FFFFFF000060003000700000000060003018000000000060001FFC000000000060000000000000000040^FO320,150^XGGRAPH002,1,1^FS^CFA20,20^FO10,180^FD2007-04-25^FS~DGGRAPH003,00240,010,002001E00000E0000080002001E000007007FFC0006006380000300300000060063800303003000001E00C1830183003000001E00C181818300300C003600800181BF001FFE0036008001FF830001800066018001818300018000660180018183000180018601BF0181BF000181E18601BF01FF830FFFFFF30601C1810103070000030601C180000200000006060180C0000000000006060180C0007000038007FFC0C0C000FC0007E007FFC0C0C00186000C30000600E1800303001818000600E1800303001818001F803E000303001818001F803E000186000C30000000000000FC0007E0000000000000700003800^FO140,180^XGGRAPH003,1,1^FS^CFE10,10^FO10,210^FDStomach 2/10^FS^CFA20,20^FO10,240^FDBiopsh^FS^PQ1^XZ"); //CommAX.PortClose(); //return; var sDD = getCurrentDate(); var sTM = getCurrentTime(); var reprint =""; for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){ if ( model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DI" && model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DS" ){ totcnt++; } } // 2010.02.12 pymi if( parseInt(totcnt%6) != 0) totcnt ++; // ¶óº§Âï±â Àü¿¡ ÇÑÁÙ ¶ç¿ì±â for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){ if(model.getValue("/root/main/lbllist/lbllist["+ i +"]/lblcnts2").length > 0) { totcnt++; vlblcnt = true;} } // (e) for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){ if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){ reprint ="(Àç)"; } //½ÃÀÛ(X, Y) sSndMsg += astfStartFormat(0, 0, "S"); //¶óº§À̸§(³»º¹¾à/ÁÖ»ç¾à/¸¶¾à) sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),""); //if(PrnKind == "2" || PrnKind == "7") { //Ãâ·ÂÀÏÀÚ sSndMsg += astfPrintOut(190, 25, 21, "Ãâ·Â:"+fPrntTime(sDD, sTM),""); //Ãâ·ÂÀÏÀÚ sSndMsg += astfPrintOut(190, 55, 21, "ó¹æ:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),""); //} else { //Ãâ·ÂÀÏÀÚ // sSndMsg += astfPrintOut(220, 25, 21, "Ãâ ·Â : "+fPrntTime(sDD, sTM),""); //Ãâ·ÂÀÏÀÚ // sSndMsg += astfPrintOut(220, 55, 21, "ó ¹æ : "+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),""); //} //º´½Ç sSndMsg += astfPrintOut(20, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),""); //ȯÀÚÀ̸§ sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),""); //ȯÀÚ¹øÈ£ sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+")",""); //¼±±×¸®±â sSndMsg += astfGraphicBox(5, 120, 465, 0, 4); var sDrugKindcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"); var sMixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno"); if(sDrugKindcd == "[³»º¹¾à]"){ if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){ fInUseDrugLBL2(); // 2010.02.12 pymi //if((vcnt < 6) && (vlblcnt) && (iPoint == getNodesetCount("/root/main/lbllist/lbllist")) ) { if( vcnt < 6 && vlblcnt ) { mlblcnt = true; fPrntLblCnt2(vcnt, ordflag); ordflag = ""; vcnt = 0; } // (e) } else { fInUseDrugLBL(); } } else if(sDrugKindcd == "[¿Ü¿ë¾à]"){ //fExUseDrugLBL(); if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){ fInUseDrugLBL2(); //fOutUseDrugLBL2(); } else { fInUseDrugLBL(); } } else if(sDrugKindcd == "[ÁÖ»ç¾à]"){ //alert(sMixno); if(sMixno != "-"){ fMixLBL(); } else { fInjDrugLBL(); } } CommAX.SendMsg(sSndMsg); fSleep(500); sSndMsg = ""; // 2010.02.11 pymi if(sDrugKindcd == "[³»º¹¾à]") { if( iPoint == getNodesetCount("/root/main/lbllist/lbllist") ) { if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){ if(vlblcnt && (!mlblcnt) && (ordflag.length > 0)) { fPrntLblCnt2(vcnt, ordflag); ordflag = ""; vcnt = 0; } } mlblcnt = false; } } // (e) } //CommAX.PortClose(); model.refresh(); //} } /** * mix ¶óº§ */ function fMixLBL() { var sMixno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno"); var cnt = 0; for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){ sMixno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpmixno"); var qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty"); var dayqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/dayprcpqty"); var qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit"); var tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims"); var dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno"); if(PrnKind == "2") { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"); prcpnm = prcpnm.substr(0,7); } else { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"); } if(sMixno1 == sMixno2){ // sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),""); // sSndMsg += astfPrintOut(170, 140+(cnt*30), 11, prcpnm.substr(0,7),""); // sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty+qtyunit,""); // sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,""); // sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,""); cnt++; } else { j--; break; } if(cnt == 5){ break; } } iPoint = j; //Á¾·á(¸Å¼ö) sSndMsg += astfEndFormat(0); } /** * ³»º¹¾à ¶óº§ */ function fInUseDrugLBL() { // var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls"); var sMthdcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd"); var qty = ""; var dayqty = ""; var qtyunit = ""; var tims = ""; var dayno = ""; var cnt = 0; for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){ if(cnt != 0 && fChkIndependDrug(j)){ break; } // sSumCls2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls"); sMthdcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd"); qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty"); dayqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/dayprcpqty"); qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit"); tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims"); dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno"); if(PrnKind == "2") { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"); prcpnm = prcpnm.substr(0,7); } else { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"); } if((sMthdcd1 == sMthdcd2)){ // sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),""); // sSndMsg += astfPrintOut(165, 140+(cnt*30), 11, prcpnm.substr(0,7),""); if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){ // sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty+qtyunit,""); // sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,""); // sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,""); } else { // sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty,""); // sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,""); // sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,""); } cnt++; } else { break; } if(cnt == fMthdnmLength(iPoint) || fChkIndependDrug(j)){ j++; break; } } iPoint = j-1; //º¸°ü¹æ¹ý °í°¡ Ãâ·Â var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd"); var sExpnyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/expnyn"); var sExpnnm = ""; if(sExpnyn == "Y") sExpnnm = "°í°¡"; //if(sKeepmthd != "" && sExpnnm != ""){ // sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">",""); //} else if(sKeepmthd != ""){ sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">",""); } if(sExpnnm != ""){ sSndMsg += astfPrintOut(135, 180, 3, "<"+sExpnnm+">",""); } /* if(sKeepmthd != "" && sExpnnm != ""){ sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">",""); } else if(sKeepmthd != ""){ sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">",""); } if(sExpnnm != ""){ sSndMsg += astfPrintOut(20, 180, 3, "<"+sExpnnm+">",""); }*/ //¿ë¹ýÀÇ ±æÀÌ¿¡ µû¶ó Âï´Â À§Ä¡¸¦ ´Þ¸®ÇÑ´Ù(¿ë¹ýÂïÀ» °ø°£À» È®º¸) var iYPoint = 0; if( fMthdnmLength(iPoint) == 4){ iYPoint = 280; } else { iYPoint = 245; } if( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblgrup") == "DS"){ sSndMsg += astfPrintOut(20, iYPoint, 3, "1ÀÏ "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"ȸ " +qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"ÀϺÐ",""); } else { sSndMsg += astfPrintOut(20, iYPoint, 3, "1ÀÏ "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"ȸ " +model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"ÀϺÐ",""); } // sSndMsg += fMthdnm(iPoint); //Á¾·á(¸Å¼ö) sSndMsg += astfEndFormat(0); } /** * ³»º¹¾à ¶óº§ - ÇÑÀå¿¡ ¸ðµç ¿ë¹ý ¾àÀ» ... */ function fInUseDrugLBL2() { // var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls"); var sMthdcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd"); var qty = ""; var dayqty = ""; var qtyunit = ""; var tims = ""; var dayno = ""; var cnt = 0; var chk = false; totpg = Math.ceil(totcnt / 6 ); for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){ if(cnt != 0 && model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DI" ) { break; } //if(cnt != 0 && fChkIndependDrug(j)){ // break; //} // sSumCls2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls"); sMthdcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd"); qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty"); dayqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/dayprcpqty"); qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit"); tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims"); dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno"); if(PrnKind == "2") { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"); prcpnm = prcpnm.substr(0,7); } else { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"); } //if((sMthdcd1 == sMthdcd2)){ // if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DT"){ //PTP´Â * Ç¥½Ã sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, "*",""); } sSndMsg += astfPrintOut(30, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),""); // sSndMsg += astfPrintOut(165, 140+(cnt*30), 11, prcpnm.substr(0,7),""); if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){ // sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty+qtyunit,""); // sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,""); // sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,""); } else { // sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty,""); // sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,""); // sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,""); } if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0) ordflag += j + "/"; // 2010.02.10 pymi cnt++; //} else { // break; //} //if(cnt == fMthdnmLength(iPoint) || fChkIndependDrug(j)){ // j++; // break; //} if(cnt == 6){ pg++; sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,""); sSndMsg += astfEndFormat(0); j++; chk = true; break; } } // 2010.02 18 pymi if (chk == false) { if( model.getValue("/root/main/lbllist/lbllist["+(j-1)+"]/lblgrup") != "DI" ) { cnt ++; // ¶óº§³»¿ë Âï±â Àü¿¡ ÇÑÁÙ ¶ç¿ì±â if(!vlblcnt || cnt == 6) { pg++; sSndMsg += astfPrintOut(430,320, 2, pg+"/" +totpg ,""); sSndMsg += astfEndFormat(0); } } else { sSndMsg += astfEndFormat(0); } } iPoint = j-1; //if( (cnt < 6) && (!vlblcnt)) sSndMsg += astfEndFormat(0); vcnt = cnt; // (e) } // Æ÷Àå¶óº§³»¿ë Ãâ·Â 2010.02.10 pymi function fPrntLblCnt2(cnt, ordflag) { var lblcnts2 = ""; var sordflag = ordflag.split("/"); var lblcnt = cnt; var pgprnt = false; var sDD = getCurrentDate(); var sTM = getCurrentTime(); var y = 0; var x = parseInt(sordflag[y]); //for(var x = parseInt(sordflag[0]); x <= parseInt(sordflag[sordflag.length - 2]); x ++) { while( x <= parseInt(sordflag[sordflag.length - 2])) { if(lblcnt == 6 || lblcnt == 0) { lblcnt = 0; pgprnt = false; // /*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") if ( PrnKind ==7 ) { CommAX.PrnKind =4; } else { CommAX.PrnKind =PrnKind; } if(commkind == "02") { CommAX.PortNm = 1; } else { CommAX.PortNm = 2; } if(commkind == "01") { CommAX.PrtNm = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval"); }*/ // var reprint =""; if ( model.getValue("/root/main/lbllist/lbllist["+x+"]/lblprnttims")>0 ){ reprint ="(Àç)"; } //½ÃÀÛ(X, Y) sSndMsg += astfStartFormat(0, 0, "S"); //¶óº§À̸§(³»º¹¾à/ÁÖ»ç¾à/¸¶¾à) sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+x+"]/drugkindnm"),""); //Ãâ·ÂÀÏÀÚ sSndMsg += astfPrintOut(190, 25, 21, "Ãâ·Â:"+fPrntTime(sDD, sTM),""); //Ãâ·ÂÀÏÀÚ sSndMsg += astfPrintOut(190, 55, 21, "ó¹æ:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+x+"]/prcpdd"), "MD"),""); //º´½Ç sSndMsg += astfPrintOut(20, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/roomcd"),""); //ȯÀÚÀ̸§ sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/patnm"),""); //ȯÀÚ¹øÈ£ sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+x+"]/drugno")+reprint+")",""); //¼±±×¸®±â sSndMsg += astfGraphicBox(5, 120, 465, 0, 4); } //if( !fChkIndependDrug(x) ) { lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ x +"]/lblcnts2"); // 2010.02.10 pymi sSndMsg += astfPrintOut(30, 140+(lblcnt*30), 2, lblcnts2,""); lblcnt ++; //} if(lblcnt == 6){ pg++; sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,""); lblcnt = 0; pgprnt = true; sSndMsg += astfEndFormat(0); CommAX.SendMsg(sSndMsg); fSleep(500); sSndMsg = ""; //break; } x = parseInt(sordflag[++y]); } // end while if(!pgprnt) { pg++; sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,""); sSndMsg += astfEndFormat(0); } if(!mlblcnt) { CommAX.SendMsg(sSndMsg); fSleep(500); sSndMsg = ""; } ordflag = ""; vcnt = 0; pg = 0; totpg = 0; mlblcnt = false; } // (e) /** * ¿Ü¿ë¾à ¶óº§ */ function fExUseDrugLBL() { var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty"); var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty"); var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims"); var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); if(PrnKind == "2") { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm"); prcpnm = prcpnm.substr(0,7); } else { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm"); } // sSndMsg += astfPrintOut(20, 140, 24, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd"),""); // sSndMsg += astfPrintOut(165, 140, 11, prcpnm.substr(0,7),""); // sSndMsg += astfPrintOut(360, 140, 2, dayqty,""); // sSndMsg += astfPrintOut(430, 140, 2, tims,""); // sSndMsg += astfPrintOut(460, 140, 2, dayno,""); sSndMsg += astfPrintOut(20, 280, 3, "1ÀÏ "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"ȸ " +model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"ÀϺÐ",""); // sSndMsg += fMthdnm(iPoint); //Á¾·á(¸Å¼ö) sSndMsg += astfEndFormat(0); } /** * ÁÖ»ç¾à ¶óº§ */ function fInjDrugLBL() { var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls"); var cnt = 0; for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){ if(cnt != 0 && fChkIndependInj(j)){ //Áֻ簡 ¹¶Ãļ­ ³ª¿À´Ù°¡ ´Üµ¶Áֻ縦 ¸¸³¯°æ¿ì ´Üµ¶ÁÖ»ç´Â Ãâ·ÂÇÏÁö ¾Æ´ÏÇÔ. break; } sSumCls2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls"); var qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty"); var dayqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/dayprcpqty"); var qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit"); var tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims"); var dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno"); if(PrnKind == "2") { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"); prcpnm = prcpnm.substr(0,7); } else { var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"); } // sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),""); // sSndMsg += astfPrintOut(165, 140+(cnt*30), 11, prcpnm.substr(0,7),""); // sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, fChkFloat(dayqty)+qtyunit,""); // sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,""); // sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,""); cnt++; if(cnt == 5 || fChkIndependInj(j)){ j++; break; } } iPoint = j-1; //º¸°ü¹æ¹ý °í°¡ Ãâ·Â var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd"); var sExpnyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/expnyn"); var sExpnnm = ""; if(sExpnyn == "Y") sExpnnm = "°í°¡"; //if(sKeepmthd != "" && sExpnnm != ""){ // sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">",""); //} else if(sKeepmthd != ""){ sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">",""); } if(sExpnnm != ""){ sSndMsg += astfPrintOut(135, 180, 3, "<"+sExpnnm+">",""); } //Á¾·á(¸Å¼ö) sSndMsg += astfEndFormat(0); } /** * ³»º¹¾à ´Üµ¶¶óº§ °ËÁõÀÛ¾÷ */ function fChkIndependDrug(cnt) { var sLBLGrup = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/lblgrup"); var sSnglyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/atcifsnglyn"); var sDrugindependpackflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/drugindependpackflag"); var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/keepmthd"); var sExpnyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/expnyn"); var sRst = false; if(sLBLGrup == "DS" || sLBLGrup == "DI" || sLBLGrup == "DT" || sLBLGrup == "DX") sRst = true; if(sSnglyn == "Y") sRst = true; if(sDrugindependpackflag == "Y") sRst = true; if(sExpnyn == "Y") sRst = true; if(sKeepmthd != "") sRst = true; return sRst; } /** * ÁÖ»ç¾à ´Üµ¶¶óº§ °ËÁõÀÛ¾÷ */ function fChkIndependInj(cnt) { var sLBLGrup = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/lblgrup"); var sExp = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/expnyn"); var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/keepmthd"); var sSelfprcpflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/selfprcpflag"); var sDrugindependpackflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/drugindependpackflag"); var sRst = false; if(sLBLGrup == "IH" || sLBLGrup == "IO" || sLBLGrup == "IS" || sLBLGrup == "IX") sRst = true; if(sExp == "Y" || sKeepmthd != "" || sSelfprcpflag == "Y") sRst = true; if(sDrugindependpackflag == "Y") sRst = true; return sRst; } /** * ¿ë¹ý »ý¼º */ function fMthdnm(iPoint) { var sMthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1"); var sMthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2"); var sMthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"); var sMthd4 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"); var sTemp = ""; var sRst = ""; if(sMthd1 != "") sTemp += sMthd1 + " "; if(sMthd2 != "") sTemp += sMthd2 + " "; if(sMthd3 != "") sTemp += sMthd3 + " "; if(sMthd4 != "") sTemp += sMthd4; if(sTemp.length > 28){ var sTemp1 = sTemp.substr(0, 26); var sTemp2 = sTemp.substr(26, sTemp.length); sRst = astfPrintOut(20, 285, 28, sTemp1,""); sRst += astfPrintOut(20, 320, 28, sTemp2,""); } else if(sTemp.length > 24){ sRst = astfPrintOut(20, 320, 29, sTemp,""); } else if(sTemp.length > 22){ sRst = astfPrintOut(20, 320, 3, sTemp,""); } else if(sTemp.length > 21){ sRst = astfPrintOut(20, 320, 3, sTemp,""); } else if(sTemp.length <= 21){ sRst = astfPrintOut(20, 320, 3, sTemp,""); } return sRst; } /** * ¿ë¹ý ±æÀÌ */ function fMthdnmLength(iPoint) { var sMthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1"); var sMthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2"); var sMthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"); var sMthd4 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"); var sTemp = ""; var sRst = "4"; //º´µ¿¶óº§Àº ±âº» 4ÁÙ±îÁö ¾àó¹æÀÌ Ãâ·ÂµÈ´Ù. if(sMthd1 != "") sTemp += sMthd1 + " "; if(sMthd2 != "") sTemp += sMthd2 + " "; if(sMthd3 != "") sTemp += sMthd3 + " "; if(sMthd4 != "") sTemp += sMthd4; if(sTemp.length > 28){ sRst = "3"; //º¹¿ë¹æ¹ýÀÌ ±æ°æ¿ì 3ÁÙ±îÁö ¾àó¹æÀ» Ãâ·ÂÇÑ´Ù. } return sRst; } /** * ÀÀ±Þ½Ç/Åð¿ø/¿Ü¹Ú/¿ÜÃâ ¶óº§Ãâ·Â(Å«»çÀÌÁî) */ function fBigLBLPrint() { /* ¶óº§ Sorting ·ÎÁ÷ //mgt¿¡¼­ vo·Î ¸®ÅÏ ´ëºÐ·ù - ³»º¹¾à, ¿Ü¿ë¾à, ÁÖ»ç, Ç×¾ÏÁ¦, TPN, ¸¶¾à, Áߺзù - ¹æ¹ýÄÚµå ¼ÒºÐ·ù - ³»º¹¾à,¿Ü¿ë¾à(¹æ¹ýÄÚµå), ÁÖ»ç,¸¶¾à,Ç×¾ÏÁ¦(mix) web js Ãâ·Â·ÎÁ÷ 1 ¾àÁ¾·ù(³»º¹¾à/ÁÖ»ç¾à/¿Ü¿ë¾à) 1.1 ¹æ¹ýÄÚµå 1.2 󹿼ö·® */ // Comm ¼³Á¤ //CommAX.CommPort = "1"; // Ãâ·Â Port //CommAX.Settings = "9600,n,8,1"; // Comm ¼³Á¤ //CommAX.Settings = "127.0.0.1"; // Comm ¼³Á¤ PrnKind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/prntkind"); var commkind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/commkind") CommAX.PrnKind =PrnKind; if(commkind == "02") { CommAX.PortNm = 1; } else { CommAX.PortNm = 2; } if(commkind == "01") { CommAX.PrtNm = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval"); } var reprint=""; for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){ if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){ reprint ="(Àç)"; } //½ÃÀÛ(X, Y) sSndMsg += astfStartFormat(0, 0, "B"); //iPageCnt++; ////////////////////////////////////////////////// // ¶óº§ »ó´Ü³»¿ë // ///////////////////////////////////////////////// //º´½Ç sSndMsg += astfPrintOut(30, 30, 6, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),""); //ȯÀÚ¸í sSndMsg += astfPrintOut(180, 30, 6, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm").substring(0,5),""); //¹ÙÄÚµå(º¯È¯) sSndMsg += astfBarCode_Code39(390, 40, "N", 70, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode")); //ȯÀÚ¹øÈ£ sSndMsg += astfPrintOut(30, 85, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid") ,""); //Åõ¾à¹øÈ£=>20091014 À̼±°æ : Å©°í ÁøÇÏ°Ô º¯°æ sSndMsg += astfPrintOut(130, 85, 6, " (" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno") + ")",""); //¼ºº°³ªÀÌ sSndMsg += astfPrintOut(280, 85, 3, reprint+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sexage"),""); //󹿰ú¾à¾î¸í sSndMsg += astfPrintOut(30, 135, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/deptengabbr"),""); //ÀÇ»ç¸í sSndMsg += astfPrintOut(120, 135, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/orddrnm"),""); //ó¹æÀÏÀÚ sSndMsg += astfPrintOut(270, 135, 3, fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd")),""); //ÆäÀÌÁö¼ö //sSndMsg += astfPrintOut(430, 135, 3, iPageCnt+"/"+iTotalPageNum,""); //¹ÙÄÚµå sSndMsg += astfPrintOut(510, 130, 3, "*"+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode")+"*",""); //¼±±×¸®±â sSndMsg += astfGraphicBox(5, 180, 815, 0, 4); sSndMsg += astfPrintOut(20, 600, 2, "*ÀǾàǰÀº ±× Ư¼º»ó º¸°ü¹×°ü¸®°¡ ¾ö°ÝÇØ¾ßÇϹǷÎ, "); sSndMsg += astfPrintOut(20, 630, 2, " ÀÏ´Ü Á¶Á¦Åõ¾àµÈ ¾àÀº ¹Ý³³ÇÒ ¼ö ¾ø½À´Ï´Ù."); ////////////////////////////////////////////////// // ¶óº§ Çϴܳ»¿ë // ///////////////////////////////////////////////// if( fChkSumcls(iPoint)){ //´Üµ¶¶óº§Ãâ·Â fIndependPrint(); } else { //ÀϹݶóº§Ãâ·Â fGnrlPrint(); } //Á¾·á(¸Å¼ö) sSndMsg += astfEndFormat(0); CommAX.SendMsg(sSndMsg); fSleep(500); sSndMsg = ""; // 2010.02.17 pymi if(nextPage) { fGnrlPrintnm(nCnt, bordflag); nextPage = false; nCnt = 0; bordflag = ""; } // (e) } //CommAX.PortClose(); model.refresh(); //} } /** * */ function fIndependPrint() { //¾àÁ¾·ù(³»º¹¾à/ÁÖ»ç¾à/¿Ü¿ë¾à) sSndMsg += astfPrintOut(30, 230, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),""); //¶óº§³»¿ë 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 tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims"); var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); if (drugkindnm == "[ÁÖ»ç¾à]"){ //¿ë¹ý2 sSndMsg += astfPrintOut(30, 300, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),""); } else if (drugkindnm == "[¿Ü¿ë¾à]"){ //sSndMsg += astfPrintOut(210, 230, 7, "1ÀÏ "+tims+"ȸ "+fChkFloat(qty)+"°³¾¿ "+dayno+"ÀϺÐ",""); //¿ë¹ý1 sSndMsg += astfPrintOut(30, 300, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"),""); //¿ë¹ý2 sSndMsg += astfPrintOut(30, 370, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),""); } else if (drugkindnm == "[³»º¹¾à]"){ sSndMsg += astfPrintOut(210, 230, 7, "1ÀÏ "+tims+"ȸ "+fChkFloat(qty)+"Æ÷[Á¤]¾¿ "+dayno+"ÀϺÐ",""); //¿ë¹ý1 sSndMsg += astfPrintOut(30, 300, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"),""); //¿ë¹ý2 sSndMsg += astfPrintOut(30, 370, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),""); } var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1"); lblcnts1 = lblcnts1.setReplaceWord("~", "-"); //20090728 var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd") +" "+parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")) +" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm"); if(lblcnts1.length > 28){ //ÁÖÀÇ»çÇ× sSndMsg += astfPrintOut(30, 450, 5, lblcnts1.substring(0,24),""); sSndMsg += astfPrintOut(30, 510, 5, lblcnts1.substring(24,lblcnts1.length),""); //¾àÁ¤º¸ sSndMsg += astfPrintOut(30, 570, 4, val, ""); } else { //ÁÖÀÇ»çÇ× sSndMsg += astfPrintOut(30, 450, 5, lblcnts1,""); //¾àÁ¤º¸ sSndMsg += astfPrintOut(30, 510, 4, val, ""); } } /** * */ function fGnrlPrint() { var cnt = 0; var drugcnt = 0; var ordCnt = 0; // 2010.02.10 pymi //¾àÁ¾·ù(³»º¹¾à/ÁÖ»ç¾à/¿Ü¿ë¾à) sSndMsg += astfPrintOut(30, 220, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),""); //¶óº§³»¿ë 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 tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims"); var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); //¾àÄÚµå Ãâ·Â 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 mthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd"); if (drugkindnm != "[³»º¹¾à]"){ if (drugkindnm == "[ÁÖ»ç¾à]"){ //¿ë¹ý2 sSndMsg += astfPrintOut(30, 290, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),""); } else if (drugkindnm == "[¿Ü¿ë¾à]"){ //sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+tims+"ȸ "+qty+"°³¾¿ "+dayno+"ÀϺÐ",""); //¿ë¹ý1 sSndMsg += astfPrintOut(30, 290, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"),""); //¿ë¹ý2 sSndMsg += astfPrintOut(30, 360, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),""); } 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"); if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6) && !fChkSumcls(j)){ //if(model.getValue("/root/main/lbllist/lbllist["+j+"]/fst_prnt") == "Y"){ 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; var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd") +" "+prcpqty +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6); sSndMsg += astfPrintOut(30+((cnt%2)*380), 440+((parseInt(cnt/2, 10))*40), 2, val, ""); //} cnt++; } else { break; } if(cnt == 8){ j++; break; } } iPoint = j-1; } else if (drugkindnm == "[³»º¹¾à]"){ var lbltims =0; lbl_tims = mthd2.split(","); if ( mthdcd == "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; 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"); if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6) && !fChkSumcls(j)){ drugcnt++; } else { break; } } if ( drugcnt == 1 ){ if(lbltims == 1) { if(mthd2.indexOf("¸¶´Ù") == -1) { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+lbltims+ "ȸ"+fChkFloat(qty)+"Æ÷[Á¤]¾¿ "+dayno+"ÀϺÐ",""); prcpqty = prcpqty * lbltims; } else { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+tims+ "ȸ"+fChkFloat(qty)+"Æ÷[Á¤]¾¿ "+dayno+"ÀϺÐ",""); prcpqty = prcpqty * tims; } } else { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+lbltims+ "ȸ"+fChkFloat(qty)+"Æ÷[Á¤]¾¿ "+dayno+"ÀϺÐ",""); prcpqty = prcpqty * lbltims; } } else { if(lbltims == 1) { if(mthd2.indexOf("¸¶´Ù") == -1) { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+lbltims+ "ȸ 1Æ÷¾¿ "+dayno+"ÀϺÐ",""); } else { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+tims+ "ȸ 1Æ÷¾¿ "+dayno+"ÀϺÐ",""); } } else { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+lbltims+ "ȸ 1Æ÷¾¿ "+dayno+"ÀϺÐ",""); } } //¿ë¹ý1 //if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") =="ÃëħÀü¿¡" ){ // sSndMsg += astfPrintOut(30, 290, 7, 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 { sSndMsg += astfPrintOut(30, 290, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3"),""); //} //¿ë¹ý2 sSndMsg += astfPrintOut(30, 360, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),""); 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"); if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6) && !fChkSumcls(j)){ //if(model.getValue("/root/main/lbllist/lbllist["+j+"]/fst_prnt") == "Y"){ /* 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; var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd") +" "+prcpqty +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6); sSndMsg += astfPrintOut(30+((cnt%2)*380), 440+((parseInt(cnt/2, 10))*40), 2, val, "");*/ //} //cnt++; // 2010.02.10 pymi var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2"); bordflag += j + "/"; // Æ÷Àå¶óº§ ó¹æÄÚµå ¼ø¼­ if(lblcnts2.length > 0) { sSndMsg += astfPrintOut(30, 440 +(60 * ordCnt), 5, lblcnts2, ""); //if(ordCnt == 0) {sSndMsg += astfPrintOut(30, 440, 4, lblcnts2, ""); } //if(ordCnt == 1) {sSndMsg += astfPrintOut(30, 500, 4, lblcnts2, ""); } //if(ordCnt == 2) {sSndMsg += astfPrintOut(30, 560, 4, lblcnts2, ""); } ordCnt++; // Æ÷Àå¶óº§ °¹¼ö } // (e) } else { // ¿ë¹ýÀÌ ¹Ù²î´Â ½ÃÁ¡ 2010.02.10 pymi // ó¹æÃâ·Â fGnrlPrintnm(ordCnt, bordflag); bordflag = ""; // (e) break; } //if(cnt == 8){ if(ordCnt == 3){ //2010.02.10 pymi j++; if(j <= getNodesetCount("/root/main/lbllist/lbllist")) { var drugkind3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm"); var dayno3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno"); var mthd7 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1"); var mthd8 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2"); var mthd9 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3"); if((drugkind1 == drugkind3) && (dayno1 == dayno3) && (mthd1 == mthd7 && mthd2 == mthd8 && mthd3 == mthd9) && !fChkSumcls(j)){ // ÆäÀÌÁö ³Ñ°Ü¼­µµ ¿ë¹ý ¹Ù²îÁö ¾ÊÀ¸¸é °è¼Ó ÁøÇà } else { // ÆäÀÌÁö ³Ñ±æ¶§ ¿ë¹ýÀÌ ¹Ù²î¸é ó¹æ Ãâ·Â nextPage = true; nCnt = ordCnt; //fGnrlPrintnm(ordCnt, bordflag); } } break; } } iPoint = j-1; // ¿ë¹ý ¹Ù²îÁö ¾Ê´Â ¸¶Áö¸· ó¹æ Ãâ·Â 2010.02.10 pymi if(iPoint == getNodesetCount("/root/main/lbllist/lbllist") ) { if(ordCnt == 3) { nextPage = true; nCnt = ordCnt; } else { fGnrlPrintnm(ordCnt, bordflag); bordflag = ""; } } // (e) } } /* * 2010.02.10 pymi ó¹æÃâ·Â */ function fGnrlPrintnm(linecnt, ordflag) { var cnt = 0; var xValue = 440; var valCnt = 8; var lblup = false; var sordflag = ""; sordflag = ordflag.split("/"); if(linecnt == 1) { xValue = 500; valCnt = 6; } if(linecnt == 2) { xValue = 560; valCnt = 2; } if(linecnt == 3) { xValue = 440; valCnt = 8; lblup = true;} //¾àÁ¾·ù(³»º¹¾à/ÁÖ»ç¾à/¿Ü¿ë¾à) for(mPoint = parseInt(sordflag[0]); mPoint <= parseInt(sordflag[sordflag.length - 2]); mPoint++) { var xtims = 0; var drugcnt = 0; if(lblup) { //½ÃÀÛ(X, Y) xValue = 440; valCnt = 8; cnt = 0; // /*PrnKind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/prntkind"); var commkind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/commkind") CommAX.PrnKind =PrnKind; if(commkind == "02") { CommAX.PortNm = 1; } else { CommAX.PortNm = 2; } if(commkind == "01") { CommAX.PrtNm = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval"); }*/ // var reprint =""; if ( model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/lblprnttims")>0 ){ reprint ="(Àç)"; } sSndMsg += astfStartFormat(0, 0, "B"); //iPageCnt++; ////////////////////////////////////////////////// // ¶óº§ »ó´Ü³»¿ë // ///////////////////////////////////////////////// //º´½Ç sSndMsg += astfPrintOut(30, 30, 6, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/roomcd"),""); //ȯÀÚ¸í sSndMsg += astfPrintOut(180, 30, 6, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/patnm").substring(0,5),""); //¹ÙÄÚµå(º¯È¯) sSndMsg += astfBarCode_Code39(390, 40, "N", 70, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/barcode")); //ȯÀÚ¹øÈ£ sSndMsg += astfPrintOut(30, 85, 3, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/pid") ,""); //Åõ¾à¹øÈ£=>20091014 À̼±°æ : Å©°í ÁøÇÏ°Ô º¯°æ sSndMsg += astfPrintOut(130, 85, 6, " (" + model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugno") + ")",""); //¼ºº°³ªÀÌ sSndMsg += astfPrintOut(280, 85, 3, reprint+model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/sexage"),""); //󹿰ú¾à¾î¸í sSndMsg += astfPrintOut(30, 135, 3, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/deptengabbr"),""); //ÀÇ»ç¸í sSndMsg += astfPrintOut(120, 135, 3, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/orddrnm"),""); //ó¹æÀÏÀÚ sSndMsg += astfPrintOut(270, 135, 3, fDateFormat(model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdd")),""); //ÆäÀÌÁö¼ö //sSndMsg += astfPrintOut(430, 135, 3, iPageCnt+"/"+iTotalPageNum,""); //¹ÙÄÚµå sSndMsg += astfPrintOut(510, 130, 3, "*"+model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/barcode")+"*",""); //¼±±×¸®±â sSndMsg += astfGraphicBox(5, 180, 815, 0, 4); sSndMsg += astfPrintOut(20, 600, 2, "*ÀǾàǰÀº ±× Ư¼º»ó º¸°ü¹×°ü¸®°¡ ¾ö°ÝÇØ¾ßÇϹǷÎ, "); sSndMsg += astfPrintOut(20, 630, 2, " ÀÏ´Ü Á¶Á¦Åõ¾àµÈ ¾àÀº ¹Ý³³ÇÒ ¼ö ¾ø½À´Ï´Ù."); lblup = false; //} sSndMsg += astfPrintOut(30, 220, 7, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm"),""); //¶óº§³»¿ë var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm"); var qty = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpqty"); var dayqty = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/dayprcpqty"); var tims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims"); var dayno = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdayno");//ó¹æÀϼö var mthddayno = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/dayno"); //¿ë¹ýÀϼö //¾àÄÚµå Ãâ·Â var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm"); var dayno1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdayno"); var mthd1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd1"); var mthd2 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd2"); var mthd3 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd3"); var mthdcd = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthdcd"); // ¿ë¹ý Ãâ·Â var lbltims =0; lbl_tims = mthd2.split(","); if ( mthdcd == "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["+mPoint+"]/prcptims"); } else { lbltims = lbl_tims.length; } tims = lbltims; xtims = tims; /*for(var j = mPoint; 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"); if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6) && !fChkSumcls(j)){ drugcnt++; } else { break; } } if ( drugcnt == 1 ){ if(lbltims == 1) { if(mthd2.indexOf("¸¶´Ù") == -1) { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+lbltims+ "ȸ"+fChkFloat(qty)+"Æ÷[Á¤]¾¿ "+dayno+"ÀϺÐ",""); prcpqty = prcpqty * lbltims; } else { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+tims+ "ȸ"+fChkFloat(qty)+"Æ÷[Á¤]¾¿ "+dayno+"ÀϺÐ",""); prcpqty = prcpqty * tims; } } else { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+lbltims+ "ȸ"+fChkFloat(qty)+"Æ÷[Á¤]¾¿ "+dayno+"ÀϺÐ",""); prcpqty = prcpqty * lbltims; } } else {*/ if(lbltims == 1) { if(mthd2.indexOf("¸¶´Ù") == -1) { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+lbltims+ "ȸ 1Æ÷¾¿ "+dayno+"ÀϺÐ",""); } else { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+tims+ "ȸ 1Æ÷¾¿ "+dayno+"ÀϺÐ",""); } } else { sSndMsg += astfPrintOut(210, 220, 7, "1ÀÏ "+lbltims+ "ȸ 1Æ÷¾¿ "+dayno+"ÀϺÐ",""); } //} //¿ë¹ý1 var val = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd1") + model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd2") + model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd3"); sSndMsg += astfPrintOut(30, 290, 7, val,""); //¿ë¹ý2 sSndMsg += astfPrintOut(30, 360, 7, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthdcnts4"),""); } else{ var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm"); var dayno1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdayno"); var mthd1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd1"); var mthd2 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd2"); var mthd3 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd3"); var mthdcd = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthdcd"); var tims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims"); // ¿ë¹ý Ãâ·Â var lbltims =0; lbl_tims = mthd2.split(","); if ( mthdcd == "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["+mPoint+"]/prcptims"); } else { lbltims = lbl_tims.length; } tims = lbltims; xtims = tims; } for(var j = mPoint; j <= parseInt(sordflag[sordflag.length - 2]) ; 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"); //if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6) // && !fChkSumcls(j)){ //if(model.getValue("/root/main/lbllist/lbllist["+j+"]/fst_prnt") == "Y"){ var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims"); prcpqty = Math.ceil( prcpqty * xtims*1000)/1000 ; var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd") +" "+prcpqty +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6); sSndMsg += astfPrintOut(30+((cnt%2)*380), xValue+((parseInt(cnt/2, 10))*40), 2, val, ""); //} cnt++; //} else { // break; //} //if(cnt == 8){ if(cnt == valCnt){ j++; lblup = true; break; } } mPoint = j-1; //var s ="º¹¿ë±â°£: "+(rcptdd.toDate("YYYYMMDD")).getDateFormat("YYYY/MM/DD") +" - "+ ((rcptdd.toDate("YYYYMMDD")).getAddDate( parseInt(dayno),"D")).getDateFormat("YYYY/MM/DD") ; //sSndMsg +=astfPrintOut(30, 630, 3, s); //Á¾·á(¸Å¼ö) sSndMsg += astfEndFormat(0); CommAX.SendMsg(sSndMsg); fSleep(500); sSndMsg = ""; } } /** * */ function fDateFormat(sDD, sYMD) { if(sYMD == "MD"){ return sDD.substr(4,2)+"/"+sDD.substr(6,2); } else { return sDD.substr(0,4)+"/"+sDD.substr(4,2)+"/"+sDD.substr(6,2); } } /** * */ function fPrntTime(sDD, sTM) { //if(PrnKind == "2" || PrnKind == "7" ) { return sDD.substr(4,2)+"/"+sDD.substr(6,2)+" "+sTM.substr(0,2)+":"+sTM.substr(2,2); //} else { // return sDD.substr(4,2)+" / "+sDD.substr(6,2)+" "+sTM.substr(0,2)+":"+sTM.substr(2,2)+":"+sTM.substr(4,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 == "IS"|| sSumcls == "IX"|| sSumcls == "X" || sSumcls == "I"){ chk = true; } if ( sSumcls == "D" && sSnglyn =="Y" ) { chk = true; } if ( sDrugindependpackflag =="Y"){ chk = true; } return chk; } /** * ¹°¾à¶óº§Ãâ·Â */ function fLiquidLBLPrint() { // Comm ¼³Á¤ //CommAX.CommPort = "1"; // Ãâ·Â Port //CommAX.Settings = "9600,n,8,1"; // Comm ¼³Á¤ //CommAX.Settings = "127.0.0.1"; // Comm ¼³Á¤ 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") if ( PrnKind ==7 ) { CommAX.PrnKind =4; } else { CommAX.PrnKind =PrnKind; } if(commkind == "02") { CommAX.PortNm = 1; } else { CommAX.PortNm = 2; } if(commkind == "01") { CommAX.PrtNm = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval"); } var reprint =""; //if ( CommAX.PortOpen() == true) { for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){ if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){ reprint ="(Àç)"; } //½ÃÀÛ(X, Y) sSndMsg += astfStartFormat(0, 0, "S"); ////////////////////////////////////////////////// // ¶óº§ »ó´Ü³»¿ë // ///////////////////////////////////////////////// //º´½Ç //sSndMsg += astfPrintOut(50, 30, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),""); //ȯÀÚ¸í //sSndMsg += astfPrintOut(50, 85, 6, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),""); //³»º¹¾à //sSndMsg += astfPrintOut(250, 30, 3, "³»º¹¾à",""); //ó¹æÀÏÀÚ //sSndMsg += astfPrintOut(250, 70, 3, fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd")),""); //ȯÀÚ¹øÈ£(Åõ¾à¹øÈ£) //sSndMsg += astfPrintOut(250, 110, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+ " ( "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+" )",""); //¼±±×¸®±â //sSndMsg += astfGraphicBox(5, 145, 465, 0, 4); var sDD = getCurrentDate(); var sTM = getCurrentTime(); //¶óº§À̸§(³»º¹¾à/ÁÖ»ç¾à/¸¶¾à) sSndMsg += astfPrintOut(20, 25, 20, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),""); //if(PrnKind == "2" || PrnKind == "7" ) { //Ãâ·ÂÀÏÀÚ sSndMsg += astfPrintOut(190, 25, 21, "Ãâ·Â:"+fPrntTime(sDD, sTM),""); //Ãâ·ÂÀÏÀÚ sSndMsg += astfPrintOut(190, 55, 21, "ó¹æ:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),""); //} else { //Ãâ·ÂÀÏÀÚ // sSndMsg += astfPrintOut(220, 25, 21, "Ãâ ·Â : "+fPrntTime(sDD, sTM),""); //Ãâ·ÂÀÏÀÚ // sSndMsg += astfPrintOut(220, 55, 21, "ó ¹æ : "+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),""); //} //º´½Ç sSndMsg += astfPrintOut(20, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),""); //ȯÀÚÀ̸§ sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),""); //ȯÀÚ¹øÈ£ sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+")",""); //¼±±×¸®±â sSndMsg += astfGraphicBox(5, 120, 465, 0, 4); ////////////////////////////////////////////////// // ¶óº§ Çϴܳ»¿ë // ///////////////////////////////////////////////// //¶óº§³»¿ë 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 qty = Math.ceil(dayqty / tims * 1000)/1000 ; var totqty = parseInt(dayqty)*parseInt(dayno); var mthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1"); var mthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2"); var mthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"); //¿ë¹ý if ( mthd1 == "" && mthd2 == "" && mthd3 == "" ){ //1ÀÏ Xȸ Xml¾¿ XÀϺРsSndMsg += astfPrintOut(40, 126, 27, "1ÀÏ "+tims+"ȸ "+qty+qtyunit+"¾¿ "+dayno+"ÀϺÐ",""); var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/abbrnm"); if (val.length > 17) { sSndMsg += astfPrintOut(40, 171, 27, val.substring(0,17) ,""); sSndMsg += astfPrintOut(40, 210, 27, val.substring(17,val.length) ,""); } else { sSndMsg += astfPrintOut(40, 210, 27, val ,""); } } else { //1ÀÏ Xȸ Xml¾¿ XÀϺРvar val = mthd1 + " " + mthd2 + " " + mthd3; if (val.length > 17) { sSndMsg += astfPrintOut(40, 126, 27, "1ÀÏ "+tims+"ȸ "+qty+qtyunit+"¾¿ "+dayno+"ÀϺÐ",""); sSndMsg += astfPrintOut(40, 171, 27, val.substring(0,17) ,""); sSndMsg += astfPrintOut(40, 210, 27, val.substring(17,val.length) ,""); } else { sSndMsg += astfPrintOut(40, 165, 27, "1ÀÏ "+tims+"ȸ "+qty+qtyunit+"¾¿ "+dayno+"ÀϺÐ",""); sSndMsg += astfPrintOut(40, 210, 27, val ,""); } } //¿ë¹ý //sSndMsg += astfPrintOut(40, 210, 27, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/abbrnm"),""); //¾àǰÄÚµå + Ãѿ뷮 //sSndMsg += astfPrintOut(40, 255, 27, "[ "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd")+" ] "+totqty,""); //¾àǰÄÚµå + Ãѿ뷮 + ¾àǰ¸í var prcpnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm"); if(PrnKind == "2") { var val = "[ "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd")+" ] "+ parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")) + " " + prcpnm; sSndMsg += astfPrintOut(20, 255, 27, val,""); } else { if(prcpnm.length > 12) { prcpnm = prcpnm.substring(0,12); } sSndMsg += astfPrintOut(20, 255, 27, "[ "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd")+" ] "+ parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")) + " " + prcpnm,""); } //º¸°ü¹æ¹ý var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1"); lblcnts1 = lblcnts1.setReplaceWord("~", "-"); //20090728 if ( lblcnts1 == "" ) { if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd") != ""){ sSndMsg += astfPrintOut(40, 300, 27, "< "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd")+" >",""); } } else { if(lblcnts1.length > 17){ //ÁÖÀÇ»çÇ× sSndMsg += astfPrintOut(20, 285, 3, lblcnts1.substring(0,17),""); sSndMsg += astfPrintOut(20, 315, 3, lblcnts1.substring(17,lblcnts1.length),""); } else { //ÁÖÀÇ»çÇ× sSndMsg += astfPrintOut(40, 300, 27, lblcnts1,""); } } //Á¾·á(¸Å¼ö) sSndMsg += astfEndFormat(0); CommAX.SendMsg(sSndMsg); fSleep(500); sSndMsg = ""; } //CommAX.PortClose(); model.refresh(); //} }