12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502 |
- /**
- * 파 일 명 : 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;
- /**
- * 초기화
- */
- function fInit_lbl() {
-
- submit("TRADT62301");
-
- }
- /**
- *
- */
- 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끼리
- 고가,향정,보관벙법이 실온이 아닌경우 자가주사인 경우 단독
- 나머지
- */
- PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
- PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
- PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
- commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
- Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
- PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
- if(commkind == "02") {
- PortNm = 1;
- } else {
- PortNm = 2;
- }
- //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
-
- CommAX.setPrt(PrnKind, PortNm, PrtNm, Comm);
-
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
- var reprint ="";
- totcnt = 0;
- pg = 0;
- totpg = 0;
-
- for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){
- if(model.getValue("/root/main/lbllist/lbllist["+i+"]/pid") == "") {
- return;
- }
-
- if ( model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DI" && model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DS" ){
- totcnt++;
- }
- }
-
- 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");
-
-
- if(PrnKind == "2" || PrnKind == "7") {
- //라벨이름(내복약/주사약/마약)
- sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
- //출력일자
- 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(20, 25, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
- //출력일자
- 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();
- } else {
- fInUseDrugLBL();
- }
- } else if(sDrugKindcd == "[외용약]"){
- //fExUseDrugLBL();
- if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){
- fInUseDrugLBL2();
- } else {
- fInUseDrugLBL();
- }
- } else if(sDrugKindcd == "[주사약]"){
- if(sMixno != "-"){
- fMixLBL();
- } else {
- fInjDrugLBL();
- }
- }
- CommAX.SendMsg(sSndMsg);
- CommAX.PortClose();
- sSndMsg = "";
- }
-
- 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)){
- if(PrnKind == "2") {
- //
- 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,"");
- }
- } else {
- //
- sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
- //
- sSndMsg += astfPrintOut(135, 140+(cnt*30), 11, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"),"");
- if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){
- //
- sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty+qtyunit,"");
- //
- sSndMsg += astfPrintOut(400, 140+(cnt*30), 2, tims,"");
- //
- sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, dayno,"");
- } else {
- //
- sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty,"");
- //
- sSndMsg += astfPrintOut(390, 140+(cnt*30), 2, tims,"");
- //
- sSndMsg += astfPrintOut(420, 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"),"");
-
- //20100224 이선경 수정 : zebra는 명칭 길게 나오도록 함 사토만 잘라서 출력
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- 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,"");
- }
- } else {
- var prcpnm = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- prcpnm = prcpnm.substring(0,16);
- sSndMsg += astfPrintOut(135, 140+(cnt*30), 11, prcpnm,"");
- if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){
- //
- sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty+qtyunit,"");
- //
- sSndMsg += astfPrintOut(400, 140+(cnt*30), 2, tims,"");
- //
- sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, dayno,"");
- } else {
- //
- sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty,"");
- //
- sSndMsg += astfPrintOut(390, 140+(cnt*30), 2, tims,"");
- //
- sSndMsg += astfPrintOut(420, 140+(cnt*30), 2, dayno,"");
- }
- }
-
- cnt++;
- //} else {
- // break;
- //}
-
-
- //if(cnt == fMthdnmLength(iPoint) || fChkIndependDrug(j)){
- // j++;
- // break;
- //}
-
- if(cnt == 6){
- pg++;
-
- sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,"");
- j++;
- chk=true;
- break;
- }
- }
- if ( chk == false ){
- pg++;
- if( model.getValue("/root/main/lbllist/lbllist["+(j-1)+"]/lblgrup") != "DI" ) {
- sSndMsg += astfPrintOut(430,320, 2, pg+"/" +totpg ,"");
- }
- }
- 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 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 처방수량
- */
- PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
- PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
- PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
- commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
- Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
- PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
- if(commkind == "02") {
- PortNm = 1;
- } else {
- PortNm = 2;
- }
-
- //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
-
- CommAX.setPrt(PrnKind, PortNm, PrtNm, Comm);
-
- var reprint="";
- var iPageCnt = 0;
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
- if( fChkSumcls(iPoint)){
- //단독라벨출력
- } else {
- //일반라벨출력
- 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 cnt = 0;
- 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)){
- cnt++;
- } else {
- break;
- }
-
- if(cnt == 8){
- j++;
- break;
- }
- }
- iPoint = j-1;
- }
- iPageCnt++;
- }
- var iTotalPageNum = iPageCnt;
- iPageCnt = 0;
-
-
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid") =="" ) {
- return;
- }
- 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") +
- // " (" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno") + reprint+")","");
- //환자번호
- 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);
-
- if(PrnKind == "2" || PrnKind == "7") {
- sSndMsg += astfPrintOut(20, 600, 2, "*의약품은 그 특성상 보관및관리가 엄격해야하므로, ");
- sSndMsg += astfPrintOut(20, 630, 2, " 일단 조제투약된 약은 반납할 수 없습니다.");
- } else {
- sSndMsg += astfPrintOut(20, 630, 2, "*의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다.");
- }
-
- //////////////////////////////////////////////////
- // 라벨 하단내용 //
- /////////////////////////////////////////////////
- if( fChkSumcls(iPoint)){
- //단독라벨출력
- fIndependPrint();
- } else {
- //일반라벨출력
- fGnrlPrint();
- }
- //종료(매수)
- sSndMsg += astfEndFormat(0);
- CommAX.SendMsg(sSndMsg);
- CommAX.PortClose();
- sSndMsg = "";
- }
- 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");//처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
- var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //약품마스터의 수량단위
- 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"),"");
-
- //이선경 2008-08-20 start(용법이 짤리지 않고 출력되도록)
- 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");
- if(val.length > 22) {
- sSndMsg += astfPrintOut(30, 300, 7, val.substring(0, 22),"");
-
- if(val.substring(0, 22).length > 22) {
- sSndMsg += astfPrintOut(30, 370, 7, val.substring(22, 50),"");
- sSndMsg += astfPrintOut(30, 440, 7, val.substring(50, val.length),"");
- } else {
- sSndMsg += astfPrintOut(30, 370, 7, val.substring(22, val.length),"");
- }
- } else {
- sSndMsg += astfPrintOut(30, 300, 7, val.substring(0, 22),"");
- }
-
- //이선경 2008-08-20 end(용법이 짤리지 않고 출력되도록)
-
- } else if (drugkindnm == "[내복약]"){
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX"){ //20091110 이선경 수정 : 라벨그룹이 마약(경구), 수제, ptp, 기타약일경우 약품마스터의 수량단위를 출력
- var tmpqty = Math.round(qty * 10) / 10;
- if(packunit == "T" || packunit == "C") {
- sSndMsg += astfPrintOut(210, 230, 7, mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"정씩 "+(dayno*mthddayno)+"일분","");
- } else {
- sSndMsg += astfPrintOut(210, 230, 7, mthddayno + "일 "+tims+"회 "+fChkFloat(tmpqty)+ packunit +"씩 "+(dayno*mthddayno)+"일분","");
- }
- } else {
- sSndMsg += astfPrintOut(210, 230, 7, mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"포[정]씩 "+(dayno*mthddayno)+"일분","");
- }
-
- //sSndMsg += astfPrintOut(210, 230, 7, "1일 "+tims+"회 "+fChkFloat(qty)+packunit+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;
- //약종류(내복약/주사약/외용약)
- 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 mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
-
- //약코드 출력
- 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 == "[주사약]"){
- //용법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"),"");
- } 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 if(mthd1.indexOf("의사지시") > -1){
- lbltims = tims;
- } 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, mthddayno + "일 "+lbltims+ "회"+fChkFloat(qty)+"포[정]씩 "+(dayno * mthddayno)+"일분","");
- prcpqty = prcpqty * lbltims;
- } else {
- sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+tims+ "회"+fChkFloat(qty)+"포[정]씩 "+(dayno * mthddayno)+"일분","");
- prcpqty = prcpqty * tims;
- }
- } else {
- sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+lbltims+ "회"+fChkFloat(qty)+"포[정]씩 "+(dayno * mthddayno)+"일분","");
- prcpqty = prcpqty * lbltims;
- }
- } else {
- */
- if(lbltims == 1) {
- if(mthd2.indexOf("마다") == -1) {
- sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분","");
- } else {
- sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+tims+ "회 1포씩 "+(dayno * mthddayno)+"일분","");
-
- }
- } else {
- sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분","");
- }
- //}
-
- //용법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;
-
- //20100224 이선경 수정 : zebra는 명칭 길게 나오도록 함 사토만 잘라서 출력
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
- +" "+prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
- } else {
- var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
- +" "+prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- }
- 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;
-
-
- }
- /**
- *
- */
- 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 == "DP"
- || 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/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
- PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
- PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
- commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
- Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
- PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
- if(commkind == "02") {
- PortNm = 1;
- } else {
- PortNm = 2;
- }
-
- //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
-
- CommAX.setPrt(PrnKind, PortNm, PrtNm, Comm);
-
- var reprint ="";
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid") == "") {
- return;
- }
- 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();
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- //라벨이름(내복약/주사약/마약)
- sSndMsg += astfPrintOut(20, 25, 20, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
- //출력일자
- 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(20, 25, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
- //출력일자
- 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);
- CommAX.PortClose();
- sSndMsg = "";
- }
- model.refresh();
- }
- /*
- * 산제처방을 용법코드별로 라벨출력
- */
- function fPowderlLBLPrint() {
- PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
- PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
- PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
- commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
- Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
- PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
- if(commkind == "02") {
- PortNm = 1;
- } else {
- PortNm = 2;
- }
- //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
-
- CommAX.setPrt(PrnKind, PortNm, PrtNm, Comm);
-
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
- var reprint ="";
- totcnt = 0;
- pg = 0;
- totpg = 0;
-
- for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){
- if(model.getValue("/root/main/lbllist/lbllist["+i+"]/pid") == "") {
- return;
- }
-
- if ( model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DI" && model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DS" ){
- totcnt++;
- }
- }
-
- 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");
-
-
- if(PrnKind == "2" || PrnKind == "7") {
- //라벨이름(내복약/주사약/마약)
- sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
- //출력일자
- 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(20, 25, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
- //출력일자
- 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 == "[내복약]"){
- fInPwdDrugLBL();
- }
- CommAX.SendMsg(sSndMsg);
- CommAX.PortClose();
- sSndMsg = "";
- }
-
- model.refresh();
- }
- /**
- * 산제 용법코드별 라벨상세(용법코드별 분류)
- */
- function fInPwdDrugLBL() {
- // 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 && fChkIpwdDrug(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(PrnKind == "2") {
- //
- 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, dayqty,"");
- //
- sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,"");
- //
- sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,"");
- } else {
- //
- sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
- //
- sSndMsg += astfPrintOut(135, 140+(cnt*30), 11, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"),"");
- //
- sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty,"");
- //
- sSndMsg += astfPrintOut(390, 140+(cnt*30), 2, tims,"");
- //
- sSndMsg += astfPrintOut(420, 140+(cnt*30), 2, dayno,"");
- }
- cnt++;
- } else {
- break;
- }
-
- //if(fChkIpwdDrug(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;
- }
-
- 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 fChkIpwdDrug() {
- }
|