123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599 |
- /**
- * 파 일 명 : SPADT61400.js
- * 설 명 : (팝업)원내봉투출력 Javascriot
- * 설 계 자 : 공두경 * 작 성 자 : 공두경
- * 수정이력 : 2007.09.20 / 최초작성 / 공두경
- */
- var sSndMsg = ""; //라벨출력내용
- var iPoint = 0; //라벨출력row
- var iCnt = 0; //라벨출력매수
- var iPageCnt = 1; //페이지번호 조회
- /**
- * 초기화
- */
- function fInit() {
- var sParam = model.getAttribute("params");
- model.makeValue("/root/send/prcpinfo/drugdd", astfMatrixData(sParam, 1, 0));
- model.makeValue("/root/send/prcpinfo/drugno", astfMatrixData(sParam, 1, 1));
- model.makeValue("/root/send/prcpinfo/ioflag", astfMatrixData(sParam, 1, 2));
- model.makeValue("/root/send/prcpinfo/lblflag", astfMatrixData(sParam, 1, 3));
- model.makeValue("/root/send/prcpinfo/liquidflag", astfMatrixData(sParam, 1, 4));
- model.makeValue("/root/send/prcpinfo/reprintyn", astfMatrixData(sParam, 1, 5));
- model.makeValue("/root/send/prcpinfo/autoinprntyn", astfMatrixData(sParam, 1, 6));
- model.makeValue("/root/send/prcpinfo/atclblyn", astfMatrixData(sParam, 1, 8));
- model.makeValue("/root/send/prcpinfo/prntflag", "O");
- model.refresh();
-
- submit("TRADT61301");
-
- //fLBLPrint_knu("B");
- fLBLPrint();
-
- model.refresh();
- window.close();
- }
- /**
- *
- */
- function fStopTimer() {
- window.clearinterval(gTimer);
- }
- function fSleep(numberMillis) {
- var now = new Date();
- var exitTime = now.getTime() + numberMillis;
- while (true) {
- now = new Date();
- if (now.getTime() > exitTime)
- return;
- }
- }
- /**
- * 라벨출력
- */
- function fLBLPrint() {
- /*
- 라벨 Sorting 로직
- //mgt에서 vo로 리턴
- 대분류
- - 내복약, 외용약, 주사, 항암제, TPN, 마약,
- 중분류
- - 방법코드
- 소분류
- - 내복약,외용약(방법코드), 주사,마약,항암제(mix)
-
-
- web js 출력로직
- 1 약종류(내복약/주사약/외용약)
- 1.1 방법코드
- 1.2 처방수량
- */
- PrnKind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
- PrnMarginLeft = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
- PrnMarginTop = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
- var commkind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
- for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
-
- // 20110519_laboru_라벨출력여부에 따라
- var lblprntyn = model.getValue("/root/main/lbllist/lbllist["+ iPoint+"]/lblprntyn");
- if(lblprntyn == "N") {
- model.removeNodeset("/root/main/lbllist/lbllist["+ iPoint +"]");
- } else {
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
- var mthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
- var prcpmixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno"); // 20110414_laboru_경북대병원_분리번호가 단독 여부보다 먼저 체크 되어야 함.
- //var prcpmixno2 = model.getValue("/root/main/lbllist/lbllist["+parseInt(iPoint) + parseInt(1) +"]/prcpmixno"); // 20110414_laboru_경북대병원_분리번호가 단독 여부보다 먼저 체크 되어야 함.
- var atc_kind = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind");
-
- if (mthdcd == "ZZZ" || mthdcd == "A10PQ") { //기타용법이거나 '필요시 복용하십시오' 용법인 경우도 단독라벨출력
- sumcls = mthdcd;
- }
-
- //alert(fChkSumcls(iPoint));
- if( fChkSumcls(iPoint) ){
- //단독라벨출력
- fIndependPrint();
- } else {
- //일반라벨출력
- fGnrlPrint();
- }
- }
- }
- iPageCnt = 0;
- makeReportPreview(0,0,10, 10, "");
- model.makeNode("/root/main/barcdprntsetup/prntsetupinfo");
- model.copyNode("/root/main/barcdprntsetup/prntsetupinfo","/root/init/barcdprntsetup/prntsetupinfo");
- fPrintRexbar("RFADT61400");
- model.refresh();
- }
- /**
- *
- */
- function fIndependPrint() {
- model.makeNode("/root/main/prnt/lbllist[" +iPageCnt+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCnt+ "]", "/root/main/lbllist/lbllist["+iPoint+"]");
-
- 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"); //약품마스터의 수량단위
- var modprcpqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/modprcpqty"); // 20110425_laboru_수정된 1일 수량
- if(mthddayno == "" || mthddayno == 0) { mthddayno = 1;}
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", tims+"회 "+(dayno*mthddayno)+"일분");
- if (drugkindnm == "[주사약]"){
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "주사");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else if (drugkindnm == "[외용약]"){
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "외용");
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", val);
-
- } else if (drugkindnm == "[내복약]"){
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/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") ;
- var strchk = val.substring(val.length - 1, val.length);
- //alert(strchk);
- if(strchk == "후" || strchk == "시" || strchk == "간" || strchk == "중" || strchk == "분") {
- val += "에 ";
- } else {
- val += " ";
- }
- var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
-
- if(modprcpqty != qty) {
- qty = modprcpqty; // 20110425_laboru_경북대병원_원처방 수량과 수정된 처방 수량이 다르면 수정된 것으로 출력함
- }
- if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX" || sumcls == "DG" ){ //20091110 이선경 수정 : 라벨그룹이 마약(경구), 수제, ptp, 기타약일경우 약품마스터의 수량단위를 출력 20110512_laboru_pack 추가
- var tmpqty = Math.round(qty * 10) / 10;
- if(packunit == "T" || packunit == "C") {
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", val + " " +fChkFloat(qty)+"정씩 " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- } else {
- if(packunit == "cap" || packunit == "tab") {
- packunit = "알"; // 20110413_laboru_경북대병원_단위가 cap, tab 일때 알로 바꾸기
- }
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", val + " " +fChkFloat(tmpqty)+ packunit +"씩 " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- }
- } else {
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", val + " " +fChkFloat(qty)+"포[정]씩 " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- }
-
- }
-
- var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/lblcnts1", lblcnts1);
-
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
- var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm") + " "
- + qty + " " +
- + tims + " " +
- + dayno + " " +
- + Math.round(qty*tims*dayno*1000)/1000 ;
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drug1", val);
- iPageCnt++;
- }
- /**
- *
- */
- function fGnrlPrint() {
- model.makeNode("/root/main/prnt/lbllist[" +iPageCnt+ "]");
- model.copyNode("/root/main/prnt/lbllist[" +iPageCnt+ "]", "/root/main/lbllist/lbllist["+iPoint+"]");
-
- 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"); //약품마스터의 수량단위
- 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 = iPageCnt;
- var mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- var mthdcd5nm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd5nm"); //약품코드5번째자리명칭 (용법세분류)
- var prcpmixno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
-
- if (drugkindnm == "[주사약]"){
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "주사");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
-
- if(mthddayno == "" || mthddayno == 0) { mthddayno = 1;}
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", tims+"회 "+(dayno*mthddayno)+"일분");
- } else if (drugkindnm == "[외용약]"){
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "외용");
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthddesc", model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"));
- if(mthddayno == "" || mthddayno == 0) { mthddayno = 1;}
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", tims+"회 "+(dayno*mthddayno)+"일분");
-
- } else if (drugkindnm == "[내복약]"){
- model.setValue("/root/main/prnt/lbllist["+iPageCnt+"]/drugkindnm", "내복");
- var lbltims =0;
- 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;
- if(mthddayno == "" || mthddayno == 0) { mthddayno = 1;};
- //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(lbltims == 1) {
- if(mthd2.indexOf("마다") == -1) {
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", lbltims+ "회 " +(dayno * mthddayno)+"일분");
-
- } else {
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", tims+ "회 " +(dayno*mthddayno)+"일분");
-
- }
- } else {
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", lbltims+ "회 " +(dayno*mthddayno)+"일분");
-
- }
-
- mthdcnts_end = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- 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;
- }
- var drugcnt = 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");
- var mthdcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
- var atc_drugkind = model.getValue("/root/main/lbllist/lbllist["+j+"]/atc_drugkind");
- var mthdcdfive2 = mthdcd2.substring(4,5);
- var prcptims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
- var cntpatt2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntpatt");
- var qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty"); // 20110413_laboru_경북대병원 1 회수량
- var prcpmixno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpmixno");
-
-
- //if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
- // && !fChkSumcls(j)){
- if( atc_drugkind == "p") {
- if(dayno1 == dayno2 && (mthdcd1 == mthdcd2 || (mthdcdfive1 == "P" && (mthdcd2 == "A11D" || mthdcd2 == "A11DI") ) ) && prcpmixno1 == prcpmixno2) {
- //20110102 이선경 수정 : 라벨출력시 묶어주는 기준은 용법코드 5번째자리(식후30분후..)와 일수
- //예외적으로 일수가 같고 식후30분과 취침전용법은 같이 묶어줌
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
-
- //용법코드의 아침, 점심, 저녁, 취침전 출력
- if(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;}
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", mthdtims+ "회 " +(dayno*mthddayno)+"일분");
-
- var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") + " "
- + qty + " " +
- + prcptims + " " +
- + dayno2 + " " +
- + Math.round(qty*prcptims*dayno2*1000)/1000 ;
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drug" + drugcnt, val);
- drugcnt++;
- iPoint = j;
- } else {
- iPageCnt++;
- iPoint = j - 1;
- break;
- }
- } else if((mthdcdfive1 == mthdcdfive2 && dayno1 == dayno2 && !( fChkSumcls(j) && atc_drugkind != "p") && prcpmixno1 == prcpmixno2) // fChkSumcls(j) &&
- || (dayno1 == dayno2 && mthdcdfive1 == "P" && (mthdcd2 == "A11D" || mthdcd2 == "A11DI") && prcpmixno1 == prcpmixno2) ) { // 20110412_laboru_경북대병원_아침 식후 30분 + 취침전
- // || (dayno1 == dayno2 && mthdcdfive2 == "P" && mthdcd1 == "A11D" && prcpmixno1 == prcpmixno2) ) { // 20110412_laboru_경북대병원_취침전 + 아침 식후 30분
- //20110102 이선경 수정 : 라벨출력시 묶어주는 기준은 용법코드 5번째자리(식후30분후..)와 일수
- //예외적으로 일수가 같고 식후30분과 취침전용법은 같이 묶어줌
- var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
- prcpqty = Math.ceil( prcpqty * tims*1000)/1000 ;
-
- //용법코드의 아침, 점심, 저녁, 취침전 출력
- if(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;}
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drugmthd", mthdtims+ "회 " +(dayno*mthddayno)+"일분");
- var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm") + " "
- + qty + " " +
- + prcptims + " " +
- + dayno2 + " " +
- + Math.round(qty*prcptims*dayno2*1000)/1000 ;
-
- model.makeValue("/root/main/prnt/lbllist[" +iPageCnt+ "]/drug" + drugcnt, val);
- drugcnt++;
- iPoint = j;
- } else {
- iPageCnt++;
- iPoint = j - 1;
- break;
- }
-
- if(drugcnt == 17){
- iPageCnt++;
- iPoint = j - 1;
- break;
- }
- }
-
- /*
- 아침, 점심, 저녁, 취침전 찍지 않는 예외 용법
- 1. 횟수 패턴 5번째 자리값이 1인 경우
- 2. 용법코드 4번째 자리값이 E (시간마다) 인 경우
- 3. 용법코드 4번째 자리값이 D (의사지시대로) 인 경우
- 4. 용법코드 5번째 자리값이 Q (의사지시대로) 인 경우
- */
- if(mthdcnts5 > 0 || mthdcd1.substring(3,4) == "E" || (mthdcd1.substring(3,4) == "D" && mthdcnts4 < 1) || mthdcd1.substring(4,5) == "Q") {
- mthdcnts = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- }
- /*if(mthdcdfive1 == "P" && prcpmixno1 != "-") {
- 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(mthdcnts_end == "취침전에") {
- //mthdcnts += mthdcd5nm;
- } else {
- //mthdcnts += mthdcnts_end;
- }
-
- if(mthdcnts4 > 0) {
- if(mthdcnts != "" ) {
- mthdcnts += "과 취침전에 ";
- } else {
- mthdcnts = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2") + " "
- + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
- }
- } else {
- mthdcnts += "에 ";
- }
- }
- for(var p = mthdcntsno ; p <= getNodesetCount("/root/main/prnt/lbllist") ; p++){
- //alert(p + " " + getNodesetCount("/root/main/prnt/lbllist") + "/////" + mthdcnts);
- 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+ "]/drugmthddesc", mthdcnts + " 1포씩 " + model.getValue("/root/main/lbllist/lbllist["+p+"]/mthdcnts4"));
- }
- }
- mthdcnts = "";
- }
- }
- /**
- *
- */
- function fGetImage() {
- var pImage = "";
- iImageCnt++;
- if(iImageCnt > 99){
- pImage = "GRAPH"+iImageCnt;
- } else if(iImageCnt > 9){
- pImage = "GRAPH0"+iImageCnt;
- } else {
- pImage = "GRAPH00"+iImageCnt;
- }
- return pImage
- }
- /**
- *
- */
- function fDateFormat(sDD) {
-
- return sDD.substr(0,4)+"/"+sDD.substr(4,2)+"/"+sDD.substr(6,2);
- }
- /**
- *
- */
- function fChkFloat(qty) {
- var fQty = parseFloat(qty);
- var fRst = "";
- if(fQty%1 == 0){
- fRst = parseInt(qty);
- } else {
- fRst = qty;
- }
-
- return fRst;
- }
- /**
- *
- */
- function fChkSumcls(cnt) {
- var chk = false;
- var sSumcls = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/sumcls");
- var sSnglyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/atcifsnglyn");
- var sDrugindependpackflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/drugindependpackflag");
- if(sSumcls == "DI" || sSumcls == "DS"|| sSumcls == "DX"|| sSumcls == "DT" || sSumcls == "DM" || sSumcls == "IH"|| sSumcls == "IO" || sSumcls == "DG" //20110512_laboru_pack 추가
- || sSumcls == "IS"|| sSumcls == "IX"|| sSumcls == "X" || sSumcls == "ZZZ" || sSumcls == "A10PQ" || sSumcls == "I"){
- chk = true;
- }
- if ( sSumcls == "D" && sSnglyn =="Y" ) {
- chk = true;
- }
- if ( sDrugindependpackflag =="Y"){
- chk = true;
- }
- return chk;
- }
- function fPrntTime(sDD, sTM) {
- if(PrnKind == "2") {
- return sDD.substr(4,2)+"/"+sDD.substr(6,2)+" "+sTM.substr(0,2)+":"+sTM.substr(2,2)+":"+sTM.substr(4,2);
- } else {
- return sDD.substr(4,2)+" / "+sDD.substr(6,2)+" "+sTM.substr(0,2)+":"+sTM.substr(2,2)+":"+sTM.substr(4,2);
- }
- }
|