SMADT10201.js 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766
  1. /**
  2. * 파 일 명 : SMADT10200.js
  3. * 설 명 : 병동 처방전/라벨 출력, 병동 마감 Javascript
  4. * 설 계 자 : 공두경
  5. * 작 성 자 : 공두경
  6. * 수정이력 : 2006.6.28 / 수정작성 / 공두경
  7. */
  8. //조회조건에 맞는 데이터가 있는지를 chk
  9. var chk_drugno = 0;
  10. var chk_wardcd = 0;
  11. var chk_pid = 0;
  12. var chk_prnt_count = 0;
  13. var chk_sum_count = 0;
  14. var chk_count = 0;
  15. var gTimer = null;
  16. var gTimer2 = null;
  17. var gT1 = null;
  18. var sleepTime= 1000;
  19. var chk_cnt = 0;
  20. var gCurrPrtObj = null; //현재 출력 IViewer
  21. /**
  22. * 초기화
  23. */
  24. function fInit() {
  25. if (model.getValue("/root/hidden/prcpsrch/prcpdd") == "") {
  26. // 날짜 초기화
  27. model.makeValue("/root/hidden/srchinfo/prcpdd", getCurrentDate());
  28. }
  29. //처방구분 초기화
  30. model.makeValue("/root/hidden/srchinfo/prcpflag", "A");
  31. submit("TRADT10211");
  32. //약주사구분 초기화
  33. model.makeValue("/root/hidden/srchinfo/drugkind", "T");
  34. //라벨 체크 초기화
  35. model.makeValue("/root/hidden/srchinfo/lblyn", "L");
  36. fChkLBL_YN();
  37. //처방전 체크 초기화
  38. model.makeValue("/root/hidden/srchinfo/mpsflag", "P");
  39. //기타조회구분 초기화
  40. model.makeValue("/root/hidden/srchinfo/etcflag", "T");
  41. cbx_etcdescflag.disabled = true;
  42. //마감시 instcd 적용을 위해 instcd 초기화
  43. // model.setValue("/root/hidden/srchinfo/instcd", getUserInfo("posinstcd"));
  44. var dutplceinstcd = getUserInfo("dutplceinstcd");
  45. if(dutplceinstcd == ""){
  46. dutplceinstcd = "012";
  47. }
  48. model.makeValue("/root/hidden/srchinfo/instcd", dutplceinstcd);
  49. //makeReportPreview(0,270,820,700);
  50. //병동 Combo 조회
  51. model.setValue("/root/send/deptinfo/deptflag", "W");
  52. submit("TRADT10203");
  53. astfAddCombo("/root/hidden/deptlist", "ward", "wardcd,wardnm", "T,전체");
  54. //자동출력구분 초기화
  55. btn_autoprnt_start.disabled = false;
  56. btn_autoprnt_end.disabled = true;
  57. //model.setValue("/root/hidden/srchinfo/auto_selflag", "1");
  58. //chk_auto_big.disabled = false;
  59. //chk_auto_small.disabled = true;
  60. //model.setValue("/root/hidden/srchinfo/auto_bigflag", "E|L|G");
  61. //model.setValue("/root/hidden/srchinfo/auto_smallflag", "");
  62. //20100412 황세원 수정 병실컬럼
  63. submit("TRADT10213");
  64. if(model.getValue("init/roomyn/roomyn/roomyn")=="Y") {
  65. grd_patlist.colHidden(5) = false;
  66. model.makeValue("/root/hidden/srchinfo/atc3", "Y");
  67. } else {
  68. model.makeValue("/root/hidden/srchinfo/atc3", "N");
  69. grd_patlist.colHidden(5) = true;
  70. }
  71. model.refresh();
  72. /*/ 병실컬럼
  73. if(dutplceinstcd == "013") {
  74. grd_patlist.colHidden(5) = false;
  75. model.makeValue("/root/hidden/srchinfo/atc3", "Y");
  76. } else {
  77. model.makeValue("/root/hidden/srchinfo/atc3", "N");
  78. grd_patlist.colHidden(5) = true;
  79. }
  80. model.refresh();
  81. */
  82. //마감시간구분
  83. submit("TRADT10212");
  84. cmb_sumtmflag1.select(0);
  85. cmb_sumtmflag2.select(0);
  86. cmb_sumtmflag3.select(0);
  87. //처방전 감사화면에서 팝업으로 열때 데이터 조회
  88. if(model.getValue("/root/hidden/popupinfo/drugno") != ""){
  89. model.setValue("/root/hidden/srchinfo/prcpdd", model.getValue("/root/hidden/popupinfo/prcpdd"));
  90. model.setValue("/root/hidden/srchinfo/fst_drugno", model.getValue("/root/hidden/popupinfo/drugno"));
  91. model.setValue("/root/hidden/srchinfo/pid", model.getValue("/root/hidden/popupinfo/pid"));
  92. //model.setValue("/root/hidden/srchinfo/ward", model.getValue("/root/hidden/popupinfo/ward"));
  93. model.refresh();
  94. fInSumList();
  95. }
  96. //바코드프린터설정 초기화
  97. model.setValue("/root/send/scrnid", getScreenID());
  98. submit("TRLLC90101");
  99. //lzzfMakeBrcdPrntObjHanDo("CommAX");
  100. var comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
  101. var prntkind = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  102. if(comm == "2") {
  103. model.setValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm", "1");
  104. }
  105. if(prntkind == "1") {
  106. model.setValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind", "5");
  107. }
  108. //추가마감시 admission과 병동응급을 함께 마감할지 여부 조회 , ATC순으로 정렬 체크 여부
  109. //20100405 이선경 추가 : 정제 작은라벨(리스트형식) 출력시 ptp 함께 출력할지 여부
  110. submit("TRADT10207");
  111. if(model.getValue("/root/init/sumprcpflagyn/flagyn/orderbyatc") == "Y") {
  112. model.setValue("/root/hidden/srchinfo/orderbyatc", "Y");
  113. model.refresh();
  114. }
  115. // 출고부서 조회, 설정 2009.09.07 pymi
  116. submit("TRADT01106");
  117. // 20101019_laboru_경북대병원_cmc 셋팅을 경북대병원용으로 변경
  118. /*
  119. if((dutplceinstcd == "013") || (dutplceinstcd == "014") || (dutplceinstcd == "017")) {
  120. combo1.select(0);
  121. } else if(dutplceinstcd == "012") {
  122. combo1.select(2);
  123. } else {
  124. combo1.select(1);
  125. }*/
  126. if(dutplceinstcd == "032" || dutplceinstcd == "031") {
  127. combo1.select(0);
  128. } else {
  129. combo1.select(0);
  130. }
  131. //if(dutplceinstcd == "031") {
  132. // checkbox13.visible = false;
  133. //}
  134. chk_cnt ++;
  135. model.setValue("/root/temp/stocdeptcd", model.getValue("/root/hidden/srchinfo/stocdeptcd"));
  136. combo1.refresh();
  137. // (e)
  138. // 2010.03.22 pymi
  139. submit("TRADT01107");
  140. model.setValue("/root/hidden/srchinfo/lbl5", model.getValue("/root/init/lbllists/lbllists/lbl5"));
  141. // (e)
  142. }
  143. /**
  144. * 라벨 변경시 처리
  145. */
  146. function fChkLBL_YN() {
  147. var chk = model.getValue("/root/hidden/srchinfo/lblyn");
  148. var sLbl_Drug = "D|DT|DX|DE|DH";
  149. var sLbl_Inj = "I|IO|IX|IE|IH|IS"; // 20120628_일반수액도 추가(퇴원의 경우)
  150. if(chk != ""){
  151. model.makeValue("/root/hidden/srchinfo/lbl_drug", sLbl_Drug);
  152. model.makeValue("/root/hidden/srchinfo/lbl_inj", sLbl_Inj);
  153. model.makeValue("/root/hidden/srchinfo/drugall", "Y");
  154. model.makeValue("/root/hidden/srchinfo/injall", "Y");
  155. } else {
  156. model.makeValue("/root/hidden/srchinfo/lbl_drug", "");
  157. model.makeValue("/root/hidden/srchinfo/lbl_inj", "");
  158. model.makeValue("/root/hidden/srchinfo/drugall", "");
  159. model.makeValue("/root/hidden/srchinfo/injall", "");
  160. }
  161. //라벨 출력 형식 옵션
  162. submit("TRADT10208");
  163. if(model.getValue("/root/init/lbltype/item2/lbltype") == "Y") {
  164. checkbox10.visible = true;
  165. checkbox3.visible = true;
  166. } else {
  167. checkbox10.visible = false;
  168. checkbox3.visible = false;
  169. }
  170. }
  171. /**
  172. * 마감리스트 조회
  173. */
  174. function fInSumList() {
  175. model.removeNodeset("/root/main/sumlist/sumlist");
  176. model.refresh();
  177. chk_ward.visible = false;
  178. if(model.getValue("/root/hidden/srchinfo/prcpflag") == ""){
  179. messageBox("처방구분을", "C001")
  180. return;
  181. }
  182. if(model.getValue("/root/hidden/srchinfo/prcpflag").indexOf("Z") >= 0 && model.getValue("/root/hidden/srchinfo/prcpflag").length > 1){
  183. messageBox("처방구분 '정규약(508응급병동)'을 중복 선택할 수 없습니다.", "C");
  184. model.setValue("/root/hidden/srchinfo/prcpflag", "");
  185. rdo_prcp.refresh();
  186. rdo_prcp2.refresh();
  187. return;
  188. }
  189. prcpflag = model.getValue("/root/hidden/srchinfo/prcpflag");
  190. model.setValue("/root/send/suminfo/prcpflag", prcpflag);
  191. model.copyNode("/root/send/sumlistinfo", "/root/hidden/srchinfo");
  192. model.makeValue("/root/send/sumlistinfo/version", "new");
  193. //20100301 이선경 수정 : 자동라벨출력시 라벨그룹별로 마감대상 조회되도록
  194. if(model.getValue("/root/hidden/srchinfo/autolblyn") == "Y") {
  195. var lblstr = model.getValue("/root/hidden/srchinfo/autolblflag");
  196. var lblstr2 = lblstr.setReplaceWord("AD", "D|DX|DH|DP");
  197. lblstr2 = lblstr2.setReplaceWord("AI", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
  198. model.makeValue("/root/send/sumlistinfo/autolblflag", lblstr2);
  199. }
  200. // 20130115_심사실퇴원 처방 조회
  201. /* if(prcpflag == "J") {
  202. alert("dd");
  203. model.setValue("/root/hidden/srchinfo/prcpflag","L");
  204. model.makeValue("/root/hidden/srchinfo/prcpsimflag","J");
  205. }*/
  206. submit("TRADT10201");
  207. grd_sumlist.isSelected(grd_sumlist.fixedRows) = true;
  208. grd_sumlist.row = grd_sumlist.fixedRows;
  209. if(grd_sumlist.Rows > 1){ //20100210 이선경 주석 : 마감일자를 체크해서 조회하도록 함
  210. model.setValue("/root/main/sumlist/sumlist[1]/sel", "Y");
  211. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  212. } else {
  213. model.removeNodeset("/root/main/patlist/patlist");
  214. model.refresh();
  215. }
  216. }
  217. /**
  218. * 병동 마감
  219. */
  220. function fHosInSum(chk, auto) {
  221. var prcpflag = "";
  222. var prcpdd = model.getValue("/root/hidden/srchinfo/prcpdd");
  223. var instcd = model.getValue("/root/hidden/srchinfo/instcd");
  224. var pid = model.getValue("/root/hidden/srchinfo/pid");
  225. var drugkind = model.getValue("/root/hidden/srchinfo/drugkind");
  226. var onlyantis = model.getValue("/root/hidden/srchinfo/onlyantis");
  227. var prcpflagnm = rdo_prcp.label;
  228. var chkret = 0;
  229. var fromddflag = "";
  230. var fromdd = "";
  231. var fromtm = "";
  232. var toddflag = "";
  233. var todd = "";
  234. var totm = "";
  235. var sumdt = getCurrentDateTime().replace(" ", "");
  236. prcpflag = model.getValue("/root/hidden/srchinfo/prcpflag");
  237. if(chk == "Y") {
  238. if(prcpflag == "R") {//정규마감구분
  239. fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag1");
  240. fromtm = model.getValue("/root/hidden/srchinfo/fromtm1");
  241. toddflag = model.getValue("/root/hidden/srchinfo/toddflag1");
  242. totm = model.getValue("/root/hidden/srchinfo/totm1");
  243. } else if(prcpflag == "Z") {//정규약(508응급병동)
  244. fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag1");
  245. fromtm = model.getValue("/root/hidden/srchinfo/fromtm1");
  246. toddflag = model.getValue("/root/hidden/srchinfo/toddflag1");
  247. totm = model.getValue("/root/hidden/srchinfo/totm1");
  248. } else if(prcpflag == "A") {//추가마감구분
  249. fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag2");
  250. fromtm = model.getValue("/root/hidden/srchinfo/fromtm2");
  251. toddflag = model.getValue("/root/hidden/srchinfo/toddflag2");
  252. totm = model.getValue("/root/hidden/srchinfo/totm2");
  253. } else if(prcpflag == "K") {// 응급실마감구분
  254. fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag3");
  255. fromtm = model.getValue("/root/hidden/srchinfo/fromtm3");
  256. toddflag = model.getValue("/root/hidden/srchinfo/toddflag3");
  257. totm = model.getValue("/root/hidden/srchinfo/totm3");
  258. }
  259. if ( prcpflag =="R" || prcpflag =="Z" || prcpflag =="A" || prcpflag == "K"){
  260. if( fromddflag == "" || fromtm == "" || toddflag == "" || totm == "" || fromtm.length != 4 || totm.length != 4) {
  261. messageBox("마감구분이 잘못", "E005");
  262. return;
  263. } else {
  264. if(fromddflag == "0") {
  265. fromdd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD") ;
  266. } else {
  267. fromdd = prcpdd ;
  268. }
  269. if(toddflag == "0") {
  270. todd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD") ;
  271. } else {
  272. todd = prcpdd ;
  273. }
  274. fromtm = fromtm + "00";
  275. totm = totm + "59";
  276. }
  277. } else {
  278. fromdd = "" ;
  279. todd = "" ;
  280. fromtm ="";
  281. totm ="";
  282. }
  283. chkret = 6 ; //messageBox(prcpflagnm + "마감을", "Q004");
  284. } else {
  285. if (prcpflag == "Z" && chk == "N" && auto == "auto") {
  286. //fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag1");
  287. //fromtm = model.getValue("/root/hidden/srchinfo/fromtm1");
  288. //toddflag = model.getValue("/root/hidden/srchinfo/toddflag1");
  289. //totm = model.getValue("/root/hidden/srchinfo/totm1");
  290. fromdd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD");
  291. fromtm = '030000'
  292. //todd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(1,"D")).getDateFormat("YYYYMMDD");
  293. todd = prcpdd;
  294. totm = '235959';
  295. //멀티데이 처방 출력시 업무 알아봐야 함
  296. }
  297. chkret = 6;
  298. }
  299. if(chkret == 6){
  300. if(model.getValue("/root/hidden/srchinfo/prcpflag") != "C2") {
  301. if(chk == "Y") {
  302. model.setValue("/root/send/suminfo/fromdd", fromdd);
  303. model.setValue("/root/send/suminfo/fromtm", fromtm);
  304. model.setValue("/root/send/suminfo/todd", todd);
  305. model.setValue("/root/send/suminfo/totm", totm);
  306. //model.makeValue("/root/send/suminfo/autoyn", "N"); 20100217 이선경 주석
  307. } else {
  308. if (prcpflag == "Z") {
  309. model.setValue("/root/send/suminfo/fromdd", fromdd);
  310. model.setValue("/root/send/suminfo/fromtm", fromtm);
  311. model.setValue("/root/send/suminfo/todd", todd);
  312. model.setValue("/root/send/suminfo/totm", totm);
  313. } else {
  314. model.setValue("/root/send/suminfo/fromdd", "");
  315. model.setValue("/root/send/suminfo/fromtm", "");
  316. model.setValue("/root/send/suminfo/todd", "");
  317. model.setValue("/root/send/suminfo/totm", "");
  318. }
  319. }
  320. model.setValue("/root/send/suminfo/sumdt", sumdt);
  321. model.setValue("/root/send/suminfo/prcpdd", prcpdd);
  322. model.setValue("/root/send/suminfo/prcpflag", prcpflag);
  323. model.setValue("/root/send/suminfo/instcd", instcd);
  324. model.setValue("/root/send/suminfo/pid", pid);
  325. model.setValue("/root/send/suminfo/sumdrugkind", drugkind);
  326. model.setValue("/root/send/suminfo/onlyantis", onlyantis);
  327. model.setValue("/root/send/suminfo/mstocdeptcd", model.getValue("/root/hidden/srchinfo/stocdeptcd")); // 2009.09.11 pymi
  328. model.setValue("/root/send/suminfo/ioflag", "I");
  329. model.makeValue("/root/send/suminfo/multiyn", model.getValue("/root/hidden/srchinfo/multiyn")); //multi day 처방 포함 여부
  330. model.makeValue("/root/send/suminfo/dinjyn", model.getValue("/root/hidden/srchinfo/dinjyn")); // 20121120_항암주사실 제외 여부
  331. var dinjonlyyn = model.getValue("/root/hidden/srchinfo/dinjonlyyn"); // 20121120_항암주사실만 여부
  332. if(prcpflag == "A" || prcpflag == "R") {//20110102 이선경 수정 : 경북대병원 병동별로 마감호출( 약번호 순서 : 병동, 파우더, 등록번호)
  333. if(dinjonlyyn == "Y") {
  334. model.makeValue("/root/send/suminfo/wardcd", "3120900000"); // 20121121_항암주사실만 체크 시 항암주사실만 마감 되도록 수정
  335. submit("TXADT10201");
  336. } else {
  337. for(var i = 2 ; i <= getNodesetCount("/root/hidden/deptlist/ward"); i++) {
  338. model.makeValue("/root/send/suminfo/wardcd", model.getValue("/root/hidden/deptlist/ward["+ i + "]/wardcd"));
  339. submit("TXADT10201");
  340. }
  341. }
  342. } else if(prcpflag == "K") { // 20120519_laboru
  343. //model.makeValue("/root/send/suminfo/wardcd", model.getValue("/root/hidden/deptlist/ward["+ i + "]/wardcd"));
  344. submit("TXADT10201");
  345. } else {
  346. submit("TXADT10201");
  347. }
  348. //추가마감시 flayn=Y이면 admission과 병동응급도 마감을 한다.
  349. /*if(chk == "Y" && prcpflag == "A" && model.getValue("/root/init/sumprcpflagyn/flagyn/flagyn") == "Y") {
  350. model.setValue("/root/send/suminfo/prcpflag", "M");
  351. for(var i = 0 ; i < 5; i++) {
  352. submit("TXADT10201");
  353. }
  354. model.setValue("/root/send/suminfo/prcpflag", "W");
  355. for(var i = 0 ; i < 5; i++) {
  356. submit("TXADT10201");
  357. }
  358. }*/ //20100211 이선경 수정 : 멀티체크해서 마감하는 기능이 있으므로 주석처리
  359. if (model.getValue("/root/hidden/srchinfo/prcpflag")=="L" || model.getValue("/root/hidden/srchinfo/prcpflag")=="G" ) {
  360. model.setValue("/root/send/suminfo/prcpdd", prcpdd);
  361. model.setValue("/root/send/suminfo/prcpflag", prcpflag);
  362. model.setValue("/root/send/suminfo/instcd", instcd);
  363. model.setValue("/root/send/suminfo/pid", pid);
  364. model.setValue("/root/send/suminfo/ioflag", "O");
  365. for(var i = 0 ; i < 5; i++) {
  366. submit("TXADT10201");
  367. }
  368. }
  369. if(prcpflag =="J") {
  370. //model.makeValue("/root/send/suminfo/wardcd", "4070700000"); // 20130114_심사실 퇴원
  371. submit("TXADT10201");
  372. }
  373. }
  374. //20100818 이선경 : 임상연구 일반약 80000번대로 마감
  375. model.makeValue("/root/send/srchinfo/srchprcpdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
  376. model.makeValue("/root/send/srchinfo/crsumflag", "N");
  377. model.makeValue("/root/send/srchinfo/orgdrugflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
  378. model.makeValue("/root/send/srchinfo/sumdt", sumdt);
  379. var drugkind = model.getValue("/root/hidden/srchinfo/drugkind");
  380. if(model.getValue("/root/hidden/srchinfo/prcpflag") != "C2") {
  381. if(model.getValue("/root/hidden/srchinfo/prcpflag") != "L" && model.getValue("/root/hidden/srchinfo/prcpflag") !="G") {
  382. if(drugkind == "T") {
  383. //주사 마감
  384. model.makeValue("/root/send/srchinfo/crdrugkind", "M");
  385. submit("TXADC10902");
  386. //약 마감
  387. model.makeValue("/root/send/srchinfo/crdrugkind", "D");
  388. submit("TXADC10902");
  389. } else if(drugkind == "D") {
  390. //약 마감
  391. model.makeValue("/root/send/srchinfo/crdrugkind", "D");
  392. submit("TXADC10902");
  393. } else if(drugkind == "M") {
  394. //주사 마감
  395. model.makeValue("/root/send/srchinfo/crdrugkind", "M");
  396. submit("TXADC10902");
  397. }
  398. } else {
  399. model.makeValue("/root/send/srchinfo/crdrugkind", "");
  400. submit("TXADC10902");
  401. }
  402. }
  403. //20100831 이선경 추가 : 임상연구 일반약 외래주사 마감 기능 추가
  404. if((auto != "auto" && isSearchString(rdo_prcp2.value, "C2"))|| (auto == "auto" && isSearchString(chk_auto_small.value, "C2")) ) {
  405. model.makeValue("/root/send/srchinfo/srchprcpdd", model.getValue( "/root/hidden/srchinfo/prcpdd"));
  406. model.makeValue("/root/send/srchinfo/crsumflag", "I");
  407. model.makeValue("/root/send/srchinfo/hosinhosout", "I"); //원내
  408. submit("TXADC10901"); //외래임상약 마감하는 것과 동일 소스임 (수정시 주의)
  409. }
  410. }
  411. }
  412. /**
  413. * 마감리스트 더블클릭시 출력할 환자리스트 조회
  414. */
  415. function fPrntPatList() {
  416. model.removeNodeset("/root/main/patlist/patlist");
  417. grd_patlist.rebuildStyle();
  418. // if(model.getValue("/root/main/sumlist/sumlist["+grd_sumlist.row+"]/sumdt") != ""){
  419. //20100210 이선경 수정 : 마감일자 멀티체크 조회 가능하도록 함
  420. var strsumdt = "";
  421. for(var i = 1 ; i <= getNodesetCount("/root/main/sumlist/sumlist") ; i++) {
  422. if(model.getValue("/root/main/sumlist/sumlist["+i+"]/sel") == "Y") {
  423. model.copyNode("/root/send/patlistinfo","/root/main/sumlist/sumlist["+i+"]");
  424. model.makeValue("/root/send/patlistinfo/prcpdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
  425. model.makeValue("/root/send/patlistinfo/fst_drugno", model.getValue("/root/hidden/srchinfo/fst_drugno"));
  426. model.makeValue("/root/send/patlistinfo/last_drugno", model.getValue("/root/hidden/srchinfo/last_drugno"));
  427. model.makeValue("/root/send/patlistinfo/wardcd", model.getValue("/root/hidden/srchinfo/wardcd"));
  428. model.makeValue("/root/send/patlistinfo/pid", model.getValue("/root/hidden/srchinfo/pid"));
  429. model.makeValue("/root/send/patlistinfo/autoprntflag", model.getValue("/root/hidden/srchinfo/autoprntflag"));
  430. model.makeValue("/root/send/patlistinfo/etcdescflag", model.getValue("/root/hidden/srchinfo/etcdescflag"));
  431. model.makeValue("/root/send/patlistinfo/prntkind", model.getValue("/root/hidden/srchinfo/prntkind"));
  432. model.makeValue("/root/send/patlistinfo/autolblyn", model.getValue("/root/hidden/srchinfo/autolblyn"));
  433. model.makeValue("/root/send/patlistinfo/prcpflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
  434. model.makeValue("/root/send/patlistinfo/orderbyatc", model.getValue("/root/hidden/srchinfo/orderbyatc"));
  435. model.makeValue("/root/send/patlistinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  436. model.makeValue("/root/send/patlistinfo/atc3", model.getValue("/root/hidden/srchinfo/atc3"));
  437. model.makeValue("/root/send/patlistinfo/autoyn", model.getValue("/root/hidden/srchinfo/autoyn"));
  438. model.makeValue("/root/send/patlistinfo/version", "new");
  439. strsumdt = strsumdt + " " + model.getValue("/root/main/sumlist/sumlist["+i+"]/sumdt");
  440. }
  441. }
  442. model.makeValue("/root/send/patlistinfo/sumdt", strsumdt);
  443. // 20121121_항암주사실 여부
  444. model.makeValue("/root/send/patlistinfo/dinjyn", model.getValue("/root/hidden/srchinfo/dinjyn"));
  445. model.makeValue("/root/send/patlistinfo/dinjonlyyn", model.getValue("/root/hidden/srchinfo/dinjonlyyn"));
  446. if(strsumdt != "") {
  447. submit("TRADT10202");
  448. }
  449. if(model.getValue("/root/hidden/srchinfo/fst_drugno") != "" && getNodesetCount("/root/main/patlist/patlist") > 0){
  450. model.setValue("/root/main/patlist/patlist/sel", "Y");
  451. }
  452. //sortNodeList("")
  453. // }
  454. model.refresh();
  455. }
  456. /**
  457. * 처방전/라벨 출력
  458. * autoflag : M(수동출력), A(자동출력)
  459. * prntflag : mps(처방전자동출력), lbl(라벨자동출력)
  460. */
  461. function fPrcpMPSPrint( autoflag, prntflag ) {
  462. //투약번호로 출력
  463. var oRptViewer = "";
  464. var sDrugNo = model.getValue("/root/hidden/srchinfo/fst_drugno");
  465. sleepTime = model.getValue("/root/hidden/sleeptime") * 1000;
  466. /*if(sDrugNo != ""
  467. && chk_prnt_count == 0){
  468. fAutoPrnt();
  469. return;
  470. }*/
  471. chk_prnt_count = 0;
  472. //수동출력
  473. var chk_mpsflag = model.getValue("/root/hidden/srchinfo/mpsflag");
  474. var chk_lblyn = model.getValue("/root/hidden/srchinfo/lblyn");
  475. var chk_patlbl = model.getValue("/root/hidden/srchinfo/namecard");
  476. //var chk_lbl_drug = model.getValue("/root/hidden/srchinfo/lbl_drug");
  477. //var chk_lbl_inj = model.getValue("/root/hidden/srchinfo/lbl_inj");
  478. //자동출력
  479. var chk_autokindflag = model.getValue("/root/hidden/srchinfo/autokind");
  480. var chk_autolblyn = model.getValue("/root/hidden/srchinfo/autolblsize");
  481. //alert(flag + " " + chk_mpsflag);
  482. grd_patlist.rebuildStyle();
  483. //if (chk_mpsflag != "" || chk_lblyn != "") {
  484. //처방전 출력 데이터 조회
  485. if(autoflag =="M" ) {//수동출력
  486. var cnt = 0;
  487. for(var i = grd_patlist.fixedRows; i < grd_patlist.rows; i++){
  488. if(model.getValue("/root/main/patlist/patlist["+i+"]/sel") == "Y"){
  489. cnt++ ;
  490. }
  491. }
  492. if( cnt == 0){
  493. messageBox("처방전을 출력할 환자리스트가 없거나 선택된 환자가", "I004");
  494. }
  495. }
  496. for(var i = grd_patlist.fixedRows; i < grd_patlist.rows; i++){
  497. if(model.getValue("/root/main/patlist/patlist["+i+"]/sel") == "Y"){
  498. model.copyNode("/root/send/prcpinfo", "/root/main/patlist/patlist["+i+"]");
  499. /*if(chk_lbl_drug != "" && chk_lbl_inj != ""){
  500. model.makeValue("/root/send/prcpinfo/lblflag", chk_lbl_drug+"|"+chk_lbl_inj);
  501. } else if(chk_lbl_drug != ""){
  502. model.makeValue("/root/send/prcpinfo/lblflag", chk_lbl_drug);
  503. } else if(chk_lbl_inj != ""){
  504. model.makeValue("/root/send/prcpinfo/lblflag", chk_lbl_inj);
  505. }*/
  506. if(autoflag == "M"){
  507. //model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
  508. //20100315 이선경 수정 : prcpflag의 멀티체크가 가능하기때문에 patlist 조회된 환자 각각의 drugflag 값을 보내도록
  509. model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/send/prcpinfo/drugflag"));
  510. model.makeValue("/root/send/prcpinfo/reprintyn", model.getValue("/root/hidden/srchinfo/reprintyn"));
  511. } else if(autoflag == "A") {
  512. //model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/hidden/srchinfo/autoprntflag"));
  513. //model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/send/patlistinfo/sumflag"));
  514. //20100414 이선경 수정 : patlist 조회된 환자 각각의 drugflag 값을 보내도록
  515. model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/send/prcpinfo/drugflag"));
  516. }
  517. model.makeValue("/root/send/prcpinfo/prntflag", model.getValue("/root/hidden/srchinfo/prntflag"));
  518. model.makeValue("/root/send/prcpinfo/ioflag", "I");
  519. var drugno = model.getValue("/root/send/prcpinfo/drugno");
  520. var wardcd = model.getValue("/root/send/prcpinfo/wardcd");
  521. var pid = model.getValue("/root/send/prcpinfo/pid");
  522. if(autoflag =="M" ) {//수동출력
  523. if (chk_mpsflag != "" ){
  524. //처방전 출력
  525. fHosInMPSPrint();
  526. }
  527. if(chk_lblyn != "") {
  528. //라벨수동출력
  529. fPrcpLBLPrint("M");
  530. }
  531. if (chk_patlbl != "") {
  532. //네임카드 출력
  533. oRptViewer += "report_"+i+"|";
  534. fPatLblPrint("report_"+i);
  535. }
  536. } else if(autoflag == "A"){ //자동출력
  537. if (prntflag == "mps" ){
  538. //처방전 출력
  539. fHosInMPSPrint();
  540. }
  541. if(prntflag == "lbl") {
  542. //라벨자동출력
  543. fPrcpLBLPrint("A");
  544. }
  545. }
  546. if (model.getValue("/root/hidden/srchinfo/autoyn") !="Y") {
  547. //출력상태 표시
  548. for ( var j = 0 ; j < grd_patlist.cols -1; j++){
  549. grd_patlist.cellStyle("background-color", i, j) = "#cfffcf";
  550. //grd_patlist.cellStyle("font-weight", i, j) = "bold";
  551. }
  552. grd_patlist.refresh();
  553. }
  554. }
  555. //}
  556. model.setValue("/root/send/atcinfo/drugdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
  557. if ( model.getValue("/root/hidden/srchinfo/prcpflag") =="L" ) {
  558. model.setValue("/root/send/atcinfo/drugflag", "L");
  559. } else if ( model.getValue("/root/hidden/srchinfo/prcpflag") =="E" ) {
  560. model.setValue("/root/send/atcinfo/drugflag", "E");
  561. } else {
  562. model.setValue("/root/send/atcinfo/drugflag", "I");
  563. }
  564. if (model.getValue("/root/hidden/srchinfo/autoatcyn") =="Y") {
  565. model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  566. submit("TXADT10202"); //ATC Data 전송(배치호출)
  567. }
  568. }
  569. //cleaniViewer(oRptViewer);
  570. }
  571. //라벨출력
  572. function fPrcpLBLPrint(flag) {
  573. var lblitem = null; //라벨구분
  574. var lblstr = "";
  575. var lblsize = ""; //라벨출력크기
  576. var lblgrupAD = "N"; //정제라벨 체크여부
  577. var lblgrupDT = "N"; //PTP라벨 체크여부
  578. if(flag == "A") {//자동출력
  579. lblstr = model.getValue("/root/hidden/srchinfo/autolblflag");
  580. lblitem = model.getValue("/root/hidden/srchinfo/autolblflag").split("|");
  581. lblsize = model.getValue("/root/hidden/srchinfo/autolblsize");
  582. if(lblstr.indexOf("AD") >= 0){
  583. lblgrupAD = "Y";
  584. }
  585. if(lblstr.indexOf("DT") >= 0){
  586. lblgrupDT = "Y";
  587. }
  588. } else if(flag == "M") {//수동출력
  589. lblstr = model.getValue("/root/hidden/srchinfo/manllblflag");
  590. lblitem = model.getValue("/root/hidden/srchinfo/manllblflag").split("|");
  591. lblsize = model.getValue("/root/hidden/srchinfo/lblsizeflag");
  592. if(lblstr.indexOf("AD") >= 0){
  593. lblgrupAD = "Y";
  594. }
  595. if(lblstr.indexOf("DT") >= 0){
  596. lblgrupDT = "Y";
  597. }
  598. }
  599. // 20101221_laboru_라벨 출력은 팝업으로 함.
  600. model.makeValue("/root/hidden/srchinfo/flagtmp", flag);
  601. model.makeValue("/root/send/prcpinfo/etcdescflag", model.getValue("/root/hidden/srchinfo/etcdescflag"));
  602. model.makeValue("/root/send/prcpinfo/lblkind", model.getValue("/root/hidden/srchinfo/lblkind"));
  603. model.makeValue("/root/send/prcpinfo/lbltype", model.getValue("/root/init/lbltype/item/lbltype"));
  604. model.makeValue("/root/send/prcpinfo/drugkind", model.getValue("/root/hidden/srchinfo/drugkind"));
  605. model.makeValue("/root/send/prcpinfo/autoyn", model.getValue("/root/hidden/srchinfo/autoyn"));
  606. model.makeValue("/root/send/prcpinfo/prcpliflag", model.getValue("/root/hidden/srchinfo/prcpflag")); // 20120621_제한항생제 승인 처방 라벨 출력위해
  607. model.makeValue("/root/send/prcpinfo/version", "new");
  608. if(model.getValue("/root/send/suminfo/intiflag") == "N") {
  609. model.makeValue("/root/send/prcpinfo/intiflag", "Y"); // 20120417_laboru_인티팜 여부 추가
  610. }
  611. // 20101222_laboru_경북대병원_경대 본원 라벨(큰라벨 2)
  612. if(lblsize == "L" || lblsize == "L1" ) {//자동출력에 큰라벨 출력이면 환자별로 한꺼번에 뽑아야 라벨총장수와 페이지 번호 찍음
  613. var lblstr2 = lblstr.setReplaceWord("AD", "D|DX|DH|DP");
  614. lblstr2 = lblstr2.setReplaceWord("AI", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
  615. model.makeValue("/root/send/prcpinfo/lblflag", lblstr2);
  616. model.makeValue("/root/send/prcpinfo/lblsizeflag", "L");
  617. //fInit_lbl();
  618. //fBigLBLPrint();
  619. // 20101221_laboru_라벨 출력은 팝업으로 함.
  620. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  621. } else if(lblsize == "S") {
  622. model.makeValue("/root/send/prcpinfo/lblsizeflag", "S");
  623. for (var i = 0; i < lblitem.length; i++) {
  624. //20101221_laboru_lblitem 을 팝업창으로 넘기기.
  625. model.makeValue("/root/hidden/srchinfo/tmplblitem", lblitem[i]);
  626. //정제
  627. if (lblitem[i]=="AD"){
  628. //20100405 이선경 추가 : 라벨그룹의 PTP가 체크되어 있고 정제 작은라벨(리스트형식) 출력시 ptp 함께 출력하는 옵션일때 PTP함께 출력
  629. if(lblgrupDT == "Y" && model.getValue("/root/init/sumprcpflagyn/flagyn/lbl6yn") == "Y") {
  630. model.makeValue("/root/send/prcpinfo/lblflag", "D|DX|DH|DP|DT");
  631. } else {
  632. model.makeValue("/root/send/prcpinfo/lblflag", "D|DX|DH|DP");
  633. }
  634. //fInit_lbl();
  635. //fSmallLBLPrint();
  636. // 20101221_laboru_라벨 출력은 팝업으로 함.
  637. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  638. }
  639. //주사
  640. if (lblitem[i]=="AI"){
  641. model.makeValue("/root/send/prcpinfo/lblflag", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
  642. //fInit_lbl();
  643. //fSmallLBLPrint();
  644. // 20101221_laboru_라벨 출력은 팝업으로 함.
  645. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  646. }
  647. //PTP
  648. if (lblitem[i]=="DT"){
  649. model.makeValue("/root/send/prcpinfo/lblflag", "DT");
  650. //20100405 이선경 추가 : 라벨그룹의 정제가 체크되어 있고 정제 작은라벨(리스트형식) 출력시 ptp 함께 출력하는 옵션일때 출력안함
  651. if(lblgrupAD == "N" || model.getValue("/root/init/sumprcpflagyn/flagyn/lbl6yn") != "Y") {
  652. //fInit_lbl();
  653. //fSmallLBLPrint();
  654. // 20101221_laboru_라벨 출력은 팝업으로 함.
  655. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  656. }
  657. }
  658. //외용
  659. if (lblitem[i]=="DI"){
  660. model.makeValue("/root/send/prcpinfo/lblflag", "DI");
  661. //fInit_lbl();
  662. //fLiquidLBLPrint();
  663. // 20101221_laboru_라벨 출력은 팝업으로 함.
  664. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  665. }
  666. //수제
  667. if (lblitem[i]=="DS"){
  668. model.makeValue("/root/send/prcpinfo/lblflag", "DS");
  669. //fInit_lbl();
  670. //fLiquidLBLPrint();
  671. // 20101221_laboru_라벨 출력은 팝업으로 함.
  672. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  673. }
  674. //PACK 20110922_laboru_pack 도 작은 라벨로 출력 가능하게 수정
  675. if (lblitem[i]=="DG"){
  676. model.makeValue("/root/send/prcpinfo/lblflag", "DG");
  677. //fInit_lbl();
  678. //fLiquidLBLPrint();
  679. // 20101221_laboru_라벨 출력은 팝업으로 함.
  680. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  681. }
  682. //PTP단독처방
  683. if (lblitem[i]=="PTS"){
  684. model.makeValue("/root/send/prcpinfo/lblflag", "PTS");
  685. //fInit_lbl();
  686. //fSmallLBLPrint();
  687. // 20101221_laboru_라벨 출력은 팝업으로 함.
  688. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  689. }
  690. //산제용법별
  691. if (lblitem[i]=="DP"){
  692. model.makeValue("/root/send/prcpinfo/lblflag", "DP");
  693. //fInit_lbl();
  694. //fPowderlLBLPrint();
  695. // 20101221_laboru_라벨 출력은 팝업으로 함.
  696. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  697. }
  698. //2010-06-29 [보관방법:냉장주사] 단독출력
  699. if (lblitem[i]=="LBL_INJ_I"){
  700. model.makeValue("/root/send/prcpinfo/lblflag", "LBL_INJ_I");
  701. //fInit_lbl();
  702. //fSmallLBLPrint();
  703. // 20101221_laboru_라벨 출력은 팝업으로 함.
  704. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  705. }
  706. //2010-06-29 [보관방법:고위험주사] 단독출력
  707. if (lblitem[i]=="LBL_INJ_D"){
  708. model.makeValue("/root/send/prcpinfo/lblflag", "LBL_INJ_D");
  709. //fInit_lbl();
  710. //fSmallLBLPrint();
  711. // 20101221_laboru_라벨 출력은 팝업으로 함.
  712. modal("SPADT62302", 1, 0, 0, "SPADT62302", "/root", "/root", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  713. }
  714. }
  715. }
  716. }
  717. function fStopTimer() {
  718. window.clearinterval(gT1);
  719. }
  720. /**
  721. * 처방전 출력
  722. */
  723. function fHosInMPSPrint() {
  724. model.makeValue("/root/send/prcpinfo/etcdescflag", model.getValue("/root/hidden/srchinfo/etcdescflag"));
  725. model.makeValue("/root/send/prcpinfo/autoyn", model.getValue("/root/hidden/srchinfo/autoyn"));
  726. model.makeValue("/root/send/prcpinfo/stocdeptcd", model.getValue("/root/hidden/srchinfo/stocdeptcd"));
  727. model.makeValue("/root/send/prcpinfo/autolimanti", model.getValue("/root/hidden/srchinfo/prcpflag")); // 2011.02.08 pymi 제한항생제
  728. //fInit_prnt();
  729. modal("SPADT62201", 1, 0, 0, "SPADT62201", "/root/send/prcpinfo", "/root/send/prcpinfo", "left:0px; top:0px; width:0px; height:0px; sysmenu:hidden; min:hidden; max:hidden; caption:hidden;", "false", "x");
  730. }
  731. /**
  732. * 자동출력 버튼 클릭시 타이머 작동
  733. */
  734. function fClickAutoPrnt(chk) {
  735. if (chk == "Y") {
  736. //20090824 마정민 수정. 오류가 나더라도 팝업이 뜨지 않고 계속해서 진행될 수 있도록 수정.
  737. setErrorOff(true);
  738. model.setValue("/root/hidden/autoend", "N") ;
  739. if(model.getValue("/root/hidden/srchinfo/autoprntflag") == ""){
  740. messageBox("자동출력의 처방구분을", "C001");
  741. return;
  742. }
  743. if(model.getValue("/root/hidden/srchinfo/autokind") == "" && model.getValue("/root/hidden/srchinfo/autolblsize") == "") {
  744. messageBox("자동출력의 출력구분을", "C001");
  745. return;
  746. }
  747. // 20101203 wify 경북대병원 큰라벨(본원)추가
  748. //if(isSearchString(chk_auto_lblsize.value, "L") || isSearchString(chk_auto_lblsize.value, "S")) {
  749. if(isSearchString(chk_auto_lblsize.value, "L") || isSearchString(chk_auto_lblsize.value, "S") || isSearchString(chk_auto_lblsize.value, "L1")) {
  750. if(model.getValue("/root/hidden/srchinfo/autolblflag") == ""){
  751. messageBox("자동출력의 라벨구분을", "C001");
  752. return;
  753. }
  754. }
  755. var sRst = "";
  756. if(gTimer != null) {
  757. sRst = messageBox("자동출력이 동작중입니다.\n자동출력구분설정대로 다시", "Q004");
  758. if(sRst == "6"){
  759. window.clearinterval(gTimer);
  760. gTimer = null;
  761. } else {
  762. return;
  763. }
  764. }
  765. if(sRst == ""){
  766. sRst = messageBox("자동출력을", "S001");
  767. if(sRst != "6"){
  768. return;
  769. }
  770. }
  771. btn_hist.visible=false;
  772. grd_sumlist.visible=false;
  773. grd_patlist.visible=false;
  774. //20090914 이선경 추가 : 자동출력중 처방구분등 다른조건 변경 못하게 함(오류 가능성 있음)
  775. rdo_prcp.disabled = true; //처방구분(정규, 추가)
  776. rdo_prcp2.disabled = true; //처방구분(admission, 병동응급, 퇴원, 외박, 응급실)
  777. checkbox4.disabled = true; //항암프로토콜처방만 체크
  778. ipt_fst_drugno.disabled = true; //투약번호 from
  779. caption25.disabled = true; //'~'
  780. ipt_last_drugno.disabled = true; //투약번호 to
  781. ipt_pid.disabled = true; //등록번호
  782. chk_manl_lblflag.disabled = true; //라벨구분
  783. btn_prt.disabled = true; //출력버튼
  784. button1.disabled = true; //마감버튼
  785. checkbox10.disabled = true; //PTP단독처방라벨
  786. checkbox3.disabled = true; //자동출력의 PTP단독처방라벨
  787. chk_auto_small.disabled = true; //자동출력의 처방구분
  788. chk_auto_lblflag.disabled = true; //자동출력의 라벨구분
  789. chk_auto_big.disabled = true; //자동출력의 출력구분
  790. chk_auto_lblsize.disabled = true; //자동출력의 출력구분
  791. checkbox8.disabled = true; //자동출력의 ptp라벨, 외용라벨
  792. ipt_prcpdd.disabled = true; //적용일자
  793. btn_sea.disabled = true; //조회버튼
  794. cmb_sumtmflag1.disabled = true; //마감시간대구분
  795. cmb_fromddflag1.disabled = true; //마감일자from
  796. ipt_fromtm1.disabled = true; //마감시간from
  797. cmb_toddflag1.disabled = true; //마감일자to
  798. ipt_totm1.disabled = true; //마감시간to
  799. cmb_sumtmflag2.disabled = true; //마감시간대구분
  800. cmb_fromddflag2.disabled = true; //마감일자from
  801. ipt_fromtm2.disabled = true; //마감시간from
  802. cmb_toddflag2.disabled = true; //마감일자to
  803. ipt_totm2.disabled = true; //마감시간to
  804. radio1.disabled = true; //약주사구분
  805. radio3.disabled = true; //기타조회구분
  806. btn_init.disabled = true; //초기화버튼
  807. button5.disabled = true; //병동검색이미지
  808. chk_mps.disabled = true; //출력구분의 처방전체크
  809. chk_lbl.disabled = true; //출력구분의 라벨체크
  810. checkbox1.disabled = true; //출력구분의 약체크
  811. checkbox2.disabled = true; //출력구분의 주사체크
  812. chk_lbl_drug.disabled = true; //출력구분의 약리스트체크
  813. chk_lbl_inj.disabled = true; //출력구분의 주사리스트체크
  814. combo1.disabled = true; //실출고부서
  815. checkbox7.disabled = true; //ATC순으로 정렬
  816. btn_prnt.disabled = true; //프린터설정
  817. button3.disabled = true; //마감시간관리
  818. input1.disabled = true; //출력간격
  819. checkbox11.disabled = true; //multi-day 처방포함
  820. //cmb_ward.visible = false;
  821. model.setValue("/root/hidden/srchinfo/prcpflag", "");
  822. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  823. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  824. model.setValue("/root/hidden/srchinfo/wardcd", "");
  825. model.setValue("/root/hidden/srchinfo/wardnm", "");
  826. model.setValue("/root/temp/srchinfo/ward", "");
  827. model.setValue("/root/hidden/srchinfo/pid", "");
  828. model.setValue("/root/hidden/srchinfo/onlyantis","");
  829. model.makeValue("/root/hidden/srchinfo/autoyn", "Y");
  830. model.setValue("/root/send/suminfo/fromdd", "");
  831. model.setValue("/root/send/suminfo/fromtm", "");
  832. model.setValue("/root/send/suminfo/todd", "");
  833. model.setValue("/root/send/suminfo/totm", "");
  834. var autostr = chk_auto_small.label + " " + chk_auto_big.label + " " + chk_auto_lblsize.label ;
  835. if(isSearchString(chk_auto_lblsize.value, "L") || isSearchString(chk_auto_lblsize.value, "S") || isSearchString(chk_auto_lblsize.value, "L1")){
  836. autostr = autostr + "(" + chk_auto_lblflag.label + ")";
  837. }
  838. autostr = autostr.setReplaceWord("|", ", " );
  839. caption23.text = autostr;
  840. model.refresh();
  841. btn_autoprnt_start.disabled = true;
  842. btn_autoprnt_end.disabled = false;
  843. chk_sum_count = 8;
  844. gTimer = window.setInterval("fAutoPrnt()",20000);
  845. //재출력 불가
  846. model.setValue("/root/hidden/srchinfo/reprintyn", "");
  847. checkbox9.disabled = true;
  848. group2.visible = "true";
  849. //서버오류가 발생하더라도 modeless 팝업을 통해 계속해서 진행할 수 있도록 수정.
  850. fErrMsg ();
  851. } else {
  852. setErrorOn();
  853. window.clearinterval(gTimer);
  854. gTimer = null;
  855. btn_hist.visible=true;
  856. grd_sumlist.visible=true;
  857. grd_patlist.visible=true;
  858. //20090914 이선경 추가 : 자동출력중 처방구분등 다른조건 변경 못하게 함(오류 가능성 있음)
  859. rdo_prcp.disabled = false; //처방구분(정규, 추가)
  860. rdo_prcp2.disabled = false; //처방구분(admission, 병동응급, 퇴원, 외박, 응급실)
  861. checkbox4.disabled = false; //항암프로토콜처방만 체크
  862. ipt_fst_drugno.disabled = false; //투약번호 from
  863. caption25.disabled = false; //'~'
  864. ipt_last_drugno.disabled = false; //투약번호 to
  865. ipt_pid.disabled = false; //등록번호
  866. chk_manl_lblflag.disabled = false; //라벨구분
  867. btn_prt.disabled = false; //출력버튼
  868. button1.disabled = false; //마감버튼
  869. checkbox10.disabled = false; //PTP단독처방라벨
  870. checkbox3.disabled = false; //자동출력의 PTP단독처방라벨
  871. chk_auto_small.disabled = false; //자동출력의 처방구분
  872. chk_auto_lblflag.disabled = false; //자동출력의 라벨구분
  873. chk_auto_big.disabled = false; //자동출력의 출력구분
  874. chk_auto_lblsize.disabled = false; //자동출력의 출력구분
  875. checkbox8.disabled = false; //자동출력의 ptp라벨, 외용라벨
  876. ipt_prcpdd.disabled = false; //적용일자
  877. btn_sea.disabled = false; //조회버튼
  878. cmb_sumtmflag1.disabled = false; //마감시간대구분
  879. cmb_fromddflag1.disabled = false; //마감일자from
  880. ipt_fromtm1.disabled = false; //마감시간from
  881. cmb_toddflag1.disabled = false; //마감일자to
  882. ipt_totm1.disabled = false; //마감시간to
  883. cmb_sumtmflag2.disabled = false; //마감시간대구분
  884. cmb_fromddflag2.disabled = false; //마감일자from
  885. ipt_fromtm2.disabled = false; //마감시간from
  886. cmb_toddflag2.disabled = false; //마감일자to
  887. ipt_totm2.disabled = false; //마감시간to
  888. radio1.disabled = false; //약주사구분
  889. radio3.disabled = false; //기타조회구분
  890. btn_init.disabled = false; //초기화버튼
  891. button5.disabled = false; //병동검색이미지
  892. chk_mps.disabled = false; //출력구분의 처방전체크
  893. chk_lbl.disabled = false; //출력구분의 라벨체크
  894. checkbox1.disabled = false; //출력구분의 약체크
  895. checkbox2.disabled = false; //출력구분의 주사체크
  896. chk_lbl_drug.disabled = false; //출력구분의 약리스트체크
  897. chk_lbl_inj.disabled = false; //출력구분의 주사리스트체크
  898. combo1.disabled = false; //실출고부서
  899. checkbox7.disabled = false; //ATC순으로 정렬
  900. btn_prnt.disabled = false; //프린터설정
  901. button3.disabled = false; //마감시간관리
  902. input1.disabled = false; //출력간격
  903. checkbox11.disabled = false; //multi-day 처방포함
  904. //cmb_ward.visible = true;
  905. model.setValue("/root/hidden/srchinfo/prcpflag", "");
  906. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  907. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  908. model.setValue("/root/hidden/srchinfo/wardcd", "");
  909. model.setValue("/root/hidden/srchinfo/wardnm", "");
  910. model.setValue("/root/hidden/srchinfo/drugkind", "T");
  911. model.setValue("/root/temp/srchinfo/ward", "");
  912. model.setValue("/root/hidden/srchinfo/pid", "");
  913. //model.setValue("/root/hidden/srchinfo/autoprntflag", "");
  914. model.makeValue("/root/hidden/srchinfo/autoyn", "");
  915. btn_autoprnt_start.disabled = false;
  916. btn_autoprnt_end.disabled = true;
  917. model.setValue("/root/hidden/autoend", "Y") ;
  918. model.setValue("/root/hidden/srchinfo/prcpflag", "A");
  919. model.refresh();
  920. //재출력 가능
  921. checkbox9.disabled = false;
  922. group2.visible = "false";
  923. model.removeNodeset("/root/main/sumlist/sumlist");
  924. model.removeNodeset("/root/main/patlist/patlist");
  925. model.refresh();
  926. }
  927. }
  928. function fReStart(){
  929. //window.clearinterval(gTimer2);
  930. //gTimer = window.setInterval("fAutoPrnt()",11000);
  931. }
  932. /**
  933. * 자동출력
  934. */
  935. function fAutoPrnt() {
  936. //window.clearinterval(gTimer);
  937. if ( model.getValue("/root/hidden/autoend") =="Y" ){
  938. gTimer = null;
  939. return;
  940. }
  941. var orgPrcpflag = model.getValue("/root/hidden/srchinfo/prcpflag");
  942. //if ( chk_count >= 50 ){
  943. //chk_count = 0;
  944. //gTimer2 = window.setInterval("fReStart()",5000);
  945. //return;
  946. //}
  947. chk_count++;
  948. if ( ( chk_count % 4 )=="0" ){
  949. caption14.text="자동 출력중[/]";
  950. }
  951. if ( ( chk_count % 4 )=="1" ){
  952. caption14.text="자동 출력중[ ―]";
  953. }
  954. if ( ( chk_count % 4 )=="2" ){
  955. caption14.text="자동 출력중[\]";
  956. }
  957. if ( ( chk_count % 4 )=="3" ){
  958. caption14.text="자동 출력중[|]";
  959. }
  960. caption14.refresh();
  961. if(chk_sum_count >= 4){
  962. if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("M") > -1 ){ //20090721 이선경 수정 : 처방전 자동출력일때만 마감적용
  963. if (model.getValue("/root/hidden/srchinfo/autoendyn") =="Y") {
  964. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("Z") >=0 ){
  965. model.setValue("/root/hidden/srchinfo/prcpflag", "Z");
  966. fHosInSum("N", "auto"); //508응급병동 정규약
  967. }
  968. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M1") >=0 ){
  969. model.setValue("/root/hidden/srchinfo/prcpflag", "M");
  970. model.setValue("/root/hidden/srchinfo/drugkind", "D");
  971. fHosInSum("N", "auto"); //Admission약마감
  972. }
  973. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M2") >=0 ){
  974. model.setValue("/root/hidden/srchinfo/prcpflag", "M");
  975. model.setValue("/root/hidden/srchinfo/drugkind", "M");
  976. fHosInSum("N", "auto"); //Admission주사마감
  977. }
  978. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M1") < 0
  979. && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M2") < 0
  980. && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M") >=0 ){
  981. model.setValue("/root/hidden/srchinfo/prcpflag", "M");
  982. fHosInSum("N", "auto"); //Admission마감
  983. }
  984. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W1") >=0 ){
  985. model.setValue("/root/hidden/srchinfo/prcpflag", "W");
  986. model.setValue("/root/hidden/srchinfo/drugkind", "D");
  987. fHosInSum("N", "auto"); //병동응급약마감
  988. }
  989. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W2") >=0 ){
  990. model.setValue("/root/hidden/srchinfo/prcpflag", "W");
  991. model.setValue("/root/hidden/srchinfo/drugkind", "M");
  992. fHosInSum("N", "auto"); //병동응급주사마감
  993. } else
  994. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W1") < 0
  995. && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W2") < 0
  996. && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W") >=0 ){
  997. model.setValue("/root/hidden/srchinfo/prcpflag", "W");
  998. fHosInSum("N", "auto"); //병동응급마감
  999. }
  1000. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") >=0 ){
  1001. model.setValue("/root/hidden/srchinfo/prcpflag", "L"); // 자동일때는 외출외박으로 처리하여 응급실 퇴원약 제외 20091027 이선경 수정 : 외출외박과 퇴원약은 따로 처리
  1002. model.setValue("/root/hidden/srchinfo/drugkind", "T");
  1003. fHosInSum("N", "auto"); //퇴원약마감
  1004. }
  1005. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("G") >=0 ){
  1006. model.setValue("/root/hidden/srchinfo/prcpflag", "G");
  1007. model.setValue("/root/hidden/srchinfo/drugkind", "T");
  1008. fHosInSum("N", "auto"); //외박마감
  1009. }
  1010. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") >=0 ){
  1011. //model.setValue("/root/hidden/srchinfo/prcpflag", "Q"); //마약만 마감
  1012. //fHosInSum("N");
  1013. }
  1014. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("S") >=0 ){
  1015. //model.setValue("/root/hidden/srchinfo/prcpflag", "Q"); //마약만 마감
  1016. //fHosInSum("N");
  1017. }
  1018. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("C2") >=0 ){
  1019. model.setValue("/root/hidden/srchinfo/prcpflag", "C2");
  1020. fHosInSum("N", "auto"); //임상주사 마감
  1021. }
  1022. }
  1023. model.setValue("/root/hidden/srchinfo/prcpflag", "");
  1024. chk_sum_count = 0;
  1025. }
  1026. }
  1027. chk_sum_count++;
  1028. //퇴원 자동출력시 마감을 G로 해서 원래 L 값을 보내줘야함
  1029. //model.setValue("/root/hidden/srchinfo/prcpflag", orgPrcpflag); //이훈재 막음. ( 옵션을 선택한 값임)
  1030. if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("M") > -1 ){
  1031. model.setValue("/root/hidden/srchinfo/prntkind", "M");
  1032. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("Z") >=0 ){
  1033. model.setValue("/root/hidden/srchinfo/prcpflag", "Z");
  1034. fInSumList(); //마감시간별 미출력데이터 조회
  1035. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1036. chk_prnt_count++;
  1037. grd_sumlist.isSelected(i) = true;
  1038. grd_sumlist.row = i;
  1039. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1040. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1041. fPrcpMPSPrint("A", "mps"); //처방전출력
  1042. }
  1043. }
  1044. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M") >=0 ){
  1045. model.setValue("/root/hidden/srchinfo/prcpflag", "M");
  1046. fInSumList(); //마감시간별 미출력데이터 조회
  1047. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1048. chk_prnt_count++;
  1049. grd_sumlist.isSelected(i) = true;
  1050. grd_sumlist.row = i;
  1051. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1052. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1053. fPrcpMPSPrint("A", "mps"); //처방전출력
  1054. }
  1055. }
  1056. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W") >=0 ){
  1057. model.setValue("/root/hidden/srchinfo/prcpflag", "W");
  1058. if ( model.getValue("/root/send/suminfo/intiflag") != "N" ){
  1059. fInSumList(); //마감시간별 미출력데이터 조회
  1060. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1061. chk_prnt_count++;
  1062. grd_sumlist.isSelected(i) = true;
  1063. grd_sumlist.row = i;
  1064. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1065. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1066. fPrcpMPSPrint("A", "mps"); //처방전출력
  1067. }
  1068. }
  1069. }
  1070. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") >=0 ){
  1071. model.setValue("/root/hidden/srchinfo/prcpflag", "L"); // 자동일때는 외출외박으로 처리하여 응급실 퇴원약 제외 20091027 이선경 수정 : 외출외박과 퇴원약은 따로 처리
  1072. fInSumList(); //마감시간별 미출력데이터 조회
  1073. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1074. chk_prnt_count++;
  1075. grd_sumlist.isSelected(i) = true;
  1076. grd_sumlist.row = i;
  1077. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1078. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1079. fPrcpMPSPrint("A", "mps"); //처방전출력
  1080. }
  1081. }
  1082. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("G") >=0 ){
  1083. model.setValue("/root/hidden/srchinfo/prcpflag", "G");
  1084. fInSumList(); //마감시간별 미출력데이터 조회
  1085. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1086. chk_prnt_count++;
  1087. grd_sumlist.isSelected(i) = true;
  1088. grd_sumlist.row = i;
  1089. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1090. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1091. fPrcpMPSPrint("A", "mps"); //처방전출력
  1092. }
  1093. }
  1094. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") >=0 ){
  1095. model.setValue("/root/hidden/srchinfo/prcpflag", "E");
  1096. fInSumList(); //마감시간별 미출력데이터 조회
  1097. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1098. chk_prnt_count++;
  1099. grd_sumlist.isSelected(i) = true;
  1100. grd_sumlist.row = i;
  1101. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1102. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1103. fPrcpMPSPrint("A", "mps"); //처방전출력
  1104. }
  1105. }
  1106. // 2011.02.08 pymi 제한항생제
  1107. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("B") >=0 ){
  1108. model.setValue("/root/hidden/srchinfo/prcpflag", "B");
  1109. fInSumList(); //마감시간별 미출력데이터 조회
  1110. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1111. chk_prnt_count++;
  1112. grd_sumlist.isSelected(i) = true;
  1113. grd_sumlist.row = i;
  1114. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1115. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1116. fPrcpMPSPrint("A", "mps"); //처방전출력
  1117. }
  1118. }
  1119. // (e)
  1120. // 임상
  1121. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("C2") >=0 ){
  1122. model.setValue("/root/hidden/srchinfo/prcpflag", "C2");
  1123. fInSumList(); //마감시간별 미출력데이터 조회
  1124. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1125. chk_prnt_count++;
  1126. grd_sumlist.isSelected(i) = true;
  1127. grd_sumlist.row = i;
  1128. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1129. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1130. fPrcpMPSPrint("A", "mps"); //처방전출력
  1131. }
  1132. }
  1133. // 20120316_laboru_마약 단독 처방전 출력
  1134. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("S") >=0 ){
  1135. model.setValue("/root/hidden/srchinfo/prcpflag", "S");
  1136. fInSumList(); //마감시간별 미출력데이터 조회
  1137. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1138. chk_prnt_count++;
  1139. grd_sumlist.isSelected(i) = true;
  1140. grd_sumlist.row = i;
  1141. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1142. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1143. fPrcpMPSPrint("A", "mps"); //처방전출력
  1144. }
  1145. }
  1146. // 20120416_laboru_인티팜 처방전 출력
  1147. if (model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("T") >=0 ){
  1148. model.setValue("/root/hidden/srchinfo/prcpflag", "T");
  1149. model.makeValue("/root/send/sumlistinfo/intiflag", "N");
  1150. fInSumList(); //마감시간별 미출력데이터 조회
  1151. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1152. chk_prnt_count++;
  1153. grd_sumlist.isSelected(i) = true;
  1154. grd_sumlist.row = i;
  1155. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1156. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1157. fPrcpMPSPrint("A", "mps"); //처방전출력
  1158. }
  1159. }
  1160. }
  1161. //라벨
  1162. // 20101204 wify 경북대병원 큰라벨(본원) 추가
  1163. //if ( model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("L") > -1 || model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("S") > -1 ){
  1164. if ( model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("L") > -1 || model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("S") > -1 || model.getValue("/root/hidden/srchinfo/autolblsize").indexOf("L1") > -1 ){
  1165. model.setValue("/root/hidden/srchinfo/prntkind", "L");
  1166. if (model.getValue("/root/hidden/srchinfo/autoyn") =="Y") {
  1167. model.makeValue("/root/hidden/srchinfo/autolblyn", "Y");
  1168. } else {
  1169. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1170. }
  1171. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("Z") >=0 ){
  1172. model.setValue("/root/hidden/srchinfo/prcpflag", "Z");
  1173. fInSumList(); //마감시간별 미출력데이터 조회
  1174. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1175. chk_prnt_count++;
  1176. grd_sumlist.isSelected(i) = true;
  1177. grd_sumlist.row = i;
  1178. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1179. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1180. }
  1181. }
  1182. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M") >=0 ){
  1183. model.setValue("/root/hidden/srchinfo/prcpflag", "M");
  1184. fInSumList(); //마감시간별 미출력데이터 조회
  1185. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1186. chk_prnt_count++;
  1187. grd_sumlist.isSelected(i) = true;
  1188. grd_sumlist.row = i;
  1189. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1190. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1191. }
  1192. }
  1193. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W") >=0 ){
  1194. model.setValue("/root/hidden/srchinfo/prcpflag", "W");
  1195. fInSumList(); //마감시간별 미출력데이터 조회
  1196. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1197. chk_prnt_count++;
  1198. grd_sumlist.isSelected(i) = true;
  1199. grd_sumlist.row = i;
  1200. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1201. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1202. }
  1203. }
  1204. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") >=0 ){
  1205. model.setValue("/root/hidden/srchinfo/prcpflag", "L");
  1206. fInSumList(); //마감시간별 미출력데이터 조회
  1207. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1208. chk_prnt_count++;
  1209. grd_sumlist.isSelected(i) = true;
  1210. grd_sumlist.row = i;
  1211. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1212. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1213. }
  1214. }
  1215. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("G") >=0 ){
  1216. model.setValue("/root/hidden/srchinfo/prcpflag", "G");
  1217. fInSumList(); //마감시간별 미출력데이터 조회
  1218. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1219. chk_prnt_count++;
  1220. grd_sumlist.isSelected(i) = true;
  1221. grd_sumlist.row = i;
  1222. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1223. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1224. }
  1225. }
  1226. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") >=0 ){
  1227. model.setValue("/root/hidden/srchinfo/prcpflag", "E");
  1228. fInSumList(); //마감시간별 미출력데이터 조회
  1229. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1230. chk_prnt_count++;
  1231. grd_sumlist.isSelected(i) = true;
  1232. grd_sumlist.row = i;
  1233. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1234. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1235. }
  1236. }
  1237. // 2011.02.09 pymi
  1238. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("B") >=0 ){
  1239. model.setValue("/root/hidden/srchinfo/prcpflag", "B");
  1240. fInSumList(); //마감시간별 미출력데이터 조회
  1241. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1242. chk_prnt_count++;
  1243. grd_sumlist.isSelected(i) = true;
  1244. grd_sumlist.row = i;
  1245. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1246. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1247. }
  1248. }
  1249. //(e)
  1250. // 임상
  1251. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("C2") >=0 ){
  1252. model.setValue("/root/hidden/srchinfo/prcpflag", "C2");
  1253. fInSumList(); //마감시간별 미출력데이터 조회
  1254. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1255. chk_prnt_count++;
  1256. grd_sumlist.isSelected(i) = true;
  1257. grd_sumlist.row = i;
  1258. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1259. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1260. }
  1261. }
  1262. }
  1263. if (model.getValue("/root/hidden/srchinfo/autoatcyn") =="Y") {
  1264. //ATC전송
  1265. model.setValue("/root/send/atcinfo/drugdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
  1266. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") > -1 ) {
  1267. model.setValue("/root/send/atcinfo/drugflag", "L");
  1268. model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  1269. submit("TXADT10202"); //ATC Data 전송(배치호출)
  1270. }
  1271. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") > -1 ) {
  1272. model.setValue("/root/send/atcinfo/drugflag", "E");
  1273. model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  1274. submit("TXADT10202"); //ATC Data 전송(배치호출)
  1275. }
  1276. //if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") == -1 && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") == -1 ){
  1277. model.setValue("/root/send/atcinfo/drugflag", "I");
  1278. model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  1279. submit("TXADT10202"); //ATC Data 전송(배치호출)
  1280. //}
  1281. }
  1282. //gTimer = window.setInterval("fAutoPrnt()",11000);
  1283. }
  1284. function fSleep(numberMillis) {
  1285. var now = new Date();
  1286. var exitTime = now.getTime() + numberMillis;
  1287. while (true) {
  1288. now = new Date();
  1289. if (now.getTime() > exitTime)
  1290. return;
  1291. }
  1292. }
  1293. /**
  1294. * 투약번호 변경시
  1295. */
  1296. function fChgDrugno(flag) {
  1297. var bResult = true;
  1298. if(flag == "first"){
  1299. var chk = model.getValue("/root/hidden/srchinfo/fst_drugno");
  1300. if(chk == ""){
  1301. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  1302. model.refresh();
  1303. bResult = false;
  1304. } else {
  1305. if(isNaN(chk)){
  1306. messageBox("투약번호는 숫자로","C001");
  1307. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  1308. model.refresh();
  1309. bResult = false;
  1310. }
  1311. if(chk.length > 5){
  1312. messageBox("투약번호는 5자리미만으로","C001");
  1313. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  1314. model.refresh();
  1315. bResult = false;
  1316. }
  1317. }
  1318. } else if(flag == "last"){
  1319. var chk_fst = model.getValue("/root/hidden/srchinfo/fst_drugno");
  1320. var chk_last = model.getValue("/root/hidden/srchinfo/fst_drugno");
  1321. if(chk_fst == ""){
  1322. messageBox("첫번째 투약번호부터","C001");
  1323. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  1324. bResult = false;
  1325. } else {
  1326. if(isNaN(chk_fst)){
  1327. messageBox("투약번호는 숫자로","C001");
  1328. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  1329. bResult = false;
  1330. }
  1331. if(chk_fst.length > 5 ){
  1332. messageBox("투약번호는 5자리미만으로","C001");
  1333. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  1334. bResult = false;
  1335. }
  1336. if(isNaN(chk_last)){
  1337. messageBox("투약번호는 숫자로","C001");
  1338. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  1339. bResult = false;
  1340. }
  1341. if(chk_last.length > 5 ){
  1342. messageBox("투약번호는 5자리미만으로","C001");
  1343. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  1344. bResult = false;
  1345. }
  1346. }
  1347. model.refresh();
  1348. }
  1349. return bResult;
  1350. }
  1351. function fErrMsg () {
  1352. var errorMsgPath = "/root/properties/error";
  1353. if ( model.getValue ( "/root/properties/error/type" ) == "error" ) {
  1354. window.load("../../../com/commonweb/xrw/SPZZZ00100_시스템에러.xrw","modeless","","width:514px;height:198px;align:center;","/root/properties/error","/root/main");
  1355. }
  1356. }
  1357. function fPatLblPrint() {
  1358. submit("TRADT10215");
  1359. var commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind")
  1360. //프린터 포트명, 혹은 네트웍 공유 프린터 명
  1361. if(commkind == "01") {
  1362. CommAX1.PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  1363. }
  1364. var iPoint=0;
  1365. for(iPoint = 1; iPoint <= getNodesetCount("/root/temp/prntpat/prcpdrug") ; iPoint++){
  1366. if(model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/pid") != "" ) {
  1367. //////////////////////////////////////////////////
  1368. // 라벨 상단내용 //
  1369. /////////////////////////////////////////////////
  1370. //병동
  1371. model.setValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/wardnm" ,model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/wardnm") + " / " + model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/roomcd"));
  1372. //환자번호
  1373. model.setValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/pid", "등록번호:" + model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/pid") );
  1374. //진료과
  1375. model.setValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/orddeptnm" , model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/orddeptnm") + "/" + model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/medispclidnm") + "/" + model.getValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/atdoctidnm") );
  1376. //라벨출력일
  1377. var lbldate = getCurrentDate();
  1378. lbldate = lbldate.toDate().getDateFormat("YYYY/MM/DD") ;
  1379. model.makeValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/lbldate" , lbldate);
  1380. }
  1381. }
  1382. makeReportIViewer(0,0,10, 10, arguments[0]);
  1383. fPrintRex("RFADT10310", "undefined", "undefined", "undefined", "undefined", "undefined", arguments[0]);
  1384. }
  1385. function makeReportIViewer(left, top, width, height, iViewerName){
  1386. if(left==null || top==null || width==null || height==null){
  1387. messageBox("미리보기 크기정보가", "I004");
  1388. }else{
  1389. if(iViewerName != null && iViewerName != ""){
  1390. if(document.all("ivr_"+iViewerName) == null){
  1391. if(document.all("grp_biz") == null){
  1392. body.createChild("xforms:iviewer", "id:ivr_"+iViewerName+"; src:../../../com/commonweb/xrw/SPZUR00100_보고서.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
  1393. "px;");
  1394. }else{
  1395. grp_biz.createChild("xforms:iviewer", "id:ivr_"+iViewerName+"; src:../../../com/commonweb/xrw/SPZUR00100_보고서.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
  1396. "px;");
  1397. }
  1398. model.refresh();
  1399. }
  1400. }
  1401. }
  1402. }
  1403. function fPrintRex(rexnm, closeYn, printCount, dataXPath, paramsXPath, infoXPath, parentId){
  1404. var posx = '';
  1405. var posy = '';
  1406. var printnm = '';
  1407. if(infoXPath == "" || infoXPath == "undefined" || infoXPath == null) infoXPath = "/root/main/barcdprntsetup/prntsetupinfo";
  1408. if(model.getValue(infoXPath + "/setupinfo/rexgbn") != "1") return false;
  1409. try{
  1410. if(model.getXpathValue("count(" + infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/barnm)") > "0"){
  1411. posx = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/xpos");
  1412. posy = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/ypos");
  1413. printnm = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/prtnm");
  1414. }else{
  1415. posx = model.getValue(infoXPath + "/setupinfo/blank/left");
  1416. posy = model.getValue(infoXPath + "/setupinfo/blank/top");
  1417. printnm = model.getValue(infoXPath + "/setupinfo/comm01/setupval");
  1418. }
  1419. if(posx == '') posx = "0";
  1420. if(posy == '') posy = "0";
  1421. if(closeYn == "true") printnm = "";
  1422. exeRexPreview(rexnm, 'XMLSTR', paramsXPath, '', printnm,
  1423. '', '', '', '', '',
  1424. '', parentId, '', '', '',
  1425. printCount, '', 'offsetx=' + posx + ';offsety=' + posy + ';', dataXPath, '',
  1426. '');
  1427. }
  1428. catch(e){
  1429. alert("출력시 오류가 발생하였습니다\n" + e);
  1430. return true;
  1431. }
  1432. return true;
  1433. }
  1434. function exeRexPreview(rid, dataType, paramsXPath, submitId, print, printDialog, fileType, fileName, fileDialog, closeYn, monNo, parentObjId, printPaperBin, userService, showButton, printCount, zoomRate, printOption, dataXPath, mainDataXPath, subDataXPath)
  1435. {
  1436. var reportNode = instance1.selectSingleNode(gvReportPath);
  1437. var syscd = getSystemCd();
  1438. syscd = syscd.substr(3,3);
  1439. //if(syscd == "888" || syscd == "999" || syscd == "") syscd = "001";
  1440. if(syscd == "") syscd = "001";
  1441. //레포트 관련 내용 초기화
  1442. if(reportNode != null){
  1443. model.removeNodeset(gvReportPath);
  1444. }
  1445. model.makeNode(gvReportPath);
  1446. model.makeNode(gvReportParamsPath);
  1447. model.makeNode(gvReportPropsPath);
  1448. model.makeNode(gvReportOptionsPath);
  1449. paramsXPath = instance1.selectSingleNode(paramsXPath);
  1450. if(paramsXPath != null){
  1451. model.copyNode(gvReportParamsPath, paramsXPath);
  1452. }
  1453. model.makeValue(gvReportParamsPath+"/userid", getUserId());
  1454. model.makeValue(gvReportParamsPath+"/logoimgurl", getImageURL("error_logo"+getLogoImageKey()));
  1455. model.makeValue(gvReportParamsPath+"/url", rid);
  1456. model.makeValue(gvReportPropsPath+"/rex_rptname", rid);
  1457. model.makeValue(gvReportPropsPath+"/rex_datatype", dataType);
  1458. model.makeValue(gvReportPropsPath+"/rex_submitid", submitId);
  1459. model.makeValue(gvReportPropsPath+"/rex_userservice", userService);
  1460. model.makeValue(gvReportPropsPath+"/rex_data_xpath", dataXPath);
  1461. model.makeValue(gvReportPropsPath+"/rex_xpath", mainDataXPath);
  1462. model.makeValue(gvReportPropsPath+"/rex_xpath1", subDataXPath);
  1463. model.makeValue(gvReportOptionsPath+"/rex_print", print);
  1464. model.makeValue(gvReportOptionsPath+"/rex_printdialog", printDialog);
  1465. model.makeValue(gvReportOptionsPath+"/rex_printpaperbin", printPaperBin);
  1466. model.makeValue(gvReportOptionsPath+"/rex_filetype", fileType);
  1467. model.makeValue(gvReportOptionsPath+"/rex_filename", fileName);
  1468. model.makeValue(gvReportOptionsPath+"/rex_filedialog", fileDialog);
  1469. model.makeValue(gvReportOptionsPath+"/rex_close", closeYn);
  1470. model.makeValue(gvReportOptionsPath+"/rex_showbutton", showButton);
  1471. model.makeValue(gvReportOptionsPath+"/rex_printcount", printCount);
  1472. model.makeValue(gvReportOptionsPath+"/rex_zoomrate", zoomRate);
  1473. model.makeValue(gvReportOptionsPath+"/rex_printoption", printOption);
  1474. if(parentObjId == null || parentObjId == ""){
  1475. if(document.all("ivr_report") == null){
  1476. //popup
  1477. setParameter("onready","true");
  1478. modal("SPZUR00100", monNo);
  1479. }else{
  1480. //iviewer
  1481. ivr_report.window.javascript.fInitRexpert();
  1482. }
  1483. }else{
  1484. var parentObj = document.all("ivr_"+parentObjId);
  1485. if(parentObj != null){
  1486. var childObj = document.all("ivr_"+parentObjId);
  1487. if(childObj != null){
  1488. gCurrPrtObj = "ivr_"+parentObjId; //삭제할 viewer를 현재 출력 obj변수에 설정하고.. 프린트 끝난후 현재변수의 Iviewer를 삭제
  1489. childObj.window.javascript.fInitRexpert();
  1490. }
  1491. }
  1492. }
  1493. }
  1494. /**
  1495. 생성된 IViewer삭제
  1496. **/
  1497. function cleanIViewer() {
  1498. if (arguments[0] == "undefined" || arguments[0] == undefined) { //파라미터가 없으면 현재 gCurrPrtObj변수로 IViewer를 삭제하고
  1499. var o = document.all("ivr_"+gCurrPrtObj);
  1500. if (o != null) {
  1501. body.removeChild("ivr_"+gCurrPrtObj);
  1502. }
  1503. } else { //파라미터가 존재하면 파라미터 배열의 IViewer를 삭제함
  1504. if (arguments[0].indexOf("|") != -1)
  1505. return;
  1506. var arr = arguments[0].split("|");
  1507. for (var i in arr) {
  1508. var o = document.all("ivr_"+arr[i]);
  1509. if (o != null) {
  1510. body.removeChild("ivr_"+arr[i]);
  1511. }
  1512. }
  1513. }
  1514. gCurrPrtObj = null;
  1515. }