PMI001.xjs 53 KB

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