1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587 |
- /**
- * 파 일 명 : SPADT62300.js
- * 설 명 : (팝업)병동라벨출력 Javascriot
- * 설 계 자 : 공두경
- * 작 성 자 : 공두경
- * 수정이력 : 2007.09.17 / 최초작성 / 공두경
- */
- var sSndMsg = ""; //라벨출력내용
- var iPoint = 1; //라벨출력row
- var iCnt = 0; //라벨출력매수
- var iImageCnt = 0; //라벨그래픽폰트수
- var gTimer = null;
- var pg =0;
- var totpg =0;
- var totcnt =0;
- var ordflag = "";
- var bordflag = "";
- var vcnt = 0;
- var nCnt = 0;
- var vlblcnt = false;
- var mlblcnt2 = false;
- var mlblcnt1 = false;
- var nextPage = false;
- var prntflag = false;
- var iTotalPageNum = 0;
- var iPageCnt = 0;
- var BarOCX ;
- /**
- * 초기화
- */
- 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(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX = CommAX1;
- } else {
- BarOCX = CommAX2;
- }
-
- if(commkind == "02") {
- PortNm = 1;
- } else {
- PortNm = 2;
- }
- //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);
- } else {
- BarOCX.CommPort = "1"; // 출력 Port
- BarOCX.Settings = "9600,n,8,1"; // Comm 설정
- var ocxcnt = 0;
- while(!BarOCX.PortOpen() && ocxcnt < 10) {
- BarOCX.PortClose();
- fSleep(2000);
- ocxcnt++;
- }
- }
-
- 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++;
- }
-
- }
-
- // 2010.02.12 pymi
- if( (totcnt%6) != 0) totcnt ++; // 라벨찍기 전에 한줄 띄우기
- for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){
- if(model.getValue("/root/main/lbllist/lbllist["+ i +"]/lblcnts2").length > 0) { totcnt++; vlblcnt = true;}
- }
- // (e)
-
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
- if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
- //시작(X, Y)
- sSndMsg += astfStartFormat(0, 0, "S");
-
-
- 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();
-
- // 2010.02.12 pymi
- //if((vcnt < 6) && (vlblcnt) && (iPoint == getNodesetCount("/root/main/lbllist/lbllist")) ) {
- if(vcnt < 6 && vlblcnt) {
- mlblcnt2 = true;
- fPrntLblCnt2(vcnt, ordflag);
- ordflag = "";
- vcnt = 0;
- }
- // (e)
- } else {
- fInUseDrugLBL();
-
- // 2010.02.19 pymi
- if((vcnt < 4) && (ordflag.length > 0)) {
- mlblcnt1 = true;
- fPrntLblCnt1(vcnt, ordflag);
- ordflag = "";
- vcnt = 0;
- }
- // (e)
- }
- } else if(sDrugKindcd == "[외용약]"){
- //fExUseDrugLBL();
- if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){
- fInUseDrugLBL2();
- } else {
- fInUseDrugLBL();
- }
- } else if(sDrugKindcd == "[주사약]"){
- if(sMixno != "-"){
- fMixLBL();
- } else {
- fInjDrugLBL();
- }
- }
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.SendMsg(sSndMsg);
- BarOCX.PortClose();
- sSndMsg = "";
- } else {
- BarOCX.SendMessage(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- }
-
- // 2010.02.11 pymi
- if(sDrugKindcd == "[내복약]"){
- if( iPoint == getNodesetCount("/root/main/lbllist/lbllist") ) {
- if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){
- if(vlblcnt && (!mlblcnt2) && (ordflag.length > 0)) {
- fPrntLblCnt2(vcnt, ordflag);
- ordflag = "";
- vcnt = 0;
- }
- } else {
-
- if(vlblcnt && (!mlblcnt1) && (ordflag.length > 0)) {
- fPrntLblCnt1(vcnt, ordflag);
- ordflag = "";
- vcnt = 0;
- }
- }
- mlblcnt2 = false;
- mlblcnt1= false;
- } else if( iPoint < getNodesetCount("/root/main/lbllist/lbllist") ){
- if(model.getValue("/root/send/prcpinfo/lbltype") != "Y"){
- if(prntflag) {
- fPrntLblCnt1(vcnt, ordflag);
- ordflag = "";
- vcnt = 0;
- prntflag = false;
- }
- }
- }
- }
- // (e)
- }
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- } else {
- BarOCX.PortClose();
- //alert("close 1");
- }
- 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){
- //
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //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;
- }
-
- //2010-07-05 병동처방전출력 화면 - JCI관련 - 보관구분:[냉장주사]/[고위험주사] MIX이더라고 단독으로 출력한다.
- //if(cnt == 5){
- // break;
- //}
- var sDngryn = model.getValue("/root/main/lbllist/lbllist["+j+"]/dngryn"); //고위험주사 여부
- var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthdyn"); //냉장주사 여부
- if ( sDngryn =="Y" || sKeepmthdyn =="Y" ) {
- if(cnt == 5 || fChkIndependInj(j)){
- //j++;
- break;
- }
- }else{
- 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;
- var chgMth = false; // 2010.02.17 pymi
-
- 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") {
- //
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
- //
-
- // 2010.02.17 pymi
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
- // (e)
-
- 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 {
- //
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
- //
- // 2010.02.17 pymi
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
- // (e)
-
- 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 {
- // 용법바뀔때 2010.02.17 pymi
- chgMth = true;
- // (e)
- break;
- }
-
- if(cnt == fMthdnmLength(iPoint) || fChkIndependDrug(j)){
- j++;
- // 다음 용법이 다를때 2010.02.17 pymi
- sMthdcd3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
- if((sMthdcd1 != sMthdcd3) && (ordflag.length > 0) ){
- prntflag = true;
- }
- //
- 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);
-
- // 용법바뀔때 2010.02.17 pymi
- //if(chgMth) {
- if(ordflag.length > 0) {
- cnt++; //라벨내용찍기전 한줄 띄우기
- if(cnt >= 4) sSndMsg += astfEndFormat(0);
-
- } else {
- sSndMsg += astfEndFormat(0);
- }
- //}
- // (e)
-
- // 용법 바뀌지 않는 마지막이 아닌 처방 2010.02.17 pymi
- /*if(iPoint != getNodesetCount("/root/main/lbllist/lbllist") && (!chgMth)) {
- cnt++;
- sSndMsg += astfEndFormat(0);
- }*/
- vcnt = cnt;
- // (e)
- }
- // 포장라벨내용 출력 2010.02.17 pymi
- function fPrntLblCnt1(cnt, ordflag) {
-
- var lblcnts2 = "";
- var sordflag = ordflag.split("/");
- var mthprnt = false;
- var lblcnt = cnt;
- var qty = "";
- var qtyunit = "";
-
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
-
- var y = 0;
- var x = parseInt(sordflag[y]);
- while( x <= parseInt(sordflag[sordflag.length - 2])) {
- if(lblcnt >= fMthdnmLength(x) || lblcnt == 0) {
- mthprnt = false;
- lblcnt = 0;
-
- //
- /*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;
- }
-
- BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);*/
- //
- var reprint ="";
- if ( model.getValue("/root/main/lbllist/lbllist["+x+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
- //시작(X, Y)
- sSndMsg += astfStartFormat(0, 0, "S");
- //라벨이름(내복약/주사약/마약)
- //sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+x+"]/drugkindnm"),"");
-
- 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["+x+"]/roomcd"),"");
- //환자이름
- sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/patnm"),"");
- //환자번호
- sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+x+"]/drugno")+reprint+")","");
- //선그리기
- sSndMsg += astfGraphicBox(5, 120, 465, 0, 4);
- }
-
- if( !fChkIndependDrug(x) ) {
- lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ x +"]/lblcnts2"); // 2010.02.10 pymi
- sSndMsg += astfPrintOut(20, 140+(lblcnt*30), 24, lblcnts2,"");
- lblcnt ++;
- }
-
- if(lblcnt == fMthdnmLength(x)){
- mthprnt = true;
- lblcnt = 0;
-
- //용법의 길이에 따라 찍는 위치를 달리한다(용법찍을 공간을 확보)
- var iYPoint = 0;
- qty = model.getValue("/root/main/lbllist/lbllist["+ x +"]/prcpqty");
- qtyunit = model.getValue("/root/main/lbllist/lbllist["+ x +"]/prcpqtyunit");
- if( fMthdnmLength(x) == 4){
- iYPoint = 280;
- } else {
- iYPoint = 245;
- }
- if( model.getValue("/root/main/lbllist/lbllist["+x+"]/lblgrup") == "DS"){
- sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+x+"]/prcptims")+"회 "
- +qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+x+"]/prcpdayno")+"일분","");
- } else {
- sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+x+"]/prcptims")+"회 "
- +model.getValue("/root/main/lbllist/lbllist["+x+"]/prcpdayno")+"일분","");
- }
- //
- sSndMsg += fMthdnm(iPoint);
-
- sSndMsg += astfEndFormat(0);
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.SendMsg(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- //break;
- } else {
- BarOCX.SendMessage(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- }
- }
- x = parseInt(sordflag[++y]);
- } // end while
-
- if(!mthprnt) {
-
- //용법의 길이에 따라 찍는 위치를 달리한다(용법찍을 공간을 확보)
- var iYPoint = 0;
- var lastvalu = parseInt(sordflag[sordflag.length - 2]);
- qty = model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcpqty");
- qtyunit = model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcpqtyunit");
- if( fMthdnmLength(lastvalu) == 4){
- iYPoint = 280;
- } else {
- iYPoint = 245;
- }
- if( model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/lblgrup") == "DS"){
- sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcptims")+"회 "
- +qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcpdayno")+"일분","");
- } else {
- sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcptims")+"회 "
- +model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcpdayno")+"일분","");
- }
- //
- sSndMsg += fMthdnm(iPoint);
- sSndMsg += astfEndFormat(0);
- }
-
- if(!mlblcnt1) {
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.SendMsg(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- } else {
- BarOCX.SendMessage(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- }
- }
-
- ordflag = "";
- vcnt = 0;
- mlblcnt1 = false;
-
- model.refresh();
- }
- // (e)
- /**
- * 내복약 라벨 - 한장에 모든 용법 약을 ...
- */
- 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, "*","");
- }
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //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,"");
- }
- }
-
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0) ordflag += j + "/"; // 2010.02.10 pymi
- cnt++;
- //} else {
- // break;
- //}
-
-
- //if(cnt == fMthdnmLength(iPoint) || fChkIndependDrug(j)){
- // j++;
- // break;
- //}
-
- if(cnt == 6){
- pg++;
- sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,"");
- sSndMsg += astfEndFormat(0);
- j++;
- chk=true;
- break;
- }
- }
-
- // 2010.02 18 pymi
- if (chk == false) {
- if( model.getValue("/root/main/lbllist/lbllist["+(j-1)+"]/lblgrup") != "DI" ) {
- cnt ++; // 라벨내용 찍기 전에 한줄 띄우기
- if(!vlblcnt || cnt == 6) {
- pg++;
- sSndMsg += astfPrintOut(430,320, 2, pg+"/" +totpg ,"");
- sSndMsg += astfEndFormat(0);
-
- }
- } else{
- sSndMsg += astfEndFormat(0);
- }
- }
- iPoint = j-1;
- //if( (cnt < 6) && (!vlblcnt)) sSndMsg += astfEndFormat(0);
- vcnt = cnt;
- // (e)
-
- //보관방법 고가 출력
- /*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); // 2010.02.12 pymi
- }
- // 포장라벨내용 출력 2010.02.10 pymi
- function fPrntLblCnt2(cnt, ordflag) {
-
- var lblcnts2 = "";
- var sordflag = ordflag.split("/");
- var lblcnt = cnt;
- var pgprnt = false;
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
- var reprint ="";
- var y = 0;
- var x = parseInt(sordflag[y]);
- //for(var x = parseInt(sordflag[0]); x <= parseInt(sordflag[sordflag.length - 2]); x ++) {
- while( x <= parseInt(sordflag[sordflag.length - 2])) {
- if(lblcnt == 6 || lblcnt == 0) {
- lblcnt = 0;
- pgprnt = false;
-
- /*PrnKind = model.getvalue("/root/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;
- }
-
- BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);*/
- //
-
- if ( model.getValue("/root/main/lbllist/lbllist["+x+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
- //시작(X, Y)
- sSndMsg += astfStartFormat(0, 0, "S");
- //라벨이름(내복약/주사약/마약)
- //sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+x+"]/drugkindnm"),"");
-
- //출력일자
- //sSndMsg += astfPrintOut(190, 25, 21, "출력:"+fPrntTime(sDD, sTM),"");
- //출력일자
- //sSndMsg += astfPrintOut(190, 55, 21, "처방:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+x+"]/prcpdd"), "MD"),"");
-
- 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["+x+"]/roomcd"),"");
- //환자이름
- sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/patnm"),"");
- //환자번호
- sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+x+"]/drugno")+reprint+")","");
- //선그리기
- sSndMsg += astfGraphicBox(5, 120, 465, 0, 4);
- }
- //if( !fChkIndependDrug(x) ) {
- lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ x +"]/lblcnts2"); // 2010.02.10 pymi
- sSndMsg += astfPrintOut(30, 140+(lblcnt*30), 2, lblcnts2,"");
- lblcnt ++;
- //}
-
- if(lblcnt == 6){
- pg++;
- sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,"");
- lblcnt = 0;
- pgprnt = true;
- sSndMsg += astfEndFormat(0);
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.SendMsg(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- } else {
- BarOCX.SendMessage(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- }
- }
- x = parseInt(sordflag[++y]);
- } // end while
-
- if(!pgprnt) {
- pg++;
- sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,"");
- sSndMsg += astfEndFormat(0);
- }
-
- if(!mlblcnt2) {
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.SendMsg(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- } else {
- BarOCX.SendMessage(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = ""
- }
- }
- ordflag = "";
- vcnt = 0;
- pg = 0;
- totpg = 0;
- mlblcnt2 = false;
-
-
- model.refresh();
-
- }
- // (e)
- /**
- * 외용약 라벨
- */
- function fExUseDrugLBL() {
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");
- if(PrnKind == "2") {
- var prcpnm= model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
- prcpnm = prcpnm.substr(0,7);
- } else {
- var prcpnm= model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
- }
- //
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //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");
- }
- //
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //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;
- //2010-06-29 [보관방법:냉장주사/고위험주사] 단독출력
- var sDngryn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/dngryn"); //고위험주사 여부
- var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/keepmthdyn"); //냉장주사 여부
- if(sDngryn == "Y" || sKeepmthdyn=="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(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX = CommAX1;
- } else {
- BarOCX = CommAX2;
- }
-
- if(commkind == "02") {
- PortNm = 1;
- } else {
- PortNm = 2;
- }
-
- //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);
- } else {
- BarOCX.CommPort = "1"; // 출력 Port
- BarOCX.Settings = "9600,n,8,1"; // Comm 설정
- var ocxcnt = 0;
- while(!BarOCX.PortOpen() && ocxcnt < 10) {
- BarOCX.PortClose();
- fSleep(2000);
- ocxcnt++;
- }
- }
-
- var reprint="";
- //var iPageCnt = 0;
- var prcpCnt = 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;
- var lblCnt = 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");
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2"); // 2010.02.17 pymi
-
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !fChkSumcls(j)){
- // 2010.02.18 pymi
- if(lblcnts2.length > 0) { lblCnt ++; }
- cnt++;
- // (e)
-
- // 용법 바뀌지 않는 마지막 처방 갯수 2010.02.18
- if( j == getNodesetCount("/root/main/lbllist/lbllist")) {
- //라벨갯수
- if( lblCnt >= 3 ) {
- iPageCnt += parseInt(lblCnt/3);
- lblCnt = parseInt(lblCnt%3);
-
- }
- // 기준 갯수
- if(lblCnt == 0) prcpCnt = 8;
- if(lblCnt == 1) prcpCnt = 6;
- if(lblCnt == 2) prcpCnt = 2;
-
- // 처방갯수 - 기준갯수
- var reCnt = cnt - prcpCnt;
- if( reCnt > 0 ) {
- iPageCnt ++;
- iPageCnt += parseInt(reCnt/14); // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- }
- }
- // (e)
-
- } else {
-
- //라벨갯수 2010.02.18
- if( lblCnt >= 3 ) {
- iPageCnt += parseInt(lblCnt/3);
- lblCnt = parseInt(lblCnt%3);
-
- }
- // 기준 갯수
- if(lblCnt == 0) prcpCnt = 8;
- if(lblCnt == 1) prcpCnt = 6;
- if(lblCnt == 2) prcpCnt = 2;
-
- // 처방갯수 - 기준갯수
- var reCnt = cnt - prcpCnt;
- if( reCnt > 0 ) {
- iPageCnt ++;
- iPageCnt += parseInt(reCnt/14); // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- }
- // (e)
- break;
- }
-
- /*if(cnt == 8){ //2010.02.10 pymi
- j++;
- break;
- }*/
- }
- iPoint = j-1;
- }
- iPageCnt++;
- }
- iTotalPageNum = iPageCnt; // 2010.02.10 pymi
- //alert(iTotalPageNum);
- 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),"");
- //바코드(변환)
- // 20101101_laboru_경북대병원_atc drugkind 구분자에 의한 바코드 출력 형식
- // t : "ATC" , p : 산제 바코드, e : blank
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "t" ) {
- sSndMsg += astfPrintOut(390, 40, 6, "ATC","");
- } else if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "p") {
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode" , model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode") + iPoint );
- sSndMsg += astfBarCode_Code39(390, 40, "N", 70, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode"));
- } else {
- // 공백
- }
- //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,"");
- //바코드
- // 20101101_laboru_경북대병원_바코드 아래 내용 삭제
- //sSndMsg += astfPrintOut(510, 130, 3, "*"+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode")+"*","");
- //선그리기ㅋ
- // 20101101_laboru_경북대병원_라벨 하단 안내문구 삭제
- /*
- 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);
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.SendMsg(sSndMsg);
- BarOCX.PortClose();
- sSndMsg = "";
- } else {
- BarOCX.SendMessage(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- }
-
- // 2010.02.17 pymi
- if(nextPage) {
- fGnrlPrintnm(nCnt, bordflag);
- nextPage = false;
- nCnt = 0;
- bordflag = "";
- }
- // (e)
- if(iPoint == getNodesetCount("/root/main/lbllist/lbllist")) {
- iTotalPageNum = 0;
- iPageCnt = 0;
- }
- }
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- } else {
- BarOCX.PortClose();
- //alert("close 2");
- }
- 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");
- var atcyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atcyn");
- alert("atcyn");
- 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
-
- // 2010.03.22 pymi
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugflag") == "L" && !fChkSumcls(iPoint) && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty"))
- +" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
- /*
- 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");
- */
- }
- // (e)
-
- if(lblcnts1.length > 28){
- //주의사항
- sSndMsg += astfPrintOut(30, 450, 5, lblcnts1.substring(0,24),"");
- sSndMsg += astfPrintOut(30, 510, 5, lblcnts1.substring(24,lblcnts1.length),"");
- //약정보
- sSndMsg += astfPrintOut(30, 570, 4, val, "");
- } else {
- //주의사항
- sSndMsg += astfPrintOut(30, 450, 5, lblcnts1,"");
- //약정보
- sSndMsg += astfPrintOut(30, 510, 4, val, "");
- }
- }
- /**
- *
- */
- function fGnrlPrint() {
- var cnt = 0;
- var drugcnt = 0;
- var ordCnt = 0; // 2010.02.10 pymi
-
- //약종류(내복약/주사약/외용약)
- sSndMsg += astfPrintOut(30, 220, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");//처방일수
- var 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 == "[주사약]"){
- //용법2
- sSndMsg += astfPrintOut(30, 290, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),"");
- } else if (drugkindnm == "[외용약]"){
- //sSndMsg += astfPrintOut(210, 220, 7, "1일 "+tims+"회 "+qty+"개씩 "+dayno+"일분","");
- //용법1
- sSndMsg += astfPrintOut(30, 290, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"),"");
- //용법2
- sSndMsg += astfPrintOut(30, 360, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),"");
- }
-
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
- var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !fChkSumcls(j)){
- //if(model.getValue("/root/main/lbllist/lbllist["+j+"]/fst_prnt") == "Y"){
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims") ;
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000;
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
- /*
- var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
- +" "+prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
- */
- sSndMsg += astfPrintOut(30+((cnt%2)*380), 440+((parseInt(cnt/2, 10))*40), 2, val, "");
- //}
- cnt++;
- } else {
- break;
- }
-
- if(cnt == 14){ // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- j++;
- break;
- }
- }
- iPoint = j-1;
-
- } else if (drugkindnm == "[내복약]"){
- var lbltims =0;
- lbl_tims = mthd2.split(",");
- if ( mthdcd == "ZZZ" ){
- lbltims = tims;
- } else if ( mthd3.indexOf("취침") > -1 ) {
- lbltims = lbl_tims.length +1;
- } else if(mthd2.indexOf("마다") > -1){
- lbltims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- } else 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;
- var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
- +" "+prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
- sSndMsg += astfPrintOut(30+((cnt%2)*380), 440+((parseInt(cnt/2, 10))*40), 2, val, "");*/
- //}
- //cnt++;
-
- // 2010.02.17 pymi
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2");
- bordflag += j + "/"; // 포장라벨 처방코드 순서
-
- if(lblcnts2.length > 0) {
- sSndMsg += astfPrintOut(30, 440 +(60 * ordCnt), 4, lblcnts2, "");
- //if(ordCnt == 0) {sSndMsg += astfPrintOut(30, 440, 4, lblcnts2, ""); }
- //if(ordCnt == 1) {sSndMsg += astfPrintOut(30, 500, 4, lblcnts2, ""); }
- //if(ordCnt == 2) {sSndMsg += astfPrintOut(30, 560, 4, lblcnts2, ""); }
- ordCnt++; // 포장라벨 갯수
- }
- // (e)
- } else {
- // 용법이 바뀌는 시점 2010.02.10 pymi
- // 처방출력
- fGnrlPrintnm(ordCnt, bordflag);
- bordflag = "";
- // (e)
-
- break;
- }
-
- //if(cnt == 8){
- if(ordCnt == 3){ //2010.02.17 pymi
- j++;
- if(j <= getNodesetCount("/root/main/lbllist/lbllist")) {
- var drugkind3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
- var mthd7 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd8 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd9 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- if((drugkind1 == drugkind3) && (dayno1 == dayno3) && (mthd1 == mthd7 && mthd2 == mthd8 && mthd3 == mthd9)
- && !fChkSumcls(j)){
- // 페이지 넘겨서도 용법 바뀌지 않으면 계속 진행
- } else {
- // 페이지 넘길때 용법이 바뀌면 처방 출력
- //종료(매수)
- nextPage = true;
- nCnt = ordCnt;
- //fGnrlPrintnm(ordCnt, bordflag);
- }
- }
- // (e)
- break;
- }
- }
- iPoint = j-1;
-
- // 용법 바뀌지 않는 마지막 처방 출력 2010.02.17 pymi
- if(iPoint == getNodesetCount("/root/main/lbllist/lbllist") ) {
- if(ordCnt == 3) {
- nextPage = true;
- nCnt = ordCnt;
- }
- else {
- fGnrlPrintnm(ordCnt, bordflag);
- bordflag = "";
- }
- }
- // (e)
- }
- }
- /*
- * 2010.02.17 pymi 처방출력
- */
- function fGnrlPrintnm(linecnt, ordflag) {
- var cnt = 0;
- var xValue = 440;
- var valCnt = 14; // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- var lblup = false;
- var xtims = 0;
- var sordflag = "";
- sordflag = ordflag.split("/");
- if(linecnt == 1) { xValue = 490; valCnt = 6; }
- if(linecnt == 2) { xValue = 550; valCnt = 2; }
- if(linecnt == 3) { xValue = 440; valCnt = 8; lblup = true;}
-
-
- //약종류(내복약/주사약/외용약)
- for(mPoint = parseInt(sordflag[0]); mPoint <= parseInt(sordflag[sordflag.length - 2]); mPoint++) {
- if(lblup) {
- //시작(X, Y)
- xValue = 440;
- valCnt = 14; // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- cnt = 0;
-
- //
- /*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;
- }
-
- BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);*/
- //
- var reprint ="";
- if ( model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
- sSndMsg += astfStartFormat(0, 0, "B");
- iPageCnt++;
- //alert(iPageCnt);
- //////////////////////////////////////////////////
- // 라벨 상단내용 //
- /////////////////////////////////////////////////
- //병실
- sSndMsg += astfPrintOut(30, 30, 6, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/roomcd"),"");
- //환자명
- sSndMsg += astfPrintOut(180, 30, 6, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/patnm").substring(0,5),"");
- //바코드(변환)
- // 20101101_laboru_경북대병원_atc drugkind 구분자에 의한 바코드 출력 형식
- // t : "ATC" , p : 산제 바코드, e : blank
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "t" ) {
- sSndMsg += astfPrintOut(390, 40, 6, "ATC","");
- } else if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "p") {
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode" , model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode") + iPoint );
- sSndMsg += astfBarCode_Code39(390, 40, "N", 70, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode"));
- } else {
- // 공백
- }
- //sSndMsg += astfBarCode_Code39(390, 40, "N", 70, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/barcode"));
- //환자번호(투약번호)
- //sSndMsg += astfPrintOut(30, 85, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid") +
- // " (" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno") + reprint+")","");
- //환자번호
- sSndMsg += astfPrintOut(30, 85, 3, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/pid") ,"");
- //(투약번호)=>20091014 이선경 : 크고 진하게 변경
- sSndMsg += astfPrintOut(130, 85, 6, " (" + model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugno") + ")","");
- //(재)성별나이
- sSndMsg += astfPrintOut(280, 85, 3, reprint+model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/sexage"),"");
- //처방과약어명
- sSndMsg += astfPrintOut(30, 135, 3, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/deptengabbr"),"");
- //의사명
- sSndMsg += astfPrintOut(120, 135, 3, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/orddrnm"),"");
- //처방일자
- sSndMsg += astfPrintOut(270, 135, 3, fDateFormat(model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdd")),"");
- //페이지수
- sSndMsg += astfPrintOut(430, 135, 3, iPageCnt+"/"+iTotalPageNum,"");
- //바코드
- // 20101101_laboru_경북대병원_바코드 아래 내용 삭제
- //sSndMsg += astfPrintOut(510, 130, 3, "*"+model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/barcode")+"*","");
- //선그리기
- // 201011101_laboru_경북대병원_라벨 하단 안내문구 삭제
- /*
- 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, "*의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다.");
- }
- */
- lblup = false;
- //}
-
- sSndMsg += astfPrintOut(30, 220, 7, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm"),"");
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/dayprcpqty");
- var tims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdayno");//처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/dayno"); //용법일수
-
- //약코드 출력
- var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm");
- var dayno1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdayno");
- var mthd1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd1");
- var mthd2 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd2");
- var mthd3 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd3");
- var mthdcd = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthdcd");
-
- var lbltims =0;
- lbl_tims = mthd2.split(",");
- if ( mthdcd == "ZZZ" ){
- lbltims = tims;
- } else if ( mthd3.indexOf("취침") > -1 ) {
- lbltims = lbl_tims.length +1;
- } else if(mthd2.indexOf("마다") > -1){
- lbltims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims");
- } else {
- lbltims = lbl_tims.length;
- }
- tims = lbltims;
- xtims = tims;
-
- 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
- var val = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd1") + model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd2")
- + model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd3");
- sSndMsg += astfPrintOut(30, 290, 7, val,"");
-
- //용법2
- sSndMsg += astfPrintOut(30, 360, 7, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthdcnts4"),"");
- } else{
- //약코드 출력
- var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm");
- var dayno1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdayno");
- var mthd1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd1");
- var mthd2 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd2");
- var mthd3 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd3");
- var mthdcd = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthdcd");
- var tims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims");
-
- var lbltims =0;
- lbl_tims = mthd2.split(",");
- if ( mthdcd == "ZZZ" ){
- lbltims = tims;
- } else if ( mthd3.indexOf("취침") > -1 ) {
- lbltims = lbl_tims.length +1;
- } else if(mthd2.indexOf("마다") > -1){
- lbltims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims");
- } else {
- lbltims = lbl_tims.length;
- }
- tims = lbltims;
- xtims = tims;
- }
-
- for(var j = mPoint; j <= parseInt(sordflag[sordflag.length - 2]) ; j++){
-
- //var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- //var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
- //var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- //var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- //var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- //if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- // && !fChkSumcls(j)){
- //if(model.getValue("/root/main/lbllist/lbllist["+j+"]/fst_prnt") == "Y"){
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
-
- prcpqty = Math.ceil( prcpqty * xtims*1000)/1000 ;
-
- //20100224 이선경 수정 : zebra는 명칭 길게 나오도록 함 사토만 잘라서 출력
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- // 2010.03.22 pymi
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/drugflag") == "L" && !fChkSumcls(j) && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
- /*
- var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
- +" "+prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
- */
- }
- // (e)
- } else {
- // 2010.03.22 pymi
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/drugflag") == "L" && !fChkSumcls(j) && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- /*
- var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
- +" "+prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- */
- }
- // (e)
- }
- sSndMsg += astfPrintOut(30+((cnt%2)*380), xValue+((parseInt(cnt/2, 10))*40), 2, val, "");
- //}
- cnt++;
- //} else {
- // break;
- //}
-
- //if(cnt == 8){
- if(cnt == valCnt){
- j++;
- lblup = true;
- break;
- }
- }
-
- mPoint = j-1;
-
- //var s ="복용기간: "+(rcptdd.toDate("YYYYMMDD")).getDateFormat("YYYY/MM/DD") +" - "+ ((rcptdd.toDate("YYYYMMDD")).getAddDate( parseInt(dayno),"D")).getDateFormat("YYYY/MM/DD") ;
- //sSndMsg +=astfPrintOut(30, 630, 3, s);
-
- //종료(매수)
- sSndMsg += astfEndFormat(0);
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.SendMsg(sSndMsg);
- BarOCX.PortClose();
- sSndMsg = "";
- } else {
- BarOCX.SendMessage(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- }
- }
-
- model.refresh();
-
- }
- /**
- *
- */
- 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;
- }
- //2010-06-29 [보관방법:냉장주사/고위험주사] 단독출력
- var sDngryn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/dngryn"); //고위험주사 여부
- var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/keepmthdyn"); //냉장주사 여부
- if(sDngryn == "Y" || sKeepmthdyn=="Y" ) chk = true;
- return chk;
- }
- /**
- * 물약라벨출력
- */
- function fLiquidLBLPrint() {
- // Comm 설정
- //BarOCX.CommPort = "1"; // 출력 Port
- //BarOCX.Settings = "9600,n,8,1"; // Comm 설정
- //BarOCX.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(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX = CommAX1;
- } else {
- BarOCX = CommAX2;
- }
-
- if(commkind == "02") {
- PortNm = 1;
- } else {
- PortNm = 2;
- }
-
- //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);
- } else {
- BarOCX.CommPort = "1"; // 출력 Port
- BarOCX.Settings = "9600,n,8,1"; // Comm 설정
- var ocxcnt = 0;
- while(!BarOCX.PortOpen() && ocxcnt < 10) {
- BarOCX.PortClose();
- fSleep(2000);
- ocxcnt++;
- }
- }
-
- 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") {
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")) + " " +
- prcpnm;
- /*
- 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);
- }
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- sSndMsg += astfPrintOut(20, 255, 27, parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")) + " " +
- prcpnm,"");
- /*
- 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);
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.SendMsg(sSndMsg);
- BarOCX.PortClose();
- sSndMsg = "";
- } else {
- BarOCX.SendMessage(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- }
- }
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- } else {
- BarOCX.PortClose();
- //alert("close 3");
- }
-
- 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(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX = CommAX1;
- } else {
- BarOCX = CommAX2;
- }
-
- if(commkind == "02") {
- PortNm = 1;
- } else {
- PortNm = 2;
- }
- //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);
- } else {
- BarOCX.CommPort = "1"; // 출력 Port
- BarOCX.Settings = "9600,n,8,1"; // Comm 설정
- var ocxcnt = 0;
- while(!BarOCX.PortOpen() && ocxcnt < 10) {
- BarOCX.PortClose();
- fSleep(2000);
- ocxcnt++;
- }
- }
-
- 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++;
- }
- }
-
- // 2010.02.12 pymi
- if( (totcnt%6) != 0) totcnt ++; // 라벨찍기 전에 한줄 띄우기
- for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){
- if(model.getValue("/root/main/lbllist/lbllist["+ i +"]/lblcnts2").length > 0) { totcnt++; vlblcnt = true;}
- }
- // (e)
-
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
- if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
- //시작(X, Y)
- sSndMsg += astfStartFormat(0, 0, "S");
-
-
- 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();
-
- // 2010.02.19 pymi
- if((vcnt < 4) && (ordflag.length > 0)) {
- mlblcnt1 = true;
- fPrntLblCnt1(vcnt, ordflag);
- ordflag = "";
- vcnt = 0;
- }
- // (e)
- }
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- BarOCX.SendMsg(sSndMsg);
- BarOCX.PortClose();
- sSndMsg = "";
- } else {
- BarOCX.SendMessage(sSndMsg);
- //BarOCX.PortClose();
- sSndMsg = "";
- }
-
- // 2010.02.11 pymi
- if(sDrugKindcd == "[내복약]"){
- if( iPoint == getNodesetCount("/root/main/lbllist/lbllist") ) {
- if(vlblcnt && (!mlblcnt1) && (ordflag.length > 0)) {
- fPrntLblCnt1(vcnt, ordflag);
- ordflag = "";
- vcnt = 0;
- }
- }
- /*else if( iPoint < getNodesetCount("/root/main/lbllist/lbllist") ){
- if(vcnt > 4 && (ordflag.length > 0) ) {
- fPrntLblCnt1(vcnt, ordflag);
- ordflag = "";
- vcnt = 0;
- }
- }*/
- mlblcnt1= false;
- }
- // (e)
- }
-
- if(PrnKind == "2" || PrnKind == "7" ) {//sato
- } else {
- BarOCX.PortClose();
- //alert("close 4");
- }
-
- 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;
- var chgMth = false; // 2010.02.17 pymi
-
- 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") {
- //
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //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,"");
- // 2010.02.17 pymi
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
- // (e)
- } else {
- //
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //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,"");
- // 2010.02.17 pymi
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
- // (e)
- }
- cnt++;
- } else {
- // 용법바뀔때 2010.02.17 pymi
- chgMth = true;
- // (e)
- break;
- }
-
- //if(fChkIpwdDrug(j)){
- // j++;
- // break;
- //}
- if(cnt == fMthdnmLength(iPoint)){
- j++;
- // 다음 용법이 다를때 2010.02.17 pymi
- sMthdcd3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
- if((sMthdcd1 != sMthdcd3) && (ordflag.length > 0) ){
- prntflag = true;
- }
- 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);
-
- // 용법바뀔때 2010.02.17 pymi
- //if(chgMth) {
- if(ordflag.length > 0) {
- cnt++; //라벨내용찍기전 한줄 띄우기
- if(cnt >= 4) sSndMsg += astfEndFormat(0);
-
- } else {
- sSndMsg += astfEndFormat(0);
- }
- //}
- // (e)
-
- vcnt = cnt;
-
- }
- function fChkIpwdDrug() {
- }
|