12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211 |
- /*
- * 입원등록 공통 함수
- * PMI001.js
- * 작성자 : 최병진
- * 작성일 : 2008.12.10
- * 수정이력 : PMC001.js 파일로 함수 이동
- pmifGetNhicQualification -> pmcfGetNhicQualification로 변경
- 2009.05.21 - 바코드 출력 기능 신규 모듈로 교체에 따라 PAM.js에서 여기로 이전(기존 함수는 PAM.js에 그대로 존재)
- */
- /*
- 22 11 11
- 32 차상위1종
- 00 00 33 A 차상위2종 정상
- 02 02 34 O 차상위2종 정상(인공신장투석)
- 03 03 35 O 차상위2종 정상(복막관류술)
- 04 04 36 O 차상위2종 정상(장기이식)
- 10 10 37 O 차상위2종 정상(가정간호)
- 11 11 38 O 차상위2종 정상(가정간호등록암)
- 05 05 39 I 차상위2종 개심,개두
- 06 06 40 A 차상위2종 등록암
- 07 07 45 O 차상위2종 산정특례
- 08 08 41 I 차상위2종 입원6세미만
- 09 09 42 I 차상위2종 자연분만
- 14 00 43 I 차상위2종 정신과입원진료
- 17 00 44 A 차상위2종 만성질환
- */
- /* 차상위2종 보조유형 셋팅
- * 전제조건 : 보험유형은 이 함수로 밖에서 변경 한다.
- * Parameter : pBeForeInsuKind - 변경전 보험유형
- * pBeforeSuppKind - 변경전 유형보조
- * pAfterInsuKind - 변경후 보험유형
- * pScndSupTrgtman - 차상위구분(1:차상위1종, 2:차상위2종)
- * pOrdDeptCd - 진료과코드
- * pChronicDiseaseYn - 만성질환여부
- * Return : suppkind - String
- */
- function pmifGetScndSuptrgtSuppkind(pBeForeInsuKind, pBeforeSuppKind, pAfterInsuKind, pScndSupTrgtman, pOrdDeptCd, pChronicDiseaseYn) {
- var log = "pBeForeInsuKind : " + pBeForeInsuKind + "\n" +
- "pBeforeSuppKind : " + pBeforeSuppKind + "\n" +
- "pAfterInsuKind : " + pAfterInsuKind + "\n" +
- "pScndSupTrgtman : " + pScndSupTrgtman + "\n" +
- "pOrdDeptCd : " + pOrdDeptCd + "\n" +
- "pChronicDiseaseYn : " + pChronicDiseaseYn;
- // alert ("log : " + log);
- var sNPcd = "2030000000"; // 정신과
- var result = pBeforeSuppKind; // 최초에는 현재의 보조유형을 설정해 놓는다.
- // 차상위1종
- if (pScndSupTrgtman == "1") {
- if(pAfterInsuKind == "11") {
- result = "32";
- }
- } else if (pScndSupTrgtman == "2") { // 차상위2종
- // 건강보험이고, 보조유형이 차상위2종의 보조유형이 아닐 때
- if(pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) < 32) {
- if (pBeforeSuppKind == "00") { result = "33"; }
- else if (pBeforeSuppKind == "01") { result = "01"; }
- else if (pBeforeSuppKind == "02") { result = "33"; }
- else if (pBeforeSuppKind == "03") { result = "33"; }
- else if (pBeforeSuppKind == "04") { result = "33"; }
- else if (pBeforeSuppKind == "10") { result = "33"; }
- else if (pBeforeSuppKind == "11") { result = "33"; }
- else if (pBeforeSuppKind == "05") { result = "39"; }
- else if (pBeforeSuppKind == "06") { result = "40"; }
- else if (pBeforeSuppKind == "07") { result = "33"; }
- else if (pBeforeSuppKind == "08") { result = "41"; }
- else if (pBeforeSuppKind == "09") { result = "42"; }
- else if (pBeforeSuppKind == "14") { result = "33"; }
- else if (pBeforeSuppKind == "17" && pChronicDiseaseYn == "Y") { result = "44"; }
- else if (pBeforeSuppKind == "17" && pChronicDiseaseYn != "Y") { result = "33"; }
- else {
- messageBox("파라미터 값이 올바르지 않습니다[1]!!");
- }
- }
- /*
- // 의료급여1종 -> 차상위2종, 보조유형이 차상위2종의 보조유형이 아닐 때
- if(pBeForeInsuKind == "21" && pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) < 32) {
- if (pBeforeSuppKind == "00" && pOrdDeptCd != sNPcd) { result = "33"; }
- else if (pBeforeSuppKind == "01") { result = "01"; }
- else if (pBeforeSuppKind == "02") { result = "33"; }
- else if (pBeforeSuppKind == "03") { result = "33"; }
- else if (pBeforeSuppKind == "04") { result = "33"; }
- else if (pBeforeSuppKind == "10") { result = "33"; }
- else if (pBeforeSuppKind == "11") { result = "33"; }
- else if (pBeforeSuppKind == "05") { result = "39"; }
- else if (pBeforeSuppKind == "06") { result = "40"; }
- else if (pBeforeSuppKind == "08") { result = "41"; }
- else if (pBeforeSuppKind == "09") { result = "42"; }
- else if (pBeforeSuppKind == "14" && pOrdDeptCd == sNPcd) { result = "43"; }
- else if (pBeforeSuppKind == "17" && pChronicDiseaseYn == "Y") { result = "44"; }
- else {
- messageBox("파라미터 값이 올바르지 않습니다[1]!!");
- }
- }
- // 의료급여2종 -> 차상위2종, 보조유형이 차상위2종의 보조유형이 아닐 때
- if(pBeForeInsuKind == "22" && pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) < 32) {
- if (pBeforeSuppKind == "00" && pOrdDeptCd != sNPcd) { result = "33"; }
- else if (pBeforeSuppKind == "01") { result = "01"; }
- else if (pBeforeSuppKind == "02") { result = "33"; }
- else if (pBeforeSuppKind == "03") { result = "33"; }
- else if (pBeforeSuppKind == "04") { result = "33"; }
- else if (pBeforeSuppKind == "10") { result = "33"; }
- else if (pBeforeSuppKind == "11") { result = "33"; }
- else if (pBeforeSuppKind == "05") { result = "39"; }
- else if (pBeforeSuppKind == "06") { result = "40"; }
- else if (pBeforeSuppKind == "08") { result = "41"; }
- else if (pBeforeSuppKind == "09") { result = "42"; }
- else if (pBeforeSuppKind == "14" && pOrdDeptCd == sNPcd) { result = "43"; }
- else if (pBeforeSuppKind == "17" && pChronicDiseaseYn == "Y") { result = "44"; }
- else {
- messageBox("파라미터 값이 올바르지 않습니다[1]!!");
- }
- }
- */
- } else {
- // 건강보험이고 차상위1종이 아닐 때
- if(pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) == 32) {
- result = "00";
- }
- /*
- // 의료급여1종이고 차상위1종이 아닐 때
- if(pBeForeInsuKind == "11" && pAfterInsuKind == "21" && parseInt(pBeforeSuppKind) == 32) {
- result = "00";
- }
- // 의료급여2종이고 차상위1종이 아닐 때
- if(pBeForeInsuKind == "11" && pAfterInsuKind == "22" && parseInt(pBeforeSuppKind) == 32) {
- result = "00";
- }
- */
- // 건강보험이고 차상위2종이 아닐 때
- // if(pBeForeInsuKind == "11" && pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) > 32) {
- if(pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) > 32) {
- if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "01") { result = "01"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "39") { result = "05"; }
- else if (pBeforeSuppKind == "40") { result = "06"; }
- else if (pBeforeSuppKind == "41") { result = "08"; }
- else if (pBeforeSuppKind == "42") { result = "09"; }
- else if (pBeforeSuppKind == "43") { result = "00"; }
- else if (pBeforeSuppKind == "44") { result = "00"; }
- else if (pBeforeSuppKind == "45") { result = "00"; }
- else {
- messageBox("파라미터 값이 올바르지 않습니다[2]!!");
- }
- }
- // 의료급여1종이고 차상위2종이 아닐 때
- // if(pBeForeInsuKind == "11" && pAfterInsuKind == "21" && parseInt(pBeforeSuppKind) > 32) {
- if(pAfterInsuKind == "21" && parseInt(pBeforeSuppKind) > 32) {
- if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "01") { result = "01"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "39") { result = "05"; }
- else if (pBeforeSuppKind == "40") { result = "06"; }
- else if (pBeforeSuppKind == "41") { result = "08"; }
- else if (pBeforeSuppKind == "42") { result = "09"; }
- else if (pBeforeSuppKind == "43" && pOrdDeptCd == sNPcd) { result = "14"; }
- else if (pBeforeSuppKind == "43" && pOrdDeptCd != sNPcd) { result = "00"; }
- else if (pBeforeSuppKind == "44" && pChronicDiseaseYn == "Y") { result = "17"; }
- else if (pBeforeSuppKind == "44" && pChronicDiseaseYn != "Y") { result = "00"; }
- else if (pBeforeSuppKind == "45") { result = "00"; }
- else {
- messageBox("파라미터 값이 올바르지 않습니다[2]!!");
- }
- }
- // 의료급여2종이고 차상위2종이 아닐 때
- // if(pBeForeInsuKind == "11" && pAfterInsuKind == "22" && parseInt(pBeforeSuppKind) > 32) {
- if(pAfterInsuKind == "22" && parseInt(pBeforeSuppKind) > 32) {
- if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "01") { result = "01"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "33") { result = "00"; }
- else if (pBeforeSuppKind == "39") { result = "05"; }
- else if (pBeforeSuppKind == "40") { result = "06"; }
- else if (pBeforeSuppKind == "41") { result = "08"; }
- else if (pBeforeSuppKind == "42") { result = "09"; }
- else if (pBeforeSuppKind == "43" && pOrdDeptCd == sNPcd) { result = "14"; }
- else if (pBeforeSuppKind == "43" && pOrdDeptCd != sNPcd) { result = "00"; }
- else if (pBeforeSuppKind == "44" && pChronicDiseaseYn == "Y") { result = "17"; }
- else if (pBeforeSuppKind == "44" && pChronicDiseaseYn != "Y") { result = "00"; }
- else if (pBeforeSuppKind == "45") { result = "00"; }
- else {
- messageBox("파라미터 값이 올바르지 않습니다[2]!!");
- }
- }
- }
- return result;
- }
- /*
- * 바코드 출력 함수
- * DSC, ER간호에서도 사용
- * 최초작성일 : 2009.05.21
- * 삭제된 파라미터 : pPort - COM Port 지정값
- * 추가된 파라미터 : pSetyn - 프린터설정정보 셋팅여부
- * pScrid - 프린터설정정보 조회용 화면 아이디
- * pBarcdRef - 설정정보 xpath -> 구형 / 신형프린터 구분자로 사용
- * 수정이력 : 2009.05.30 - 병실코드 출력 (파라미터로 출력여부를 받음)
- * 2009.06.01 - pRoomyn 파라미터 사용없이 쿼리에서 원무공통코드를 체크하여 출력여부결정
- * - 향후 간호와 원무의 출력여부가 달라질 수 있으므로 기능은 주석처리
- */
- function pmifPrintBarCode(pPid, pIndd, pCretno, pMskind, pHiststat, pSetyn, pScrid, pBarcdRef, pRoomyn, pIsNEW, pErvisityn, pTest) {
- // 1. 공통[시작] - 2009.05.25
- model.removeNodeset("/root/hidden/h_receipt/receipt");
- model.removeNodeset("/root/send/data17");
- model.makeNode("/root/hidden/h_receipt/receipt/pid");
- model.makeNode("/root/hidden/h_receipt/receipt/hngnm");
- model.makeNode("/root/hidden/h_receipt/receipt/hngnm2");
- model.makeNode("/root/hidden/h_receipt/receipt/sex");
- model.makeNode("/root/hidden/h_receipt/receipt/age");
- model.makeNode("/root/hidden/h_receipt/receipt/religncd");
- model.makeNode("/root/hidden/h_receipt/receipt/rrgstno");
- model.makeNode("/root/hidden/h_receipt/receipt/orddeptcd");
- model.makeNode("/root/hidden/h_receipt/receipt/orddeptnm");
- model.makeNode("/root/hidden/h_receipt/receipt/specordyn");
- model.makeNode("/root/hidden/h_receipt/receipt/medispclid");
- model.makeNode("/root/hidden/h_receipt/receipt/wardcd");
- model.makeNode("/root/hidden/h_receipt/receipt/wardcd2");
- model.makeNode("/root/hidden/h_receipt/receipt/roomcd");
- model.makeNode("/root/hidden/h_receipt/receipt/indd");
- model.makeNode("/root/hidden/h_receipt/receipt/barcode");
- model.makeNode("/root/hidden/h_receipt/receipt/newprintflag");
- model.makeNode("/root/hidden/h_receipt/receipt/btype");
-
- model.makeNode("/root/hidden/h_receipt/receipt/rfidyn");
- model.makeNode("/root/hidden/h_receipt/receipt/rfidcardid1");
- model.makeNode("/root/hidden/h_receipt/receipt/deptplce");
-
- model.makeValue("/root/send/data17/pid", pPid);
- model.makeValue("/root/send/data17/indd", pIndd);
- model.makeValue("/root/send/data17/cretno", pCretno);
- model.makeValue("/root/send/data17/mskind", pMskind);
- model.makeValue("/root/send/data17/histstat", pHiststat);
- model.makeValue("/root/send/data17/ioflag", "");
- model.makeValue("/root/send/data17/ervisityn", pErvisityn);
- model.makeValue("/root/send/data17/ipaddr", app.clientIp);
- submit("TRPMI00115");
- if (pRoomyn == undefined || pRoomyn == null) {
- pRoomyn = "N";
- }
- // OCX 버전 로딩 구분
- if (pIsNEW == undefined || pIsNEW == null) {
- pIsNEW = "";
- } else {
- pIsNEW = "NEW"
- }
-
- var inpt_pid = model.getValue("/root/hidden/h_receipt/receipt/pid");
- var rfidyn = model.getValue("/root/hidden/h_receipt/receipt/rfidyn");
-
- if (inpt_pid == null || inpt_pid == " " || inpt_pid == "") {
- messageBox("입원 환자가 아닙니다.! 환자 팔찌를 발행할 수 없습니다.","E999","");
- return false;
-
- // // RFID 출력 시
- // } else if (rfidyn == 'Y') {
- //
- // var hngnm2 = model.getValue("/root/hidden/h_receipt/receipt/hngnm2");
- //
- // var btype = model.getValue("/root/hidden/h_receipt/receipt/btype");
- //
- // //경북대 병원 성별표시 한글로 바꿈
- // var sex = model.getValue("/root/hidden/h_receipt/receipt/sex");
- // if( sex == 'M' ){
- // sex = '남';
- // }else{
- // sex = '여';
- // }
- //
- // var age = model.getValue("/root/hidden/h_receipt/receipt/age") + "세";
- //
- // var rrgstno = model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(0,2) + "."
- // + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(2,2) + "."
- // + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(4,2);
- //
- // var wardcd = model.getValue("/root/hidden/h_receipt/receipt/wardcd");
- //
- // var roomcd = model.getValue("/root/hidden/h_receipt/receipt/roomcd");
- //
- // var deptplce = model.getValue("/root/hidden/h_receipt/receipt/deptplce");
- //
- // var cardid1 = model.getValue("/root/hidden/h_receipt/receipt/rfidcardid1");
- //
- // var param = inpt_pid + "|" + hngnm2 + "|" + btype + "|" + sex + "|" + age + "|" + rrgstno + "|" + wardcd + " " + roomcd + "호 (" + deptplce + ")|" + cardid1;
- //
- // //alert(param);
- //
- // try{
- //
- // // 1. RFID 출력
- // var activeObj = new ActiveXObject("WScript.Shell");
- // activeObj.CurrentDirectory = "C:/Program Files/himed/components/OneTech";
- // var fileName = "RfidLabelPrt.exe " + param;
- // activeObj.Run(fileName);
- //
- // // 2. RFID 데이터 저장
- // model.makeValue("/root/send/data60/pid", inpt_pid);
- // model.makeValue("/root/send/data60/usernm", hngnm2);
- // model.makeValue("/root/send/data60/gubun", "P");
- // model.makeValue("/root/send/data60/cardid1", cardid1);
- // model.makeValue("/root/send/data60/indd", model.getValue("/root/hidden/h_receipt/receipt/indd"));
- //
- // submit("TXPMC06606");
- //
- // }catch(e){
- //
- // alert("RFID 카드 등록오류입니다. \r\n동일현상 반복 시 전산실로 문의하십시오.");
- // }
- //
- // return;
-
- // 기존 환자팔찌 출력 시
- } else {
- // var sRrgstno = model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(0,6) + "-"
- // + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(6,1) + "******";
- var sRrgstno = model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(0,2) + "."
- + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(2,2) + "."
- + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(4,2);
- model.setValue("/root/hidden/h_receipt/receipt/rrgstno",sRrgstno);
- //경북대 병원 성별표시 한글로 바꿈
- var sSex = model.getValue("/root/hidden/h_receipt/receipt/sex");
- if( sSex == 'M' ){
- sSex = '남';
- }else{
- sSex = '여';
- }
- model.setValue("/root/hidden/h_receipt/receipt/sex", sSex);
-
- // 전실신청정보 있을 경우에는 전실대상 병동을 표시
- var inptWard = model.getValue("/root/hidden/h_receipt/receipt/wardcd");
- var cdcrWard = model.getValue("/root/hidden/h_receipt/receipt/wardcd2");
-
- if (inptWard != cdcrWard && cdcrWard != null && cdcrWard != '') {
- model.setValue("/root/hidden/h_receipt/receipt/wardcd", cdcrWard);
- }
- var sIndd = model.getValue("/root/hidden/h_receipt/receipt/indd");
- sIndd = sIndd.substr(0, 4) + "-" + sIndd.substr(4,2) + "-" + sIndd.substr(6,2);
- model.setValue("/root/hidden/h_receipt/receipt/indd", sIndd);
-
- //2010-09-14 이동식 추가 - 경북대병원 환자팔지 렉스포트로 출력
- //2008.10.14 Rexpert 출력전 클리어 - 최병진
- //childObj.window.javascript.fCloseReport();
- //var sPrinter;
- //var trayno;
-
- // 2009.06.19 - local에 설정된 파일을 우선시 한다.
- // print1:입원약정서, print2:입원환자카드, print3:선택신청, print4:환자팔찌
- /*
- var printInfo = pmifGetPrintSetting("print4");
- if (printInfo.length == 2) {
- sPrinter = printInfo[0];
- trayno = printInfo[1];
- } else {
- // 2008.09.21 입원약정서 출력용 프린터 이름 조회 - 최병진
- sPrinter = model.getValue("/root/hidden/printers/card_printer");
- if (isNull(sPrinter)) {
- sPrinter = "true";
- }
- // 2009년 03월 20일, JHP, 트레이정보를 받아서 넣는다.
- trayno = model.getValue("/root/hidden/pam/printer/value");
- }
- */
-
- //공통코드 P0045에서 프린터 명칭과 트레이 호출 - 입원환자팔찌 프린터
- fGetPrintName();
-
- // 프린터정보
- var print_name = "";
-
- // 트레이정보
- var print_tray = "";
-
- var resultFlag = "";
-
- // // 신형팔찌는 소아체크 없음
- // if (pBarcdRef == 'N') {
- //
- // print_name = getGlobalVariable("SPPAO00100_P0045_12_nm","p"); // SLP-T400
- // print_tray = getGlobalVariable("SPPAO00100_P0045_12_tray","p");
- //
- // // 기존팔찌
- // } else {
-
- // 6세미만 체크
- if (model.getValue("/root/hidden/h_receipt/receipt/age") < 6) {
-
- resultFlag = messageBox("6세미만 환자입니다!!! \r\n\r\n소아용팔찌를 출력", "S006", "\r\n성인용팔찌를 출력|\r\n출력을 취소");
-
- // 취소한 경우
- if (resultFlag == "2") {
- return;
- }
- }
-
- // 환자팔찌 설정 값(참고용) 변경시 SPPAO00100 수정필요
- // P0045_8 : HC100 구형 프린터(성인용)
- // P0045_11 : HC101 구형 프린터(소아용)
- // P0045_12 : SLP-T400 신형 프린터(성인용)
- // P0045_13 : SLP-T400 신형 프린터(소아용)
- // model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "Y" : 성인 신형 / 소아 신형
- // model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "A" : 성인 신형 / 소아 구형
- // model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "B" : 성인 구형 / 소아 신형
- // model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "N" : 성인 구형 / 소아 구형
-
- // 출력PC별 장비가 달라 IP로 해당 장비 구분하도록 수정(원무공통코드 PK060) by 조중래 20140404
-
- // 소아용
- if (resultFlag == "6") {
-
- // 신형 프린터 설정
- if (model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "Y" || model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "B") {
- print_name = getGlobalVariable("SPPAO00100_P0045_13_nm", "p"); // SLP-T401
- print_tray = getGlobalVariable("SPPAO00100_P0045_13_tray", "p");
-
- // 구형 프린터 설정
- } else {
- print_name = getGlobalVariable("SPPAO00100_P0045_11_nm", "p"); // HC101
- print_tray = getGlobalVariable("SPPAO00100_P0045_11_tray", "p");
- }
-
- model.makeValue("/root/hidden/h_receipt/receipt/babyyn", "Y"); // 소아용
-
- // 성인용
- } else {
-
- // 신형 프린터 설정
- if (model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "Y" || model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "A") {
- print_name = getGlobalVariable("SPPAO00100_P0045_12_nm", "p"); // SLP-T400
- print_tray = getGlobalVariable("SPPAO00100_P0045_12_tray", "p");
-
- // 구형 프린터 설정
- } else {
- print_name = getGlobalVariable("SPPAO00100_P0045_8_nm", "p"); // HC100
- print_tray = getGlobalVariable("SPPAO00100_P0045_8_tray", "p");
- }
-
- model.makeValue("/root/hidden/h_receipt/receipt/babyyn", "N"); // 성인용
- }
- // }
- // 호출끝
-
- // 프린터 드라이버 종류에 따라서 렉스퍼트 동적으로 호출(용지가 다르기때문임)
- // HC-100 : 구형팔찌(성인용) - Zebra 제품
- // HC-101 : 구형팔찌(소아용) - Zebra 제품
- // SLP-T400 : 신형팔찌(성인용) - Bixolon 제품
- // SLP-T401 : 신형팔찌(소아용) - Bixolon 제품
-
- //alert(pTest);
-
- // 신형팔찌용 렉스퍼트
- if (print_name == 'SLP-T400' || print_name == 'SLP-T401') {
-
- if(pTest == 'Y')
- {
- //alert("333");
- exeReportPreview("RPPMI03203", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
- }
- else
- {
- //alert("444");
- exeReportPreview("RPPMI03202", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
-
- if (rfidyn == "Y") {
- // RFID 데이터 저장
- model.makeValue("/root/send/data60/pid", inpt_pid);
- model.makeValue("/root/send/data60/usernm", model.getValue("/root/hidden/h_receipt/receipt/hngnm2"));
- model.makeValue("/root/send/data60/gubun", "P");
- model.makeValue("/root/send/data60/cardid1", model.getValue("/root/hidden/h_receipt/receipt/rfidcardid1"));
- model.makeValue("/root/send/data60/indd", pIndd);
-
- submit("TXPMC06606");
- }
- }
-
-
- // 기존팔찌용 렉스퍼트
- } else {
- exeReportPreview("RPPMI03201", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
- }
-
-
- //2010-09-14 이동식 주석처리 - 기존 바코드 출력 로직 주석처리
- // 1. 공통[끝] - 2009.05.25
- /*
- // 출력을 위한 변수 선언
- var sPid = model.getValue("/root/hidden/h_receipt/receipt/pid");
- var sHngnm = model.getValue("/root/hidden/h_receipt/receipt/hngnm");
- var sSex = model.getValue("/root/hidden/h_receipt/receipt/sex");
- var sAge = model.getValue("/root/hidden/h_receipt/receipt/age");
- var sRoomcd = model.getValue("/root/hidden/h_receipt/receipt/roomcd");
-
-
- var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
- var sSndMsg = "";
- var portOpenTF = ""; // 포트연결 성공여부
- var esc = String.fromCharCode(27);
- var sPrntKind = "1";
- var sCommKind = "02";
- var sCommPort = "1";
- var sDataBit = "8";
- var sStopBit = "1";
- var sBaudRate = "9600";
- var sParity = "n";
- var iLeft = 0;
- var iTop = 0;
- if (pSetyn == "Y") {
- fGetBarCodeInfo(pScrid); //입원등록 기본
- sPrntKind = model.getvalue(barcdRef + "/prntkind");
- sCommKind = model.getValue(barcdRef + "/commkind");
- iLeft = model.getValue(barcdRef + "/blank/left");
- iTop = model.getValue(barcdRef + "/blank/top");
- sCommPort = model.getvalue(barcdRef + "/comm02/comm");
- sDataBit = model.getvalue(barcdRef + "/comm02/databit");
- sStopBit = model.getvalue(barcdRef + "/comm02/stopbit");
- sBaudRate = model.getvalue(barcdRef + "/comm02/baudrate");
- sParity = model.getvalue(barcdRef + "/comm02/parity");
- if(iLeft == "" || iLeft == "-"){
- iLeft = 0;
- }
- if(iTop == "" || iTop == "-"){
- iTop = 0;
- }
- // 2008.07.02 모듈 로딩
- if (!body.isChild("CommAX")) {
- lzzfMakeBrcdPrntObjHanDo("CommAX", barcdRef, pIsNEW); // 로직안에 셋팅로직이 포함되어 있음
- }
- } else {
- sPrntKind = model.getvalue(pBarcdRef + "/prntkind");
- sCommKind = model.getValue(pBarcdRef + "/commkind");
- iLeft = model.getValue(pBarcdRef + "/blank/left");
- iTop = model.getValue(pBarcdRef + "/blank/top");;
- sCommPort = model.getvalue(pBarcdRef + "/comm02/comm");
- sDataBit = model.getvalue(pBarcdRef + "/comm02/databit");
- sStopBit = model.getvalue(pBarcdRef + "/comm02/stopbit");
- sBaudRate = model.getvalue(pBarcdRef + "/comm02/baudrate");
- sParity = model.getvalue(pBarcdRef + "/comm02/parity");
- }
- if(sCommKind == "02") {
- if (pIsNEW != "NEW") {
- portOpenTF = CommAX.PortOpen("true");
- }
- }
-
- // 프린터 종류별 출력
- // 1. SATO
- if(sPrntKind == "2" || sPrntKind == "6" || sPrntKind == "7") {
- // 시작위치 셋팅 (A1aaaabbbb:출력 용지 규격(aaaa:세로크기_최대 2848, bbbb:가로크기_최대 832))
- sSndMsg += esc + "A" + esc + "A103000500";
- sSndMsg += esc + "V" + (parseInt(iTop)+20) + esc + "H" + (parseInt(iLeft)+40) + esc + "BG" + "02" + "040" + sPid;
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+25 , parseInt(iLeft)+360 , sSex + "/" + sAge, 1, 1);
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+65 , parseInt(iLeft)+40 , sHngnm, 1, 2);
- // 2009.06.01 - pRoomyn 조건 주석처리
- //if (pRoomyn == "Y") {
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+65 , parseInt(iLeft)+340 , sRoomcd, 1, 1);
- //}
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+115 , parseInt(iLeft)+40 , sPid, 1, 1);
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+145 , parseInt(iLeft)+40 , sRrgstno, 1, 1);
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+115 , parseInt(iLeft)+280 , sIndd, 1, 1);
- sSndMsg += esc + "Q1" + esc + "Z";
- CommAX.SendMsg(sSndMsg);
- CommAX.PortOpen("false");
- } else { // Zebra
- if (model.getValue("/root/main/barcdprntsetup/macaddr") == "DEFAULT" || model.getValue("/root/main/barcdprntsetup/macaddr") == "") {
-
- lzzfMakeBrcdPrntObjHanDo("CommAX", "", pIsNEW);
- if (pIsNEW != "NEW") {
- CommAX.CommPort = "1";
- CommAX.Settings = "9600,n,8,1";
- }
- } else {
- if (pIsNEW != "NEW") {
- CommAX.CommPort = sCommPort;
- CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
- }
- }
- if (pIsNEW != "NEW") {
- portOpenTF = CommAX.PortOpen("true");
- }
-
- if (pIsNEW != "NEW") {
- if(portOpenTF == "TRUE") {
- // 2008.07.31 - 주민번호 라인 변경
-
- sSndMsg += "^XA^LH" + (parseInt(iLeft) + 20) + "," + (parseInt(iTop) + 20); // 출력시작
- sSndMsg += "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 05) + "^BC400,40,N,N,N^FD" + sPid + "^FS"; // 바코드(등록번호)
- sSndMsg += "^CFE40,40" + "^FO" + (parseInt(iLeft) + 340) + "," + (parseInt(iTop) + 10) + "^FD" + sSex + "/" + sAge + "^FS"; // 성별,나이
- sSndMsg += CommAX.PrtImgOut(parseInt(iLeft) + 10, parseInt(iTop) + 50, sHngnm, 1, 2); // 환자명 - 가로시작위치, 세로시작위치, 출력할문자열, 1,1 (비율:X, Y)
- sSndMsg += CommAX.HanImageData();
- // 2009.06.01 - pRoomyn 조건 주석처리
- //if (pRoomyn == "Y") {
- sSndMsg += "^CFE18,18" + "^FO" + (parseInt(iLeft) + 300) + "," + (parseInt(iTop) + 50) + "^FD" + sRoomcd + "^FS";
- //}
- sSndMsg += "^CFE18,18" + "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 100) + "^FD" + sPid + "^FS"; // 등록번호
- sSndMsg += "^CFE30,30" + "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 130) + "^FD" + sRrgstno + "^FS"; // 주민번호
- sSndMsg += "^CFA30,30" + "^FO" + (parseInt(iLeft) + 235) + "," + (parseInt(iTop) + 100) + "^FD" + sIndd + "^FS"; // 입원일자
- sSndMsg += "^PQ1"; // 출력매수
- sSndMsg += "^XZ";
-
- CommAX.SendMessage(sSndMsg); // 출력
-
- CommAX.PortOpen("false"); // 출력종료
-
- } else {
- messageBox("아래 사항을 확인후 재출력해주십시오."
- + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
- + " \n 2.케이블 확인"
- + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
- return;
- }
- } else {
- sSndMsg += "^XA^LH" + (parseInt(iLeft) + 20) + "," + (parseInt(iTop) + 20); // 출력시작
- sSndMsg += "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 05) + "^BC400,40,N,N,N^FD" + sPid + "^FS"; // 바코드(등록번호)
- sSndMsg += "^CFE40,40" + "^FO" + (parseInt(iLeft) + 340) + "," + (parseInt(iTop) + 10) + "^FD" + sSex + "/" + sAge + "^FS"; // 성별,나이
- sSndMsg += CommAX.PrtImgOut(parseInt(iLeft) + 10, parseInt(iTop) + 50, sHngnm, 1, 2); // 환자명 - 가로시작위치, 세로시작위치, 출력할문자열, 1,1 (비율:X, Y)
- sSndMsg += CommAX.HanImageData();
- // 2009.06.01 - pRoomyn 조건 주석처리
- //if (pRoomyn == "Y") {
- sSndMsg += "^CFE18,18" + "^FO" + (parseInt(iLeft) + 300) + "," + (parseInt(iTop) + 50) + "^FD" + sRoomcd + "^FS";
- //}
- sSndMsg += "^CFE18,18" + "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 100) + "^FD" + sPid + "^FS"; // 등록번호
- sSndMsg += "^CFE30,30" + "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 130) + "^FD" + sRrgstno + "^FS"; // 주민번호
- sSndMsg += "^CFA30,30" + "^FO" + (parseInt(iLeft) + 235) + "," + (parseInt(iTop) + 100) + "^FD" + sIndd + "^FS"; // 입원일자
- sSndMsg += "^PQ1"; // 출력매수
- sSndMsg += "^XZ";
-
- CommAX.SendMsg(sSndMsg); // 출력
-
- }
- }
- */
- }
- }
- //maxaddr없는 일반적인 경우, 서버에서 mac를 받아옴
- function fGetBarCodeInfo(scrnid){
- model.resetInstanceNode("/root/send/reqdata");
- model.makeValue("/root/send/scrnid", scrnid);
- submit("TRLLC90101");
- }
- //각종 약정서 및 카드발급등 원격으로 출력할시 프린터 세팅
- /////////////////사용안함//////////////////////////////////
- function pmifGetPrintSetting(pPrint) {
- /*
- 파라미터정의
- pPrint : print1 - 입원약정서
- print2 - 입원환자카드
- print3 - 선택신청
- print4 - 환자카드발행
- C:\\cmcnuprinter\\printersetting.ini 파일 존재해야하며 내용은 아래와 같음
- ex1)
- [printers]
- print1=\\10.20.73.57\aficio2022 --입원약정서
- print2=\\10.20.73.57\aficio2022 --입원환자카드
- print3=\\10.20.73.57\aficio2022 --선택신청
- print4=Zebra P330i Card Printer USB --환자카드발행
- [Tray]
- trayno=1
- ex2)
- [printers]
- print1=입원예정자
- print2=\\프린터IP\드라이버이름
- print3=\\127.0.0.1\HP LaserJet 1020
- [trayno]
- print1=1
- print2=2
- print3=1
- [printers] 섹션은 프린터 드라이브 명을 입력하며,
- print1은 입원약정서
- print2는 입원등록카드
- print3은 선택진료신청서를
- 출력하기 위한 프린터 드라이버 이름이다.
- [trayno] 는각각의 출력물들에 대해서 프린터의 어떤 용지함으로
- 출력할 지를 지정하는 정보이다. [printers] 섹션과 마찬가지로,
- print1은 입원약정서,
- print2는 입원등록카드,
- print3은 선택진료신청서를 출력하기 위한 tray(용지함) 번호를 지정한다.
- */
- var resultArray = new Array();
- var fileName = "C:\\cmcnuprinter\\printersetting.ini";
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var isExist = fso.FileExists(fileName);
- var file = null;
- var fileContent = null;
-
- if (isExist == true) {
- // 파일에 설정되어 있는 프린터로 출력을 설정한다.
- resultArray[0] = document.readIniFile("printers", pPrint, "true", fileName);
- resultArray[1] = document.readIniFile("trayno", pPrint, "1", fileName);
- } else {
- // 기존의 출력 모듈을 그대로 따른다.
- resultArray[0] = false;
- }
-
- return resultArray;
- }
- /*
- * 입원약정서 출력
- * 진료시 입원결정서 작성한 후 출력 할 수 있게끔.
- * 최초작성일 : 2011.01.19 노회식
- * 파라미터 : vpid - 환자번호
- * : vinrsrvacptdd - 입원희망일자
- * : vorddeptcd - 입원결정과
- * : vdeciflag - 약정서 분류 R : 입원전 결정서 존재시 출력, I : 입원결정 후, C : 전과전실시
- * vdeciflag = "R" 로 고정하여 예약정보만 있을 때 출력. 입원 후 출력시에는 fInDeciPrintlss() 사용 해야함.
- */
- function fInDeciPrint(vpid,vinrsrvacptdd,vorddeptcd,vdeciflag)
- {
- model.removeNodeset("/root/hidden/h_deciprint/deciprint");
- model.makeNode("/root/hidden/h_deciprint/deciprint/indd"); //입원일 - 입원일시
- model.makeNode("/root/hidden/h_deciprint/deciprint/inpath"); //입원경로
- model.makeNode("/root/hidden/h_deciprint/deciprint/roomcd"); //입원병실
- model.makeNode("/root/hidden/h_deciprint/deciprint/orddeptcd"); //진료과
- model.makeNode("/root/hidden/h_deciprint/deciprint/orddrid"); //선택의
- model.makeNode("/root/hidden/h_deciprint/deciprint/specordyn"); //선택의/지정의
- model.makeNode("/root/hidden/h_deciprint/deciprint/pid"); //등록번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/hngnm"); //환자성명
- model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno"); //주민번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/sex"); //성별1
- model.makeNode("/root/hidden/h_deciprint/deciprint/religncd"); //종교
- model.makeNode("/root/hidden/h_deciprint/deciprint/address"); //주소 = 상위주소 + 하위주소
- model.makeNode("/root/hidden/h_deciprint/deciprint/hometel"); //전화번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/mpphontel"); //휴대폰
- model.makeNode("/root/hidden/h_deciprint/deciprint/insukind"); //보험유형
- model.makeNode("/root/hidden/h_deciprint/deciprint/insucd"); //기관기호
- model.makeNode("/root/hidden/h_deciprint/deciprint/insuno"); //증번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/insdnm"); //세대주(피보험자)
- model.makeNode("/root/hidden/h_deciprint/deciprint/diagcd"); //상병코드
- model.makeNode("/root/hidden/h_deciprint/deciprint/termhngnm"); //상병명
- model.makeNode("/root/hidden/h_deciprint/deciprint/inschedd"); //입원예정일
- model.makeNode("/root/hidden/h_deciprint/deciprint/opschedd"); //수술예정일
- model.makeNode("/root/hidden/h_deciprint/deciprint/indirecdrnm"); //의뢰자
- model.makeNode("/root/hidden/h_deciprint/deciprint/inrsrvacptdt"); //의뢰일시
- model.makeNode("/root/hidden/h_deciprint/deciprint/handicapryn1"); //장애인유무체크
- model.makeNode("/root/hidden/h_deciprint/deciprint/handicapryn2"); //장애인유무체크
- model.makeNode("/root/hidden/h_deciprint/deciprint/inrsrvrem"); //원무참고사항
- model.makeNode("/root/hidden/h_deciprint/deciprint/cnstyn"); //의뢰서제출여부
- model.makeNode("/root/hidden/h_deciprint/deciprint/rareobstflag"); //희귀난치
- model.makeNode("/root/hidden/h_deciprint/deciprint/disregprson3"); //차상위
- model.makeNode("/root/hidden/h_deciprint/deciprint/wardnm"); //병동명
- model.makeNode("/root/hidden/h_deciprint/deciprint/bedcnt"); //병상수
- model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno1"); //주민번호앞자리
- model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno2"); //주민번호뒷자리
- model.makeNode("/root/hidden/h_deciprint/deciprint/insukindcd"); //보험유형코드
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnternm"); //보증인명
- model.makeNode("/root/hidden/h_deciprint/deciprint/grntertel"); //보증인전화번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/realcd"); //보증인관계
- model.makeNode("/root/hidden/h_deciprint/deciprint/addr"); //보증인주소
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno1"); //보증인주민번호앞자리
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno2"); //보증인주민번호뒷자리
- model.makeNode("/root/hidden/h_deciprint/deciprint/grntermpphontel"); //보증인휴대전화번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/worknm"); //보증인직장명
- model.makeNode("/root/hidden/h_deciprint/deciprint/worktel"); //보증인직장전화번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnternm1"); //보증인명1
- model.makeNode("/root/hidden/h_deciprint/deciprint/grntertel1"); //보증인전화번호1
- model.makeNode("/root/hidden/h_deciprint/deciprint/real1"); //보증인관계1
- model.makeNode("/root/hidden/h_deciprint/deciprint/addr1"); //보증인주소1
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno11"); //보증인주민번호앞자리1
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno12"); //보증인주민번호뒷자리1
- model.makeNode("/root/hidden/h_deciprint/deciprint/grntermpphontel1"); //보증인휴대전화번호1
- model.makeNode("/root/hidden/h_deciprint/deciprint/worknm1"); //보증인직장명1
- model.makeNode("/root/hidden/h_deciprint/deciprint/worktel1"); //보증인직장전화번호1
- model.makeNode("/root/hidden/h_deciprint/deciprint/centcd"); //센터명
- model.makeNode("/root/hidden/h_deciprint/deciprint/instcd"); //병원명
- model.makeNode("/root/hidden/h_deciprint/deciprint/hosptel"); //병원전화번호
-
- model.makeValue("/root/send/data40/pid",vpid);
- model.makeValue("/root/send/data40/inrsrvacptdd",vinrsrvacptdd);
- model.makeValue("/root/send/data40/orddeptcd",vorddeptcd);
- model.makeValue("/root/send/data40/deciflag",vdeciflag);
-
- if(submit("TRPMI01201") == true) {
-
- var indd = model.getValue("/root/hidden/h_deciprint/deciprint/indd");
- if (indd != null && indd != " " && indd != "") {
- var s_indd = indd.substr(0,4) + "-" +
- indd.substr(4,2) + "-" +
- indd.substr(6,2);
- model.setValue("/root/hidden/h_deciprint/deciprint/indd", s_indd);
- }
-
- var rrgstno = model.getValue("/root/hidden/h_deciprint/deciprint/rrgstno");
- var s_rrgstno = rrgstno.substr(0,6) + "-" + rrgstno.substr(6,7);
-
- model.setValue("/root/hidden/h_deciprint/deciprint/rrgstno",s_rrgstno);
- var sinschedd = model.getValue("/root/hidden/h_deciprint/deciprint/inschedd");
- var sopschedd = model.getValue("/root/hidden/h_deciprint/deciprint/opschedd");
- var sinrsrvacptdt = model.getValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt");
- var s_inrsrvacptdt = sinrsrvacptdt.substr(0,4) + "/" +
- sinrsrvacptdt.substr(4,2) + "/" +
- sinrsrvacptdt.substr(6,2) + " " +
- sinrsrvacptdt.substr(8,2) + ":" +
- sinrsrvacptdt.substr(10,2);
- model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt","");
-
- if (sinschedd != null && sinschedd != "" && sinschedd != " ") {
- model.setValue ("/root/hidden/h_deciprint/deciprint/inschedd", sinschedd.substr(0,4) + "년" + " " + sinschedd.substr(4,2) + "월" + " " + sinschedd.substr(6.2) + "일");
- }
- if (sopschedd != null && sopschedd != "" && sopschedd != " ") {
- model.setValue ("/root/hidden/h_deciprint/deciprint/opschedd",sopschedd.substr(0,4) + "년" + " " + sopschedd.substr(4,2) + "월" + " " + sopschedd.substr(6.2) + "일");
- }
- if (sinrsrvacptdt != null && sinrsrvacptdt != "" && sinrsrvacptdt != " ") {
- model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt",s_inrsrvacptdt);
- }
- }
-
- var sNhicRareobstflag = model.getValue("/root/main/nhicinfo/nhic_rareobstflag");
- var sNhicDisregprson3 = model.getValue("/root/main/nhicinfo/nhic_disregprson3");
- if (sNhicRareobstflag == "H") {
- model.setValue("/root/hidden/h_deciprint/deciprint/rareobstflag", "희귀난치"); //희귀난치
- } else {
- model.setValue("/root/hidden/h_deciprint/deciprint/rareobstflag", ""); //희귀난치
- }
-
- if (sNhicDisregprson3 == "32") {
- model.setValue("/root/hidden/h_deciprint/deciprint/disregprson3", "차상위"); //차상위
- } else {
- model.setValue("/root/hidden/h_deciprint/deciprint/disregprson3", ""); //차상위
- }
-
- //공통코드 P0045에서 프린터 명칭과 트레이 호출-입원약정서
- fGetPrintName();
- var print_name = getGlobalVariable("SPPAO00100_P0045_2_nm","p");
- var print_tray = getGlobalVariable("SPPAO00100_P0045_2_tray","p");
- //호출끝
-
- //입원약정서
- if(print_name != "false"){
- exeReportPreview("RPPMI01200", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
- }
- }
- /*
- * 입원약정서 출력
- * 입원정보inpt 저장된 후 입원약정서 출력하는 함수.
- * 최초작성일 : 2011.01.19 노회식
- * 파라미터 : vpid - 환자번호
- * : vindd - 입원일자
- * : vcretno - 생성번호
- * : vmskind - 주부유형
- * : vorddeptcd - 입원결정과
- * : vmedispclid - 전문의ID
- * : vdeciflag - 약정서 분류 R : 입원전 결정서 존재시 출력, I : 입원결정 후, C : 전과전실시
- * 입원정보 있을 경우 사용 orgordtype(ordtype) 이 E, D, C 일경우 vdeciflag = C else I
- *
- * 전과전실화면에 fInDeciPrintls 라는 이름으로 따로 실행시켜요. 응급실 재원환자의 입원약정서를 출력할 때 필요해요. 수정시 같이 해야합니다.
- *
- */
- function fInDeciPrintlss(vpid, vindd, vcretno, vmskind, vorddeptcd, vmedispclid, vdeciflag)
- {
- //공통코드 P0045에서 프린터 명칭과 트레이 호출 -입원약정서
- fGetPrintName();
- var print_name = getGlobalVariable("SPPAO00100_P0045_2_nm","p");
- var print_tray = getGlobalVariable("SPPAO00100_P0045_2_tray","p");
- //호출끝
-
- //입원약정서
- if(print_name == "false"){
- return false;
- }
- model.removeNodeset("/root/hidden/h_deciprint/deciprint");
- model.makeNode("/root/hidden/h_deciprint/deciprint/indd"); //입원일 - 입원일시
- model.makeNode("/root/hidden/h_deciprint/deciprint/inpath"); //입원경로
- model.makeNode("/root/hidden/h_deciprint/deciprint/roomcd"); //입원병실
- model.makeNode("/root/hidden/h_deciprint/deciprint/orddeptcd"); //진료과
- model.makeNode("/root/hidden/h_deciprint/deciprint/orddrid"); //선택의
- model.makeNode("/root/hidden/h_deciprint/deciprint/specordyn"); //선택의/지정의
- model.makeNode("/root/hidden/h_deciprint/deciprint/pid"); //등록번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/hngnm"); //환자성명
- model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno"); //주민번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/sex"); //성별1
- model.makeNode("/root/hidden/h_deciprint/deciprint/religncd"); //종교
- model.makeNode("/root/hidden/h_deciprint/deciprint/address"); //주소 = 상위주소 + 하위주소
- model.makeNode("/root/hidden/h_deciprint/deciprint/hometel"); //전화번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/mpphontel"); //휴대폰
- model.makeNode("/root/hidden/h_deciprint/deciprint/insukind"); //보험유형
- model.makeNode("/root/hidden/h_deciprint/deciprint/insucd"); //기관기호
- model.makeNode("/root/hidden/h_deciprint/deciprint/insuno"); //증번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/insdnm"); //세대주(피보험자)
- model.makeNode("/root/hidden/h_deciprint/deciprint/diagcd"); //상병코드
- model.makeNode("/root/hidden/h_deciprint/deciprint/termhngnm"); //상병명
- model.makeNode("/root/hidden/h_deciprint/deciprint/inschedd"); //입원예정일
- model.makeNode("/root/hidden/h_deciprint/deciprint/opschedd"); //수술예정일
- model.makeNode("/root/hidden/h_deciprint/deciprint/indirecdrnm"); //의뢰자
- model.makeNode("/root/hidden/h_deciprint/deciprint/inrsrvacptdt"); //의뢰일시
- model.makeNode("/root/hidden/h_deciprint/deciprint/handicapryn1"); //장애인유무체크
- model.makeNode("/root/hidden/h_deciprint/deciprint/handicapryn2"); //장애인유무체크
- model.makeNode("/root/hidden/h_deciprint/deciprint/inrsrvrem"); //원무참고사항
- model.makeNode("/root/hidden/h_deciprint/deciprint/cnstyn"); //의뢰서제출여부
- model.makeNode("/root/hidden/h_deciprint/deciprint/bedcnt"); //병상수
- model.makeNode("/root/hidden/h_deciprint/deciprint/wardnm"); //병동명
- model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno1"); //주민번호앞자리
- model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno2"); //주민번호뒷자리
- model.makeNode("/root/hidden/h_deciprint/deciprint/insukindcd"); //보험유형코드
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnternm"); //보증인명
- model.makeNode("/root/hidden/h_deciprint/deciprint/grntertel"); //보증인전화번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/realcd"); //보증인관계
- model.makeNode("/root/hidden/h_deciprint/deciprint/addr"); //보증인주소
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno1"); //보증인주민번호앞자리
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno2"); //보증인주민번호뒷자리
- model.makeNode("/root/hidden/h_deciprint/deciprint/grntermpphontel"); //보증인휴대전화번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/worknm"); //보증인직장명
- model.makeNode("/root/hidden/h_deciprint/deciprint/worktel"); //보증인직장전화번호
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnternm1"); //보증인명1
- model.makeNode("/root/hidden/h_deciprint/deciprint/grntertel1"); //보증인전화번호1
- model.makeNode("/root/hidden/h_deciprint/deciprint/real1"); //보증인관계1
- model.makeNode("/root/hidden/h_deciprint/deciprint/addr1"); //보증인주소1
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno11"); //보증인주민번호앞자리1
- model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno12"); //보증인주민번호뒷자리1
- model.makeNode("/root/hidden/h_deciprint/deciprint/grntermpphontel1"); //보증인휴대전화번호1
- model.makeNode("/root/hidden/h_deciprint/deciprint/worknm1"); //보증인직장명1
- model.makeNode("/root/hidden/h_deciprint/deciprint/worktel1"); //보증인직장전화번호1
- model.makeNode("/root/hidden/h_deciprint/deciprint/centcd"); //센터명
- model.makeNode("/root/hidden/h_deciprint/deciprint/instcd"); //병원명
- model.makeNode("/root/hidden/h_deciprint/deciprint/hosptel"); //병원전화번호
- model.makeValue("/root/send/data40/pid", vpid);
- model.makeValue("/root/send/data40/indd", vindd);
- model.makeValue("/root/send/data40/cretno", vcretno);
- model.makeValue("/root/send/data40/mskind", vmskind);
- model.makeValue("/root/send/data40/orddeptcd", vorddeptcd);
- model.makeValue("/root/send/data40/medispclid", vmedispclid);
- model.makeValue("/root/send/data40/deciflag", vdeciflag);
-
- if (submit("TRPMI00113") == true) {
- var indd = model.getValue("/root/hidden/h_deciprint/deciprint/indd");
- if (indd != null && indd != " " && indd != "") {
- var s_indd = indd.substr(0,4) + "-" +
- indd.substr(4,2) + "-" +
- indd.substr(6,2);
- model.setValue("/root/hidden/h_deciprint/deciprint/indd",s_indd);
- // model.setValue("/root/hidden/h_deciprint/deciprint/mm",indd.substr(4,2));
- // model.setValue("/root/hidden/h_deciprint/deciprint/dd",indd.substr(6,2));
-
- var rrgstno = model.getValue("/root/hidden/h_deciprint/deciprint/rrgstno");
- var s_rrgstno = rrgstno.substr(0,6) + "-" + rrgstno.substr(6,7);
- model.setValue("/root/hidden/h_deciprint/deciprint/rrgstno",s_rrgstno);
-
- var sinschedd = model.getValue("/root/hidden/h_deciprint/deciprint/inschedd");
- var sopschedd = model.getValue("/root/hidden/h_deciprint/deciprint/opschedd");
- var sinrsrvacptdt = model.getValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt");
- var s_inrsrvacptdt = sinrsrvacptdt.substr(0,4) + "/" +
- sinrsrvacptdt.substr(4,2) + "/" +
- sinrsrvacptdt.substr(6,2) + " " +
- sinrsrvacptdt.substr(8,2) + ":" +
- sinrsrvacptdt.substr(10,2);
- model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt","");
- if (sinschedd != null && sinschedd != "" && sinschedd != " ") {
- model.setValue ("/root/hidden/h_deciprint/deciprint/inschedd", sinschedd.substr(0,4) + "년" + " " + sinschedd.substr(4,2) + "월" + " " + sinschedd.substr(6.2) + "일");
- }
- if (sopschedd != null && sopschedd != "" && sopschedd != " ") {
- model.setValue ("/root/hidden/h_deciprint/deciprint/opschedd",sopschedd.substr(0,4) + "년" + " " + sopschedd.substr(4,2) + "월" + " " + sopschedd.substr(6.2) + "일");
- }
- if (sinrsrvacptdt != null && sinrsrvacptdt != "" && sinrsrvacptdt != " ") {
- model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt",s_inrsrvacptdt);
- }
-
- var sNhicRareobstflag = model.getValue("/root/hidden/h_deciprint/deciprint/rareobstflag"); // 희귀난치
- var sNhicDisregprson3 = model.getValue("/root/hidden/h_deciprint/deciprint/disregprson3"); // 차상위
- if (sNhicRareobstflag == "H") {
- model.setValue("/root/hidden/h_deciprint/deciprint/rareobstflag", "희귀난치"); //희귀난치
- } else {
- model.setValue("/root/hidden/h_deciprint/deciprint/rareobstflag", ""); //희귀난치
- }
-
- if (sNhicDisregprson3 == "32") {
- model.setValue("/root/hidden/h_deciprint/deciprint/disregprson3", "차상위"); //차상위
- } else {
- model.setValue("/root/hidden/h_deciprint/deciprint/disregprson3", ""); //차상위
- }
-
- // 2009.08.07 - zzui - 입원약정서 상병,참고사항 숨김(성가만 적용) - 시작
- /*
- var rsrvYn = model.getValue("/root/hidden/rsrvyn");
- if (rsrvYn == 'N'){
- model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvrem","");
- model.setValue("/root/hidden/h_deciprint/deciprint/diagcd","");
- model.setValue("/root/hidden/h_deciprint/deciprint/termhngnm","");
- }
- */
- // 2009.08.07 - zzui - 입원약정서 상병,참고사항 숨김(성가만 적용) - 끝
-
- // 2009.06.19 - local에 설정된 파일을 우선시 한다.
- // print1:입원약정서, print2:입원환자카드, print3:선택신청
- /*
- var printInfo = pmifGetPrintSetting("print1");
- if (printInfo.length == 2) {
- sPrinter = printInfo[0];
- trayno = printInfo[1];
- } else {
- // 2008.09.21 입원약정서 출력용 프린터 이름 조회 - 최병진
- sPrinter = model.getValue("/root/hidden/printers/deci_printer");
- if (isNull(sPrinter)) {
- sPrinter = "true";
- }
- // 2009년 03월 20일, JHP, 트레이정보를 받아서 넣는다.
- trayno = model.getValue("/root/hidden/pam/printer/value");
- }
- */
-
- //공통코드 P0045에서 프린터 명칭과 트레이 호출 -입원약정서
- fGetPrintName();
- var print_name = getGlobalVariable("SPPAO00100_P0045_2_nm","p");
- var print_tray = getGlobalVariable("SPPAO00100_P0045_2_tray","p");
- //호출끝
-
- //입원약정서
- if(print_name != "false"){
- exeReportPreview("RPPMI01200", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
- }
-
- } else {
- var sOrdType = model.getValue("/root/main/inpt/inpt_ordtype");
- if (sOrdType == "E" || sOrdType == "D") {
- messageBox("응급/DSC/CHEMO 환자입니다. [전과전실승인]화면에서 출력하십시오.!", "I");
- }
- }
- }
- }
- // 상급병실신청 전자서명관리
- function fUpRoomSignMngt(pid, indd, autoflag) {
-
- // 차트번호, 입원일자가 존재하는 경우에만 설정
- if (!isNull(pid) && !isNull(indd)) {
-
- setParameter("SPZHA20101_PARM_PID", pid);
- setParameter("SPZHA20101_PARM_INDD", indd);
- setParameter("SPZHA20101_PARM_AUTOFLAG", autoflag);
- }
-
- // 상급병실신청 서명관리화면 호출
- modal("SPPMI02800", "", "200", "300");
- }
- // 입원통지서 및 신청서 출력
- function fPrintInNoti(pid, indd, cretno) {
-
- if(isNull(pid)) {
- alert("환자를 선택 후 출력하십시오.");
- return;
- }
-
- model.resetInstanceNode("/root/send/data30");
- model.makeValue("/root/send/data30/pid", pid);
- model.makeValue("/root/send/data30/indd", indd);
- model.makeValue("/root/send/data30/cretno", cretno);
-
- submit("TRPMI00123");
-
- var specwardcd = model.getValue("/root/hidden/innotiinfo/innotiinfo/specwardcd");
-
- // 보호입원 / 행정입원 통지서
- if (!isNull(specwardcd) && (specwardcd == "C" || specwardcd == "D")) {
-
- exeReportPreview("RPPMI01205","XMLSTR" , "" , "" , "true" , "", "", "", "", "true");
-
- // 그외 통지서 (자의입원:A, 동의입원:B, 응급입원:E)
- } else {
-
- exeReportPreview("RPPMI01204","XMLSTR" , "" , "" , "true" , "", "", "", "", "true");
- }
-
- // 신청서는 본원만 적용 - 칠곡 동시적용 20170801
- //if (getUserInfo("dutplceinstcd") == "031") {
-
- if (specwardcd == "C") {
-
- // 보호입원신청서 출력
- fPerPrintOCR(
- model.getValue("/root/init/prncd/hardcd[cdseqno='16']/hardcd"),
- pid,
- indd,
- cretno,
- "I",
- "O"
- );
-
- } else {
-
- // 자의동의입원신청서 출력
- fPerPrintOCR(
- model.getValue("/root/init/prncd/hardcd[cdseqno='15']/hardcd"),
- pid,
- indd,
- cretno,
- "I",
- "O"
- );
- }
- //}
-
- }
- // 입원통지서 수령 확인서
- function fPrintInNotiConfirm(pid, indd, cretno, hngnm) {
-
- if(isNull(pid)) {
- alert("환자를 선택 후 출력하십시오.");
- return;
- }
-
- var ocrtype = "O";
- if(model.getValue("/root/init/PAM/PK018list/PK018[cdid='" + app.clientIp + "']/cdnm") == "Y"){
-
- if (messageBox("입원통지서 수령 확인서", "Q017") == "6") {
- ocrtype = "S";
- }
- }
-
- //구분에 맞춰 폼코드 처리(1:일반약정서 / 2:기간약정서 / 3:개인정보이용동의서 / 12:영상정보처리기기수집/이용동의서 / 13:입원통지서 수령 확인서
- var formcd = model.getValue("/root/init/prncd/hardcd[cdseqno='13']/hardcd");
-
- // COR 출력의 경우
- if (ocrtype == "O") {
- fPerPrintOCR(
- formcd,
- pid,
- indd,
- cretno,
- "I",
- ocrtype
- );
- } else {
- model.makeValue("/root/temp/consent/pid", pid);
- model.makeValue("/root/temp/consent/orddd", indd);
- model.makeValue("/root/temp/consent/cretno", cretno);
- model.makeValue("/root/temp/consent/ordtype", "I");
- model.makeValue("/root/temp/consent/flag", "N"); // N:입원통지서 수령 확인서
- model.makeValue("/root/temp/consent/formcd", formcd);
- model.makeValue("/root/temp/consent/tag1", hngnm);
- model.makeValue("/root/temp/consent/tag2", indd.substr(0,4));
- model.makeValue("/root/temp/consent/tag3", indd.substr(4,2));
- model.makeValue("/root/temp/consent/tag4", indd.substr(6,2));
-
- fPrintOcrConsent("/root/temp/consent");
- }
- }
|