SMADT10200.js 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298
  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. /**
  21. * 초기화
  22. */
  23. function fInit() {
  24. if (model.getValue("/root/hidden/prcpsrch/prcpdd") == "") {
  25. // 날짜 초기화
  26. model.makeValue("/root/hidden/srchinfo/prcpdd", getCurrentDate());
  27. }
  28. //처방구분 초기화
  29. model.makeValue("/root/hidden/srchinfo/prcpflag", "A");
  30. //약주사구분 초기화
  31. model.makeValue("/root/hidden/srchinfo/drugkind", "T");
  32. //라벨 체크 초기화
  33. model.makeValue("/root/hidden/srchinfo/lblyn", "Y");
  34. fChkLBL_YN();
  35. //처방전 체크 초기화
  36. model.makeValue("/root/hidden/srchinfo/mpsflag", "P");
  37. //기타조회구분 초기화
  38. model.makeValue("/root/hidden/srchinfo/etcflag", "T");
  39. cbx_etcdescflag.disabled = true;
  40. //마감시 instcd 적용을 위해 instcd 초기화
  41. // model.setValue("/root/hidden/srchinfo/instcd", getUserInfo("posinstcd"));
  42. var dutplceinstcd = getUserInfo("dutplceinstcd");
  43. if(dutplceinstcd == ""){
  44. dutplceinstcd = "012";
  45. }
  46. model.makeValue("/root/hidden/srchinfo/instcd", dutplceinstcd);
  47. //makeReportPreview(0,270,820,700);
  48. //병동 Combo 조회
  49. model.setValue("/root/send/deptinfo/deptflag", "W");
  50. submit("TRADT10203");
  51. astfAddCombo("/root/hidden/deptlist", "ward", "wardcd,wardnm", "T,전체");
  52. //자동출력구분 초기화
  53. btn_autoprnt_start.disabled = false;
  54. btn_autoprnt_end.disabled = true;
  55. //model.setValue("/root/hidden/srchinfo/auto_selflag", "1");
  56. //chk_auto_big.disabled = false;
  57. //chk_auto_small.disabled = true;
  58. //model.setValue("/root/hidden/srchinfo/auto_bigflag", "E|L|G");
  59. //model.setValue("/root/hidden/srchinfo/auto_smallflag", "");
  60. //20100412 황세원 수정 병실컬럼
  61. submit("TRADT10213");
  62. if(model.getValue("init/roomyn/roomyn/roomyn")=="Y") {
  63. grd_patlist.colHidden(5) = false;
  64. model.makeValue("/root/hidden/srchinfo/atc3", "Y");
  65. } else {
  66. model.makeValue("/root/hidden/srchinfo/atc3", "N");
  67. grd_patlist.colHidden(5) = true;
  68. }
  69. model.refresh();
  70. /*/ 병실컬럼
  71. if(dutplceinstcd == "013") {
  72. grd_patlist.colHidden(5) = false;
  73. model.makeValue("/root/hidden/srchinfo/atc3", "Y");
  74. } else {
  75. model.makeValue("/root/hidden/srchinfo/atc3", "N");
  76. grd_patlist.colHidden(5) = true;
  77. }
  78. model.refresh();
  79. */
  80. //마감시간구분
  81. model.makeValue("/root/send/sumlistinfo/prcpflag", "A");
  82. submit("TRADT10206");
  83. cmb_sumtmflag.select(0);
  84. //처방전 감사화면에서 팝업으로 열때 데이터 조회
  85. if(model.getValue("/root/hidden/popupinfo/drugno") != ""){
  86. model.setValue("/root/hidden/srchinfo/prcpdd", model.getValue("/root/hidden/popupinfo/prcpdd"));
  87. model.setValue("/root/hidden/srchinfo/fst_drugno", model.getValue("/root/hidden/popupinfo/drugno"));
  88. model.setValue("/root/hidden/srchinfo/pid", model.getValue("/root/hidden/popupinfo/pid"));
  89. //model.setValue("/root/hidden/srchinfo/ward", model.getValue("/root/hidden/popupinfo/ward"));
  90. model.refresh();
  91. fInSumList();
  92. }
  93. //바코드프린터설정 초기화
  94. model.setValue("/root/send/scrnid", getScreenID());
  95. submit("TRLLC90101");
  96. var comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
  97. var prntkind = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  98. if(comm == "2") {
  99. model.setValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm", "1");
  100. }
  101. if(prntkind == "1") {
  102. model.setValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind", "5");
  103. }
  104. //추가마감시 admission과 병동응급을 함께 마감할지 여부 조회 , ATC순으로 정렬 체크 여부
  105. submit("TRADT10207");
  106. if(model.getValue("/root/init/sumprcpflagyn/flagyn/orderbyatc") == "Y") {
  107. model.setValue("/root/hidden/srchinfo/orderbyatc", "Y");
  108. model.refresh();
  109. }
  110. //라벨 출력 형식 옵션
  111. submit("TRADT10208");
  112. if(model.getValue("/root/init/lbltype/item2/lbltype") == "Y") {
  113. button4.visible = true;
  114. button6.visible = true;
  115. //checkbox8.visible = true; 20090812 주석처리 추후협희후 수정
  116. } else {
  117. button4.visible = false;
  118. button6.visible = false;
  119. //checkbox8.visible = false; 20090812 주석처리 추후협희후 수정
  120. }
  121. // 출고부서 조회, 설정 2009.09.07 pymi
  122. submit("TRADT01106");
  123. if((dutplceinstcd == "013") || (dutplceinstcd == "014") || (dutplceinstcd == "017")) {
  124. combo1.select(0);
  125. } else if(dutplceinstcd == "012") {
  126. combo1.select(2);
  127. } else {
  128. combo1.select(1);
  129. }
  130. chk_cnt ++;
  131. model.setValue("/root/temp/stocdeptcd", model.getValue("/root/hidden/srchinfo/stocdeptcd"));
  132. combo1.refresh();
  133. // (e)
  134. }
  135. /**
  136. * 라벨 변경시 처리
  137. */
  138. function fChkLBL_YN() {
  139. var chk = model.getValue("/root/hidden/srchinfo/lblyn");
  140. var sLbl_Drug = "D|DT|DX|DE|DH";
  141. var sLbl_Inj = "I|IO|IX|IE|IH";
  142. if(chk == "Y"){
  143. model.makeValue("/root/hidden/srchinfo/lbl_drug", sLbl_Drug);
  144. model.makeValue("/root/hidden/srchinfo/lbl_inj", sLbl_Inj);
  145. model.makeValue("/root/hidden/srchinfo/drugall", "Y");
  146. model.makeValue("/root/hidden/srchinfo/injall", "Y");
  147. } else {
  148. model.makeValue("/root/hidden/srchinfo/lbl_drug", "");
  149. model.makeValue("/root/hidden/srchinfo/lbl_inj", "");
  150. model.makeValue("/root/hidden/srchinfo/drugall", "");
  151. model.makeValue("/root/hidden/srchinfo/injall", "");
  152. }
  153. model.refresh();
  154. }
  155. /**
  156. * 마감리스트 조회
  157. */
  158. function fInSumList() {
  159. chk_ward.visible = false;
  160. if(model.getValue("/root/hidden/srchinfo/autoprntflag") == "" && model.getValue("/root/hidden/srchinfo/prcpflag") == ""){
  161. messageBox("처방구분을", "C001")
  162. return;
  163. }
  164. model.copyNode("/root/send/sumlistinfo", "/root/hidden/srchinfo");
  165. submit("TRADT10201");
  166. grd_sumlist.isSelected(grd_sumlist.fixedRows) = true;
  167. grd_sumlist.row = grd_sumlist.fixedRows;
  168. if(grd_sumlist.Rows > 1){
  169. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  170. } else {
  171. model.removeNodeset("/root/main/patlist/patlist");
  172. model.refresh();
  173. }
  174. }
  175. /**
  176. * 병동 마감
  177. */
  178. function fHosInSum(chk) {
  179. var prcpflag = model.getValue("/root/hidden/srchinfo/prcpflag");
  180. var prcpdd = model.getValue("/root/hidden/srchinfo/prcpdd");
  181. var instcd = model.getValue("/root/hidden/srchinfo/instcd");
  182. var pid = model.getValue("/root/hidden/srchinfo/pid");
  183. var drugkind = model.getValue("/root/hidden/srchinfo/drugkind");
  184. var onlyantis = model.getValue("/root/hidden/srchinfo/onlyantis");
  185. var prcpflagnm = rdo_prcp.label;
  186. var chkret = 0;
  187. var fromddflag = "";
  188. var fromdd = "";
  189. var fromtm = "";
  190. var toddflag = "";
  191. var todd = "";
  192. var totm = "";
  193. if(chk == "Y") {
  194. fromddflag = model.getValue("/root/hidden/srchinfo/fromddflag");
  195. fromtm = model.getValue("/root/hidden/srchinfo/fromtm");
  196. toddflag = model.getValue("/root/hidden/srchinfo/toddflag");
  197. totm = model.getValue("/root/hidden/srchinfo/totm");
  198. if ( prcpflag =="R" || prcpflag =="A" ){
  199. if( fromddflag == "" || fromtm == "" || toddflag == "" || totm == "" || fromtm.length != 4 || totm.length != 4) {
  200. messageBox("마감구분이 잘못", "E005");
  201. return;
  202. } else {
  203. if(fromddflag == "0") {
  204. fromdd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD") ;
  205. } else {
  206. fromdd = prcpdd ;
  207. }
  208. if(toddflag == "0") {
  209. todd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD") ;
  210. } else {
  211. todd = prcpdd ;
  212. }
  213. fromtm = fromtm + "00";
  214. totm = totm + "59";
  215. }
  216. } else {
  217. fromdd = "" ;
  218. todd = "" ;
  219. fromtm ="";
  220. totm ="";
  221. }
  222. chkret = messageBox(prcpflagnm + "마감을", "Q004");
  223. } else {
  224. chkret = 6;
  225. }
  226. if(chkret == 6){
  227. if(chk == "Y") {
  228. model.setValue("/root/send/suminfo/fromdd", fromdd);
  229. model.setValue("/root/send/suminfo/fromtm", fromtm);
  230. model.setValue("/root/send/suminfo/todd", todd);
  231. model.setValue("/root/send/suminfo/totm", totm);
  232. } else {
  233. model.setValue("/root/send/suminfo/fromdd", "");
  234. model.setValue("/root/send/suminfo/fromtm", "");
  235. model.setValue("/root/send/suminfo/todd", "");
  236. model.setValue("/root/send/suminfo/totm", "");
  237. }
  238. model.setValue("/root/send/suminfo/sumdt", getCurrentDateTime().replace(" ", ""));
  239. model.setValue("/root/send/suminfo/prcpdd", prcpdd);
  240. model.setValue("/root/send/suminfo/prcpflag", prcpflag);
  241. model.setValue("/root/send/suminfo/instcd", instcd);
  242. model.setValue("/root/send/suminfo/pid", pid);
  243. model.setValue("/root/send/suminfo/sumdrugkind", drugkind);
  244. model.setValue("/root/send/suminfo/onlyantis", onlyantis);
  245. model.setValue("/root/send/suminfo/mstocdeptcd", model.getValue("/root/hidden/srchinfo/stocdeptcd")); // 2009.09.11 pymi
  246. model.setValue("/root/send/suminfo/ioflag", "I");
  247. model.makeValue("/root/send/suminfo/multiyn", model.getValue("/root/hidden/srchinfo/multiyn")); //multi day 처방 포함 여부
  248. submit("TXADT10201");
  249. for(var i = 0 ; i < 15; i++) {
  250. submit("TXADT10201");
  251. }
  252. //추가마감시 flayn=Y이면 admission과 병동응급도 마감을 한다.
  253. if(chk == "Y" && prcpflag == "A" && model.getValue("/root/init/sumprcpflagyn/flagyn/flagyn") == "Y") {
  254. model.setValue("/root/send/suminfo/prcpflag", "M");
  255. for(var i = 0 ; i < 5; i++) {
  256. submit("TXADT10201");
  257. }
  258. model.setValue("/root/send/suminfo/prcpflag", "W");
  259. for(var i = 0 ; i < 5; i++) {
  260. submit("TXADT10201");
  261. }
  262. }
  263. if (model.getValue("/root/hidden/srchinfo/prcpflag")=="L" || model.getValue("/root/hidden/srchinfo/prcpflag")=="G") {
  264. model.setValue("/root/send/suminfo/prcpdd", prcpdd);
  265. model.setValue("/root/send/suminfo/prcpflag", prcpflag);
  266. model.setValue("/root/send/suminfo/instcd", instcd);
  267. model.setValue("/root/send/suminfo/pid", pid);
  268. model.setValue("/root/send/suminfo/ioflag", "O");
  269. for(var i = 0 ; i < 5; i++) {
  270. submit("TXADT10201");
  271. }
  272. }
  273. }
  274. }
  275. /**
  276. * 마감리스트 더블클릭시 출력할 환자리스트 조회
  277. */
  278. function fPrntPatList() {
  279. grd_patlist.rebuildStyle();
  280. if(model.getValue("/root/main/sumlist/sumlist["+grd_sumlist.row+"]/sumdt") != ""){
  281. model.copyNode("/root/send/patlistinfo","/root/main/sumlist/sumlist["+grd_sumlist.row+"]");
  282. model.makeValue("/root/send/patlistinfo/prcpdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
  283. model.makeValue("/root/send/patlistinfo/fst_drugno", model.getValue("/root/hidden/srchinfo/fst_drugno"));
  284. model.makeValue("/root/send/patlistinfo/last_drugno", model.getValue("/root/hidden/srchinfo/last_drugno"));
  285. model.makeValue("/root/send/patlistinfo/wardcd", model.getValue("/root/hidden/srchinfo/wardcd"));
  286. model.makeValue("/root/send/patlistinfo/pid", model.getValue("/root/hidden/srchinfo/pid"));
  287. model.makeValue("/root/send/patlistinfo/autoprntflag", model.getValue("/root/hidden/srchinfo/autoprntflag"));
  288. model.makeValue("/root/send/patlistinfo/etcdescflag", model.getValue("/root/hidden/srchinfo/etcdescflag"));
  289. model.makeValue("/root/send/patlistinfo/prntkind", model.getValue("/root/hidden/srchinfo/prntkind"));
  290. model.makeValue("/root/send/patlistinfo/autolblyn", model.getValue("/root/hidden/srchinfo/autolblyn"));
  291. model.makeValue("/root/send/patlistinfo/prcpflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
  292. model.makeValue("/root/send/patlistinfo/orderbyatc", model.getValue("/root/hidden/srchinfo/orderbyatc"));
  293. model.makeValue("/root/send/patlistinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  294. model.makeValue("/root/send/patlistinfo/atc3", model.getValue("/root/hidden/srchinfo/atc3"));
  295. model.makeValue("/root/send/patlistinfo/autoyn", model.getValue("/root/hidden/srchinfo/autoyn"));
  296. submit("TRADT10202");
  297. if(model.getValue("/root/hidden/srchinfo/fst_drugno") != ""){
  298. model.setValue("/root/main/patlist/patlist/sel", "Y");
  299. }
  300. //sortNodeList("")
  301. }
  302. }
  303. /**
  304. * 처방전/라벨 출력
  305. */
  306. function fPrcpMPSPrint( flag ) {
  307. //투약번호로 출력
  308. var sDrugNo = model.getValue("/root/hidden/srchinfo/fst_drugno");
  309. sleepTime = model.getValue("/root/hidden/sleeptime") * 1000;
  310. /*if(sDrugNo != ""
  311. && chk_prnt_count == 0){
  312. fAutoPrnt();
  313. return;
  314. }*/
  315. chk_prnt_count = 0;
  316. //처방전 및 라벨 출력
  317. var chk_mpsflag = model.getValue("/root/hidden/srchinfo/mpsflag");
  318. var chk_lblyn = model.getValue("/root/hidden/srchinfo/lblyn");
  319. var chk_lbl_drug = model.getValue("/root/hidden/srchinfo/lbl_drug");
  320. var chk_lbl_inj = model.getValue("/root/hidden/srchinfo/lbl_inj");
  321. grd_patlist.rebuildStyle();
  322. if (chk_mpsflag != "" || chk_lblyn != "") {
  323. //처방전 출력 데이터 조회
  324. var cnt = 0;
  325. for(var i = grd_patlist.fixedRows; i < grd_patlist.rows; i++){
  326. if(model.getValue("/root/main/patlist/patlist["+i+"]/sel") == "Y"){
  327. model.copyNode("/root/send/prcpinfo", "/root/main/patlist/patlist["+i+"]");
  328. if(chk_lbl_drug != "" && chk_lbl_inj != ""){
  329. model.makeValue("/root/send/prcpinfo/lblflag", chk_lbl_drug+"|"+chk_lbl_inj);
  330. } else if(chk_lbl_drug != ""){
  331. model.makeValue("/root/send/prcpinfo/lblflag", chk_lbl_drug);
  332. } else if(chk_lbl_inj != ""){
  333. model.makeValue("/root/send/prcpinfo/lblflag", chk_lbl_inj);
  334. }
  335. model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
  336. model.makeValue("/root/send/prcpinfo/prntflag", model.getValue("/root/hidden/srchinfo/prntflag"));
  337. model.makeValue("/root/send/prcpinfo/reprintyn", model.getValue("/root/hidden/srchinfo/reprintyn"));
  338. model.makeValue("/root/send/prcpinfo/ioflag", "I");
  339. var drugno = model.getValue("/root/send/prcpinfo/drugno");
  340. var wardcd = model.getValue("/root/send/prcpinfo/wardcd");
  341. var pid = model.getValue("/root/send/prcpinfo/pid");
  342. //alert(flag);
  343. if ( flag =="M" || flag == null ){
  344. //처방전 출력
  345. // if (chk_mpsflag != "" && fChkParam(drugno, wardcd, pid) == true) {
  346. if (chk_mpsflag != "" ) {
  347. //var gT1 = window.setInterval("fHosInMPSPrint()",10000);
  348. //window.clearinterval(gT1);
  349. //gT1 = window.setInterval("fStopTimer()",100000);
  350. fSleep(sleepTime);
  351. fHosInMPSPrint();
  352. }
  353. }
  354. if ( flag =="L" || flag == null ){
  355. //라벨 출력
  356. // if (chk_lblyn != "" && fChkParam(drugno, wardcd, pid) == true) {
  357. if (chk_lblyn != "" ) {
  358. fSleep(sleepTime);
  359. fHosInLBLPrint();
  360. }
  361. }
  362. if ( flag =="Q" ){
  363. //라벨 출력
  364. // if (chk_lblyn != "" && fChkParam(drugno, wardcd, pid) == true) {
  365. if (chk_lblyn != "" ) {
  366. fSleep(sleepTime/2);
  367. fLiquidLBLPrint();
  368. }
  369. }
  370. if ( flag =="O" ){
  371. //라벨 출력
  372. // if (chk_lblyn != "" && fChkParam(drugno, wardcd, pid) == true) {
  373. if (chk_lblyn != "" ) {
  374. fSleep(sleepTime/2);
  375. fOutLBLPrint();
  376. }
  377. }
  378. if ( flag =="P" ){
  379. //라벨 출력
  380. // if (chk_lblyn != "" && fChkParam(drugno, wardcd, pid) == true) {
  381. if (chk_lblyn != "" ) {
  382. fSleep(sleepTime/2);
  383. fPTPLBLPrint();
  384. }
  385. }
  386. cnt++;
  387. if (model.getValue("/root/hidden/srchinfo/autoyn") !="Y") {
  388. //출력상태 표시
  389. for ( var j = 0 ; j < grd_patlist.cols -1; j++){
  390. grd_patlist.cellStyle("background-color", i, j) = "#cfffcf";
  391. //grd_patlist.cellStyle("font-weight", i, j) = "bold";
  392. }
  393. grd_patlist.refresh();
  394. }
  395. }
  396. }
  397. if( cnt == 0 && gTimer == null){
  398. messageBox("처방전을 출력할 환자리스트가 없거나 선택된 환자가", "I004");
  399. }
  400. model.setValue("/root/send/atcinfo/drugdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
  401. if ( model.getValue("/root/hidden/srchinfo/prcpflag") =="L" ) {
  402. model.setValue("/root/send/atcinfo/drugflag", "L");
  403. } else if ( model.getValue("/root/hidden/srchinfo/prcpflag") =="E" ) {
  404. model.setValue("/root/send/atcinfo/drugflag", "E");
  405. } else {
  406. model.setValue("/root/send/atcinfo/drugflag", "I");
  407. }
  408. if (model.getValue("/root/hidden/srchinfo/autoatcyn") =="Y") {
  409. model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  410. submit("TXADT10202"); //ATC Data 전송(배치호출)
  411. }
  412. }
  413. }
  414. function fStopTimer() {
  415. window.clearinterval(gT1);
  416. }
  417. /**
  418. * 처방전 출력
  419. */
  420. function fHosInMPSPrint() {
  421. var sParam = "";
  422. sParam = "drugdd▦drugno▦ioflag▦prcpdd▦orddd▦cretno▦prcpgenrflag▦pid▦orddeptcd▦wardcd▦lblflag▦prcpflag▦prntflag▦etcdescflag▦reyn▦autoyn▦reprintyn▩";
  423. sParam += model.getValue("/root/send/prcpinfo/drugdd")+"▦"+
  424. model.getValue("/root/send/prcpinfo/drugno")+"▦"+
  425. model.getValue("/root/send/prcpinfo/ioflag")+"▦"+
  426. model.getValue("/root/send/prcpinfo/prcpdd")+"▦"+
  427. model.getValue("/root/send/prcpinfo/orddd")+"▦"+
  428. model.getValue("/root/send/prcpinfo/cretno")+"▦"+
  429. model.getValue("/root/send/prcpinfo/prcpgenrflag")+"▦"+
  430. model.getValue("/root/send/prcpinfo/pid")+"▦"+
  431. model.getValue("/root/send/prcpinfo/orddeptcd")+"▦"+
  432. model.getValue("/root/send/prcpinfo/wardcd")+"▦"+
  433. model.getValue("/root/send/prcpinfo/lblflag")+"▦"+
  434. //model.getValue("/root/send/prcpinfo/prcpflag")+"▦"+
  435. model.getValue("/root/send/prcpinfo/drugflag")+"▦"+
  436. model.getValue("/root/send/prcpinfo/prntflag")+"▦"+
  437. model.getValue("/root/hidden/srchinfo/etcdescflag")+"▦"+
  438. model.getValue("/root/send/prcpinfo/reyn")+"▦"+
  439. model.getValue("/root/hidden/srchinfo/autoyn") +"▦"+
  440. model.getValue("/root/send/prcpinfo/reprintyn")+"▦"+
  441. model.getValue("/root/hidden/srchinfo/stocdeptcd")+"▩"; // 2009.09.08 pymi
  442. model.setAttribute("params", sParam);
  443. modal("SPADT62200",0,200,200,"","");
  444. model.setAttribute("params", "");
  445. return 0;
  446. }
  447. /**
  448. * 라벨 출력
  449. */
  450. function fHosInLBLPrint() {
  451. var sParam = "";
  452. sParam = "drugdd▦drugno▦ioflag▦prcpdd▦orddd▦cretno▦prcpgenrflag▦pid▦orddeptcd▦wardcd▦lblflag▦prcpflag▦prntflag▦liquidflag▦etcdescflag▦lblkind▦outlblyn▦ptplblyn▦reprintyn▦lbltype▦drugkind▦autolblyn▩";
  453. sParam += model.getValue("/root/send/prcpinfo/drugdd")+"▦"+
  454. model.getValue("/root/send/prcpinfo/drugno")+"▦"+
  455. model.getValue("/root/send/prcpinfo/ioflag")+"▦"+
  456. model.getValue("/root/send/prcpinfo/prcpdd")+"▦"+
  457. model.getValue("/root/send/prcpinfo/orddd")+"▦"+
  458. model.getValue("/root/send/prcpinfo/cretno")+"▦"+
  459. model.getValue("/root/send/prcpinfo/prcpgenrflag")+"▦"+
  460. model.getValue("/root/send/prcpinfo/pid")+"▦"+
  461. model.getValue("/root/send/prcpinfo/orddeptcd")+"▦"+
  462. model.getValue("/root/send/prcpinfo/wardcd")+"▦"+
  463. model.getValue("/root/send/prcpinfo/lblflag")+"▦"+
  464. //model.getValue("/root/send/prcpinfo/prcpflag")+"▦"+
  465. model.getValue("/root/send/prcpinfo/drugflag")+"▦"+
  466. model.getValue("/root/send/prcpinfo/prntflag")+"▦"+
  467. ""+"▦"+
  468. model.getValue("/root/hidden/srchinfo/etcdescflag")+"▦"+
  469. model.getValue("/root/hidden/srchinfo/lblkind")+"▦"+
  470. ""+"▦"+
  471. ""+"▦"+
  472. model.getValue("/root/send/prcpinfo/reprintyn")+"▦"+
  473. model.getValue("/root/init/lbltype/item/lbltype")+"▦"+
  474. model.getValue("/root/hidden/srchinfo/drugkind")+"▦"+
  475. model.getValue("/root/hidden/srchinfo/autoyn")+"▩";
  476. model.setAttribute("params", sParam);
  477. model.copyNode("/root/init/barcdprntsetup", "/root/main/barcdprntsetup");
  478. modal("SPADT62300",0,200,200,"SPADT62300","/root/init/barcdprntsetup","/root/init/barcdprntsetup");
  479. model.setAttribute("params", "");
  480. // submit("TRADT10205");
  481. return 0;
  482. }
  483. /**
  484. * 물약 라벨 출력
  485. */
  486. function fLiquidLBLPrint() {
  487. //처방전 출력 데이터 조회
  488. var cnt = 0;
  489. for(var i = grd_patlist.fixedRows; i < grd_patlist.rows; i++){
  490. if(model.getValue("/root/main/patlist/patlist["+i+"]/sel") == "Y"){
  491. model.copyNode("/root/send/prcpinfo", "/root/main/patlist/patlist["+i+"]");
  492. model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
  493. model.makeValue("/root/send/prcpinfo/prntflag", model.getValue("/root/hidden/srchinfo/prntflag"));
  494. model.makeValue("/root/send/prcpinfo/reprintyn", model.getValue("/root/hidden/srchinfo/reprintyn"));
  495. model.makeValue("/root/send/prcpinfo/ioflag", "I");
  496. var drugno = model.getValue("/root/send/prcpinfo/drugno");
  497. var wardcd = model.getValue("/root/send/prcpinfo/wardcd");
  498. var pid = model.getValue("/root/send/prcpinfo/pid");
  499. var sParam = "";
  500. sParam = "drugdd▦drugno▦ioflag▦prcpdd▦orddd▦cretno▦prcpgenrflag▦pid▦orddeptcd▦wardcd▦lblflag▦prcpflag▦prntflag▦liquidflag▦etcdescflag▦lblkind▦outlblyn▦ptplblyn▦reprintyn▦lbltype▦drugkind▦autolblyn▩";
  501. sParam += model.getValue("/root/send/prcpinfo/drugdd")+"▦"+
  502. model.getValue("/root/send/prcpinfo/drugno")+"▦"+
  503. model.getValue("/root/send/prcpinfo/ioflag")+"▦"+
  504. model.getValue("/root/send/prcpinfo/prcpdd")+"▦"+
  505. model.getValue("/root/send/prcpinfo/orddd")+"▦"+
  506. model.getValue("/root/send/prcpinfo/cretno")+"▦"+
  507. model.getValue("/root/send/prcpinfo/prcpgenrflag")+"▦"+
  508. model.getValue("/root/send/prcpinfo/pid")+"▦"+
  509. model.getValue("/root/send/prcpinfo/orddeptcd")+"▦"+
  510. model.getValue("/root/send/prcpinfo/wardcd")+"▦"+
  511. model.getValue("/root/send/prcpinfo/lblflag")+"▦"+
  512. //model.getValue("/root/send/prcpinfo/prcpflag")+"▦"+
  513. model.getValue("/root/send/prcpinfo/drugflag")+"▦"+
  514. model.getValue("/root/send/prcpinfo/prntflag")+"▦"+
  515. "Y"+"▦"+
  516. model.getValue("/root/hidden/srchinfo/etcdescflag")+"▦"+
  517. model.getValue("/root/hidden/srchinfo/lblkind")+"▦"+
  518. ""+"▦"+
  519. ""+"▦"+
  520. model.getValue("/root/send/prcpinfo/reprintyn")+"▦"+
  521. model.getValue("/root/init/lbltype/item/lbltype")+"▦"+
  522. model.getValue("/root/hidden/srchinfo/drugkind")+"▦"+
  523. model.getValue("/root/hidden/srchinfo/autoyn")+"▩";
  524. model.setAttribute("params", sParam);
  525. model.copyNode("/root/init/barcdprntsetup", "/root/main/barcdprntsetup");
  526. modal("SPADT62300",0,200,200,"SPADT62300","/root/init/barcdprntsetup","/root/init/barcdprntsetup");
  527. model.setAttribute("params", "");
  528. //fSleep(sleepTime);
  529. cnt++;
  530. }
  531. }
  532. if( cnt == 0 && gTimer == null){
  533. messageBox("라벨를 출력할 환자리스트가 없거나 선택된 환자가", "I004");
  534. }
  535. }
  536. /**
  537. * 외용 라벨 출력
  538. */
  539. function fOutLBLPrint() {
  540. //처방전 출력 데이터 조회
  541. var cnt = 0;
  542. for(var i = grd_patlist.fixedRows; i < grd_patlist.rows; i++){
  543. if(model.getValue("/root/main/patlist/patlist["+i+"]/sel") == "Y"){
  544. model.copyNode("/root/send/prcpinfo", "/root/main/patlist/patlist["+i+"]");
  545. model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
  546. model.makeValue("/root/send/prcpinfo/prntflag", model.getValue("/root/hidden/srchinfo/prntflag"));
  547. model.makeValue("/root/send/prcpinfo/reprintyn", model.getValue("/root/hidden/srchinfo/reprintyn"));
  548. model.makeValue("/root/send/prcpinfo/ioflag", "I");
  549. var drugno = model.getValue("/root/send/prcpinfo/drugno");
  550. var wardcd = model.getValue("/root/send/prcpinfo/wardcd");
  551. var pid = model.getValue("/root/send/prcpinfo/pid");
  552. var sParam = "";
  553. sParam = "drugdd▦drugno▦ioflag▦prcpdd▦orddd▦cretno▦prcpgenrflag▦pid▦orddeptcd▦wardcd▦lblflag▦prcpflag▦prntflag▦liquidflag▦etcdescflag▦lblkind▦outlblyn▦ptplblyn▦reprintyn▦lbltype▦drugkind▦autolblyn▩";
  554. sParam += model.getValue("/root/send/prcpinfo/drugdd")+"▦"+
  555. model.getValue("/root/send/prcpinfo/drugno")+"▦"+
  556. model.getValue("/root/send/prcpinfo/ioflag")+"▦"+
  557. model.getValue("/root/send/prcpinfo/prcpdd")+"▦"+
  558. model.getValue("/root/send/prcpinfo/orddd")+"▦"+
  559. model.getValue("/root/send/prcpinfo/cretno")+"▦"+
  560. model.getValue("/root/send/prcpinfo/prcpgenrflag")+"▦"+
  561. model.getValue("/root/send/prcpinfo/pid")+"▦"+
  562. model.getValue("/root/send/prcpinfo/orddeptcd")+"▦"+
  563. model.getValue("/root/send/prcpinfo/wardcd")+"▦"+
  564. model.getValue("/root/send/prcpinfo/lblflag")+"▦"+
  565. //model.getValue("/root/send/prcpinfo/prcpflag")+"▦"+
  566. model.getValue("/root/send/prcpinfo/drugflag")+"▦"+
  567. model.getValue("/root/send/prcpinfo/prntflag")+"▦"+
  568. ""+"▦"+
  569. model.getValue("/root/hidden/srchinfo/etcdescflag")+"▦"+
  570. model.getValue("/root/hidden/srchinfo/lblkind")+"▦"+
  571. "Y"+"▦"+
  572. ""+"▦"+
  573. model.getValue("/root/send/prcpinfo/reprintyn")+"▦"+
  574. model.getValue("/root/init/lbltype/item/lbltype")+"▦"+
  575. model.getValue("/root/hidden/srchinfo/drugkind")+"▦"+
  576. model.getValue("/root/hidden/srchinfo/autoyn")+"▩";
  577. model.setAttribute("params", sParam);
  578. model.copyNode("/root/init/barcdprntsetup", "/root/main/barcdprntsetup");
  579. modal("SPADT62300",0,200,200,"SPADT62300","/root/init/barcdprntsetup","/root/init/barcdprntsetup");
  580. model.setAttribute("params", "");
  581. //fSleep(sleepTime);
  582. cnt++;
  583. }
  584. }
  585. if( cnt == 0 && gTimer == null){
  586. messageBox("라벨를 출력할 환자리스트가 없거나 선택된 환자가", "I004");
  587. }
  588. }
  589. /**
  590. * PTP 라벨 출력 ( ATC 전송구분 e 인 처방만 있는 약번호의 라벨 )
  591. */
  592. function fPTPLBLPrint() {
  593. //처방전 출력 데이터 조회
  594. var cnt = 0;
  595. for(var i = grd_patlist.fixedRows; i < grd_patlist.rows; i++){
  596. if(model.getValue("/root/main/patlist/patlist["+i+"]/sel") == "Y"){
  597. model.copyNode("/root/send/prcpinfo", "/root/main/patlist/patlist["+i+"]");
  598. model.makeValue("/root/send/prcpinfo/prcpflag", model.getValue("/root/hidden/srchinfo/prcpflag"));
  599. model.makeValue("/root/send/prcpinfo/prntflag", model.getValue("/root/hidden/srchinfo/prntflag"));
  600. model.makeValue("/root/send/prcpinfo/reprintyn", model.getValue("/root/hidden/srchinfo/reprintyn"));
  601. model.makeValue("/root/send/prcpinfo/ioflag", "I");
  602. var drugno = model.getValue("/root/send/prcpinfo/drugno");
  603. var wardcd = model.getValue("/root/send/prcpinfo/wardcd");
  604. var pid = model.getValue("/root/send/prcpinfo/pid");
  605. var sParam = "";
  606. sParam = "drugdd▦drugno▦ioflag▦prcpdd▦orddd▦cretno▦prcpgenrflag▦pid▦orddeptcd▦wardcd▦lblflag▦prcpflag▦prntflag▦liquidflag▦etcdescflag▦lblkind▦outlblyn▦ptplblyn▦reprintyn▦lbltype▦drugkind▦autolblyn▩";
  607. sParam += model.getValue("/root/send/prcpinfo/drugdd")+"▦"+
  608. model.getValue("/root/send/prcpinfo/drugno")+"▦"+
  609. model.getValue("/root/send/prcpinfo/ioflag")+"▦"+
  610. model.getValue("/root/send/prcpinfo/prcpdd")+"▦"+
  611. model.getValue("/root/send/prcpinfo/orddd")+"▦"+
  612. model.getValue("/root/send/prcpinfo/cretno")+"▦"+
  613. model.getValue("/root/send/prcpinfo/prcpgenrflag")+"▦"+
  614. model.getValue("/root/send/prcpinfo/pid")+"▦"+
  615. model.getValue("/root/send/prcpinfo/orddeptcd")+"▦"+
  616. model.getValue("/root/send/prcpinfo/wardcd")+"▦"+
  617. model.getValue("/root/send/prcpinfo/lblflag")+"▦"+
  618. //model.getValue("/root/send/prcpinfo/prcpflag")+"▦"+
  619. model.getValue("/root/send/prcpinfo/drugflag")+"▦"+
  620. model.getValue("/root/send/prcpinfo/prntflag")+"▦"+
  621. ""+"▦"+
  622. model.getValue("/root/hidden/srchinfo/etcdescflag")+"▦"+
  623. model.getValue("/root/hidden/srchinfo/lblkind")+"▦"+
  624. ""+"▦"+
  625. "Y"+"▦"+
  626. model.getValue("/root/send/prcpinfo/reprintyn")+"▦"+
  627. model.getValue("/root/init/lbltype/item/lbltype")+"▦"+
  628. model.getValue("/root/hidden/srchinfo/drugkind")+"▦"+
  629. model.getValue("/root/hidden/srchinfo/autoyn")+"▩";
  630. model.setAttribute("params", sParam);
  631. model.copyNode("/root/init/barcdprntsetup", "/root/main/barcdprntsetup");
  632. modal("SPADT62300",0,200,200,"SPADT62300","/root/init/barcdprntsetup","/root/init/barcdprntsetup");
  633. model.setAttribute("params", "");
  634. //fSleep(sleepTime);
  635. cnt++;
  636. }
  637. }
  638. if( cnt == 0 && gTimer == null){
  639. messageBox("라벨를 출력할 환자리스트가 없거나 선택된 환자가", "I004");
  640. }
  641. }
  642. /**
  643. * 처방전 출력
  644. */
  645. /*
  646. function fChkParam(drugno, wardcd, pid) {
  647. var chk = true;
  648. var srch_fst_drugno = model.getValue("/root/hidden/srchinfo/fst_drugno");
  649. var srch_last_drugno = model.getValue("/root/hidden/srchinfo/last_drugno");
  650. var srch_wardcd = model.getValue("/root/hidden/srchinfo/ward");
  651. var srch_pid = model.getValue("/root/hidden/srchinfo/pid");
  652. //투약번호 조회 범위에 있는지 체크
  653. if(srch_fst_drugno != "" && srch_last_drugno != ""){
  654. if(drugno <= srch_fst_drugno && drugno >= srch_last_drugno){
  655. chk = false;
  656. chk_drugno++;
  657. }
  658. } else if(srch_fst_drugno != "") {
  659. if(drugno != srch_fst_drugno ){
  660. chk = false;
  661. chk_drugno++;
  662. }
  663. } else if(srch_last_drugno != ""){
  664. if(drugno != srch_last_drugno ){
  665. chk = false;
  666. chk_drugno++;
  667. }
  668. }
  669. //조회병동과 동일한지 체크
  670. if(srch_wardcd != ""){
  671. if(wardcd != srch_wardcd){
  672. chk = false;
  673. chk_wardcd++;
  674. }
  675. }
  676. //조회환자번호과 동일한지 체크
  677. if(srch_pid != ""){
  678. if(pid != srch_pid){
  679. chk = false;
  680. chk_pid++;
  681. }
  682. }
  683. return chk;
  684. }*/
  685. /**
  686. * 자동출력 버튼 클릭시 타이머 작동
  687. */
  688. function fClickAutoPrnt(chk) {
  689. if (chk == "Y") {
  690. //20090824 마정민 수정. 오류가 나더라도 팝업이 뜨지 않고 계속해서 진행될 수 있도록 수정.
  691. setErrorOff(true);
  692. model.setValue("/root/hidden/autoend", "N") ;
  693. /*if(model.getValue("/root/hidden/srchinfo/auto_selflag") == "1" && model.getValue("/root/hidden/srchinfo/auto_bigflag") == ""){
  694. messageBox("자동출력구분을", "C001");
  695. return;
  696. } else if(model.getValue("/root/hidden/srchinfo/auto_selflag") == "2" && model.getValue("/root/hidden/srchinfo/auto_smallflag") == ""){
  697. messageBox("자동출력구분을", "C001");
  698. return;
  699. }*/
  700. if(model.getValue("/root/hidden/srchinfo/autoprntflag") == ""){
  701. messageBox("자동출력의 처방구분을", "C001");
  702. return;
  703. }
  704. if(model.getValue("/root/hidden/srchinfo/autokind") == "") {
  705. messageBox("자동출력의 출력구분을", "C001");
  706. return;
  707. }
  708. /*if(isSearchString(chk_auto_big.value, "L") || isSearchString(chk_auto_big.value, "Q")) {
  709. if(model.getValue("/root/hidden/srchinfo/autolblflag") == ""){
  710. messageBox("자동출력의 라벨구분을", "C001");
  711. return;
  712. }
  713. }*/
  714. var sRst = "";
  715. if(gTimer != null) {
  716. sRst = messageBox("자동출력이 동작중입니다.\n자동출력구분설정대로 다시", "Q004");
  717. if(sRst == "6"){
  718. window.clearinterval(gTimer);
  719. gTimer = null;
  720. } else {
  721. return;
  722. }
  723. }
  724. if(sRst == ""){
  725. sRst = messageBox("자동출력을", "S001");
  726. if(sRst != "6"){
  727. return;
  728. }
  729. }
  730. btn_hist.visible=false;
  731. grd_sumlist.visible=false;
  732. grd_patlist.visible=false;
  733. //20090914 이선경 추가 : 자동출력중 처방구분등 다른조건 변경 못하게 함(오류 가능성 있음)
  734. rdo_prcp.disabled = true; //처방구분(정규, 추가)
  735. rdo_prcp2.disabled = true; //처방구분(admission, 병동응급, 퇴원, 외박, 응급실)
  736. checkbox4.disabled = true; //항암프로토콜처방만 체크
  737. ipt_fst_drugno.disabled = true; //투약번호 from
  738. caption25.disabled = true; //'~'
  739. ipt_last_drugno.disabled = true; //투약번호 to
  740. ipt_pid.disabled = true; //등록번호
  741. btn_prt.disabled = true; //출력버튼
  742. button1.disabled = true; //마감버튼
  743. button2.disabled = true; //물약라벨버튼
  744. button4.disabled = true; //외용라벨버튼
  745. button6.disabled = true; //ptp라벨버튼
  746. chk_auto_small.disabled = true; //자동출력의 처방구분
  747. //chk_auto_lblflag.disabled = true; //자동출력의 라벨구분
  748. chk_auto_big.disabled = true; //자동출력의 출력구분
  749. checkbox8.disabled = true; //자동출력의 ptp라벨, 외용라벨
  750. ipt_prcpdd.disabled = true; //적용일자
  751. btn_sea.disabled = true; //조회버튼
  752. cmb_sumtmflag.disabled = true; //마감시간대구분
  753. cmb_fromddflag.disabled = true; //마감일자from
  754. ipt_fromtm.disabled = true; //마감시간from
  755. cmb_toddflag.disabled = true; //마감일자to
  756. ipt_totm.disabled = true; //마감시간to
  757. radio1.disabled = true; //약주사구분
  758. radio3.disabled = true; //기타조회구분
  759. btn_init.disabled = true; //초기화버튼
  760. button5.disabled = true; //병동검색이미지
  761. chk_mps.disabled = true; //출력구분의 처방전체크
  762. chk_lbl.disabled = true; //출력구분의 라벨체크
  763. checkbox1.disabled = true; //출력구분의 약체크
  764. checkbox2.disabled = true; //출력구분의 주사체크
  765. chk_lbl_drug.disabled = true; //출력구분의 약리스트체크
  766. chk_lbl_inj.disabled = true; //출력구분의 주사리스트체크
  767. combo1.disabled = true; //실출고부서
  768. checkbox7.disabled = true; //ATC순으로 정렬
  769. //cmb_ward.visible = false;
  770. model.setValue("/root/hidden/srchinfo/prcpflag", "");
  771. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  772. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  773. model.setValue("/root/hidden/srchinfo/wardcd", "");
  774. model.setValue("/root/hidden/srchinfo/wardnm", "");
  775. model.setValue("/root/temp/srchinfo/ward", "");
  776. model.setValue("/root/hidden/srchinfo/pid", "");
  777. model.setValue("/root/hidden/srchinfo/onlyantis","");
  778. model.makeValue("/root/hidden/srchinfo/autoyn", "Y");
  779. model.setValue("/root/send/suminfo/fromdd", "");
  780. model.setValue("/root/send/suminfo/fromtm", "");
  781. model.setValue("/root/send/suminfo/todd", "");
  782. model.setValue("/root/send/suminfo/totm", "");
  783. //model.setValue("/root/hidden/srchinfo/fromdd", "");
  784. //model.setValue("/root/hidden/srchinfo/fromtm", "");
  785. //model.setValue("/root/hidden/srchinfo/todd", "");
  786. //model.setValue("/root/hidden/srchinfo/totm", "");
  787. var autostr = chk_auto_small.label + " " + chk_auto_big.label;
  788. /*if(isSearchString(chk_auto_big.value, "L") || isSearchString(chk_auto_big.value, "Q")){
  789. autostr = autostr + "(" + chk_auto_lblflag.label + ")";
  790. }*/
  791. autostr = autostr.setReplaceWord("|", ", " );
  792. caption23.text = autostr;
  793. model.refresh();
  794. window.minimize();
  795. fSleep(sleepTime);
  796. window.maximize();
  797. /*if(model.getValue("/root/hidden/srchinfo/auto_selflag") == "1"){
  798. model.setValue("/root/hidden/srchinfo/autoprntflag", model.getValue("/root/hidden/srchinfo/auto_bigflag"));
  799. } else {
  800. model.setValue("/root/hidden/srchinfo/autoprntflag", model.getValue("/root/hidden/srchinfo/auto_smallflag"));
  801. }*/
  802. btn_autoprnt_start.disabled = true;
  803. btn_autoprnt_end.disabled = false;
  804. chk_sum_count = 8;
  805. gTimer = window.setInterval("fAutoPrnt()",11000);
  806. //재출력 불가
  807. model.setValue("/root/hidden/srchinfo/reprintyn", "");
  808. checkbox3.disabled = true;
  809. group2.visible = "true";
  810. //서버오류가 발생하더라도 modeless 팝업을 통해 계속해서 진행할 수 있도록 수정.
  811. fErrMsg ();
  812. } else {
  813. setErrorOn();
  814. window.clearinterval(gTimer);
  815. gTimer = null;
  816. btn_hist.visible=true;
  817. grd_sumlist.visible=true;
  818. grd_patlist.visible=true;
  819. //20090914 이선경 추가 : 자동출력중 처방구분등 다른조건 변경 못하게 함(오류 가능성 있음)
  820. rdo_prcp.disabled = false; //처방구분(정규, 추가)
  821. rdo_prcp2.disabled = false; //처방구분(admission, 병동응급, 퇴원, 외박, 응급실)
  822. checkbox4.disabled = false; //항암프로토콜처방만 체크
  823. ipt_fst_drugno.disabled = false; //투약번호 from
  824. caption25.disabled = false; //'~'
  825. ipt_last_drugno.disabled = false; //투약번호 to
  826. ipt_pid.disabled = false; //등록번호
  827. btn_prt.disabled = false; //출력버튼
  828. button1.disabled = false; //마감버튼
  829. button2.disabled = false; //물약라벨버튼
  830. button4.disabled = false; //외용라벨버튼
  831. button6.disabled = false; //ptp라벨버튼
  832. chk_auto_small.disabled = false; //자동출력의 처방구분
  833. //chk_auto_lblflag.disabled = false; //자동출력의 라벨구분
  834. chk_auto_big.disabled = false; //자동출력의 출력구분
  835. checkbox8.disabled = false; //자동출력의 ptp라벨, 외용라벨
  836. ipt_prcpdd.disabled = false; //적용일자
  837. btn_sea.disabled = false; //조회버튼
  838. cmb_sumtmflag.disabled = false; //마감시간대구분
  839. cmb_fromddflag.disabled = false; //마감일자from
  840. ipt_fromtm.disabled = false; //마감시간from
  841. cmb_toddflag.disabled = false; //마감일자to
  842. ipt_totm.disabled = false; //마감시간to
  843. radio1.disabled = false; //약주사구분
  844. radio3.disabled = false; //기타조회구분
  845. btn_init.disabled = false; //초기화버튼
  846. button5.disabled = false; //병동검색이미지
  847. chk_mps.disabled = false; //출력구분의 처방전체크
  848. chk_lbl.disabled = false; //출력구분의 라벨체크
  849. checkbox1.disabled = false; //출력구분의 약체크
  850. checkbox2.disabled = false; //출력구분의 주사체크
  851. chk_lbl_drug.disabled = false; //출력구분의 약리스트체크
  852. chk_lbl_inj.disabled = false; //출력구분의 주사리스트체크
  853. combo1.disabled = false; //실출고부서
  854. checkbox7.disabled = false; //ATC순으로 정렬
  855. if(model.getValue("/root/init/lbltype/item2/lbltype") == "Y") {
  856. button4.visible = true;
  857. button6.visible = true;
  858. } else {
  859. button4.visible = false;
  860. button6.visible = false;
  861. }
  862. //cmb_ward.visible = true;
  863. model.setValue("/root/hidden/srchinfo/prcpflag", "");
  864. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  865. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  866. model.setValue("/root/hidden/srchinfo/wardcd", "");
  867. model.setValue("/root/hidden/srchinfo/wardnm", "");
  868. model.setValue("/root/temp/srchinfo/ward", "");
  869. model.setValue("/root/hidden/srchinfo/pid", "");
  870. //model.setValue("/root/hidden/srchinfo/autoprntflag", "");
  871. model.makeValue("/root/hidden/srchinfo/autoyn", "");
  872. btn_autoprnt_start.disabled = false;
  873. btn_autoprnt_end.disabled = true;
  874. model.setValue("/root/hidden/autoend", "Y") ;
  875. model.refresh();
  876. //재출력 가능
  877. checkbox3.disabled = false;
  878. group2.visible = "false";
  879. }
  880. }
  881. function fReStart(){
  882. window.clearinterval(gTimer2);
  883. window.maximize();
  884. gTimer = window.setInterval("fAutoPrnt()",11000);
  885. }
  886. /**
  887. * 자동출력
  888. */
  889. function fAutoPrnt() {
  890. window.clearinterval(gTimer);
  891. if ( model.getValue("/root/hidden/autoend") =="Y" ){
  892. gTimer = null;
  893. return;
  894. }
  895. var orgPrcpflag = model.getValue("/root/hidden/srchinfo/prcpflag");
  896. if ( chk_count >= 50 ){
  897. chk_count = 0;
  898. window.minimize();
  899. gTimer2 = window.setInterval("fReStart()",5000);
  900. return;
  901. }
  902. chk_count++;
  903. if ( ( chk_count % 4 )=="0" ){
  904. caption14.text="자동 출력중[/]";
  905. }
  906. if ( ( chk_count % 4 )=="1" ){
  907. caption14.text="자동 출력중[ ―]";
  908. }
  909. if ( ( chk_count % 4 )=="2" ){
  910. caption14.text="자동 출력중[\]";
  911. }
  912. if ( ( chk_count % 4 )=="3" ){
  913. caption14.text="자동 출력중[|]";
  914. }
  915. caption14.refresh();
  916. if(chk_sum_count >= 8){
  917. if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("M") > -1 ){ //20090721 이선경 수정 : 처방전 자동출력일때만 마감적용
  918. if (model.getValue("/root/hidden/srchinfo/autoendyn") =="Y") {
  919. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("M") >=0 ){
  920. model.setValue("/root/hidden/srchinfo/prcpflag", "M");
  921. fHosInSum("N"); //Admission마감
  922. }
  923. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("W") >=0 ){
  924. model.setValue("/root/hidden/srchinfo/prcpflag", "W");
  925. fHosInSum("N"); //병동응급마감
  926. }
  927. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") >=0 ){
  928. model.setValue("/root/hidden/srchinfo/prcpflag", "L"); // 자동일때는 외출외박으로 처리하여 응급실 퇴원약 제외
  929. fHosInSum("N"); //퇴원약마감
  930. }
  931. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("G") >=0 ){
  932. model.setValue("/root/hidden/srchinfo/prcpflag", "G");
  933. fHosInSum("N"); //외박마감
  934. }
  935. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") >=0 ){
  936. //model.setValue("/root/hidden/srchinfo/prcpflag", "Q"); //마약만 마감
  937. //fHosInSum("N");
  938. }
  939. }
  940. model.setValue("/root/hidden/srchinfo/prcpflag", "");
  941. chk_sum_count = 0;
  942. }
  943. }
  944. chk_sum_count++;
  945. //퇴원 자동출력시 마감을 G로 해서 원래 L 값을 보내줘야함
  946. //model.setValue("/root/hidden/srchinfo/prcpflag", orgPrcpflag); //이훈재 막음. ( 옵션을 선택한 값임)
  947. if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("M") > -1 ){
  948. model.setValue("/root/hidden/srchinfo/prntkind", "M");
  949. fInSumList(); //마감시간별 미출력데이터 조회
  950. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  951. chk_prnt_count++;
  952. grd_sumlist.isSelected(i) = true;
  953. grd_sumlist.row = i;
  954. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  955. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  956. fPrcpMPSPrint("M"); //처방전출력
  957. }
  958. /*
  959. chk_ward.visible = false;
  960. if(model.getValue("/root/hidden/srchinfo/autoprntflag") == "" && model.getValue("/root/hidden/srchinfo/prcpflag") == ""){
  961. messageBox("처방구분을", "C001")
  962. return;
  963. }
  964. model.copyNode("/root/send/sumlistinfo", "/root/hidden/srchinfo");
  965. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  966. submit("TRADT10205");
  967. if(model.getValue("/root/hidden/srchinfo/fst_drugno") != ""){
  968. model.setValue("/root/main/patlist/patlist/sel", "Y");
  969. }
  970. model.refresh();
  971. fPrcpMPSPrint("M"); //출력
  972. */
  973. }
  974. if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("L") > -1 ){
  975. model.setValue("/root/hidden/srchinfo/prntkind", "L");
  976. fInSumList(); //마감시간별 미출력데이터 조회
  977. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  978. chk_prnt_count++;
  979. grd_sumlist.isSelected(i) = true;
  980. grd_sumlist.row = i;
  981. if (model.getValue("/root/hidden/srchinfo/autoyn") =="Y") {
  982. model.makeValue("/root/hidden/srchinfo/autolblyn", "Y");
  983. } else {
  984. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  985. }
  986. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  987. fPrcpMPSPrint("L"); //라벨출력
  988. }
  989. }
  990. //물약라벨
  991. if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("Q") > -1 ){
  992. model.setValue("/root/hidden/srchinfo/prntkind", "Q");
  993. fInSumList(); //마감시간별 미출력데이터 조회
  994. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  995. chk_prnt_count++;
  996. grd_sumlist.isSelected(i) = true;
  997. grd_sumlist.row = i;
  998. if (model.getValue("/root/hidden/srchinfo/autoyn") =="Y") {
  999. model.makeValue("/root/hidden/srchinfo/autolblyn", "Y");
  1000. } else {
  1001. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1002. }
  1003. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1004. fPrcpMPSPrint("Q"); //물약라벨출력
  1005. //var gT1 = window.setInterval("fDelay()",10000);
  1006. //window.clearinterval(gT1);
  1007. }
  1008. }
  1009. //외용라벨
  1010. if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("O") > -1 ){
  1011. model.setValue("/root/hidden/srchinfo/prntkind", "O");
  1012. fInSumList(); //마감시간별 미출력데이터 조회
  1013. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1014. chk_prnt_count++;
  1015. grd_sumlist.isSelected(i) = true;
  1016. grd_sumlist.row = i;
  1017. if (model.getValue("/root/hidden/srchinfo/autoyn") =="Y") {
  1018. model.makeValue("/root/hidden/srchinfo/autolblyn", "Y");
  1019. } else {
  1020. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1021. }
  1022. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1023. fPrcpMPSPrint("O"); //외용라벨출력
  1024. //var gT1 = window.setInterval("fDelay()",10000);
  1025. //window.clearinterval(gT1);
  1026. }
  1027. }
  1028. //PTP라벨
  1029. if ( model.getValue("/root/hidden/srchinfo/autokind").indexOf("P") > -1 ){
  1030. model.setValue("/root/hidden/srchinfo/prntkind", "P");
  1031. fInSumList(); //마감시간별 미출력데이터 조회
  1032. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
  1033. chk_prnt_count++;
  1034. grd_sumlist.isSelected(i) = true;
  1035. grd_sumlist.row = i;
  1036. if (model.getValue("/root/hidden/srchinfo/autoyn") =="Y") {
  1037. model.makeValue("/root/hidden/srchinfo/autolblyn", "Y");
  1038. } else {
  1039. model.makeValue("/root/hidden/srchinfo/autolblyn", "");
  1040. }
  1041. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1042. fPrcpMPSPrint("P"); //PTP라벨출력
  1043. //var gT1 = window.setInterval("fDelay()",10000);
  1044. //window.clearinterval(gT1);
  1045. }
  1046. }
  1047. if (model.getValue("/root/hidden/srchinfo/autoatcyn") =="Y") {
  1048. //ATC전송
  1049. model.setValue("/root/send/atcinfo/drugdd", model.getValue("/root/hidden/srchinfo/prcpdd"));
  1050. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") > -1 ) {
  1051. model.setValue("/root/send/atcinfo/drugflag", "L");
  1052. model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  1053. submit("TXADT10202"); //ATC Data 전송(배치호출)
  1054. }
  1055. if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") > -1 ) {
  1056. model.setValue("/root/send/atcinfo/drugflag", "E");
  1057. model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  1058. submit("TXADT10202"); //ATC Data 전송(배치호출)
  1059. }
  1060. //if ( model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("L") == -1 && model.getValue("/root/hidden/srchinfo/autoprntflag").indexOf("E") == -1 ){
  1061. model.setValue("/root/send/atcinfo/drugflag", "I");
  1062. model.setValue("/root/send/atcinfo/instcd", model.getValue("/root/hidden/srchinfo/instcd"));
  1063. submit("TXADT10202"); //ATC Data 전송(배치호출)
  1064. //}
  1065. }
  1066. gTimer = window.setInterval("fAutoPrnt()",11000);
  1067. }
  1068. function fSleep(numberMillis) {
  1069. var now = new Date();
  1070. var exitTime = now.getTime() + numberMillis;
  1071. while (true) {
  1072. now = new Date();
  1073. if (now.getTime() > exitTime)
  1074. return;
  1075. }
  1076. }
  1077. /**
  1078. * 투약번호 변경시
  1079. */
  1080. function fChgDrugno(flag) {
  1081. var bResult = true;
  1082. if(flag == "first"){
  1083. var chk = model.getValue("/root/hidden/srchinfo/fst_drugno");
  1084. if(chk == ""){
  1085. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  1086. model.refresh();
  1087. bResult = false;
  1088. } else {
  1089. if(isNaN(chk)){
  1090. messageBox("투약번호는 숫자로","C001");
  1091. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  1092. model.refresh();
  1093. bResult = false;
  1094. }
  1095. if(chk.length > 5){
  1096. messageBox("투약번호는 5자리미만으로","C001");
  1097. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  1098. model.refresh();
  1099. bResult = false;
  1100. }
  1101. }
  1102. } else if(flag == "last"){
  1103. var chk_fst = model.getValue("/root/hidden/srchinfo/fst_drugno");
  1104. var chk_last = model.getValue("/root/hidden/srchinfo/fst_drugno");
  1105. if(chk_fst == ""){
  1106. messageBox("첫번째 투약번호부터","C001");
  1107. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  1108. bResult = false;
  1109. } else {
  1110. if(isNaN(chk_fst)){
  1111. messageBox("투약번호는 숫자로","C001");
  1112. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  1113. bResult = false;
  1114. }
  1115. if(chk_fst.length > 5 ){
  1116. messageBox("투약번호는 5자리미만으로","C001");
  1117. model.setValue("/root/hidden/srchinfo/fst_drugno", "");
  1118. bResult = false;
  1119. }
  1120. if(isNaN(chk_last)){
  1121. messageBox("투약번호는 숫자로","C001");
  1122. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  1123. bResult = false;
  1124. }
  1125. if(chk_last.length > 5 ){
  1126. messageBox("투약번호는 5자리미만으로","C001");
  1127. model.setValue("/root/hidden/srchinfo/last_drugno", "");
  1128. bResult = false;
  1129. }
  1130. }
  1131. model.refresh();
  1132. }
  1133. return bResult;
  1134. }
  1135. function fErrMsg () {
  1136. var errorMsgPath = "/root/properties/error";
  1137. if ( model.getValue ( "/root/properties/error/type" ) == "error" ) {
  1138. window.load("../../../com/commonweb/xrw/SPZZZ00100_시스템에러.xrw","modeless","","width:514px;height:198px;align:center;","/root/properties/error","/root/main");
  1139. }
  1140. }