1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351 |
- /**
- * 파 일 명 : 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 NBflag = false; // 큰라벨 일반라벨 내복약 flag
- var iTotalPageNum = 0;
- var iPageCnt = 0;
- var iPageCntO = 1; //외래 큰라벨출력양식 사용
- var lblsz = ""; // 큰라벨 1,2 구분
- //var BarOCX ;
- /**
- * 초기화
- */
- function fInit_lbl() {
- model.removeNode("/root/main/lbllist2");
- model.removeNode("/root/main/lbllist");
-
- var lblitem = null; //라벨구분
- var lblstr = "";
- var lblsize = ""; //라벨출력크기
- var lblgrupAD = "N"; //정제라벨 체크여부
- var lblgrupDT = "N"; //PTP라벨 체크여부
-
- var flag = model.getValue("/root/hidden/srchinfo/flagtmp");
- var lblitem = model.getValue("/root/hidden/srchinfo/tmplblitem");
-
- // alert("row:53 SPADT62305.js- 1 " + flag );
-
- if(flag == "A") {//자동출력
- lblstr = model.getValue("/root/hidden/srchinfo/autolblflag");
- //lblitem = model.getValue("/root/hidden/srchinfo/autolblflag").split("|");
- lblsize = model.getValue("/root/hidden/srchinfo/autolblsize");
- if(lblstr.indexOf("AD") >= 0){
- lblgrupAD = "Y";
- }
- if(lblstr.indexOf("DT") >= 0){
- lblgrupDT = "Y";
- }
- } else if(flag == "M") {//수동출력
- lblstr = model.getValue("/root/hidden/srchinfo/manllblflag");
- //lblitem = model.getValue("/root/hidden/srchinfo/manllblflag").split("|");
- lblsize = model.getValue("/root/hidden/srchinfo/lblsizeflag");
- if(lblstr.indexOf("AD") >= 0){
- lblgrupAD = "Y";
- }
- if(lblstr.indexOf("DT") >= 0){
- lblgrupDT = "Y";
- }
- }
- /* model.makeValue("/root/send/prcpinfo/etcdescflag", model.getValue("/root/hidden/srchinfo/etcdescflag"));
- model.makeValue("/root/send/prcpinfo/lblkind", model.getValue("/root/hidden/srchinfo/lblkind"));
- model.makeValue("/root/send/prcpinfo/lbltype", model.getValue("/root/init/lbltype/item/lbltype"));
- model.makeValue("/root/send/prcpinfo/drugkind", model.getValue("/root/hidden/srchinfo/drugkind"));
- model.makeValue("/root/send/prcpinfo/autoyn", model.getValue("/root/hidden/srchinfo/autoyn"));
- model.makeValue("/root/send/prcpinfo/version", "new");*/
-
- model.makeValue("/root/send/prcpinfo/noname", model.getValue("/root/hidden/srchinfo/noname")); // 2011.03.28 pymi
- // alert("row:85 SPADT62305.js- 1 " + lblsize );
- if(lblsize == "L") {//자동출력에 큰라벨 출력이면 환자별로 한꺼번에 뽑아야 라벨총장수와 페이지 번호 찍음
- var lblstr2 = lblstr.setReplaceWord("AD", "D|DX|DH|DP");
- lblstr2 = lblstr2.setReplaceWord("AI", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
- model.makeValue("/root/send/prcpinfo/lblflag", lblstr2);
- model.makeValue("/root/send/prcpinfo/lblsizeflag", "L");
- //fInit_lbl();
- submit("TRADT62301");
- //fBigLBLPrint("L");
- fBigLBLPrint_knu("L");//20101224 이선경 수정 : 외래 큰라벨 양식으로 출력하는 부분 새로 작성
-
- } else if(lblsize == "S") {
-
- model.makeValue("/root/send/prcpinfo/lblsizeflag", "S");
- //for (var i = 0; i < lblitem.length; i++) {
- if (lblitem =="AD"){
- //20100405 이선경 추가 : 라벨그룹의 PTP가 체크되어 있고 정제 작은라벨(리스트형식) 출력시 ptp 함께 출력하는 옵션일때 PTP함께 출력
- if(lblgrupDT == "Y" && model.getValue("/root/init/sumprcpflagyn/flagyn/lbl6yn") == "Y") {
- model.makeValue("/root/send/prcpinfo/lblflag", "D|DX|DH|DP|DT");
- } else {
- model.makeValue("/root/send/prcpinfo/lblflag", "D|DX|DH|DP");
- }
- //fInit_lbl();
- submit("TRADT62301");
- //fSmallLBLPrint();
- fBigLBLPrint_knu("S");
- }
- //주사
- if (lblitem =="AI"){
- model.makeValue("/root/send/prcpinfo/lblflag", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
- //fInit_lbl();
- submit("TRADT62301");
- //fSmallLBLPrint();
- fBigLBLPrint_knu("S");
- }
- //PTP
- if (lblitem=="DT"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DT");
- //fInit_lbl();
- submit("TRADT62301");
- //fSmallLBLPrint();
- fBigLBLPrint_knu("S");
- }
- //외용
- if (lblitem=="DI"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DI");
- //fInit_lbl();
- submit("TRADT62301");
- fLiquidLBLPrint();
- }
- //수제
- if (lblitem=="DS"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DS");
- //fInit_lbl();
- submit("TRADT62301");
- fLiquidLBLPrint();
- }
-
- //PACK 20110922_laboru_pack 류도 작은 라벨 출력되게 수정
- if (lblitem=="DG"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DG");
- //fInit_lbl();
- submit("TRADT62301");
- fLiquidLBLPrint();
- }
-
- //PTP단독처방
- if (lblitem=="PTS"){
- model.makeValue("/root/send/prcpinfo/lblflag", "PTS");
- //fInit_lbl();
- submit("TRADT62301");
- //fSmallLBLPrint();
- fBigLBLPrint_knu("S");
- }
- //산제용법별
- if (lblitem=="DP"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DP");
- //fInit_lbl();
- submit("TRADT62301");
- fPowderlLBLPrint();
- }
- //2010-06-29 [보관방법:냉장주사] 단독출력
- if (lblitem =="LBL_INJ_I"){
- model.makeValue("/root/send/prcpinfo/lblflag", "LBL_INJ_I");
- submit("TRADT62301");
- //fSmallLBLPrint();
- fBigLBLPrint_knu("S");
- }
- //2010-06-29 [보관방법:고위험주사] 단독출력
- if (lblitem =="LBL_INJ_D"){
- model.makeValue("/root/send/prcpinfo/lblflag", "LBL_INJ_D");
- submit("TRADT62301");
- //fSmallLBLPrint();
- fBigLBLPrint_knu("S");
- }
- //}
- } else if(lblsize == "L1") {// 20101222_laboru_경북대병원_경대 본원 라벨(큰라벨 2)
- var lblstr2 = lblstr.setReplaceWord("AD", "D|DX|DH|DP");
- lblstr2 = lblstr2.setReplaceWord("AI", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
- model.makeValue("/root/send/prcpinfo/lblflag", lblstr2);
- model.makeValue("/root/send/prcpinfo/lblsizeflag", "L");
- //fInit_lbl();
- submit("TRADT62301");
- //fBigLBLPrint("L1");
- // alert(" lblsize : " + lblsize )
- // alert(" fBigLBLPrint_knu Call" )
- fBigLBLPrint_knu("L1");
- }
-
- window.close();
-
- }
- /**
- *
- */
- function fStopTimer() {
- window.clearinterval(gTimer);
- }
- function fSleep(numberMillis) {
- var now = new Date();
- var exitTime = now.getTime() + numberMillis;
- while (true) {
- now = new Date();
- if (now.getTime() > exitTime)
- return;
- }
- }
- /**
- * 병동 라벨출력(작은사이즈)
- */
- function fSmallLBLPrint() {
- /*
- 라벨 Sorting 로직
- //mgt에서 vo로 리턴
- 대분류
- - 내복약, 외용약, 주사, 항암제, TPN, 마약,
- 중분류
- - 방법코드
- 소분류
- - 내복약,외용약(방법코드), 주사,마약,항암제(mix)
-
-
- web js 출력로직
- 가. 퇴원/외래/응급실/외박/외출 : 큰사이즈라벨
- 외래기준
- 나. 그외 입원처방
- 1. 외용약
- 단독출력
- 2. 내복약
- 단독출력
- 따로포장
- 복용방법
- 3. 주사약
- 단독출력
- mix끼리
- 고가,향정,보관벙법이 실온이 아닌경우 자가주사인 경우 단독
- 나머지
- */
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
- var reprint ="";
- totcnt = 0;
- pg = 0;
- totpg = 0;
-
- // 라벨내용 copy
- model.makeNode("/root/main/lbllist2");
- model.copyNode("/root/main/lbllist2", "/root/main/lbllist");
-
- 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 ="(재)";
- }
-
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/fprnttime", "출 력 : " + fPrntTime(sDD, sTM));
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd", "처 방 : " + fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"));
-
- //병실
- //환자이름
- var patnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm")
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm", patnm.substr(0,6));
- //환자번호
- var tpid = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+")" ;
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/pid" , tpid);
-
- var sDrugKindcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var sMixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
- if(sDrugKindcd == "[내복약]"){
- if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){
- fInUseDrugLBL2();
- } else {
- fInUseDrugLBL();
- }
- } else if(sDrugKindcd == "[외용약]"){
- if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){
- fInUseDrugLBL2();
- } else {
- fInUseDrugLBL();
- }
- } else if(sDrugKindcd == "[주사약]"){
- if(sMixno != "-"){
- fMixLBL();
- } else {
- fInjDrugLBL();
- }
- }
- }
-
- if(getNodesetCount("/root/main/lbllist/lbllist") > 0 ) {
- // 20100429_laboru_병동 작은라벨 .
- makeReportPreview(0,0,10, 10, "");
- fPrintRexbar("RFADT62302");
- }
- model.refresh();
- }
- /**
- * mix 라벨
- */
- function fMixLBL() {
- var sMixno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
- var cnt = 0;
- var unit = "";
- var tprcpcd = "";
- var tprcpnm = "";
- 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");
- var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- var prcpcd = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd");
-
- //prcpnm = prcpnm.substr(0,7);
-
- if(sMixno1 == sMixno2){
-
- if(cnt == 0) {
- tprcpcd = prcpcd;
- tprcpnm = prcpnm;
- unit = fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
- } else {
- tprcpcd += "\n" + prcpcd;
- tprcpnm += "\n" + prcpnm;
- unit += "\n" + fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
- }
-
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- j--
- }
-
- cnt++;
- } else {
- j--;
- break;
- }
-
- if(cnt == 5){
- break;
- }
- }
- //iPoint = j;
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd" , tprcpcd );
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm" , tprcpnm );
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit" , unit );
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts", "N6");
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts2", "");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/pageflag", "N");
- }
- /**
- * 내복약 라벨
- */
- 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
- var unit = "";
- var tprcpnm = "";
- var tprcpcd = "";
- var tlblcnts2 = "";
-
- //var tj = iPoint+1;
-
- 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");
- var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- var prcpcd= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd");
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/lblcnts2");
- model.makeValue("/root/main/lbllist/lbllist["+j+"]/inusedrugflag", "Y");
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty"));
-
- if((sMthdcd1 == sMthdcd2)){
- // 2010.02.17 pymi
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
-
- //prcpnm = prcpnm.substr(0,7);
-
- if(cnt == 0) {
- tprcpnm = val + " " + prcpnm;
- tprcpcd = prcpcd;
- tlblcnts2 = lblcnts2;
- } else {
- tprcpnm += "\n" + val + " " +prcpnm;
- tprcpcd += "\n" + prcpcd;
- tlblcnts2 += "\n" + lblcnts2;
- }
-
- if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){
-
- if(cnt == 0) {
- unit = dayqty+qtyunit+ " "+tims+ " "+dayno;
- } else {
- unit += "\n" + dayqty+qtyunit+ " "+tims+ " "+dayno;
- }
-
- } else {
- if(cnt == 0) {
- unit = dayqty+ " "+tims+ " "+dayno;
- } else {
- unit += "\n" + dayqty+ " "+tims+ " "+dayno;
- }
- }
-
-
- // 20100421_laboru_rex 중복 출력 막기 위해
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- model.removeNode("/root/main/lbllist2/lbllist["+j+"]");
- j--;
- }
-
- 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;
- }
- }
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", tprcpcd);
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm", tprcpnm);
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", unit);
-
- if(ordflag.length > 0) {
- model.makeValue("/root/main/lbllist2/lbllist["+iPoint+"]/lblcnts2", tlblcnts2);
- }
-
- //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 != ""){
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd", "<"+sKeepmthd+">" );
- }
- if(sExpnnm != ""){
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/expnnm", "<"+sExpnnm+">" );
- }
-
- //용법의 길이에 따라 찍는 위치를 달리한다(용법찍을 공간을 확보)
- var iYPoint = 0;
- if( fMthdnmLength(iPoint) == 4){
- iYPoint = 280;
- } else {
- iYPoint = 245;
- }
-
- var tmth = "";
- if( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblgrup") == "DS"){
- var tmth = "1일 "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"회 "+qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"일분";
- } else {
- var tmth = "1일 "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"회 " +model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"일분";
- }
-
- // 용법 생성
- 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 = "";
- if(sMthd1 != "") sTemp += sMthd1 + " ";
- if(sMthd2 != "") sTemp += sMthd2 + " ";
- if(sMthd3 != "") sTemp += sMthd3 + " ";
- if(sMthd4 != "") sTemp += sMthd4;
-
- tmth += "\n" + sTemp;
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts" , tmth);
- vcnt = cnt;
- }
- /**
- * 내복약 라벨 - 한장에 모든 용법 약을 ...
- */
- 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;
-
- var tprcpcd = "";
- var tprcpnm = "";
- var tlblcnts2 = "";
- var unit = "";
-
- 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;
- }
- 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");
-
- var prcpcd = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd");
- var prcpnm = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/lblcnts2");
-
- //prcpnm = prcpnm.substr(0,7);
- if(cnt == 0) {
- if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DT"){ //PTP는 * 표시
- tprcpcd += "* " + prcpcd;
- } else {
- tprcpcd =prcpcd;
- }
- tprcpnm = prcpnm;
- tlblcnts2 = lblcnts2;
- } else {
- if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DT"){ //PTP는 * 표시
- tprcpcd += "\n" + "* " + prcpcd;
- } else {
- tprcpcd +="\n" + prcpcd;
- }
- tprcpnm += "\n" + prcpnm;
- tlblcnts2 += "\n" + lblcnts2;
- }
-
- if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){
- if(cnt == 0) {
- unit = dayqty+qtyunit+ " "+tims+ " "+dayno;
- } else {
- unit += "\n" + dayqty+qtyunit+ " "+tims+ " "+dayno;
- }
- } else {
-
- if(cnt == 0) {
- unit = dayqty+ " "+tims+ " "+dayno;
- } else {
- unit += "\n" + dayqty+ " "+tims+ " "+dayno;
- }
- }
-
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0) ordflag += j + "/"; // 2010.02.10 pymi
-
-
- // 20100421_laboru_rex 중복 출력 막기 위해
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- model.removeNode("/root/main/lbllist2/lbllist["+j+"]");
- j--;
- }
-
- cnt++;
-
- if(cnt == 6){
- pg++;
- j++;
- chk=true;
- break;
- }
- }
-
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", tprcpcd);
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm", tprcpnm);
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", unit);
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts", "N6");
- if(ordflag.length > 0) {
- model.makeValue("/root/main/lbllist2/lbllist["+iPoint+"]/lblcnts2", tlblcnts2);
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts2", "");
- }
-
- // 2010.02 18 pymi
- if (chk == false) {
- if( model.getValue("/root/main/lbllist/lbllist["+(j-1)+"]/lblgrup") != "DI" ) {
- cnt ++; // 라벨내용 찍기 전에 한줄 띄우기
- if(!vlblcnt || cnt == 6) {
- pg++;
- }
- }
- }
- vcnt = cnt;
-
- }
- // 20100503_laboru_포장라벨내용 출력
- function fPrntLblCnt2New() {
-
- var tPoint = 1;
- var reprint = "";
-
- for(var t = 1 ; t <= getNodesetCount("/root/main/lbllist2/lbllist") ; t++) {
-
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
-
- if(model.getValue("/root/main/lbllist2/lbllist["+t+"]/pid") =="" ) {
- return;
- }
- if ( model.getValue("/root/main/lbllist2/lbllist["+t+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
-
- model.makeValue("/root/main/lbllist2/lbllist["+t+"]/fprnttime", "출 력 : " + fPrntTime(sDD, sTM));
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/prcpdd", "처 방 : " + fDateFormat(model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpdd"), "MD"));
- var tpid = model.getValue("/root/main/lbllist2/lbllist["+t+"]/pid")+" ("+model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugno")+reprint+")" ;
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/pid" , tpid);
- for(var y = tPoint ; y <= getNodesetCount("/root/main/lbllist/lbllist") ; y++) {
-
- if(y == getNodesetCount("/root/main/lbllist/lbllist")) {
- model.makeNode("root/main/lbllist/lbllist[" + (y+1) + "]");
-
- model.copyNode("root/main/lbllist/lbllist[" + (y+1) + "]", "root/main/lbllist2/lbllist[" + t + "]");
-
- model.makeValue("/root/main/lbllist/lbllist["+ (y+1) +"]/mthdcnts", "N6");
-
- model.setValue("/root/main/lbllist/lbllist["+ (y+1) +"]/prcpcd" , "");
- model.setValue("/root/main/lbllist/lbllist["+ (y+1) +"]/prcpnm" , "");
- break;
- }
- }
- }
-
- ordflag = "";
- vcnt = 0;
- pg = 0;
- totpg = 0;
- mlblcnt2 = false;
- }
- /**
- * 외용약 라벨
- */
- function fExUseDrugLBL() {
- }
- /**
- * 주사약 라벨
- */
- function fInjDrugLBL() {
- var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- var cnt = 0;
- var unit = "";
- var tprcpcd = "";
- var tprcpnm = "";
- 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");
- var prcpnm = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- var prcpcd = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd");
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty"));
- //prcpnm = prcpnm.substr(0,7);
-
- if(cnt == 0) {
- tprcpcd = prcpcd;
- tprcpnm = val + " " + prcpnm;
- unit = fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
- } else {
- tprcpcd += "\n" + prcpcd;
- tprcpnm += "\n" + val + " " + prcpnm;
- unit += "\n" + fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
- }
-
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- j--
- }
- cnt++;
-
- if(cnt == 5 || fChkIndependInj(j)){
- j++;
- break;
- }
- }
-
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd" , tprcpcd );
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm" , tprcpnm );
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit" , unit );
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts2", "");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/pageflag", "N");
- if(!fChkIndependInj(iPoint)) {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts", "N6");
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/inusedrugflag", "Y");
- }
-
- //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 != ""){
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd", "<"+sKeepmthd+">" );
- }
- if(sExpnnm != ""){
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/expnnm", "<"+sExpnnm+">" );
- }
-
-
- }
- /**
- * 내복약 단독라벨 검증작업
- */
- 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(lblsz) {
- /*
- 라벨 Sorting 로직
- //mgt에서 vo로 리턴
- 대분류
- - 내복약, 외용약, 주사, 항암제, TPN, 마약,
- 중분류
- - 방법코드
- 소분류
- - 내복약,외용약(방법코드), 주사,마약,항암제(mix)
-
-
- web js 출력로직
- 1 약종류(내복약/주사약/외용약)
- 1.1 방법코드
- 1.2 처방수량
- */
- // 라벨내용 copy
- model.removeNodeset("/root/main/lbllist2");
- model.makeNode("/root/main/lbllist2");
- model.copyNode("/root/main/lbllist2", "/root/main/lbllist");
-
- // 20100427_laboru_큰라벨 일반라벨 내복약 처방코드 출력
- for(mPoint = 1; mPoint <= getNodesetCount("/root/main/lbllist2/lbllist") ; mPoint++){
- if( fChkSumcls2(mPoint) ) {
- model.removeNode("/root/main/lbllist2/lbllist["+parseInt(mPoint)+"]");
- mPoint--;
- } else {
- //일반라벨출력
- fGnrlPrintnmNew();
- }
- }
-
- 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 ="(재)";
- }
-
- iPageCnt++;
-
- // roomcd
- if(lblsz == "L1") {
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd") + " 호실");
- }
- // patnm.substring(0,5)
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"));
- // barcode
- // 20101101_laboru_경북대병원_atc drugkind 구분자에 의한 바코드 출력 형식
- // t : "ATC" , p : 산제 바코드, e : blank
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "t" ) {
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode", "ATC");
- //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 {
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode", "");
- // 공백
- }
- // pid
- // ( drugno )
- if(lblsz == "L") {
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno", "(" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno") + ")" );
- } else if(lblsz == "L1") {
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno", "<" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno") + ">" );
- }
- // (재) sexage
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/sexage", reprint + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sexage"));
- // deptengabbr
- // orddrnm
- // prcpdd (형식 : 2010/04/15)
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd", fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd")));
- // iPageCnt / iTotalPageNum
- //model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/pagecnt", iPageCnt + "/" + iTotalPageNum);
- // 선 한줄.. 필요한가?
- // 가운데 약품 정보 들어가고...
- // 하단 정보 들어감.
- // *의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다.
- // 20100712_laboru_출력일시 추가
- //var sDD = getCurrentDate();
- //var sTM = getCurrentTime();
- //model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/caution","*의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다." + " ( 출력 : " + fPrntTime(sDD, sTM) + " )");
-
-
- // 처방구분
- var drugflag = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugflag");
- var tdfname = "";
- if(drugflag == "L") {
- tdfname = "퇴원";
- } else {
- tdfname = "입원";
- }
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/drugflag", tdfname);
- //alert(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd"));
-
- if( fChkSumcls(iPoint)){
- //단독라벨출력
- if(lblsz == "L") {
- fIndependPrint();
- } else if(lblsz == "L1") {
- fIndependPrintL1();
- }
-
- } else {
- //일반라벨출력
- if(lblsz == "L") {
- fGnrlPrint();
- } else if(lblsz == "L1") {
- fGnrlPrintL1(); // 20101222_laboru_경북대병원_경북대본원용 라벨 크기
- }
- }
- // 2010.02.17 pymi
- if(nextPage) {
- //fGnrlPrintnm_Old(nCnt, bordflag);
- nextPage = false;
- nCnt = 0;
- bordflag = "";
- }
-
- if(iPoint == getNodesetCount("/root/main/lbllist/lbllist")) {
- iTotalPageNum = 0;
- iPageCnt = 0;
- }
-
- }
- if(NBflag) {
- // 큰라벨 일반라벨 내복약이 있을 때만.
- if(lblsz == "L") {
- fGnrlNbPrint();
- } else if(lblsz == "L1") {
- fGnrlNbPrintL1();
- }
- NBflag = false;
- }
-
- if(getNodesetCount("/root/main/lbllist/lbllist") > 0) {
- // 20100419_laboru_병동 큰라벨 주사.
-
- makeReportPreview(0,0,10, 10, "");
- // 20101222_laboru_경북대병원_경대본원용 라벨 사이즈 L1 추가
- if(lblsz == "L") {
- fPrintRexbar("RFADT62301");
- } else if(lblsz == "L1") {
- fPrintRexbar("RFADT62303");
- }
- //removeReportPreview("RFADT62301");
- }
- model.refresh();
- }
- /*
- * 20100427_laboru_큰라벨 일반라벨 내복약 처방 출력.
- */
- function fGnrlNbPrint() {
-
- var tPoint = 1;
- var reprint = "";
- for(var t = 1 ; t <= getNodesetCount("/root/main/lbllist2/lbllist") ; t++) {
- if(model.getValue("/root/main/lbllist2/lbllist["+t+"]/pid") =="" ) {
- return;
- }
- if ( model.getValue("/root/main/lbllist2/lbllist["+t+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
-
- var drugkind3 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugkindnm");
- var dayno3 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpdayno");
- var mthd7 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd1");
- var mthd8 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd2");
- var mthd9 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd3");
- var mthdcd = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthdcd");
-
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist2/lbllist["+t+"]/dayprcpqty");
- var tims = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpdayno");//처방일수
- var mthddayno = model.getValue("/root/main/lbllist2/lbllist["+t+"]/dayno"); //용법일수
- var packunit = model.getValue("/root/main/lbllist2/lbllist["+t+"]/packunit"); //약품마스터의 수량단위
-
- // patnm.substring(0,5)
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/patnm", model.getValue("/root/main/lbllist2/lbllist["+t+"]/patnm"));
- // barcode
- // pid
- // ( drugno )
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/drugno", "(" + model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugno") + ")" );
- // (재) sexage
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/sexage", reprint + model.getValue("/root/main/lbllist2/lbllist["+t+"]/sexage"));
- // deptengabbr
- // orddrnm
- // prcpdd (형식 : 2010/04/15)
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/prcpdd", fDateFormat(model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpdd")));
- // 선 한줄.. 필요한가?
- // 가운데 약품 정보 들어가고...
- // 하단 정보 들어감.
- // *의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다.
- //model.makeValue("/root/main/lbllist2/lbllist["+t+"]/caution","*의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다.");
-
- // 처방구분
- var drugflag = model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugflag");
- var tdfname = "";
- if(drugflag == "L") {
- tdfname = "퇴원";
- } else {
- tdfname = "입원";
- }
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/drugflag", tdfname);
-
-
- var lbltims =0;
- lbl_tims = mthd8.split(",");
- if ( mthdcd == "ZZZ" ){
- lbltims = tims;
- } else if ( mthd9.indexOf("취침") > -1 ) {
- lbltims = lbl_tims.length +1;
- } else if(mthd8.indexOf("마다") > -1){
- lbltims = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcptims");
- } else if(mthd7.indexOf("의사지시") > -1){
- lbltims = tims;
- } else {
- lbltims = lbl_tims.length;
- }
- tims = lbltims;
-
- for(var y = tPoint ; y <= getNodesetCount("/root/main/lbllist/lbllist") ; y++) {
- var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+y+"]/drugkindnm");
- var dayno1 = model.getValue("/root/main/lbllist/lbllist["+y+"]/prcpdayno");
- var mthd1 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthd1");
- var mthd2 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthd2");
- var mthd3 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthd3");
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+y+"]/lblcnts2");
-
- if( !(fChkSumcls(y)) && drugkind1 == "[내복약]" ) {
- if((drugkind1 == drugkind3) && (dayno1 == dayno3) && (mthd1 == mthd7 && mthd2 == mthd8 && mthd3 == mthd9) && !fChkSumcls(y)){
- if(y == getNodesetCount("/root/main/lbllist/lbllist")) {
- model.makeNode("root/main/lbllist/lbllist[" + (y+1) + "]");
-
- model.copyNode("root/main/lbllist/lbllist[" + (y+1) + "]", "root/main/lbllist2/lbllist[" + t + "]");
- model.makeValue("root/main/lbllist/lbllist[" + (y+1) + "]/cntflag2", "Y");
-
- if(lbltims == 1) {
- if(mthd8.indexOf("마다") == -1) {
- model.makeValue("/root/main/lbllist/lbllist["+(y+1)+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분" );
-
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+(y+1)+"]/unit", mthddayno + "일 "+tims+ "회 1포씩 "+(dayno * mthddayno)+"일분" );
-
- }
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+(y+1)+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분" );
-
- }
- var val = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd1") + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd2")
- + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd3");
-
- val += "\n" + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+(y+1)+"]/mthdcnts" , val);
-
- if(model.getValue("/root/main/lbllist/lbllist["+ (y+1) +"]/drugflag") == "L" && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
- model.setValue("/root/main/lbllist/lbllist["+ (y+1) +"]/prcpcd", "");
- model.setValue("/root/main/lbllist/lbllist["+ (y+1) +"]/samedrugflag", "N");
- }
-
- if( (lblcnts2.length <= 0) && (model.getValue("root/main/lbllist/lbllist[" + y + "]/cntflag2") != "Y") ) {
- model.removeNode("/root/main/lbllist/lbllist["+y+"]");
- y--;
- }
-
- break;
- }
- } else {
- tPoint = y+1;
- // 기존 라벨 정보 shift
- var tTotalCnt = getNodesetCount("/root/main/lbllist/lbllist");
- model.makeValue("/root/main/lbllist/lbllist["+(parseInt(tTotalCnt)+1)+"]", "Y");
-
- for(var x = tTotalCnt ; x >= y ; x--) {
- model.copyNode("/root/main/lbllist/lbllist[" + (parseInt(x) + 1) + "]", "/root/main/lbllist/lbllist[" + x + "]" );
- }
-
- model.copyNode("root/main/lbllist/lbllist[" + y + "]", "root/main/lbllist2/lbllist[" + t + "]");
- model.makeValue("root/main/lbllist/lbllist[" + y + "]/cntflag2", "Y");
-
- if(lbltims == 1) {
- if(mthd8.indexOf("마다") == -1) {
- model.makeValue("/root/main/lbllist/lbllist["+y+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분" );
-
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+y+"]/unit", mthddayno + "일 "+tims+ "회 1포씩 "+(dayno * mthddayno)+"일분" );
-
- }
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+y+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분" );
-
- }
- var val = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd1") + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd2")
- + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd3");
-
- val += "\n" + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+y+"]/mthdcnts" , val);
-
- if(model.getValue("/root/main/lbllist/lbllist["+ y +"]/drugflag") == "L" && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
- model.setValue("/root/main/lbllist/lbllist["+ y +"]/prcpcd", "");
- model.setValue("/root/main/lbllist/lbllist["+ y +"]/samedrugflag", "N");
- }
-
- if( (lblcnts2.length <= 0) && (model.getValue("root/main/lbllist/lbllist[" + (y-1) + "]/cntflag2") != "Y") ) {
- model.removeNode("/root/main/lbllist/lbllist["+(y-1)+"]");
- y--;
- }
-
- if( (t +1) == y) {
- tPoint--;
- }
- break;
-
- }
- }
- }
-
-
- }
- }
- /*
- * 20100427_laboru_큰라벨 일반라벨 내복약 처방 출력.
- */
- function fGnrlNbPrintL1() {
-
- var tPoint = 1;
- var reprint = "";
- for(var t = 1 ; t <= getNodesetCount("/root/main/lbllist2/lbllist") ; t++) {
- if(model.getValue("/root/main/lbllist2/lbllist["+t+"]/pid") =="" ) {
- return;
- }
- if ( model.getValue("/root/main/lbllist2/lbllist["+t+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
-
- var drugkind3 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugkindnm");
- var dayno3 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpdayno");
- var mthd7 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd1");
- var mthd8 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd2");
- var mthd9 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd3");
- var mthdcd = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthdcd");
-
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist2/lbllist["+t+"]/dayprcpqty");
- var tims = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpdayno");//처방일수
- var mthddayno = model.getValue("/root/main/lbllist2/lbllist["+t+"]/dayno"); //용법일수
- var packunit = model.getValue("/root/main/lbllist2/lbllist["+t+"]/packunit"); //약품마스터의 수량단위
-
- // roomcd
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/roomcd", model.getValue("/root/main/lbllist2/lbllist["+t+"]/roomcd") + " 호실");
-
- // patnm.substring(0,5)
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/patnm", model.getValue("/root/main/lbllist2/lbllist["+t+"]/patnm"));
- // barcode
- // pid
- // ( drugno )
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/drugno", "<" + model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugno") + ">" );
- // (재) sexage
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/sexage", reprint + model.getValue("/root/main/lbllist2/lbllist["+t+"]/sexage"));
- // deptengabbr
- // orddrnm
- // prcpdd (형식 : 2010/04/15)
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/prcpdd", fDateFormat(model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpdd")));
- // 선 한줄.. 필요한가?
- // 가운데 약품 정보 들어가고...
- // 하단 정보 들어감.
- // *의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다.
- //model.makeValue("/root/main/lbllist2/lbllist["+t+"]/caution","*의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다.");
-
- // 처방구분
- var drugflag = model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugflag");
- var tdfname = "";
- if(drugflag == "L") {
- tdfname = "퇴원";
- } else {
- tdfname = "입원";
- }
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/drugflag", tdfname);
-
-
- var lbltims =0;
- lbl_tims = mthd8.split(",");
- if ( mthdcd == "ZZZ" ){
- lbltims = tims;
- } else if ( mthd9.indexOf("취침") > -1 ) {
- lbltims = lbl_tims.length +1;
- } else if(mthd8.indexOf("마다") > -1){
- lbltims = model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcptims");
- } else if(mthd7.indexOf("의사지시") > -1){
- lbltims = tims;
- } else {
- lbltims = lbl_tims.length;
- }
- tims = lbltims;
- for(var y = tPoint ; y <= getNodesetCount("/root/main/lbllist/lbllist") ; y++) {
- var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+y+"]/drugkindnm");
- var dayno1 = model.getValue("/root/main/lbllist/lbllist["+y+"]/prcpdayno");
- var mthd1 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthd1");
- var mthd2 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthd2");
- var mthd3 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthd3");
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+y+"]/lblcnts2");
-
- if( !(fChkSumcls(y)) && drugkind1 == "[내복약]" ) {
- if((drugkind1 == drugkind3) && (dayno1 == dayno3) && (mthd1 == mthd7 && mthd2 == mthd8 && mthd3 == mthd9) && !fChkSumcls(y)){
- if(y == getNodesetCount("/root/main/lbllist/lbllist")) {
-
- model.makeNode("root/main/lbllist/lbllist[" + (y+1) + "]");
-
- model.copyNode("root/main/lbllist/lbllist[" + (y+1) + "]", "root/main/lbllist2/lbllist[" + t + "]");
- model.makeValue("root/main/lbllist/lbllist[" + (y+1) + "]/cntflag2", "Y");
-
- var val = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd1") + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd2")
- + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd3");
-
- if(lbltims == 1) {
- if(mthd8.indexOf("마다") == -1) {
- model.makeValue("/root/main/lbllist/lbllist["+(y+1)+"]/unit", lbltims+ "회 "+(dayno * mthddayno)+"일분" );
- val += "1포씩 ";
-
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+(y+1)+"]/unit", tims+ "회 "+(dayno * mthddayno)+"일분" );
- val += "1포씩 ";
- }
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+(y+1)+"]/unit", lbltims+ "회 "+(dayno * mthddayno)+"일분" );
- val += "1포씩 ";
- }
-
- val += model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+(y+1)+"]/mthdcnts" , val);
-
- if(model.getValue("/root/main/lbllist/lbllist["+ (y+1) +"]/drugflag") == "L" && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
- model.setValue("/root/main/lbllist/lbllist["+ (y+1) +"]/prcpcd", "");
- model.setValue("/root/main/lbllist/lbllist["+ (y+1) +"]/samedrugflag", "N");
- }
-
- if( (lblcnts2.length <= 0) && (model.getValue("root/main/lbllist/lbllist[" + y + "]/cntflag2") != "Y") ) {
- model.removeNode("/root/main/lbllist/lbllist["+y+"]");
- y--;
- }
-
- break;
- }
- } else {
-
- tPoint = y+1;
- // 기존 라벨 정보 shift
- var tTotalCnt = getNodesetCount("/root/main/lbllist/lbllist");
- model.makeValue("/root/main/lbllist/lbllist["+(parseInt(tTotalCnt)+1)+"]", "Y");
-
- for(var x = tTotalCnt ; x >= y ; x--) {
- model.copyNode("/root/main/lbllist/lbllist[" + (parseInt(x) + 1) + "]", "/root/main/lbllist/lbllist[" + x + "]" );
- }
-
- model.copyNode("root/main/lbllist/lbllist[" + y + "]", "root/main/lbllist2/lbllist[" + t + "]");
- model.makeValue("root/main/lbllist/lbllist[" + y + "]/cntflag2", "Y");
-
- var val = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd1") + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd2")
- + model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthd3");
-
- if(lbltims == 1) {
- if(mthd8.indexOf("마다") == -1) {
- model.makeValue("/root/main/lbllist/lbllist["+y+"]/unit",lbltims+ "회 "+(dayno * mthddayno)+"일분" );
- val += "1포씩 ";
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+y+"]/unit", tims+ "회 "+(dayno * mthddayno)+"일분" );
- val += "1포씩 ";
- }
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+y+"]/unit", lbltims+ "회 "+(dayno * mthddayno)+"일분" );
- val += "1포씩 ";
- }
-
- val += model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+y+"]/mthdcnts" , val);
-
- if(model.getValue("/root/main/lbllist/lbllist["+ y +"]/drugflag") == "L" && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
- model.setValue("/root/main/lbllist/lbllist["+ y +"]/prcpcd", "");
- model.setValue("/root/main/lbllist/lbllist["+ y +"]/samedrugflag", "N");
- }
-
- if( (lblcnts2.length <= 0) && (model.getValue("root/main/lbllist/lbllist[" + (y-1) + "]/cntflag2") != "Y") ) {
- model.removeNode("/root/main/lbllist/lbllist["+(y-1)+"]");
- y--;
- }
-
- break;
-
- }
- }
- }
-
-
- }
- }
- /**
- *
- */
- function fIndependPrint() {
-
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");//처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
- var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //약품마스터의 수량단위
- var powdflag = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/powdflag"); //처방쪽 산제 여부
-
- if (drugkindnm == "[주사약]"){
- //용법2
- //alert("큰라벨+단독라벨+주사약");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
-
- } else if (drugkindnm == "[외용약]"){
- //alert("큰라벨+단독라벨+외용약");
-
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts" , val);
-
-
- } else if (drugkindnm == "[내복약]"){
- //alert("큰라벨+단독라벨+내복약");
-
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX"){ //20091110 이선경 수정 : 라벨그룹이 마약(경구), 수제, ptp, 기타약일경우 약품마스터의 수량단위를 출력
- var tmpqty = Math.round(qty * 1000) / 1000; // 20100803_laboru_소수점 넷째 자리에서 반올림
- if(packunit == "T" || packunit == "C") {
- var unit = mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"정씩 "+(dayno*mthddayno)+"일분";
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", unit);
- } else {
- var unit = mthddayno + "일 "+tims+"회 "+fChkFloat(tmpqty)+ packunit +"씩 "+(dayno*mthddayno)+"일분";
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", unit);
- }
- } else {
- var unit = mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"포[정]씩 "+(dayno*mthddayno)+"일분";
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", unit);
- }
-
- var mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- mth += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts", mth);
- }
-
- // 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");*/
- if(sumcls == "DT" ) { //20100707_ laboru_PTP 라벨 표시
- val += " (PTP)";
- }
-
- //var tmpv += val;
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", val)
- }
- }
- function fIndependPrintL1() {
-
- //라벨내용
- 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"); //약품마스터의 수량단위
- var powdflag = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/powdflag"); //처방쪽 산제 여부
-
- if (drugkindnm == "[주사약]"){
- //용법2
- //alert("큰라벨+단독라벨+주사약");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
-
- } else if (drugkindnm == "[외용약]"){
- //alert("큰라벨+단독라벨+외용약");
-
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts" , val);
-
-
- } else if (drugkindnm == "[내복약]"){
- //alert("큰라벨+단독라벨+내복약");
-
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- var mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
-
- if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX"){ //20091110 이선경 수정 : 라벨그룹이 마약(경구), 수제, ptp, 기타약일경우 약품마스터의 수량단위를 출력
- var tmpqty = Math.round(qty * 1000) / 1000; // 20100803_laboru_소수점 넷째 자리에서 반올림
- if(packunit == "T" || packunit == "C") {
- var unit = tims+"회 "+(dayno*mthddayno)+"일분";
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", unit);
- mth += fChkFloat(qty)+"정씩 ";
- } else {
- var unit = tims+"회 "+(dayno*mthddayno)+"일분";
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", unit);
- mth += fChkFloat(tmpqty)+ packunit +"씩 ";
- }
- } else {
- var unit = tims+"회 "+(dayno*mthddayno)+"일분";
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", unit);
- mth += fChkFloat(qty)+"포[정]씩 ";
- }
-
- mth += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts", mth);
- }
-
- // 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");*/
- if(sumcls == "DT" ) { //20100707_ laboru_PTP 라벨 표시
- val += " (PTP)";
- }
-
- //var tmpv += val;
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", val)
- }
- }
- /**
- *
- */
- function fGnrlPrint() {
-
- var cnt = 0;
- var drugcnt = 0;
- var ordCnt = 0; // 2010.02.10 pymi
- //라벨내용
- 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
- //alert("일반라벨+주사약");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- //alert("일반라벨+외용약");
- //용법1
- //용법2
-
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
-
- val += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts" , val);
- }
-
- var tmppc = "";
- var sndprcpcnt = 1;
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno"); // 처방일수
- var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !fChkSumcls(j)){
- //alert("완전 같은 처방이 복수개일때 같은 라벨지에 출력.");
- //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_경북대병원_라벨 출력물 처방코드 삭제
- tmppc = prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")) + " ";
- /* tmppc = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
- +" "+prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6) + " ";
- */
- //alert(tmppc);
- // 20100607_laboru_처방내용 출력하지 않음.(추후 공통 코드로 빼야함)
- //model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/sndprcp"+sndprcpcnt, tmppc);
- sndprcpcnt++;
- // 20100421_laboru_rex 중복 출력 막기 위해
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- j--;
- }
-
- //}
- cnt++;
- } else {
- break;
- }
-
- // 20100607_laboru_처방내용 출력하지 않음.(추후 공통 코드로 빼야함)
- if(cnt == 12){
- j++;
- break;
- }
- }
-
- // 20100420_laboru
- //if( sndprcpcnt > 2 ) {
- if( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sndprcp1") != "" ) {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/samedrugflag", "Y");
- } else {
- // 20100607_laboru_처방내용 출력하지 않음.(추후 공통 코드로 빼야함)
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", tmppc);
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", "총 " + (sndprcpcnt-1) + " 개 약");
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", "");
- }
-
-
- } else if (drugkindnm == "[내복약]"){
- //alert("일반라벨+내복약");
-
- NBflag = true;
- 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;
-
- // 라벨주의사항2 출력
- var tmplblcnts2 = "";
- var tmppc = "";
- var sndprcpcnt = 1;
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
- var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !fChkSumcls(j)){
-
- // 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, "");
- // 20100421_laboru_라벨주의사항2 내용 유무 flag
- model.makeValue("/root/main/lbllist/lbllist["+iPoint +"]/lblcnts2flag", "Y");
- tmplblcnts2 += lblcnts2 + "\n";
-
- ordCnt++; // 포장라벨 갯수
- }
-
-
- // 20100421_laboru_rex 중복 출력 막기 위해
- if(drugcnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- j--;
- }
-
- drugcnt++;
- } else {
- // 용법이 바뀌는 시점 2010.02.10 pymi
-
- bordflag = "";
-
- break;
- }
-
- 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;
- }
-
- }
-
- if(lbltims == 1) {
- if(mthd2.indexOf("마다") == -1) {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분" );
-
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", mthddayno + "일 "+tims+ "회 1포씩 "+(dayno * mthddayno)+"일분" );
-
- }
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분" );
-
- }
-
- //용법1
- var val = 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
- val += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts" , val);
-
- // 20100420_laboru_약품코드 출력 X
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", "");
-
- // 20100420_laboru_라벨주의사항2 출력
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts2", tmplblcnts2);
-
- }
-
- }
- function fGnrlPrintL1() {
- var cnt = 0;
- var drugcnt = 0;
- var ordCnt = 0; // 2010.02.10 pymi
- //라벨내용
- 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
- //alert("일반라벨+주사약");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- //alert("일반라벨+외용약");
- //용법1
- //용법2
-
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
-
- val += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts" , val);
- }
-
- var tmppc = "";
- var sndprcpcnt = 1;
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno"); // 처방일수
- var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !fChkSumcls(j)){
- //alert("완전 같은 처방이 복수개일때 같은 라벨지에 출력.");
- //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_경북대병원_라벨 출력물 처방코드 삭제
- tmppc = prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")) + " ";
- /* tmppc = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
- +" "+prcpqty
- +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6) + " ";
- */
- //alert(tmppc);
- // 20100607_laboru_처방내용 출력하지 않음.(추후 공통 코드로 빼야함)
- //model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/sndprcp"+sndprcpcnt, tmppc);
- sndprcpcnt++;
- // 20100421_laboru_rex 중복 출력 막기 위해
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- j--;
- }
-
- //}
- cnt++;
- } else {
- break;
- }
-
- // 20100607_laboru_처방내용 출력하지 않음.(추후 공통 코드로 빼야함)
- if(cnt == 12){
- j++;
- break;
- }
- }
-
- // 20100420_laboru
- //if( sndprcpcnt > 2 ) {
- if( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sndprcp1") != "" ) {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/samedrugflag", "Y");
- } else {
- // 20100607_laboru_처방내용 출력하지 않음.(추후 공통 코드로 빼야함)
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", tmppc);
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", "총 " + (sndprcpcnt-1) + " 개 약");
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", "");
- }
-
-
- } else if (drugkindnm == "[내복약]"){
- //alert("일반라벨+내복약");
-
- NBflag = true;
- 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;
-
- // 라벨주의사항2 출력
- var tmplblcnts2 = "";
- var tmppc = "";
- var sndprcpcnt = 1;
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
- var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !fChkSumcls(j)){
-
- // 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, "");
- // 20100421_laboru_라벨주의사항2 내용 유무 flag
- model.makeValue("/root/main/lbllist/lbllist["+iPoint +"]/lblcnts2flag", "Y");
- tmplblcnts2 += lblcnts2 + "\n";
-
- ordCnt++; // 포장라벨 갯수
- }
-
-
- // 20100421_laboru_rex 중복 출력 막기 위해
- if(drugcnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- j--;
- }
-
- drugcnt++;
- } else {
- // 용법이 바뀌는 시점 2010.02.10 pymi
-
- bordflag = "";
-
- break;
- }
-
- 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;
- }
-
- }
-
- //용법1
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3");
-
- if(lbltims == 1) {
- if(mthd2.indexOf("마다") == -1) {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", lbltims+ "회 "+(dayno * mthddayno)+"일분" );
- val += "1포씩 ";
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", tims+ "회 "+(dayno * mthddayno)+"일분" );
- val += "1포씩 ";
- }
- } else {
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", lbltims+ "회 "+(dayno * mthddayno)+"일분" );
- val += "1포씩 ";
- }
-
- //용법2
- val += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts" , val);
-
-
- // 20100420_laboru_약품코드 출력 X
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", "");
-
- // 20100420_laboru_라벨주의사항2 출력
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts2", tmplblcnts2);
-
- }
-
- }
- /*
- * 20100426_laboru_라벨주의사항 출력 후 처방코드를 출력
- */
-
- function fGnrlPrintnmNew() {
- var cnt = 0;
- var drugcnt = 0;
- var ordCnt = 0; // 2010.02.10 pymi
-
- //mPoint = iPoint;
- var reprint="";
- //for(mPoint = 1; mPoint <= getNodesetCount("/root/main/lbllist2/lbllist") ; mPoint++){
-
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/dayprcpqty");
- var tims = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/prcpdayno");//처방일수
- var mthddayno = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/dayno"); //용법일수
-
- //약코드 출력
- var drugkind1 = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/drugkindnm");
- var dayno1 = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/prcpdayno");
- var mthd1 = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/mthd1");
- var mthd2 = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/mthd2");
- var mthd3 = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/mthd3");
- var mthdcd = model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/mthdcd");
-
- 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/lbllist2/lbllist["+mPoint+"]/prcptims");
- } else if(mthd1.indexOf("의사지시") > -1){
- lbltims = tims;
- } else {
- lbltims = lbl_tims.length;
- }
- tims = lbltims;
-
-
- var tmppc = "";
- var sndprcpcnt = 1;
- for(var j = mPoint; j <= getNodesetCount("/root/main/lbllist2/lbllist") ; j++){
- var drugkind2 = model.getValue("/root/main/lbllist2/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist2/lbllist["+j+"]/prcpdayno"); // 처방일수
- var mthd4 = model.getValue("/root/main/lbllist2/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist2/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist2/lbllist["+j+"]/mthd3");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !fChkSumcls2(j)){
- //alert("완전 같은 처방이 복수개일때 같은 라벨지에 출력.");
- //if(model.getValue("/root/main/lbllist/lbllist["+j+"]/fst_prnt") == "Y"){
- var prcpqty = model.getValue("/root/main/lbllist2/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist2/lbllist["+j+"]/prcptims") ;
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000;
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- tmppc = prcpqty
- +" "+(model.getValue("/root/main/lbllist2/lbllist["+j+"]/prcpnm")) + " ";
- /* tmppc = model.getValue("/root/main/lbllist2/lbllist["+j+"]/prcpcd")
- +" "+prcpqty
- +" "+(model.getValue("/root/main/lbllist2/lbllist["+j+"]/prcpnm")).substring(0,6) + " ";
- */
- //alert(tmppc);
- model.makeValue("/root/main/lbllist2/lbllist["+mPoint+"]/sndprcp"+sndprcpcnt, tmppc);
- sndprcpcnt++;
-
- // 20100421_laboru_rex 중복 출력 막기 위해
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist2/lbllist["+j+"]");
- j--;
- }
-
- //}
- cnt++;
- } else {
- break;
- }
-
- if(cnt == 12){
- j++;
- break;
- }
- }
-
- // 20100420_laboru
- //if( sndprcpcnt > 2 ) {
- if( model.getValue("/root/main/lbllist2/lbllist["+mPoint+"]/sndprcp1") != "" ) {
- model.makeValue("/root/main/lbllist2/lbllist["+mPoint+"]/samedrugflag", "Y");
- } else {
- model.makeValue("/root/main/lbllist2/lbllist["+mPoint+"]/prcpcd", tmppc);
- }
-
- } else {
- model.removeNode("/root/main/lbllist2/lbllist["+mPoint+"]");
- mPoint--;
- }
- }
- /**
- *
- */
- 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 atcyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/atcyn");
- var sDrugindependpackflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/drugindependpackflag");
-
- if(sSumcls == "DI" || sSumcls == "DS"|| sSumcls == "DX"|| sSumcls == "DT" || sSumcls == "DM" || sSumcls == "DP" || sSumcls == "DG" //20110511_laboru_pack 류도 수제처럼 단독으로
- || 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;
- }
- //2013년 8월22일 김치국 ATC전송시 키지 않는 믹스 번호 70이하 데이타는 단독 라벨 출력 되게
- if ( atcyn =="N" ){
- 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 fChkSumcls2(cnt) {
- var chk = false;
- var sSumcls = model.getValue("/root/main/lbllist2/lbllist["+cnt+"]/sumcls");
- var sSnglyn = model.getValue("/root/main/lbllist2/lbllist["+cnt+"]/atcifsnglyn");
- var sDrugindependpackflag = model.getValue("/root/main/lbllist2/lbllist["+cnt+"]/drugindependpackflag");
-
- if(sSumcls == "DI" || sSumcls == "DS"|| sSumcls == "DX"|| sSumcls == "DT" || sSumcls == "DM" || sSumcls == "DP"
- || sSumcls == "IH"|| sSumcls == "IO" || sSumcls == "IS"|| sSumcls == "IX"|| sSumcls == "X" || sSumcls == "I"){
- chk = true;
- }
- if ( sSumcls == "D" && sSnglyn =="Y" ) {
- chk = true;
- }
- if ( sDrugindependpackflag =="Y"){
- chk = true;
- }
-
- return chk;
- }
- /**
- * 물약라벨출력
- */
- function fLiquidLBLPrint() {
-
- 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 ="(재)";
- }
-
- //////////////////////////////////////////////////
- // 라벨 상단내용 //
- /////////////////////////////////////////////////
-
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/fprnttime", "출 력 : " + fPrntTime(sDD, sTM));
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd", "처 방 : " + fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"));
-
- //병실
- //환자이름
- //환자번호
- var tpid = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")
- var drugno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint ;
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/pid" , tpid);
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno" , drugno);
-
- // 20100618_laboru_작은 라벨 외용, 수제 처방구분
- var drugflag = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugflag");
- var tdfname = "";
- /*if(drugflag == "L") {
- tdfname = "퇴원";
- } else {
- tdfname = "입원";
- }*///20110121 이선경 수정 : 병동작은 라벨과 동일하게 찍도록 함(칠곡병원 김은영 약사님 요청)
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/drugflag", tdfname);
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/drugflag", drugflag);
-
- //////////////////////////////////////////////////
- // 라벨 하단내용 //
- /////////////////////////////////////////////////
- //라벨내용
- 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일분
- var tunit = "1일 "+tims+"회 "+qty+qtyunit+"씩 "+dayno+"일분" + "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/abbrnm");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", tunit);
-
- } else {
- //1일 X회 Xml씩 X일분
- var tunit = "1일 "+tims+"회 "+qty+qtyunit+"씩 "+dayno+"일분" + "\n" + mthd1 + " " + mthd2 + " " + mthd3;
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", tunit);
-
- }
-
- //용법
- //약품코드 + 총용량
- //약품코드 + 총용량 + 약품명
- var prcpnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
-
- // 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;*/
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd" , val);
-
-
- //보관방법
- 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")+" >","");
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd", "< "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd")+" >" );
- }
- } else {
-
- }
-
- }
-
- if(getNodesetCount("/root/main/lbllist/lbllist") > 0) {
- // 20100427_laboru_물약라벨 rex 출력
- makeReportPreview(0,0,10, 10, "");
- fPrintRexbar("RFADT62302");
- }
- model.refresh();
- }
- /*
- * 산제처방을 용법코드별로 라벨출력
- */
- function fPowderlLBLPrint() {
-
- // 라벨내용 copy
- model.makeNode("/root/main/lbllist2");
- model.copyNode("/root/main/lbllist2", "/root/main/lbllist");
-
- 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;}
- }
-
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
- if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
-
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/fprnttime", "출 력 : " + fPrntTime(sDD, sTM));
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd", "처 방 : " + fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"));
-
- var patnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm")
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm", patnm.substr(0,6));
- //환자번호
- var tpid = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+")" ;
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/pid" , tpid);
-
- var sDrugKindcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var sMixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
- if(sDrugKindcd == "[내복약]"){
- fInPwdDrugLBL();
- }
- }
-
- if(vlblcnt && (!mlblcnt1) && (ordflag.length > 0)) {
- fPrntLblCnt1New();
- ordflag = "";
- vcnt = 0;
- }
- mlblcnt1= false;
-
- if(getNodesetCount("/root/main/lbllist/lbllist") > 0) {
- // 20100429_laboru_병동 작은라벨 산제용법별
- makeReportPreview(0,0,10, 10, "");
- fPrintRexbar("RFADT62302");
- }
- model.refresh();
- }
- /**
- * 산제 용법코드별 라벨상세(용법코드별 분류)
- */
- function fInPwdDrugLBL() {
-
- var sMthdcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
- var qty = "";
- var dayqty = "";
- var qtyunit = "";
- var tims = "";
- var dayno = "";
- var cnt = 0;
- var tprcpnm = "";
- var tprcpcd = ""
- var tlblcnts2 = "";
- var chgMth = false; // 2010.02.17 pymi
-
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- 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");
- var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- var prcpcd= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd");
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/lblcnts2");
- model.makeValue("/root/main/lbllist/lbllist["+j+"]/inusedrugflag", "Y");
- //model.setValue("/root/main/lbllist/lbllist["+j+"]/prcpnm", prcpnm.substr(0,6));
- //prcpnm = prcpnm.substr(0,7);
-
- if((sMthdcd1 == sMthdcd2)){
- if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
-
- if(cnt == 0) {
- tprcpnm = prcpnm;
- tprcpcd = prcpcd;
- tlblcnts2 = lblcnts2;
- } else {
- tprcpnm += "\n" + prcpnm;
- tprcpcd += "\n" + prcpcd;
- tlblcnts2 += "\n" + lblcnts2;
- }
-
- if(cnt == 0) {
- unit = dayqty + " "+tims+ " "+dayno;
- } else {
- unit += "\n" + dayqty + " "+tims+ " "+dayno;
- }
-
-
- // 20100421_laboru_rex 중복 출력 막기 위해
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- model.removeNode("/root/main/lbllist2/lbllist["+j+"]");
- j--;
- }
-
- cnt++;
- } else {
- // 용법바뀔때 2010.02.17 pymi
- chgMth = true;
- // (e)
- 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;
- }
- }
-
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd", tprcpcd);
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm", tprcpnm);
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/unit", unit);
-
- if(ordflag.length > 0) {
- model.makeValue("/root/main/lbllist2/lbllist["+iPoint+"]/lblcnts2", tlblcnts2);
- }
-
- //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 != ""){
- //sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
- model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd", "<"+sKeepmthd+">" );
- }
- if(sExpnnm != ""){
- //sSndMsg += astfPrintOut(135, 180, 3, "<"+sExpnnm+">","");
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/expnnm", "<"+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")+"일분","");
- var tmth = "1일 "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"회 " +model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"일분";
-
- //sSndMsg += 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 = "";
- if(sMthd1 != "") sTemp += sMthd1 + " ";
- if(sMthd2 != "") sTemp += sMthd2 + " ";
- if(sMthd3 != "") sTemp += sMthd3 + " ";
- if(sMthd4 != "") sTemp += sMthd4;
-
- tmth += "\n" + sTemp;
- model.makeValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts" , tmth);
-
-
- // 용법바뀔때 2010.02.17 pymi
- if(ordflag.length > 0) {
- cnt++; //라벨내용찍기전 한줄 띄우기
- if(cnt >= 4) sSndMsg += astfEndFormat(0);
-
- } else {
- sSndMsg += astfEndFormat(0);
- }
-
- vcnt = cnt;
- }
- /*
- * 20100427_laboru_작은라벨 내복약 처방 출력.
- */
- function fPrntLblCnt1New() {
-
- var tPoint = 1;
- var reprint = "";
-
- for(var t = 1 ; t <= getNodesetCount("/root/main/lbllist2/lbllist") ; t++) {
-
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
-
- if(model.getValue("/root/main/lbllist2/lbllist["+t+"]/pid") =="" ) {
- return;
- }
- if ( model.getValue("/root/main/lbllist2/lbllist["+t+"]/lblprnttims")>0 ){
- reprint ="(재)";
- }
- var mthdcd1 = model.getValue("/root/main/lbllist2/lbllist["+t+"]/mthdcd");
-
-
- model.makeValue("/root/main/lbllist2/lbllist["+t+"]/fprnttime", "출 력 : " + fPrntTime(sDD, sTM));
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/prcpdd", "처 방 : " + fDateFormat(model.getValue("/root/main/lbllist2/lbllist["+t+"]/prcpdd"), "MD"));
- var tpid = model.getValue("/root/main/lbllist2/lbllist["+t+"]/pid")+" ("+model.getValue("/root/main/lbllist2/lbllist["+t+"]/drugno")+reprint+")" ;
- model.setValue("/root/main/lbllist2/lbllist["+t+"]/pid" , tpid);
- for(var y = tPoint ; y <= getNodesetCount("/root/main/lbllist/lbllist") ; y++) {
- var mthdcd2 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthdcd");
-
- if(!fChkIndependDrug(y)) {
- if((mthdcd1 == mthdcd2)){
- if(y == getNodesetCount("/root/main/lbllist/lbllist")) {
- model.makeNode("root/main/lbllist/lbllist[" + (y+1) + "]");
-
- model.copyNode("root/main/lbllist/lbllist[" + (y+1) + "]", "root/main/lbllist2/lbllist[" + t + "]");
-
- model.makeValue("/root/main/lbllist/lbllist["+ (y+1) +"]/samedrugflag", "Y");
-
- var tmth = "";
- if( model.getValue("/root/main/lbllist/lbllist["+(y+1)+"]/lblgrup") == "DS"){
- var tmth = "1일 "+model.getValue("/root/main/lbllist/lbllist["+(y+1)+"]/prcptims")+"회 "+qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+(y+1)+"]/prcpdayno")+"일분";
- } else {
- var tmth = "1일 "+model.getValue("/root/main/lbllist/lbllist["+(y+1)+"]/prcptims")+"회 " +model.getValue("/root/main/lbllist/lbllist["+(y+1)+"]/prcpdayno")+"일분";
- }
-
- // 용법 생성
- var sMthd1 = model.getValue("/root/main/lbllist/lbllist["+(y+1)+"]/mthdcnts1");
- var sMthd2 = model.getValue("/root/main/lbllist/lbllist["+(y+1)+"]/mthdcnts2");
- var sMthd3 = model.getValue("/root/main/lbllist/lbllist["+(y+1)+"]/mthdcnts3");
- var sMthd4 = model.getValue("/root/main/lbllist/lbllist["+(y+1)+"]/mthdcnts4");
- var sTemp = "";
-
- if(sMthd1 != "") sTemp += sMthd1 + " ";
- if(sMthd2 != "") sTemp += sMthd2 + " ";
- if(sMthd3 != "") sTemp += sMthd3 + " ";
- if(sMthd4 != "") sTemp += sMthd4;
-
- tmth += "\n" + sTemp;
- model.makeValue("/root/main/lbllist/lbllist["+(y+1)+"]/mthdcnts" , tmth);
-
- break;
- }
- } else {
- tPoint = y+1;
-
- // 기존 라벨 정보 shift
- var tTotalCnt = getNodesetCount("/root/main/lbllist/lbllist");
- model.makeValue("/root/main/lbllist/lbllist["+(parseInt(tTotalCnt)+1)+"]", "Y");
-
- for(var x = tTotalCnt ; x >= y ; x--) {
- model.copyNode("/root/main/lbllist/lbllist[" + (parseInt(x) + 1) + "]", "/root/main/lbllist/lbllist[" + x + "]" );
- }
-
- model.copyNode("root/main/lbllist/lbllist[" + y + "]", "root/main/lbllist2/lbllist[" + t + "]");
- model.makeValue("/root/main/lbllist/lbllist["+ y +"]/samedrugflag", "Y");
-
- var tmth = "";
- if( model.getValue("/root/main/lbllist/lbllist["+y+"]/lblgrup") == "DS"){
- var tmth = "1일 "+model.getValue("/root/main/lbllist/lbllist["+y+"]/prcptims")+"회 "+qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+y+"]/prcpdayno")+"일분";
- } else {
- var tmth = "1일 "+model.getValue("/root/main/lbllist/lbllist["+y+"]/prcptims")+"회 " +model.getValue("/root/main/lbllist/lbllist["+y+"]/prcpdayno")+"일분";
- }
-
- //sSndMsg += fMthdnm(iPoint); // 용법 생성
- var sMthd1 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthdcnts1");
- var sMthd2 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthdcnts2");
- var sMthd3 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthdcnts3");
- var sMthd4 = model.getValue("/root/main/lbllist/lbllist["+y+"]/mthdcnts4");
- var sTemp = "";
-
- if(sMthd1 != "") sTemp += sMthd1 + " ";
- if(sMthd2 != "") sTemp += sMthd2 + " ";
- if(sMthd3 != "") sTemp += sMthd3 + " ";
- if(sMthd4 != "") sTemp += sMthd4;
-
- tmth += "\n" + sTemp;
- model.makeValue("/root/main/lbllist/lbllist["+y+"]/mthdcnts" , tmth);
-
- break;
- }
- }
- }
- }
- }
- function fChkIpwdDrug() {
- }
- /**
- * 20101224 이선경 추가
- * 외래 큰라벨 출력 양식
- */
- function fBigLBLPrint_Out() {
- /*
- 라벨 Sorting 로직
- //mgt에서 vo로 리턴
- 대분류
- - 내복약, 외용약, 주사, 항암제, TPN, 마약,
- 중분류
- - 방법코드
- 소분류
- - 내복약,외용약(방법코드), 주사,마약,항암제(mix)
-
-
- web js 출력로직
- 1 약종류(내복약/주사약/외용약)
- 1.1 방법코드
- 1.2 처방수량
- */
-
- var prcpnum = "";
- var prcpCnt = 14; // 20101030_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
-
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/lbllist/lbllist["+iPoint+"]");
- //바코드(변환)
- // 20101030_laboru_경북대병원_atc drugkind 구분자에 의한 바코드 출력 형식
- // t : "ATC" , p : 산제 바코드, e : blank
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "t" ) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode2", "ATC");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode", "");
- } else if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "p") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode"));
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode", "");
- }
-
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- var mthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
-
- if (mthdcd == "ZZZ" || mthdcd == "A10PQ") { //기타용법이거나 '필요시 복용하십시오' 용법인 경우도 단독라벨출력
- sumcls = mthdcd;
- }
-
- //복용기간 계산시 수납일자를 기준으로 하고 출력(퇴원은 적용일자로)
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/rcptdd" , model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"));
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind");
- if(atc_drugkind != "p" && fChkSumcls(iPoint)){
- //단독라벨출력
- fIndependPrint_Out();
- } else {
- //일반라벨출력
- fGnrlPrint_Out();
- }
- }
-
- if(getNodesetCount("/root/main/prnt/lbllist") > 0) {
- makeReportPreview(0,0,10, 10, "");
- //model.makeNode("/root/main/barcdprntsetup/prntsetupinfo");
- //model.copyNode("/root/main/barcdprntsetup/prntsetupinfo","/root/init/barcdprntsetup/prntsetupinfo");
- fPrintRexbar("RFADT61300");
- //alert("enD");
- }
- }
- /**
- * 20101224 이선경 추가
- * 외래 큰라벨 출력 양식(단독)
- */
- function fIndependPrint_Out() {
-
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var qtyunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqtyunit");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); //처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
- var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //약품마스터의 수량단위
- if (drugkindnm == "[주사약]"){
- //용법2
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts" , val);
- } else if (drugkindnm == "[내복약]"){
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX"){ //20091110 이선경 수정 : 라벨그룹이 마약(경구), 수제, ptp, 기타약일경우 약품마스터의 수량단위를 출력
- var tmpqty = Math.round(qty * 10) / 10;
- if(packunit == "T" || packunit == "C") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"정씩 "+(dayno*mthddayno)+"일분");
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(tmpqty)+ packunit +"씩 "+(dayno*mthddayno)+"일분");
-
- }
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"포[정]씩 "+(dayno*mthddayno)+"일분");
- }
-
- var mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", mth);
- }
-
- // 2010.03.18 pymi
- if(!fChkSumcls(iPoint) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty"))
- +" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpcd", val);
- }
- // (e)
- iPageCntO++;
- }
-
- /**
- * 20101224 이선경 추가
- * 외래 큰라벨 출력 양식(일반)
- */
- function fGnrlPrint_Out() {
- var cnt = 0;
- var ordCnt = 0;
-
- var tmppc = "";
- var sndprcpcnt = 1;
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");//처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
-
- //약코드 출력
- var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var dayno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");
- var mthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1");
- var mthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2");
- var mthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3");
- var mthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
-
-
- if( drugkindnm != "[내복약]") {
- if (drugkindnm == "[주사약]"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
-
- val += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts" , val);
- }
-
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
- var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+j+"]/atc_drugkind");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !(fChkSumcls(j) && atc_drugkind != "p") ){
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
- // 2010.03.18 pymi
- if(!fChkSumcls(j) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, tmppc);
- sndprcpcnt++;
- }
-
- cnt++;
- iPoint = j ;
- } else {
- iPageCntO++;
- iPoint = j - 1;
- break;
- }
-
-
- if(cnt == 12){ // 20101030_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- iPageCntO++;
- break;
- }
- }
-
- sndprcpcnt = 1;
-
- } else if (drugkindnm == "[내복약]"){
- var lbltims =0;
- lbl_tims = mthd2.split(",");
- if ( mthdcd == "ZZZ" ){
- lbltims = tims;
- } else if ( mthd3.indexOf("취침") > -1 ) {
- lbltims = lbl_tims.length +1;
- } else if(mthd2.indexOf("마다") > -1){
- lbltims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- } else {
- lbltims = lbl_tims.length;
- }
- tims = lbltims;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/samedrugflag", "Y");
- if(lbltims == 1) {
- if(mthd2.indexOf("마다") == -1) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+dayno+"일분");
-
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+ "회 1포씩 "+dayno+"일분");
-
- }
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+lbltims+ "회 1포씩 "+dayno+"일분");
- }
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3") + "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
-
-
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
- var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+j+"]/atc_drugkind");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !(fChkSumcls(j) && atc_drugkind != "p")){
-
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2");
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
-
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
- //alert(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims" + " " + prcpqty));
- if(lblcnts2.length > 0) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2") + "\n" + lblcnts2);
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2flag", "Y");
- }
-
- if(sndprcpcnt > 12) {
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp6", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp12", "");
- }
- var val = prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, val);
- sndprcpcnt++;
- iPoint = j;
-
- } else {
- iPageCntO++;
- iPoint = j - 1;
- break;
- }
- }
- }
- }
- /**
- * 20101224 이선경 추가
- * 경북대병원 외래 큰라벨 출력 양식
- */
- function fBigLBLPrint_knu(type) {
- /*
- 라벨 Sorting 로직
-
- < 정제 >
- 1. 단독조제는 따로 한장으로
- 2. 용법코드 5자리인 것중 5번째 자리 값(식후 10분, 식전 10분 등..)이 같은 것끼리 한장으로
- 3. 그외 나머지는 용법코드 같은 같은 것끼리 한장으로
- < 산제 >
- 1.용법코드 전체가 같은 것끼리 한장으로
-
- */
-
- var prcpnum = "";
- var prcpCnt = 14; // 20101030_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- var sDD = getCurrentDate();
- var sTM = getCurrentTime();
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
-
- //alert(model.getValue("/root/main/lbllist/lbllist["+ iPoint+"]/lblprntyn"));
- // 20110519_laboru_라벨출력여부에 따라
- var lblprntyn = model.getValue("/root/main/lbllist/lbllist["+ iPoint+"]/lblprntyn");
- if(lblprntyn == "N") {
- model.removeNodeset("/root/main/lbllist/lbllist["+ iPoint +"]");
- } else {
-
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/lbllist/lbllist["+iPoint+"]");
-
- if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
- model.setValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/drugno", model.getValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/drugno") + "(재)");
- }
-
- //바코드(변환)
- // 20101030_laboru_경북대병원_atc drugkind 구분자에 의한 바코드 출력 형식
- // t : "ATC" , p : 산제 바코드, e : blank
- if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "t" ) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode2", "ATC");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode", "");
- } else if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "p") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode"));
- } else {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/barcode", "");
- }
-
- // 20110415_laboru_경북대병원
- if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm").length > 3 ){
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/patnmlength", "Y");
- }
-
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- var mthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
-
- if (mthdcd == "ZZZ" || mthdcd == "A10PQ") { //기타용법이거나 '필요시 복용하십시오' 용법인 경우도 단독라벨출력
- sumcls = mthdcd;
- }
-
- //복용기간 계산시 수납일자를 기준으로 하고 출력
- rcptdd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/rcptdd");
-
-
- if(type == "S") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/fprnttime", "출 력 : " + fPrntTime(sDD, sTM));
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpdd", "처 방 : " + fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"));
- }
-
- //보관방법 고가 출력
- var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd");
- var sExpnyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/expnyn");
- var sExpnnm = "";
- if(sExpnyn == "Y") sExpnnm = "고가";
-
- if(sKeepmthd != ""){
- //sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/keepmthd", "<"+sKeepmthd+">" );
- }
- if(sExpnnm != ""){
- //sSndMsg += astfPrintOut(135, 180, 3, "<"+sExpnnm+">","");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/expnnm", "<"+sExpnnm+">" );
- }
-
- //병동에서 출력하는 큰라벨일 경우 수납일자대신 처방일자를 출력
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/rcptdd", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"));
-
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind");
- var sDrugKindcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var sMixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
- var sMthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd"); // 20120216
-
- //2013.08.22 김치국
- var sprcpnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm"); // 20120216
-
-
- if(type == "S" && sDrugKindcd == "[주사약]"){
- if(sMixno != "-"){
- fMixLBL_knu();
- } else if(fChkIndependInj(iPoint)){
- //alert(iPoint + "단독주사");
- fIndependPrint_knu(type);
- } else {
- //alert(iPoint + "복합주사");
- fInjDrugLBL_knu();
- }
- } else if(atc_drugkind != "p" && fChkSumcls(iPoint) && sDrugKindcd != "[주사약]" && sMthdcd != 'O10DE'){ // && sMthdcd != 'O10DE'
- // alert(" 단독라벨출력 fIndependPrint_knu(type) Call" + sprcpnm )
- //단독라벨출력
- fIndependPrint_knu(type);
- } else {
- // alert(" 일반라벨출력 fGnrlPrint_knu(type) Call" + sprcpnm )
- //일반라벨출력
- fGnrlPrint_knu(type);
- }
- }
- }
- // alert("row:3076 SPADT62305.js- 1 " + type );
- ///2015년 3월11일 김치국 주사큰라벨 Flag 만듬
- //if(type == "L" && sDrugKindcd == "[주사약]"){
- // type = "LJ"
- // }
-
- if(getNodesetCount("/root/main/prnt/lbllist") > 0) {
- if(type == "L1") { //본원큰라벨
- model.removeNodeset("/root/main/lbllist");
- model.makeNode("/root/main/lbllist");
- model.copyNode("/root/main/lbllist", "/root/main/prnt");
- makeReportPreview(0,0,10, 10, "");
- fPrintRexbar("RFADT62303");
- } else if(type == "L"){ //큰라벨
- makeReportPreview(0,0,10, 10, "");
- fPrintRexbar("RFADT61300");
- } else if(type == "S") { //작은라벨
- model.removeNodeset("/root/main/lbllist");
- model.makeNode("/root/main/lbllist");
- model.copyNode("/root/main/lbllist", "/root/main/prnt");
- makeReportPreview(0,0,10, 10, "");
- fPrintRexbar("RFADT62302");
- } else if(type == "LJ"){ //주사큰라벨 ///2015년 3월11일 김치국 주사큰라벨 Flag 만듬
- makeReportPreview(0,0,10, 10, "");
- fPrintRexbar("RFADT61305");
- }
- }
- }
- /**
- * 20101224 이선경 추가
- * 외래 큰라벨 출력 양식(단독)
- */
- function fIndependPrint_knu(type) {
-
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var qtyunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqtyunit");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno"); //처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
- var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //약품마스터의 수량단위
- //2013년 8월22일 김치국 ATC전송되지 않는 정제약 처리위해 추가 ~~~~ 여기에서
- var atcyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atcyn"); //ATC라벨 YN
- var prcpmixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno"); //분리번호
- // alert("atcyn : " + atcyn )
- // alert("prcpmixno : " + prcpmixno )
-
- var mth = ""; //용법내용설명
-
- if (drugkindnm == "[주사약]"){
- //용법2
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
-
- } else if (drugkindnm == "[외용약]"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts" , val);
- } else if (drugkindnm == "[내복약]"){
- // alert(" 내복약 1 Call " )
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX" || sumcls == "DG"){ //20091110 이선경 수정 : 라벨그룹이 마약(경구), 수제, ptp, 기타약일경우 약품마스터의 수량단위를 출력 20110511_laboru_pack 추가
- var tmpqty = Math.round(qty * 1000) / 1000; // 20110705_laboru_소수 둘째 자리 반올림서 넷째자리 반올림으로 변경
- if(packunit == "T" || packunit == "C") {
- // alert(" 내복약 2 Call " )
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", tims+"회 "+(dayno*mthddayno)+"일분");
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " +fChkFloat(qty)+"정씩 "+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
-
- } else if(type == "L") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"정씩 "+(dayno*mthddayno)+"일분");
- } else if(type == "S") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"정씩 "+(dayno*mthddayno)+"일분");
- }
- } else {
- // alert(" 내복약 3 Call " )
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", tims+"회 "+(dayno*mthddayno)+"일분");
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " +fChkFloat(tmpqty)+ packunit +"씩 "+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(tmpqty)+ packunit +"씩 "+(dayno*mthddayno)+"일분");
- } else if(type == "S") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(tmpqty)+ packunit +"씩 "+(dayno*mthddayno)+"일분");
- }
- }
- } else {
- // alert(" 내복약 4 Call " )
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", tims+"회 "+(dayno*mthddayno)+"일분");
- //2013년 8월22일 김치국 ATC전송되지 않는 정제약 처리위해 추가 ~~~~ 여기에서
- if( atcyn == "N" && prcpmixno <= 70 ) {
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " +fChkFloat(qty)+"알씩 "+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else {
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " +fChkFloat(qty)+"포[정]씩 "+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- // mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- // + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " +fChkFloat(qty)+"포[정]씩 "+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- // alert(" L 11 Call + " + mth)
- } else if(type == "L"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"포[정]씩 "+(dayno*mthddayno)+"일분");
- } else if(type == "S"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"포[정]씩 "+(dayno*mthddayno)+"일분");
- }
- }
- //20110201 이선경 수정 (경북대)
- //if(type == "L" || type == "S") {
- if(type == "S") {
- // alert(" 내복약 5 Call " )
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit") + "\n" + mth);
- } else {
- // alert(" 내복약 6 Call " )
- mth = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //alert(mth.length);
- var strchk = mth.substring(mth.length - 1, mth.length);
- //alert(strchk);
- if(strchk == "후" || strchk == "시" || strchk == "간" || strchk == "중" || strchk == "분") {
- mth += "에 ";
- } else {
- mth += " ";
- }
- // 20110415_laboru_경북대병원_추가
- if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX" || sumcls == "DG"){ //20091110 이선경 수정 : 라벨그룹이 마약(경구), 수제, ptp, 기타약일경우 약품마스터의 수량단위를 출력
- // alert(" 내복약 7 Call " )
- var tmpqty = Math.round(qty * 1000) / 1000; // 20110705_laboru_소수 둘째 자리 반올림서 넷째자리 반올림으로 변경
- if(packunit == "T" || packunit == "C") {
- // alert(" 내복약 8 Call " )
- mth += fChkFloat(qty)+"정씩 ";
- } else {
- // alert(" 내복약 9 Call " )
- // if(packunit == "cap" || packunit == "tab" ) {
- if( (packunit == "cap" || packunit == "tab" ) && atcyn == "N" ) {
- packunit = "알"; // 20110413_laboru_경북대병원_단위가 cap, tab 일때 알로 바꾸기
- }
- mth += fChkFloat(tmpqty)+ packunit +"씩 " ;
- // alert(" mth :l " + mth )
- }
- } else {
-
- //2013년 9월 5일 김치국 ATC전송되지 않는 정제약 처리위해 추가 ~~~~ 여기에서
- if (atcyn == "N") {
- if ( packunit == "cap" || packunit == "tab" ) {
- mth += fChkFloat(qty)+"알씩 ";
- } else {
- mth += fChkFloat(tmpqty)+ packunit +"씩 " ;
- }
- } else {
- mth += fChkFloat(qty)+"포[정]씩 ";
- }
- // alert(" 내복약 11 Call " + mth )
- }
- mth += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", mth);
- }
-
- // 2010.03.18 pymi
- if(!fChkSumcls(iPoint) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty"))
- +" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
- if(sumcls == "DT" && type != "S") { //20100707_ laboru_PTP 라벨 표시 //20110307 칠곡 김은영약사님 요청(작은라벨일때는 (PTP) 출력하지 않도록
- val += " (PTP)";
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpcd", val);
- }
- // (e)
- //alert("iPageCntO 단독: " + iPageCntO);
- iPageCntO++;
- }
-
- /**
- * 20101224 이선경 추가
- * 외래 큰라벨 출력 양식(일반)
- */
- function fGnrlPrint_knu(type) {
- var cnt = 0;
- var ordCnt = 0;
-
- var tmppc = "";
- var sndprcpcnt = 1;
- //라벨내용
- var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
- var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
- var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");//처방일수
- var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
-
- //약코드 출력
- var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
- var dayno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");
- var mthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1");
- var mthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2");
- var mthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3");
- var mthdcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
- var mthdcdfive1 = mthdcd1.substring(4,5);
- var mthdcdthree1 = 0;
- var cntpatt1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/cntpatt");
- var mthdcntsno = iPageCntO;
- var mthdcnts_end = ""; //용법내용설명
- var mthdcd5nm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd5nm"); //약품코드5번째자리명칭 (용법세분류)
- var prcpmixno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
- //alert(drugkindnm + " " + mthdcd + " " + mthdcdfive1);
- if( drugkindnm != "[내복약]" ) { // 20120216
- if (drugkindnm == "[주사약]"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
-
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var totdrugqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty");
- var mthdcnts4 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- var sDngryn = model.getValue("/root/main/lbllist/lbllist["+j+"]/dngryn"); //고위험주사 여부
- var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthdyn"); //냉장주사 여부
- var sAtcifsnglyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/atcifsnglyn"); //단독주사 여부
-
- if(sndprcpcnt > 6) {
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
-
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp6", "");
- /* model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp12", "");*/
- }
-
- // 20110608_laboru
- if(cnt == 0 && (sDngryn == "Y" || sKeepmthdyn == "Y" || sAtcifsnglyn == "Y") ){
- //주사가 뭉쳐서 나오다가 단독주사를 만날경우 단독주사 출력.
- var prcpcd = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") ;
-
- var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+j+"]/lblcnts1");
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts1", lblcnts1);
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpcd", prcpcd);
-
- // 20110608_laboru_주사단독일때
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/snglflag", "Y");
-
- iPageCntO++;
- iPoint = j;
-
- break;
- } else if(cnt != 0 && (sDngryn == "Y" || sKeepmthdyn == "Y" || sAtcifsnglyn == "Y")) {
-
- iPageCntO++;
- iPoint = j - 1;
- break;
-
- } else {
-
- var val = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") + " " + mthdcnts4;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, val);
-
- // 20110531_laboru_본원 큰라벨 크기로 주사 라벨 출력할 때 묶어서 출력
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/injsamedrugflag", "Y");
-
- sndprcpcnt++;
- iPoint = j;
- cnt++;
-
- }
- }
- } else if (drugkindnm == "[외용약]" && mthdcd1 == "O10DE"){
-
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- if(type == "L1") {
- val += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else {
- val += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts" , val);
-
- if(mthdcd1 != "O10DE") {
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var totdrugqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty");
- var mthdcnts4 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- var sDngryn = model.getValue("/root/main/lbllist/lbllist["+j+"]/dngryn"); //고위험주사 여부
- var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthdyn"); //냉장주사 여부
- var sAtcifsnglyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/atcifsnglyn"); //단독주사 여부
-
- if(sndprcpcnt > 6) {
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
-
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp6", "");
- /* model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp12", "");*/
- }
-
- // 20110608_laboru
- if(cnt == 0 && (sDngryn == "Y" || sKeepmthdyn == "Y" || sAtcifsnglyn == "Y") ){
- //주사가 뭉쳐서 나오다가 단독주사를 만날경우 단독주사 출력.
- var prcpcd = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") ;
-
- var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+j+"]/lblcnts1");
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts1", lblcnts1);
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpcd", prcpcd);
-
- // 20110608_laboru_주사단독일때
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/snglflag", "Y");
-
- iPageCntO++;
- iPoint = j;
-
- break;
- } else if(cnt != 0 && (sDngryn == "Y" || sKeepmthdyn == "Y" || sAtcifsnglyn == "Y")) {
-
- iPageCntO++;
- iPoint = j - 1;
- break;
-
- } else {
-
- var val = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") + " " + mthdcnts4;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, val);
-
- // 20110531_laboru_본원 큰라벨 크기로 주사 라벨 출력할 때 묶어서 출력
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/injsamedrugflag", "Y");
-
- sndprcpcnt++;
- iPoint = j;
- cnt++;
-
- }
- }
- } else {
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var mthdcdcheck = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
-
- if(mthdcdcheck == "O10DE") {
- var totdrugqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty");
- var mthdcnts4 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- var sDngryn = model.getValue("/root/main/lbllist/lbllist["+j+"]/dngryn"); //고위험주사 여부
- var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthdyn"); //냉장주사 여부
- var sAtcifsnglyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/atcifsnglyn"); //단독주사 여부
-
- if(sndprcpcnt > 12) {
-
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
-
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp6", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp12", "");
-
- }
-
- // 20110608_laboru
- /* if(cnt == 0 && (sDngryn == "Y" || sKeepmthdyn == "Y" || sAtcifsnglyn == "Y") ){
- //주사가 뭉쳐서 나오다가 단독주사를 만날경우 단독주사 출력.
- var prcpcd = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") ;
-
- var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+j+"]/lblcnts1");
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts1", lblcnts1);
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpcd", prcpcd);
-
- // 20110608_laboru_주사단독일때
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/snglflag", "Y");
-
- iPageCntO++;
- iPoint = j;
-
- break;
- } else if(cnt != 0 && (sDngryn == "Y" || sKeepmthdyn == "Y" || sAtcifsnglyn == "Y")) {
-
- iPageCntO++;
- iPoint = j - 1;
- break;
-
- } else {
- */
- var val = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"); //+ " " + mthdcnts4;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, val);
-
- // 20110531_laboru_본원 큰라벨 크기로 주사 라벨 출력할 때 묶어서 출력
- //model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/injsamedrugflag", "Y");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/samedrugflag", "Y");
- //alert(iPageCntO + " " + model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/samedrugflag"));
-
- sndprcpcnt++;
- iPoint = j;
- cnt++;
-
- //}
- }
- }
- iPageCntO++;
- }
- } else if (drugkindnm == "[외용약]" && mthdcd1 != "O10DE"){
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- if(type == "L1") {
- val += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else {
- val += "\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/mthdcnts" , val);
-
-
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var totdrugqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty");
- var mthdcnts4 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- var sDngryn = model.getValue("/root/main/lbllist/lbllist["+j+"]/dngryn"); //고위험주사 여부
- var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthdyn"); //냉장주사 여부
- var sAtcifsnglyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/atcifsnglyn"); //단독주사 여부
-
- if(sndprcpcnt > 6) {
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
-
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp6", "");
- /* model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp12", "");*/
- }
-
- // 20110608_laboru
- if(cnt == 0 && (sDngryn == "Y" || sKeepmthdyn == "Y" || sAtcifsnglyn == "Y") ){
- //주사가 뭉쳐서 나오다가 단독주사를 만날경우 단독주사 출력.
- var prcpcd = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") ;
-
- var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+j+"]/lblcnts1");
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts1", lblcnts1);
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpcd", prcpcd);
-
- // 20110608_laboru_주사단독일때
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/snglflag", "Y");
-
- iPageCntO++;
- iPoint = j;
-
- break;
- } else if(cnt != 0 && (sDngryn == "Y" || sKeepmthdyn == "Y" || sAtcifsnglyn == "Y")) {
-
- iPageCntO++;
- iPoint = j - 1;
- break;
-
- } else {
-
- var val = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") + " " + mthdcnts4;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, val);
-
- // 20110531_laboru_본원 큰라벨 크기로 주사 라벨 출력할 때 묶어서 출력
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/injsamedrugflag", "Y");
-
- sndprcpcnt++;
- iPoint = j;
- cnt++;
-
- }
- }
- }
-
-
-
-
- /* if(sDngryn == "Y" || sKeepmthdyn == "Y" || sAtcifsnglyn == "Y" ){
- // 20110608_laboru_주사단독일때
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/snglflag", "Y");
- } else {
- // 20110531_laboru_본원 큰라벨 크기로 주사 라벨 출력할 때 묶어서 출력
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/injsamedrugflag", "Y");
- }*/
-
- /* var sSumCls1 = model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/sumcls");
- var cnt = 0;
- var unit = "";
- var tprcpcd = "";
- var tprcpnm = "";
- var prePage = iPageCntO;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/samedrugflag", "Y");
-
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++) {
-
- //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");
- var prcpnm = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- var prcpcd = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd");
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty"));
-
- if(cnt != 0 && fChkIndependInj(j)){
- //주사가 뭉쳐서 나오다가 단독주사를 만날경우 단독주사는 출력하지 아니함.
- iPageCntO++;
- break;
- }
-
- if(cnt == 0) {
- tprcpcd = prcpcd;
- tprcpnm = val + " " + prcpnm;
- unit = fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
- } else {
- tprcpcd += "\n" + prcpcd;
- tprcpnm += "\n" + val + " " + prcpnm;
- unit += "\n" + fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
- }
-
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- j--
- }
-
- cnt++;
-
- if(cnt == 5 || fChkIndependInj(j)){
- j++;
- iPageCntO++;
- break;
- }
-
- }
-
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd" , tprcpcd );
- model.setValue("/root/main/prnt/lbllist["+prePage+"]/prcpnm" , tprcpnm );
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/unit" , unit );
- model.setValue("/root/main/prnt/lbllist["+prePage+"]/lblcnts2", "");
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/pageflag", "N");
- //iPoint = j-1;
- //보관방법 고가 출력
- var sKeepmthd = model.getValue("/root/main/prnt/lbllist["+prePage+"]/keepmthd");
- var sExpnyn = model.getValue("/root/main/prnt/lbllist["+prePage+"]/expnyn");
- var sExpnnm = "";
-
- if(sExpnyn == "Y") sExpnnm = "고가";
-
- if(sKeepmthd != ""){
- model.setValue("/root/main/prnt/lbllist["+prePage+"]/keepmthd", "<"+sKeepmthd+">" );
- }
- if(sExpnnm != ""){
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/expnnm", "<"+sExpnnm+">" );
- }
- */
- /* alert("dd"); // 20110531_laboru
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
- var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+j+"]/atc_drugkind");
- if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- && !(fChkSumcls(j) && atc_drugkind != "p") ){
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
- // 2010.03.18 pymi
- if(!fChkSumcls(j) && model.getValue("/root/send/prcpinfo/lbl5") == "Y") {
- var val = "";
- } else {
- // 20101027_laboru_경북대병원_라벨 출력물 처방코드 삭제
- var val = prcpqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, tmppc);
- sndprcpcnt++;
- }
-
- cnt++;
- iPoint = j ;
- } else {
- iPageCntO++;
- iPoint = j - 1;
- break;
- }
-
-
- if(cnt == 12){ // 20101030_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
- iPageCntO++;
- break;
- }
- }
-
- sndprcpcnt = 1;*/
-
- } else if (drugkindnm == "[내복약]" ){ // 20120216
-
- var lbltims =0;
- var unit = "";
- var mthdcnts = "";
- var mthdcnts1 = 0; //아침
- var mthdcnts2 = 0; //점심
- var mthdcnts3 = 0; //저녁
- var mthdcnts4 = 0; //취침전
- var mthdcnts5 = 0; //특수용법
- var mthdtims = 0; //용법횟수
- lbl_tims = mthd2.split(",");
- if ( mthdcd1 == "ZZZ" ){
- lbltims = tims;
- } else if ( mthd3.indexOf("취침") > -1 ) {
- lbltims = lbl_tims.length +1;
- } else if(mthd2.indexOf("마다") > -1){
- lbltims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- } else {
- lbltims = lbl_tims.length;
- }
- tims = lbltims;
-
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/samedrugflag", "Y");
- if(lbltims == 1) {
- if(mthd2.indexOf("마다") == -1) {
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdcdthree1+ "회 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + "에" + " 1포씩"; // 20110411_laboru_에 추가
- //+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdcdthree1+ "회 1포씩 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //if(mthdcnts_end != "") { mthdcnts_end += "에 ";}
- //mthdcnts_end +="\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdcdthree1+ "회 1포씩 "+dayno+"일분" + "\n";
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //if(mthdcnts_end != "") { mthdcnts_end += "에 ";}
- //mthdcnts_end += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- } else {
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdcdthree1+ "회 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + "에" + " 1포씩"; // 20110411_laboru_에 추가
- //+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdcdthree1+ "회 1포씩 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //if(mthdcnts_end != "") { mthdcnts_end += "에 ";}
- //mthdcnts_end +="\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdcdthree1+ "회 1포씩 "+dayno+"일분" + "\n";
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //if(mthdcnts_end != "") { mthdcnts_end += "에 ";}
- //mthdcnts_end += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- }
- } else {
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdcdthree1+ "회 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + "에" + " 1포씩"; // 20110411_laboru_에 추가
- //+ model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "L") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdcdthree1+ "회 1포씩 "+dayno+"일분");
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //if(mthdcnts_end != "") { mthdcnts_end += "에 ";}
- //mthdcnts_end +="\n" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdcdthree1+ "회 1포씩 "+dayno+"일분" + "\n";
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- //if(mthdcnts_end != "") { mthdcnts_end += "에 ";}
- //mthdcnts_end += model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- }
- }
- if(cntpatt1.substring(0,1) == "1" && mthdcnts1 == 0) {//아침
- mthdcnts1++;
- mthdtims++;
- }
- if(cntpatt1.substring(1,2) == "1" && mthdcnts2 == 0) {//점심
- mthdcnts2++;
- mthdtims++;
- }
- if(cntpatt1.substring(2,3) == "1" && mthdcnts3 == 0) {//저녁
- mthdcnts3++;
- mthdtims++;
- }
- if(cntpatt1.substring(3,4) == "1" && mthdcnts4 == 0) {//취침전
- mthdcnts4++;
- mthdtims++;
- }
- if(cntpatt1.substring(4,5) == "1") {//특수용법
- mthdcnts5++;
- }
- if(mthdtims == 0) {
- mthdtims = tims;
- }
-
- //alert(mthdcnts);
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
-
- var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
- var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
- var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
- var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
- var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
- //20101229 이선경 수정 : atc구분이 산제아닐때만 단독라벨 적용
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+j+"]/atc_drugkind");
- var mthdcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
- var mthdcdfive2 = mthdcd2.substring(4,5);
- var cntpatt2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntpatt");
- var prcpmixno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpmixno");
- //alert("cntpatt2 : " + cntpatt2);
- //alert(prcpmixno1 + " " + prcpmixno2 + " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"));
-
- //20110102 이선경 수정 : 라벨출력시 묶어주는 기준은 용법코드 5번째자리(식후30분후..)와 일수
- //if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- // && !(fChkSumcls(j) && atc_drugkind != "p")){
- if(atc_drugkind == "p") {
- if(dayno1 == dayno2 && (mthdcd1 == mthdcd2 || (mthdcdfive1 == "P" && (mthdcd2 == "A11D" || mthdcd2 == "A11DI") ) ) && prcpmixno1 == prcpmixno2) {
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2");
- var totdrugqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty");
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
-
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
- //alert(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims" + " " + prcpqty));
- if(lblcnts2.length > 0) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2") + "\n" + lblcnts2);
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2flag", "Y");
- }
-
- //용법코드의 아침, 점심, 저녁, 취침전 출력
- if(cntpatt2.substring(0,1) == "1" && mthdcnts1 == 0) {
- mthdcnts1++;
- mthdtims++;
- }
- if(cntpatt2.substring(1,2) == "1" && mthdcnts2 == 0) {
- mthdcnts2++;
- mthdtims++;
- }
- if(cntpatt2.substring(2,3) == "1" && mthdcnts3 == 0) {
- mthdcnts3++;
- mthdtims++;
- }
- if(cntpatt2.substring(3,4) == "1" && mthdcnts4 == 0) {
- mthdcnts4++;
- mthdtims++;
- }
- //용법코드의 최대횟수 출력함
- if(mthdtims == 0) { mthdtims = 1;}
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdtims+ "회 "+dayno2+"일분");
- } else if(type == "L"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdtims+ "회 1포씩 "+dayno2+"일분");
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdtims+ "회 1포씩 "+dayno+"일분" + "\n";
- }
- var val = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- if(type == "L1" || type == "L") {
-
- if(sndprcpcnt > 12) {
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp6", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp12", "");
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, val);
- } else if(type == "S") {
-
-
- if(sndprcpcnt > 4){
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- }
- if(sndprcpcnt == 1) {
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm", val);
- } else {
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm") + "\n" + val);
- }
- }
-
- sndprcpcnt++;
- iPoint = j;
- } else {
- iPageCntO++;
- iPoint = j - 1;
- break;
- }
- } else if((mthdcdfive1 == mthdcdfive2 && dayno1 == dayno2 && !(fChkSumcls(j) && atc_drugkind != "p") && prcpmixno1 == prcpmixno2)
- || (dayno1 == dayno2 && mthdcdfive1 == "P" && (mthdcd2 == "A11D" || mthdcd2 == "A11DI") && prcpmixno1 == prcpmixno2 ) ) {
- //20110102 이선경 수정 : 라벨출력시 묶어주는 기준은 용법코드 5번째자리(식후30분후..)와 일수
- //예외적으로 일수가 같고 식후30분과 취침전용법은 같이 묶어줌
- //20110221 이선경 수정 : 믹스번호 체크함.
- var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2");
- var totdrugqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty");
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
-
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
- //alert(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")+ " " + model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims" + " " + prcpqty));
- if(lblcnts2.length > 0) {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2") + "\n" + lblcnts2);
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/lblcnts2flag", "Y");
- }
-
- //용법코드의 아침, 점심, 저녁, 취침전 출력
- if(cntpatt2.substring(0,1) == "1" && mthdcnts1 == 0) {
- mthdcnts1++;
- mthdtims++;
- }
- if(cntpatt2.substring(1,2) == "1" && mthdcnts2 == 0) {
- mthdcnts2++;
- mthdtims++;
- }
- if(cntpatt2.substring(2,3) == "1" && mthdcnts3 == 0) {
- mthdcnts3++;
- mthdtims++;
- }
- if(cntpatt2.substring(3,4) == "1" && mthdcnts4 == 0) {
- mthdcnts4++;
- mthdtims++;
- }
- //용법코드의 최대횟수 출력함
- if(mthdtims == 0) { mthdtims = 1;}
- if(type == "L1") {
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthdtims+ "회 "+dayno2+"일분");
- } else if(type == "L"){
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/unit", mthddayno + "일 "+mthdtims+ "회 1포씩 "+dayno2+"일분");
- } else if(type == "S") {
- unit = mthddayno + "일 "+mthdtims+ "회 1포씩 "+dayno+"일분" + "\n";
- }
- var val = totdrugqty
- +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- if(type == "L1" || type == "L") {
-
- if(sndprcpcnt > 12) {
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/lblcnts2flag", "N");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp1", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp2", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp3", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp4", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp5", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp6", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp7", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp8", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp9", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp10", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp11", "");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCntO+ "]/sndprcp12", "");
- }
- model.makeValue("/root/main/prnt/lbllist["+iPageCntO+"]/sndprcp"+sndprcpcnt, val);
- } else if(type == "S") {
-
- if(sndprcpcnt > 4){
- var prePage = iPageCntO;
- iPageCntO++;
- sndprcpcnt = 1;
- model.makeNode("/root/main/prnt/lbllist[" +iPageCntO+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCntO+ "]", "/root/main/prnt/lbllist["+prePage+"]");
-
- }
- if(sndprcpcnt == 1) {
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm", val);
- } else {
- model.setValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm", model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpnm") + "\n" + val);
- }
- }
- sndprcpcnt++;
- iPoint = j;
-
- } else {
- iPageCntO++;
- iPoint = j - 1;
- break;
- }
- }
- /*
- 아침, 점심, 저녁, 취침전 찍지 않는 예외 용법
- 1. 횟수 패턴 5번째 자리값이 1인 경우
- 2. 용법코드 4번째 자리값이 E (시간마다) 인 경우
- 3. 용법코드 4번째 자리값이 D (의사지시대로) 인 경우
- 4. 용법코드 5번째 자리값이 Q (의사지시대로) 인 경우
- */
- if(mthdcnts5 > 0 || mthdcd1.substring(3,4) == "E" || (mthdcd1.substring(3,4) == "D" && mthdcnts4 < 1)|| mthdcd1.substring(4,5) == "Q"
- ) { // 20110411_laboru_경북대병원_mthdcnts3 가 취침전에 일때 || model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") == "취침전에"
- mthdcnts = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- } else {
- if(mthdcnts1 > 0) {
- mthdcnts = "아침 ";
- }
- if(mthdcnts2 > 0) {
- mthdcnts += "점심 ";
- }
- if(mthdcnts3 > 0) {
- mthdcnts += "저녁 ";
- }
-
- if(mthdcdfive1 == "P" ) {
- mthdcnts += "식후30분"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "I" ) {
- mthdcnts += "식후즉시"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "B" ) {
- mthdcnts += "식전10분"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "A" ) {
- mthdcnts += "식전30분"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "C" ) {
- mthdcnts += "식전1시간"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "D" ) {
- mthdcnts += "식전2시간"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "E" ) {
- mthdcnts += "공복"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "M" ) {
- mthdcnts += "식사도중"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "W" ) {
- mthdcnts += "식사와 함께"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "T" ) {
- mthdcnts += "식후2시간"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "F" ) {
- mthdcnts += "식후1시간"; // 20110412_laboru_
- }
-
- if(mthdcdfive1 == "H" ) {
- mthdcnts += "일어난 직후"; // 20120725_laboru_
- }
-
- if(mthdcdfive1 == "Q" ) {
- mthdcnts += "의사지시대로"; // 20120725_laboru_
- }
- if(mthdcnts_end == "취침전에") {
- //mthdcnts += mthdcd5nm;
- } else {
- //mthdcnts += mthdcnts_end;
- }
-
- if(mthdcnts4 > 0) {
- if(mthdcnts != "" ) {
- mthdcnts += "과 ";
- }
-
- if(type != "S") {
- mthdcnts += "취침전에 ";
- } else {
- mthdcnts += "취침전";
- }
-
- if(mthdcnts == "") {
- mthdcnts = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- }
- } else {
- if(type != "S") {
- mthdcnts += "에 "; // 20110411_laboru_에 삭제
- }
-
- }
- }
-
- if(type == "S") {
- for(var p = mthdcntsno ; p <= getNodesetCount("/root/main/prnt/lbllist") ; p++){
- model.makeValue("/root/main/prnt/lbllist["+p+"]/mthdcnts", unit + mthdcnts);
- }
- } else {
- for(var p = mthdcntsno ; p <= getNodesetCount("/root/main/prnt/lbllist") ; p++){
- if(mthdcnts == "") {
- model.makeValue("/root/main/prnt/lbllist[" +p+ "]/drugmthddesc", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- +model.getValue("/root/main/lbllist/lbllist["+p+"]/mthdcnts3") + model.getValue("/root/main/lbllist/lbllist["+p+"]/mthdcnts4"));
- } else {
- model.makeValue("/root/main/prnt/lbllist["+p+"]/mthdcnts", unit + mthdcnts + " 1포씩 " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- }
- }
- }
- }
- }
- /**
- * 병동작은라벨 mix 라벨 (경북대병원)
- */
- function fMixLBL_knu() {
- var sMixno1 = model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/prcpmixno");
- var cnt = 0;
- var unit = "";
- var tprcpcd = "";
- var tprcpnm = "";
- var prePage = iPageCntO;
-
- 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");
- var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- var prcpcd = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd");
-
- //prcpnm = prcpnm.substr(0,7);
-
- if(sMixno1 == sMixno2){
-
- if(cnt == 0) {
- tprcpcd = prcpcd;
- tprcpnm = fChkFloat(dayqty);
- tprcpnm += " " + prcpnm;
- unit = fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
-
- } else {
- tprcpcd += "\n" + prcpcd;
- tprcpnm += "\n" + fChkFloat(dayqty) + " " + prcpnm;
- unit += "\n" + fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
- }
-
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- j--
- }
-
- cnt++;
- } else {
- iPageCntO++;
- j--;
- break;
- }
-
- if(cnt == 5){
- iPageCntO++;
- break;
- }
- }
- //alert(model.getValue("/root/main/prnt/lbllist["+prePage+"]/prcpnm" ));
-
- //iPoint = j;
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd" , tprcpcd );
- model.setValue("/root/main/prnt/lbllist["+prePage+"]/prcpnm" , tprcpnm );
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/unit" , unit );
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/mthdcnts", "N6");
- model.setValue("/root/main/prnt/lbllist["+prePage+"]/lblcnts2", "");
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/pageflag", "N");
- }
- /**
- * 병동작은라벨 주사약 라벨(경북대병원)
- */
- function fInjDrugLBL_knu() {
- var sSumCls1 = model.getValue("/root/main/prnt/lbllist["+iPageCntO+"]/sumcls");
- var cnt = 0;
- var unit = "";
- var tprcpcd = "";
- var tprcpnm = "";
- var prePage = iPageCntO;
- for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
- if(cnt != 0 && fChkIndependInj(j)){
- //주사가 뭉쳐서 나오다가 단독주사를 만날경우 단독주사는 출력하지 아니함.
- iPageCntO++;
- 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");
- var prcpnm = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
- var prcpcd = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd");
- var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty"));
- //alert(val+ "\n" + prcpnm);
- //prcpnm = prcpnm.substr(0,7);
-
- if(cnt == 0) {
- tprcpcd = prcpcd;
- tprcpnm = val + " " + prcpnm;
- unit = fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
- } else {
- tprcpcd += "\n" + prcpcd;
- tprcpnm += "\n" + val + " " + prcpnm;
- unit += "\n" + fChkFloat(dayqty)+qtyunit+ " "+tims+ " "+dayno;
- }
-
- if(cnt != 0) {
- model.removeNode("/root/main/lbllist/lbllist["+j+"]");
- j--
- }
- cnt++;
-
- if(cnt == 5 || fChkIndependInj(j)){
- j++;
- iPageCntO++;
- break;
- }
- }
-
- // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
- //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd" , tprcpcd );
- model.setValue("/root/main/prnt/lbllist["+prePage+"]/prcpnm" , tprcpnm );
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/unit" , unit );
- model.setValue("/root/main/prnt/lbllist["+prePage+"]/lblcnts2", "");
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/pageflag", "N");
-
- if(!fChkIndependInj(iPoint)) {
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/mthdcnts", "N6");
- } else {
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/inusedrugflag", "Y");
- }
-
- //iPoint = j-1;
- //보관방법 고가 출력
- var sKeepmthd = model.getValue("/root/main/prnt/lbllist["+prePage+"]/keepmthd");
- var sExpnyn = model.getValue("/root/main/prnt/lbllist["+prePage+"]/expnyn");
- var sExpnnm = "";
- if(sExpnyn == "Y") sExpnnm = "고가";
- if(sKeepmthd != ""){
- model.setValue("/root/main/prnt/lbllist["+prePage+"]/keepmthd", "<"+sKeepmthd+">" );
- }
- if(sExpnnm != ""){
- model.makeValue("/root/main/prnt/lbllist["+prePage+"]/expnnm", "<"+sExpnnm+">" );
- }
-
- }
|