SMADT10201.xjs 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[/**
  3. * 파 일 명 : SMADT10200.js
  4. * 설 명 : 병동 처방전/라벨 출력, 병동 마감 Javascript
  5. * 설 계 자 : 공두경
  6. * 작 성 자 : 공두경
  7. * 수정이력 : 2006.6.28 / 수정작성 / 공두경
  8. */
  9. //조회조건에 맞는 데이터가 있는지를 chk
  10. var chk_drugno = 0;
  11. var chk_wardcd = 0;
  12. var chk_pid = 0;
  13. var chk_prnt_count = 0;
  14. var chk_sum_count = 0;
  15. var chk_count = 0;
  16. var gTimer = 0;
  17. var gTimer2 = 0;
  18. var gT1 = null;
  19. var sleepTime = 1000;
  20. var chk_cnt = 0;
  21. var gCurrPrtObj = null; //현재 출력 IViewer
  22. /****************************************************************************************
  23. * Argument : N/A
  24. * Description : 초기화
  25. ****************************************************************************************/
  26. function fInit() {
  27. if (utlf_isNull(ds_hidden_prcpsrch.getColumn(0,"prcpdd"))) {
  28. // 날짜 초기화
  29. ds_hidden_srchinfo.setColumn(0,"prcpdd",utlf_getCurrentDate());
  30. }
  31. //처방구분 초기화
  32. ds_hidden_srchinfo.setColumn(0,"prcpflag", "A");
  33. var oParam = {};
  34. oParam.id = "TRADT10211";
  35. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  36. oParam.method = "reqGetPrcpFlagList";
  37. oParam.inds = "req=ds_send_suminfo";
  38. oParam.outds = "ds_init_prcpflaglist_prcpflag=flaglist";
  39. oParam.async = false;
  40. //oParam.callback = "cf_TRADT10211";
  41. tranf_submit(oParam);
  42. var menuparam = frmf_getMenuParam();
  43. var menuitemcd = sysf_getGlobalVariable("menuitemcd");
  44. var screenid = frmf_getScreenID();
  45. var dutplceinstcd = sysf_getUserInfo("dutplceinstcd");
  46. if(utlf_isNull(dutplceinstcd)){
  47. dutplceinstcd = "031";
  48. }
  49. //trace("menuitemcd :"+menuitemcd);
  50. //인티맘
  51. /*
  52. if ( dutplceinstcd == '031') { //인티팜처방전
  53. if (menuparam != "P" ) { //인티팜처방전
  54. var aRow = ds_init_prcpflaglist_prcpflag.addRow();
  55. ds_init_prcpflaglist_prcpflag.setColumn(aRow,"flagid","IN");
  56. ds_init_prcpflaglist_prcpflag.setColumn(aRow,"flagnm","비인티팜");
  57. var aRow = ds_init_prcpflaglist_prcpflag.addRow();
  58. ds_init_prcpflaglist_prcpflag.setColumn(aRow,"flagid","9");
  59. ds_init_prcpflaglist_prcpflag.setColumn(aRow,"flagnm","코로나생활지원");
  60. var aRow = ds_init_prcpflaglist_prcpflag.addRow();
  61. ds_init_prcpflaglist_prcpflag.setColumn(aRow,"flagid","8");
  62. ds_init_prcpflaglist_prcpflag.setColumn(aRow,"flagnm","경북대생활관");
  63. }
  64. } else {
  65. var aRow = ds_init_prcpflaglist_prcpflag.addRow();
  66. ds_init_prcpflaglist_prcpflag.setColumn(aRow,"flagid","7");
  67. ds_init_prcpflaglist_prcpflag.setColumn(aRow,"flagnm","7생활치료센터");
  68. }
  69. */
  70. //약주사구분 초기화
  71. ds_hidden_srchinfo.setColumn(0,"drugkind", "T");
  72. //라벨 체크 초기화
  73. ds_hidden_srchinfo.setColumn(0,"lblyn", "L");
  74. fChkLBL_YN();
  75. //처방전 체크 초기화
  76. ds_hidden_srchinfo.setColumn(0,"mpsflag", "P");
  77. //기타조회구분 초기화
  78. ds_hidden_srchinfo.setColumn(0,"etcflag", "T");
  79. cbx_etcdescflag.enable = false;
  80. //마감시 instcd 적용을 위해 instcd 초기화
  81. var dutplceinstcd = sysf_getUserInfo("dutplceinstcd");
  82. if(utlf_isNull(dutplceinstcd)){
  83. dutplceinstcd = "031";
  84. }
  85. ds_hidden_srchinfo.setColumn(0,"instcd", dutplceinstcd);
  86. //병동 Combo 조회
  87. ds_send_deptinfo.setColumn(0,"deptflag", "W");
  88. var oParam = {};
  89. oParam.id = "TRADT10203";
  90. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  91. oParam.method = "reqGetDeptList";
  92. oParam.inds = "req=ds_send_deptinfo";
  93. oParam.outds = "ds_hidden_deptlist_ward=ward";
  94. oParam.async = false;
  95. oParam.callback = "cf_TRADT10203";
  96. tranf_submit(oParam);
  97. dsf_addDsItem(ds_hidden_deptlist_ward,"wardcd","wardnm","전체","T");
  98. //자동출력구분 초기화
  99. btn_autoprnt_start.enable = true;
  100. btn_autoprnt_end.enable = false;
  101. //20100412 황세원 수정 병실컬럼
  102. var oParam = {};
  103. oParam.id = "TRADT10213";
  104. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  105. oParam.method = "reqGetRoomFlag";
  106. oParam.inds = "";
  107. oParam.outds = "ds_init_roomyn=roomyn";
  108. oParam.async = false;
  109. //oParam.callback = "cf_TRADT10213";
  110. tranf_submit(oParam);
  111. if(ds_init_roomyn.getColumn(0,"roomyn")=="Y") {
  112. dsf_makeValue(ds_hidden_srchinfo,"atc3","string","Y");
  113. grd_patlist.setFormatColProperty(5,"size",70);
  114. } else {
  115. dsf_makeValue(ds_hidden_srchinfo,"atc3","string","N");
  116. grd_patlist.setFormatColProperty(5,"size",0);
  117. }
  118. //마감시간구분
  119. var oParam = {};
  120. oParam.id = "TRADT10212";
  121. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  122. oParam.method = "reqGetSumtmFlagList2";
  123. oParam.inds = "req=ds_send_sumlistinfo";
  124. oParam.outds = "ds_init_sumtmflaglist_flaglist1=flaglist1 ds_init_sumtmflaglist_flaglist2=flaglist2 ds_init_sumtmflaglist_flaglist3=flaglist3";
  125. oParam.async = false;
  126. //oParam.callback = "cf_TRADT10212";
  127. tranf_submit(oParam);
  128. cmb_sumtmflag1.index = 0;
  129. cmb_sumtmflag2.index = 0;
  130. cmb_sumtmflag3.index = 0;
  131. //처방전 감사화면에서 팝업으로 열때 데이터 조회
  132. if(!utlf_isNull(ds_hidden_popupinfo.getColumn(0,"drugno"))) {
  133. ds_hidden_srchinfo.setColumn(0,"prcpdd" , ds_hidden_popupinfo.getColumn(0,"prcpdd"));
  134. ds_hidden_srchinfo.setColumn(0,"fst_drugno" , ds_hidden_popupinfo.getColumn(0,"drugno"));
  135. ds_hidden_srchinfo.setColumn(0,"pid" , ds_hidden_popupinfo.getColumn(0,"pid"));
  136. fInSumList();
  137. }
  138. //바코드프린터설정 초기화
  139. ds_send.setColumn(0,"scrnid", frmf_getScreenID());
  140. var oParam = {};
  141. oParam.id = "TRLLC90101";
  142. oParam.service = "diagtestapplib.LisCommon";
  143. oParam.method = "reqGetSetUpInfo";
  144. oParam.inds = "scrnid=ds_send";
  145. oParam.outds = "ds_main_barcdprntsetup=getSetUpInfo";
  146. oParam.async = false;
  147. // oParam.callback = "cf_TRLLC90101";
  148. tranf_submit(oParam);
  149. var prntsetupinfo = ds_main_barcdprntsetup.getColumn(0,"prntsetupinfo"); //프린터설정 XML형식
  150. lf_convertXmlToDs(prntsetupinfo); //XML데이터로 프리터설정 관련 DS생성
  151. var comm = ds_data_comm02.getColumn(0,"comm");
  152. var prntkind = ds_data_setupinfo.getColumn(0,"prntkind");
  153. if(comm == "2") {
  154. ds_data_comm02.setColumn(0,"comm", "1");
  155. }
  156. if(prntkind == "1") {
  157. ds_data_setupinfo.setColumn(0,"prntkind", "5");
  158. }
  159. //추가마감시 admission과 병동응급을 함께 마감할지 여부 조회 , ATC순으로 정렬 체크 여부
  160. //20100405 이선경 추가 : 정제 작은라벨(리스트형식) 출력시 ptp 함께 출력할지 여부
  161. var oParam = {};
  162. oParam.id = "TRADT10207";
  163. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  164. oParam.method = "reqGetSumPrcpFlagYn";
  165. oParam.inds = "req=ds_send_suminfo";
  166. oParam.outds = "ds_init_sumprcpflagyn_flagyn=item";
  167. oParam.async = false;
  168. //oParam.callback = "cf_TRADT10207";
  169. tranf_submit(oParam);
  170. if(ds_init_sumprcpflagyn_flagyn.getColumn(0,"orderbyatc") == "Y") {
  171. ds_hidden_srchinfo.setColumn(0,"orderbyatc", "Y");
  172. }
  173. // 출고부서 조회, 설정 2009.09.07 pymi
  174. var oParam = {};
  175. oParam.id = "TRADT01106";
  176. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  177. oParam.method = "reqGetMisDeptlist";
  178. oParam.inds = "";
  179. oParam.outds = "ds_init_misdeptlist_deptlist=deptlist";
  180. oParam.async = false;
  181. //oParam.callback = "cf_TRADT01106";
  182. tranf_submit(oParam);
  183. if(dutplceinstcd == "032" || dutplceinstcd == "031") {
  184. combo1.index = 0;
  185. } else {
  186. combo1.index = 0;
  187. }
  188. chk_cnt++;
  189. ds_temp.setColumn(0,"stocdeptcd", ds_hidden_srchinfo.getColumn(0,"stocdeptcd"));
  190. // 2010.03.22 pymi
  191. var oParam = {};
  192. oParam.id = "TRADT01107";
  193. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  194. oParam.method = "reqGetLblFlag5";
  195. oParam.inds = "";
  196. oParam.outds = "ds_init_lbllists=lbllists";
  197. oParam.async = false;
  198. //oParam.callback = "cf_TRADT01107";
  199. tranf_submit(oParam);
  200. ds_hidden_srchinfo.setColumn(0,"lbl5", ds_init_lbllists.getColumn(0,"lbl5"));
  201. }
  202. function cf_TRADT10203(sSvcId, nErrorCode, sErrorMsg) {
  203. if(nErrorCode < 0) return;
  204. ds_hidden_deptlist_ward.updateColID("deptcd","wardcd");
  205. ds_hidden_deptlist_ward.updateColID("deptnm","wardnm");
  206. }
  207. /****************************************************************************************
  208. * Argument : N/A
  209. * Description : 라벨 변경시 처리
  210. ****************************************************************************************/
  211. function fChkLBL_YN() {
  212. var chk = ds_hidden_srchinfo.getColumn(0,"lblyn");
  213. var sLbl_Drug = "D|DT|DX|DE|DH";
  214. var sLbl_Inj = "I|IO|IX|IE|IH|IS"; // 20120628_일반수액도 추가(퇴원의 경우)
  215. if(!utlf_isNull(chk)){
  216. ds_hidden_srchinfo.setColumn(0,"lbl_drug" , sLbl_Drug);
  217. ds_hidden_srchinfo.setColumn(0,"lbl_inj" , sLbl_Inj);
  218. ds_hidden_srchinfo.setColumn(0,"drugall" , "Y");
  219. ds_hidden_srchinfo.setColumn(0,"injall" , "Y");
  220. } else {
  221. ds_hidden_srchinfo.setColumn(0,"lbl_drug" , "");
  222. ds_hidden_srchinfo.setColumn(0,"lbl_inj" , "");
  223. ds_hidden_srchinfo.setColumn(0,"drugall" , "");
  224. ds_hidden_srchinfo.setColumn(0,"injall" , "");
  225. }
  226. //라벨 출력 형식 옵션
  227. var oParam = {};
  228. oParam.id = "TRADT10208";
  229. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  230. oParam.method = "reqGetLblType";
  231. oParam.inds = "req=ds_send_suminfo";
  232. oParam.outds = "ds_init_lbltype_item=item ds_init_lbltype_item2=item2";
  233. oParam.async = false;
  234. //oParam.callback = "cf_TRADT10208";
  235. tranf_submit(oParam);
  236. if(ds_init_lbltype_item2.getColumn(0,"lbltype") == "Y") {
  237. checkbox10.visible = true;
  238. checkbox3.visible = true;
  239. } else {
  240. checkbox10.visible = false;
  241. checkbox3.visible = false;
  242. }
  243. }
  244. /****************************************************************************************
  245. * Argument : N/A
  246. * Description : 마감리스트 조회
  247. ****************************************************************************************/
  248. function fInSumList() {
  249. ds_main_sumlist.clearData();
  250. chk_ward.visible = false;
  251. if(utlf_isNull(ds_hidden_srchinfo.getColumn(0,"prcpflag"))) {
  252. sysf_messageBox("처방구분을", "C001")
  253. return;
  254. }
  255. if(ds_hidden_srchinfo.getColumn(0,"prcpflag").indexOf("Z") >= 0 && ds_hidden_srchinfo.getColumn(0,"prcpflag").length > 1){
  256. sysf_messageBox("처방구분 '정규약(508응급병동)'을 중복 선택할 수 없습니다.", "C");
  257. ds_hidden_srchinfo.setColumn(0,"prcpflag", "");
  258. rdo_prcp.setCheckAll(false,false);
  259. rdo_prcp2.setCheckAll(false,false);
  260. return;
  261. }
  262. prcpflag = ds_hidden_srchinfo.getColumn(0,"prcpflag");
  263. ds_send_suminfo.setColumn(0,"prcpflag", prcpflag);
  264. ds_send_sumlistinfo.copyData(ds_hidden_srchinfo);
  265. dsf_makeValue(ds_send_sumlistinfo,"version","string","new");
  266. //20100301 이선경 수정 : 자동라벨출력시 라벨그룹별로 마감대상 조회되도록
  267. if(ds_hidden_srchinfo.getColumn(0,"autolblyn") == "Y") {
  268. var lblstr = ds_hidden_srchinfo.getColumn(0,"autolblflag");
  269. var lblstr2 = lblstr.setReplaceWord("AD", "D|DX|DH|DP");
  270. lblstr2 = lblstr2.setReplaceWord("AI", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
  271. dsf_makeValue(ds_send_sumlistinfo,"autolblflag","string",lblstr2);
  272. }
  273. var oParam = {};
  274. oParam.id = "TRADT10201";
  275. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  276. oParam.method = "reqGetInSumList";
  277. oParam.inds = "req=ds_send_sumlistinfo";
  278. oParam.outds = "ds_main_sumlist=sumlist";
  279. oParam.async = false;
  280. oParam.callback = "cf_TRADT10201";
  281. tranf_submit(oParam);
  282. // grd_sumlist.isSelected(grd_sumlist.fixedRows) = true;
  283. // grd_sumlist.row = grd_sumlist.fixedRows;
  284. if(ds_main_sumlist.rowcount > 0){ //20100210 이선경 주석 : 마감일자를 체크해서 조회하도록 함
  285. ds_main_sumlist.setColumn(0,"sel", "Y");
  286. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  287. } else {
  288. ds_main_patlist.clearData();
  289. }
  290. }
  291. function cf_TRADT10201(sSvcId, nErrorCode, sErrorMsg) {
  292. if(nErrorCode < 0) return;
  293. ds_main_sumlist.addColumn("sel","string");
  294. }
  295. /****************************************************************************************
  296. * Argument : N/A
  297. * Description : 병동 마감
  298. ****************************************************************************************/
  299. function fHosInSum(chk, auto) {
  300. var prcpflag = "";
  301. var prcpdd = ds_hidden_srchinfo.getColumn(0,"prcpdd");
  302. var instcd = ds_hidden_srchinfo.getColumn(0,"instcd");
  303. var pid = ds_hidden_srchinfo.getColumn(0,"pid");
  304. var drugkind = ds_hidden_srchinfo.getColumn(0,"drugkind");
  305. var onlyantis = ds_hidden_srchinfo.getColumn(0,"onlyantis");
  306. var prcpflagnm = String(rdo_prcp.getLableData()).replace(","," ");
  307. var chkret = 0;
  308. var fromddflag = "";
  309. var fromdd = "";
  310. var fromtm = "";
  311. var toddflag = "";
  312. var todd = "";
  313. var totm = "";
  314. var sumdt = utlf_getCurrentDateTime().replace(" ", "");
  315. prcpflag = ds_hidden_srchinfo.getColumn(0,"prcpflag");
  316. if(chk == "Y") {
  317. if(prcpflag == "R") {//정규마감구분
  318. fromddflag = ds_hidden_srchinfo.getColumn(0,"fromddflag1");
  319. fromtm = ds_hidden_srchinfo.getColumn(0,"fromtm1");
  320. toddflag = ds_hidden_srchinfo.getColumn(0,"toddflag1");
  321. totm = ds_hidden_srchinfo.getColumn(0,"totm1");
  322. } else if(prcpflag == "Z") {//정규약(508응급병동)
  323. fromddflag = ds_hidden_srchinfo.getColumn(0,"fromddflag1");
  324. fromtm = ds_hidden_srchinfo.getColumn(0,"fromtm1");
  325. toddflag = ds_hidden_srchinfo.getColumn(0,"toddflag1");
  326. totm = ds_hidden_srchinfo.getColumn(0,"totm1");
  327. } else if(prcpflag == "A") {//추가마감구분
  328. fromddflag = ds_hidden_srchinfo.getColumn(0,"fromddflag2");
  329. fromtm = ds_hidden_srchinfo.getColumn(0,"fromtm2");
  330. toddflag = ds_hidden_srchinfo.getColumn(0,"toddflag2");
  331. totm = ds_hidden_srchinfo.getColumn(0,"totm2");
  332. } else if(prcpflag == "K") {// 응급실마감구분
  333. fromddflag = ds_hidden_srchinfo.getColumn(0,"fromddflag3");
  334. fromtm = ds_hidden_srchinfo.getColumn(0,"fromtm3");
  335. toddflag = ds_hidden_srchinfo.getColumn(0,"toddflag3");
  336. totm = ds_hidden_srchinfo.getColumn(0,"totm3");
  337. }
  338. if ( prcpflag =="R" || prcpflag =="Z" || prcpflag =="A" || prcpflag == "K"){
  339. if( utlf_isNull(fromddflag) || utlf_isNull(fromtm) || utlf_isNull(toddflag) || utlf_isNull(totm) || fromtm.length != 4 || totm.length != 4) {
  340. sysf_messageBox("마감구분이 잘못", "E005");
  341. return;
  342. } else {
  343. if(fromddflag == "0") {
  344. fromdd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD") ;
  345. } else {
  346. fromdd = prcpdd ;
  347. }
  348. if(toddflag == "0") {
  349. todd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD") ;
  350. } else {
  351. todd = prcpdd ;
  352. }
  353. fromtm = fromtm + "00";
  354. totm = totm + "59";
  355. }
  356. } else {
  357. fromdd = "" ;
  358. todd = "" ;
  359. fromtm = "";
  360. totm = "";
  361. }
  362. chkret = 6 ; //sysf_messageBox(prcpflagnm + "마감을", "Q004");
  363. } else {
  364. if (prcpflag == "Z" && chk == "N" && auto == "auto") {
  365. fromdd = ((prcpdd.toDate("YYYYMMDD")).getAddDate(-1,"D")).getDateFormat("YYYYMMDD");
  366. fromtm = "030000";
  367. todd = prcpdd;
  368. totm = "235959";
  369. //멀티데이 처방 출력시 업무 알아봐야 함
  370. }
  371. chkret = 6;
  372. }
  373. if(chkret == 6){
  374. if(ds_hidden_srchinfo.getColumn(0,"prcpflag") != "C2") {
  375. if(chk == "Y") {
  376. ds_send_suminfo.setColumn(0,"fromdd", fromdd);
  377. ds_send_suminfo.setColumn(0,"fromtm", fromtm);
  378. ds_send_suminfo.setColumn(0,"todd", todd);
  379. ds_send_suminfo.setColumn(0,"totm", totm);
  380. } else {
  381. if (prcpflag == "Z") {
  382. ds_send_suminfo.setColumn(0,"fromdd", fromdd);
  383. ds_send_suminfo.setColumn(0,"fromtm", fromtm);
  384. ds_send_suminfo.setColumn(0,"todd", todd);
  385. ds_send_suminfo.setColumn(0,"totm", totm);
  386. } else {
  387. ds_send_suminfo.setColumn(0,"fromdd", "");
  388. ds_send_suminfo.setColumn(0,"fromtm", "");
  389. ds_send_suminfo.setColumn(0,"todd", "");
  390. ds_send_suminfo.setColumn(0,"totm", "");
  391. }
  392. }
  393. ds_send_suminfo.setColumn(0,"sumdt", sumdt);
  394. ds_send_suminfo.setColumn(0,"prcpdd", prcpdd);
  395. ds_send_suminfo.setColumn(0,"prcpflag", prcpflag);
  396. ds_send_suminfo.setColumn(0,"instcd", instcd);
  397. ds_send_suminfo.setColumn(0,"pid", pid);
  398. ds_send_suminfo.setColumn(0,"sumdrugkind", drugkind);
  399. ds_send_suminfo.setColumn(0,"onlyantis", onlyantis);
  400. ds_send_suminfo.setColumn(0,"mstocdeptcd", ds_hidden_srchinfo.getColumn(0,"stocdeptcd")); // 2009.09.11 pymi
  401. ds_send_suminfo.setColumn(0,"ioflag", "I");
  402. dsf_makeValue(ds_send_suminfo,"multiyn","string",ds_hidden_srchinfo.getColumn(0,"multiyn")); //multi day 처방 포함 여부
  403. dsf_makeValue(ds_send_suminfo,"dinjyn","string",ds_hidden_srchinfo.getColumn(0,"dinjyn")); // 20121120_항암주사실 제외 여부
  404. var dinjonlyyn = ds_hidden_srchinfo.getColumn(0,"dinjonlyyn"); // 20121120_항암주사실만 여부
  405. if(prcpflag == "A" || prcpflag == "R") { //20110102 이선경 수정 : 경북대병원 병동별로 마감호출( 약번호 순서 : 병동, 파우더, 등록번호)
  406. if(dinjonlyyn == "Y") {
  407. dsf_makeValue(ds_send_suminfo,"wardcd","string", "3120900000"); // 20121121_항암주사실만 체크 시 항암주사실만 마감 되도록 수정
  408. call_TXADT10201();
  409. } else {
  410. for(var i = 1 ; i < ds_hidden_deptlist_ward.rowcount ; i++) { //전체 제외
  411. dsf_makeValue(ds_send_suminfo,"wardcd","string",ds_hidden_deptlist_ward.getColumn(i,"wardcd"));
  412. call_TXADT10201();
  413. }
  414. }
  415. } else if(prcpflag == "K") { // 20120519_laboru
  416. call_TXADT10201();
  417. } else {
  418. call_TXADT10201();
  419. }
  420. if (ds_hidden_srchinfo.getColumn(0,"prcpflag")=="L" || ds_hidden_srchinfo.getColumn(0,"prcpflag")=="G" ) {
  421. ds_send_suminfo.setColumn(0,"prcpdd", prcpdd);
  422. ds_send_suminfo.setColumn(0,"prcpflag", prcpflag);
  423. ds_send_suminfo.setColumn(0,"instcd", instcd);
  424. ds_send_suminfo.setColumn(0,"pid", pid);
  425. ds_send_suminfo.setColumn(0,"ioflag", "O");
  426. for(var i = 0 ; i < 5; i++) {
  427. call_TXADT10201();
  428. }
  429. }
  430. if(prcpflag =="J") {
  431. call_TXADT10201();
  432. }
  433. }
  434. //20100818 이선경 : 임상연구 일반약 80000번대로 마감
  435. dsf_makeValue(ds_send_srchinfo,"srchprcpdd","string", ds_hidden_srchinfo.getColumn(0,"prcpdd"));
  436. dsf_makeValue(ds_send_srchinfo,"crsumflag","string", "N");
  437. dsf_makeValue(ds_send_srchinfo,"orgdrugflag","string", ds_hidden_srchinfo.getColumn(0,"prcpflag"));
  438. dsf_makeValue(ds_send_srchinfo,"sumdt","string", sumdt);
  439. var drugkind = ds_hidden_srchinfo.getColumn(0,"drugkind");
  440. if(ds_hidden_srchinfo.getColumn(0,"prcpflag") != "C2") {
  441. if(ds_hidden_srchinfo.getColumn(0,"prcpflag") != "L" && ds_hidden_srchinfo.getColumn(0,"prcpflag") !="G") {
  442. if(drugkind == "T") {
  443. //주사 마감
  444. dsf_makeValue(ds_send_srchinfo,"crdrugkind","string", "M");
  445. call_TXADC10902();
  446. //약 마감
  447. dsf_makeValue(ds_send_srchinfo,"crdrugkind","string", "D");
  448. call_TXADC10902();
  449. } else if(drugkind == "D") {
  450. //약 마감
  451. dsf_makeValue(ds_send_srchinfo,"crdrugkind","string", "D");
  452. call_TXADC10902();
  453. } else if(drugkind == "M") {
  454. //주사 마감
  455. dsf_makeValue(ds_send_srchinfo,"crdrugkind","string", "M");
  456. call_TXADC10902();
  457. }
  458. } else {
  459. dsf_makeValue(ds_send_srchinfo,"crdrugkind","string", "");
  460. call_TXADC10902();
  461. }
  462. }
  463. //20100831 이선경 추가 : 임상연구 일반약 외래주사 마감 기능 추가
  464. if((auto != "auto" && utlf_isSearchString(ds_hidden_srchinfo.getColumn(0,"prcpflag"), "C2"))|| (auto == "auto" && utlf_isSearchString(ds_hidden_srchinfo.getColumn(0,"autoprntflag"), "C2")) ) {
  465. dsf_makeValue(ds_send_srchinfo,"srchprcpdd","string", ds_hidden_srchinfo.getColumn(0,"prcpdd"));
  466. dsf_makeValue(ds_send_srchinfo,"crsumflag","string", "I");
  467. dsf_makeValue(ds_send_srchinfo,"hosinhosout","string", "I"); //원내
  468. //외래임상약 마감하는 것과 동일 소스임 (수정시 주의)
  469. dsf_makeValue(ds_send_srchinfo,"prcpdd","string", ds_send_srchinfo.getColumn(0,"srchprcpdd"));
  470. var oParam = {};
  471. oParam.id = "TXADC10901";
  472. oParam.service = "pharmacyprescriptionapp.DrugAccept";
  473. oParam.method = "reqExeOutCrSum";
  474. oParam.inds = "req=ds_send_srchinfo";
  475. oParam.outds = "ds_temp_ret=result";
  476. oParam.async = false;
  477. //oParam.callback = "cf_TXADC10901";
  478. tranf_submit(oParam);
  479. }
  480. }
  481. }
  482. function call_TXADT10201() {
  483. dsf_setDefaultVal(ds_send_suminfo, "ioflag:I");
  484. var oParam = {};
  485. oParam.id = "TXADT10201";
  486. oParam.service = "pharmacyprescriptionapp.DrugAccept";
  487. oParam.method = "reqExeInSum";
  488. oParam.inds = "req=ds_send_suminfo";
  489. oParam.outds = "ds_main_sumrslt=result";
  490. oParam.async = false;
  491. //oParam.callback = "cf_TXADT10201";
  492. tranf_submit(oParam);
  493. }
  494. function call_TXADC10902() {
  495. dsf_createDsRow("ds_req", [
  496. {col:"prcpdd", type:"STRING", size:256, val:ds_send_srchinfo.getColumn(0,"srchprcpdd")}
  497. ]);
  498. var oParam = {};
  499. oParam.id = "TXADC10902";
  500. oParam.service = "pharmacyprescriptionapp.DrugAccept";
  501. oParam.method = "reqExeInCrSum";
  502. oParam.inds = "req=ds_req";
  503. oParam.outds = "ds_temp_ret=result";
  504. oParam.async = false;
  505. //oParam.callback = "cf_TXADC10902";
  506. tranf_submit(oParam);
  507. }
  508. /****************************************************************************************
  509. * Argument : N/A
  510. * Description : 마감리스트 더블클릭시 출력할 환자리스트 조회
  511. ****************************************************************************************/
  512. function fPrntPatList() {
  513. ds_main_patlist.clearData();
  514. ds_send_patlistinfo.clear();
  515. //20100210 이선경 수정 : 마감일자 멀티체크 조회 가능하도록 함
  516. var strsumdt = "";
  517. for(var i = 0 ; i < ds_main_sumlist.rowcount ; i++) {
  518. if(ds_main_sumlist.getColumn(i,"sel") == "Y") {
  519. if(ds_send_patlistinfo.rowcount < 1) {
  520. dsf_copyColInfo(ds_send_patlistinfo,ds_main_sumlist);
  521. ds_send_patlistinfo.addRow();
  522. }
  523. ds_send_patlistinfo.copyRow(0,ds_main_sumlist,i);
  524. dsf_makeValue(ds_send_patlistinfo,"prcpdd" , "string", ds_hidden_srchinfo.getColumn(0,"prcpdd"));
  525. dsf_makeValue(ds_send_patlistinfo,"fst_drugno" , "string", ds_hidden_srchinfo.getColumn(0,"fst_drugno"));
  526. dsf_makeValue(ds_send_patlistinfo,"last_drugno" , "string", ds_hidden_srchinfo.getColumn(0,"last_drugno"));
  527. dsf_makeValue(ds_send_patlistinfo,"wardcd" , "string", ds_hidden_srchinfo.getColumn(0,"wardcd"));
  528. dsf_makeValue(ds_send_patlistinfo,"pid" , "string", ds_hidden_srchinfo.getColumn(0,"pid"));
  529. dsf_makeValue(ds_send_patlistinfo,"autoprntflag", "string", ds_hidden_srchinfo.getColumn(0,"autoprntflag"));
  530. dsf_makeValue(ds_send_patlistinfo,"etcdescflag" , "string", ds_hidden_srchinfo.getColumn(0,"etcdescflag"));
  531. dsf_makeValue(ds_send_patlistinfo,"prntkind" , "string", ds_hidden_srchinfo.getColumn(0,"prntkind"));
  532. dsf_makeValue(ds_send_patlistinfo,"autolblyn" , "string", ds_hidden_srchinfo.getColumn(0,"autolblyn"));
  533. dsf_makeValue(ds_send_patlistinfo,"prcpflag" , "string", ds_hidden_srchinfo.getColumn(0,"prcpflag"));
  534. dsf_makeValue(ds_send_patlistinfo,"orderbyatc" , "string", ds_hidden_srchinfo.getColumn(0,"orderbyatc"));
  535. dsf_makeValue(ds_send_patlistinfo,"instcd" , "string", ds_hidden_srchinfo.getColumn(0,"instcd"));
  536. dsf_makeValue(ds_send_patlistinfo,"atc3" , "string", ds_hidden_srchinfo.getColumn(0,"atc3"));
  537. dsf_makeValue(ds_send_patlistinfo,"autoyn" , "string", ds_hidden_srchinfo.getColumn(0,"autoyn"));
  538. dsf_makeValue(ds_send_patlistinfo,"version" , "string", "new");
  539. strsumdt = strsumdt + " " + ds_main_sumlist.getColumn(i,"sumdt");
  540. }
  541. }
  542. dsf_makeValue(ds_send_patlistinfo,"sumdt" ,"string", strsumdt);
  543. // 20121121_항암주사실 여부
  544. dsf_makeValue(ds_send_patlistinfo,"dinjyn" ,"string", ds_hidden_srchinfo.getColumn(0,"dinjyn"));
  545. dsf_makeValue(ds_send_patlistinfo,"dinjonlyyn" ,"string", ds_hidden_srchinfo.getColumn(0,"dinjonlyyn"));
  546. if(!utlf_isNull(strsumdt)) {
  547. var oParam = {};
  548. oParam.id = "TRADT10202";
  549. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  550. oParam.method = "reqGetInPatList";
  551. oParam.inds = "req=ds_send_patlistinfo";
  552. oParam.outds = "ds_main_patlist=patlist";
  553. oParam.async = false;
  554. oParam.callback = "cf_TRADT10202";
  555. tranf_submit(oParam);
  556. }
  557. if(!utlf_isNull(ds_hidden_srchinfo.getColumn(0,"fst_drugno")) && ds_main_patlist.rowcount > 0) {
  558. ds_main_patlist.setColumn(0,"sel", "Y");
  559. }
  560. }
  561. function cf_TRADT10202(sSvcId, nErrorCode, sErrorMsg) {
  562. if(nErrorCode < 0) return;
  563. ds_main_patlist.addColumn("sel","string");
  564. }
  565. /****************************************************************************************
  566. * Argument : autoflag : M(수동출력), A(자동출력)
  567. * : prntflag : mps(처방전자동출력), lbl(라벨자동출력)
  568. * Description : 처방전/라벨 출력
  569. ****************************************************************************************/
  570. function fPrcpMPSPrint( autoflag, prntflag ) {
  571. //투약번호로 출력
  572. var oRptViewer = "";
  573. var sDrugNo = ds_hidden_srchinfo.getColumn(0,"fst_drugno");
  574. sleepTime = ds_hidden.getColumn(0,"sleeptime") * 1000;
  575. chk_prnt_count = 0;
  576. //수동출력
  577. var chk_mpsflag = ds_hidden_srchinfo.getColumn(0,"mpsflag");
  578. var chk_lblyn = ds_hidden_srchinfo.getColumn(0,"lblyn");
  579. var chk_patlbl = ds_hidden_srchinfo.getColumn(0,"namecard");
  580. //자동출력
  581. var chk_autokindflag = ds_hidden_srchinfo.getColumn(0,"autokind");
  582. var chk_autolblyn = ds_hidden_srchinfo.getColumn(0,"autolblsize");
  583. //처방전 출력 데이터 조회
  584. if(autoflag =="M") {//수동출력
  585. var cnt = 0;
  586. for(var i = 0; i < ds_main_patlist.rowcount; i++) {
  587. if(ds_main_patlist.getColumn(i,"sel") == "Y"){
  588. cnt++ ;
  589. }
  590. }
  591. if( cnt == 0){
  592. sysf_messageBox("처방전을 출력할 환자리스트가 없거나 선택된 환자가", "I004");
  593. }
  594. }
  595. for(var i = 0; i < ds_main_patlist.rowcount; i++){
  596. if(ds_main_patlist.getColumn(i,"sel") == "Y"){
  597. ds_send_prcpinfo.clear();
  598. dsf_copyColInfo(ds_send_prcpinfo,ds_main_patlist);
  599. var nRow = ds_send_prcpinfo.addRow();
  600. ds_send_prcpinfo.copyRow(nRow,ds_main_patlist,i);
  601. if(autoflag == "M"){
  602. //20100315 이선경 수정 : prcpflag의 멀티체크가 가능하기때문에 patlist 조회된 환자 각각의 drugflag 값을 보내도록
  603. dsf_makeValue(ds_send_prcpinfo,"prcpflag","string", ds_send_prcpinfo.getColumn(0,"drugflag"));
  604. dsf_makeValue(ds_send_prcpinfo,"reprintyn","string", ds_hidden_srchinfo.getColumn(0,"reprintyn"));
  605. } else if(autoflag == "A") {
  606. //20100414 이선경 수정 : patlist 조회된 환자 각각의 drugflag 값을 보내도록
  607. dsf_makeValue(ds_send_prcpinfo,"prcpflag","string", ds_send_prcpinfo.getColumn(0,"drugflag"));
  608. }
  609. dsf_makeValue(ds_send_prcpinfo,"prntflag","string", ds_hidden_srchinfo.getColumn(0,"prntflag"));
  610. dsf_makeValue(ds_send_prcpinfo,"ioflag","string", "I");
  611. var drugno = ds_send_prcpinfo.getColumn(0,"drugno");
  612. var wardcd = ds_send_prcpinfo.getColumn(0,"wardcd");
  613. var pid = ds_send_prcpinfo.getColumn(0,"pid");
  614. //trace("병동처방전 출력 순서 // rowno : "+i+" / drugno : "+drugno+" / wardcd : "+wardcd+" / pid : "+pid);
  615. if(autoflag =="M" ) {//수동출력
  616. if (!utlf_isNull(chk_mpsflag)){
  617. //처방전 출력
  618. fHosInMPSPrint();
  619. }
  620. if(!utlf_isNull(chk_lblyn)) {
  621. //라벨수동출력
  622. //trace("병동 라벨 수동 출력 순서 // rowno : "+i+" / drugno : "+drugno+" / wardcd : "+wardcd+" / pid : "+pid);
  623. fPrcpLBLPrint("M");
  624. }
  625. if (!utlf_isNull(chk_patlbl)) {
  626. //네임카드 출력
  627. oRptViewer += "report_"+i+"|";
  628. fPatLblPrint("report_"+i);
  629. }
  630. } else if(autoflag == "A"){ //자동출력
  631. if (prntflag == "mps" ){
  632. //처방전 출력
  633. fHosInMPSPrint();
  634. }
  635. if(prntflag == "lbl") {
  636. //라벨자동출력
  637. trace("병동 라벨 자동 출력 순서 // rowno : "+i+" / drugno : "+drugno+" / wardcd : "+wardcd+" / pid : "+pid);
  638. fPrcpLBLPrint("A");
  639. }
  640. }
  641. // if (ds_hidden_srchinfo.getColumn(0,"autoyn") != "Y") {
  642. // //출력상태 표시
  643. // for ( var j = 0 ; j < grd_patlist.cols -1; j++){
  644. // grd_patlist.cellStyle("background-color", i, j) = "#cfffcf";
  645. // //grd_patlist.cellStyle("font-weight", i, j) = "bold";
  646. // }
  647. // grd_patlist.refresh();
  648. // }
  649. dsf_makeValue(ds_main_patlist,"prntynnow","string","Y",i); //출력이 이뤄진 항목 표시
  650. }
  651. ds_send_atcinfo.setColumn(0,"drugdd", ds_hidden_srchinfo.getColumn(0,"prcpdd"));
  652. if ( ds_hidden_srchinfo.getColumn(0,"prcpflag") == "L" ) {
  653. ds_send_atcinfo.setColumn(0,"drugflag", "L");
  654. } else if ( ds_hidden_srchinfo.getColumn(0,"prcpflag") == "E" ) {
  655. ds_send_atcinfo.setColumn(0,"drugflag", "E");
  656. } else {
  657. ds_send_atcinfo.setColumn(0,"drugflag", "I");
  658. }
  659. if ( ds_hidden_srchinfo.getColumn(0,"autoatcyn") == "Y" ) {
  660. ds_send_atcinfo.setColumn(0,"instcd", ds_hidden_srchinfo.getColumn(0,"instcd"));
  661. //ATC Data 전송(배치호출)
  662. call_TXADT10202();
  663. }
  664. }
  665. //cleaniViewer(oRptViewer);
  666. }
  667. function call_TXADT10202() {
  668. var oParam = {};
  669. oParam.id = "TXADT10202";
  670. oParam.service = "pharmacyprescriptionapp.DrugAccept";
  671. oParam.method = "reqExeDrugATC";
  672. oParam.inds = "req=ds_send_atcinfo";
  673. oParam.outds = "ds_temp_ret=result";
  674. oParam.async = false;
  675. //oParam.callback = "cf_TXADT10202";
  676. tranf_submit(oParam);
  677. }
  678. /****************************************************************************************
  679. * Argument : flag
  680. * Description : 라벨출력
  681. ****************************************************************************************/
  682. function fPrcpLBLPrint(flag) {
  683. var lblitem = null; //라벨구분
  684. var lblstr = "";
  685. var lblsize = ""; //라벨출력크기
  686. var lblgrupAD = "N"; //정제라벨 체크여부
  687. var lblgrupDT = "N"; //PTP라벨 체크여부
  688. if(flag == "A") {//자동출력
  689. lblstr = utlf_transNullToEmpty(ds_hidden_srchinfo.getColumn(0,"autolblflag"));
  690. lblitem = utlf_transNullToEmpty(ds_hidden_srchinfo.getColumn(0,"autolblflag")).split("|");
  691. lblsize = utlf_transNullToEmpty(ds_hidden_srchinfo.getColumn(0,"autolblsize"));
  692. if(lblstr.indexOf("AD") >= 0){
  693. lblgrupAD = "Y";
  694. }
  695. if(lblstr.indexOf("DT") >= 0){
  696. lblgrupDT = "Y";
  697. }
  698. } else if(flag == "M") {//수동출력
  699. lblstr = ds_hidden_srchinfo.getColumn(0,"manllblflag");
  700. lblitem = utlf_transNullToEmpty(ds_hidden_srchinfo.getColumn(0,"manllblflag")).split("|");
  701. lblsize = ds_hidden_srchinfo.getColumn(0,"lblsizeflag");
  702. if(lblstr.indexOf("AD") >= 0){
  703. lblgrupAD = "Y";
  704. }
  705. if(lblstr.indexOf("DT") >= 0){
  706. lblgrupDT = "Y";
  707. }
  708. }
  709. // 20101221_laboru_라벨 출력은 팝업으로 함.
  710. // ds_hidden_srchinfo.setColumn(0,"flagtmp", flag);
  711. dsf_makeValue(ds_hidden_srchinfo,"flagtmp", "string", flag);
  712. dsf_makeValue(ds_send_prcpinfo,"etcdescflag", "string", ds_hidden_srchinfo.getColumn(0,"etcdescflag"));
  713. dsf_makeValue(ds_send_prcpinfo,"lblkind", "string", ds_hidden_srchinfo.getColumn(0,"lblkind"));
  714. dsf_makeValue(ds_send_prcpinfo,"lbltype", "string", ds_init_lbltype_item.getColumn(0,"lbltype"));
  715. dsf_makeValue(ds_send_prcpinfo,"drugkind", "string", ds_hidden_srchinfo.getColumn(0,"drugkind"));
  716. dsf_makeValue(ds_send_prcpinfo,"autoyn", "string", ds_hidden_srchinfo.getColumn(0,"autoyn"));
  717. //dsf_makeValue(ds_send_prcpinfo,"prcpliflag", "string", ds_hidden_srchinfo.getColumn(0,"prcpflag")); // 20120621_제한항생제 승인 처방 라벨 출력위해
  718. //2016.12.25 Shaun 제한항생제 체크.
  719. if (ds_hidden_srchinfo.getColumn(0,"prcpflag").indexOf("B") >=0 ){
  720. //sysf_trace("라벨출력 : " + ds_hidden_srchinfo.getColumn(0,"prcpflag").indexOf("B"));
  721. dsf_makeValue(ds_send_prcpinfo,"prcpliflag", "string", "B");
  722. }
  723. dsf_makeValue(ds_send_prcpinfo,"version", "string", "new");
  724. if(ds_send_suminfo.getColumn(0,"intiflag") == "N") {
  725. dsf_makeValue(ds_send_prcpinfo,"intiflag", "string", "Y"); // 20120417_laboru_인티팜 여부 추가
  726. }
  727. // 20101222_laboru_경북대병원_경대 본원 라벨(큰라벨 2)
  728. if(lblsize == "L" || lblsize == "L1" ) {//자동출력에 큰라벨 출력이면 환자별로 한꺼번에 뽑아야 라벨총장수와 페이지 번호 찍음
  729. var lblstr2 = lblstr.setReplaceWord("AD", "D|DX|DH|DP");
  730. lblstr2 = lblstr2.setReplaceWord("AI", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
  731. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", lblstr2);
  732. dsf_makeValue(ds_send_prcpinfo,"lblsizeflag", "string", "L");
  733. // 20101221_laboru_라벨 출력은 팝업으로 함.
  734. // 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");
  735. lf_openRexLabel();
  736. } else if(lblsize == "S") {
  737. dsf_makeValue(ds_send_prcpinfo,"lblsizeflag", "string", "S");
  738. for (var i = 0; i < lblitem.length; i++) {
  739. //20101221_laboru_lblitem 을 팝업창으로 넘기기.
  740. // ds_hidden_srchinfo.setColumn(0,"tmplblitem", lblitem[i]);
  741. dsf_makeValue(ds_hidden_srchinfo,"tmplblitem","string",lblitem[i]);
  742. //정제
  743. if (lblitem[i]=="AD"){
  744. //20100405 이선경 추가 : 라벨그룹의 PTP가 체크되어 있고 정제 작은라벨(리스트형식) 출력시 ptp 함께 출력하는 옵션일때 PTP함께 출력
  745. if(lblgrupDT == "Y" && ds_init_sumprcpflagyn_flagyn.getColumn(0,"lbl6yn") == "Y") {
  746. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "D|DX|DH|DP|DT");
  747. } else {
  748. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "D|DX|DH|DP");
  749. }
  750. // 20101221_laboru_라벨 출력은 팝업으로 함.
  751. // 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");
  752. lf_openRexLabel();
  753. }
  754. //주사
  755. if (lblitem[i]=="AI"){
  756. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "I|IO|IX|IH|IS"); // 20120628_일반수액도 추가(퇴원의 경우)
  757. // 20101221_laboru_라벨 출력은 팝업으로 함.
  758. // 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");
  759. lf_openRexLabel();
  760. }
  761. //PTP
  762. if (lblitem[i]=="DT"){
  763. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "DT");
  764. //20100405 이선경 추가 : 라벨그룹의 정제가 체크되어 있고 정제 작은라벨(리스트형식) 출력시 ptp 함께 출력하는 옵션일때 출력안함
  765. if(lblgrupAD == "N" || ds_init_sumprcpflagyn_flagyn.getColumn(0,"lbl6yn") != "Y") {
  766. // 20101221_laboru_라벨 출력은 팝업으로 함.
  767. // 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");
  768. lf_openRexLabel();
  769. }
  770. }
  771. //외용
  772. if (lblitem[i]=="DI"){
  773. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "DI");
  774. // 20101221_laboru_라벨 출력은 팝업으로 함.
  775. // 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");
  776. lf_openRexLabel();
  777. }
  778. //수제
  779. if (lblitem[i]=="DS"){
  780. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "DS");
  781. // 20101221_laboru_라벨 출력은 팝업으로 함.
  782. // 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");
  783. lf_openRexLabel();
  784. }
  785. //PACK 20110922_laboru_pack 도 작은 라벨로 출력 가능하게 수정
  786. if (lblitem[i]=="DG"){
  787. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "DG");
  788. // 20101221_laboru_라벨 출력은 팝업으로 함.
  789. // 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");
  790. lf_openRexLabel();
  791. }
  792. //PTP단독처방
  793. if (lblitem[i]=="PTS"){
  794. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "PTS");
  795. // 20101221_laboru_라벨 출력은 팝업으로 함.
  796. //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");
  797. lf_openRexLabel();
  798. }
  799. //산제용법별
  800. if (lblitem[i]=="DP"){
  801. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "DP");
  802. // 20101221_laboru_라벨 출력은 팝업으로 함.
  803. // 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");
  804. lf_openRexLabel();
  805. }
  806. //2010-06-29 [보관방법:냉장주사] 단독출력
  807. if (lblitem[i]=="LBL_INJ_I"){
  808. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "LBL_INJ_I");
  809. // 20101221_laboru_라벨 출력은 팝업으로 함.
  810. // 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");
  811. lf_openRexLabel();
  812. }
  813. //2010-06-29 [보관방법:고위험주사] 단독출력
  814. if (lblitem[i]=="LBL_INJ_D"){
  815. dsf_makeValue(ds_send_prcpinfo,"lblflag", "string", "LBL_INJ_D");
  816. // 20101221_laboru_라벨 출력은 팝업으로 함.
  817. // 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");
  818. lf_openRexLabel();
  819. }
  820. }
  821. }
  822. }
  823. /****************************************************************************************
  824. * Argument : N/A
  825. * Description : 병동라벨렉스퍼트 출력화면 오픈
  826. ****************************************************************************************/
  827. function lf_openRexLabel() {
  828. ds_init_barcdprntsetup.copyData(ds_main_barcdprntsetup);
  829. var objArg = new Object();
  830. objArg.arg_ds_init_barcdprntsetup = ds_init_barcdprntsetup;
  831. objArg.arg_ds_send_prcpinfo = ds_send_prcpinfo;
  832. objArg.arg_ds_hidden_srchinfo = ds_hidden_srchinfo;
  833. objArg.arg_ds_init_sumprcpflagyn_flagyn = ds_init_sumprcpflagyn_flagyn;
  834. frmf_modal("SPADT62302","SPADT62302", objArg, "", 1, 0, 0, "", "", "", "", "", "M");
  835. }
  836. function fStopTimer() {
  837. // window.clearinterval(gT1);
  838. }
  839. /****************************************************************************************
  840. * Argument : N/A
  841. * Description : 처방전 출력
  842. ****************************************************************************************/
  843. function fHosInMPSPrint() {
  844. dsf_makeValue(ds_send_prcpinfo,"etcdescflag", "string",ds_hidden_srchinfo.getColumn(0,"etcdescflag"));
  845. dsf_makeValue(ds_send_prcpinfo,"autoyn", "string",ds_hidden_srchinfo.getColumn(0,"autoyn"));
  846. dsf_makeValue(ds_send_prcpinfo,"stocdeptcd", "string",ds_hidden_srchinfo.getColumn(0,"stocdeptcd"));
  847. var intiflag = "";
  848. var intinoflag = "";
  849. var prcpflag = ds_hidden_srchinfo.getColumn(0,'prcpflag');
  850. if(prcpflag.indexOf("IT") > -1) {
  851. intiflag = "Y";
  852. }
  853. if(prcpflag.indexOf("IN") > -1) {
  854. intinoflag = "Y";
  855. }
  856. dsf_makeValue(ds_send_prcpinfo,"intiflag", "string",intiflag);
  857. dsf_makeValue(ds_send_prcpinfo,"intinoflag", "string",intinoflag);
  858. //dsf_makeValue(ds_send_prcpinfo,"autolimanti", "string",ds_hidden_srchinfo.getColumn(0,"prcpflag")); // 2011.02.08 pymi 제한항생제
  859. //2016.12.25 Shaun 제한항생제.
  860. if (ds_hidden_srchinfo.getColumn(0,"prcpflag").indexOf("B") >=0 ){
  861. //sysf_trace("처방전 출력 : " + ds_hidden_srchinfo.getColumn(0,"prcpflag").indexOf("B"));
  862. dsf_makeValue(ds_send_prcpinfo,"autolimanti", "string", "B");
  863. }
  864. var objArg = new Object();
  865. objArg.arg_ds_send_prcpinfo = ds_send_prcpinfo;
  866. frmf_modal("SPADT62201","SPADT62201", objArg, "", 0, 0, 0,"","","","","","M" );
  867. }
  868. /****************************************************************************************
  869. * Argument : N/A
  870. * Description : 자동출력 버튼 클릭시 타이머 작동
  871. ****************************************************************************************/
  872. function fClickAutoPrnt(chk) {
  873. if (chk == "Y") {
  874. //20090824 마정민 수정. 오류가 나더라도 팝업이 뜨지 않고 계속해서 진행될 수 있도록 수정.
  875. sysf_setErrorMsg(true);
  876. ds_hidden.setColumn(0,"autoend", "N");
  877. if(utlf_isNull(ds_hidden_srchinfo.getColumn(0,"autoprntflag"))) {
  878. sysf_messageBox("자동출력의 처방구분을", "C001");
  879. return;
  880. }
  881. if(utlf_isNull(ds_hidden_srchinfo.getColumn(0,"autokind")) && utlf_isNull(ds_hidden_srchinfo.getColumn(0,"autolblsize"))) {
  882. sysf_messageBox("자동출력의 출력구분을", "C001");
  883. return;
  884. }
  885. // 20101203 wify 경북대병원 큰라벨(본원)추가
  886. if(ds_hidden_srchinfo.getColumn(0,"autolblsize") == "L" || ds_hidden_srchinfo.getColumn(0,"autolblsize") == "S" || ds_hidden_srchinfo.getColumn(0,"autolblsize1") == "L1") {
  887. if(utlf_isNull(ds_hidden_srchinfo.getColumn(0,"autolblflag"))) {
  888. sysf_messageBox("자동출력의 라벨구분을", "C001");
  889. return;
  890. }
  891. }
  892. var sRst = "";
  893. if(gTimer > 0) {
  894. sRst = sysf_messageBox("자동출력이 동작중입니다.\n자동출력구분설정대로 다시", "Q004");
  895. if(sRst == "6"){
  896. // window.clearinterval(gTimer);
  897. gTimer = 0;
  898. this.killTimer(0);
  899. } else {
  900. return;
  901. }
  902. }
  903. if(sRst == ""){
  904. sRst = sysf_messageBox("자동출력을", "Q004");
  905. if(sRst != "6"){
  906. return;
  907. }
  908. }
  909. btn_hist.visible = false;
  910. grd_sumlist.visible = false;
  911. grd_patlist.visible = false;
  912. //20090914 이선경 추가 : 자동출력중 처방구분등 다른조건 변경 못하게 함(오류 가능성 있음)
  913. rdo_prcp.enable = false; //처방구분(정규, 추가)
  914. rdo_prcp2.enable = false; //처방구분(admission, 병동응급, 퇴원, 외박, 응급실)
  915. checkbox4.enable = false; //항암프로토콜처방만 체크
  916. ipt_fst_drugno.enable = false; //투약번호 from
  917. caption25.enable = false; //'~'
  918. ipt_last_drugno.enable = false; //투약번호 to
  919. ipt_pid.enable = false; //등록번호
  920. chk_manl_lblflag.enable = false; //라벨구분
  921. btn_prt.enable = false; //출력버튼
  922. button1.enable = false; //마감버튼
  923. checkbox10.enable = false; //PTP단독처방라벨
  924. checkbox3.enable = false; //자동출력의 PTP단독처방라벨
  925. chk_auto_small.enable = false; //자동출력의 처방구분
  926. chk_auto_lblflag.enable = false; //자동출력의 라벨구분
  927. chk_auto_big.enable = false; //자동출력의 출력구분
  928. chk_auto_lblsize.enable = false; //자동출력의 출력구분
  929. chk_auto_lbl_L.enable = false;
  930. chk_auto_lbl_S.enable = false;
  931. //checkbox8.enable = false; //자동출력의 ptp라벨, 외용라벨
  932. ipt_prcpdd.enable = false; //적용일자
  933. btn_sea.enable = false; //조회버튼
  934. cmb_sumtmflag1.enable = false; //마감시간대구분
  935. cmb_fromddflag1.enable = false; //마감일자from
  936. ipt_fromtm1.enable = false; //마감시간from
  937. cmb_toddflag1.enable = false; //마감일자to
  938. ipt_totm1.enable = false; //마감시간to
  939. cmb_sumtmflag2.enable = false; //마감시간대구분
  940. cmb_fromddflag2.enable = false; //마감일자from
  941. ipt_fromtm2.enable = false; //마감시간from
  942. cmb_toddflag2.enable = false; //마감일자to
  943. ipt_totm2.enable = false; //마감시간to
  944. radio1.enable = false; //약주사구분
  945. radio3.enable = false; //기타조회구분
  946. btn_init.enable = false; //초기화버튼
  947. button5.enable = false; //병동검색이미지
  948. chk_mps.enable = false; //출력구분의 처방전체크
  949. chk_lbl.enable = false; //출력구분의 라벨체크
  950. //checkbox1.enable = false; //출력구분의 약체크
  951. //checkbox2.enable = false; //출력구분의 주사체크
  952. //chk_lbl_drug.enable = false; //출력구분의 약리스트체크
  953. //chk_lbl_inj.enable = false; //출력구분의 주사리스트체크
  954. combo1.enable = false; //실출고부서
  955. checkbox7.enable = false; //ATC순으로 정렬
  956. btn_prnt.enable = false; //프린터설정
  957. button3.enable = false; //마감시간관리
  958. input1.enable = false; //출력간격
  959. checkbox11.enable = false; //multi-day 처방포함
  960. checkbox14.enable = false;
  961. checkbox15.enable = false;
  962. cmb_sumtmflag3.enable = false;
  963. cmb_fromddflag3.enable = false;
  964. ipt_fromtm3.enable = false;
  965. cmb_toddflag3.enable = false;
  966. ipt_totm3.enable = false;
  967. cbx_etcdescflag.enable = false;
  968. chk_lbl_keepmthd.enable = false;
  969. chk_lbl_L.enable = false;
  970. chk_lbl_S.enable = false;
  971. chk_lbl1.enable = false;
  972. chk_name_card.enable = false;
  973. chk_auto_lblsize1.enable = false;
  974. //cmb_ward.visible = false;
  975. ds_hidden_srchinfo.setColumn(0,"prcpflag", "");
  976. ds_hidden_srchinfo.setColumn(0,"fst_drugno", "");
  977. ds_hidden_srchinfo.setColumn(0,"last_drugno", "");
  978. ds_hidden_srchinfo.setColumn(0,"wardcd", "");
  979. ds_hidden_srchinfo.setColumn(0,"wardnm", "");
  980. ds_temp_srchinfo.setColumn(0,"ward", "");
  981. ds_hidden_srchinfo.setColumn(0,"pid", "");
  982. ds_hidden_srchinfo.setColumn(0,"onlyantis","");
  983. ds_hidden_srchinfo.setColumn(0,"autoyn", "Y");
  984. ds_send_suminfo.setColumn(0,"fromdd", "");
  985. ds_send_suminfo.setColumn(0,"fromtm", "");
  986. ds_send_suminfo.setColumn(0,"todd", "");
  987. ds_send_suminfo.setColumn(0,"totm", "");
  988. var autostr = String(chk_auto_small.getLableData());
  989. if(ds_hidden_srchinfo.getColumn(0,"autokind") == "M") autostr = autostr + " " + chk_auto_big.text;
  990. if(ds_hidden_srchinfo.getColumn(0,"autolblsize") == "L") autostr = autostr + " " + chk_auto_lbl_L.text;
  991. if(ds_hidden_srchinfo.getColumn(0,"autolblsize") == "S") autostr = autostr + " " + chk_auto_lbl_S.text;
  992. if(ds_hidden_srchinfo.getColumn(0,"autolblsize1") == "L1") autostr = autostr + " " + chk_auto_lblsize1.text;
  993. //+ " " + chk_auto_big.text + " " + chk_auto_lbl_L.text + " " + chk_auto_lbl_S.text;
  994. if(ds_hidden_srchinfo.getColumn(0,"autolblsize") == "L" || ds_hidden_srchinfo.getColumn(0,"autolblsize") == "S" || ds_hidden_srchinfo.getColumn(0,"autolblsize1") == "L1"){
  995. autostr = autostr + "(" + String(chk_auto_lblflag.getLableData()).replace(",","|") + ")";
  996. }
  997. autostr = autostr.setReplaceWord("|", ", " );
  998. group2.caption23.text = autostr;
  999. btn_autoprnt_start.enable = false;
  1000. btn_autoprnt_end.enable = true;
  1001. chk_sum_count = 8;
  1002. // gTimer = window.setInterval("fAutoPrnt()",20000);
  1003. gTimer = 1;
  1004. this.setTimer(0, 20000);
  1005. //재출력 불가
  1006. ds_hidden_srchinfo.setColumn(0,"reprintyn", "");
  1007. checkbox9.enable = false;
  1008. group2.visible = true;
  1009. //서버오류가 발생하더라도 modeless 팝업을 통해 계속해서 진행할 수 있도록 수정.
  1010. // fErrMsg ();
  1011. } else {
  1012. sysf_setErrorMsg(true);
  1013. // window.clearinterval(gTimer);
  1014. gTimer = 0;
  1015. this.killTimer(0);
  1016. btn_hist.visible = true;
  1017. grd_sumlist.visible = true;
  1018. grd_patlist.visible = true;
  1019. //20090914 이선경 추가 : 자동출력중 처방구분등 다른조건 변경 못하게 함(오류 가능성 있음)
  1020. rdo_prcp.enable = true; //처방구분(정규, 추가)
  1021. rdo_prcp2.enable = true; //처방구분(admission, 병동응급, 퇴원, 외박, 응급실)
  1022. checkbox4.enable = true; //항암프로토콜처방만 체크
  1023. ipt_fst_drugno.enable = true; //투약번호 from
  1024. caption25.enable = true; //'~'
  1025. ipt_last_drugno.enable = true; //투약번호 to
  1026. ipt_pid.enable = true; //등록번호
  1027. chk_manl_lblflag.enable = true; //라벨구분
  1028. btn_prt.enable = true; //출력버튼
  1029. button1.enable = true; //마감버튼
  1030. checkbox10.enable = true; //PTP단독처방라벨
  1031. checkbox3.enable = true; //자동출력의 PTP단독처방라벨
  1032. chk_auto_small.enable = true; //자동출력의 처방구분
  1033. chk_auto_lblflag.enable = true; //자동출력의 라벨구분
  1034. chk_auto_big.enable = true; //자동출력의 출력구분
  1035. chk_auto_lblsize.enable = true; //자동출력의 출력구분
  1036. chk_auto_lbl_L.enable = true;
  1037. chk_auto_lbl_S.enable = true;
  1038. //checkbox8.enable = true; //자동출력의 ptp라벨, 외용라벨
  1039. ipt_prcpdd.enable = true; //적용일자
  1040. btn_sea.enable = true; //조회버튼
  1041. cmb_sumtmflag1.enable = true; //마감시간대구분
  1042. cmb_fromddflag1.enable = true; //마감일자from
  1043. ipt_fromtm1.enable = true; //마감시간from
  1044. cmb_toddflag1.enable = true; //마감일자to
  1045. ipt_totm1.enable = true; //마감시간to
  1046. cmb_sumtmflag2.enable = true; //마감시간대구분
  1047. cmb_fromddflag2.enable = true; //마감일자from
  1048. ipt_fromtm2.enable = true; //마감시간from
  1049. cmb_toddflag2.enable = true; //마감일자to
  1050. ipt_totm2.enable = true; //마감시간to
  1051. radio1.enable = true; //약주사구분
  1052. radio3.enable = true; //기타조회구분
  1053. btn_init.enable = true; //초기화버튼
  1054. button5.enable = true; //병동검색이미지
  1055. chk_mps.enable = true; //출력구분의 처방전체크
  1056. chk_lbl.enable = true; //출력구분의 라벨체크
  1057. //checkbox1.enable = true; //출력구분의 약체크
  1058. //checkbox2.enable = true; //출력구분의 주사체크
  1059. //chk_lbl_drug.enable = true; //출력구분의 약리스트체크
  1060. //chk_lbl_inj.enable = true; //출력구분의 주사리스트체크
  1061. combo1.enable = true; //실출고부서
  1062. checkbox7.enable = true; //ATC순으로 정렬
  1063. btn_prnt.enable = true; //프린터설정
  1064. button3.enable = true; //마감시간관리
  1065. input1.enable = true; //출력간격
  1066. checkbox11.enable = true; //multi-day 처방포함
  1067. checkbox14.enable = true;
  1068. checkbox15.enable = true;
  1069. cmb_sumtmflag3.enable = true;
  1070. cmb_fromddflag3.enable = true;
  1071. ipt_fromtm3.enable = true;
  1072. cmb_toddflag3.enable = true;
  1073. ipt_totm3.enable = true;
  1074. cbx_etcdescflag.enable = true;
  1075. chk_lbl_keepmthd.enable = true;
  1076. chk_lbl_L.enable = true;
  1077. chk_lbl_S.enable = true;
  1078. chk_lbl1.enable = true;
  1079. chk_name_card.enable = true;
  1080. chk_auto_lblsize1.enable = true;
  1081. //cmb_ward.visible = true;
  1082. ds_hidden_srchinfo.setColumn(0,"prcpflag", "");
  1083. ds_hidden_srchinfo.setColumn(0,"fst_drugno", "");
  1084. ds_hidden_srchinfo.setColumn(0,"last_drugno", "");
  1085. ds_hidden_srchinfo.setColumn(0,"wardcd", "");
  1086. ds_hidden_srchinfo.setColumn(0,"wardnm", "");
  1087. ds_hidden_srchinfo.setColumn(0,"drugkind", "T");
  1088. ds_temp_srchinfo.setColumn(0,"ward", "");
  1089. ds_hidden_srchinfo.setColumn(0,"pid", "");
  1090. //ds_hidden_srchinfo.setColumn(0,"autoprntflag", "");
  1091. ds_hidden_srchinfo.setColumn(0,"autoyn", "");
  1092. btn_autoprnt_start.enable = true;
  1093. btn_autoprnt_end.enable = false;
  1094. ds_hidden.setColumn(0,"autoend", "Y") ;
  1095. ds_hidden_srchinfo.setColumn(0,"prcpflag", "A");
  1096. //재출력 가능
  1097. checkbox9.enable = true;
  1098. group2.visible = false;
  1099. ds_main_sumlist.clearData();
  1100. ds_main_patlist.clearData();
  1101. }
  1102. sysf_setErrorMsg(false);
  1103. }
  1104. function fReStart(){
  1105. //window.clearinterval(gTimer2);
  1106. //gTimer = window.setInterval("fAutoPrnt()",11000);
  1107. }
  1108. /****************************************************************************************
  1109. * Argument : N/A
  1110. * Description : 자동출력
  1111. ****************************************************************************************/
  1112. function fAutoPrnt() {
  1113. //window.clearinterval(gTimer);
  1114. if ( ds_hidden.getColumn(0,"autoend") == "Y" ){
  1115. gTimer = 0;
  1116. return;
  1117. }
  1118. var orgPrcpflag = ds_hidden_srchinfo.getColumn(0,"prcpflag");
  1119. chk_count++;
  1120. if ( ( chk_count % 4 )=="0" ){
  1121. group2.caption14.text="자동 출력중[/]";
  1122. }
  1123. if ( ( chk_count % 4 )=="1" ){
  1124. group2.caption14.text="자동 출력중[ ―]";
  1125. }
  1126. if ( ( chk_count % 4 )=="2" ){
  1127. group2.caption14.text="자동 출력중[\]";
  1128. }
  1129. if ( ( chk_count % 4 )=="3" ){
  1130. group2.caption14.text="자동 출력중[|]";
  1131. }
  1132. if(chk_sum_count >= 4){
  1133. if ( ds_hidden_srchinfo.getColumn(0,"autokind").indexOf("M") > -1 ){ //20090721 이선경 수정 : 처방전 자동출력일때만 마감적용
  1134. if (ds_hidden_srchinfo.getColumn(0,"autoendyn") =="Y") {
  1135. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("Z") >=0 ){
  1136. ds_hidden_srchinfo.setColumn(0,"prcpflag", "Z");
  1137. fHosInSum("N", "auto"); //508응급병동 정규약
  1138. }
  1139. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("9") >=0 ){
  1140. ds_hidden_srchinfo.setColumn(0,"prcpflag", "9");
  1141. fHosInSum("N", "auto"); //508응급병동 정규약
  1142. }
  1143. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("8") >=0 ){
  1144. ds_hidden_srchinfo.setColumn(0,"prcpflag", "8");
  1145. fHosInSum("N", "auto"); //508응급병동 정규약
  1146. }
  1147. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("7") >=0 ){
  1148. ds_hidden_srchinfo.setColumn(0,"prcpflag", "7");
  1149. fHosInSum("N", "auto"); //508응급병동 정규약
  1150. }
  1151. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("M1") >=0 ){
  1152. ds_hidden_srchinfo.setColumn(0,"prcpflag", "M");
  1153. ds_hidden_srchinfo.setColumn(0,"drugkind", "D");
  1154. fHosInSum("N", "auto"); //Admission약마감
  1155. }
  1156. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("M2") >=0 ){
  1157. ds_hidden_srchinfo.setColumn(0,"prcpflag", "M");
  1158. ds_hidden_srchinfo.setColumn(0,"drugkind", "M");
  1159. fHosInSum("N", "auto"); //Admission주사마감
  1160. }
  1161. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("M1") < 0
  1162. && ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("M2") < 0
  1163. && ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("M") >=0 ){
  1164. ds_hidden_srchinfo.setColumn(0,"prcpflag", "M");
  1165. fHosInSum("N", "auto"); //Admission마감
  1166. }
  1167. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("W1") >=0 ){
  1168. ds_hidden_srchinfo.setColumn(0,"prcpflag", "W");
  1169. ds_hidden_srchinfo.setColumn(0,"drugkind", "D");
  1170. fHosInSum("N", "auto"); //병동응급약마감
  1171. }
  1172. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("W2") >=0 ){
  1173. ds_hidden_srchinfo.setColumn(0,"prcpflag", "W");
  1174. ds_hidden_srchinfo.setColumn(0,"drugkind", "M");
  1175. fHosInSum("N", "auto"); //병동응급주사마감
  1176. } else
  1177. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("W1") < 0
  1178. && ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("W2") < 0
  1179. && ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("W") >=0 ){
  1180. ds_hidden_srchinfo.setColumn(0,"prcpflag", "W");
  1181. fHosInSum("N", "auto"); //병동응급마감
  1182. }
  1183. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("L") >=0 ){
  1184. ds_hidden_srchinfo.setColumn(0,"prcpflag", "L"); // 자동일때는 외출외박으로 처리하여 응급실 퇴원약 제외 20091027 이선경 수정 : 외출외박과 퇴원약은 따로 처리
  1185. ds_hidden_srchinfo.setColumn(0,"drugkind", "T");
  1186. fHosInSum("N", "auto"); //퇴원약마감
  1187. }
  1188. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("G") >=0 ){
  1189. ds_hidden_srchinfo.setColumn(0,"prcpflag", "G");
  1190. ds_hidden_srchinfo.setColumn(0,"drugkind", "T");
  1191. fHosInSum("N", "auto"); //외박마감
  1192. }
  1193. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("E") >=0 ){
  1194. //ds_hidden_srchinfo.setColumn(0,"prcpflag", "O"); //마약만 마감
  1195. //fHosInSum("N", "auto");
  1196. }
  1197. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("S") >=0 ){
  1198. //ds_hidden_srchinfo.setColumn(0,"prcpflag", "Q"); //마약만 마감
  1199. //fHosInSum("N");
  1200. }
  1201. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("C2") >=0 ){
  1202. ds_hidden_srchinfo.setColumn(0,"prcpflag", "C2");
  1203. fHosInSum("N", "auto"); //임상주사 마감
  1204. }
  1205. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("IN") >=0 ){
  1206. ds_hidden_srchinfo.setColumn(0,"prcpflag", "IN");
  1207. }
  1208. }
  1209. ds_hidden_srchinfo.setColumn(0,"prcpflag", "");
  1210. chk_sum_count = 0;
  1211. }
  1212. }
  1213. chk_sum_count++;
  1214. //퇴원 자동출력시 마감을 G로 해서 원래 L 값을 보내줘야함
  1215. //ds_hidden_srchinfo.setColumn(0,"prcpflag", orgPrcpflag); //이훈재 막음. ( 옵션을 선택한 값임)
  1216. if ( ds_hidden_srchinfo.getColumn(0,"autokind").indexOf("M") > -1 ){
  1217. ds_hidden_srchinfo.setColumn(0,"prntkind", "M");
  1218. ds_hidden_srchinfo.setColumn(0,"autolblyn", ""); //20190502.pkc 처방전 출력경우 null
  1219. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("Z") >=0 ){
  1220. ds_hidden_srchinfo.setColumn(0,"prcpflag", "Z");
  1221. fInSumList(); //마감시간별 미출력데이터 조회
  1222. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1223. chk_prnt_count++;
  1224. grd_sumlist.setFocus();
  1225. ds_main_sumlist.rowposition = i;
  1226. // grd_sumlist.setCellPos(grd_sumlist.getBindCellIndex("body","column"));
  1227. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1228. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1229. fPrcpMPSPrint("A", "mps"); //처방전출력
  1230. }
  1231. }
  1232. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("M") >=0 ){
  1233. ds_hidden_srchinfo.setColumn(0,"prcpflag", "M");
  1234. fInSumList(); //마감시간별 미출력데이터 조회
  1235. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1236. chk_prnt_count++;
  1237. // grd_sumlist.isSelected(i) = true;
  1238. // grd_sumlist.row = i;
  1239. grd_sumlist.setFocus();
  1240. ds_main_sumlist.rowposition = i;
  1241. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1242. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1243. fPrcpMPSPrint("A", "mps"); //처방전출력
  1244. }
  1245. }
  1246. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("W") >=0 ){
  1247. ds_hidden_srchinfo.setColumn(0,"prcpflag", "W");
  1248. if ( ds_send_suminfo.getColumn(0,"intiflag") != "N" ){
  1249. fInSumList(); //마감시간별 미출력데이터 조회
  1250. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1251. chk_prnt_count++;
  1252. // grd_sumlist.isSelected(i) = true;
  1253. // grd_sumlist.row = i;
  1254. grd_sumlist.setFocus();
  1255. ds_main_sumlist.rowposition = i;
  1256. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1257. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1258. fPrcpMPSPrint("A", "mps"); //처방전출력
  1259. }
  1260. }
  1261. }
  1262. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("L") >=0 ){
  1263. ds_hidden_srchinfo.setColumn(0,"prcpflag", "L"); // 자동일때는 외출외박으로 처리하여 응급실 퇴원약 제외 20091027 이선경 수정 : 외출외박과 퇴원약은 따로 처리
  1264. fInSumList(); //마감시간별 미출력데이터 조회
  1265. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1266. chk_prnt_count++;
  1267. // grd_sumlist.isSelected(i) = true;
  1268. // grd_sumlist.row = i;
  1269. grd_sumlist.setFocus();
  1270. ds_main_sumlist.rowposition = i;
  1271. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1272. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1273. fPrcpMPSPrint("A", "mps"); //처방전출력
  1274. }
  1275. }
  1276. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("G") >=0 ){
  1277. ds_hidden_srchinfo.setColumn(0,"prcpflag", "G");
  1278. fInSumList(); //마감시간별 미출력데이터 조회
  1279. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1280. chk_prnt_count++;
  1281. // grd_sumlist.isSelected(i) = true;
  1282. // grd_sumlist.row = i;
  1283. grd_sumlist.setFocus();
  1284. ds_main_sumlist.rowposition = i;
  1285. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1286. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1287. fPrcpMPSPrint("A", "mps"); //처방전출력
  1288. }
  1289. }
  1290. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("E") >=0 ){
  1291. ds_hidden_srchinfo.setColumn(0,"prcpflag", "E");
  1292. fInSumList(); //마감시간별 미출력데이터 조회
  1293. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1294. chk_prnt_count++;
  1295. // grd_sumlist.isSelected(i) = true;
  1296. // grd_sumlist.row = i;
  1297. grd_sumlist.setFocus();
  1298. ds_main_sumlist.rowposition = i;
  1299. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1300. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1301. fPrcpMPSPrint("A", "mps"); //처방전출력
  1302. }
  1303. }
  1304. // 2011.02.08 pymi 제한항생제
  1305. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("B") >=0 ){
  1306. ds_hidden_srchinfo.setColumn(0,"prcpflag", "B");
  1307. fInSumList(); //마감시간별 미출력데이터 조회
  1308. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1309. chk_prnt_count++;
  1310. // grd_sumlist.isSelected(i) = true;
  1311. // grd_sumlist.row = i;
  1312. grd_sumlist.setFocus();
  1313. ds_main_sumlist.rowposition = i;
  1314. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1315. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1316. fPrcpMPSPrint("A", "mps"); //처방전출력
  1317. }
  1318. }
  1319. // (e)
  1320. // 임상
  1321. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("C2") >=0 ){
  1322. ds_hidden_srchinfo.setColumn(0,"prcpflag", "C2");
  1323. fInSumList(); //마감시간별 미출력데이터 조회
  1324. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1325. chk_prnt_count++;
  1326. // grd_sumlist.isSelected(i) = true;
  1327. // grd_sumlist.row = i;
  1328. grd_sumlist.setFocus();
  1329. ds_main_sumlist.rowposition = i;
  1330. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1331. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1332. fPrcpMPSPrint("A", "mps"); //처방전출력
  1333. }
  1334. }
  1335. // 20120316_laboru_마약 단독 처방전 출력
  1336. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("S") >=0 ){
  1337. ds_hidden_srchinfo.setColumn(0,"prcpflag", "S");
  1338. fInSumList(); //마감시간별 미출력데이터 조회
  1339. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1340. chk_prnt_count++;
  1341. // grd_sumlist.isSelected(i) = true;
  1342. // grd_sumlist.row = i;
  1343. grd_sumlist.setFocus();
  1344. ds_main_sumlist.rowposition = i;
  1345. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1346. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1347. fPrcpMPSPrint("A", "mps"); //처방전출력
  1348. }
  1349. }
  1350. // 20120416_laboru_인티팜 처방전 출력
  1351. if (ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("IT") >=0 ){
  1352. ds_hidden_srchinfo.setColumn(0,"prcpflag", "T");
  1353. dsf_makeValue(ds_send_sumlistinfo,"intiflag","string","N");
  1354. fInSumList(); //마감시간별 미출력데이터 조회
  1355. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1356. chk_prnt_count++;
  1357. // grd_sumlist.isSelected(i) = true;
  1358. // grd_sumlist.row = i;
  1359. grd_sumlist.setFocus();
  1360. ds_main_sumlist.rowposition = i;
  1361. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1362. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1363. fPrcpMPSPrint("A", "mps"); //처방전출력
  1364. }
  1365. }
  1366. if (ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("IN") >=0 ){
  1367. ds_hidden_srchinfo.setColumn(0,"prcpflag", "T");
  1368. dsf_makeValue(ds_send_sumlistinfo,"intiflag","string","N");
  1369. dsf_makeValue(ds_send_sumlistinfo,"intinoflag","string","Y");
  1370. fInSumList(); //마감시간별 미출력데이터 조회
  1371. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1372. chk_prnt_count++;
  1373. // grd_sumlist.isSelected(i) = true;
  1374. // grd_sumlist.row = i;
  1375. grd_sumlist.setFocus();
  1376. ds_main_sumlist.rowposition = i;
  1377. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1378. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1379. fPrcpMPSPrint("A", "mps"); //처방전출력
  1380. }
  1381. }
  1382. if (ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("9") >=0 ){
  1383. ds_hidden_srchinfo.setColumn(0,"prcpflag", "9");
  1384. fInSumList(); //마감시간별 미출력데이터 조회
  1385. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1386. chk_prnt_count++;
  1387. // grd_sumlist.isSelected(i) = true;
  1388. // grd_sumlist.row = i;
  1389. grd_sumlist.setFocus();
  1390. ds_main_sumlist.rowposition = i;
  1391. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1392. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1393. fPrcpMPSPrint("A", "mps"); //처방전출력
  1394. }
  1395. }
  1396. if (ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("8") >=0 ){
  1397. ds_hidden_srchinfo.setColumn(0,"prcpflag", "8");
  1398. fInSumList(); //마감시간별 미출력데이터 조회
  1399. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1400. chk_prnt_count++;
  1401. // grd_sumlist.isSelected(i) = true;
  1402. // grd_sumlist.row = i;
  1403. grd_sumlist.setFocus();
  1404. ds_main_sumlist.rowposition = i;
  1405. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1406. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1407. fPrcpMPSPrint("A", "mps"); //처방전출력
  1408. }
  1409. }
  1410. if (ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("7") >=0 ){
  1411. ds_hidden_srchinfo.setColumn(0,"prcpflag", "7");
  1412. fInSumList(); //마감시간별 미출력데이터 조회
  1413. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1414. chk_prnt_count++;
  1415. // grd_sumlist.isSelected(i) = true;
  1416. // grd_sumlist.row = i;
  1417. grd_sumlist.setFocus();
  1418. ds_main_sumlist.rowposition = i;
  1419. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1420. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1421. fPrcpMPSPrint("A", "mps"); //처방전출력
  1422. }
  1423. }
  1424. }
  1425. //라벨
  1426. // 20101204 wify 경북대병원 큰라벨(본원) 추가
  1427. if ( ds_hidden_srchinfo.getColumn(0,"autolblsize").indexOf("L") > -1 || ds_hidden_srchinfo.getColumn(0,"autolblsize").indexOf("S") > -1 || ds_hidden_srchinfo.getColumn(0,"autolblsize").indexOf("L1") > -1 ){
  1428. ds_hidden_srchinfo.setColumn(0,"prntkind", "L");
  1429. if (ds_hidden_srchinfo.getColumn(0,"autoyn") =="Y") {
  1430. ds_hidden_srchinfo.setColumn(0,"autolblyn", "Y");
  1431. } else {
  1432. ds_hidden_srchinfo.setColumn(0,"autolblyn", "");
  1433. }
  1434. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("Z") >=0 ){
  1435. ds_hidden_srchinfo.setColumn(0,"prcpflag", "Z");
  1436. fInSumList(); //마감시간별 미출력데이터 조회
  1437. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1438. chk_prnt_count++;
  1439. // grd_sumlist.isSelected(i) = true;
  1440. // grd_sumlist.row = i;
  1441. grd_sumlist.setFocus();
  1442. ds_main_sumlist.rowposition = i;
  1443. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1444. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1445. }
  1446. }
  1447. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("M") >=0 ){
  1448. ds_hidden_srchinfo.setColumn(0,"prcpflag", "M");
  1449. fInSumList(); //마감시간별 미출력데이터 조회
  1450. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1451. chk_prnt_count++;
  1452. // grd_sumlist.isSelected(i) = true;
  1453. // grd_sumlist.row = i;
  1454. grd_sumlist.setFocus();
  1455. ds_main_sumlist.rowposition = i;
  1456. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1457. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1458. }
  1459. }
  1460. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("W") >=0 ){
  1461. ds_hidden_srchinfo.setColumn(0,"prcpflag", "W");
  1462. fInSumList(); //마감시간별 미출력데이터 조회
  1463. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1464. chk_prnt_count++;
  1465. // grd_sumlist.isSelected(i) = true;
  1466. // grd_sumlist.row = i;
  1467. grd_sumlist.setFocus();
  1468. ds_main_sumlist.rowposition = i;
  1469. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1470. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1471. }
  1472. }
  1473. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("L") >=0 ){
  1474. ds_hidden_srchinfo.setColumn(0,"prcpflag", "L");
  1475. fInSumList(); //마감시간별 미출력데이터 조회
  1476. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1477. chk_prnt_count++;
  1478. // grd_sumlist.isSelected(i) = true;
  1479. // grd_sumlist.row = i;
  1480. grd_sumlist.setFocus();
  1481. ds_main_sumlist.rowposition = i;
  1482. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1483. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1484. }
  1485. }
  1486. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("G") >=0 ){
  1487. ds_hidden_srchinfo.setColumn(0,"prcpflag", "G");
  1488. fInSumList(); //마감시간별 미출력데이터 조회
  1489. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1490. chk_prnt_count++;
  1491. // grd_sumlist.isSelected(i) = true;
  1492. // grd_sumlist.row = i;
  1493. grd_sumlist.setFocus();
  1494. ds_main_sumlist.rowposition = i;
  1495. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1496. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1497. }
  1498. }
  1499. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("E") >=0 ){
  1500. ds_hidden_srchinfo.setColumn(0,"prcpflag", "E");
  1501. fInSumList(); //마감시간별 미출력데이터 조회
  1502. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1503. chk_prnt_count++;
  1504. // grd_sumlist.isSelected(i) = true;
  1505. // grd_sumlist.row = i;
  1506. grd_sumlist.setFocus();
  1507. ds_main_sumlist.rowposition = i;
  1508. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1509. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1510. }
  1511. }
  1512. // 2011.02.09 pymi
  1513. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("B") >=0 ){
  1514. ds_hidden_srchinfo.setColumn(0,"prcpflag", "B");
  1515. fInSumList(); //마감시간별 미출력데이터 조회
  1516. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1517. chk_prnt_count++;
  1518. // grd_sumlist.isSelected(i) = true;
  1519. // grd_sumlist.row = i;
  1520. grd_sumlist.setFocus();
  1521. ds_main_sumlist.rowposition = i;
  1522. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1523. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1524. }
  1525. }
  1526. //(e)
  1527. // 임상
  1528. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("C2") >=0 ){
  1529. ds_hidden_srchinfo.setColumn(0,"prcpflag", "C2");
  1530. fInSumList(); //마감시간별 미출력데이터 조회
  1531. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1532. chk_prnt_count++;
  1533. // grd_sumlist.isSelected(i) = true;
  1534. // grd_sumlist.row = i;
  1535. grd_sumlist.setFocus();
  1536. ds_main_sumlist.rowposition = i;
  1537. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1538. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1539. }
  1540. }
  1541. ///인티팜 20181207
  1542. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("IT") >=0 ){
  1543. ds_hidden_srchinfo.setColumn(0,"prcpflag", "IT");
  1544. fInSumList(); //마감시간별 미출력데이터 조회
  1545. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1546. chk_prnt_count++;
  1547. // grd_sumlist.isSelected(i) = true;
  1548. // grd_sumlist.row = i;
  1549. grd_sumlist.setFocus();
  1550. ds_main_sumlist.rowposition = i;
  1551. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1552. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1553. }
  1554. }
  1555. ///비인티팜 20181207
  1556. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("IN") >=0 ){
  1557. ds_hidden_srchinfo.setColumn(0,"prcpflag", "IN");
  1558. fInSumList(); //마감시간별 미출력데이터 조회
  1559. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1560. chk_prnt_count++;
  1561. // grd_sumlist.isSelected(i) = true;
  1562. // grd_sumlist.row = i;
  1563. grd_sumlist.setFocus();
  1564. ds_main_sumlist.rowposition = i;
  1565. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1566. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1567. }
  1568. }
  1569. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("9") >=0 ){
  1570. ds_hidden_srchinfo.setColumn(0,"prcpflag", "9");
  1571. fInSumList(); //마감시간별 미출력데이터 조회
  1572. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1573. chk_prnt_count++;
  1574. // grd_sumlist.isSelected(i) = true;
  1575. // grd_sumlist.row = i;
  1576. grd_sumlist.setFocus();
  1577. ds_main_sumlist.rowposition = i;
  1578. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1579. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1580. }
  1581. }
  1582. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("8") >=0 ){
  1583. ds_hidden_srchinfo.setColumn(0,"prcpflag", "8");
  1584. fInSumList(); //마감시간별 미출력데이터 조회
  1585. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1586. chk_prnt_count++;
  1587. // grd_sumlist.isSelected(i) = true;
  1588. // grd_sumlist.row = i;
  1589. grd_sumlist.setFocus();
  1590. ds_main_sumlist.rowposition = i;
  1591. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1592. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1593. }
  1594. }
  1595. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("7") >=0 ){
  1596. ds_hidden_srchinfo.setColumn(0,"prcpflag", "7");
  1597. fInSumList(); //마감시간별 미출력데이터 조회
  1598. for(var i = 0; i < ds_main_sumlist.rowcount; i++){
  1599. chk_prnt_count++;
  1600. // grd_sumlist.isSelected(i) = true;
  1601. // grd_sumlist.row = i;
  1602. grd_sumlist.setFocus();
  1603. ds_main_sumlist.rowposition = i;
  1604. fPrntPatList(); //마감시간별 미출력환자데이터 조회
  1605. fPrcpMPSPrint("A", "lbl"); //라벨출력
  1606. }
  1607. }
  1608. }
  1609. if (ds_hidden_srchinfo.getColumn(0,"autoatcyn") =="Y") {
  1610. //ATC전송
  1611. ds_send_atcinfo.setColumn(0,"drugdd", ds_hidden_srchinfo.getColumn(0,"prcpdd"));
  1612. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("L") > -1 ) {
  1613. ds_send_atcinfo.setColumn(0,"drugflag", "L");
  1614. ds_send_atcinfo.setColumn(0,"instcd", ds_hidden_srchinfo.getColumn(0,"instcd"));
  1615. call_TXADT10202(); //ATC Data 전송(배치호출)
  1616. }
  1617. if ( ds_hidden_srchinfo.getColumn(0,"autoprntflag").indexOf("E") > -1 ) {
  1618. ds_send_atcinfo.setColumn(0,"drugflag", "E");
  1619. ds_send_atcinfo.setColumn(0,"instcd", ds_hidden_srchinfo.getColumn(0,"instcd"));
  1620. call_TXADT10202(); //ATC Data 전송(배치호출)
  1621. }
  1622. ds_send_atcinfo.setColumn(0,"drugflag", "I");
  1623. ds_send_atcinfo.setColumn(0,"instcd", ds_hidden_srchinfo.getColumn(0,"instcd"));
  1624. call_TXADT10202(); //ATC Data 전송(배치호출)
  1625. }
  1626. }
  1627. function fSleep(numberMillis) {
  1628. var now = new Date();
  1629. var exitTime = now.getTime() + numberMillis;
  1630. while (true) {
  1631. now = new Date();
  1632. if (now.getTime() > exitTime)
  1633. return;
  1634. }
  1635. }
  1636. /****************************************************************************************
  1637. * Argument : N/A
  1638. * Description : 투약번호 변경시
  1639. ****************************************************************************************/
  1640. function fChgDrugno(flag) {
  1641. var bResult = true;
  1642. if(flag == "first"){
  1643. var chk = ds_hidden_srchinfo.getColumn(0,"fst_drugno");
  1644. if(utlf_isNull(chk)){
  1645. ds_hidden_srchinfo.setColumn(0,"last_drugno", "");
  1646. bResult = false;
  1647. } else {
  1648. if(isNaN(chk)){
  1649. sysf_messageBox("투약번호는 숫자로","C001");
  1650. ds_hidden_srchinfo.setColumn(0,"fst_drugno", "");
  1651. bResult = false;
  1652. }
  1653. if(chk.length > 5){
  1654. sysf_messageBox("투약번호는 5자리미만으로","C001");
  1655. ds_hidden_srchinfo.setColumn(0,"fst_drugno", "");
  1656. bResult = false;
  1657. }
  1658. }
  1659. } else if(flag == "last"){
  1660. var chk_fst = ds_hidden_srchinfo.getColumn(0,"fst_drugno");
  1661. var chk_last = ds_hidden_srchinfo.getColumn(0,"fst_drugno");
  1662. if(utlf_isNull(chk_fst)){
  1663. sysf_messageBox("첫번째 투약번호부터","C001");
  1664. ds_hidden_srchinfo.setColumn(0,"last_drugno", "");
  1665. bResult = false;
  1666. } else {
  1667. if(isNaN(chk_fst)){
  1668. sysf_messageBox("투약번호는 숫자로","C001");
  1669. ds_hidden_srchinfo.setColumn(0,"fst_drugno", "");
  1670. bResult = false;
  1671. }
  1672. if(chk_fst.length > 5 ){
  1673. sysf_messageBox("투약번호는 5자리미만으로","C001");
  1674. ds_hidden_srchinfo.setColumn(0,"fst_drugno", "");
  1675. bResult = false;
  1676. }
  1677. if(isNaN(chk_last)){
  1678. sysf_messageBox("투약번호는 숫자로","C001");
  1679. ds_hidden_srchinfo.setColumn(0,"last_drugno", "");
  1680. bResult = false;
  1681. }
  1682. if(chk_last.length > 5 ){
  1683. sysf_messageBox("투약번호는 5자리미만으로","C001");
  1684. ds_hidden_srchinfo.setColumn(0,"last_drugno", "");
  1685. bResult = false;
  1686. }
  1687. }
  1688. }
  1689. return bResult;
  1690. }
  1691. function fErrMsg () {
  1692. var errorMsgPath = "/root/properties/error";
  1693. if ( model.getValue ( "/root/properties/error/type" ) == "error" ) {
  1694. window.load("../../../com/commonweb/xrw/SPZZZ00100_시스템에러.xrw","modeless","","width:514px;height:198px;align:center;","/root/properties/error","/root/main");
  1695. }
  1696. }
  1697. /****************************************************************************************
  1698. * Argument : N/A
  1699. * Description : 네임카드 출력
  1700. ****************************************************************************************/
  1701. function fPatLblPrint() {
  1702. var oParam = {};
  1703. oParam.id = "TRADT10215";
  1704. oParam.service = "pharmacyprescriptionapp.DrugPrint";
  1705. oParam.method = "reqGetPatLblData";
  1706. oParam.inds = "req=ds_send_prcpinfo";
  1707. oParam.outds = "ds_temp_prntpat_prcpdrug=prcpdrug";
  1708. oParam.async = false;
  1709. //oParam.callback = "cf_TRADT10215";
  1710. tranf_submit(oParam);
  1711. // var commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind")
  1712. //프린터 포트명, 혹은 네트웍 공유 프린터 명
  1713. // if(commkind == "01") {
  1714. // CommAX1.PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  1715. // }
  1716. // var iPoint = 0;
  1717. for(var iPoint = 0; iPoint < ds_temp_prntpat_prcpdrug.rowcount ; iPoint++) {
  1718. if(!utlf_isNull(ds_temp_prntpat_prcpdrug.getColumn(iPoint,"pid"))) {
  1719. //////////////////////////////////////////////////
  1720. // 라벨 상단내용 //
  1721. //////////////////////////////////////////////////
  1722. //병동
  1723. ds_temp_prntpat_prcpdrug.setColumn(iPoint,"wardnm" ,dsf_getColumnNullToEmpty(ds_temp_prntpat_prcpdrug, iPoint, "wardnm")+ " / " + dsf_getColumnNullToEmpty(ds_temp_prntpat_prcpdrug, iPoint, "roomcd"));
  1724. //환자번호
  1725. ds_temp_prntpat_prcpdrug.setColumn(iPoint,"pid", "등록번호:" + ds_temp_prntpat_prcpdrug.getColumn(iPoint,"pid") );
  1726. //진료과
  1727. ds_temp_prntpat_prcpdrug.setColumn(iPoint,"orddeptnm" , dsf_getColumnNullToEmpty(ds_temp_prntpat_prcpdrug,iPoint,"orddeptnm") + "/" + dsf_getColumnNullToEmpty(ds_temp_prntpat_prcpdrug,iPoint,"medispclidnm") + "/" + dsf_getColumnNullToEmpty(ds_temp_prntpat_prcpdrug,iPoint,"atdoctidnm") );
  1728. //라벨출력일
  1729. var lbldate = utlf_getCurrentDate();
  1730. lbldate = lbldate.toDate().getDateFormat("YYYY/MM/DD") ;
  1731. //model.makeValue("/root/temp/prntpat/prcpdrug["+iPoint+"]/lbldate" , lbldate);
  1732. dsf_makeValue(ds_temp_prntpat_prcpdrug,"lbldate","string",lbldate,iPoint);
  1733. }
  1734. }
  1735. // makeReportIViewer(0,0,10, 10, arguments[0]);
  1736. // fPrintRex("RFADT10310", "undefined", "undefined", "undefined", "undefined", "undefined", arguments[0]);
  1737. rptf_printRexbar("RFADT10310", "", "/root/temp/prntpat/prcpdrug", ds_temp_prntpat_prcpdrug);
  1738. }
  1739. // function makeReportIViewer(left, top, width, height, iViewerName){
  1740. // if(left==null || top==null || width==null || height==null){
  1741. // sysf_messageBox("미리보기 크기정보가", "I004");
  1742. // }else{
  1743. // if(iViewerName != null && iViewerName != ""){
  1744. // if(document.all("ivr_"+iViewerName) == null){
  1745. // if(document.all("grp_biz") == null){
  1746. // body.createChild("xforms:iviewer", "id:ivr_"+iViewerName+"; src:../../../com/commonweb/xrw/SPZUR00100_보고서.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
  1747. // "px;");
  1748. // }else{
  1749. // 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+
  1750. // "px;");
  1751. // }
  1752. // model.refresh();
  1753. // }
  1754. // }
  1755. // }
  1756. // }
  1757. // function fPrintRex(rexnm, closeYn, printCount, dataXPath, paramsXPath, infoXPath, parentId){
  1758. // var posx = '';
  1759. // var posy = '';
  1760. // var printnm = '';
  1761. //
  1762. // if(infoXPath == "" || infoXPath == "undefined" || infoXPath == null) infoXPath = "/root/main/barcdprntsetup/prntsetupinfo";
  1763. //
  1764. // if(model.getValue(infoXPath + "/setupinfo/rexgbn") != "1") return false;
  1765. //
  1766. // try{
  1767. // if(model.getXpathValue("count(" + infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/barnm)") > "0"){
  1768. // posx = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/xpos");
  1769. // posy = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/ypos");
  1770. // printnm = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/prtnm");
  1771. // }else{
  1772. // posx = model.getValue(infoXPath + "/setupinfo/blank/left");
  1773. // posy = model.getValue(infoXPath + "/setupinfo/blank/top");
  1774. // printnm = model.getValue(infoXPath + "/setupinfo/comm01/setupval");
  1775. // }
  1776. //
  1777. // if(posx == '') posx = "0";
  1778. // if(posy == '') posy = "0";
  1779. //
  1780. // if(closeYn == "true") printnm = "";
  1781. //
  1782. // exeRexPreview(rexnm, 'XMLSTR', paramsXPath, '', printnm,
  1783. // '', '', '', '', '',
  1784. // '', parentId, '', '', '',
  1785. // printCount, '', 'offsetx=' + posx + ';offsety=' + posy + ';', dataXPath, '',
  1786. // '');
  1787. // }
  1788. // catch(e){
  1789. // alert("출력시 오류가 발생하였습니다\n" + e);
  1790. // return true;
  1791. // }
  1792. //
  1793. // return true;
  1794. // }
  1795. // function exeRexPreview(rid, dataType, paramsXPath, submitId, print, printDialog, fileType, fileName, fileDialog, closeYn, monNo, parentObjId, printPaperBin, userService, showButton, printCount, zoomRate, printOption, dataXPath, mainDataXPath, subDataXPath)
  1796. // {
  1797. // var reportNode = instance1.selectSingleNode(gvReportPath);
  1798. //
  1799. // var syscd = getSystemCd();
  1800. // syscd = syscd.substr(3,3);
  1801. // //if(syscd == "888" || syscd == "999" || syscd == "") syscd = "001";
  1802. // if(syscd == "") syscd = "001";
  1803. //
  1804. // //레포트 관련 내용 초기화
  1805. // if(reportNode != null){
  1806. // model.removeNodeset(gvReportPath);
  1807. // }
  1808. //
  1809. // model.makeNode(gvReportPath);
  1810. // model.makeNode(gvReportParamsPath);
  1811. // model.makeNode(gvReportPropsPath);
  1812. // model.makeNode(gvReportOptionsPath);
  1813. // paramsXPath = instance1.selectSingleNode(paramsXPath);
  1814. // if(paramsXPath != null){
  1815. // model.copyNode(gvReportParamsPath, paramsXPath);
  1816. // }
  1817. //
  1818. // model.makeValue(gvReportParamsPath+"/userid", getUserId());
  1819. // model.makeValue(gvReportParamsPath+"/logoimgurl", getImageURL("error_logo"+getLogoImageKey()));
  1820. // model.makeValue(gvReportParamsPath+"/url", rid);
  1821. //
  1822. // model.makeValue(gvReportPropsPath+"/rex_rptname", rid);
  1823. // model.makeValue(gvReportPropsPath+"/rex_datatype", dataType);
  1824. // model.makeValue(gvReportPropsPath+"/rex_submitid", submitId);
  1825. // model.makeValue(gvReportPropsPath+"/rex_userservice", userService);
  1826. // model.makeValue(gvReportPropsPath+"/rex_data_xpath", dataXPath);
  1827. // model.makeValue(gvReportPropsPath+"/rex_xpath", mainDataXPath);
  1828. // model.makeValue(gvReportPropsPath+"/rex_xpath1", subDataXPath);
  1829. //
  1830. // model.makeValue(gvReportOptionsPath+"/rex_print", print);
  1831. // model.makeValue(gvReportOptionsPath+"/rex_printdialog", printDialog);
  1832. // model.makeValue(gvReportOptionsPath+"/rex_printpaperbin", printPaperBin);
  1833. // model.makeValue(gvReportOptionsPath+"/rex_filetype", fileType);
  1834. // model.makeValue(gvReportOptionsPath+"/rex_filename", fileName);
  1835. // model.makeValue(gvReportOptionsPath+"/rex_filedialog", fileDialog);
  1836. // model.makeValue(gvReportOptionsPath+"/rex_close", closeYn);
  1837. // model.makeValue(gvReportOptionsPath+"/rex_showbutton", showButton);
  1838. // model.makeValue(gvReportOptionsPath+"/rex_printcount", printCount);
  1839. // model.makeValue(gvReportOptionsPath+"/rex_zoomrate", zoomRate);
  1840. // model.makeValue(gvReportOptionsPath+"/rex_printoption", printOption);
  1841. //
  1842. // if(parentObjId == null || parentObjId == ""){
  1843. // if(document.all("ivr_report") == null){
  1844. // //popup
  1845. // setParameter("onready","true");
  1846. // modal("SPZUR00100", monNo);
  1847. // }else{
  1848. // //iviewer
  1849. // ivr_report.window.javascript.fInitRexpert();
  1850. // }
  1851. // }else{
  1852. // var parentObj = document.all("ivr_"+parentObjId);
  1853. // if(parentObj != null){
  1854. // var childObj = document.all("ivr_"+parentObjId);
  1855. //
  1856. // if(childObj != null){
  1857. // gCurrPrtObj = "ivr_"+parentObjId; //삭제할 viewer를 현재 출력 obj변수에 설정하고.. 프린트 끝난후 현재변수의 Iviewer를 삭제
  1858. // childObj.window.javascript.fInitRexpert();
  1859. // }
  1860. // }
  1861. // }
  1862. // }
  1863. /**
  1864. 생성된 IViewer삭제
  1865. **/
  1866. // function cleanIViewer() {
  1867. // if (arguments[0] == "undefined" || arguments[0] == undefined) { //파라미터가 없으면 현재 gCurrPrtObj변수로 IViewer를 삭제하고
  1868. // var o = document.all("ivr_"+gCurrPrtObj);
  1869. // if (o != null) {
  1870. // body.removeChild("ivr_"+gCurrPrtObj);
  1871. // }
  1872. // } else { //파라미터가 존재하면 파라미터 배열의 IViewer를 삭제함
  1873. // if (arguments[0].indexOf("|") != -1)
  1874. // return;
  1875. //
  1876. // var arr = arguments[0].split("|");
  1877. // for (var i in arr) {
  1878. // var o = document.all("ivr_"+arr[i]);
  1879. // if (o != null) {
  1880. // body.removeChild("ivr_"+arr[i]);
  1881. // }
  1882. // }
  1883. // }
  1884. // gCurrPrtObj = null;
  1885. // }]]></Script>