1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636 |
- /**
- * 파 일 명 : SPADT61300.js
- * 설 명 : (팝업)원내라벨출력 Javascriot
- * 설 계 자 : 공두경
- * 작 성 자 : 공두경
- * 수정이력 : 2007.09.20 / 최초작성 / 공두경
- */
- var sSndMsg = ""; //라벨출력내용
- var iPoint = 0; //라벨출력row
- var iCnt = 0; //라벨출력매수
- var iImageCnt = 0; //라벨그래픽폰트수
- var ordflag = "";
- var iTotalPageNum = 0;
- var mPoint = 0;
- //var iPageCnt = 1; //페이지번호 조회
- var iPageCnt = 0;
- var iPageCntO = 1; //외래 큰라벨출력양식 사용
- var nextPage = false;
- var vCnt = 0;
- /**
- * 초기화
- */
- function fInit() {
- var sParam = model.getAttribute("params");
- model.makeValue("/root/send/prcpinfo/drugdd", astfMatrixData(sParam, 1, 0));
- model.makeValue("/root/send/prcpinfo/drugno", astfMatrixData(sParam, 1, 1));
- model.makeValue("/root/send/prcpinfo/ioflag", astfMatrixData(sParam, 1, 2));
- model.makeValue("/root/send/prcpinfo/lblflag", astfMatrixData(sParam, 1, 3));
- model.makeValue("/root/send/prcpinfo/liquidflag", astfMatrixData(sParam, 1, 4));
- model.makeValue("/root/send/prcpinfo/reprintyn", astfMatrixData(sParam, 1, 5));
- model.makeValue("/root/send/prcpinfo/autoinprntyn", astfMatrixData(sParam, 1, 6));
- model.makeValue("/root/send/prcpinfo/lbl5", astfMatrixData(sParam, 1, 7)); // 2010.03.18 pymi
- model.makeValue("/root/send/prcpinfo/atclblyn", astfMatrixData(sParam, 1, 8)); // 2010-12-13 이선경
- model.makeValue("/root/send/prcpinfo/lblkindflag", astfMatrixData(sParam, 1, 9)); // 2010-12-31 이선경
- model.makeValue("/root/send/prcpinfo/noname", astfMatrixData(sParam, 1, 10)); // 2011.03.22 pymi
- model.makeValue("/root/send/prcpinfo/prntflag", "O");
- var dutplceinstcd = getUserInfo("dutplceinstcd");
-
- submit("TRADT61301");
-
- if(model.getValue("/root/main/lbllist/lbllist["+1+"]/drugkindnm") != ""){
- if(model.getValue("/root/send/prcpinfo/liquidflag") == "Y"){
- fLiquidLBLPrint();
- } else {
- if (model.getValue("/root/send/prcpinfo/lblkindflag") == "S") {
- fLBLPrint_knu("S");
- } else {
- ///2015년 3월11일 김치국 외래 주사약큰라벨 Flag 만듬
- var Vdrugkind = model.getValue("/root/main/lbllist/lbllist["+1+"]/drugkindnm")
- if ( Vdrugkind == "[주사약]" && dutplceinstcd == '031' ){
- fLBLPrint_knu("LJ");
- } else {
- fLBLPrint_knu("L");
- }
- }
- }
- }
-
- model.refresh();
-
- window.close();
- }
- /**
- *
- */
- function fStopTimer() {
- window.clearinterval(gTimer);
- }
- function fSleep(numberMillis) {
- var now = new Date();;
- var exitTime = now.getTime() + numberMillis;
- while (true) {
- now = new Date();
- if (now.getTime() > exitTime)
- return;
- }
- }
- /**
- * 라벨출력
- */
- function fLBLPrint() {
- /*
- 라벨 Sorting 로직
- //mgt에서 vo로 리턴
- 대분류
- - 내복약, 외용약, 주사, 항암제, TPN, 마약,
- 중분류
- - 방법코드
- 소분류
- - 내복약,외용약(방법코드), 주사,마약,항암제(mix)
-
-
- web js 출력로직
- 1 약종류(내복약/주사약/외용약)
- 1.1 방법코드
- 1.2 처방수량
- */
-
- var prcpnum = "";
- var prcpCnt = 14; // 20101030_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
-
- // 라벨내용 copy
- //model.makeNode("/root/main/lbllist2");
- //model.copyNode("/root/main/lbllist2", "/root/main/lbllist");
-
- //iTotalPageNum = iPageCnt;
- //iPageCnt = 0;
-
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
-
- model.makeNode("/root/main/prnt/lbllist[" +iPageCnt+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCnt+ "]", "/root/main/lbllist/lbllist["+iPoint+"]");
- //바코드(변환)
- // 20101030_laboru_경북대병원_atc drugkind 구분자에 의한 바코드 출력 형식
- // t : "ATC" , p : 산제 바코드, e : blank
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "t" ) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/barcode2", "ATC");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/barcode", "");
- } else if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "p") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/barcode", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode"));
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/barcode", "");
- }
-
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- var mthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
-
- if (mthdcd == "ZZZ" || mthdcd == "A10PQ") { //기타용법이거나 '필요시 복용하십시오' 용법인 경우도 단독라벨출력
- sumcls = mthdcd;
- }
-
- //복용기간 계산시 수납일자를 기준으로 하고 출력
- rcptdd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/rcptdd");
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind");
- if(atc_drugkind != "p" && fChkSumcls(iPoint)){
- //단독라벨출력
- if(model.getValue("/root/send/prcpinfo/lblkindflag") == "L1"){//경북대병원 큰라벨(본원)
- fIndependPrint2();
- } else {
- fIndependPrint();
- }
- } else {
- //일반라벨출력
- if(model.getValue("/root/send/prcpinfo/lblkindflag") == "L1"){//경북대병원 큰라벨(본원)
- fGnrlPrint2();
- } else {
- fGnrlPrint();
- }
- }
- }
- makeReportPreview(0,0,10, 10, "");
- model.makeNode("/root/main/barcdprntsetup/prntsetupinfo");
- model.copyNode("/root/main/barcdprntsetup/prntsetupinfo","/root/init/barcdprntsetup/prntsetupinfo");
- if(model.getValue("/root/send/prcpinfo/lblkindflag") == "L1"){//경북대병원 큰라벨(본원)
- model.removeNodeset("/root/main/lbllist/lbllist");
- model.makeNode("/root/main/lbllist");
- model.copyNode("/root/main/lbllist", "/root/main/prnt");
- fPrintRexbar("RFADT62303");
- } else {
- fPrintRexbar("RFADT61300");
- }
- }
- /**
- *
- */
- function fIndependPrint() {
-
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var qtyunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqtyunit");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); //처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
- var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //약품마스터의 수량단위
-
- if (drugkindnm == "[주사약]"){
- //용법2
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts" , val);
- } 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") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"정씩 "+(dayno*mthddayno)+"일분");
- } else {
- if(packunit == "cap" || packunit == "tab") {
- packunit = "알"; // 20110413_laboru_경북대병원_단위가 cap, tab 일때 알로 바꾸기
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(tmpqty)+ packunit +"씩 "+(dayno*mthddayno)+"일분");
- }
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"포[정]씩 "+(dayno*mthddayno)+"일분");
- }
-
- var mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts", mth);
- }
-
- // 2010.03.18 pymi
- if(!fChkSumcls(iPoint) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty"))
- +" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/prcpcd", val);
- }
- // (e)
- iPageCnt++;
- }
- /*
- * 20101231 이선경 추가 : 경북대병원 병동약국에서 외래환자처방을 큰라벨(본원)으로 출력함
- */
- function fIndependPrint2() {
-
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var qtyunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqtyunit");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); //처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
- var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //약품마스터의 수량단위
-
- if (drugkindnm == "[주사약]"){
- //용법2
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts" , val);
- } 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") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", tims+"회 "+ (dayno*mthddayno)+"일분");
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", tims+"회 "+ (dayno*mthddayno)+"일분");
- }
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", tims+"회 "+ (dayno*mthddayno)+"일분");
- }
-
- var mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts", mth);
- }
-
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugno", "<" + model.getValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugno") + ">");
-
- // 2010.03.18 pymi
- if(!fChkSumcls(iPoint) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty"))
- +" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/prcpcd", val);
- }
- // (e)
- iPageCnt++;
- }
- /**
- *
- */
- function fGnrlPrint() {
- var cnt = 0;
- var ordCnt = 0;
-
- var tmppc = "";
- var sndprcpcnt = 1;
- //라벨내용
- 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 != "[내복약]") {
- if (drugkindnm == "[주사약]"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
-
- val += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts" , val);
- }
-
- 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)){
- 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 ;
- // 2010.03.18 pymi
- if(!fChkSumcls(j) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/sndprcp"+sndprcpcnt, tmppc);
- sndprcpcnt++;
- }
-
- cnt++;
- iPoint = j ;
- } else {
- iPageCnt++;
- iPoint = j - 1;
- break;
- }
-
-
- if(cnt == 12){ // 20101030_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- iPageCnt++;
- break;
- }
- }
-
- sndprcpcnt = 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;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/samedrugflag", "Y");
- if(lbltims == 1) {
- if(mthd2.indexOf("마다") == -1) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+dayno+"일분");
-
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", mthddayno + "일 "+tims+ "회 1포씩 "+dayno+"일분");
-
- }
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+dayno+"일분");
- }
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3") + "\n" + 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)){
-
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2");
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
-
- if(lblcnts2.length > 0) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/lblcnts2", model.getValue("/root/main/prnt/lbllist["+iPageCnt+"]/lblcnts2") + "\n" + lblcnts2);
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/lblcnts2flag", "Y");
- }
-
- if(sndprcpcnt > 12) {
- var prePage = iPageCnt;
- iPageCnt++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCnt+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCnt+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp6", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp12", "");
- }
- var val = prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/sndprcp"+sndprcpcnt, val);
- sndprcpcnt++;
- iPoint = j;
-
- } else {
- iPageCnt++;
- iPoint = j - 1;
- break;
- }
- }
- }
-
- }
- /**
- * 20101231 이선경 추가 : 경북대병원 병동약국에서 외래환자처방을 큰라벨(본원)으로 출력함
- */
- function fGnrlPrint2() {
- var cnt = 0;
- var ordCnt = 0;
-
- var tmppc = "";
- var sndprcpcnt = 1;
- //라벨내용
- 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 != "[내복약]") {
- if (drugkindnm == "[주사약]"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
-
- val += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts" , val);
- }
-
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugno", "<" + model.getValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugno") + ">");
- 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)){
- 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 ;
- // 2010.03.18 pymi
- if(!fChkSumcls(j) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/sndprcp"+sndprcpcnt, tmppc);
- sndprcpcnt++;
- }
-
- cnt++;
- iPoint = j ;
- } else {
- iPageCnt++;
- iPoint = j - 1;
- break;
- }
-
-
- if(cnt == 12){ // 20101030_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- iPageCnt++;
- break;
- }
- }
-
- sndprcpcnt = 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;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/samedrugflag", "Y");
- if(lbltims == 1) {
- if(mthd2.indexOf("마다") == -1) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", lbltims+ "회 "+dayno+"일분");
-
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", tims+ "회 "+dayno+"일분");
-
- }
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", lbltims+ "회 "+dayno+"일분");
- }
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
-
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugno", "<" + model.getValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugno") + ">");
-
-
- 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)){
-
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2");
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
-
- if(lblcnts2.length > 0) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/lblcnts2", model.getValue("/root/main/prnt/lbllist["+iPageCnt+"]/lblcnts2") + "\n" + lblcnts2);
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/lblcnts2flag", "Y");
- }
-
- if(sndprcpcnt > 12) {
- var prePage = iPageCnt;
- iPageCnt++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCnt+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCnt+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp6", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/sndprcp12", "");
- }
- var val = prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/sndprcp"+sndprcpcnt, val);
- sndprcpcnt++;
- iPoint = j;
-
- } else {
- iPageCnt++;
- iPoint = j - 1;
- break;
- }
- }
- }
-
- }
- /**
- *
- */
- function fGetImage() {
- var pImage = "";
- iImageCnt++;
- if(iImageCnt > 99){
- pImage = "GRAPH"+iImageCnt;
- } else if(iImageCnt > 9){
- pImage = "GRAPH0"+iImageCnt;
- } else {
- pImage = "GRAPH00"+iImageCnt;
- }
- return pImage
- }
- /**
- *
- */
- function fDateFormat(sDD) {
-
- return sDD.substr(0,4)+"/"+sDD.substr(4,2)+"/"+sDD.substr(6,2);
- }
- /**
- *
- */
- function fChkFloat(qty) {
- var fQty = parseFloat(qty);
- var fRst = "";
- if(fQty%1 == 0){
- fRst = parseInt(qty);
- } else {
- fRst = qty;
- }
-
- return fRst;
- }
- /**
- *
- */
- function fChkSumcls(cnt) {
- var chk = false;
- var sSumcls = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/sumcls");
- var sSnglyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/atcifsnglyn");
- var sDrugindependpackflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/drugindependpackflag");
- var atcyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/atcyn");
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/atc_drugkind");
- var prcpnm = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/prcpnm");
- if(sSumcls == "DI" || sSumcls == "DS"|| sSumcls == "DX"|| sSumcls == "DT" || sSumcls == "DM" || sSumcls == "IH"|| sSumcls == "IO" || sSumcls == "DG" // 20110512_laboru_pack 추가
- || sSumcls == "IS"|| sSumcls == "IX"|| sSumcls == "X" || sSumcls == "ZZZ" || sSumcls == "A10PQ" || sSumcls == "I"){
- chk = true;
- }
- if ( sSumcls == "D" && sSnglyn =="Y" ) {
- chk = true;
- }
- if ( sDrugindependpackflag =="Y"){
- chk = true;
- }
- //2013년 8월1일 김치국 ATC전송시 키지 않는 믹스 번호 70이하 데이타는 단독 라벨 출력 되게
- if ( atcyn =="N" ){
- chk = true;
- }
-
- // alert(" fChkSumcls : " + prcpnm +" : " + atc_drugkind +" : " + atcyn +" : " + chk )
- return chk;
- }
- /**
- * 물약라벨출력
- */
- function fLiquidLBLPrint() {
- 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);
-
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
-
- model.makeNode("/root/main/prnt/lbllist[" +iPageCnt+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCnt+ "]", "/root/main/lbllist/lbllist["+iPoint+"]");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/fprnttime", "출 력 : " + fPrntTime(sDD, sTM));
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/rcptdd", "수 납 : " + fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/rcptdd"), "MD"));
-
- var tpid = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+")" ;
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/pid" , tpid);
- //라벨내용
- 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 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var totqty = parseInt(dayqty)*parseInt(dayno);
- //1일 X회 Xml씩 X일분
- qty = Math.round(qty*10) / 10;
-
- 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 == "" ){
- var tunit = "1일 "+tims+"회 "+qty+qtyunit+"씩 "+dayno+"일분" + "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/abbrnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", tunit);
- } else {
- var tunit = "1일 "+tims+"회 "+qty+qtyunit+"씩 "+dayno+"일분" + "\n" + mthd1 + " " + mthd2 + " " + mthd3;
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/unit", tunit);
- }
-
- //약품코드 + 총용량 + 약품명
- var prcpnm = "[ "+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");
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/prcpcd", prcpnm);
-
- //보관방법
- var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1");
- if ( lblcnts1 == "" ) {
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd") != ""){
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/keepmthd", "< "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd")+" >","");
- }
- } else {
- //주의사항
- model.makeValue("/root/main/prnt/lbllist["+iPageCnt+"]/keepmthd", lblcnts1);
- }
- iPageCnt++;
- }
- makeReportPreview(0,0,10, 10, "");
- model.makeNode("/root/main/barcdprntsetup/prntsetupinfo");
- model.copyNode("/root/main/barcdprntsetup/prntsetupinfo","/root/init/barcdprntsetup/prntsetupinfo");
- fPrintRexbar("RFADT61301");
- }
- function fPrntTime(sDD, sTM) {
-
- return sDD.substr(4,2)+" / "+sDD.substr(6,2)+" "+sTM.substr(0,2)+":"+sTM.substr(2,2)+":"+sTM.substr(4,2);
- }
- /**
- * 20101224 이선경 추가
- * 경북대병원 외래 큰라벨 출력 양식
- */
- function fLBLPrint_knu(type) {
- /*
- 라벨 Sorting 로직
-
- < 정제 >
- 1. 단독조제는 따로 한장으로
- 2. 용법코드 5자리인 것중 5번째 자리 값(식후 10분, 식전 10분 등..)이 같은 것끼리 한장으로
- 3. 그외 나머지는 용법코드 같은 같은 것끼리 한장으로
- < 산제 >
- 1.용법코드 전체가 같은 것끼리 한장으로
-
- */
-
- var prcpnum = "";
- var prcpCnt = 14; // 20101030_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
-
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
-
- var lblprntyn = model.getValue("/root/main/lbllist/lbllist["+ iPoint+"]/lblprntyn");
- if(lblprntyn == "N") {
- model.removeNodeset("/root/main/lbllist/lbllist["+ iPoint +"]");
- } else {
-
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/lbllist/lbllist["+iPoint+"]");
-
- if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
- model.setValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/drugno", model.getValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/drugno") + "(재)");
- }
-
- //바코드(변환)
- // 20101030_laboru_경북대병원_atc drugkind 구분자에 의한 바코드 출력 형식
- // t : "ATC" , p : 산제 바코드, e : blank
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "t" && model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atcyn") == "Y" ) { //2013년 8월1일 김치국
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode2", "ATC");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode", "");
- } else if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "p") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode"));
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode", "");
- }
-
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- var mthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
-
- if (mthdcd == "ZZZ" || mthdcd == "A10PQ") { //기타용법이거나 '필요시 복용하십시오' 용법인 경우도 단독라벨출력
- sumcls = mthdcd;
- }
-
- //복용기간 계산시 수납일자를 기준으로 하고 출력
- rcptdd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/rcptdd");
-
-
- if(type == "S") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/fprnttime", "출 력 : " + fPrntTime(sDD, sTM));
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpdd", "처 방 : " + fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"));
- }
-
- //보관방법 고가 출력
- 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 != ""){
- //sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/keepmthd", "<"+sKeepmthd+">" );
- }
- if(sExpnnm != ""){
- //sSndMsg += astfPrintOut(135, 180, 3, "<"+sExpnnm+">","");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/expnnm", "<"+sExpnnm+">" );
- }
-
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind");
- var sDrugKindcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var sMixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
-
- if(type == "S" && sDrugKindcd == "[주사약]"){
- if(sMixno != "-"){
- fMixLBL_knu();
- } else if(fChkIndependInj(iPoint)){
- //alert(iPoint + "단독주사");
- fIndependPrint_knu(type);
- } else {
- //alert(iPoint + "복합주사");
- fInjDrugLBL_knu();
- }
- } else if(atc_drugkind != "p" && fChkSumcls(iPoint)){
- //단독라벨출력
- // alert(iPoint + " 정제 단독라벨");
- fIndependPrint_knu(type);
- } else {
- //일반라벨출력
- // alert(iPoint + " 복합라벨");
- fGnrlPrint_knu(type);
- }
- } // 20110519_laboru
- }
-
- model.makeNode("/root/main/barcdprntsetup/prntsetupinfo");
- model.copyNode("/root/main/barcdprntsetup/prntsetupinfo","/root/init/barcdprntsetup/prntsetupinfo");
- if(getNodesetCount("/root/main/prnt/lbllist") > 0) {
- if(type == "L1") { //본원큰라벨
- model.removeNodeset("/root/main/lbllist");
- model.makeNode("/root/main/lbllist");
- model.copyNode("/root/main/lbllist", "/root/main/prnt");
- makeReportPreview(0,0,10, 10, "");
- fPrintRexbar("RFADT62303");
- } else if(type == "L"){ //큰라벨
- makeReportPreview(0,0,10, 10, "");
- if (model.getValue("/root/send/prcpinfo/lblkindflag") == "L2"){//경북대병원 큰라벨(본원_외래약국 ) 김치국 20120808
- fPrintRexbar("RFADT61302");
- } else {
- fPrintRexbar("RFADT61300")
- }
- } else if(type == "LJ"){ //주사큰라벨 ///2015년 3월11일 김치국 주사큰라벨 Flag 만듬
- // alert("row 917 SPADT61304.js "+ model.getValue("/root/send/prcpinfo/lblkindflag") )
- makeReportPreview(0,0,10, 10, "");
- if (model.getValue("/root/send/prcpinfo/lblkindflag") == "L2"){//경북대병원 큰라벨(본원_외래약국 ) 김치국 20120808
- fPrintRexbar("RFADT61302");
- } else {
- //fPrintRexbar("RFADT61300")
- fPrintRexbar("RFADT61305");
- }
- } else if(type == "S") { //작은라벨
- model.removeNodeset("/root/main/lbllist");
- model.makeNode("/root/main/lbllist");
- model.copyNode("/root/main/lbllist", "/root/main/prnt");
- makeReportPreview(0,0,10, 10, "");
- fPrintRexbar("RFADT62302");
- }
- }
- }
- /**
- * 20101224 이선경 추가
- * 외래 큰라벨 출력 양식(단독)
- */
- function fIndependPrint_knu(type) {
-
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var qtyunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqtyunit");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); //처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
- var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //약품마스터의 수량단위
- //2013년 8월1일 김치국 ATC전송되지 않는 정제약 처리위해 추가 ~~~~ 여기에서
- var atcyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atcyn"); //ATC라벨 YN
- var prcpnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm"); //처방 명칭
- var prcpmixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno"); //분리번호
- //2013년 8월1일 김치국 ATC전송되지 않는 정제약 처리위해 추가 ~~~ 까지
- var mth = ""; //용법내용설명
- var mth_qty = ""; // 날수 내용설명 김치국 20120808 'L2' 처리
- //경북대병원 큰라벨(본원_외래약국 ) 김치국 20120808 'L2' 처리
- var hostype = model.getValue("/root/send/prcpinfo/lblkindflag");
- if(mthddayno == "" || mthddayno == 0) {
- mthddayno = 1;
- }
- //alert("type: " + type + " " + prcpnm + " " + hostype + " " + packunit + " " + drugkindnm)
- //alert("hostype: " + hostype )
- //alert("drugkindnm : " + drugkindnm )
- //alert("packunit : " + packunit )
- //alert("atcyn : " + atcyn )
- //alert("prcpnm : " + prcpnm )
- if (drugkindnm == "[주사약]"){
- //용법2
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts" , val);
- } else if (drugkindnm == "[내복약]"){
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- // alert("sumcls : " + sumcls )
- if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX" || sumcls == "DG" ){ //20091110 이선경 수정 : 라벨그룹이 마약(경구), 수제, ptp, 기타약일경우 약품마스터의 수량단위를 출력 20110512_laboru_pack 추가
- var tmpqty = Math.round(qty * 10) / 10;
- if(packunit == "T" || packunit == "C") {
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", tims+"회 "+(dayno*mthddayno)+"일분");
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " +fChkFloat(qty)+"정씩 "+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L") {
- if (hostype == "L2") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+(dayno*mthddayno)+"일분");
- mth_qty = fChkFloat(qty)+"정씩 " ;
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"정씩 "+(dayno*mthddayno)+"일분");
- }
- } else if(type == "S") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"정씩 "+(dayno*mthddayno)+"일분");
- }
- } else {
- if(packunit == "cap" || packunit == "tab" ) {
- packunit = "알"; // 20110413_laboru_경북대병원_단위가 cap, tab 일때 알로 바꾸기
- }
- // alert(" prcpnm : " + packunit )
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", tims+"회 "+(dayno*mthddayno)+"일분");
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " +fChkFloat(tmpqty)+ packunit +"씩 "+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L") {
- if (hostype == "L2") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+(dayno*mthddayno)+"일분");
- mth_qty = fChkFloat(tmpqty)+ packunit +"씩 " ;
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(tmpqty)+ packunit +"씩 "+(dayno*mthddayno)+"일분");
- }
-
- } else if(type == "S") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(tmpqty)+ packunit +"씩 "+(dayno*mthddayno)+"일분");
- }
- }
- } else {
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", tims+"회 "+(dayno*mthddayno)+"일분");
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " +fChkFloat(qty)+"포[정]씩 "+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L"){
- if (hostype == "L2") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+(dayno*mthddayno)+"일분");
- //2013년 8월1일 김치국 ATC전송되지 않는 정제약 중 믹스 번호 70이하 처리위해 추가
- if (atcyn == "N" && prcpmixno <= 70 ) {
- mth_qty = fChkFloat(qty)+"알씩 " ;
- }else{
- mth_qty = fChkFloat(qty)+"포[정]씩 " ;
- }
- // alert(" mth_qty: " + mth_qty );
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"포[정]씩 "+(dayno*mthddayno)+"일분");
- }
-
- } else if(type == "S"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"포[정]씩 "+(dayno*mthddayno)+"일분");
- }
- }
-
- if(type == "L" || type == "S") {
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- // alert("마자막 mth : " + mth);
- //if(mth.replace(/ /g,"") != "" ) { mth += "에 "; };
- var strchk = mth.substring(mth.length - 1, mth.length);
- //alert(strchk);
- if(strchk == "후" || strchk == "시" || strchk == "간" || strchk == "중" || strchk == "분") {
- mth += "에 ";
- } else {
- mth += " ";
- }
- /////본원 외래 약국 큰라벨은 수량을 후에 별도로 나타내기 2012.8.29 김치국
- if (hostype == "L2") {
- mth += mth_qty ;
- }
-
- // alert(" 10: " + mth);
- mth += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", mth);
- // alert("마지막 둥: " + mth);
- }
-
- // 2010.03.18 pymi
- if(!fChkSumcls(iPoint) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty"))
- +" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
- if(sumcls == "DT" ) { //20100707_ laboru_PTP 라벨 표시
- val += " (PTP)";
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpcd", val);
- }
- // (e)
- iPageCntO++;
- }
-
- /**
- * 20101224 이선경 추가
- * 외래 큰라벨 출력 양식(일반)
- */
- function fGnrlPrint_knu(type) {
- var cnt = 0;
- var ordCnt = 0;
-
- var tmppc = "";
- var sndprcpcnt = 1;
- //라벨내용
- 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 mthdcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
- var mthdcdfive1 = mthdcd1.substring(4,5);
- var mthdcdthree1 = mthdcd1.substring(2,3);
- var cntpatt1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/cntpatt");
- var mthdcntsno = iPageCntO;
- var mthdcnts_end = ""; //용법내용설명
- var mthdcd5nm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd5nm"); //약품코드5번째자리명칭 (용법세분류)
- var prcpmixno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
- //경북대병원 큰라벨(본원_외래약국 ) 김치국 20120808 'L2' 처리
- var hostype = model.getValue("/root/send/prcpinfo/lblkindflag");
- if(mthddayno == "" || mthddayno == 0) {
- mthddayno = 1;
- }
- //alert(drugkindnm + " " + mthdcd + " " + mthdcdfive1);
- if( drugkindnm != "[내복약]") {
- if (drugkindnm == "[주사약]"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- if(type == "L1") {
- val += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else {
- val += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts" , val);
- }
-
- 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");
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+j+"]/atc_drugkind");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !(fChkSumcls(j) && atc_drugkind != "p") ){
- 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 ;
- // 2010.03.18 pymi
- if(!fChkSumcls(j) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, tmppc);
- sndprcpcnt++;
- }
-
- cnt++;
- iPoint = j ;
- } else {
- iPageCntO++;
- iPoint = j - 1;
- break;
- }
-
-
- if(cnt == 12){ // 20101030_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- iPageCntO++;
- break;
- }
- }
-
- sndprcpcnt = 1;
-
- } else if (drugkindnm == "[내복약]"){
-
- var lbltims =0;
- var unit = "";
- var mthdcnts = ""; //용법내용
- var mthdcnts1 = 0; //아침
- var mthdcnts2 = 0; //점심
- var mthdcnts3 = 0; //저녁
- var mthdcnts4 = 0; //취침전
- var mthdcnts5 = 0; //특수용법
- var mthdtims = 0; //용법횟수
- lbl_tims = mthd2.split(",");
- if ( mthdcd1 == "ZZZ" ){
- lbltims = tims;
- } else if ( mthd3.indexOf("취침") > -1 ) {
- lbltims = lbl_tims.length +1;
- } else if(mthd2.indexOf("마다") > -1){
- lbltims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- } else {
- lbltims = lbl_tims.length;
- }
- tims = lbltims;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/samedrugflag", "Y");
- // alert("시작");
- if(lbltims == 1) {
- if(mthd2.indexOf("마다") == -1) {
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdcdthree1+ "회 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + "에" + " 1포씩"; // 20110411_laboru_에 추가
- //+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L") {
- if (hostype == "L2") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdcdthree1+ "회 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " 1포씩";
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdcdthree1+ "회 1포씩 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- }
- //if(mthdcnts_end != "") { mthdcnts_end += "에 ";}
- //mthdcnts_end +="\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdcdthree1+ "회 "+dayno+"일분" + "\n";
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- } else {
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdcdthree1+ "회 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3")+ "에" + " 1포씩"; // 20110411_laboru_에 추가
- //+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L") {
- if (hostype == "L2") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdcdthree1+ "회 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " 1포씩";
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdcdthree1+ "회 1포씩 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- }
- //if(mthdcnts_end != ""){ mthdcnts_end += "에";}
- //mthdncts_end += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdcdthree1+ "회 "+dayno+"일분" + "\n";
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- }
- } else {
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdcdthree1+ "회 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3")+ "에" + " 1포씩"; // 20110411_laboru_에 추가
- //+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L") {
- if (hostype == "L2") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdcdthree1+ "회 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " 1포씩";
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdcdthree1+ "회 1포씩 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- }
- //if(mthdcnts_end != "") {mthdcnts_end += "에";}
- //mthdcnts_end += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdcdthree1+ "회 "+dayno+"일분" + "\n";
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- }
- //alert("cntpatt1 " + cntpatt1);
- if(cntpatt1.substring(0,1) == "1" && mthdcnts1 == 0) {
- mthdcnts1++;
- mthdtims++;
- }
- if(cntpatt1.substring(1,2) == "1" && mthdcnts2 == 0) {
- mthdcnts2++;
- mthdtims++;
- }
- if(cntpatt1.substring(2,3) == "1" && mthdcnts3 == 0) {
- mthdcnts3++;
- mthdtims++;
- }
- if(cntpatt1.substring(3,4) == "1" && mthdcnts4 == 0) {
- mthdcnts4++;
- mthdtims++;
- }
- if(cntpatt1.substring(4,5) == "1") {
- mthdcnts5++;
- }
- if(mthdtims == 0) {
- mthdtims = mthdcdthree1;
- }
-
- 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");
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+j+"]/atc_drugkind");
- var mthdcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
- var mthdcdfive2 = mthdcd2.substring(4,5);
- var cntpatt2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntpatt");
- var prcpmixno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpmixno");
- //alert("cntpatt2 : " + cntpatt2);
- //20110102 이선경 수정 : 라벨출력시 묶어주는 기준은 용법코드 5번째자리(식후30분후..)와 일수
- //if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- // && !(fChkSumcls(j) && atc_drugkind != "p")){
- if(atc_drugkind == "p") {
- if(dayno1 == dayno2 && (mthdcd1 == mthdcd2 || (mthdcdfive1 == "P" && (mthdcd2 == "A11D" || mthdcd2 == "A11DI") ) ) && prcpmixno1 == prcpmixno2) {
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2");
- var totdrugqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty");
- 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 ;
- //alert(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims" + " " + prcpqty));
- if(lblcnts2.length > 0) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2") + "\n" + lblcnts2);
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2flag", "Y");
- }
- //용법코드의 아침, 점심, 저녁, 취침전 출력
- if(cntpatt2.substring(0,1) == "1" && mthdcnts1 == 0) {
- mthdcnts1++;
- mthdtims++;
- }
- if(cntpatt2.substring(1,2) == "1" && mthdcnts2 == 0) {
- mthdcnts2++;
- mthdtims++;
- }
- if(cntpatt2.substring(2,3) == "1" && mthdcnts3 == 0) {
- mthdcnts3++;
- mthdtims++;
- }
- if(cntpatt2.substring(3,4) == "1" && mthdcnts4 == 0) {
- mthdcnts4++;
- mthdtims++;
- }
- if(cntpatt2.substring(4,5) == "1") {
- mthdcnts5++;
- }
- //용법코드의 최대횟수 출력함
- if(mthdtims == 0) { mthdtims = 1;}
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdtims+ "회 "+dayno2+"일분");
- } else if(type == "L"){
- if (hostype == "L2") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdtims+ "회 "+dayno2+"일분");
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdtims+ "회 1포씩 "+dayno2+"일분");
- }
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdtims+ "회 "+dayno+"일분" + "\n";
- }
- var val = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- if(type == "L1" || type == "L") {
-
- if(sndprcpcnt > 12) {
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp6", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp12", "");
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, val);
- } else if(type == "S") {
- if(sndprcpcnt > 4){
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- }
- if(sndprcpcnt == 1) {
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm", val);
- } else {
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm") + "\n" + val);
- }
- }
-
- sndprcpcnt++;
- iPoint = j;
- } else {
- iPageCntO++;
- iPoint = j - 1;
- break;
- }
- } else if((mthdcdfive1 == mthdcdfive2 && dayno1 == dayno2 && !(fChkSumcls(j) && atc_drugkind != "p") && prcpmixno1 == prcpmixno2)
- || (dayno1 == dayno2 && mthdcdfive1 == "P" && (mthdcd2 == "A11D" || mthdcd2 == "A11DI") && prcpmixno1 == prcpmixno2 ) ) {
- //20110102 이선경 수정 : 라벨출력시 묶어주는 기준은 용법코드 5번째자리(식후30분후..)와 일수
- //예외적으로 일수가 같고 식후30분과 취침전용법은 같이 묶어줌
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2");
- var totdrugqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty");
- 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 ;
- //alert(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims" + " " + prcpqty));
- if(lblcnts2.length > 0) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2") + "\n" + lblcnts2);
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2flag", "Y");
- }
-
- //용법코드의 아침, 점심, 저녁, 취침전 출력
- if(cntpatt2.substring(0,1) == "1" && mthdcnts1 == 0) {
- mthdcnts1++;
- mthdtims++;
- }
- if(cntpatt2.substring(1,2) == "1" && mthdcnts2 == 0) {
- mthdcnts2++;
- mthdtims++;
- }
- if(cntpatt2.substring(2,3) == "1" && mthdcnts3 == 0) {
- mthdcnts3++;
- mthdtims++;
- }
- if(cntpatt2.substring(3,4) == "1" && mthdcnts4 == 0) {
- mthdcnts4++;
- mthdtims++;
- }
- //용법코드의 최대횟수 출력함
- if(mthdtims == 0) { mthdtims = 1;}
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdtims+ "회 "+dayno2+"일분");
- } else if(type == "L"){
- if (hostype == "L2") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdtims+ "회 "+dayno2+"일분");
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdtims+ "회 1포씩 "+dayno2+"일분");
- }
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdtims+ "회 "+dayno+"일분" + "\n";
- }
- var val = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- if(type == "L1" || type == "L") {
-
- if(sndprcpcnt > 12) {
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp6", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp12", "");
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, val);
- } else if(type == "S") {
-
-
- if(sndprcpcnt > 4){
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- }
- if(sndprcpcnt == 1) {
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm", val);
- } else {
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm") + "\n" + val);
- }
- }
- sndprcpcnt++;
- iPoint = j;
-
- } else {
- iPageCntO++;
- iPoint = j - 1;
- break;
- }
- }
-
- /*
- 아침, 점심, 저녁, 취침전 찍지 않는 예외 용법
- 1. 횟수 패턴 5번째 자리값이 1인 경우
- 2. 용법코드 4번째 자리값이 E (시간마다) 인 경우
- 3. 용법코드 4번째 자리값이 D (의사지시대로) 인 경우
- 4. 용법코드 5번째 자리값이 Q (의사지시대로) 인 경우
- */
- if(mthdcnts5 > 0 || mthdcd1.substring(3,4) == "E" || (mthdcd1.substring(3,4) == "D" && mthdcnts4 < 1) || mthdcd1.substring(4,5) == "Q") {
- mthdcnts = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- } else {
- if(mthdcnts1 > 0) {
- mthdcnts = "아침 ";
- }
- if(mthdcnts2 > 0) {
- mthdcnts += "점심 ";
- }
- if(mthdcnts3 > 0) {
- mthdcnts += "저녁 ";
- }
-
- if(mthdcdfive1 == "P" ) {
- mthdcnts += "식후30분"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "I" ) {
- mthdcnts += "식후즉시"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "B" ) {
- mthdcnts += "식전10분"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "A" ) {
- mthdcnts += "식전30분"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "C" ) {
- mthdcnts += "식전1시간"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "D" ) {
- mthdcnts += "식전2시간"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "E" ) {
- mthdcnts += "공복"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "M" ) {
- mthdcnts += "식사도중"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "W" ) {
- mthdcnts += "식사와 함께"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "T" ) {
- mthdcnts += "식후2시간"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "F" ) {
- mthdcnts += "식후1시간"; // 20120725_laboru_
- }
-
- if(mthdcdfive1 == "H" ) {
- mthdcnts += "일어난 직후"; // 20120725_laboru_
- }
-
- if(mthdcdfive1 == "Q" ) {
- mthdcnts += "의사지시대로"; // 20120725_laboru_
- }
-
- if(mthdcnts_end == "취침전에") {
- //mthdcnts += mthdcd5nm;
- } else {
- //mthdcnts += mthdcnts_end;
- }
- if(mthdcnts4 > 0) {
- if(mthdcnts != "" ) {
- mthdcnts += "과 취침전에 ";
- } else {
- mthdcnts = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- }
- } else {
- mthdcnts += "에 ";
- }
- }
-
- for(var p = mthdcntsno ; p <= getNodesetCount("/root/main/prnt/lbllist") ; p++){
- if (hostype == "L2") {
- mthdcnts = mthdcnts + " 1포씩 " ;
- }
- model.makeValue("/root/main/prnt/lbllist["+p+"]/mthdcnts", unit + mthdcnts + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- }
- }
- }
|