SPADT63300.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  1. /**
  2. * 파 일 명 : SPADT63300.js
  3. * 설 명 : (팝업)특조라벨출력 Javascriot
  4. * 설 계 자 : 이훈재
  5. * 작 성 자 : 이훈재
  6. * 수정이력 : 2007.09.29 / 최초작성 / 이훈재
  7. */
  8. var sSndMsg = ""; //라벨출력내용
  9. var iPoint = 0; //라벨출력row
  10. var iCnt = 0; //라벨출력매수
  11. var iImageCnt = 0; //라벨그래픽폰트수
  12. var gTimer = null;
  13. /**
  14. * 초기화
  15. */
  16. function fInit() {
  17. var sParam = model.getAttribute("params");
  18. model.makeValue("/root/send/prcpinfo/drugdd", astfMatrixData(sParam, 1, 0));
  19. model.makeValue("/root/send/prcpinfo/drugno", astfMatrixData(sParam, 1, 1));
  20. model.makeValue("/root/send/prcpinfo/ioflag", astfMatrixData(sParam, 1, 2));
  21. model.makeValue("/root/send/prcpinfo/prcpdd", astfMatrixData(sParam, 1, 3));
  22. model.makeValue("/root/send/prcpinfo/orddd", astfMatrixData(sParam, 1, 4));
  23. model.makeValue("/root/send/prcpinfo/cretno", astfMatrixData(sParam, 1, 5));
  24. model.makeValue("/root/send/prcpinfo/prcpgenrflag", astfMatrixData(sParam, 1, 6));
  25. model.makeValue("/root/send/prcpinfo/pid", astfMatrixData(sParam, 1, 7));
  26. model.makeValue("/root/send/prcpinfo/orddeptcd", astfMatrixData(sParam, 1, 8));
  27. model.makeValue("/root/send/prcpinfo/wardcd", astfMatrixData(sParam, 1, 9));
  28. model.makeValue("/root/send/prcpinfo/lblflag", astfMatrixData(sParam, 1, 10));
  29. model.makeValue("/root/send/prcpinfo/prcpflag", astfMatrixData(sParam, 1, 11));
  30. model.makeValue("/root/send/prcpinfo/prntflag", astfMatrixData(sParam, 1, 12));
  31. model.makeValue("/root/send/prcpinfo/drugflag", astfMatrixData(sParam, 1, 13));
  32. model.makeValue("/root/send/prcpinfo/prcpno", astfMatrixData(sParam, 1, 14));
  33. model.makeValue("/root/send/prcpinfo/prcpmixno", astfMatrixData(sParam, 1, 15));
  34. model.makeValue("/root/send/prcpinfo/spclblflag", astfMatrixData(sParam, 1, 16)); // 20100322_laboru.
  35. model.refresh();
  36. if(model.getValue("/root/send/prcpinfo/prcpflag") == "B"){
  37. submit("TRADT63302");
  38. if(model.getValue("/root/main/lbllist/lbllist["+1+"]/pid") != ""){
  39. fLBLChildTPNPrint();
  40. }
  41. } else {
  42. submit("TRADT63301");
  43. if(model.getValue("/root/main/lbllist/lbllist["+1+"]/drugno") != ""){
  44. fLBLPrint();
  45. }
  46. }
  47. model.refresh();
  48. gTimer = window.setInterval("fStopTimer()",20000);
  49. window.close();
  50. }
  51. /**
  52. *
  53. */
  54. function fStopTimer() {
  55. window.clearinterval(gTimer);
  56. }
  57. /**
  58. * 라벨출력
  59. */
  60. function fLBLPrint() {
  61. /*
  62. 라벨 Sorting 로직
  63. //mgt에서 vo로 리턴
  64. 대분류
  65. - 내복약, 외용약, 주사, 항암제, TPN, 마약,
  66. 중분류
  67. - 방법코드
  68. 소분류
  69. - 내복약,외용약(방법코드), 주사,마약,항암제(mix)
  70. web js 출력로직
  71. 1. mix가 있는경우
  72. 같은mix번호들만 모아서 한라벨에 출력
  73. 2. mix가 없는경우
  74. 2.1 내복약
  75. 2.1.1 라벨그룹
  76. 2.1.1.1 방법코드
  77. 2.2 외용약
  78. 2.2.1 라벨그룹
  79. 2.2.1.1 방법코드
  80. 2.3 주사약
  81. 2.3.1 라벨그룹
  82. 2.4 마약
  83. 2.4.1 방법코드
  84. */
  85. var iBfPoint = 0;
  86. var sPointChk = "N";
  87. var sMixno5 = "";
  88. var sMixno6 = "";
  89. var bCheck = false;
  90. /*
  91. //Comm 설정
  92. CommAX.CommPort = "1"; // 출력 Port
  93. CommAX.Settings = "9600,n,8,1"; // Comm 설정
  94. CommAX.Settings = "127.0.0.1"; // Comm 설정
  95. */
  96. var iChaTotCnt = 0;
  97. var iTotPrcpTimes = 0;
  98. PrnKind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  99. var commkind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/commkind")
  100. if ( PrnKind ==7 ) {
  101. CommAX.PrnKind =4;
  102. } else {
  103. CommAX.PrnKind =PrnKind;
  104. }
  105. if(commkind == "02") {
  106. CommAX.PortNm = 1;
  107. } else {
  108. CommAX.PortNm = 2;
  109. }
  110. if(commkind == "01") {
  111. CommAX.PrtNm = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  112. }
  113. var reprint = "";
  114. //if ( CommAX.PortOpen() == true) {
  115. //alert("라벨 프린트 Open");
  116. //CommAX.SendMessage("^XA^SEE:UHANGUL.DAT^FS^CWQ,E:AAAAA.FNT^FS^CI26^FO100,50^AQN,40,40^FD이훈재ABCDEFGHI1234^FS^FO100,100^AQN,40,40^FD(주)한글인쇄테스트ABCDEFGHI1234^FS^FO100,150^AQN,40,40^FD A B C D E F G H I^FS^CI0^FO100,200^A0,50,50^FDPRINTING TEST^FS^FO100,250^BY2^B3N,N,100,Y,N,N^FD1232423423^FS^XZ");
  117. //CommAX.SendMessage("^XA^LH0,0^PRB^CF0,89^FO10,05^FDSH07^FS^CF0,70^FO260,05^FD10/10^FS^CF0,89^FO50,80^FD- 234567^FS^CFA20,20^FO10,150^FD1234567890^FS~DGGRAPH001,00504,021,0078000000E00000800000F01E000C00201FFC0000003C0000007007FFC00000F01E000C00201FFC000000006000003003000000C0701C00180060180C03000FFFF00FFE3003000000C0701C00180060180C0300061000061C300300000300783C003001E0101800C0007E000018300300C00300783C003001E0101800C000C30000303001FFE006006C6C006003600018006001818000603000180006006C6C006003600018006000C30000C03000180004006C6C00C0066000300020007E0001803000180004006C6C00C006600030002000180003003000181E0C0066CC0180186000600030001800060030FFFFFF0C0066CC018018600060003000181E1800207000000C00638C0300306000C00030FFFFFF0000000000000C00638C0300306000C000307000000000000000000400638C060060600180002000000000FFF00038000400638C0600606001800020007E00006060007E000600610C0C007FFC0180006000C30000006000C3000600610C0C007FFC018000600181800000400181800300600C18000060018000C001818000FFE00181800300600C18000060018000C001818000600001818000C0F03E300001F80180030000C30000600000C30000C0F03E300001F801800300007E00006060007E00000000000000000000000000003800003FF0003800000000000000000000000000^FO140,150^XGGRAPH001,1,1^FS~DGGRAPH002,00216,009,0000700000000001C00000380000000000E00000180000000000600000180000000000600FFF1807FFE0000060060E180300C03FFC60001C180000C0181C60003018000080001C600060180FFFC000186000D018070000001860018C180300000C18600307180300C006106606031801FFE006207F18001800000006006000001801860006036000001800C300061C6000001000C300FFE06000E00000C30070006000300000C31E000060003000FFFFFF000060003000700000000060003018000000000060001FFC000000000060000000000000000040^FO320,150^XGGRAPH002,1,1^FS^CFA20,20^FO10,180^FD2007-04-25^FS~DGGRAPH003,00240,010,002001E00000E0000080002001E000007007FFC0006006380000300300000060063800303003000001E00C1830183003000001E00C181818300300C003600800181BF001FFE0036008001FF830001800066018001818300018000660180018183000180018601BF0181BF000181E18601BF01FF830FFFFFF30601C1810103070000030601C180000200000006060180C0000000000006060180C0007000038007FFC0C0C000FC0007E007FFC0C0C00186000C30000600E1800303001818000600E1800303001818001F803E000303001818001F803E000186000C30000000000000FC0007E0000000000000700003800^FO140,180^XGGRAPH003,1,1^FS^CFE10,10^FO10,210^FDStomach 2/10^FS^CFA20,20^FO10,240^FDBiopsh^FS^PQ1^XZ");
  118. //CommAX.PortClose();
  119. //return;
  120. var sumcls ="";
  121. var ioflag = "";
  122. for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
  123. if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls")!=""){
  124. sumcls =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  125. ioflag =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ioflag");
  126. }
  127. }
  128. for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
  129. var sMixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
  130. if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
  131. reprint ="(재)";
  132. }
  133. //차광일 경우 2매 출력
  134. if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd2nm") == "차광"){
  135. iChaTotCnt = 2;
  136. } else {
  137. iChaTotCnt = 1;
  138. if(sMixno != "-" && sMixno != ""){
  139. if(sumcls != "T" && sumcls != "Q" && sumcls != "B"){
  140. bCheck = false;
  141. sMixno5 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
  142. for(var iBCnt = iPoint; iBCnt <= getNodesetCount("/root/main/lbllist/lbllist") ; iBCnt++){
  143. sMixno6 = model.getValue("/root/main/lbllist/lbllist["+iBCnt+"]/prcpmixno");
  144. if(sMixno5 == sMixno6){
  145. if (model.getValue("/root/main/lbllist/lbllist["+iBCnt+"]/keepmthd2nm") !=""){
  146. iChaTotCnt = 2;
  147. break;
  148. }
  149. } else {
  150. bCheck = true;
  151. }
  152. if(bCheck){
  153. break;
  154. }
  155. }
  156. }
  157. }
  158. }
  159. iTotPrcpTimes = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  160. //차광일 경우 2매 출력
  161. sPointChk = "N";
  162. for(var iChaCnt = 1 ; iChaCnt <= iChaTotCnt ; iChaCnt++) {
  163. //처방회수 만큼 출력한다.
  164. for(var iCntPrcpTimes = 1 ; iCntPrcpTimes <= iTotPrcpTimes ; iCntPrcpTimes++) {
  165. //재출력시 동일한 리스트를 출력하기 위해 iPoint를 이전 위치로 돌림.
  166. if(sPointChk == "Y") {
  167. iPoint = iBfPoint;
  168. } else {
  169. iBfPoint = iPoint;
  170. }
  171. //시작(X, Y)
  172. sSndMsg += astfStartFormat(0, 0);
  173. //라벨이름
  174. if(sumcls == "T"){
  175. sSndMsg += astfPrintOut(20, 25, 5, "[TPN]","");
  176. } else if(sumcls == "B"){
  177. sSndMsg += astfPrintOut(20, 25, 5, "[소아TPN]","");
  178. } else if(sumcls == "D"){
  179. sSndMsg += astfPrintOut(20, 25, 5, "[항암제]","");
  180. } else if(sumcls == "Q"){
  181. sSndMsg += astfPrintOut(20, 25, 5, "[TPN]","");
  182. } else if(sumcls == "1"){
  183. sSndMsg += astfPrintOut(20, 25, 5, "[면역억제제]","");
  184. } else {// if(sumcls == "C"){
  185. sSndMsg += astfPrintOut(20, 25, 5, "[무균조제]","");
  186. }
  187. if(PrnKind == "2") {
  188. //처방일자
  189. sSndMsg += astfPrintOut(500, 25, 3, fGetDateString(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd")),"");
  190. } else {
  191. //처방일자
  192. sSndMsg += astfPrintOut(400, 25, 3, fGetDateString(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd")),"");
  193. }
  194. //현재페이지/전체페이지
  195. if(iTotPrcpTimes > 1) {
  196. sSndMsg += astfPrintOut(750, 25, 3, iCntPrcpTimes + "-" + iTotPrcpTimes,"");
  197. }
  198. //병실
  199. sSndMsg += astfPrintOut(20, 70, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),"");
  200. //sSndMsg += astfPrintOut(20, 70, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/orddeptnm"),"");
  201. // 외래 항암제 진료과
  202. if(sumcls == "D" && ioflag == "O"){
  203. if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd") == "") {
  204. sSndMsg += astfPrintOut(20, 70, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/orddeptnm"),"");
  205. }
  206. }
  207. //투약번호
  208. sSndMsg += astfPrintOut(290, 25, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno") + reprint,"");
  209. //환자이름
  210. sSndMsg += astfPrintOut(180, 70, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),"");
  211. //환자번호
  212. sSndMsg += astfPrintOut(400, 70, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid"),"");
  213. //선그리기
  214. sSndMsg += astfGraphicBox(5, 110, 815, 0, 4);
  215. //return;
  216. if(sMixno != "-" && sMixno != ""){
  217. if(sumcls == "T" || sumcls == "Q"){
  218. fTPNDrugMixLBL(sumcls, iChaCnt, iChaTotCnt);
  219. } else if(sumcls == "B"){
  220. fTPNDrugMixLBL(sumcls, iChaCnt, iChaTotCnt);
  221. } else {//if(sumcls == "D"){
  222. fAntimeticsMixLBL(iChaCnt, iChaTotCnt);
  223. }
  224. } else {
  225. if(sumcls == "T" || sumcls == "Q"){
  226. fTPNDrugLBL(sumcls, iChaCnt, iChaTotCnt);
  227. } else if(sumcls == "B"){
  228. fTPNDrugLBL(sumcls, iChaCnt, iChaTotCnt);
  229. } else {// if(sumcls == "D"){
  230. fAntimeticsLBL(iChaCnt, iChaTotCnt);
  231. }
  232. }
  233. if((iChaCnt != iChaTotCnt) || (iCntPrcpTimes != iTotPrcpTimes)) {
  234. sPointChk = "Y";
  235. } else {
  236. sPointChk = "N";
  237. }
  238. sSndMsg += astfEndFormat(1);
  239. CommAX.SendMsg(sSndMsg);
  240. sSndMsg = "";
  241. }
  242. }
  243. }
  244. //CommAX.PortClose();
  245. model.refresh();
  246. //}
  247. }
  248. /**
  249. * mix 라벨
  250. */
  251. function fTPNDrugMixLBL(sc, pChaCnt, pChaTotCnt) {
  252. var sMixno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
  253. var cnt = 0;
  254. var bContinue = false;
  255. var lblCnts2 ="";
  256. var tims = 0;
  257. var keepmthdnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthdnm");
  258. var keepmthd2nm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd2nm");
  259. var keepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd");
  260. var lblCnts1 =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1");
  261. var valitime =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/valitime");
  262. var drugDD = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugdd");
  263. tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  264. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  265. sMixno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpmixno");
  266. var qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty");
  267. var qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit");
  268. var stndvol = model.getValue("/root/main/lbllist/lbllist["+j+"]/stndvol");
  269. var stndunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/stndunit");
  270. var cntsvol = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntsvol");
  271. var cntsunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntsunit");
  272. // tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
  273. var dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  274. var sumcls = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls");
  275. if(sMixno1 == sMixno2){
  276. //
  277. sSndMsg += astfPrintOut(20, 130+(cnt*30), 3, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  278. if(PrnKind == "2") {
  279. //
  280. sSndMsg += astfPrintOut(170, 130+(cnt*30), 2, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm").substring(0, 9),"");
  281. } else {
  282. //
  283. sSndMsg += astfPrintOut(170, 130+(cnt*30), 2, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm").substring(0, 11),"");
  284. }
  285. //
  286. sSndMsg += astfPrintOut(390, 130+(cnt*30), 3, cntsvol);
  287. //
  288. sSndMsg += astfPrintOut(480, 130+(cnt*30), 3, cntsunit);
  289. //
  290. sSndMsg += astfPrintOut(540, 130+(cnt*30), 3, qty);
  291. //
  292. sSndMsg += astfPrintOut(630, 130+(cnt*30), 3, qtyunit);
  293. //
  294. sSndMsg += astfPrintOut(690, 130+(cnt*30), 3, stndvol);
  295. //
  296. sSndMsg += astfPrintOut(780, 130+(cnt*30), 3, stndunit);
  297. cnt++;
  298. } else {
  299. bContinue = true;
  300. }
  301. if(cnt == 5 || bContinue){
  302. break;
  303. }
  304. }
  305. iPoint = j-1;
  306. if ( sc !="Q" ){
  307. sSndMsg += astfPrintOut(20, 460, 3, "조제후("+valitime +") 시간이내투여","");
  308. }
  309. sSndMsg += astfPrintOut(440, 460, 3, keepmthdnm,"");
  310. sSndMsg += astfPrintOut(610, 500, 3, keepmthd2nm,"");
  311. if(pChaTotCnt > 1) {
  312. sSndMsg += astfPrintOut(660, 500, 3, pChaCnt + "/" + pChaTotCnt,"");
  313. }
  314. sSndMsg += astfPrintOut(20, 500, 3,"조제일자 : " + fGetDateString(drugDD) ,"");
  315. sSndMsg += astfPrintOut(20, 540, 3, lblCnts1 ,"");
  316. /*
  317. //출력 페이지수를 표시하기 위하여 상위(fLBLPrint)에서 for문으로 처리.
  318. //종료(매수) 차광은 2매
  319. if ( keepmthd2nm == "차광"){
  320. sSndMsg += astfEndFormat(2*tims);
  321. } else {
  322. sSndMsg += astfEndFormat(tims);
  323. }
  324. */
  325. }
  326. /**
  327. * TPN 라벨
  328. */
  329. function fTPNDrugLBL(sc, pChaCnt, pChaTotCnt) {
  330. var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  331. var cnt = 0;
  332. var bContinue = false;
  333. var lblCnts2 ="";
  334. var tims = 0;
  335. var keepmthdnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthdnm");
  336. var keepmthd2nm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd2nm");
  337. var keepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd");
  338. var lblCnts1 =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1");
  339. var valitime =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/valitime");
  340. var drugDD = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugdd");
  341. tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  342. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  343. sSumCls2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls");
  344. var qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty");
  345. var qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit");
  346. var stndvol = model.getValue("/root/main/lbllist/lbllist["+j+"]/stndvol");
  347. var stndunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/stndunit");
  348. var cntsvol = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntsvol");
  349. var cntsunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntsunit");
  350. // tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
  351. var dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  352. var sumcls = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls");
  353. //var drugDD="";
  354. if(sSumCls1 == sSumCls2){
  355. //
  356. sSndMsg += astfPrintOut(20, 130+(cnt*30), 3, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  357. if(PrnKind == "2") {
  358. //
  359. sSndMsg += astfPrintOut(170, 130+(cnt*30), 2, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm").substring(0, 9),"");
  360. } else {
  361. //
  362. sSndMsg += astfPrintOut(170, 130+(cnt*30), 2, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm").substring(0, 11),"");
  363. }
  364. //
  365. sSndMsg += astfPrintOut(390, 130+(cnt*30), 3, cntsvol);
  366. //
  367. sSndMsg += astfPrintOut(480, 130+(cnt*30), 3, cntsunit);
  368. //
  369. sSndMsg += astfPrintOut(540, 130+(cnt*30), 3, qty);
  370. //
  371. sSndMsg += astfPrintOut(630, 130+(cnt*30), 3, qtyunit);
  372. //
  373. sSndMsg += astfPrintOut(690, 130+(cnt*30), 3, stndvol);
  374. //
  375. sSndMsg += astfPrintOut(780, 130+(cnt*30), 3, stndunit);
  376. cnt++;
  377. } else {
  378. bContinue = true;
  379. }
  380. //if(cnt == 5 || bContinue){
  381. if( bContinue){
  382. break;
  383. }
  384. }
  385. iPoint = j-1;
  386. if ( sc !="Q" ){
  387. sSndMsg += astfPrintOut(20, 460, 3, "조제후("+valitime +") 시간이내투여","");
  388. }
  389. sSndMsg += astfPrintOut(440, 500, 3, keepmthdnm,"");
  390. sSndMsg += astfPrintOut(610, 500, 3, keepmthd2nm,"");
  391. if(pChaTotCnt > 1) {
  392. sSndMsg += astfPrintOut(660, 500, 3, pChaCnt + "/" + pChaTotCnt,"");
  393. }
  394. sSndMsg += astfPrintOut(20, 500, 3,"조제일자 : " + fGetDateString(drugDD) ,"");
  395. sSndMsg += astfPrintOut(20, 540, 3, lblCnts1 ,"");
  396. /*
  397. //출력 페이지수를 표시하기 위하여 상위(fLBLPrint)에서 for문으로 처리.
  398. //종료(매수) 차광은 2매
  399. if ( keepmthd2nm == "차광"){
  400. sSndMsg += astfEndFormat(2*tims);
  401. } else {
  402. sSndMsg += astfEndFormat(tims);
  403. }
  404. */
  405. }
  406. function fAntimeticsMixLBL(pChaCnt, pChaTotCnt) {
  407. var sMixno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
  408. var cnt = 0;
  409. var bContinue = false;
  410. var lblCnts2 ="";
  411. var tims = 0;
  412. var keepmthdnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthdnm");
  413. var keepmthd2nm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd2nm");
  414. var keepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd");
  415. var lblCnts1 =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1");
  416. var valitime =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/valitime");
  417. var drugDD = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugdd");
  418. var voldivcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/voldivcd");
  419. var totqty = 0;
  420. var totstndvol = 0;
  421. var divcnt = 0;
  422. var totvolexptynCnt = 0 ; //2010-05-25 [요청번호:13894]-특수조제실 마스터에 총VOL제외 컬럼을 삽입하여 체크된 약품에 한해 라벨 출력시 총VOLUME 이 인쇄되지 않도록 처리
  423. tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  424. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  425. sMixno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpmixno");
  426. var qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty");
  427. var qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit");
  428. var stndvol = model.getValue("/root/main/lbllist/lbllist["+j+"]/stndvol");
  429. var stndunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/stndunit");
  430. var cntsvol = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntsvol");
  431. var cntsunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/cntsunit");
  432. // tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
  433. var dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  434. var sumcls = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls");
  435. var prcpdelivefact = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdelivefact");
  436. var voldivcd1 = "";
  437. var voldivcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/voldivcd");
  438. var basevol = model.getValue("/root/main/lbllist/lbllist["+j+"]/basevol");
  439. var basevolunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/basevolunit");
  440. if(sMixno1 == sMixno2){
  441. if ( model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthdnm") !=""){
  442. keepmthdnm = model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthdnm");
  443. }
  444. if ( model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthd2nm") !=""){
  445. keepmthd2nm = model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthd2nm");
  446. }
  447. if ( model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthd") !=""){
  448. keepmthd = model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthd");
  449. }
  450. if ( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblcnts1") !=""){
  451. lblCnts1 =model.getValue("/root/main/lbllist/lbllist["+j+"]/lblcnts1");
  452. }
  453. if ( model.getValue("/root/main/lbllist/lbllist["+j+"]/valitime") !=""){
  454. valitime =model.getValue("/root/main/lbllist/lbllist["+j+"]/valitime");
  455. }
  456. //
  457. sSndMsg += astfPrintOut(20, 130+(cnt*30), 3, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  458. if(PrnKind == "2") {
  459. //
  460. sSndMsg += astfPrintOut(170, 130+(cnt*30), 2, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm").substring(0, 9),"");
  461. } else {
  462. //
  463. sSndMsg += astfPrintOut(170, 130+(cnt*30), 2, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm").substring(0, 11),"");
  464. }
  465. //
  466. sSndMsg += astfPrintOut(390, 130+(cnt*30), 3, cntsvol);
  467. //
  468. sSndMsg += astfPrintOut(480, 130+(cnt*30), 3, cntsunit);
  469. //
  470. sSndMsg += astfPrintOut(540, 130+(cnt*30), 3, qty);
  471. //
  472. sSndMsg += astfPrintOut(630, 130+(cnt*30), 3, qtyunit);
  473. //
  474. sSndMsg += astfPrintOut(690, 130+(cnt*30), 3, stndvol);
  475. //
  476. sSndMsg += astfPrintOut(780, 130+(cnt*30), 3, stndunit);
  477. cnt++;
  478. /*if ( prcpdelivefact != "-" && prcpdelivefact != "" ) {
  479. if ( prcpdelivefact.substring(0,3) =="총용량") {
  480. sSndMsg += astfPrintOut(20, 130+(cnt*30), 3, " ","");
  481. //
  482. sSndMsg += astfPrintOut(170, 130+(cnt*30), 3, prcpdelivefact,"");
  483. cnt++;
  484. }
  485. }*/
  486. if(voldivcd2 != 0 && voldivcd1 != voldivcd2){
  487. voldivcd1 = voldivcd2;
  488. };
  489. if(voldivcd1 == voldivcd2){
  490. //총용량
  491. if(cntsunit != basevolunit) {//용량분할기준용량과 단위가 다를경우는 기준용량단위로 환산
  492. totqty += Number(basevol) * Number(qty);
  493. } else {
  494. totqty += Number(cntsvol);
  495. }
  496. //총 volume
  497. totstndvol += Number(stndvol);
  498. //2010-05-25 [요청번호:13894]-특수조제실 마스터에 총VOL제외 컬럼을 삽입하여 체크된 약품에 한해 라벨 출력시 총VOLUME 이 인쇄되지 않도록 처리
  499. if (model.getValue("/root/main/lbllist/lbllist["+j+"]/totvolexptyn") == "Y") {
  500. totvolexptynCnt++; // 처방코드중 하나라도 [총VOL제외]에 Check되어 있으면 총 Volume 출력하지 않는다.
  501. }
  502. //용량분할관리대상인 코드의 개수
  503. divcnt++;
  504. if( j < getNodesetCount("/root/main/lbllist/lbllist") ) {
  505. var idx = j+1;
  506. var voldivcd3 = model.getValue("/root/main/lbllist/lbllist["+ idx +"]/voldivcd");
  507. var sMixno3 = model.getValue("/root/main/lbllist/lbllist["+idx+"]/prcpmixno");
  508. if(divcnt > 1 && (sMixno2 != sMixno3 || voldivcd2 != voldivcd3 ) ){
  509. //2010-06-08 계산되어 지면서 소숫점아래의 숫자가 0.009999999999999 발생되는경우가 있음
  510. // (곱셈이라 0.00999999 발생될수 없은 상황인데.. 발생되고 있음 <<<10*0.963+50 = 59.629999999 발생됨>>>)
  511. // 그래서 강제로 4자리 반올림처리함.
  512. totqty = totqty.toString().getRound(-4, "HALF_UP");
  513. if(stndvol > 0) {//재구성농도가 있을경우만 volume 출력
  514. var cmt = "총용량 : " + totqty + " " + basevolunit + " 총 Volume : " + ((Math.floor(totstndvol * 1000))/1000) + " " + stndunit;
  515. } else {
  516. var cmt = "총용량 : " + totqty + " " + basevolunit;
  517. }
  518. //2010-05-25 [요청번호:13894]-특수조제실 마스터에 총VOL제외 컬럼을 삽입하여 체크된 약품에 한해 라벨 출력시 총VOLUME 이 인쇄되지 않도록 처리
  519. if ( totvolexptynCnt > 0 ) { // 처방코드중 하나라도 [총VOL제외]에 Check되어 있으면 총 Volume 출력하지 않는다.
  520. var cmt = "총용량 : " + totqty + " " + basevolunit;
  521. }
  522. sSndMsg += astfPrintOut(170, 130+(cnt*30), 3, cmt ,"");
  523. cnt++;
  524. totqty = 0;
  525. totstndvol = 0;
  526. divcnt = 0;
  527. totvolexptynCnt = 0; //2010-05-25 [요청번호:13894]-특수조제실 마스터에 총VOL제외 컬럼을 삽입하여 체크된 약품에 한해 라벨 출력시 총VOLUME 이 인쇄되지 않도록 처리
  528. }
  529. } else if(divcnt > 1 && (j = getNodesetCount("/root/main/lbllist/lbllist")) ){
  530. //2010-06-08 계산되어 지면서 소숫점아래의 숫자가 0.009999999999999 발생되는경우가 있음
  531. // (곱셈이라 0.00999999 발생될수 없은 상황인데.. 발생되고 있음 <<<10*0.963+50 = 59.629999999 발생됨>>>)
  532. // 그래서 강제로 4자리 반올림처리함.
  533. totqty = totqty.toString().getRound(-4, "HALF_UP");
  534. if(stndvol > 0) {//재구성농도가 있을경우만 volume 출력
  535. var cmt = "총용량 : " + totqty + " " + basevolunit + " 총 Volume : " + ((Math.floor(totstndvol * 1000))/1000) + " " + stndunit;
  536. } else {
  537. var cmt = "총용량 : " + totqty + " " + basevolunit ;
  538. }
  539. //2010-05-25 [요청번호:13894]-특수조제실 마스터에 총VOL제외 컬럼을 삽입하여 체크된 약품에 한해 라벨 출력시 총VOLUME 이 인쇄되지 않도록 처리
  540. if ( totvolexptynCnt > 0 ) { // 처방코드중 하나라도 [총VOL제외]에 Check되어 있으면 총 Volume 출력하지 않는다.
  541. var cmt = "총용량 : " + totqty + " " + basevolunit;
  542. }
  543. sSndMsg += astfPrintOut(170, 130+(cnt*30), 3, cmt ,"");
  544. cnt++;
  545. totqty = 0;
  546. totstndvol = 0;
  547. divcnt = 0;
  548. totvolexptynCnt = 0; //2010-05-25 [요청번호:13894]-특수조제실 마스터에 총VOL제외 컬럼을 삽입하여 체크된 약품에 한해 라벨 출력시 총VOLUME 이 인쇄되지 않도록 처리
  549. }
  550. }
  551. } else {
  552. bContinue = true;
  553. }
  554. //if(cnt == 5 || bContinue){
  555. if(bContinue){
  556. break;
  557. }
  558. }
  559. iPoint = j-1;
  560. sSndMsg += astfPrintOut(20, 500, 3, "조제후("+valitime +") 시간이내투여","");
  561. sSndMsg += astfPrintOut(440, 540, 3, keepmthdnm,"");
  562. sSndMsg += astfPrintOut(610, 540, 3, keepmthd2nm,"");
  563. if(pChaTotCnt > 1) {
  564. sSndMsg += astfPrintOut(660, 540, 3, pChaCnt + "/" + pChaTotCnt,"");
  565. }
  566. sSndMsg += astfPrintOut(20, 540, 3,"조제일자 : " + fGetDateString(drugDD) ,"");
  567. sSndMsg += astfPrintOut(20, 580, 3, lblCnts1 ,"");
  568. /*
  569. //출력 페이지수를 표시하기 위하여 상위(fLBLPrint)에서 for문으로 처리.
  570. //종료(매수) 차광은 2매
  571. if ( keepmthd2nm == "차광"){
  572. sSndMsg += astfEndFormat(2*tims);
  573. } else {
  574. sSndMsg += astfEndFormat(tims);
  575. }
  576. */
  577. }
  578. /**
  579. * 항암제 라벨
  580. */
  581. function fAntimeticsLBL(pChaCnt, pChaTotCnt) {
  582. var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  583. var cnt = 0;
  584. var bContinue = false;
  585. var lblCnts2 ="";
  586. var tims = 0;
  587. var keepmthdnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthdnm");
  588. var keepmthd2nm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd2nm");
  589. var keepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd");
  590. var lblCnts1 =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1");
  591. var valitime =model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/valitime");
  592. var drugDD = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugdd");
  593. sSumCls2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  594. var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
  595. var qtyunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqtyunit");
  596. var stndvol = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/stndvol");
  597. var stndunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/stndunit");
  598. var cntsvol = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/cntsvol");
  599. var cntsunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/cntsunit");
  600. tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  601. var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");
  602. var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  603. //var drugDD="";
  604. //
  605. sSndMsg += astfPrintOut(20, 130+(cnt*30), 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd"),"");
  606. if(PrnKind == "2") {
  607. //
  608. sSndMsg += astfPrintOut(170, 130+(cnt*30), 2, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm").substring(0, 9),"");
  609. } else {
  610. //
  611. sSndMsg += astfPrintOut(170, 130+(cnt*30), 2, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm").substring(0, 11),"");
  612. }
  613. //
  614. sSndMsg += astfPrintOut(390, 130+(cnt*30), 3, cntsvol);
  615. //
  616. sSndMsg += astfPrintOut(480, 130+(cnt*30), 3, cntsunit);
  617. //
  618. sSndMsg += astfPrintOut(540, 130+(cnt*30), 3, qty);
  619. //
  620. sSndMsg += astfPrintOut(630, 130+(cnt*30), 3, qtyunit);
  621. //
  622. sSndMsg += astfPrintOut(690, 130+(cnt*30), 3, stndvol);
  623. //
  624. sSndMsg += astfPrintOut(780, 130+(cnt*30), 3, stndunit);
  625. //iPoint = j-1;
  626. if(valitime != "") {
  627. sSndMsg += astfPrintOut(20, 460, 3, "조제후("+valitime +") 시간이내투여","");
  628. }
  629. sSndMsg += astfPrintOut(440, 540, 3, keepmthdnm,"");
  630. sSndMsg += astfPrintOut(610, 540, 3, keepmthd2nm,"");
  631. if(pChaTotCnt > 1) {
  632. sSndMsg += astfPrintOut(660, 540, 3, pChaCnt + "/" + pChaTotCnt,"");
  633. }
  634. sSndMsg += astfPrintOut(20, 540, 3,"조제일자 : " + fGetDateString(drugDD) ,"");
  635. sSndMsg += astfPrintOut(20, 580, 3, lblCnts1 ,"");
  636. /*
  637. //출력 페이지수를 표시하기 위하여 상위(fLBLPrint)에서 for문으로 처리.
  638. //종료(매수) 차광은 2매
  639. if ( keepmthd2nm == "차광"){
  640. sSndMsg += astfEndFormat(2*tims);
  641. } else {
  642. sSndMsg += astfEndFormat(tims);
  643. }
  644. */
  645. }
  646. /**
  647. * 소아TPN 라벨출력
  648. */
  649. function fLBLChildTPNPrint() {
  650. /*
  651. 라벨 Sorting 로직
  652. calclipidcvol != 0 면 라벨 1번 출력
  653. 라벨 2번 출력 기본
  654. 차광이면 2장 출력 (최대 4장출력가능)
  655. */
  656. // Comm 설정
  657. //CommAX.CommPort = "1"; // 출력 Port
  658. //CommAX.Settings = "9600,n,8,1"; // Comm 설정
  659. //CommAX.Settings = "127.0.0.1"; // Comm 설정
  660. PrnKind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  661. PrnMarginLeft = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
  662. PrnMarginTop = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
  663. var commkind = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/commkind")
  664. CommAX.PrnKind =PrnKind;
  665. if(commkind == "02") {
  666. CommAX.PortNm = 1;
  667. } else {
  668. CommAX.PortNm = 2;
  669. }
  670. if(commkind == "01") {
  671. CommAX.PrtNm = model.getvalue("/root/init/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  672. }
  673. //if ( CommAX.PortOpen() == true) {
  674. for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
  675. var sKeepMthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd2nm");
  676. var sOrdLipidVol = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordlipidvol");
  677. if(sKeepMthd2 != ""){
  678. if(parseFloat(sOrdLipidVol) > 0){
  679. fLBL1ChildTPNPrint("1/2");
  680. fLBL1ChildTPNPrint("2/2");
  681. }
  682. fLBL2ChildTPNPrint("1/2");
  683. fLBL2ChildTPNPrint("2/2");
  684. } else {
  685. if(parseFloat(sOrdLipidVol) > 0){
  686. fLBL1ChildTPNPrint("1/1");
  687. }
  688. fLBL2ChildTPNPrint("1/1");
  689. }
  690. }
  691. //CommAX.PortClose();
  692. model.refresh();
  693. //}
  694. }
  695. /**
  696. * 소아TPN 라벨 1 출력
  697. */
  698. function fLBL1ChildTPNPrint(prnt_page) {
  699. //처방횟수
  700. var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  701. //시작(X, Y)
  702. sSndMsg = astfStartFormat(0, 0);
  703. //상단
  704. //라벨이름
  705. sSndMsg += astfPrintOut(30, 40, 3, "소아정맥영양제","");
  706. //처방명
  707. sSndMsg += astfPrintOut(200, 40, 3, "< Group Code : "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd"),"");
  708. //병실
  709. sSndMsg += astfPrintOut(600, 40, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),"");
  710. //페이지
  711. sSndMsg += astfPrintOut(750, 40, 3, prnt_page,"");
  712. //drugpath
  713. sSndMsg += astfPrintOut(30, 80, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugpathnm"),"");
  714. //maturation
  715. sSndMsg += astfPrintOut(280, 80, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/maturationflagnm"),"");
  716. //wt
  717. sSndMsg += astfPrintOut(530, 80, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/wt")+"kg","");
  718. //환자번호
  719. sSndMsg += astfPrintOut(30, 120, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid"),"");
  720. //환자명
  721. sSndMsg += astfPrintOut(280, 120, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),"");
  722. //투여속도
  723. sSndMsg += astfPrintOut(530, 120, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugspdnm"),"");
  724. //중단
  725. //
  726. sSndMsg += astfPrintOut(30, 180, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lipiddrugcd"),"");
  727. //용량
  728. sSndMsg += astfPrintOut(210, 180, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordlipidvol"),"");
  729. //단위
  730. sSndMsg += astfPrintOut(320, 180, 3, "ml","");
  731. //
  732. sSndMsg += astfPrintOut(30, 220, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/heparindrugcd"),"");
  733. //용량
  734. sSndMsg += astfPrintOut(210, 220, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordheparinvol"),"");
  735. //단위
  736. sSndMsg += astfPrintOut(320, 220, 3, "IU","");
  737. //총열량
  738. sSndMsg += astfPrintOut(30, 420, 3, "총열량","");
  739. //총열량
  740. sSndMsg += astfPrintOut(210, 420, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordcalr2"),"");
  741. //총열량
  742. sSndMsg += astfPrintOut(320, 420, 3, "Kcal","");
  743. //하단
  744. //투여제한시간
  745. sSndMsg += astfPrintOut(30, 500, 3, "조제후 ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/valitime")+") 시간이내투여","");
  746. //냉장보관
  747. if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthdnm") != ""){
  748. sSndMsg += astfPrintOut(440, 500, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthdnm"),"");
  749. }
  750. //차광
  751. sSndMsg += astfPrintOut(610, 500, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd2nm"),"");
  752. //처방입력일시
  753. sSndMsg += astfPrintOut(30, 540, 3, "처방일:"+fGetDateString(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/rgstdt")),"");
  754. //조제일자
  755. sSndMsg += astfPrintOut(390, 540, 3, "조제일자:"+fGetDateString(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugdd")),"");
  756. sSndMsg += astfPrintOut(30, 580, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1") ,"");
  757. sSndMsg += astfEndFormat(tims);
  758. CommAX.SendMsg(sSndMsg);
  759. }
  760. /**
  761. * 소아TPN 라벨 2 출력
  762. */
  763. function fLBL2ChildTPNPrint(prnt_page) {
  764. //처방횟수
  765. var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  766. //시작(X, Y)
  767. sSndMsg = astfStartFormat(0, 0);
  768. //상단
  769. //라벨이름
  770. sSndMsg += astfPrintOut(30, 40, 3, "소아정맥영양제","");
  771. //처방명
  772. sSndMsg += astfPrintOut(200, 40, 3, "< Group Code : "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd"),"");
  773. //병실
  774. sSndMsg += astfPrintOut(600, 40, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),"");
  775. //페이지
  776. sSndMsg += astfPrintOut(750, 40, 3, prnt_page,"");
  777. //drugpath
  778. sSndMsg += astfPrintOut(30, 80, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugpathnm"),"");
  779. //maturation
  780. sSndMsg += astfPrintOut(280, 80, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/maturationflagnm"),"");
  781. //wt
  782. sSndMsg += astfPrintOut(530, 80, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/wt")+"Kg","");
  783. //환자번호
  784. sSndMsg += astfPrintOut(30, 120, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid"),"");
  785. //환자명
  786. sSndMsg += astfPrintOut(280, 120, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),"");
  787. //투여속도
  788. sSndMsg += astfPrintOut(530, 120, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugspdnm"),"");
  789. //중단
  790. //
  791. sSndMsg += astfPrintOut(30, 180, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dexdrugcd"),"");
  792. //용량
  793. sSndMsg += astfPrintOut(210, 180, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/orddexvol"),"");
  794. //단위
  795. sSndMsg += astfPrintOut(320, 180, 3, "ml","");
  796. //
  797. sSndMsg += astfPrintOut(30, 220, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/orddrug"),"");
  798. //용량
  799. sSndMsg += astfPrintOut(210, 220, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdistvol"),"");
  800. //단위
  801. sSndMsg += astfPrintOut(320, 220, 3, "ml","");
  802. //
  803. sSndMsg += astfPrintOut(30, 260, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/aminodrugcd"),"");
  804. //용량
  805. sSndMsg += astfPrintOut(210, 260, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordaminovol"),"");
  806. //단위
  807. sSndMsg += astfPrintOut(320, 260, 3, "ml","");
  808. //
  809. sSndMsg += astfPrintOut(30, 300, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pdrugcd"),"");
  810. //용량
  811. sSndMsg += astfPrintOut(210, 300, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordpvol"),"");
  812. //단위
  813. sSndMsg += astfPrintOut(320, 300, 3, "ml","");
  814. //
  815. sSndMsg += astfPrintOut(30, 340, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/nadrugcd"),"");
  816. //용량
  817. sSndMsg += astfPrintOut(210, 340, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordnavol"),"");
  818. //단위
  819. sSndMsg += astfPrintOut(320, 340, 3, "ml","");
  820. //
  821. sSndMsg += astfPrintOut(430, 180, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/kdrugcd"),"");
  822. //용량
  823. sSndMsg += astfPrintOut(610, 180, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordkvol"),"");
  824. //단위
  825. sSndMsg += astfPrintOut(720, 180, 3, "ml","");
  826. //
  827. sSndMsg += astfPrintOut(430, 220, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mgdrugcd"),"");
  828. //용량
  829. sSndMsg += astfPrintOut(610, 220, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordmgvol"),"");
  830. //단위
  831. sSndMsg += astfPrintOut(720, 220, 3, "ml","");
  832. //
  833. sSndMsg += astfPrintOut(430, 260, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/traceeledrugcd"),"");
  834. //용량
  835. sSndMsg += astfPrintOut(610, 260, 3, parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/traceelevol")) * parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcprate")),"");
  836. //단위
  837. sSndMsg += astfPrintOut(720, 260, 3, "ml","");
  838. //
  839. sSndMsg += astfPrintOut(430, 300, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/cadrugcd"),"");
  840. //용량
  841. sSndMsg += astfPrintOut(610, 300, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordcavol"),"");
  842. //단위
  843. sSndMsg += astfPrintOut(720, 300, 3, "ml","");
  844. //
  845. sSndMsg += astfPrintOut(430, 340, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/multivitadrugcd"),"");
  846. //용량
  847. sSndMsg += astfPrintOut(610, 340, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordmultivitavol"),"");
  848. //단위
  849. sSndMsg += astfPrintOut(720, 340, 3, "ml","");
  850. //총열량
  851. sSndMsg += astfPrintOut(30, 420, 3, "총열량","");
  852. //총열량
  853. sSndMsg += astfPrintOut(210, 420, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/ordcalr1"),"");
  854. //총열량
  855. sSndMsg += astfPrintOut(320, 420, 3, "Kcal","");
  856. //하단
  857. //투여제한시간
  858. sSndMsg += astfPrintOut(30, 500, 3, "조제후 ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/valitime")+") 시간이내투여","");
  859. //냉장보관
  860. if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthdnm") != ""){
  861. sSndMsg += astfPrintOut(440, 500, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthdnm"),"");
  862. }
  863. //차광
  864. sSndMsg += astfPrintOut(610, 500, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd2nm"),"");
  865. //처방입력일시
  866. sSndMsg += astfPrintOut(30, 540, 3, "처방일:"+fGetDateString(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/rgstdt")),"");
  867. //조제일자
  868. sSndMsg += astfPrintOut(390, 540, 3, "조제일자:"+fGetDateString(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugdd")),"");
  869. sSndMsg += astfPrintOut(30, 580, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1") ,"");
  870. sSndMsg += astfEndFormat(tims);
  871. CommAX.SendMsg(sSndMsg);
  872. }
  873. /**
  874. *
  875. */
  876. function fGetImage() {
  877. var pImage = "";
  878. iImageCnt++;
  879. if(iImageCnt > 99){
  880. pImage = "GRAPH"+iImageCnt;
  881. } else if(iImageCnt > 9){
  882. pImage = "GRAPH0"+iImageCnt;
  883. } else {
  884. pImage = "GRAPH00"+iImageCnt;
  885. }
  886. return pImage
  887. }
  888. function fGetDateString( s ){
  889. var dates = "";
  890. if(s.length > 8){
  891. dates = s.substring(0,4) +"/" +s.substring(4,6)+"/" +s.substring(6,8)+" "+s.substring(8,10)+":"+s.substring(10,12)+":"+s.substring(12,14);
  892. } else {
  893. dates = s.substring(0,4) +"/" +s.substring(4,6)+"/" +s.substring(6,8);
  894. }
  895. return dates;
  896. }