PMI001.js 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  1. /*
  2. * 입원등록 공통 함수
  3. * PMI001.js
  4. * 작성자 : 최병진
  5. * 작성일 : 2008.12.10
  6. * 수정이력 : PMC001.js 파일로 함수 이동
  7. pmifGetNhicQualification -> pmcfGetNhicQualification로 변경
  8. 2009.05.21 - 바코드 출력 기능 신규 모듈로 교체에 따라 PAM.js에서 여기로 이전(기존 함수는 PAM.js에 그대로 존재)
  9. */
  10. /*
  11. 22 11 11
  12. 32 차상위1종
  13. 00 00 33 A 차상위2종 정상
  14. 02 02 34 O 차상위2종 정상(인공신장투석)
  15. 03 03 35 O 차상위2종 정상(복막관류술)
  16. 04 04 36 O 차상위2종 정상(장기이식)
  17. 10 10 37 O 차상위2종 정상(가정간호)
  18. 11 11 38 O 차상위2종 정상(가정간호등록암)
  19. 05 05 39 I 차상위2종 개심,개두
  20. 06 06 40 A 차상위2종 등록암
  21. 07 07 45 O 차상위2종 산정특례
  22. 08 08 41 I 차상위2종 입원6세미만
  23. 09 09 42 I 차상위2종 자연분만
  24. 14 00 43 I 차상위2종 정신과입원진료
  25. 17 00 44 A 차상위2종 만성질환
  26. */
  27. /* 차상위2종 보조유형 셋팅
  28. * 전제조건 : 보험유형은 이 함수로 밖에서 변경 한다.
  29. * Parameter : pBeForeInsuKind - 변경전 보험유형
  30. * pBeforeSuppKind - 변경전 유형보조
  31. * pAfterInsuKind - 변경후 보험유형
  32. * pScndSupTrgtman - 차상위구분(1:차상위1종, 2:차상위2종)
  33. * pOrdDeptCd - 진료과코드
  34. * pChronicDiseaseYn - 만성질환여부
  35. * Return : suppkind - String
  36. */
  37. function pmifGetScndSuptrgtSuppkind(pBeForeInsuKind, pBeforeSuppKind, pAfterInsuKind, pScndSupTrgtman, pOrdDeptCd, pChronicDiseaseYn) {
  38. var log = "pBeForeInsuKind : " + pBeForeInsuKind + "\n" +
  39. "pBeforeSuppKind : " + pBeforeSuppKind + "\n" +
  40. "pAfterInsuKind : " + pAfterInsuKind + "\n" +
  41. "pScndSupTrgtman : " + pScndSupTrgtman + "\n" +
  42. "pOrdDeptCd : " + pOrdDeptCd + "\n" +
  43. "pChronicDiseaseYn : " + pChronicDiseaseYn;
  44. // alert ("log : " + log);
  45. var sNPcd = "2030000000"; // 정신과
  46. var result = pBeforeSuppKind; // 최초에는 현재의 보조유형을 설정해 놓는다.
  47. // 차상위1종
  48. if (pScndSupTrgtman == "1") {
  49. if(pAfterInsuKind == "11") {
  50. result = "32";
  51. }
  52. } else if (pScndSupTrgtman == "2") { // 차상위2종
  53. // 건강보험이고, 보조유형이 차상위2종의 보조유형이 아닐 때
  54. if(pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) < 32) {
  55. if (pBeforeSuppKind == "00") { result = "33"; }
  56. else if (pBeforeSuppKind == "01") { result = "01"; }
  57. else if (pBeforeSuppKind == "02") { result = "33"; }
  58. else if (pBeforeSuppKind == "03") { result = "33"; }
  59. else if (pBeforeSuppKind == "04") { result = "33"; }
  60. else if (pBeforeSuppKind == "10") { result = "33"; }
  61. else if (pBeforeSuppKind == "11") { result = "33"; }
  62. else if (pBeforeSuppKind == "05") { result = "39"; }
  63. else if (pBeforeSuppKind == "06") { result = "40"; }
  64. else if (pBeforeSuppKind == "07") { result = "33"; }
  65. else if (pBeforeSuppKind == "08") { result = "41"; }
  66. else if (pBeforeSuppKind == "09") { result = "42"; }
  67. else if (pBeforeSuppKind == "14") { result = "33"; }
  68. else if (pBeforeSuppKind == "17" && pChronicDiseaseYn == "Y") { result = "44"; }
  69. else if (pBeforeSuppKind == "17" && pChronicDiseaseYn != "Y") { result = "33"; }
  70. else {
  71. messageBox("파라미터 값이 올바르지 않습니다[1]!!");
  72. }
  73. }
  74. /*
  75. // 의료급여1종 -> 차상위2종, 보조유형이 차상위2종의 보조유형이 아닐 때
  76. if(pBeForeInsuKind == "21" && pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) < 32) {
  77. if (pBeforeSuppKind == "00" && pOrdDeptCd != sNPcd) { result = "33"; }
  78. else if (pBeforeSuppKind == "01") { result = "01"; }
  79. else if (pBeforeSuppKind == "02") { result = "33"; }
  80. else if (pBeforeSuppKind == "03") { result = "33"; }
  81. else if (pBeforeSuppKind == "04") { result = "33"; }
  82. else if (pBeforeSuppKind == "10") { result = "33"; }
  83. else if (pBeforeSuppKind == "11") { result = "33"; }
  84. else if (pBeforeSuppKind == "05") { result = "39"; }
  85. else if (pBeforeSuppKind == "06") { result = "40"; }
  86. else if (pBeforeSuppKind == "08") { result = "41"; }
  87. else if (pBeforeSuppKind == "09") { result = "42"; }
  88. else if (pBeforeSuppKind == "14" && pOrdDeptCd == sNPcd) { result = "43"; }
  89. else if (pBeforeSuppKind == "17" && pChronicDiseaseYn == "Y") { result = "44"; }
  90. else {
  91. messageBox("파라미터 값이 올바르지 않습니다[1]!!");
  92. }
  93. }
  94. // 의료급여2종 -> 차상위2종, 보조유형이 차상위2종의 보조유형이 아닐 때
  95. if(pBeForeInsuKind == "22" && pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) < 32) {
  96. if (pBeforeSuppKind == "00" && pOrdDeptCd != sNPcd) { result = "33"; }
  97. else if (pBeforeSuppKind == "01") { result = "01"; }
  98. else if (pBeforeSuppKind == "02") { result = "33"; }
  99. else if (pBeforeSuppKind == "03") { result = "33"; }
  100. else if (pBeforeSuppKind == "04") { result = "33"; }
  101. else if (pBeforeSuppKind == "10") { result = "33"; }
  102. else if (pBeforeSuppKind == "11") { result = "33"; }
  103. else if (pBeforeSuppKind == "05") { result = "39"; }
  104. else if (pBeforeSuppKind == "06") { result = "40"; }
  105. else if (pBeforeSuppKind == "08") { result = "41"; }
  106. else if (pBeforeSuppKind == "09") { result = "42"; }
  107. else if (pBeforeSuppKind == "14" && pOrdDeptCd == sNPcd) { result = "43"; }
  108. else if (pBeforeSuppKind == "17" && pChronicDiseaseYn == "Y") { result = "44"; }
  109. else {
  110. messageBox("파라미터 값이 올바르지 않습니다[1]!!");
  111. }
  112. }
  113. */
  114. } else {
  115. // 건강보험이고 차상위1종이 아닐 때
  116. if(pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) == 32) {
  117. result = "00";
  118. }
  119. /*
  120. // 의료급여1종이고 차상위1종이 아닐 때
  121. if(pBeForeInsuKind == "11" && pAfterInsuKind == "21" && parseInt(pBeforeSuppKind) == 32) {
  122. result = "00";
  123. }
  124. // 의료급여2종이고 차상위1종이 아닐 때
  125. if(pBeForeInsuKind == "11" && pAfterInsuKind == "22" && parseInt(pBeforeSuppKind) == 32) {
  126. result = "00";
  127. }
  128. */
  129. // 건강보험이고 차상위2종이 아닐 때
  130. // if(pBeForeInsuKind == "11" && pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) > 32) {
  131. if(pAfterInsuKind == "11" && parseInt(pBeforeSuppKind) > 32) {
  132. if (pBeforeSuppKind == "33") { result = "00"; }
  133. else if (pBeforeSuppKind == "01") { result = "01"; }
  134. else if (pBeforeSuppKind == "33") { result = "00"; }
  135. else if (pBeforeSuppKind == "33") { result = "00"; }
  136. else if (pBeforeSuppKind == "33") { result = "00"; }
  137. else if (pBeforeSuppKind == "33") { result = "00"; }
  138. else if (pBeforeSuppKind == "33") { result = "00"; }
  139. else if (pBeforeSuppKind == "39") { result = "05"; }
  140. else if (pBeforeSuppKind == "40") { result = "06"; }
  141. else if (pBeforeSuppKind == "41") { result = "08"; }
  142. else if (pBeforeSuppKind == "42") { result = "09"; }
  143. else if (pBeforeSuppKind == "43") { result = "00"; }
  144. else if (pBeforeSuppKind == "44") { result = "00"; }
  145. else if (pBeforeSuppKind == "45") { result = "00"; }
  146. else {
  147. messageBox("파라미터 값이 올바르지 않습니다[2]!!");
  148. }
  149. }
  150. // 의료급여1종이고 차상위2종이 아닐 때
  151. // if(pBeForeInsuKind == "11" && pAfterInsuKind == "21" && parseInt(pBeforeSuppKind) > 32) {
  152. if(pAfterInsuKind == "21" && parseInt(pBeforeSuppKind) > 32) {
  153. if (pBeforeSuppKind == "33") { result = "00"; }
  154. else if (pBeforeSuppKind == "01") { result = "01"; }
  155. else if (pBeforeSuppKind == "33") { result = "00"; }
  156. else if (pBeforeSuppKind == "33") { result = "00"; }
  157. else if (pBeforeSuppKind == "33") { result = "00"; }
  158. else if (pBeforeSuppKind == "33") { result = "00"; }
  159. else if (pBeforeSuppKind == "33") { result = "00"; }
  160. else if (pBeforeSuppKind == "39") { result = "05"; }
  161. else if (pBeforeSuppKind == "40") { result = "06"; }
  162. else if (pBeforeSuppKind == "41") { result = "08"; }
  163. else if (pBeforeSuppKind == "42") { result = "09"; }
  164. else if (pBeforeSuppKind == "43" && pOrdDeptCd == sNPcd) { result = "14"; }
  165. else if (pBeforeSuppKind == "43" && pOrdDeptCd != sNPcd) { result = "00"; }
  166. else if (pBeforeSuppKind == "44" && pChronicDiseaseYn == "Y") { result = "17"; }
  167. else if (pBeforeSuppKind == "44" && pChronicDiseaseYn != "Y") { result = "00"; }
  168. else if (pBeforeSuppKind == "45") { result = "00"; }
  169. else {
  170. messageBox("파라미터 값이 올바르지 않습니다[2]!!");
  171. }
  172. }
  173. // 의료급여2종이고 차상위2종이 아닐 때
  174. // if(pBeForeInsuKind == "11" && pAfterInsuKind == "22" && parseInt(pBeforeSuppKind) > 32) {
  175. if(pAfterInsuKind == "22" && parseInt(pBeforeSuppKind) > 32) {
  176. if (pBeforeSuppKind == "33") { result = "00"; }
  177. else if (pBeforeSuppKind == "01") { result = "01"; }
  178. else if (pBeforeSuppKind == "33") { result = "00"; }
  179. else if (pBeforeSuppKind == "33") { result = "00"; }
  180. else if (pBeforeSuppKind == "33") { result = "00"; }
  181. else if (pBeforeSuppKind == "33") { result = "00"; }
  182. else if (pBeforeSuppKind == "33") { result = "00"; }
  183. else if (pBeforeSuppKind == "39") { result = "05"; }
  184. else if (pBeforeSuppKind == "40") { result = "06"; }
  185. else if (pBeforeSuppKind == "41") { result = "08"; }
  186. else if (pBeforeSuppKind == "42") { result = "09"; }
  187. else if (pBeforeSuppKind == "43" && pOrdDeptCd == sNPcd) { result = "14"; }
  188. else if (pBeforeSuppKind == "43" && pOrdDeptCd != sNPcd) { result = "00"; }
  189. else if (pBeforeSuppKind == "44" && pChronicDiseaseYn == "Y") { result = "17"; }
  190. else if (pBeforeSuppKind == "44" && pChronicDiseaseYn != "Y") { result = "00"; }
  191. else if (pBeforeSuppKind == "45") { result = "00"; }
  192. else {
  193. messageBox("파라미터 값이 올바르지 않습니다[2]!!");
  194. }
  195. }
  196. }
  197. return result;
  198. }
  199. /*
  200. * 바코드 출력 함수
  201. * DSC, ER간호에서도 사용
  202. * 최초작성일 : 2009.05.21
  203. * 삭제된 파라미터 : pPort - COM Port 지정값
  204. * 추가된 파라미터 : pSetyn - 프린터설정정보 셋팅여부
  205. * pScrid - 프린터설정정보 조회용 화면 아이디
  206. * pBarcdRef - 설정정보 xpath -> 구형 / 신형프린터 구분자로 사용
  207. * 수정이력 : 2009.05.30 - 병실코드 출력 (파라미터로 출력여부를 받음)
  208. * 2009.06.01 - pRoomyn 파라미터 사용없이 쿼리에서 원무공통코드를 체크하여 출력여부결정
  209. * - 향후 간호와 원무의 출력여부가 달라질 수 있으므로 기능은 주석처리
  210. */
  211. function pmifPrintBarCode(pPid, pIndd, pCretno, pMskind, pHiststat, pSetyn, pScrid, pBarcdRef, pRoomyn, pIsNEW, pErvisityn, pTest) {
  212. // 1. 공통[시작] - 2009.05.25
  213. model.removeNodeset("/root/hidden/h_receipt/receipt");
  214. model.removeNodeset("/root/send/data17");
  215. model.makeNode("/root/hidden/h_receipt/receipt/pid");
  216. model.makeNode("/root/hidden/h_receipt/receipt/hngnm");
  217. model.makeNode("/root/hidden/h_receipt/receipt/hngnm2");
  218. model.makeNode("/root/hidden/h_receipt/receipt/sex");
  219. model.makeNode("/root/hidden/h_receipt/receipt/age");
  220. model.makeNode("/root/hidden/h_receipt/receipt/religncd");
  221. model.makeNode("/root/hidden/h_receipt/receipt/rrgstno");
  222. model.makeNode("/root/hidden/h_receipt/receipt/orddeptcd");
  223. model.makeNode("/root/hidden/h_receipt/receipt/orddeptnm");
  224. model.makeNode("/root/hidden/h_receipt/receipt/specordyn");
  225. model.makeNode("/root/hidden/h_receipt/receipt/medispclid");
  226. model.makeNode("/root/hidden/h_receipt/receipt/wardcd");
  227. model.makeNode("/root/hidden/h_receipt/receipt/wardcd2");
  228. model.makeNode("/root/hidden/h_receipt/receipt/roomcd");
  229. model.makeNode("/root/hidden/h_receipt/receipt/indd");
  230. model.makeNode("/root/hidden/h_receipt/receipt/barcode");
  231. model.makeNode("/root/hidden/h_receipt/receipt/newprintflag");
  232. model.makeNode("/root/hidden/h_receipt/receipt/btype");
  233. model.makeNode("/root/hidden/h_receipt/receipt/rfidyn");
  234. model.makeNode("/root/hidden/h_receipt/receipt/rfidcardid1");
  235. model.makeNode("/root/hidden/h_receipt/receipt/deptplce");
  236. model.makeValue("/root/send/data17/pid", pPid);
  237. model.makeValue("/root/send/data17/indd", pIndd);
  238. model.makeValue("/root/send/data17/cretno", pCretno);
  239. model.makeValue("/root/send/data17/mskind", pMskind);
  240. model.makeValue("/root/send/data17/histstat", pHiststat);
  241. model.makeValue("/root/send/data17/ioflag", "");
  242. model.makeValue("/root/send/data17/ervisityn", pErvisityn);
  243. model.makeValue("/root/send/data17/ipaddr", app.clientIp);
  244. submit("TRPMI00115");
  245. if (pRoomyn == undefined || pRoomyn == null) {
  246. pRoomyn = "N";
  247. }
  248. // OCX 버전 로딩 구분
  249. if (pIsNEW == undefined || pIsNEW == null) {
  250. pIsNEW = "";
  251. } else {
  252. pIsNEW = "NEW"
  253. }
  254. var inpt_pid = model.getValue("/root/hidden/h_receipt/receipt/pid");
  255. var rfidyn = model.getValue("/root/hidden/h_receipt/receipt/rfidyn");
  256. if (inpt_pid == null || inpt_pid == " " || inpt_pid == "") {
  257. messageBox("입원 환자가 아닙니다.! 환자 팔찌를 발행할 수 없습니다.","E999","");
  258. return false;
  259. // // RFID 출력 시
  260. // } else if (rfidyn == 'Y') {
  261. //
  262. // var hngnm2 = model.getValue("/root/hidden/h_receipt/receipt/hngnm2");
  263. //
  264. // var btype = model.getValue("/root/hidden/h_receipt/receipt/btype");
  265. //
  266. // //경북대 병원 성별표시 한글로 바꿈
  267. // var sex = model.getValue("/root/hidden/h_receipt/receipt/sex");
  268. // if( sex == 'M' ){
  269. // sex = '남';
  270. // }else{
  271. // sex = '여';
  272. // }
  273. //
  274. // var age = model.getValue("/root/hidden/h_receipt/receipt/age") + "세";
  275. //
  276. // var rrgstno = model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(0,2) + "."
  277. // + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(2,2) + "."
  278. // + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(4,2);
  279. //
  280. // var wardcd = model.getValue("/root/hidden/h_receipt/receipt/wardcd");
  281. //
  282. // var roomcd = model.getValue("/root/hidden/h_receipt/receipt/roomcd");
  283. //
  284. // var deptplce = model.getValue("/root/hidden/h_receipt/receipt/deptplce");
  285. //
  286. // var cardid1 = model.getValue("/root/hidden/h_receipt/receipt/rfidcardid1");
  287. //
  288. // var param = inpt_pid + "|" + hngnm2 + "|" + btype + "|" + sex + "|" + age + "|" + rrgstno + "|" + wardcd + " " + roomcd + "호 (" + deptplce + ")|" + cardid1;
  289. //
  290. // //alert(param);
  291. //
  292. // try{
  293. //
  294. // // 1. RFID 출력
  295. // var activeObj = new ActiveXObject("WScript.Shell");
  296. // activeObj.CurrentDirectory = "C:/Program Files/himed/components/OneTech";
  297. // var fileName = "RfidLabelPrt.exe " + param;
  298. // activeObj.Run(fileName);
  299. //
  300. // // 2. RFID 데이터 저장
  301. // model.makeValue("/root/send/data60/pid", inpt_pid);
  302. // model.makeValue("/root/send/data60/usernm", hngnm2);
  303. // model.makeValue("/root/send/data60/gubun", "P");
  304. // model.makeValue("/root/send/data60/cardid1", cardid1);
  305. // model.makeValue("/root/send/data60/indd", model.getValue("/root/hidden/h_receipt/receipt/indd"));
  306. //
  307. // submit("TXPMC06606");
  308. //
  309. // }catch(e){
  310. //
  311. // alert("RFID 카드 등록오류입니다. \r\n동일현상 반복 시 전산실로 문의하십시오.");
  312. // }
  313. //
  314. // return;
  315. // 기존 환자팔찌 출력 시
  316. } else {
  317. // var sRrgstno = model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(0,6) + "-"
  318. // + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(6,1) + "******";
  319. var sRrgstno = model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(0,2) + "."
  320. + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(2,2) + "."
  321. + model.getValue("/root/hidden/h_receipt/receipt/rrgstno").substr(4,2);
  322. model.setValue("/root/hidden/h_receipt/receipt/rrgstno",sRrgstno);
  323. //경북대 병원 성별표시 한글로 바꿈
  324. var sSex = model.getValue("/root/hidden/h_receipt/receipt/sex");
  325. if( sSex == 'M' ){
  326. sSex = '남';
  327. }else{
  328. sSex = '여';
  329. }
  330. model.setValue("/root/hidden/h_receipt/receipt/sex", sSex);
  331. // 전실신청정보 있을 경우에는 전실대상 병동을 표시
  332. var inptWard = model.getValue("/root/hidden/h_receipt/receipt/wardcd");
  333. var cdcrWard = model.getValue("/root/hidden/h_receipt/receipt/wardcd2");
  334. if (inptWard != cdcrWard && cdcrWard != null && cdcrWard != '') {
  335. model.setValue("/root/hidden/h_receipt/receipt/wardcd", cdcrWard);
  336. }
  337. var sIndd = model.getValue("/root/hidden/h_receipt/receipt/indd");
  338. sIndd = sIndd.substr(0, 4) + "-" + sIndd.substr(4,2) + "-" + sIndd.substr(6,2);
  339. model.setValue("/root/hidden/h_receipt/receipt/indd", sIndd);
  340. //2010-09-14 이동식 추가 - 경북대병원 환자팔지 렉스포트로 출력
  341. //2008.10.14 Rexpert 출력전 클리어 - 최병진
  342. //childObj.window.javascript.fCloseReport();
  343. //var sPrinter;
  344. //var trayno;
  345. // 2009.06.19 - local에 설정된 파일을 우선시 한다.
  346. // print1:입원약정서, print2:입원환자카드, print3:선택신청, print4:환자팔찌
  347. /*
  348. var printInfo = pmifGetPrintSetting("print4");
  349. if (printInfo.length == 2) {
  350. sPrinter = printInfo[0];
  351. trayno = printInfo[1];
  352. } else {
  353. // 2008.09.21 입원약정서 출력용 프린터 이름 조회 - 최병진
  354. sPrinter = model.getValue("/root/hidden/printers/card_printer");
  355. if (isNull(sPrinter)) {
  356. sPrinter = "true";
  357. }
  358. // 2009년 03월 20일, JHP, 트레이정보를 받아서 넣는다.
  359. trayno = model.getValue("/root/hidden/pam/printer/value");
  360. }
  361. */
  362. //공통코드 P0045에서 프린터 명칭과 트레이 호출 - 입원환자팔찌 프린터
  363. fGetPrintName();
  364. // 프린터정보
  365. var print_name = "";
  366. // 트레이정보
  367. var print_tray = "";
  368. var resultFlag = "";
  369. // // 신형팔찌는 소아체크 없음
  370. // if (pBarcdRef == 'N') {
  371. //
  372. // print_name = getGlobalVariable("SPPAO00100_P0045_12_nm","p"); // SLP-T400
  373. // print_tray = getGlobalVariable("SPPAO00100_P0045_12_tray","p");
  374. //
  375. // // 기존팔찌
  376. // } else {
  377. // 6세미만 체크
  378. if (model.getValue("/root/hidden/h_receipt/receipt/age") < 6) {
  379. resultFlag = messageBox("6세미만 환자입니다!!! \r\n\r\n소아용팔찌를 출력", "S006", "\r\n성인용팔찌를 출력|\r\n출력을 취소");
  380. // 취소한 경우
  381. if (resultFlag == "2") {
  382. return;
  383. }
  384. }
  385. // 환자팔찌 설정 값(참고용) 변경시 SPPAO00100 수정필요
  386. // P0045_8 : HC100 구형 프린터(성인용)
  387. // P0045_11 : HC101 구형 프린터(소아용)
  388. // P0045_12 : SLP-T400 신형 프린터(성인용)
  389. // P0045_13 : SLP-T400 신형 프린터(소아용)
  390. // model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "Y" : 성인 신형 / 소아 신형
  391. // model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "A" : 성인 신형 / 소아 구형
  392. // model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "B" : 성인 구형 / 소아 신형
  393. // model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "N" : 성인 구형 / 소아 구형
  394. // 출력PC별 장비가 달라 IP로 해당 장비 구분하도록 수정(원무공통코드 PK060) by 조중래 20140404
  395. // 소아용
  396. if (resultFlag == "6") {
  397. // 신형 프린터 설정
  398. if (model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "Y" || model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "B") {
  399. print_name = getGlobalVariable("SPPAO00100_P0045_13_nm", "p"); // SLP-T401
  400. print_tray = getGlobalVariable("SPPAO00100_P0045_13_tray", "p");
  401. // 구형 프린터 설정
  402. } else {
  403. print_name = getGlobalVariable("SPPAO00100_P0045_11_nm", "p"); // HC101
  404. print_tray = getGlobalVariable("SPPAO00100_P0045_11_tray", "p");
  405. }
  406. model.makeValue("/root/hidden/h_receipt/receipt/babyyn", "Y"); // 소아용
  407. // 성인용
  408. } else {
  409. // 신형 프린터 설정
  410. if (model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "Y" || model.getValue("/root/hidden/h_receipt/receipt/newprintflag") == "A") {
  411. print_name = getGlobalVariable("SPPAO00100_P0045_12_nm", "p"); // SLP-T400
  412. print_tray = getGlobalVariable("SPPAO00100_P0045_12_tray", "p");
  413. // 구형 프린터 설정
  414. } else {
  415. print_name = getGlobalVariable("SPPAO00100_P0045_8_nm", "p"); // HC100
  416. print_tray = getGlobalVariable("SPPAO00100_P0045_8_tray", "p");
  417. }
  418. model.makeValue("/root/hidden/h_receipt/receipt/babyyn", "N"); // 성인용
  419. }
  420. // }
  421. // 호출끝
  422. // 프린터 드라이버 종류에 따라서 렉스퍼트 동적으로 호출(용지가 다르기때문임)
  423. // HC-100 : 구형팔찌(성인용) - Zebra 제품
  424. // HC-101 : 구형팔찌(소아용) - Zebra 제품
  425. // SLP-T400 : 신형팔찌(성인용) - Bixolon 제품
  426. // SLP-T401 : 신형팔찌(소아용) - Bixolon 제품
  427. //alert(pTest);
  428. // 신형팔찌용 렉스퍼트
  429. if (print_name == 'SLP-T400' || print_name == 'SLP-T401') {
  430. if(pTest == 'Y')
  431. {
  432. //alert("333");
  433. exeReportPreview("RPPMI03203", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
  434. }
  435. else
  436. {
  437. //alert("444");
  438. exeReportPreview("RPPMI03202", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
  439. if (rfidyn == "Y") {
  440. // RFID 데이터 저장
  441. model.makeValue("/root/send/data60/pid", inpt_pid);
  442. model.makeValue("/root/send/data60/usernm", model.getValue("/root/hidden/h_receipt/receipt/hngnm2"));
  443. model.makeValue("/root/send/data60/gubun", "P");
  444. model.makeValue("/root/send/data60/cardid1", model.getValue("/root/hidden/h_receipt/receipt/rfidcardid1"));
  445. model.makeValue("/root/send/data60/indd", pIndd);
  446. submit("TXPMC06606");
  447. }
  448. }
  449. // 기존팔찌용 렉스퍼트
  450. } else {
  451. exeReportPreview("RPPMI03201", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
  452. }
  453. //2010-09-14 이동식 주석처리 - 기존 바코드 출력 로직 주석처리
  454. // 1. 공통[끝] - 2009.05.25
  455. /*
  456. // 출력을 위한 변수 선언
  457. var sPid = model.getValue("/root/hidden/h_receipt/receipt/pid");
  458. var sHngnm = model.getValue("/root/hidden/h_receipt/receipt/hngnm");
  459. var sSex = model.getValue("/root/hidden/h_receipt/receipt/sex");
  460. var sAge = model.getValue("/root/hidden/h_receipt/receipt/age");
  461. var sRoomcd = model.getValue("/root/hidden/h_receipt/receipt/roomcd");
  462. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
  463. var sSndMsg = "";
  464. var portOpenTF = ""; // 포트연결 성공여부
  465. var esc = String.fromCharCode(27);
  466. var sPrntKind = "1";
  467. var sCommKind = "02";
  468. var sCommPort = "1";
  469. var sDataBit = "8";
  470. var sStopBit = "1";
  471. var sBaudRate = "9600";
  472. var sParity = "n";
  473. var iLeft = 0;
  474. var iTop = 0;
  475. if (pSetyn == "Y") {
  476. fGetBarCodeInfo(pScrid); //입원등록 기본
  477. sPrntKind = model.getvalue(barcdRef + "/prntkind");
  478. sCommKind = model.getValue(barcdRef + "/commkind");
  479. iLeft = model.getValue(barcdRef + "/blank/left");
  480. iTop = model.getValue(barcdRef + "/blank/top");
  481. sCommPort = model.getvalue(barcdRef + "/comm02/comm");
  482. sDataBit = model.getvalue(barcdRef + "/comm02/databit");
  483. sStopBit = model.getvalue(barcdRef + "/comm02/stopbit");
  484. sBaudRate = model.getvalue(barcdRef + "/comm02/baudrate");
  485. sParity = model.getvalue(barcdRef + "/comm02/parity");
  486. if(iLeft == "" || iLeft == "-"){
  487. iLeft = 0;
  488. }
  489. if(iTop == "" || iTop == "-"){
  490. iTop = 0;
  491. }
  492. // 2008.07.02 모듈 로딩
  493. if (!body.isChild("CommAX")) {
  494. lzzfMakeBrcdPrntObjHanDo("CommAX", barcdRef, pIsNEW); // 로직안에 셋팅로직이 포함되어 있음
  495. }
  496. } else {
  497. sPrntKind = model.getvalue(pBarcdRef + "/prntkind");
  498. sCommKind = model.getValue(pBarcdRef + "/commkind");
  499. iLeft = model.getValue(pBarcdRef + "/blank/left");
  500. iTop = model.getValue(pBarcdRef + "/blank/top");;
  501. sCommPort = model.getvalue(pBarcdRef + "/comm02/comm");
  502. sDataBit = model.getvalue(pBarcdRef + "/comm02/databit");
  503. sStopBit = model.getvalue(pBarcdRef + "/comm02/stopbit");
  504. sBaudRate = model.getvalue(pBarcdRef + "/comm02/baudrate");
  505. sParity = model.getvalue(pBarcdRef + "/comm02/parity");
  506. }
  507. if(sCommKind == "02") {
  508. if (pIsNEW != "NEW") {
  509. portOpenTF = CommAX.PortOpen("true");
  510. }
  511. }
  512. // 프린터 종류별 출력
  513. // 1. SATO
  514. if(sPrntKind == "2" || sPrntKind == "6" || sPrntKind == "7") {
  515. // 시작위치 셋팅 (A1aaaabbbb:출력 용지 규격(aaaa:세로크기_최대 2848, bbbb:가로크기_최대 832))
  516. sSndMsg += esc + "A" + esc + "A103000500";
  517. sSndMsg += esc + "V" + (parseInt(iTop)+20) + esc + "H" + (parseInt(iLeft)+40) + esc + "BG" + "02" + "040" + sPid;
  518. sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+25 , parseInt(iLeft)+360 , sSex + "/" + sAge, 1, 1);
  519. sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+65 , parseInt(iLeft)+40 , sHngnm, 1, 2);
  520. // 2009.06.01 - pRoomyn 조건 주석처리
  521. //if (pRoomyn == "Y") {
  522. sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+65 , parseInt(iLeft)+340 , sRoomcd, 1, 1);
  523. //}
  524. sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+115 , parseInt(iLeft)+40 , sPid, 1, 1);
  525. sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+145 , parseInt(iLeft)+40 , sRrgstno, 1, 1);
  526. sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+115 , parseInt(iLeft)+280 , sIndd, 1, 1);
  527. sSndMsg += esc + "Q1" + esc + "Z";
  528. CommAX.SendMsg(sSndMsg);
  529. CommAX.PortOpen("false");
  530. } else { // Zebra
  531. if (model.getValue("/root/main/barcdprntsetup/macaddr") == "DEFAULT" || model.getValue("/root/main/barcdprntsetup/macaddr") == "") {
  532. lzzfMakeBrcdPrntObjHanDo("CommAX", "", pIsNEW);
  533. if (pIsNEW != "NEW") {
  534. CommAX.CommPort = "1";
  535. CommAX.Settings = "9600,n,8,1";
  536. }
  537. } else {
  538. if (pIsNEW != "NEW") {
  539. CommAX.CommPort = sCommPort;
  540. CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
  541. }
  542. }
  543. if (pIsNEW != "NEW") {
  544. portOpenTF = CommAX.PortOpen("true");
  545. }
  546. if (pIsNEW != "NEW") {
  547. if(portOpenTF == "TRUE") {
  548. // 2008.07.31 - 주민번호 라인 변경
  549. sSndMsg += "^XA^LH" + (parseInt(iLeft) + 20) + "," + (parseInt(iTop) + 20); // 출력시작
  550. sSndMsg += "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 05) + "^BC400,40,N,N,N^FD" + sPid + "^FS"; // 바코드(등록번호)
  551. sSndMsg += "^CFE40,40" + "^FO" + (parseInt(iLeft) + 340) + "," + (parseInt(iTop) + 10) + "^FD" + sSex + "/" + sAge + "^FS"; // 성별,나이
  552. sSndMsg += CommAX.PrtImgOut(parseInt(iLeft) + 10, parseInt(iTop) + 50, sHngnm, 1, 2); // 환자명 - 가로시작위치, 세로시작위치, 출력할문자열, 1,1 (비율:X, Y)
  553. sSndMsg += CommAX.HanImageData();
  554. // 2009.06.01 - pRoomyn 조건 주석처리
  555. //if (pRoomyn == "Y") {
  556. sSndMsg += "^CFE18,18" + "^FO" + (parseInt(iLeft) + 300) + "," + (parseInt(iTop) + 50) + "^FD" + sRoomcd + "^FS";
  557. //}
  558. sSndMsg += "^CFE18,18" + "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 100) + "^FD" + sPid + "^FS"; // 등록번호
  559. sSndMsg += "^CFE30,30" + "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 130) + "^FD" + sRrgstno + "^FS"; // 주민번호
  560. sSndMsg += "^CFA30,30" + "^FO" + (parseInt(iLeft) + 235) + "," + (parseInt(iTop) + 100) + "^FD" + sIndd + "^FS"; // 입원일자
  561. sSndMsg += "^PQ1"; // 출력매수
  562. sSndMsg += "^XZ";
  563. CommAX.SendMessage(sSndMsg); // 출력
  564. CommAX.PortOpen("false"); // 출력종료
  565. } else {
  566. messageBox("아래 사항을 확인후 재출력해주십시오."
  567. + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
  568. + " \n 2.케이블 확인"
  569. + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
  570. return;
  571. }
  572. } else {
  573. sSndMsg += "^XA^LH" + (parseInt(iLeft) + 20) + "," + (parseInt(iTop) + 20); // 출력시작
  574. sSndMsg += "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 05) + "^BC400,40,N,N,N^FD" + sPid + "^FS"; // 바코드(등록번호)
  575. sSndMsg += "^CFE40,40" + "^FO" + (parseInt(iLeft) + 340) + "," + (parseInt(iTop) + 10) + "^FD" + sSex + "/" + sAge + "^FS"; // 성별,나이
  576. sSndMsg += CommAX.PrtImgOut(parseInt(iLeft) + 10, parseInt(iTop) + 50, sHngnm, 1, 2); // 환자명 - 가로시작위치, 세로시작위치, 출력할문자열, 1,1 (비율:X, Y)
  577. sSndMsg += CommAX.HanImageData();
  578. // 2009.06.01 - pRoomyn 조건 주석처리
  579. //if (pRoomyn == "Y") {
  580. sSndMsg += "^CFE18,18" + "^FO" + (parseInt(iLeft) + 300) + "," + (parseInt(iTop) + 50) + "^FD" + sRoomcd + "^FS";
  581. //}
  582. sSndMsg += "^CFE18,18" + "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 100) + "^FD" + sPid + "^FS"; // 등록번호
  583. sSndMsg += "^CFE30,30" + "^FO" + (parseInt(iLeft) + 10) + "," + (parseInt(iTop) + 130) + "^FD" + sRrgstno + "^FS"; // 주민번호
  584. sSndMsg += "^CFA30,30" + "^FO" + (parseInt(iLeft) + 235) + "," + (parseInt(iTop) + 100) + "^FD" + sIndd + "^FS"; // 입원일자
  585. sSndMsg += "^PQ1"; // 출력매수
  586. sSndMsg += "^XZ";
  587. CommAX.SendMsg(sSndMsg); // 출력
  588. }
  589. }
  590. */
  591. }
  592. }
  593. //maxaddr없는 일반적인 경우, 서버에서 mac를 받아옴
  594. function fGetBarCodeInfo(scrnid){
  595. model.resetInstanceNode("/root/send/reqdata");
  596. model.makeValue("/root/send/scrnid", scrnid);
  597. submit("TRLLC90101");
  598. }
  599. //각종 약정서 및 카드발급등 원격으로 출력할시 프린터 세팅
  600. /////////////////사용안함//////////////////////////////////
  601. function pmifGetPrintSetting(pPrint) {
  602. /*
  603. 파라미터정의
  604. pPrint : print1 - 입원약정서
  605. print2 - 입원환자카드
  606. print3 - 선택신청
  607. print4 - 환자카드발행
  608. C:\\cmcnuprinter\\printersetting.ini 파일 존재해야하며 내용은 아래와 같음
  609. ex1)
  610. [printers]
  611. print1=\\10.20.73.57\aficio2022 --입원약정서
  612. print2=\\10.20.73.57\aficio2022 --입원환자카드
  613. print3=\\10.20.73.57\aficio2022 --선택신청
  614. print4=Zebra P330i Card Printer USB --환자카드발행
  615. [Tray]
  616. trayno=1
  617. ex2)
  618. [printers]
  619. print1=입원예정자
  620. print2=\\프린터IP\드라이버이름
  621. print3=\\127.0.0.1\HP LaserJet 1020
  622. [trayno]
  623. print1=1
  624. print2=2
  625. print3=1
  626. [printers] 섹션은 프린터 드라이브 명을 입력하며,
  627. print1은 입원약정서
  628. print2는 입원등록카드
  629. print3은 선택진료신청서를
  630. 출력하기 위한 프린터 드라이버 이름이다.
  631. [trayno] 는각각의 출력물들에 대해서 프린터의 어떤 용지함으로
  632. 출력할 지를 지정하는 정보이다. [printers] 섹션과 마찬가지로,
  633. print1은 입원약정서,
  634. print2는 입원등록카드,
  635. print3은 선택진료신청서를 출력하기 위한 tray(용지함) 번호를 지정한다.
  636. */
  637. var resultArray = new Array();
  638. var fileName = "C:\\cmcnuprinter\\printersetting.ini";
  639. var fso = new ActiveXObject("Scripting.FileSystemObject");
  640. var isExist = fso.FileExists(fileName);
  641. var file = null;
  642. var fileContent = null;
  643. if (isExist == true) {
  644. // 파일에 설정되어 있는 프린터로 출력을 설정한다.
  645. resultArray[0] = document.readIniFile("printers", pPrint, "true", fileName);
  646. resultArray[1] = document.readIniFile("trayno", pPrint, "1", fileName);
  647. } else {
  648. // 기존의 출력 모듈을 그대로 따른다.
  649. resultArray[0] = false;
  650. }
  651. return resultArray;
  652. }
  653. /*
  654. * 입원약정서 출력
  655. * 진료시 입원결정서 작성한 후 출력 할 수 있게끔.
  656. * 최초작성일 : 2011.01.19 노회식
  657. * 파라미터 : vpid - 환자번호
  658. * : vinrsrvacptdd - 입원희망일자
  659. * : vorddeptcd - 입원결정과
  660. * : vdeciflag - 약정서 분류 R : 입원전 결정서 존재시 출력, I : 입원결정 후, C : 전과전실시
  661. * vdeciflag = "R" 로 고정하여 예약정보만 있을 때 출력. 입원 후 출력시에는 fInDeciPrintlss() 사용 해야함.
  662. */
  663. function fInDeciPrint(vpid,vinrsrvacptdd,vorddeptcd,vdeciflag)
  664. {
  665. model.removeNodeset("/root/hidden/h_deciprint/deciprint");
  666. model.makeNode("/root/hidden/h_deciprint/deciprint/indd"); //입원일 - 입원일시
  667. model.makeNode("/root/hidden/h_deciprint/deciprint/inpath"); //입원경로
  668. model.makeNode("/root/hidden/h_deciprint/deciprint/roomcd"); //입원병실
  669. model.makeNode("/root/hidden/h_deciprint/deciprint/orddeptcd"); //진료과
  670. model.makeNode("/root/hidden/h_deciprint/deciprint/orddrid"); //선택의
  671. model.makeNode("/root/hidden/h_deciprint/deciprint/specordyn"); //선택의/지정의
  672. model.makeNode("/root/hidden/h_deciprint/deciprint/pid"); //등록번호
  673. model.makeNode("/root/hidden/h_deciprint/deciprint/hngnm"); //환자성명
  674. model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno"); //주민번호
  675. model.makeNode("/root/hidden/h_deciprint/deciprint/sex"); //성별1
  676. model.makeNode("/root/hidden/h_deciprint/deciprint/religncd"); //종교
  677. model.makeNode("/root/hidden/h_deciprint/deciprint/address"); //주소 = 상위주소 + 하위주소
  678. model.makeNode("/root/hidden/h_deciprint/deciprint/hometel"); //전화번호
  679. model.makeNode("/root/hidden/h_deciprint/deciprint/mpphontel"); //휴대폰
  680. model.makeNode("/root/hidden/h_deciprint/deciprint/insukind"); //보험유형
  681. model.makeNode("/root/hidden/h_deciprint/deciprint/insucd"); //기관기호
  682. model.makeNode("/root/hidden/h_deciprint/deciprint/insuno"); //증번호
  683. model.makeNode("/root/hidden/h_deciprint/deciprint/insdnm"); //세대주(피보험자)
  684. model.makeNode("/root/hidden/h_deciprint/deciprint/diagcd"); //상병코드
  685. model.makeNode("/root/hidden/h_deciprint/deciprint/termhngnm"); //상병명
  686. model.makeNode("/root/hidden/h_deciprint/deciprint/inschedd"); //입원예정일
  687. model.makeNode("/root/hidden/h_deciprint/deciprint/opschedd"); //수술예정일
  688. model.makeNode("/root/hidden/h_deciprint/deciprint/indirecdrnm"); //의뢰자
  689. model.makeNode("/root/hidden/h_deciprint/deciprint/inrsrvacptdt"); //의뢰일시
  690. model.makeNode("/root/hidden/h_deciprint/deciprint/handicapryn1"); //장애인유무체크
  691. model.makeNode("/root/hidden/h_deciprint/deciprint/handicapryn2"); //장애인유무체크
  692. model.makeNode("/root/hidden/h_deciprint/deciprint/inrsrvrem"); //원무참고사항
  693. model.makeNode("/root/hidden/h_deciprint/deciprint/cnstyn"); //의뢰서제출여부
  694. model.makeNode("/root/hidden/h_deciprint/deciprint/rareobstflag"); //희귀난치
  695. model.makeNode("/root/hidden/h_deciprint/deciprint/disregprson3"); //차상위
  696. model.makeNode("/root/hidden/h_deciprint/deciprint/wardnm"); //병동명
  697. model.makeNode("/root/hidden/h_deciprint/deciprint/bedcnt"); //병상수
  698. model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno1"); //주민번호앞자리
  699. model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno2"); //주민번호뒷자리
  700. model.makeNode("/root/hidden/h_deciprint/deciprint/insukindcd"); //보험유형코드
  701. model.makeNode("/root/hidden/h_deciprint/deciprint/grnternm"); //보증인명
  702. model.makeNode("/root/hidden/h_deciprint/deciprint/grntertel"); //보증인전화번호
  703. model.makeNode("/root/hidden/h_deciprint/deciprint/realcd"); //보증인관계
  704. model.makeNode("/root/hidden/h_deciprint/deciprint/addr"); //보증인주소
  705. model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno1"); //보증인주민번호앞자리
  706. model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno2"); //보증인주민번호뒷자리
  707. model.makeNode("/root/hidden/h_deciprint/deciprint/grntermpphontel"); //보증인휴대전화번호
  708. model.makeNode("/root/hidden/h_deciprint/deciprint/worknm"); //보증인직장명
  709. model.makeNode("/root/hidden/h_deciprint/deciprint/worktel"); //보증인직장전화번호
  710. model.makeNode("/root/hidden/h_deciprint/deciprint/grnternm1"); //보증인명1
  711. model.makeNode("/root/hidden/h_deciprint/deciprint/grntertel1"); //보증인전화번호1
  712. model.makeNode("/root/hidden/h_deciprint/deciprint/real1"); //보증인관계1
  713. model.makeNode("/root/hidden/h_deciprint/deciprint/addr1"); //보증인주소1
  714. model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno11"); //보증인주민번호앞자리1
  715. model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno12"); //보증인주민번호뒷자리1
  716. model.makeNode("/root/hidden/h_deciprint/deciprint/grntermpphontel1"); //보증인휴대전화번호1
  717. model.makeNode("/root/hidden/h_deciprint/deciprint/worknm1"); //보증인직장명1
  718. model.makeNode("/root/hidden/h_deciprint/deciprint/worktel1"); //보증인직장전화번호1
  719. model.makeNode("/root/hidden/h_deciprint/deciprint/centcd"); //센터명
  720. model.makeNode("/root/hidden/h_deciprint/deciprint/instcd"); //병원명
  721. model.makeNode("/root/hidden/h_deciprint/deciprint/hosptel"); //병원전화번호
  722. model.makeValue("/root/send/data40/pid",vpid);
  723. model.makeValue("/root/send/data40/inrsrvacptdd",vinrsrvacptdd);
  724. model.makeValue("/root/send/data40/orddeptcd",vorddeptcd);
  725. model.makeValue("/root/send/data40/deciflag",vdeciflag);
  726. if(submit("TRPMI01201") == true) {
  727. var indd = model.getValue("/root/hidden/h_deciprint/deciprint/indd");
  728. if (indd != null && indd != " " && indd != "") {
  729. var s_indd = indd.substr(0,4) + "-" +
  730. indd.substr(4,2) + "-" +
  731. indd.substr(6,2);
  732. model.setValue("/root/hidden/h_deciprint/deciprint/indd", s_indd);
  733. }
  734. var rrgstno = model.getValue("/root/hidden/h_deciprint/deciprint/rrgstno");
  735. var s_rrgstno = rrgstno.substr(0,6) + "-" + rrgstno.substr(6,7);
  736. model.setValue("/root/hidden/h_deciprint/deciprint/rrgstno",s_rrgstno);
  737. var sinschedd = model.getValue("/root/hidden/h_deciprint/deciprint/inschedd");
  738. var sopschedd = model.getValue("/root/hidden/h_deciprint/deciprint/opschedd");
  739. var sinrsrvacptdt = model.getValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt");
  740. var s_inrsrvacptdt = sinrsrvacptdt.substr(0,4) + "/" +
  741. sinrsrvacptdt.substr(4,2) + "/" +
  742. sinrsrvacptdt.substr(6,2) + " " +
  743. sinrsrvacptdt.substr(8,2) + ":" +
  744. sinrsrvacptdt.substr(10,2);
  745. model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt","");
  746. if (sinschedd != null && sinschedd != "" && sinschedd != " ") {
  747. model.setValue ("/root/hidden/h_deciprint/deciprint/inschedd", sinschedd.substr(0,4) + "년" + " " + sinschedd.substr(4,2) + "월" + " " + sinschedd.substr(6.2) + "일");
  748. }
  749. if (sopschedd != null && sopschedd != "" && sopschedd != " ") {
  750. model.setValue ("/root/hidden/h_deciprint/deciprint/opschedd",sopschedd.substr(0,4) + "년" + " " + sopschedd.substr(4,2) + "월" + " " + sopschedd.substr(6.2) + "일");
  751. }
  752. if (sinrsrvacptdt != null && sinrsrvacptdt != "" && sinrsrvacptdt != " ") {
  753. model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt",s_inrsrvacptdt);
  754. }
  755. }
  756. var sNhicRareobstflag = model.getValue("/root/main/nhicinfo/nhic_rareobstflag");
  757. var sNhicDisregprson3 = model.getValue("/root/main/nhicinfo/nhic_disregprson3");
  758. if (sNhicRareobstflag == "H") {
  759. model.setValue("/root/hidden/h_deciprint/deciprint/rareobstflag", "희귀난치"); //희귀난치
  760. } else {
  761. model.setValue("/root/hidden/h_deciprint/deciprint/rareobstflag", ""); //희귀난치
  762. }
  763. if (sNhicDisregprson3 == "32") {
  764. model.setValue("/root/hidden/h_deciprint/deciprint/disregprson3", "차상위"); //차상위
  765. } else {
  766. model.setValue("/root/hidden/h_deciprint/deciprint/disregprson3", ""); //차상위
  767. }
  768. //공통코드 P0045에서 프린터 명칭과 트레이 호출-입원약정서
  769. fGetPrintName();
  770. var print_name = getGlobalVariable("SPPAO00100_P0045_2_nm","p");
  771. var print_tray = getGlobalVariable("SPPAO00100_P0045_2_tray","p");
  772. //호출끝
  773. //입원약정서
  774. if(print_name != "false"){
  775. exeReportPreview("RPPMI01200", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
  776. }
  777. }
  778. /*
  779. * 입원약정서 출력
  780. * 입원정보inpt 저장된 후 입원약정서 출력하는 함수.
  781. * 최초작성일 : 2011.01.19 노회식
  782. * 파라미터 : vpid - 환자번호
  783. * : vindd - 입원일자
  784. * : vcretno - 생성번호
  785. * : vmskind - 주부유형
  786. * : vorddeptcd - 입원결정과
  787. * : vmedispclid - 전문의ID
  788. * : vdeciflag - 약정서 분류 R : 입원전 결정서 존재시 출력, I : 입원결정 후, C : 전과전실시
  789. * 입원정보 있을 경우 사용 orgordtype(ordtype) 이 E, D, C 일경우 vdeciflag = C else I
  790. *
  791. * 전과전실화면에 fInDeciPrintls 라는 이름으로 따로 실행시켜요. 응급실 재원환자의 입원약정서를 출력할 때 필요해요. 수정시 같이 해야합니다.
  792. *
  793. */
  794. function fInDeciPrintlss(vpid, vindd, vcretno, vmskind, vorddeptcd, vmedispclid, vdeciflag)
  795. {
  796. //공통코드 P0045에서 프린터 명칭과 트레이 호출 -입원약정서
  797. fGetPrintName();
  798. var print_name = getGlobalVariable("SPPAO00100_P0045_2_nm","p");
  799. var print_tray = getGlobalVariable("SPPAO00100_P0045_2_tray","p");
  800. //호출끝
  801. //입원약정서
  802. if(print_name == "false"){
  803. return false;
  804. }
  805. model.removeNodeset("/root/hidden/h_deciprint/deciprint");
  806. model.makeNode("/root/hidden/h_deciprint/deciprint/indd"); //입원일 - 입원일시
  807. model.makeNode("/root/hidden/h_deciprint/deciprint/inpath"); //입원경로
  808. model.makeNode("/root/hidden/h_deciprint/deciprint/roomcd"); //입원병실
  809. model.makeNode("/root/hidden/h_deciprint/deciprint/orddeptcd"); //진료과
  810. model.makeNode("/root/hidden/h_deciprint/deciprint/orddrid"); //선택의
  811. model.makeNode("/root/hidden/h_deciprint/deciprint/specordyn"); //선택의/지정의
  812. model.makeNode("/root/hidden/h_deciprint/deciprint/pid"); //등록번호
  813. model.makeNode("/root/hidden/h_deciprint/deciprint/hngnm"); //환자성명
  814. model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno"); //주민번호
  815. model.makeNode("/root/hidden/h_deciprint/deciprint/sex"); //성별1
  816. model.makeNode("/root/hidden/h_deciprint/deciprint/religncd"); //종교
  817. model.makeNode("/root/hidden/h_deciprint/deciprint/address"); //주소 = 상위주소 + 하위주소
  818. model.makeNode("/root/hidden/h_deciprint/deciprint/hometel"); //전화번호
  819. model.makeNode("/root/hidden/h_deciprint/deciprint/mpphontel"); //휴대폰
  820. model.makeNode("/root/hidden/h_deciprint/deciprint/insukind"); //보험유형
  821. model.makeNode("/root/hidden/h_deciprint/deciprint/insucd"); //기관기호
  822. model.makeNode("/root/hidden/h_deciprint/deciprint/insuno"); //증번호
  823. model.makeNode("/root/hidden/h_deciprint/deciprint/insdnm"); //세대주(피보험자)
  824. model.makeNode("/root/hidden/h_deciprint/deciprint/diagcd"); //상병코드
  825. model.makeNode("/root/hidden/h_deciprint/deciprint/termhngnm"); //상병명
  826. model.makeNode("/root/hidden/h_deciprint/deciprint/inschedd"); //입원예정일
  827. model.makeNode("/root/hidden/h_deciprint/deciprint/opschedd"); //수술예정일
  828. model.makeNode("/root/hidden/h_deciprint/deciprint/indirecdrnm"); //의뢰자
  829. model.makeNode("/root/hidden/h_deciprint/deciprint/inrsrvacptdt"); //의뢰일시
  830. model.makeNode("/root/hidden/h_deciprint/deciprint/handicapryn1"); //장애인유무체크
  831. model.makeNode("/root/hidden/h_deciprint/deciprint/handicapryn2"); //장애인유무체크
  832. model.makeNode("/root/hidden/h_deciprint/deciprint/inrsrvrem"); //원무참고사항
  833. model.makeNode("/root/hidden/h_deciprint/deciprint/cnstyn"); //의뢰서제출여부
  834. model.makeNode("/root/hidden/h_deciprint/deciprint/bedcnt"); //병상수
  835. model.makeNode("/root/hidden/h_deciprint/deciprint/wardnm"); //병동명
  836. model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno1"); //주민번호앞자리
  837. model.makeNode("/root/hidden/h_deciprint/deciprint/rrgstno2"); //주민번호뒷자리
  838. model.makeNode("/root/hidden/h_deciprint/deciprint/insukindcd"); //보험유형코드
  839. model.makeNode("/root/hidden/h_deciprint/deciprint/grnternm"); //보증인명
  840. model.makeNode("/root/hidden/h_deciprint/deciprint/grntertel"); //보증인전화번호
  841. model.makeNode("/root/hidden/h_deciprint/deciprint/realcd"); //보증인관계
  842. model.makeNode("/root/hidden/h_deciprint/deciprint/addr"); //보증인주소
  843. model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno1"); //보증인주민번호앞자리
  844. model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno2"); //보증인주민번호뒷자리
  845. model.makeNode("/root/hidden/h_deciprint/deciprint/grntermpphontel"); //보증인휴대전화번호
  846. model.makeNode("/root/hidden/h_deciprint/deciprint/worknm"); //보증인직장명
  847. model.makeNode("/root/hidden/h_deciprint/deciprint/worktel"); //보증인직장전화번호
  848. model.makeNode("/root/hidden/h_deciprint/deciprint/grnternm1"); //보증인명1
  849. model.makeNode("/root/hidden/h_deciprint/deciprint/grntertel1"); //보증인전화번호1
  850. model.makeNode("/root/hidden/h_deciprint/deciprint/real1"); //보증인관계1
  851. model.makeNode("/root/hidden/h_deciprint/deciprint/addr1"); //보증인주소1
  852. model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno11"); //보증인주민번호앞자리1
  853. model.makeNode("/root/hidden/h_deciprint/deciprint/grnterrrgstno12"); //보증인주민번호뒷자리1
  854. model.makeNode("/root/hidden/h_deciprint/deciprint/grntermpphontel1"); //보증인휴대전화번호1
  855. model.makeNode("/root/hidden/h_deciprint/deciprint/worknm1"); //보증인직장명1
  856. model.makeNode("/root/hidden/h_deciprint/deciprint/worktel1"); //보증인직장전화번호1
  857. model.makeNode("/root/hidden/h_deciprint/deciprint/centcd"); //센터명
  858. model.makeNode("/root/hidden/h_deciprint/deciprint/instcd"); //병원명
  859. model.makeNode("/root/hidden/h_deciprint/deciprint/hosptel"); //병원전화번호
  860. model.makeValue("/root/send/data40/pid", vpid);
  861. model.makeValue("/root/send/data40/indd", vindd);
  862. model.makeValue("/root/send/data40/cretno", vcretno);
  863. model.makeValue("/root/send/data40/mskind", vmskind);
  864. model.makeValue("/root/send/data40/orddeptcd", vorddeptcd);
  865. model.makeValue("/root/send/data40/medispclid", vmedispclid);
  866. model.makeValue("/root/send/data40/deciflag", vdeciflag);
  867. if (submit("TRPMI00113") == true) {
  868. var indd = model.getValue("/root/hidden/h_deciprint/deciprint/indd");
  869. if (indd != null && indd != " " && indd != "") {
  870. var s_indd = indd.substr(0,4) + "-" +
  871. indd.substr(4,2) + "-" +
  872. indd.substr(6,2);
  873. model.setValue("/root/hidden/h_deciprint/deciprint/indd",s_indd);
  874. // model.setValue("/root/hidden/h_deciprint/deciprint/mm",indd.substr(4,2));
  875. // model.setValue("/root/hidden/h_deciprint/deciprint/dd",indd.substr(6,2));
  876. var rrgstno = model.getValue("/root/hidden/h_deciprint/deciprint/rrgstno");
  877. var s_rrgstno = rrgstno.substr(0,6) + "-" + rrgstno.substr(6,7);
  878. model.setValue("/root/hidden/h_deciprint/deciprint/rrgstno",s_rrgstno);
  879. var sinschedd = model.getValue("/root/hidden/h_deciprint/deciprint/inschedd");
  880. var sopschedd = model.getValue("/root/hidden/h_deciprint/deciprint/opschedd");
  881. var sinrsrvacptdt = model.getValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt");
  882. var s_inrsrvacptdt = sinrsrvacptdt.substr(0,4) + "/" +
  883. sinrsrvacptdt.substr(4,2) + "/" +
  884. sinrsrvacptdt.substr(6,2) + " " +
  885. sinrsrvacptdt.substr(8,2) + ":" +
  886. sinrsrvacptdt.substr(10,2);
  887. model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt","");
  888. if (sinschedd != null && sinschedd != "" && sinschedd != " ") {
  889. model.setValue ("/root/hidden/h_deciprint/deciprint/inschedd", sinschedd.substr(0,4) + "년" + " " + sinschedd.substr(4,2) + "월" + " " + sinschedd.substr(6.2) + "일");
  890. }
  891. if (sopschedd != null && sopschedd != "" && sopschedd != " ") {
  892. model.setValue ("/root/hidden/h_deciprint/deciprint/opschedd",sopschedd.substr(0,4) + "년" + " " + sopschedd.substr(4,2) + "월" + " " + sopschedd.substr(6.2) + "일");
  893. }
  894. if (sinrsrvacptdt != null && sinrsrvacptdt != "" && sinrsrvacptdt != " ") {
  895. model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvacptdt",s_inrsrvacptdt);
  896. }
  897. var sNhicRareobstflag = model.getValue("/root/hidden/h_deciprint/deciprint/rareobstflag"); // 희귀난치
  898. var sNhicDisregprson3 = model.getValue("/root/hidden/h_deciprint/deciprint/disregprson3"); // 차상위
  899. if (sNhicRareobstflag == "H") {
  900. model.setValue("/root/hidden/h_deciprint/deciprint/rareobstflag", "희귀난치"); //희귀난치
  901. } else {
  902. model.setValue("/root/hidden/h_deciprint/deciprint/rareobstflag", ""); //희귀난치
  903. }
  904. if (sNhicDisregprson3 == "32") {
  905. model.setValue("/root/hidden/h_deciprint/deciprint/disregprson3", "차상위"); //차상위
  906. } else {
  907. model.setValue("/root/hidden/h_deciprint/deciprint/disregprson3", ""); //차상위
  908. }
  909. // 2009.08.07 - zzui - 입원약정서 상병,참고사항 숨김(성가만 적용) - 시작
  910. /*
  911. var rsrvYn = model.getValue("/root/hidden/rsrvyn");
  912. if (rsrvYn == 'N'){
  913. model.setValue("/root/hidden/h_deciprint/deciprint/inrsrvrem","");
  914. model.setValue("/root/hidden/h_deciprint/deciprint/diagcd","");
  915. model.setValue("/root/hidden/h_deciprint/deciprint/termhngnm","");
  916. }
  917. */
  918. // 2009.08.07 - zzui - 입원약정서 상병,참고사항 숨김(성가만 적용) - 끝
  919. // 2009.06.19 - local에 설정된 파일을 우선시 한다.
  920. // print1:입원약정서, print2:입원환자카드, print3:선택신청
  921. /*
  922. var printInfo = pmifGetPrintSetting("print1");
  923. if (printInfo.length == 2) {
  924. sPrinter = printInfo[0];
  925. trayno = printInfo[1];
  926. } else {
  927. // 2008.09.21 입원약정서 출력용 프린터 이름 조회 - 최병진
  928. sPrinter = model.getValue("/root/hidden/printers/deci_printer");
  929. if (isNull(sPrinter)) {
  930. sPrinter = "true";
  931. }
  932. // 2009년 03월 20일, JHP, 트레이정보를 받아서 넣는다.
  933. trayno = model.getValue("/root/hidden/pam/printer/value");
  934. }
  935. */
  936. //공통코드 P0045에서 프린터 명칭과 트레이 호출 -입원약정서
  937. fGetPrintName();
  938. var print_name = getGlobalVariable("SPPAO00100_P0045_2_nm","p");
  939. var print_tray = getGlobalVariable("SPPAO00100_P0045_2_tray","p");
  940. //호출끝
  941. //입원약정서
  942. if(print_name != "false"){
  943. exeReportPreview("RPPMI01200", "XMLSTR" , "" , "" , print_name , "", "", "", "", "true", "", "", print_tray);
  944. }
  945. } else {
  946. var sOrdType = model.getValue("/root/main/inpt/inpt_ordtype");
  947. if (sOrdType == "E" || sOrdType == "D") {
  948. messageBox("응급/DSC/CHEMO 환자입니다. [전과전실승인]화면에서 출력하십시오.!", "I");
  949. }
  950. }
  951. }
  952. }
  953. // 상급병실신청 전자서명관리
  954. function fUpRoomSignMngt(pid, indd, autoflag) {
  955. // 차트번호, 입원일자가 존재하는 경우에만 설정
  956. if (!isNull(pid) && !isNull(indd)) {
  957. setParameter("SPZHA20101_PARM_PID", pid);
  958. setParameter("SPZHA20101_PARM_INDD", indd);
  959. setParameter("SPZHA20101_PARM_AUTOFLAG", autoflag);
  960. }
  961. // 상급병실신청 서명관리화면 호출
  962. modal("SPPMI02800", "", "200", "300");
  963. }
  964. // 입원통지서 및 신청서 출력
  965. function fPrintInNoti(pid, indd, cretno) {
  966. if(isNull(pid)) {
  967. alert("환자를 선택 후 출력하십시오.");
  968. return;
  969. }
  970. model.resetInstanceNode("/root/send/data30");
  971. model.makeValue("/root/send/data30/pid", pid);
  972. model.makeValue("/root/send/data30/indd", indd);
  973. model.makeValue("/root/send/data30/cretno", cretno);
  974. submit("TRPMI00123");
  975. var specwardcd = model.getValue("/root/hidden/innotiinfo/innotiinfo/specwardcd");
  976. // 보호입원 / 행정입원 통지서
  977. if (!isNull(specwardcd) && (specwardcd == "C" || specwardcd == "D")) {
  978. exeReportPreview("RPPMI01205","XMLSTR" , "" , "" , "true" , "", "", "", "", "true");
  979. // 그외 통지서 (자의입원:A, 동의입원:B, 응급입원:E)
  980. } else {
  981. exeReportPreview("RPPMI01204","XMLSTR" , "" , "" , "true" , "", "", "", "", "true");
  982. }
  983. // 신청서는 본원만 적용 - 칠곡 동시적용 20170801
  984. //if (getUserInfo("dutplceinstcd") == "031") {
  985. if (specwardcd == "C") {
  986. // 보호입원신청서 출력
  987. fPerPrintOCR(
  988. model.getValue("/root/init/prncd/hardcd[cdseqno='16']/hardcd"),
  989. pid,
  990. indd,
  991. cretno,
  992. "I",
  993. "O"
  994. );
  995. } else {
  996. // 자의동의입원신청서 출력
  997. fPerPrintOCR(
  998. model.getValue("/root/init/prncd/hardcd[cdseqno='15']/hardcd"),
  999. pid,
  1000. indd,
  1001. cretno,
  1002. "I",
  1003. "O"
  1004. );
  1005. }
  1006. //}
  1007. }
  1008. // 입원통지서 수령 확인서
  1009. function fPrintInNotiConfirm(pid, indd, cretno, hngnm) {
  1010. if(isNull(pid)) {
  1011. alert("환자를 선택 후 출력하십시오.");
  1012. return;
  1013. }
  1014. var ocrtype = "O";
  1015. if(model.getValue("/root/init/PAM/PK018list/PK018[cdid='" + app.clientIp + "']/cdnm") == "Y"){
  1016. if (messageBox("입원통지서 수령 확인서", "Q017") == "6") {
  1017. ocrtype = "S";
  1018. }
  1019. }
  1020. //구분에 맞춰 폼코드 처리(1:일반약정서 / 2:기간약정서 / 3:개인정보이용동의서 / 12:영상정보처리기기수집/이용동의서 / 13:입원통지서 수령 확인서
  1021. var formcd = model.getValue("/root/init/prncd/hardcd[cdseqno='13']/hardcd");
  1022. // COR 출력의 경우
  1023. if (ocrtype == "O") {
  1024. fPerPrintOCR(
  1025. formcd,
  1026. pid,
  1027. indd,
  1028. cretno,
  1029. "I",
  1030. ocrtype
  1031. );
  1032. } else {
  1033. model.makeValue("/root/temp/consent/pid", pid);
  1034. model.makeValue("/root/temp/consent/orddd", indd);
  1035. model.makeValue("/root/temp/consent/cretno", cretno);
  1036. model.makeValue("/root/temp/consent/ordtype", "I");
  1037. model.makeValue("/root/temp/consent/flag", "N"); // N:입원통지서 수령 확인서
  1038. model.makeValue("/root/temp/consent/formcd", formcd);
  1039. model.makeValue("/root/temp/consent/tag1", hngnm);
  1040. model.makeValue("/root/temp/consent/tag2", indd.substr(0,4));
  1041. model.makeValue("/root/temp/consent/tag3", indd.substr(4,2));
  1042. model.makeValue("/root/temp/consent/tag4", indd.substr(6,2));
  1043. fPrintOcrConsent("/root/temp/consent");
  1044. }
  1045. }