12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766 |
- /**
- * 파 일 명 : SMADT10200.js
- * 설 명 : 병동 처방전/라벨 출력, 병동 마감 Javascript
- * 설 계 자 : 공두경
- * 작 성 자 : 공두경
- * 수정이력 : 2006.6.28 / 수정작성 / 공두경
- */
- //조회조건에 맞는 데이터가 있는지를 chk
- var chk_drugno = 0;
- var chk_wardcd = 0;
- var chk_pid = 0;
- var chk_prnt_count = 0;
- var chk_sum_count = 0;
- var chk_count = 0;
- var gTimer = null;
- var gTimer2 = null;
- var gT1 = null;
- var sleepTime= 1000;
- var chk_cnt = 0;
- var gCurrPrtObj = null; //현재 출력 IViewer
- /**
- * 초기화
- */
- function fInit() {
- if (model.getValue("/root/hidden/prcpsrch/prcpdd") == "") {
- // 날짜 초기화
- model.makeValue("/root/hidden/srchinfo/prcpdd", getCurrentDate());
- }
- //처방구분 초기화
- model.makeValue("/root/hidden/srchinfo/prcpflag", "A");
- submit("TRADT10211");
-
- //약주사구분 초기화
- model.makeValue("/root/hidden/srchinfo/drugkind", "T");
- //라벨 체크 초기화
- model.makeValue("/root/hidden/srchinfo/lblyn", "L");
- fChkLBL_YN();
-
- //처방전 체크 초기화
- model.makeValue("/root/hidden/srchinfo/mpsflag", "P");
-
- //기타조회구분 초기화
- model.makeValue("/root/hidden/srchinfo/etcflag", "T");
- cbx_etcdescflag.disabled = true;
-
-
- //마감시 instcd 적용을 위해 instcd 초기화
- // model.setValue("/root/hidden/srchinfo/instcd", getUserInfo("posinstcd"));
- var dutplceinstcd = getUserInfo("dutplceinstcd");
- if(dutplceinstcd == ""){
- dutplceinstcd = "012";
- }
- model.makeValue("/root/hidden/srchinfo/instcd", dutplceinstcd);
- //makeReportPreview(0,270,820,700);
-
- //병동 Combo 조회
- model.setValue("/root/send/deptinfo/deptflag", "W");
- submit("TRADT10203");
- astfAddCombo("/root/hidden/deptlist", "ward", "wardcd,wardnm", "T,전체");
-
- //자동출력구분 초기화
- btn_autoprnt_start.disabled = false;
- btn_autoprnt_end.disabled = true;
- //model.setValue("/root/hidden/srchinfo/auto_selflag", "1");
- //chk_auto_big.disabled = false;
- //chk_auto_small.disabled = true;
- //model.setValue("/root/hidden/srchinfo/auto_bigflag", "E|L|G");
- //model.setValue("/root/hidden/srchinfo/auto_smallflag", "");
-
- //20100412 황세원 수정 병실컬럼
- submit("TRADT10213");
- if(model.getValue("init/roomyn/roomyn/roomyn")=="Y") {
- grd_patlist.colHidden(5) = false;
- model.makeValue("/root/hidden/srchinfo/atc3", "Y");
- } else {
- model.makeValue("/root/hidden/srchinfo/atc3", "N");
- grd_patlist.colHidden(5) = true;
- }
- model.refresh();
-
-
- /*/ 병실컬럼
- if(dutplceinstcd == "013") {
- grd_patlist.colHidden(5) = false;
- model.makeValue("/root/hidden/srchinfo/atc3", "Y");
- } else {
- model.makeValue("/root/hidden/srchinfo/atc3", "N");
- grd_patlist.colHidden(5) = true;
- }
- model.refresh();
- */
-
- //마감시간구분
- submit("TRADT10212");
- cmb_sumtmflag1.select(0);
- cmb_sumtmflag2.select(0);
- cmb_sumtmflag3.select(0);
-
- //처방전 감사화면에서 팝업으로 열때 데이터 조회
- if(model.getValue("/root/hidden/popupinfo/drugno") != ""){
- model.setValue("/root/hidden/srchinfo/prcpdd", model.getValue("/root/hidden/popupinfo/prcpdd"));
- model.setValue("/root/hidden/srchinfo/fst_drugno", model.getValue("/root/hidden/popupinfo/drugno"));
- model.setValue("/root/hidden/srchinfo/pid", model.getValue("/root/hidden/popupinfo/pid"));
- //model.setValue("/root/hidden/srchinfo/ward", model.getValue("/root/hidden/popupinfo/ward"));
- model.refresh();
- fInSumList();
- }
-
- //바코드프린터설정 초기화
- model.setValue("/root/send/scrnid", getScreenID());
- submit("TRLLC90101");
- //lzzfMakeBrcdPrntObjHanDo("CommAX");
-
- var comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
- var prntkind = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
- if(comm == "2") {
- model.setValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm", "1");
- }
- if(prntkind == "1") {
- model.setValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind", "5");
- }
-
- //추가마감시 admission과 병동응급을 함께 마감할지 여부 조회 , ATC순으로 정렬 체크 여부
- //20100405 이선경 추가 : 정제 작은라벨(리스트형식) 출력시 ptp 함께 출력할지 여부
- submit("TRADT10207");
-
- if(model.getValue("/root/init/sumprcpflagyn/flagyn/orderbyatc") == "Y") {
- model.setValue("/root/hidden/srchinfo/orderbyatc", "Y");
- model.refresh();
- }
-
-
- // 출고부서 조회, 설정 2009.09.07 pymi
- submit("TRADT01106");
- // 20101019_laboru_경북대병원_cmc 셋팅을 경북대병원용으로 변경
- /*
- if((dutplceinstcd == "013") || (dutplceinstcd == "014") || (dutplceinstcd == "017")) {
- combo1.select(0);
- } else if(dutplceinstcd == "012") {
- combo1.select(2);
- } else {
- combo1.select(1);
- }*/
- if(dutplceinstcd == "032" || dutplceinstcd == "031") {
- combo1.select(0);
- } else {
- combo1.select(0);
- }
- //if(dutplceinstcd == "031") {
- // checkbox13.visible = false;
- //}
- chk_cnt ++;
- model.setValue("/root/temp/stocdeptcd", model.getValue("/root/hidden/srchinfo/stocdeptcd"));
- combo1.refresh();
- // (e)
-
- // 2010.03.22 pymi
- submit("TRADT01107");
- model.setValue("/root/hidden/srchinfo/lbl5", model.getValue("/root/init/lbllists/lbllists/lbl5"));
- // (e)
-
- }
- /**
- * 라벨 변경시 처리
- */
- function fChkLBL_YN() {
- var chk = model.getValue("/root/hidden/srchinfo/lblyn");
- var sLbl_Drug = "D|DT|DX|DE|DH";
- var sLbl_Inj = "I|IO|IX|IE|IH|IS"; // 20120628_일반수액도 추가(퇴원의 경우)
-
-
- if(chk != ""){
- model.makeValue("/root/hidden/srchinfo/lbl_drug", sLbl_Drug);
- model.makeValue("/root/hidden/srchinfo/lbl_inj", sLbl_Inj);
- model.makeValue("/root/hidden/srchinfo/drugall", "Y");
- model.makeValue("/root/hidden/srchinfo/injall", "Y");
- } else {
- model.makeValue("/root/hidden/srchinfo/lbl_drug", "");
- model.makeValue("/root/hidden/srchinfo/lbl_inj", "");
- model.makeValue("/root/hidden/srchinfo/drugall", "");
- model.makeValue("/root/hidden/srchinfo/injall", "");
- }
- //라벨 출력 형식 옵션
- submit("TRADT10208");
-
- if(model.getValue("/root/init/lbltype/item2/lbltype") == "Y") {
- checkbox10.visible = true;
- checkbox3.visible = true;
- } else {
- checkbox10.visible = false;
- checkbox3.visible = false;
- }
- }
- /**
- * 마감리스트 조회
- */
- function fInSumList() {
- model.removeNodeset("/root/main/sumlist/sumlist");
- model.refresh();
- chk_ward.visible = false;
- if(model.getValue("/root/hidden/srchinfo/prcpflag") == ""){
- messageBox("처방구분을", "C001")
- return;
- }
- if(model.getValue("/root/hidden/srchinfo/prcpflag").indexOf("Z") >= 0 && model.getValue("/root/hidden/srchinfo/prcpflag").length > 1){
- messageBox("처방구분 '정규약(508응급병동)'을 중복 선택할 수 없습니다.", "C");
- model.setValue("/root/hidden/srchinfo/prcpflag", "");
- rdo_prcp.refresh();
- rdo_prcp2.refresh();
- return;
- }
-
- prcpflag = model.getValue("/root/hidden/srchinfo/prcpflag");
- model.setValue("/root/send/suminfo/prcpflag", prcpflag);
- model.copyNode("/root/send/sumlistinfo", "/root/hidden/srchinfo");
- model.makeValue("/root/send/sumlistinfo/version", "new");
-
- //20100301 이선경 수정 : 자동라벨출력시 라벨그룹별로 마감대상 조회되도록
- if(model.getValue("/root/hidden/srchinfo/autolblyn") == "Y") {
- var lblstr = model.getValue("/root/hidden/srchinfo/autolblflag");
- var lblstr2 = lblstr.setReplaceWord("AD", "D|DX|DH|DP");
- lblstr2 = lblstr2.setReplaceWord("AI", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
- model.makeValue("/root/send/sumlistinfo/autolblflag", lblstr2);
- }
-
- // 20130115_심사실퇴원 처방 조회
- /* if(prcpflag == "J") {
- alert("dd");
- model.setValue("/root/hidden/srchinfo/prcpflag","L");
- model.makeValue("/root/hidden/srchinfo/prcpsimflag","J");
- }*/
-
- submit("TRADT10201");
- grd_sumlist.isSelected(grd_sumlist.fixedRows) = true;
- grd_sumlist.row = grd_sumlist.fixedRows;
- if(grd_sumlist.Rows > 1){ //20100210 이선경 주석 : 마감일자를 체크해서 조회하도록 함
- model.setValue("/root/main/sumlist/sumlist[1]/sel", "Y");
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
- } else {
- model.removeNodeset("/root/main/patlist/patlist");
- model.refresh();
- }
- }
- /**
- * 병동 마감
- */
- function fHosInSum(chk, auto) {
- var prcpflag = "";
- var prcpdd = model.getValue("/root/hidden/srchinfo/prcpdd");
- var instcd = model.getValue("/root/hidden/srchinfo/instcd");
- var pid = model.getValue("/root/hidden/srchinfo/pid");
- var drugkind = model.getValue("/root/hidden/srchinfo/drugkind");
- var onlyantis = model.getValue("/root/hidden/srchinfo/onlyantis");
- var prcpflagnm = rdo_prcp.label;
- var chkret = 0;
- var fromddflag = "";
- var fromdd = "";
- var fromtm = "";
- var toddflag = "";
- var todd = "";
- var totm = "";
- var sumdt = getCurrentDateTime().replace(" ", "");
-
- prcpflag = model.getValue("/root/hidden/srchinfo/prcpflag");
-
- if(chk == "Y") {
- if(prcpflag == "R") {//정규마감구분
- fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag1");
- fromtm = model.getValue("/root/hidden/srchinfo/fromtm1");
- toddflag = model.getValue("/root/hidden/srchinfo/toddflag1");
- totm = model.getValue("/root/hidden/srchinfo/totm1");
- } else if(prcpflag == "Z") {//정규약(508응급병동)
- fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag1");
- fromtm = model.getValue("/root/hidden/srchinfo/fromtm1");
- toddflag = model.getValue("/root/hidden/srchinfo/toddflag1");
- totm = model.getValue("/root/hidden/srchinfo/totm1");
- } else if(prcpflag == "A") {//추가마감구분
- fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag2");
- fromtm = model.getValue("/root/hidden/srchinfo/fromtm2");
- toddflag = model.getValue("/root/hidden/srchinfo/toddflag2");
- totm = model.getValue("/root/hidden/srchinfo/totm2");
- } else if(prcpflag == "K") {// 응급실마감구분
- fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag3");
- fromtm = model.getValue("/root/hidden/srchinfo/fromtm3");
- toddflag = model.getValue("/root/hidden/srchinfo/toddflag3");
- totm = model.getValue("/root/hidden/srchinfo/totm3");
- }
-
- if ( prcpflag =="R" || prcpflag =="Z" || prcpflag =="A" || prcpflag == "K"){
- if( fromddflag == "" || fromtm == "" || toddflag == "" || totm == "" || fromtm.length != 4 || totm.length != 4) {
- messageBox("마감구분이 잘못", "E005");
- return;
-
- } else {
-
- if(fromddflag == "0") {
- fromdd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD") ;
- } else {
- fromdd = prcpdd ;
- }
-
- if(toddflag == "0") {
- todd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD") ;
- } else {
- todd = prcpdd ;
- }
-
- fromtm = fromtm + "00";
- totm = totm + "59";
- }
- } else {
-
- fromdd = "" ;
- todd = "" ;
- fromtm ="";
- totm ="";
- }
-
- chkret = 6 ; //messageBox(prcpflagnm + "마감을", "Q004");
- } else {
-
- if (prcpflag == "Z" && chk == "N" && auto == "auto") {
-
- //fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag1");
- //fromtm = model.getValue("/root/hidden/srchinfo/fromtm1");
- //toddflag = model.getValue("/root/hidden/srchinfo/toddflag1");
- //totm = model.getValue("/root/hidden/srchinfo/totm1");
-
- fromdd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD");
- fromtm = '030000'
- //todd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(1,"D")).getDateFormat("YYYYMMDD");
- todd = prcpdd;
- totm = '235959';
- //멀티데이 처방 출력시 업무 알아봐야 함
- }
-
- chkret = 6;
- }
-
- if(chkret == 6){
-
- if(model.getValue("/root/hidden/srchinfo/prcpflag") != "C2") {
-
- if(chk == "Y") {
- model.setValue("/root/send/suminfo/fromdd", fromdd);
- model.setValue("/root/send/suminfo/fromtm", fromtm);
- model.setValue("/root/send/suminfo/todd", todd);
- model.setValue("/root/send/suminfo/totm", totm);
- //model.makeValue("/root/send/suminfo/autoyn", "N"); 20100217 이선경 주석
- } else {
- if (prcpflag == "Z") {
- model.setValue("/root/send/suminfo/fromdd", fromdd);
- model.setValue("/root/send/suminfo/fromtm", fromtm);
- model.setValue("/root/send/suminfo/todd", todd);
- model.setValue("/root/send/suminfo/totm", totm);
- } else {
- model.setValue("/root/send/suminfo/fromdd", "");
- model.setValue("/root/send/suminfo/fromtm", "");
- model.setValue("/root/send/suminfo/todd", "");
- model.setValue("/root/send/suminfo/totm", "");
- }
- }
- model.setValue("/root/send/suminfo/sumdt", sumdt);
- model.setValue("/root/send/suminfo/prcpdd", prcpdd);
- model.setValue("/root/send/suminfo/prcpflag", prcpflag);
- model.setValue("/root/send/suminfo/instcd", instcd);
- model.setValue("/root/send/suminfo/pid", pid);
- model.setValue("/root/send/suminfo/sumdrugkind", drugkind);
- model.setValue("/root/send/suminfo/onlyantis", onlyantis);
- model.setValue("/root/send/suminfo/mstocdeptcd", model.getValue("/root/hidden/srchinfo/stocdeptcd")); // 2009.09.11 pymi
- model.setValue("/root/send/suminfo/ioflag", "I");
- model.makeValue("/root/send/suminfo/multiyn", model.getValue("/root/hidden/srchinfo/multiyn")); //multi day 처방 포함 여부
- model.makeValue("/root/send/suminfo/dinjyn", model.getValue("/root/hidden/srchinfo/dinjyn")); // 20121120_항암주사실 제외 여부
- var dinjonlyyn = model.getValue("/root/hidden/srchinfo/dinjonlyyn"); // 20121120_항암주사실만 여부
-
-
- if(prcpflag == "A" || prcpflag == "R") {//20110102 이선경 수정 : 경북대병원 병동별로 마감호출( 약번호 순서 : 병동, 파우더, 등록번호)
- if(dinjonlyyn == "Y") {
- model.makeValue("/root/send/suminfo/wardcd", "3120900000"); // 20121121_항암주사실만 체크 시 항암주사실만 마감 되도록 수정
- submit("TXADT10201");
- } else {
- for(var i = 2 ; i <= getNodesetCount("/root/hidden/deptlist/ward"); i++) {
- model.makeValue("/root/send/suminfo/wardcd", model.getValue("/root/hidden/deptlist/ward["+ i + "]/wardcd"));
- submit("TXADT10201");
- }
- }
- } else if(prcpflag == "K") { // 20120519_laboru
- //model.makeValue("/root/send/suminfo/wardcd", model.getValue("/root/hidden/deptlist/ward["+ i + "]/wardcd"));
- submit("TXADT10201");
- } else {
- submit("TXADT10201");
- }
-
-
- //추가마감시 flayn=Y이면 admission과 병동응급도 마감을 한다.
- /*if(chk == "Y" && prcpflag == "A" && model.getValue("/root/init/sumprcpflagyn/flagyn/flagyn") == "Y") {
-
- model.setValue("/root/send/suminfo/prcpflag", "M");
-
- for(var i = 0 ; i < 5; i++) {
- submit("TXADT10201");
- }
-
- model.setValue("/root/send/suminfo/prcpflag", "W");
-
- for(var i = 0 ; i < 5; i++) {
- submit("TXADT10201");
- }
-
- }*/ //20100211 이선경 수정 : 멀티체크해서 마감하는 기능이 있으므로 주석처리
-
- if (model.getValue("/root/hidden/srchinfo/prcpflag")=="L" || model.getValue("/root/hidden/srchinfo/prcpflag")=="G" ) {
- model.setValue("/root/send/suminfo/prcpdd", prcpdd);
- model.setValue("/root/send/suminfo/prcpflag", prcpflag);
- model.setValue("/root/send/suminfo/instcd", instcd);
- model.setValue("/root/send/suminfo/pid", pid);
- model.setValue("/root/send/suminfo/ioflag", "O");
-
- for(var i = 0 ; i < 5; i++) {
- submit("TXADT10201");
- }
- }
- if(prcpflag =="J") {
- //model.makeValue("/root/send/suminfo/wardcd", "4070700000"); // 20130114_심사실 퇴원
- submit("TXADT10201");
- }
- }
-
- //20100818 이선경 : 임상연구 일반약 80000번대로 마감
- model.makeValue("/root/send/srchinfo/srchprcpdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
- model.makeValue("/root/send/srchinfo/crsumflag", "N");
- model.makeValue("/root/send/srchinfo/orgdrugflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
- model.makeValue("/root/send/srchinfo/sumdt", sumdt);
- var drugkind = model.getValue("/root/hidden/srchinfo/drugkind");
-
-
- if(model.getValue("/root/hidden/srchinfo/prcpflag") != "C2") {
- if(model.getValue("/root/hidden/srchinfo/prcpflag") != "L" && model.getValue("/root/hidden/srchinfo/prcpflag") !="G") {
- if(drugkind == "T") {
- //주사 마감
- model.makeValue("/root/send/srchinfo/crdrugkind", "M");
- submit("TXADC10902");
- //약 마감
- model.makeValue("/root/send/srchinfo/crdrugkind", "D");
- submit("TXADC10902");
-
- } else if(drugkind == "D") {
- //약 마감
- model.makeValue("/root/send/srchinfo/crdrugkind", "D");
- submit("TXADC10902");
-
- } else if(drugkind == "M") {
- //주사 마감
- model.makeValue("/root/send/srchinfo/crdrugkind", "M");
- submit("TXADC10902");
-
- }
- } else {
- model.makeValue("/root/send/srchinfo/crdrugkind", "");
- submit("TXADC10902");
- }
- }
- //20100831 이선경 추가 : 임상연구 일반약 외래주사 마감 기능 추가
- if((auto != "auto" && isSearchString(rdo_prcp2.value, "C2"))|| (auto == "auto" && isSearchString(chk_auto_small.value, "C2")) ) {
- model.makeValue("/root/send/srchinfo/srchprcpdd", model.getValue( "/root/hidden/srchinfo/prcpdd"));
- model.makeValue("/root/send/srchinfo/crsumflag", "I");
- model.makeValue("/root/send/srchinfo/hosinhosout", "I"); //원내
- submit("TXADC10901"); //외래임상약 마감하는 것과 동일 소스임 (수정시 주의)
- }
- }
- }
- /**
- * 마감리스트 더블클릭시 출력할 환자리스트 조회
- */
- function fPrntPatList() {
- model.removeNodeset("/root/main/patlist/patlist");
- grd_patlist.rebuildStyle();
-
- // if(model.getValue("/root/main/sumlist/sumlist["+grd_sumlist.row+"]/sumdt") != ""){
-
-
- //20100210 이선경 수정 : 마감일자 멀티체크 조회 가능하도록 함
- var strsumdt = "";
- for(var i = 1 ; i <= getNodesetCount("/root/main/sumlist/sumlist") ; i++) {
- if(model.getValue("/root/main/sumlist/sumlist["+i+"]/sel") == "Y") {
- model.copyNode("/root/send/patlistinfo","/root/main/sumlist/sumlist["+i+"]");
- model.makeValue("/root/send/patlistinfo/prcpdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
- model.makeValue("/root/send/patlistinfo/fst_drugno", model.getValue("/root/hidden/srchinfo/fst_drugno"));
- model.makeValue("/root/send/patlistinfo/last_drugno", model.getValue("/root/hidden/srchinfo/last_drugno"));
- model.makeValue("/root/send/patlistinfo/wardcd", model.getValue("/root/hidden/srchinfo/wardcd"));
- model.makeValue("/root/send/patlistinfo/pid", model.getValue("/root/hidden/srchinfo/pid"));
- model.makeValue("/root/send/patlistinfo/autoprntflag", model.getValue("/root/hidden/srchinfo/autoprntflag"));
- model.makeValue("/root/send/patlistinfo/etcdescflag", model.getValue("/root/hidden/srchinfo/etcdescflag"));
- model.makeValue("/root/send/patlistinfo/prntkind", model.getValue("/root/hidden/srchinfo/prntkind"));
- model.makeValue("/root/send/patlistinfo/autolblyn", model.getValue("/root/hidden/srchinfo/autolblyn"));
- model.makeValue("/root/send/patlistinfo/prcpflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
- model.makeValue("/root/send/patlistinfo/orderbyatc", model.getValue("/root/hidden/srchinfo/orderbyatc"));
- model.makeValue("/root/send/patlistinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
- model.makeValue("/root/send/patlistinfo/atc3", model.getValue("/root/hidden/srchinfo/atc3"));
- model.makeValue("/root/send/patlistinfo/autoyn", model.getValue("/root/hidden/srchinfo/autoyn"));
- model.makeValue("/root/send/patlistinfo/version", "new");
-
- strsumdt = strsumdt + " " + model.getValue("/root/main/sumlist/sumlist["+i+"]/sumdt");
- }
- }
- model.makeValue("/root/send/patlistinfo/sumdt", strsumdt);
- // 20121121_항암주사실 여부
- model.makeValue("/root/send/patlistinfo/dinjyn", model.getValue("/root/hidden/srchinfo/dinjyn"));
- model.makeValue("/root/send/patlistinfo/dinjonlyyn", model.getValue("/root/hidden/srchinfo/dinjonlyyn"));
-
- if(strsumdt != "") {
- submit("TRADT10202");
- }
-
- if(model.getValue("/root/hidden/srchinfo/fst_drugno") != "" && getNodesetCount("/root/main/patlist/patlist") > 0){
- model.setValue("/root/main/patlist/patlist/sel", "Y");
- }
-
- //sortNodeList("")
- // }
- model.refresh();
- }
- /**
- * 처방전/라벨 출력
- * autoflag : M(수동출력), A(자동출력)
- * prntflag : mps(처방전자동출력), lbl(라벨자동출력)
- */
- function fPrcpMPSPrint( autoflag, prntflag ) {
- //투약번호로 출력
- var oRptViewer = "";
- var sDrugNo = model.getValue("/root/hidden/srchinfo/fst_drugno");
- sleepTime = model.getValue("/root/hidden/sleeptime") * 1000;
- /*if(sDrugNo != ""
- && chk_prnt_count == 0){
- fAutoPrnt();
- return;
- }*/
- chk_prnt_count = 0;
-
- //수동출력
- var chk_mpsflag = model.getValue("/root/hidden/srchinfo/mpsflag");
- var chk_lblyn = model.getValue("/root/hidden/srchinfo/lblyn");
- var chk_patlbl = model.getValue("/root/hidden/srchinfo/namecard");
- //var chk_lbl_drug = model.getValue("/root/hidden/srchinfo/lbl_drug");
- //var chk_lbl_inj = model.getValue("/root/hidden/srchinfo/lbl_inj");
-
- //자동출력
-
- var chk_autokindflag = model.getValue("/root/hidden/srchinfo/autokind");
- var chk_autolblyn = model.getValue("/root/hidden/srchinfo/autolblsize");
- //alert(flag + " " + chk_mpsflag);
- grd_patlist.rebuildStyle();
- //if (chk_mpsflag != "" || chk_lblyn != "") {
- //처방전 출력 데이터 조회
-
- if(autoflag =="M" ) {//수동출력
- var cnt = 0;
- for(var i = grd_patlist.fixedRows; i < grd_patlist.rows; i++){
- if(model.getValue("/root/main/patlist/patlist["+i+"]/sel") == "Y"){
- cnt++ ;
- }
- }
-
- if( cnt == 0){
- messageBox("처방전을 출력할 환자리스트가 없거나 선택된 환자가", "I004");
- }
- }
-
- for(var i = grd_patlist.fixedRows; i < grd_patlist.rows; i++){
- if(model.getValue("/root/main/patlist/patlist["+i+"]/sel") == "Y"){
- model.copyNode("/root/send/prcpinfo", "/root/main/patlist/patlist["+i+"]");
- /*if(chk_lbl_drug != "" && chk_lbl_inj != ""){
- model.makeValue("/root/send/prcpinfo/lblflag", chk_lbl_drug+"|"+chk_lbl_inj);
- } else if(chk_lbl_drug != ""){
- model.makeValue("/root/send/prcpinfo/lblflag", chk_lbl_drug);
- } else if(chk_lbl_inj != ""){
- model.makeValue("/root/send/prcpinfo/lblflag", chk_lbl_inj);
- }*/
-
- if(autoflag == "M"){
- //model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
- //20100315 이선경 수정 : prcpflag의 멀티체크가 가능하기때문에 patlist 조회된 환자 각각의 drugflag 값을 보내도록
- model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/send/prcpinfo/drugflag"));
- model.makeValue("/root/send/prcpinfo/reprintyn", model.getValue("/root/hidden/srchinfo/reprintyn"));
- } else if(autoflag == "A") {
- //model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/hidden/srchinfo/autoprntflag"));
- //model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/send/patlistinfo/sumflag"));
- //20100414 이선경 수정 : patlist 조회된 환자 각각의 drugflag 값을 보내도록
- model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/send/prcpinfo/drugflag"));
- }
- model.makeValue("/root/send/prcpinfo/prntflag", model.getValue("/root/hidden/srchinfo/prntflag"));
- model.makeValue("/root/send/prcpinfo/ioflag", "I");
- var drugno = model.getValue("/root/send/prcpinfo/drugno");
- var wardcd = model.getValue("/root/send/prcpinfo/wardcd");
- var pid = model.getValue("/root/send/prcpinfo/pid");
- if(autoflag =="M" ) {//수동출력
- if (chk_mpsflag != "" ){
- //처방전 출력
- fHosInMPSPrint();
- }
- if(chk_lblyn != "") {
- //라벨수동출력
- fPrcpLBLPrint("M");
- }
-
- if (chk_patlbl != "") {
- //네임카드 출력
- oRptViewer += "report_"+i+"|";
- fPatLblPrint("report_"+i);
- }
-
- } else if(autoflag == "A"){ //자동출력
- if (prntflag == "mps" ){
- //처방전 출력
- fHosInMPSPrint();
- }
- if(prntflag == "lbl") {
- //라벨자동출력
- fPrcpLBLPrint("A");
- }
- }
-
- if (model.getValue("/root/hidden/srchinfo/autoyn") !="Y") {
- //출력상태 표시
- for ( var j = 0 ; j < grd_patlist.cols -1; j++){
- grd_patlist.cellStyle("background-color", i, j) = "#cfffcf";
- //grd_patlist.cellStyle("font-weight", i, j) = "bold";
- }
- grd_patlist.refresh();
- }
- }
- //}
-
- model.setValue("/root/send/atcinfo/drugdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
- if ( model.getValue("/root/hidden/srchinfo/prcpflag") =="L" ) {
- model.setValue("/root/send/atcinfo/drugflag", "L");
- } else if ( model.getValue("/root/hidden/srchinfo/prcpflag") =="E" ) {
- model.setValue("/root/send/atcinfo/drugflag", "E");
- } else {
- model.setValue("/root/send/atcinfo/drugflag", "I");
- }
- if (model.getValue("/root/hidden/srchinfo/autoatcyn") =="Y") {
- model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
- submit("TXADT10202"); //ATC Data 전송(배치호출)
- }
- }
-
- //cleaniViewer(oRptViewer);
-
- }
- //라벨출력
- function fPrcpLBLPrint(flag) {
-
- var lblitem = null; //라벨구분
- var lblstr = "";
- var lblsize = ""; //라벨출력크기
- var lblgrupAD = "N"; //정제라벨 체크여부
- var lblgrupDT = "N"; //PTP라벨 체크여부
-
- 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";
- }
- }
-
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- model.makeValue("/root/hidden/srchinfo/flagtmp", flag);
- 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/prcpliflag", model.getValue("/root/hidden/srchinfo/prcpflag")); // 20120621_제한항생제 승인 처방 라벨 출력위해
-
- model.makeValue("/root/send/prcpinfo/version", "new");
- if(model.getValue("/root/send/suminfo/intiflag") == "N") {
- model.makeValue("/root/send/prcpinfo/intiflag", "Y"); // 20120417_laboru_인티팜 여부 추가
- }
-
- // 20101222_laboru_경북대병원_경대 본원 라벨(큰라벨 2)
- if(lblsize == "L" || lblsize == "L1" ) {//자동출력에 큰라벨 출력이면 환자별로 한꺼번에 뽑아야 라벨총장수와 페이지 번호 찍음
- 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();
- //fBigLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
-
- } else if(lblsize == "S") {
-
- model.makeValue("/root/send/prcpinfo/lblsizeflag", "S");
- for (var i = 0; i < lblitem.length; i++) {
- //20101221_laboru_lblitem 을 팝업창으로 넘기기.
- model.makeValue("/root/hidden/srchinfo/tmplblitem", lblitem[i]);
-
-
- //정제
- if (lblitem[i]=="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();
- //fSmallLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- //주사
- if (lblitem[i]=="AI"){
- model.makeValue("/root/send/prcpinfo/lblflag", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
- //fInit_lbl();
- //fSmallLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- //PTP
- if (lblitem[i]=="DT"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DT");
-
- //20100405 이선경 추가 : 라벨그룹의 정제가 체크되어 있고 정제 작은라벨(리스트형식) 출력시 ptp 함께 출력하는 옵션일때 출력안함
- if(lblgrupAD == "N" || model.getValue("/root/init/sumprcpflagyn/flagyn/lbl6yn") != "Y") {
- //fInit_lbl();
- //fSmallLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- }
- //외용
- if (lblitem[i]=="DI"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DI");
- //fInit_lbl();
- //fLiquidLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- //수제
- if (lblitem[i]=="DS"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DS");
- //fInit_lbl();
- //fLiquidLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- //PACK 20110922_laboru_pack 도 작은 라벨로 출력 가능하게 수정
- if (lblitem[i]=="DG"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DG");
- //fInit_lbl();
- //fLiquidLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- //PTP단독처방
- if (lblitem[i]=="PTS"){
- model.makeValue("/root/send/prcpinfo/lblflag", "PTS");
- //fInit_lbl();
- //fSmallLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- //산제용법별
- if (lblitem[i]=="DP"){
- model.makeValue("/root/send/prcpinfo/lblflag", "DP");
- //fInit_lbl();
- //fPowderlLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
-
- //2010-06-29 [보관방법:냉장주사] 단독출력
- if (lblitem[i]=="LBL_INJ_I"){
- model.makeValue("/root/send/prcpinfo/lblflag", "LBL_INJ_I");
- //fInit_lbl();
- //fSmallLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- //2010-06-29 [보관방법:고위험주사] 단독출력
- if (lblitem[i]=="LBL_INJ_D"){
- model.makeValue("/root/send/prcpinfo/lblflag", "LBL_INJ_D");
- //fInit_lbl();
- //fSmallLBLPrint();
- // 20101221_laboru_라벨 출력은 팝업으로 함.
- modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- }
- }
-
- }
- function fStopTimer() {
- window.clearinterval(gT1);
- }
- /**
- * 처방전 출력
- */
- function fHosInMPSPrint() {
-
- model.makeValue("/root/send/prcpinfo/etcdescflag", model.getValue("/root/hidden/srchinfo/etcdescflag"));
- model.makeValue("/root/send/prcpinfo/autoyn", model.getValue("/root/hidden/srchinfo/autoyn"));
- model.makeValue("/root/send/prcpinfo/stocdeptcd", model.getValue("/root/hidden/srchinfo/stocdeptcd"));
- model.makeValue("/root/send/prcpinfo/autolimanti", model.getValue("/root/hidden/srchinfo/prcpflag")); // 2011.02.08 pymi 제한항생제
- //fInit_prnt();
-
- modal("SPADT62201", 1, 0, 0, "SPADT62201", "/root/send/prcpinfo", "/root/send/prcpinfo", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
- }
- /**
- * 자동출력 버튼 클릭시 타이머 작동
- */
- function fClickAutoPrnt(chk) {
-
- if (chk == "Y") {
- //20090824 마정민 수정. 오류가 나더라도 팝업이 뜨지 않고 계속해서 진행될 수 있도록 수정.
- setErrorOff(true);
- model.setValue("/root/hidden/autoend", "N") ;
-
- if(model.getValue("/root/hidden/srchinfo/autoprntflag") == ""){
- messageBox("자동출력의 처방구분을", "C001");
- return;
- }
-
- if(model.getValue("/root/hidden/srchinfo/autokind") == "" && model.getValue("/root/hidden/srchinfo/autolblsize") == "") {
- messageBox("자동출력의 출력구분을", "C001");
- return;
- }
-
- // 20101203 wify 경북대병원 큰라벨(본원)추가
- //if(isSearchString(chk_auto_lblsize.value, "L") || isSearchString(chk_auto_lblsize.value, "S")) {
- if(isSearchString(chk_auto_lblsize.value, "L") || isSearchString(chk_auto_lblsize.value, "S") || isSearchString(chk_auto_lblsize.value, "L1")) {
- if(model.getValue("/root/hidden/srchinfo/autolblflag") == ""){
- messageBox("자동출력의 라벨구분을", "C001");
- return;
- }
- }
-
- var sRst = "";
- if(gTimer != null) {
- sRst = messageBox("자동출력이 동작중입니다.\n자동출력구분설정대로 다시", "Q004");
- if(sRst == "6"){
- window.clearinterval(gTimer);
- gTimer = null;
- } else {
- return;
- }
- }
- if(sRst == ""){
- sRst = messageBox("자동출력을", "S001");
- if(sRst != "6"){
- return;
- }
- }
- btn_hist.visible=false;
- grd_sumlist.visible=false;
- grd_patlist.visible=false;
-
- //20090914 이선경 추가 : 자동출력중 처방구분등 다른조건 변경 못하게 함(오류 가능성 있음)
- rdo_prcp.disabled = true; //처방구분(정규, 추가)
- rdo_prcp2.disabled = true; //처방구분(admission, 병동응급, 퇴원, 외박, 응급실)
- checkbox4.disabled = true; //항암프로토콜처방만 체크
- ipt_fst_drugno.disabled = true; //투약번호 from
- caption25.disabled = true; //'~'
- ipt_last_drugno.disabled = true; //투약번호 to
- ipt_pid.disabled = true; //등록번호
- chk_manl_lblflag.disabled = true; //라벨구분
- btn_prt.disabled = true; //출력버튼
- button1.disabled = true; //마감버튼
- checkbox10.disabled = true; //PTP단독처방라벨
- checkbox3.disabled = true; //자동출력의 PTP단독처방라벨
- chk_auto_small.disabled = true; //자동출력의 처방구분
- chk_auto_lblflag.disabled = true; //자동출력의 라벨구분
- chk_auto_big.disabled = true; //자동출력의 출력구분
- chk_auto_lblsize.disabled = true; //자동출력의 출력구분
- checkbox8.disabled = true; //자동출력의 ptp라벨, 외용라벨
- ipt_prcpdd.disabled = true; //적용일자
- btn_sea.disabled = true; //조회버튼
- cmb_sumtmflag1.disabled = true; //마감시간대구분
- cmb_fromddflag1.disabled = true; //마감일자from
- ipt_fromtm1.disabled = true; //마감시간from
- cmb_toddflag1.disabled = true; //마감일자to
- ipt_totm1.disabled = true; //마감시간to
- cmb_sumtmflag2.disabled = true; //마감시간대구분
- cmb_fromddflag2.disabled = true; //마감일자from
- ipt_fromtm2.disabled = true; //마감시간from
- cmb_toddflag2.disabled = true; //마감일자to
- ipt_totm2.disabled = true; //마감시간to
- radio1.disabled = true; //약주사구분
- radio3.disabled = true; //기타조회구분
- btn_init.disabled = true; //초기화버튼
- button5.disabled = true; //병동검색이미지
- chk_mps.disabled = true; //출력구분의 처방전체크
- chk_lbl.disabled = true; //출력구분의 라벨체크
- checkbox1.disabled = true; //출력구분의 약체크
- checkbox2.disabled = true; //출력구분의 주사체크
- chk_lbl_drug.disabled = true; //출력구분의 약리스트체크
- chk_lbl_inj.disabled = true; //출력구분의 주사리스트체크
- combo1.disabled = true; //실출고부서
- checkbox7.disabled = true; //ATC순으로 정렬
- btn_prnt.disabled = true; //프린터설정
- button3.disabled = true; //마감시간관리
- input1.disabled = true; //출력간격
- checkbox11.disabled = true; //multi-day 처방포함
- //cmb_ward.visible = false;
- model.setValue("/root/hidden/srchinfo/prcpflag", "");
- model.setValue("/root/hidden/srchinfo/fst_drugno", "");
- model.setValue("/root/hidden/srchinfo/last_drugno", "");
- model.setValue("/root/hidden/srchinfo/wardcd", "");
- model.setValue("/root/hidden/srchinfo/wardnm", "");
- model.setValue("/root/temp/srchinfo/ward", "");
- model.setValue("/root/hidden/srchinfo/pid", "");
- model.setValue("/root/hidden/srchinfo/onlyantis","");
- model.makeValue("/root/hidden/srchinfo/autoyn", "Y");
-
- model.setValue("/root/send/suminfo/fromdd", "");
- model.setValue("/root/send/suminfo/fromtm", "");
- model.setValue("/root/send/suminfo/todd", "");
- model.setValue("/root/send/suminfo/totm", "");
-
- var autostr = chk_auto_small.label + " " + chk_auto_big.label + " " + chk_auto_lblsize.label ;
- if(isSearchString(chk_auto_lblsize.value, "L") || isSearchString(chk_auto_lblsize.value, "S") || isSearchString(chk_auto_lblsize.value, "L1")){
- autostr = autostr + "(" + chk_auto_lblflag.label + ")";
- }
- autostr = autostr.setReplaceWord("|", ", " );
- caption23.text = autostr;
-
- model.refresh();
-
-
- btn_autoprnt_start.disabled = true;
- btn_autoprnt_end.disabled = false;
- chk_sum_count = 8;
- gTimer = window.setInterval("fAutoPrnt()",20000);
-
- //재출력 불가
- model.setValue("/root/hidden/srchinfo/reprintyn", "");
- checkbox9.disabled = true;
-
- group2.visible = "true";
- //서버오류가 발생하더라도 modeless 팝업을 통해 계속해서 진행할 수 있도록 수정.
- fErrMsg ();
- } else {
- setErrorOn();
- window.clearinterval(gTimer);
- gTimer = null;
- btn_hist.visible=true;
- grd_sumlist.visible=true;
- grd_patlist.visible=true;
-
-
- //20090914 이선경 추가 : 자동출력중 처방구분등 다른조건 변경 못하게 함(오류 가능성 있음)
- rdo_prcp.disabled = false; //처방구분(정규, 추가)
- rdo_prcp2.disabled = false; //처방구분(admission, 병동응급, 퇴원, 외박, 응급실)
- checkbox4.disabled = false; //항암프로토콜처방만 체크
- ipt_fst_drugno.disabled = false; //투약번호 from
- caption25.disabled = false; //'~'
- ipt_last_drugno.disabled = false; //투약번호 to
- ipt_pid.disabled = false; //등록번호
- chk_manl_lblflag.disabled = false; //라벨구분
- btn_prt.disabled = false; //출력버튼
- button1.disabled = false; //마감버튼
- checkbox10.disabled = false; //PTP단독처방라벨
- checkbox3.disabled = false; //자동출력의 PTP단독처방라벨
- chk_auto_small.disabled = false; //자동출력의 처방구분
- chk_auto_lblflag.disabled = false; //자동출력의 라벨구분
- chk_auto_big.disabled = false; //자동출력의 출력구분
- chk_auto_lblsize.disabled = false; //자동출력의 출력구분
- checkbox8.disabled = false; //자동출력의 ptp라벨, 외용라벨
- ipt_prcpdd.disabled = false; //적용일자
- btn_sea.disabled = false; //조회버튼
- cmb_sumtmflag1.disabled = false; //마감시간대구분
- cmb_fromddflag1.disabled = false; //마감일자from
- ipt_fromtm1.disabled = false; //마감시간from
- cmb_toddflag1.disabled = false; //마감일자to
- ipt_totm1.disabled = false; //마감시간to
- cmb_sumtmflag2.disabled = false; //마감시간대구분
- cmb_fromddflag2.disabled = false; //마감일자from
- ipt_fromtm2.disabled = false; //마감시간from
- cmb_toddflag2.disabled = false; //마감일자to
- ipt_totm2.disabled = false; //마감시간to
- radio1.disabled = false; //약주사구분
- radio3.disabled = false; //기타조회구분
- btn_init.disabled = false; //초기화버튼
- button5.disabled = false; //병동검색이미지
- chk_mps.disabled = false; //출력구분의 처방전체크
- chk_lbl.disabled = false; //출력구분의 라벨체크
- checkbox1.disabled = false; //출력구분의 약체크
- checkbox2.disabled = false; //출력구분의 주사체크
- chk_lbl_drug.disabled = false; //출력구분의 약리스트체크
- chk_lbl_inj.disabled = false; //출력구분의 주사리스트체크
- combo1.disabled = false; //실출고부서
- checkbox7.disabled = false; //ATC순으로 정렬
- btn_prnt.disabled = false; //프린터설정
- button3.disabled = false; //마감시간관리
- input1.disabled = false; //출력간격
- checkbox11.disabled = false; //multi-day 처방포함
-
- //cmb_ward.visible = true;
- model.setValue("/root/hidden/srchinfo/prcpflag", "");
- model.setValue("/root/hidden/srchinfo/fst_drugno", "");
- model.setValue("/root/hidden/srchinfo/last_drugno", "");
- model.setValue("/root/hidden/srchinfo/wardcd", "");
- model.setValue("/root/hidden/srchinfo/wardnm", "");
- model.setValue("/root/hidden/srchinfo/drugkind", "T");
- model.setValue("/root/temp/srchinfo/ward", "");
- model.setValue("/root/hidden/srchinfo/pid", "");
- //model.setValue("/root/hidden/srchinfo/autoprntflag", "");
- model.makeValue("/root/hidden/srchinfo/autoyn", "");
- btn_autoprnt_start.disabled = false;
- btn_autoprnt_end.disabled = true;
- model.setValue("/root/hidden/autoend", "Y") ;
- model.setValue("/root/hidden/srchinfo/prcpflag", "A");
- model.refresh();
- //재출력 가능
- checkbox9.disabled = false;
-
- group2.visible = "false";
-
- model.removeNodeset("/root/main/sumlist/sumlist");
- model.removeNodeset("/root/main/patlist/patlist");
- model.refresh();
- }
- }
- function fReStart(){
- //window.clearinterval(gTimer2);
- //gTimer = window.setInterval("fAutoPrnt()",11000);
- }
- /**
- * 자동출력
- */
- function fAutoPrnt() {
- //window.clearinterval(gTimer);
- if ( model.getValue("/root/hidden/autoend") =="Y" ){
- gTimer = null;
- return;
- }
- var orgPrcpflag = model.getValue("/root/hidden/srchinfo/prcpflag");
- //if ( chk_count >= 50 ){
- //chk_count = 0;
- //gTimer2 = window.setInterval("fReStart()",5000);
-
- //return;
- //}
- chk_count++;
- if ( ( chk_count % 4 )=="0" ){
- caption14.text="자동 출력중[/]";
- }
- if ( ( chk_count % 4 )=="1" ){
- caption14.text="자동 출력중[ ―]";
- }
- if ( ( chk_count % 4 )=="2" ){
- caption14.text="자동 출력중[\]";
- }
- if ( ( chk_count % 4 )=="3" ){
- caption14.text="자동 출력중[|]";
- }
- caption14.refresh();
-
- if(chk_sum_count >= 4){
- if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("M") > -1 ){ //20090721 이선경 수정 : 처방전 자동출력일때만 마감적용
- if (model.getValue("/root/hidden/srchinfo/autoendyn") =="Y") {
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("Z") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "Z");
- fHosInSum("N", "auto"); //508응급병동 정규약
- }
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M1") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "M");
- model.setValue("/root/hidden/srchinfo/drugkind", "D");
- fHosInSum("N", "auto"); //Admission약마감
- }
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M2") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "M");
- model.setValue("/root/hidden/srchinfo/drugkind", "M");
- fHosInSum("N", "auto"); //Admission주사마감
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M1") < 0
- && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M2") < 0
- && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "M");
- fHosInSum("N", "auto"); //Admission마감
- }
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W1") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "W");
- model.setValue("/root/hidden/srchinfo/drugkind", "D");
- fHosInSum("N", "auto"); //병동응급약마감
- }
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W2") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "W");
- model.setValue("/root/hidden/srchinfo/drugkind", "M");
- fHosInSum("N", "auto"); //병동응급주사마감
- } else
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W1") < 0
- && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W2") < 0
- && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "W");
- fHosInSum("N", "auto"); //병동응급마감
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "L"); // 자동일때는 외출외박으로 처리하여 응급실 퇴원약 제외 20091027 이선경 수정 : 외출외박과 퇴원약은 따로 처리
- model.setValue("/root/hidden/srchinfo/drugkind", "T");
- fHosInSum("N", "auto"); //퇴원약마감
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("G") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "G");
- model.setValue("/root/hidden/srchinfo/drugkind", "T");
- fHosInSum("N", "auto"); //외박마감
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") >=0 ){
- //model.setValue("/root/hidden/srchinfo/prcpflag", "Q"); //마약만 마감
- //fHosInSum("N");
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("S") >=0 ){
- //model.setValue("/root/hidden/srchinfo/prcpflag", "Q"); //마약만 마감
- //fHosInSum("N");
- }
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("C2") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "C2");
- fHosInSum("N", "auto"); //임상주사 마감
- }
- }
- model.setValue("/root/hidden/srchinfo/prcpflag", "");
- chk_sum_count = 0;
- }
- }
- chk_sum_count++;
-
- //퇴원 자동출력시 마감을 G로 해서 원래 L 값을 보내줘야함
- //model.setValue("/root/hidden/srchinfo/prcpflag", orgPrcpflag); //이훈재 막음. ( 옵션을 선택한 값임)
-
- if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("M") > -1 ){
- model.setValue("/root/hidden/srchinfo/prntkind", "M");
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("Z") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "Z");
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "M");
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "W");
- if ( model.getValue("/root/send/suminfo/intiflag") != "N" ){
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "L"); // 자동일때는 외출외박으로 처리하여 응급실 퇴원약 제외 20091027 이선경 수정 : 외출외박과 퇴원약은 따로 처리
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("G") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "G");
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "E");
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
-
- // 2011.02.08 pymi 제한항생제
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("B") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "B");
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
- // (e)
-
- // 임상
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("C2") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "C2");
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
-
- // 20120316_laboru_마약 단독 처방전 출력
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("S") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "S");
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
-
- // 20120416_laboru_인티팜 처방전 출력
- if (model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("T") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "T");
- model.makeValue("/root/send/sumlistinfo/intiflag", "N");
- fInSumList(); //마감시간별 미출력데이터 조회
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
-
- fPrcpMPSPrint("A", "mps"); //처방전출력
- }
- }
-
- }
-
- //라벨
- // 20101204 wify 경북대병원 큰라벨(본원) 추가
- //if ( model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("L") > -1 || model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("S") > -1 ){
- if ( model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("L") > -1 || model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("S") > -1 || model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("L1") > -1 ){
- model.setValue("/root/hidden/srchinfo/prntkind", "L");
- if (model.getValue("/root/hidden/srchinfo/autoyn") =="Y") {
- model.makeValue("/root/hidden/srchinfo/autolblyn", "Y");
- } else {
- model.makeValue("/root/hidden/srchinfo/autolblyn", "");
- }
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("Z") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "Z");
- fInSumList(); //마감시간별 미출력데이터 조회
-
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
- fPrcpMPSPrint("A", "lbl"); //라벨출력
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "M");
- fInSumList(); //마감시간별 미출력데이터 조회
-
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
- fPrcpMPSPrint("A", "lbl"); //라벨출력
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "W");
- fInSumList(); //마감시간별 미출력데이터 조회
-
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
- fPrcpMPSPrint("A", "lbl"); //라벨출력
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "L");
- fInSumList(); //마감시간별 미출력데이터 조회
-
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
- fPrcpMPSPrint("A", "lbl"); //라벨출력
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("G") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "G");
- fInSumList(); //마감시간별 미출력데이터 조회
-
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
- fPrcpMPSPrint("A", "lbl"); //라벨출력
- }
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "E");
- fInSumList(); //마감시간별 미출력데이터 조회
-
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
- fPrcpMPSPrint("A", "lbl"); //라벨출력
- }
- }
- // 2011.02.09 pymi
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("B") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "B");
- fInSumList(); //마감시간별 미출력데이터 조회
-
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
- fPrcpMPSPrint("A", "lbl"); //라벨출력
- }
- }
- //(e)
-
- // 임상
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("C2") >=0 ){
- model.setValue("/root/hidden/srchinfo/prcpflag", "C2");
- fInSumList(); //마감시간별 미출력데이터 조회
-
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- chk_prnt_count++;
- grd_sumlist.isSelected(i) = true;
- grd_sumlist.row = i;
-
- fPrntPatList(); //마감시간별 미출력환자데이터 조회
- fPrcpMPSPrint("A", "lbl"); //라벨출력
- }
- }
- }
-
-
- if (model.getValue("/root/hidden/srchinfo/autoatcyn") =="Y") {
- //ATC전송
- model.setValue("/root/send/atcinfo/drugdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
-
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") > -1 ) {
- model.setValue("/root/send/atcinfo/drugflag", "L");
- model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
- submit("TXADT10202"); //ATC Data 전송(배치호출)
- }
- if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") > -1 ) {
- model.setValue("/root/send/atcinfo/drugflag", "E");
- model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
- submit("TXADT10202"); //ATC Data 전송(배치호출)
- }
- //if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") == -1 && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") == -1 ){
- model.setValue("/root/send/atcinfo/drugflag", "I");
-
- model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
- submit("TXADT10202"); //ATC Data 전송(배치호출)
- //}
- }
- //gTimer = window.setInterval("fAutoPrnt()",11000);
- }
- function fSleep(numberMillis) {
- var now = new Date();
- var exitTime = now.getTime() + numberMillis;
- while (true) {
- now = new Date();
- if (now.getTime() > exitTime)
- return;
- }
- }
- /**
- * 투약번호 변경시
- */
- function fChgDrugno(flag) {
- var bResult = true;
- if(flag == "first"){
- var chk = model.getValue("/root/hidden/srchinfo/fst_drugno");
- if(chk == ""){
- model.setValue("/root/hidden/srchinfo/last_drugno", "");
- model.refresh();
- bResult = false;
- } else {
- if(isNaN(chk)){
- messageBox("투약번호는 숫자로","C001");
- model.setValue("/root/hidden/srchinfo/fst_drugno", "");
- model.refresh();
- bResult = false;
- }
- if(chk.length > 5){
- messageBox("투약번호는 5자리미만으로","C001");
- model.setValue("/root/hidden/srchinfo/fst_drugno", "");
- model.refresh();
- bResult = false;
- }
- }
- } else if(flag == "last"){
- var chk_fst = model.getValue("/root/hidden/srchinfo/fst_drugno");
- var chk_last = model.getValue("/root/hidden/srchinfo/fst_drugno");
- if(chk_fst == ""){
- messageBox("첫번째 투약번호부터","C001");
- model.setValue("/root/hidden/srchinfo/last_drugno", "");
- bResult = false;
- } else {
- if(isNaN(chk_fst)){
- messageBox("투약번호는 숫자로","C001");
- model.setValue("/root/hidden/srchinfo/fst_drugno", "");
- bResult = false;
- }
- if(chk_fst.length > 5 ){
- messageBox("투약번호는 5자리미만으로","C001");
- model.setValue("/root/hidden/srchinfo/fst_drugno", "");
- bResult = false;
- }
- if(isNaN(chk_last)){
- messageBox("투약번호는 숫자로","C001");
- model.setValue("/root/hidden/srchinfo/last_drugno", "");
- bResult = false;
- }
- if(chk_last.length > 5 ){
- messageBox("투약번호는 5자리미만으로","C001");
- model.setValue("/root/hidden/srchinfo/last_drugno", "");
- bResult = false;
- }
- }
- model.refresh();
- }
- return bResult;
- }
- function fErrMsg () {
- var errorMsgPath = "/root/properties/error";
- if ( model.getValue ( "/root/properties/error/type" ) == "error" ) {
- window.load("../../../com/commonweb/xrw/SPZZZ00100_시스템에러.xrw","modeless","","width:514px;height:198px;align:center;","/root/properties/error","/root/main");
- }
- }
- function fPatLblPrint() {
- submit("TRADT10215");
- var commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind")
- //프린터 포트명, 혹은 네트웍 공유 프린터 명
- if(commkind == "01") {
- CommAX1.PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
- }
-
- var iPoint=0;
- for(iPoint = 1; iPoint <= getNodesetCount("/root/temp/prntpat/prcpdrug") ; iPoint++){
- if(model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/pid") != "" ) {
- //////////////////////////////////////////////////
- // 라벨 상단내용 //
- /////////////////////////////////////////////////
- //병동
- model.setValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/wardnm" ,model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/wardnm") + " / " + model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/roomcd"));
- //환자번호
- model.setValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/pid", "등록번호:" + model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/pid") );
- //진료과
- model.setValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/orddeptnm" , model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/orddeptnm") + "/" + model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/medispclidnm") + "/" + model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/atdoctidnm") );
- //라벨출력일
- var lbldate = getCurrentDate();
- lbldate = lbldate.toDate().getDateFormat("YYYY/MM/DD") ;
- model.makeValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/lbldate" , lbldate);
- }
- }
-
- makeReportIViewer(0,0,10, 10, arguments[0]);
- fPrintRex("RFADT10310", "undefined", "undefined", "undefined", "undefined", "undefined", arguments[0]);
- }
- function makeReportIViewer(left, top, width, height, iViewerName){
- if(left==null || top==null || width==null || height==null){
- messageBox("미리보기 크기정보가", "I004");
- }else{
- if(iViewerName != null && iViewerName != ""){
- if(document.all("ivr_"+iViewerName) == null){
- if(document.all("grp_biz") == null){
- body.createChild("xforms:iviewer", "id:ivr_"+iViewerName+"; src:../../../com/commonweb/xrw/SPZUR00100_보고서.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
- "px;");
- }else{
- grp_biz.createChild("xforms:iviewer", "id:ivr_"+iViewerName+"; src:../../../com/commonweb/xrw/SPZUR00100_보고서.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
- "px;");
- }
- model.refresh();
- }
- }
- }
- }
- function fPrintRex(rexnm, closeYn, printCount, dataXPath, paramsXPath, infoXPath, parentId){
- var posx = '';
- var posy = '';
- var printnm = '';
-
- if(infoXPath == "" || infoXPath == "undefined" || infoXPath == null) infoXPath = "/root/main/barcdprntsetup/prntsetupinfo";
-
- if(model.getValue(infoXPath + "/setupinfo/rexgbn") != "1") return false;
- try{
- if(model.getXpathValue("count(" + infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/barnm)") > "0"){
- posx = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/xpos");
- posy = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/ypos");
- printnm = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/prtnm");
- }else{
- posx = model.getValue(infoXPath + "/setupinfo/blank/left");
- posy = model.getValue(infoXPath + "/setupinfo/blank/top");
- printnm = model.getValue(infoXPath + "/setupinfo/comm01/setupval");
- }
-
- if(posx == '') posx = "0";
- if(posy == '') posy = "0";
-
- if(closeYn == "true") printnm = "";
-
- exeRexPreview(rexnm, 'XMLSTR', paramsXPath, '', printnm,
- '', '', '', '', '',
- '', parentId, '', '', '',
- printCount, '', 'offsetx=' + posx + ';offsety=' + posy + ';', dataXPath, '',
- '');
- }
- catch(e){
- alert("출력시 오류가 발생하였습니다\n" + e);
- return true;
- }
-
- return true;
- }
- function exeRexPreview(rid, dataType, paramsXPath, submitId, print, printDialog, fileType, fileName, fileDialog, closeYn, monNo, parentObjId, printPaperBin, userService, showButton, printCount, zoomRate, printOption, dataXPath, mainDataXPath, subDataXPath)
- {
- var reportNode = instance1.selectSingleNode(gvReportPath);
-
- var syscd = getSystemCd();
- syscd = syscd.substr(3,3);
- //if(syscd == "888" || syscd == "999" || syscd == "") syscd = "001";
- if(syscd == "") syscd = "001";
- //레포트 관련 내용 초기화
- if(reportNode != null){
- model.removeNodeset(gvReportPath);
- }
-
- model.makeNode(gvReportPath);
- model.makeNode(gvReportParamsPath);
- model.makeNode(gvReportPropsPath);
- model.makeNode(gvReportOptionsPath);
- paramsXPath = instance1.selectSingleNode(paramsXPath);
- if(paramsXPath != null){
- model.copyNode(gvReportParamsPath, paramsXPath);
- }
- model.makeValue(gvReportParamsPath+"/userid", getUserId());
- model.makeValue(gvReportParamsPath+"/logoimgurl", getImageURL("error_logo"+getLogoImageKey()));
- model.makeValue(gvReportParamsPath+"/url", rid);
- model.makeValue(gvReportPropsPath+"/rex_rptname", rid);
- model.makeValue(gvReportPropsPath+"/rex_datatype", dataType);
- model.makeValue(gvReportPropsPath+"/rex_submitid", submitId);
- model.makeValue(gvReportPropsPath+"/rex_userservice", userService);
- model.makeValue(gvReportPropsPath+"/rex_data_xpath", dataXPath);
- model.makeValue(gvReportPropsPath+"/rex_xpath", mainDataXPath);
- model.makeValue(gvReportPropsPath+"/rex_xpath1", subDataXPath);
- model.makeValue(gvReportOptionsPath+"/rex_print", print);
- model.makeValue(gvReportOptionsPath+"/rex_printdialog", printDialog);
- model.makeValue(gvReportOptionsPath+"/rex_printpaperbin", printPaperBin);
- model.makeValue(gvReportOptionsPath+"/rex_filetype", fileType);
- model.makeValue(gvReportOptionsPath+"/rex_filename", fileName);
- model.makeValue(gvReportOptionsPath+"/rex_filedialog", fileDialog);
- model.makeValue(gvReportOptionsPath+"/rex_close", closeYn);
- model.makeValue(gvReportOptionsPath+"/rex_showbutton", showButton);
- model.makeValue(gvReportOptionsPath+"/rex_printcount", printCount);
- model.makeValue(gvReportOptionsPath+"/rex_zoomrate", zoomRate);
- model.makeValue(gvReportOptionsPath+"/rex_printoption", printOption);
-
- if(parentObjId == null || parentObjId == ""){
- if(document.all("ivr_report") == null){
- //popup
- setParameter("onready","true");
- modal("SPZUR00100", monNo);
- }else{
- //iviewer
- ivr_report.window.javascript.fInitRexpert();
- }
- }else{
- var parentObj = document.all("ivr_"+parentObjId);
- if(parentObj != null){
- var childObj = document.all("ivr_"+parentObjId);
-
- if(childObj != null){
- gCurrPrtObj = "ivr_"+parentObjId; //삭제할 viewer를 현재 출력 obj변수에 설정하고.. 프린트 끝난후 현재변수의 Iviewer를 삭제
- childObj.window.javascript.fInitRexpert();
- }
- }
- }
- }
- /**
- 생성된 IViewer삭제
- **/
- function cleanIViewer() {
- if (arguments[0] == "undefined" || arguments[0] == undefined) { //파라미터가 없으면 현재 gCurrPrtObj변수로 IViewer를 삭제하고
- var o = document.all("ivr_"+gCurrPrtObj);
- if (o != null) {
- body.removeChild("ivr_"+gCurrPrtObj);
- }
- } else { //파라미터가 존재하면 파라미터 배열의 IViewer를 삭제함
- if (arguments[0].indexOf("|") != -1)
- return;
-
- var arr = arguments[0].split("|");
- for (var i in arr) {
- var o = document.all("ivr_"+arr[i]);
- if (o != null) {
- body.removeChild("ivr_"+arr[i]);
- }
- }
- }
- gCurrPrtObj = null;
- }
|