SPADT62303.js 90 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587
  1. /**
  2. * 파 일 명 : SPADT62300.js
  3. * 설 명 : (팝업)병동라벨출력 Javascriot
  4. * 설 계 자 : 공두경
  5. * 작 성 자 : 공두경
  6. * 수정이력 : 2007.09.17 / 최초작성 / 공두경
  7. */
  8. var sSndMsg = ""; //라벨출력내용
  9. var iPoint = 1; //라벨출력row
  10. var iCnt = 0; //라벨출력매수
  11. var iImageCnt = 0; //라벨그래픽폰트수
  12. var gTimer = null;
  13. var pg =0;
  14. var totpg =0;
  15. var totcnt =0;
  16. var ordflag = "";
  17. var bordflag = "";
  18. var vcnt = 0;
  19. var nCnt = 0;
  20. var vlblcnt = false;
  21. var mlblcnt2 = false;
  22. var mlblcnt1 = false;
  23. var nextPage = false;
  24. var prntflag = false;
  25. var iTotalPageNum = 0;
  26. var iPageCnt = 0;
  27. var BarOCX ;
  28. /**
  29. * 초기화
  30. */
  31. function fInit_lbl() {
  32. submit("TRADT62301");
  33. }
  34. /**
  35. *
  36. */
  37. function fStopTimer() {
  38. window.clearinterval(gTimer);
  39. }
  40. function fSleep(numberMillis) {
  41. var now = new Date();
  42. var exitTime = now.getTime() + numberMillis;
  43. while (true) {
  44. now = new Date();
  45. if (now.getTime() > exitTime)
  46. return;
  47. }
  48. }
  49. /**
  50. * 병동 라벨출력(작은사이즈)
  51. */
  52. function fSmallLBLPrint() {
  53. /*
  54. 라벨 Sorting 로직
  55. //mgt에서 vo로 리턴
  56. 대분류
  57. - 내복약, 외용약, 주사, 항암제, TPN, 마약,
  58. 중분류
  59. - 방법코드
  60. 소분류
  61. - 내복약,외용약(방법코드), 주사,마약,항암제(mix)
  62. web js 출력로직
  63. 가. 퇴원/외래/응급실/외박/외출 : 큰사이즈라벨
  64. 외래기준
  65. 나. 그외 입원처방
  66. 1. 외용약
  67. 단독출력
  68. 2. 내복약
  69. 단독출력
  70. 따로포장
  71. 복용방법
  72. 3. 주사약
  73. 단독출력
  74. mix끼리
  75. 고가,향정,보관벙법이 실온이 아닌경우 자가주사인 경우 단독
  76. 나머지
  77. */
  78. PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  79. PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
  80. PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
  81. commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
  82. Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
  83. PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  84. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  85. BarOCX = CommAX1;
  86. } else {
  87. BarOCX = CommAX2;
  88. }
  89. if(commkind == "02") {
  90. PortNm = 1;
  91. } else {
  92. PortNm = 2;
  93. }
  94. //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
  95. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  96. BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);
  97. } else {
  98. BarOCX.CommPort = "1"; // 출력 Port
  99. BarOCX.Settings = "9600,n,8,1"; // Comm 설정
  100. var ocxcnt = 0;
  101. while(!BarOCX.PortOpen() && ocxcnt < 10) {
  102. BarOCX.PortClose();
  103. fSleep(2000);
  104. ocxcnt++;
  105. }
  106. }
  107. var sDD = getCurrentDate();
  108. var sTM = getCurrentTime();
  109. var reprint ="";
  110. totcnt = 0;
  111. pg = 0;
  112. totpg = 0;
  113. for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){
  114. if(model.getValue("/root/main/lbllist/lbllist["+i+"]/pid") == "") {
  115. return;
  116. }
  117. if ( model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DI" && model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DS" ){
  118. totcnt++;
  119. }
  120. }
  121. // 2010.02.12 pymi
  122. if( (totcnt%6) != 0) totcnt ++; // 라벨찍기 전에 한줄 띄우기
  123. for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){
  124. if(model.getValue("/root/main/lbllist/lbllist["+ i +"]/lblcnts2").length > 0) { totcnt++; vlblcnt = true;}
  125. }
  126. // (e)
  127. for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
  128. if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
  129. reprint ="(재)";
  130. }
  131. //시작(X, Y)
  132. sSndMsg += astfStartFormat(0, 0, "S");
  133. if(PrnKind == "2" || PrnKind == "7") {
  134. //라벨이름(내복약/주사약/마약)
  135. sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  136. //출력일자
  137. sSndMsg += astfPrintOut(190, 25, 21, "출력:"+fPrntTime(sDD, sTM),"");
  138. //출력일자
  139. sSndMsg += astfPrintOut(190, 55, 21, "처방:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  140. } else {
  141. //라벨이름(내복약/주사약/마약)
  142. sSndMsg += astfPrintOut(20, 25, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  143. //출력일자
  144. sSndMsg += astfPrintOut(220, 25, 21, "출 력 : "+fPrntTime(sDD, sTM),"");
  145. //출력일자
  146. sSndMsg += astfPrintOut(220, 55, 21, "처 방 : "+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  147. }
  148. //병실
  149. sSndMsg += astfPrintOut(20, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),"");
  150. //환자이름
  151. sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),"");
  152. //환자번호
  153. sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+")","");
  154. //선그리기
  155. sSndMsg += astfGraphicBox(5, 120, 465, 0, 4);
  156. var sDrugKindcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
  157. var sMixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
  158. if(sDrugKindcd == "[내복약]"){
  159. if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){
  160. fInUseDrugLBL2();
  161. // 2010.02.12 pymi
  162. //if((vcnt < 6) && (vlblcnt) && (iPoint == getNodesetCount("/root/main/lbllist/lbllist")) ) {
  163. if(vcnt < 6 && vlblcnt) {
  164. mlblcnt2 = true;
  165. fPrntLblCnt2(vcnt, ordflag);
  166. ordflag = "";
  167. vcnt = 0;
  168. }
  169. // (e)
  170. } else {
  171. fInUseDrugLBL();
  172. // 2010.02.19 pymi
  173. if((vcnt < 4) && (ordflag.length > 0)) {
  174. mlblcnt1 = true;
  175. fPrntLblCnt1(vcnt, ordflag);
  176. ordflag = "";
  177. vcnt = 0;
  178. }
  179. // (e)
  180. }
  181. } else if(sDrugKindcd == "[외용약]"){
  182. //fExUseDrugLBL();
  183. if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){
  184. fInUseDrugLBL2();
  185. } else {
  186. fInUseDrugLBL();
  187. }
  188. } else if(sDrugKindcd == "[주사약]"){
  189. if(sMixno != "-"){
  190. fMixLBL();
  191. } else {
  192. fInjDrugLBL();
  193. }
  194. }
  195. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  196. BarOCX.SendMsg(sSndMsg);
  197. BarOCX.PortClose();
  198. sSndMsg = "";
  199. } else {
  200. BarOCX.SendMessage(sSndMsg);
  201. //BarOCX.PortClose();
  202. sSndMsg = "";
  203. }
  204. // 2010.02.11 pymi
  205. if(sDrugKindcd == "[내복약]"){
  206. if( iPoint == getNodesetCount("/root/main/lbllist/lbllist") ) {
  207. if(model.getValue("/root/send/prcpinfo/lbltype") == "Y"){
  208. if(vlblcnt && (!mlblcnt2) && (ordflag.length > 0)) {
  209. fPrntLblCnt2(vcnt, ordflag);
  210. ordflag = "";
  211. vcnt = 0;
  212. }
  213. } else {
  214. if(vlblcnt && (!mlblcnt1) && (ordflag.length > 0)) {
  215. fPrntLblCnt1(vcnt, ordflag);
  216. ordflag = "";
  217. vcnt = 0;
  218. }
  219. }
  220. mlblcnt2 = false;
  221. mlblcnt1= false;
  222. } else if( iPoint < getNodesetCount("/root/main/lbllist/lbllist") ){
  223. if(model.getValue("/root/send/prcpinfo/lbltype") != "Y"){
  224. if(prntflag) {
  225. fPrntLblCnt1(vcnt, ordflag);
  226. ordflag = "";
  227. vcnt = 0;
  228. prntflag = false;
  229. }
  230. }
  231. }
  232. }
  233. // (e)
  234. }
  235. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  236. } else {
  237. BarOCX.PortClose();
  238. //alert("close 1");
  239. }
  240. model.refresh();
  241. }
  242. /**
  243. * mix 라벨
  244. */
  245. function fMixLBL() {
  246. var sMixno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
  247. var cnt = 0;
  248. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  249. sMixno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpmixno");
  250. var qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty");
  251. var dayqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/dayprcpqty");
  252. var qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit");
  253. var tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
  254. var dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  255. if(PrnKind == "2") {
  256. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  257. prcpnm = prcpnm.substr(0,7);
  258. } else {
  259. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  260. }
  261. if(sMixno1 == sMixno2){
  262. //
  263. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  264. //sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  265. //
  266. sSndMsg += astfPrintOut(170, 140+(cnt*30), 11, prcpnm.substr(0,7),"");
  267. //
  268. sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty+qtyunit,"");
  269. //
  270. sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,"");
  271. //
  272. sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,"");
  273. cnt++;
  274. } else {
  275. j--;
  276. break;
  277. }
  278. //2010-07-05 병동처방전출력 화면 - JCI관련 - 보관구분:[냉장주사]/[고위험주사] MIX이더라고 단독으로 출력한다.
  279. //if(cnt == 5){
  280. // break;
  281. //}
  282. var sDngryn = model.getValue("/root/main/lbllist/lbllist["+j+"]/dngryn"); //고위험주사 여부
  283. var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+j+"]/keepmthdyn"); //냉장주사 여부
  284. if ( sDngryn =="Y" || sKeepmthdyn =="Y" ) {
  285. if(cnt == 5 || fChkIndependInj(j)){
  286. //j++;
  287. break;
  288. }
  289. }else{
  290. if(cnt == 5){
  291. break;
  292. }
  293. }
  294. }
  295. iPoint = j;
  296. //종료(매수)
  297. sSndMsg += astfEndFormat(0);
  298. }
  299. /**
  300. * 내복약 라벨
  301. */
  302. function fInUseDrugLBL() {
  303. // var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  304. var sMthdcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
  305. var qty = "";
  306. var dayqty = "";
  307. var qtyunit = "";
  308. var tims = "";
  309. var dayno = "";
  310. var cnt = 0;
  311. var chgMth = false; // 2010.02.17 pymi
  312. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  313. if(cnt != 0 && fChkIndependDrug(j)){
  314. break;
  315. }
  316. // sSumCls2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls");
  317. sMthdcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
  318. qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty");
  319. dayqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/dayprcpqty");
  320. qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit");
  321. tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
  322. dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  323. if(PrnKind == "2") {
  324. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  325. prcpnm = prcpnm.substr(0,7);
  326. } else {
  327. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  328. }
  329. if((sMthdcd1 == sMthdcd2)){
  330. if(PrnKind == "2") {
  331. //
  332. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  333. //sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  334. //
  335. // 2010.02.17 pymi
  336. if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
  337. // (e)
  338. sSndMsg += astfPrintOut(165, 140+(cnt*30), 11, prcpnm.substr(0,7),"");
  339. if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){
  340. //
  341. sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty+qtyunit,"");
  342. //
  343. sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,"");
  344. //
  345. sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,"");
  346. } else {
  347. //
  348. sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty,"");
  349. //
  350. sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,"");
  351. //
  352. sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,"");
  353. }
  354. } else {
  355. //
  356. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  357. //sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  358. //
  359. // 2010.02.17 pymi
  360. if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
  361. // (e)
  362. sSndMsg += astfPrintOut(135, 140+(cnt*30), 11, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"),"");
  363. if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){
  364. //
  365. sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty+qtyunit,"");
  366. //
  367. sSndMsg += astfPrintOut(400, 140+(cnt*30), 2, tims,"");
  368. //
  369. sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, dayno,"");
  370. } else {
  371. //
  372. sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty,"");
  373. //
  374. sSndMsg += astfPrintOut(390, 140+(cnt*30), 2, tims,"");
  375. //
  376. sSndMsg += astfPrintOut(420, 140+(cnt*30), 2, dayno,"");
  377. }
  378. }
  379. cnt++;
  380. } else {
  381. // 용법바뀔때 2010.02.17 pymi
  382. chgMth = true;
  383. // (e)
  384. break;
  385. }
  386. if(cnt == fMthdnmLength(iPoint) || fChkIndependDrug(j)){
  387. j++;
  388. // 다음 용법이 다를때 2010.02.17 pymi
  389. sMthdcd3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
  390. if((sMthdcd1 != sMthdcd3) && (ordflag.length > 0) ){
  391. prntflag = true;
  392. }
  393. //
  394. break;
  395. }
  396. }
  397. iPoint = j-1;
  398. //보관방법 고가 출력
  399. var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd");
  400. var sExpnyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/expnyn");
  401. var sExpnnm = "";
  402. if(sExpnyn == "Y") sExpnnm = "고가";
  403. //if(sKeepmthd != "" && sExpnnm != ""){
  404. // sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">","");
  405. //} else
  406. if(sKeepmthd != ""){
  407. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
  408. }
  409. if(sExpnnm != ""){
  410. sSndMsg += astfPrintOut(135, 180, 3, "<"+sExpnnm+">","");
  411. }
  412. /*
  413. if(sKeepmthd != "" && sExpnnm != ""){
  414. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">","");
  415. } else if(sKeepmthd != ""){
  416. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
  417. } if(sExpnnm != ""){
  418. sSndMsg += astfPrintOut(20, 180, 3, "<"+sExpnnm+">","");
  419. }*/
  420. //용법의 길이에 따라 찍는 위치를 달리한다(용법찍을 공간을 확보)
  421. var iYPoint = 0;
  422. if( fMthdnmLength(iPoint) == 4){
  423. iYPoint = 280;
  424. } else {
  425. iYPoint = 245;
  426. }
  427. if( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblgrup") == "DS"){
  428. sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"회 "
  429. +qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"일분","");
  430. } else {
  431. sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"회 "
  432. +model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"일분","");
  433. }
  434. //
  435. sSndMsg += fMthdnm(iPoint);
  436. //종료(매수)
  437. //sSndMsg += astfEndFormat(0);
  438. // 용법바뀔때 2010.02.17 pymi
  439. //if(chgMth) {
  440. if(ordflag.length > 0) {
  441. cnt++; //라벨내용찍기전 한줄 띄우기
  442. if(cnt >= 4) sSndMsg += astfEndFormat(0);
  443. } else {
  444. sSndMsg += astfEndFormat(0);
  445. }
  446. //}
  447. // (e)
  448. // 용법 바뀌지 않는 마지막이 아닌 처방 2010.02.17 pymi
  449. /*if(iPoint != getNodesetCount("/root/main/lbllist/lbllist") && (!chgMth)) {
  450. cnt++;
  451. sSndMsg += astfEndFormat(0);
  452. }*/
  453. vcnt = cnt;
  454. // (e)
  455. }
  456. // 포장라벨내용 출력 2010.02.17 pymi
  457. function fPrntLblCnt1(cnt, ordflag) {
  458. var lblcnts2 = "";
  459. var sordflag = ordflag.split("/");
  460. var mthprnt = false;
  461. var lblcnt = cnt;
  462. var qty = "";
  463. var qtyunit = "";
  464. var sDD = getCurrentDate();
  465. var sTM = getCurrentTime();
  466. var y = 0;
  467. var x = parseInt(sordflag[y]);
  468. while( x <= parseInt(sordflag[sordflag.length - 2])) {
  469. if(lblcnt >= fMthdnmLength(x) || lblcnt == 0) {
  470. mthprnt = false;
  471. lblcnt = 0;
  472. //
  473. /*PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  474. PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
  475. PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
  476. commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
  477. Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
  478. PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  479. if(commkind == "02") {
  480. PortNm = 1;
  481. } else {
  482. PortNm = 2;
  483. }
  484. BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);*/
  485. //
  486. var reprint ="";
  487. if ( model.getValue("/root/main/lbllist/lbllist["+x+"]/lblprnttims")>0 ){
  488. reprint ="(재)";
  489. }
  490. //시작(X, Y)
  491. sSndMsg += astfStartFormat(0, 0, "S");
  492. //라벨이름(내복약/주사약/마약)
  493. //sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+x+"]/drugkindnm"),"");
  494. if(PrnKind == "2" || PrnKind == "7") {
  495. //라벨이름(내복약/주사약/마약)
  496. sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  497. //출력일자
  498. sSndMsg += astfPrintOut(190, 25, 21, "출력:"+fPrntTime(sDD, sTM),"");
  499. //출력일자
  500. sSndMsg += astfPrintOut(190, 55, 21, "처방:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  501. } else {
  502. //라벨이름(내복약/주사약/마약)
  503. sSndMsg += astfPrintOut(20, 25, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  504. //출력일자
  505. sSndMsg += astfPrintOut(220, 25, 21, "출 력 : "+fPrntTime(sDD, sTM),"");
  506. //출력일자
  507. sSndMsg += astfPrintOut(220, 55, 21, "처 방 : "+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  508. }
  509. //병실
  510. sSndMsg += astfPrintOut(20, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/roomcd"),"");
  511. //환자이름
  512. sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/patnm"),"");
  513. //환자번호
  514. sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+x+"]/drugno")+reprint+")","");
  515. //선그리기
  516. sSndMsg += astfGraphicBox(5, 120, 465, 0, 4);
  517. }
  518. if( !fChkIndependDrug(x) ) {
  519. lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ x +"]/lblcnts2"); // 2010.02.10 pymi
  520. sSndMsg += astfPrintOut(20, 140+(lblcnt*30), 24, lblcnts2,"");
  521. lblcnt ++;
  522. }
  523. if(lblcnt == fMthdnmLength(x)){
  524. mthprnt = true;
  525. lblcnt = 0;
  526. //용법의 길이에 따라 찍는 위치를 달리한다(용법찍을 공간을 확보)
  527. var iYPoint = 0;
  528. qty = model.getValue("/root/main/lbllist/lbllist["+ x +"]/prcpqty");
  529. qtyunit = model.getValue("/root/main/lbllist/lbllist["+ x +"]/prcpqtyunit");
  530. if( fMthdnmLength(x) == 4){
  531. iYPoint = 280;
  532. } else {
  533. iYPoint = 245;
  534. }
  535. if( model.getValue("/root/main/lbllist/lbllist["+x+"]/lblgrup") == "DS"){
  536. sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+x+"]/prcptims")+"회 "
  537. +qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+x+"]/prcpdayno")+"일분","");
  538. } else {
  539. sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+x+"]/prcptims")+"회 "
  540. +model.getValue("/root/main/lbllist/lbllist["+x+"]/prcpdayno")+"일분","");
  541. }
  542. //
  543. sSndMsg += fMthdnm(iPoint);
  544. sSndMsg += astfEndFormat(0);
  545. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  546. BarOCX.SendMsg(sSndMsg);
  547. //BarOCX.PortClose();
  548. sSndMsg = "";
  549. //break;
  550. } else {
  551. BarOCX.SendMessage(sSndMsg);
  552. //BarOCX.PortClose();
  553. sSndMsg = "";
  554. }
  555. }
  556. x = parseInt(sordflag[++y]);
  557. } // end while
  558. if(!mthprnt) {
  559. //용법의 길이에 따라 찍는 위치를 달리한다(용법찍을 공간을 확보)
  560. var iYPoint = 0;
  561. var lastvalu = parseInt(sordflag[sordflag.length - 2]);
  562. qty = model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcpqty");
  563. qtyunit = model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcpqtyunit");
  564. if( fMthdnmLength(lastvalu) == 4){
  565. iYPoint = 280;
  566. } else {
  567. iYPoint = 245;
  568. }
  569. if( model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/lblgrup") == "DS"){
  570. sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcptims")+"회 "
  571. +qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcpdayno")+"일분","");
  572. } else {
  573. sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcptims")+"회 "
  574. +model.getValue("/root/main/lbllist/lbllist["+ lastvalu +"]/prcpdayno")+"일분","");
  575. }
  576. //
  577. sSndMsg += fMthdnm(iPoint);
  578. sSndMsg += astfEndFormat(0);
  579. }
  580. if(!mlblcnt1) {
  581. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  582. BarOCX.SendMsg(sSndMsg);
  583. //BarOCX.PortClose();
  584. sSndMsg = "";
  585. } else {
  586. BarOCX.SendMessage(sSndMsg);
  587. //BarOCX.PortClose();
  588. sSndMsg = "";
  589. }
  590. }
  591. ordflag = "";
  592. vcnt = 0;
  593. mlblcnt1 = false;
  594. model.refresh();
  595. }
  596. // (e)
  597. /**
  598. * 내복약 라벨 - 한장에 모든 용법 약을 ...
  599. */
  600. function fInUseDrugLBL2() {
  601. // var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  602. var sMthdcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
  603. var qty = "";
  604. var dayqty = "";
  605. var qtyunit = "";
  606. var tims = "";
  607. var dayno = "";
  608. var cnt = 0;
  609. var chk = false;
  610. totpg = Math.ceil(totcnt / 6 );
  611. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  612. if(cnt != 0 && model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DI" ) {
  613. break;
  614. }
  615. //if(cnt != 0 && fChkIndependDrug(j)){
  616. // break;
  617. //}
  618. // sSumCls2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls");
  619. sMthdcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
  620. qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty");
  621. dayqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/dayprcpqty");
  622. qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit");
  623. tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
  624. dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  625. if(PrnKind == "2") {
  626. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  627. prcpnm = prcpnm.substr(0,7);
  628. } else {
  629. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  630. }
  631. //if((sMthdcd1 == sMthdcd2)){
  632. //
  633. if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DT"){ //PTP는 * 표시
  634. sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, "*","");
  635. }
  636. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  637. //sSndMsg += astfPrintOut(30, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  638. //20100224 이선경 수정 : zebra는 명칭 길게 나오도록 함 사토만 잘라서 출력
  639. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  640. sSndMsg += astfPrintOut(165, 140+(cnt*30), 11, prcpnm.substr(0,7),"");
  641. if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){
  642. //
  643. sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty+qtyunit,"");
  644. //
  645. sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,"");
  646. //
  647. sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,"");
  648. } else {
  649. //
  650. sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty,"");
  651. //
  652. sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,"");
  653. //
  654. sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,"");
  655. }
  656. } else {
  657. var prcpnm = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  658. prcpnm = prcpnm.substring(0,16);
  659. sSndMsg += astfPrintOut(135, 140+(cnt*30), 11, prcpnm,"");
  660. if( model.getValue("/root/main/lbllist/lbllist["+j+"]/lblgrup") == "DS"){
  661. //
  662. sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty+qtyunit,"");
  663. //
  664. sSndMsg += astfPrintOut(400, 140+(cnt*30), 2, tims,"");
  665. //
  666. sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, dayno,"");
  667. } else {
  668. //
  669. sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty,"");
  670. //
  671. sSndMsg += astfPrintOut(390, 140+(cnt*30), 2, tims,"");
  672. //
  673. sSndMsg += astfPrintOut(420, 140+(cnt*30), 2, dayno,"");
  674. }
  675. }
  676. if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0) ordflag += j + "/"; // 2010.02.10 pymi
  677. cnt++;
  678. //} else {
  679. // break;
  680. //}
  681. //if(cnt == fMthdnmLength(iPoint) || fChkIndependDrug(j)){
  682. // j++;
  683. // break;
  684. //}
  685. if(cnt == 6){
  686. pg++;
  687. sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,"");
  688. sSndMsg += astfEndFormat(0);
  689. j++;
  690. chk=true;
  691. break;
  692. }
  693. }
  694. // 2010.02 18 pymi
  695. if (chk == false) {
  696. if( model.getValue("/root/main/lbllist/lbllist["+(j-1)+"]/lblgrup") != "DI" ) {
  697. cnt ++; // 라벨내용 찍기 전에 한줄 띄우기
  698. if(!vlblcnt || cnt == 6) {
  699. pg++;
  700. sSndMsg += astfPrintOut(430,320, 2, pg+"/" +totpg ,"");
  701. sSndMsg += astfEndFormat(0);
  702. }
  703. } else{
  704. sSndMsg += astfEndFormat(0);
  705. }
  706. }
  707. iPoint = j-1;
  708. //if( (cnt < 6) && (!vlblcnt)) sSndMsg += astfEndFormat(0);
  709. vcnt = cnt;
  710. // (e)
  711. //보관방법 고가 출력
  712. /*var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd");
  713. var sExpnyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/expnyn");
  714. var sExpnnm = "";
  715. if(sExpnyn == "Y") sExpnnm = "고가";
  716. //if(sKeepmthd != "" && sExpnnm != ""){
  717. // sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">","");
  718. //} else
  719. if(sKeepmthd != ""){
  720. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
  721. }
  722. if(sExpnnm != ""){
  723. sSndMsg += astfPrintOut(135, 180, 3, "<"+sExpnnm+">","");
  724. }*/
  725. /*
  726. if(sKeepmthd != "" && sExpnnm != ""){
  727. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">","");
  728. } else if(sKeepmthd != ""){
  729. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
  730. } if(sExpnnm != ""){
  731. sSndMsg += astfPrintOut(20, 180, 3, "<"+sExpnnm+">","");
  732. }*/
  733. //용법의 길이에 따라 찍는 위치를 달리한다(용법찍을 공간을 확보)
  734. //var iYPoint = 0;
  735. //if( fMthdnmLength(iPoint) == 4){
  736. // iYPoint = 280;
  737. //} else {
  738. // iYPoint = 245;
  739. //}
  740. //if( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblgrup") == "DS"){
  741. // sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"회 "
  742. // +qty+qtyunit+" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"일분","");
  743. //} else {
  744. // sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"회 "
  745. // +model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"일분","");
  746. //}
  747. //
  748. //sSndMsg += fMthdnm(iPoint);
  749. //종료(매수)
  750. //sSndMsg += astfEndFormat(0); // 2010.02.12 pymi
  751. }
  752. // 포장라벨내용 출력 2010.02.10 pymi
  753. function fPrntLblCnt2(cnt, ordflag) {
  754. var lblcnts2 = "";
  755. var sordflag = ordflag.split("/");
  756. var lblcnt = cnt;
  757. var pgprnt = false;
  758. var sDD = getCurrentDate();
  759. var sTM = getCurrentTime();
  760. var reprint ="";
  761. var y = 0;
  762. var x = parseInt(sordflag[y]);
  763. //for(var x = parseInt(sordflag[0]); x <= parseInt(sordflag[sordflag.length - 2]); x ++) {
  764. while( x <= parseInt(sordflag[sordflag.length - 2])) {
  765. if(lblcnt == 6 || lblcnt == 0) {
  766. lblcnt = 0;
  767. pgprnt = false;
  768. /*PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  769. PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
  770. PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
  771. commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
  772. Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
  773. PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  774. if(commkind == "02") {
  775. PortNm = 1;
  776. } else {
  777. PortNm = 2;
  778. }
  779. BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);*/
  780. //
  781. if ( model.getValue("/root/main/lbllist/lbllist["+x+"]/lblprnttims")>0 ){
  782. reprint ="(재)";
  783. }
  784. //시작(X, Y)
  785. sSndMsg += astfStartFormat(0, 0, "S");
  786. //라벨이름(내복약/주사약/마약)
  787. //sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+x+"]/drugkindnm"),"");
  788. //출력일자
  789. //sSndMsg += astfPrintOut(190, 25, 21, "출력:"+fPrntTime(sDD, sTM),"");
  790. //출력일자
  791. //sSndMsg += astfPrintOut(190, 55, 21, "처방:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+x+"]/prcpdd"), "MD"),"");
  792. if(PrnKind == "2" || PrnKind == "7") {
  793. //라벨이름(내복약/주사약/마약)
  794. sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  795. //출력일자
  796. sSndMsg += astfPrintOut(190, 25, 21, "출력:"+fPrntTime(sDD, sTM),"");
  797. //출력일자
  798. sSndMsg += astfPrintOut(190, 55, 21, "처방:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  799. } else {
  800. //라벨이름(내복약/주사약/마약)
  801. sSndMsg += astfPrintOut(20, 25, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  802. //출력일자
  803. sSndMsg += astfPrintOut(220, 25, 21, "출 력 : "+fPrntTime(sDD, sTM),"");
  804. //출력일자
  805. sSndMsg += astfPrintOut(220, 55, 21, "처 방 : "+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  806. }
  807. //병실
  808. sSndMsg += astfPrintOut(20, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/roomcd"),"");
  809. //환자이름
  810. sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/patnm"),"");
  811. //환자번호
  812. sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+x+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+x+"]/drugno")+reprint+")","");
  813. //선그리기
  814. sSndMsg += astfGraphicBox(5, 120, 465, 0, 4);
  815. }
  816. //if( !fChkIndependDrug(x) ) {
  817. lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ x +"]/lblcnts2"); // 2010.02.10 pymi
  818. sSndMsg += astfPrintOut(30, 140+(lblcnt*30), 2, lblcnts2,"");
  819. lblcnt ++;
  820. //}
  821. if(lblcnt == 6){
  822. pg++;
  823. sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,"");
  824. lblcnt = 0;
  825. pgprnt = true;
  826. sSndMsg += astfEndFormat(0);
  827. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  828. BarOCX.SendMsg(sSndMsg);
  829. //BarOCX.PortClose();
  830. sSndMsg = "";
  831. } else {
  832. BarOCX.SendMessage(sSndMsg);
  833. //BarOCX.PortClose();
  834. sSndMsg = "";
  835. }
  836. }
  837. x = parseInt(sordflag[++y]);
  838. } // end while
  839. if(!pgprnt) {
  840. pg++;
  841. sSndMsg += astfPrintOut(430,320, 2, pg+ "/" + totpg ,"");
  842. sSndMsg += astfEndFormat(0);
  843. }
  844. if(!mlblcnt2) {
  845. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  846. BarOCX.SendMsg(sSndMsg);
  847. //BarOCX.PortClose();
  848. sSndMsg = "";
  849. } else {
  850. BarOCX.SendMessage(sSndMsg);
  851. //BarOCX.PortClose();
  852. sSndMsg = ""
  853. }
  854. }
  855. ordflag = "";
  856. vcnt = 0;
  857. pg = 0;
  858. totpg = 0;
  859. mlblcnt2 = false;
  860. model.refresh();
  861. }
  862. // (e)
  863. /**
  864. * 외용약 라벨
  865. */
  866. function fExUseDrugLBL() {
  867. var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
  868. var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
  869. var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  870. var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");
  871. if(PrnKind == "2") {
  872. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
  873. prcpnm = prcpnm.substr(0,7);
  874. } else {
  875. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
  876. }
  877. //
  878. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  879. //sSndMsg += astfPrintOut(20, 140, 24, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd"),"");
  880. //
  881. sSndMsg += astfPrintOut(165, 140, 11, prcpnm.substr(0,7),"");
  882. //
  883. sSndMsg += astfPrintOut(360, 140, 2, dayqty,"");
  884. //
  885. sSndMsg += astfPrintOut(430, 140, 2, tims,"");
  886. //
  887. sSndMsg += astfPrintOut(460, 140, 2, dayno,"");
  888. sSndMsg += astfPrintOut(20, 280, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"회 "
  889. +model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"일분","");
  890. //
  891. sSndMsg += fMthdnm(iPoint);
  892. //종료(매수)
  893. sSndMsg += astfEndFormat(0);
  894. }
  895. /**
  896. * 주사약 라벨
  897. */
  898. function fInjDrugLBL() {
  899. var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  900. var cnt = 0;
  901. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  902. if(cnt != 0 && fChkIndependInj(j)){
  903. //주사가 뭉쳐서 나오다가 단독주사를 만날경우 단독주사는 출력하지 아니함.
  904. break;
  905. }
  906. sSumCls2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls");
  907. var qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty");
  908. var dayqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/dayprcpqty");
  909. var qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit");
  910. var tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
  911. var dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  912. if(PrnKind == "2") {
  913. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  914. prcpnm = prcpnm.substr(0,7);
  915. } else {
  916. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  917. }
  918. //
  919. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  920. //sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  921. //
  922. sSndMsg += astfPrintOut(165, 140+(cnt*30), 11, prcpnm.substr(0,7),"");
  923. //
  924. sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, fChkFloat(dayqty)+qtyunit,"");
  925. //
  926. sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,"");
  927. //
  928. sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,"");
  929. cnt++;
  930. if(cnt == 5 || fChkIndependInj(j)){
  931. j++;
  932. break;
  933. }
  934. }
  935. iPoint = j-1;
  936. //보관방법 고가 출력
  937. var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd");
  938. var sExpnyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/expnyn");
  939. var sExpnnm = "";
  940. if(sExpnyn == "Y") sExpnnm = "고가";
  941. //if(sKeepmthd != "" && sExpnnm != ""){
  942. // sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">","");
  943. //} else
  944. if(sKeepmthd != ""){
  945. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
  946. }
  947. if(sExpnnm != ""){
  948. sSndMsg += astfPrintOut(135, 180, 3, "<"+sExpnnm+">","");
  949. }
  950. //종료(매수)
  951. sSndMsg += astfEndFormat(0);
  952. }
  953. /**
  954. * 내복약 단독라벨 검증작업
  955. */
  956. function fChkIndependDrug(cnt) {
  957. var sLBLGrup = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/lblgrup");
  958. var sSnglyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/atcifsnglyn");
  959. var sDrugindependpackflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/drugindependpackflag");
  960. var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/keepmthd");
  961. var sExpnyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/expnyn");
  962. var sRst = false;
  963. if(sLBLGrup == "DS" || sLBLGrup == "DI" || sLBLGrup == "DT" || sLBLGrup == "DX") sRst = true;
  964. if(sSnglyn == "Y") sRst = true;
  965. if(sDrugindependpackflag == "Y") sRst = true;
  966. if(sExpnyn == "Y") sRst = true;
  967. if(sKeepmthd != "") sRst = true;
  968. return sRst;
  969. }
  970. /**
  971. * 주사약 단독라벨 검증작업
  972. */
  973. function fChkIndependInj(cnt) {
  974. var sLBLGrup = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/lblgrup");
  975. var sExp = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/expnyn");
  976. var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/keepmthd");
  977. var sSelfprcpflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/selfprcpflag");
  978. var sDrugindependpackflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/drugindependpackflag");
  979. var sRst = false;
  980. if(sLBLGrup == "IH" || sLBLGrup == "IO" || sLBLGrup == "IS" || sLBLGrup == "IX") sRst = true;
  981. if(sExp == "Y" || sKeepmthd != "" || sSelfprcpflag == "Y") sRst = true;
  982. if(sDrugindependpackflag == "Y") sRst = true;
  983. //2010-06-29 [보관방법:냉장주사/고위험주사] 단독출력
  984. var sDngryn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/dngryn"); //고위험주사 여부
  985. var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/keepmthdyn"); //냉장주사 여부
  986. if(sDngryn == "Y" || sKeepmthdyn=="Y" ) sRst = true;
  987. return sRst;
  988. }
  989. /**
  990. * 용법 생성
  991. */
  992. function fMthdnm(iPoint) {
  993. var sMthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1");
  994. var sMthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2");
  995. var sMthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
  996. var sMthd4 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
  997. var sTemp = "";
  998. var sRst = "";
  999. if(sMthd1 != "") sTemp += sMthd1 + " ";
  1000. if(sMthd2 != "") sTemp += sMthd2 + " ";
  1001. if(sMthd3 != "") sTemp += sMthd3 + " ";
  1002. if(sMthd4 != "") sTemp += sMthd4;
  1003. if(sTemp.length > 28){
  1004. var sTemp1 = sTemp.substr(0, 26);
  1005. var sTemp2 = sTemp.substr(26, sTemp.length);
  1006. sRst = astfPrintOut(20, 285, 28, sTemp1,"");
  1007. sRst += astfPrintOut(20, 320, 28, sTemp2,"");
  1008. } else if(sTemp.length > 24){
  1009. sRst = astfPrintOut(20, 320, 29, sTemp,"");
  1010. } else if(sTemp.length > 22){
  1011. sRst = astfPrintOut(20, 320, 3, sTemp,"");
  1012. } else if(sTemp.length > 21){
  1013. sRst = astfPrintOut(20, 320, 3, sTemp,"");
  1014. } else if(sTemp.length <= 21){
  1015. sRst = astfPrintOut(20, 320, 3, sTemp,"");
  1016. }
  1017. return sRst;
  1018. }
  1019. /**
  1020. * 용법 길이
  1021. */
  1022. function fMthdnmLength(iPoint) {
  1023. var sMthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1");
  1024. var sMthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2");
  1025. var sMthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
  1026. var sMthd4 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
  1027. var sTemp = "";
  1028. var sRst = "4"; //병동라벨은 기본 4줄까지 약처방이 출력된다.
  1029. if(sMthd1 != "") sTemp += sMthd1 + " ";
  1030. if(sMthd2 != "") sTemp += sMthd2 + " ";
  1031. if(sMthd3 != "") sTemp += sMthd3 + " ";
  1032. if(sMthd4 != "") sTemp += sMthd4;
  1033. if(sTemp.length > 28){
  1034. sRst = "3"; //복용방법이 길경우 3줄까지 약처방을 출력한다.
  1035. }
  1036. return sRst;
  1037. }
  1038. /**
  1039. * 응급실/퇴원/외박/외출 라벨출력(큰사이즈)
  1040. */
  1041. function fBigLBLPrint() {
  1042. /*
  1043. 라벨 Sorting 로직
  1044. //mgt에서 vo로 리턴
  1045. 대분류
  1046. - 내복약, 외용약, 주사, 항암제, TPN, 마약,
  1047. 중분류
  1048. - 방법코드
  1049. 소분류
  1050. - 내복약,외용약(방법코드), 주사,마약,항암제(mix)
  1051. web js 출력로직
  1052. 1 약종류(내복약/주사약/외용약)
  1053. 1.1 방법코드
  1054. 1.2 처방수량
  1055. */
  1056. PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  1057. PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
  1058. PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
  1059. commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
  1060. Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
  1061. PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  1062. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  1063. BarOCX = CommAX1;
  1064. } else {
  1065. BarOCX = CommAX2;
  1066. }
  1067. if(commkind == "02") {
  1068. PortNm = 1;
  1069. } else {
  1070. PortNm = 2;
  1071. }
  1072. //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
  1073. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  1074. BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);
  1075. } else {
  1076. BarOCX.CommPort = "1"; // 출력 Port
  1077. BarOCX.Settings = "9600,n,8,1"; // Comm 설정
  1078. var ocxcnt = 0;
  1079. while(!BarOCX.PortOpen() && ocxcnt < 10) {
  1080. BarOCX.PortClose();
  1081. fSleep(2000);
  1082. ocxcnt++;
  1083. }
  1084. }
  1085. var reprint="";
  1086. //var iPageCnt = 0;
  1087. var prcpCnt = 0;
  1088. for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
  1089. if( fChkSumcls(iPoint)){
  1090. //단독라벨출력
  1091. } else {
  1092. //일반라벨출력
  1093. var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
  1094. var dayno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");
  1095. var mthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1");
  1096. var mthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2");
  1097. var mthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3");
  1098. var cnt = 0;
  1099. var lblCnt = 0;
  1100. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  1101. var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
  1102. var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  1103. var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
  1104. var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
  1105. var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
  1106. var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2"); // 2010.02.17 pymi
  1107. if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
  1108. && !fChkSumcls(j)){
  1109. // 2010.02.18 pymi
  1110. if(lblcnts2.length > 0) { lblCnt ++; }
  1111. cnt++;
  1112. // (e)
  1113. // 용법 바뀌지 않는 마지막 처방 갯수 2010.02.18
  1114. if( j == getNodesetCount("/root/main/lbllist/lbllist")) {
  1115. //라벨갯수
  1116. if( lblCnt >= 3 ) {
  1117. iPageCnt += parseInt(lblCnt/3);
  1118. lblCnt = parseInt(lblCnt%3);
  1119. }
  1120. // 기준 갯수
  1121. if(lblCnt == 0) prcpCnt = 8;
  1122. if(lblCnt == 1) prcpCnt = 6;
  1123. if(lblCnt == 2) prcpCnt = 2;
  1124. // 처방갯수 - 기준갯수
  1125. var reCnt = cnt - prcpCnt;
  1126. if( reCnt > 0 ) {
  1127. iPageCnt ++;
  1128. iPageCnt += parseInt(reCnt/14); // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
  1129. }
  1130. }
  1131. // (e)
  1132. } else {
  1133. //라벨갯수 2010.02.18
  1134. if( lblCnt >= 3 ) {
  1135. iPageCnt += parseInt(lblCnt/3);
  1136. lblCnt = parseInt(lblCnt%3);
  1137. }
  1138. // 기준 갯수
  1139. if(lblCnt == 0) prcpCnt = 8;
  1140. if(lblCnt == 1) prcpCnt = 6;
  1141. if(lblCnt == 2) prcpCnt = 2;
  1142. // 처방갯수 - 기준갯수
  1143. var reCnt = cnt - prcpCnt;
  1144. if( reCnt > 0 ) {
  1145. iPageCnt ++;
  1146. iPageCnt += parseInt(reCnt/14); // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
  1147. }
  1148. // (e)
  1149. break;
  1150. }
  1151. /*if(cnt == 8){ //2010.02.10 pymi
  1152. j++;
  1153. break;
  1154. }*/
  1155. }
  1156. iPoint = j-1;
  1157. }
  1158. iPageCnt++;
  1159. }
  1160. iTotalPageNum = iPageCnt; // 2010.02.10 pymi
  1161. //alert(iTotalPageNum);
  1162. iPageCnt = 0;
  1163. for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
  1164. if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid") =="" ) {
  1165. return;
  1166. }
  1167. if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
  1168. reprint ="(재)";
  1169. }
  1170. //시작(X, Y)
  1171. sSndMsg += astfStartFormat(0, 0, "B");
  1172. iPageCnt++;
  1173. //////////////////////////////////////////////////
  1174. // 라벨 상단내용 //
  1175. /////////////////////////////////////////////////
  1176. //병실
  1177. sSndMsg += astfPrintOut(30, 30, 6, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),"");
  1178. //환자명
  1179. sSndMsg += astfPrintOut(180, 30, 6, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm").substring(0,5),"");
  1180. //바코드(변환)
  1181. // 20101101_laboru_경북대병원_atc drugkind 구분자에 의한 바코드 출력 형식
  1182. // t : "ATC" , p : 산제 바코드, e : blank
  1183. if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "t" ) {
  1184. sSndMsg += astfPrintOut(390, 40, 6, "ATC","");
  1185. } else if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "p") {
  1186. //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode" , model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode") + iPoint );
  1187. sSndMsg += astfBarCode_Code39(390, 40, "N", 70, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode"));
  1188. } else {
  1189. // 공백
  1190. }
  1191. //sSndMsg += astfBarCode_Code39(390, 40, "N", 70, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode"));
  1192. //환자번호(투약번호)
  1193. //sSndMsg += astfPrintOut(30, 85, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid") +
  1194. // " (" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno") + reprint+")","");
  1195. //환자번호
  1196. sSndMsg += astfPrintOut(30, 85, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid") ,"");
  1197. //(투약번호)=>20091014 이선경 : 크고 진하게 변경
  1198. sSndMsg += astfPrintOut(130, 85, 6, " (" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno") + ")","");
  1199. //(재)성별나이
  1200. sSndMsg += astfPrintOut(280, 85, 3, reprint+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sexage"),"");
  1201. //처방과약어명
  1202. sSndMsg += astfPrintOut(30, 135, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/deptengabbr"),"");
  1203. //의사명
  1204. sSndMsg += astfPrintOut(120, 135, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/orddrnm"),"");
  1205. //처방일자
  1206. sSndMsg += astfPrintOut(270, 135, 3, fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd")),"");
  1207. //페이지수
  1208. sSndMsg += astfPrintOut(430, 135, 3, iPageCnt+"/"+iTotalPageNum,"");
  1209. //바코드
  1210. // 20101101_laboru_경북대병원_바코드 아래 내용 삭제
  1211. //sSndMsg += astfPrintOut(510, 130, 3, "*"+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode")+"*","");
  1212. //선그리기ㅋ
  1213. // 20101101_laboru_경북대병원_라벨 하단 안내문구 삭제
  1214. /*
  1215. sSndMsg += astfGraphicBox(5, 180, 815, 0, 4);
  1216. if(PrnKind == "2" || PrnKind == "7") {
  1217. sSndMsg += astfPrintOut(20, 600, 2, "*의약품은 그 특성상 보관및관리가 엄격해야하므로, ");
  1218. sSndMsg += astfPrintOut(20, 630, 2, " 일단 조제투약된 약은 반납할 수 없습니다.");
  1219. } else {
  1220. sSndMsg += astfPrintOut(20, 630, 2, "*의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다.");
  1221. }
  1222. */
  1223. //////////////////////////////////////////////////
  1224. // 라벨 하단내용 //
  1225. /////////////////////////////////////////////////
  1226. if( fChkSumcls(iPoint)){
  1227. //단독라벨출력
  1228. fIndependPrint();
  1229. } else {
  1230. //일반라벨출력
  1231. fGnrlPrint();
  1232. }
  1233. //종료(매수)
  1234. sSndMsg += astfEndFormat(0);
  1235. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  1236. BarOCX.SendMsg(sSndMsg);
  1237. BarOCX.PortClose();
  1238. sSndMsg = "";
  1239. } else {
  1240. BarOCX.SendMessage(sSndMsg);
  1241. //BarOCX.PortClose();
  1242. sSndMsg = "";
  1243. }
  1244. // 2010.02.17 pymi
  1245. if(nextPage) {
  1246. fGnrlPrintnm(nCnt, bordflag);
  1247. nextPage = false;
  1248. nCnt = 0;
  1249. bordflag = "";
  1250. }
  1251. // (e)
  1252. if(iPoint == getNodesetCount("/root/main/lbllist/lbllist")) {
  1253. iTotalPageNum = 0;
  1254. iPageCnt = 0;
  1255. }
  1256. }
  1257. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  1258. } else {
  1259. BarOCX.PortClose();
  1260. //alert("close 2");
  1261. }
  1262. model.refresh();
  1263. }
  1264. /**
  1265. *
  1266. */
  1267. function fIndependPrint() {
  1268. //약종류(내복약/주사약/외용약)
  1269. sSndMsg += astfPrintOut(30, 230, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  1270. //라벨내용
  1271. var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
  1272. var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
  1273. var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
  1274. var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  1275. var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");//처방일수
  1276. var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
  1277. var packunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/packunit"); //약품마스터의 수량단위
  1278. if (drugkindnm == "[주사약]"){
  1279. //용법2
  1280. sSndMsg += astfPrintOut(30, 300, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),"");
  1281. } else if (drugkindnm == "[외용약]"){
  1282. //sSndMsg += astfPrintOut(210, 230, 7, "1일 "+tims+"회 "+fChkFloat(qty)+"개씩 "+dayno+"일분","");
  1283. //용법1
  1284. //sSndMsg += astfPrintOut(30, 300, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
  1285. // + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"),"");
  1286. //용법2
  1287. //sSndMsg += astfPrintOut(30, 370, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),"");
  1288. //이선경 2008-08-20 start(용법이 짤리지 않고 출력되도록)
  1289. var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
  1290. + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") + " " + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4");
  1291. if(val.length > 22) {
  1292. sSndMsg += astfPrintOut(30, 300, 7, val.substring(0, 22),"");
  1293. if(val.substring(0, 22).length > 22) {
  1294. sSndMsg += astfPrintOut(30, 370, 7, val.substring(22, 50),"");
  1295. sSndMsg += astfPrintOut(30, 440, 7, val.substring(50, val.length),"");
  1296. } else {
  1297. sSndMsg += astfPrintOut(30, 370, 7, val.substring(22, val.length),"");
  1298. }
  1299. } else {
  1300. sSndMsg += astfPrintOut(30, 300, 7, val.substring(0, 22),"");
  1301. }
  1302. //이선경 2008-08-20 end(용법이 짤리지 않고 출력되도록)
  1303. } else if (drugkindnm == "[내복약]"){
  1304. var sumcls = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  1305. var atcyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atcyn");
  1306. alert("atcyn");
  1307. if( sumcls == "DM" || sumcls == "DS" || sumcls == "DT" || sumcls == "DX"){ //20091110 이선경 수정 : 라벨그룹이 마약(경구), 수제, ptp, 기타약일경우 약품마스터의 수량단위를 출력
  1308. var tmpqty = Math.round(qty * 10) / 10;
  1309. if(packunit == "T" || packunit == "C") {
  1310. sSndMsg += astfPrintOut(210, 230, 7, mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"정씩 "+(dayno*mthddayno)+"일분","");
  1311. } else {
  1312. sSndMsg += astfPrintOut(210, 230, 7, mthddayno + "일 "+tims+"회 "+fChkFloat(tmpqty)+ packunit +"씩 "+(dayno*mthddayno)+"일분","");
  1313. }
  1314. } else {
  1315. sSndMsg += astfPrintOut(210, 230, 7, mthddayno + "일 "+tims+"회 "+fChkFloat(qty)+"포[정]씩 "+(dayno*mthddayno)+"일분","");
  1316. }
  1317. //sSndMsg += astfPrintOut(210, 230, 7, "1일 "+tims+"회 "+fChkFloat(qty)+packunit+dayno+"일분","");
  1318. //용법1
  1319. sSndMsg += astfPrintOut(30, 300, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
  1320. + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"),"");
  1321. //용법2
  1322. sSndMsg += astfPrintOut(30, 370, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),"");
  1323. }
  1324. var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1");
  1325. lblcnts1 = lblcnts1.setReplaceWord("~", "-"); //20090728
  1326. // 2010.03.22 pymi
  1327. if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugflag") == "L" && !fChkSumcls(iPoint) && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
  1328. var val = "";
  1329. } else {
  1330. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  1331. var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty"))
  1332. +" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
  1333. /*
  1334. var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd")
  1335. +" "+parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty"))
  1336. +" "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
  1337. */
  1338. }
  1339. // (e)
  1340. if(lblcnts1.length > 28){
  1341. //주의사항
  1342. sSndMsg += astfPrintOut(30, 450, 5, lblcnts1.substring(0,24),"");
  1343. sSndMsg += astfPrintOut(30, 510, 5, lblcnts1.substring(24,lblcnts1.length),"");
  1344. //약정보
  1345. sSndMsg += astfPrintOut(30, 570, 4, val, "");
  1346. } else {
  1347. //주의사항
  1348. sSndMsg += astfPrintOut(30, 450, 5, lblcnts1,"");
  1349. //약정보
  1350. sSndMsg += astfPrintOut(30, 510, 4, val, "");
  1351. }
  1352. }
  1353. /**
  1354. *
  1355. */
  1356. function fGnrlPrint() {
  1357. var cnt = 0;
  1358. var drugcnt = 0;
  1359. var ordCnt = 0; // 2010.02.10 pymi
  1360. //약종류(내복약/주사약/외용약)
  1361. sSndMsg += astfPrintOut(30, 220, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  1362. //라벨내용
  1363. var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
  1364. var qty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqty");
  1365. var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
  1366. var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  1367. var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");//처방일수
  1368. var mthddayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayno"); //용법일수
  1369. //약코드 출력
  1370. var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
  1371. var dayno1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");
  1372. var mthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1");
  1373. var mthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2");
  1374. var mthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3");
  1375. var mthdcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
  1376. if (drugkindnm != "[내복약]"){
  1377. if (drugkindnm == "[주사약]"){
  1378. //용법2
  1379. sSndMsg += astfPrintOut(30, 290, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),"");
  1380. } else if (drugkindnm == "[외용약]"){
  1381. //sSndMsg += astfPrintOut(210, 220, 7, "1일 "+tims+"회 "+qty+"개씩 "+dayno+"일분","");
  1382. //용법1
  1383. sSndMsg += astfPrintOut(30, 290, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
  1384. + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"),"");
  1385. //용법2
  1386. sSndMsg += astfPrintOut(30, 360, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),"");
  1387. }
  1388. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  1389. var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
  1390. var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  1391. var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
  1392. var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
  1393. var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
  1394. if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
  1395. && !fChkSumcls(j)){
  1396. //if(model.getValue("/root/main/lbllist/lbllist["+j+"]/fst_prnt") == "Y"){
  1397. var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims") ;
  1398. prcpqty = Math.ceil( prcpqty * tims*1000)/1000;
  1399. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  1400. var val = prcpqty
  1401. +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
  1402. /*
  1403. var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
  1404. +" "+prcpqty
  1405. +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
  1406. */
  1407. sSndMsg += astfPrintOut(30+((cnt%2)*380), 440+((parseInt(cnt/2, 10))*40), 2, val, "");
  1408. //}
  1409. cnt++;
  1410. } else {
  1411. break;
  1412. }
  1413. if(cnt == 14){ // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
  1414. j++;
  1415. break;
  1416. }
  1417. }
  1418. iPoint = j-1;
  1419. } else if (drugkindnm == "[내복약]"){
  1420. var lbltims =0;
  1421. lbl_tims = mthd2.split(",");
  1422. if ( mthdcd == "ZZZ" ){
  1423. lbltims = tims;
  1424. } else if ( mthd3.indexOf("취침") > -1 ) {
  1425. lbltims = lbl_tims.length +1;
  1426. } else if(mthd2.indexOf("마다") > -1){
  1427. lbltims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  1428. } else if(mthd1.indexOf("의사지시") > -1){
  1429. lbltims = tims;
  1430. } else {
  1431. lbltims = lbl_tims.length;
  1432. }
  1433. tims = lbltims;
  1434. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  1435. var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
  1436. var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  1437. var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
  1438. var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
  1439. var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
  1440. if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
  1441. && !fChkSumcls(j)){
  1442. drugcnt++;
  1443. } else {
  1444. break;
  1445. }
  1446. }
  1447. /*if ( drugcnt == 1 ){
  1448. if(lbltims == 1) {
  1449. if(mthd2.indexOf("마다") == -1) {
  1450. sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+lbltims+ "회"+fChkFloat(qty)+"포[정]씩 "+(dayno * mthddayno)+"일분","");
  1451. prcpqty = prcpqty * lbltims;
  1452. } else {
  1453. sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+tims+ "회"+fChkFloat(qty)+"포[정]씩 "+(dayno * mthddayno)+"일분","");
  1454. prcpqty = prcpqty * tims;
  1455. }
  1456. } else {
  1457. sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+lbltims+ "회"+fChkFloat(qty)+"포[정]씩 "+(dayno * mthddayno)+"일분","");
  1458. prcpqty = prcpqty * lbltims;
  1459. }
  1460. } else {
  1461. */
  1462. if(lbltims == 1) {
  1463. if(mthd2.indexOf("마다") == -1) {
  1464. sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분","");
  1465. } else {
  1466. sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+tims+ "회 1포씩 "+(dayno * mthddayno)+"일분","");
  1467. }
  1468. } else {
  1469. sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분","");
  1470. }
  1471. //}
  1472. //용법1
  1473. //if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3") =="취침전에" ){
  1474. // sSndMsg += astfPrintOut(30, 290, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2")
  1475. // + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3"),"");
  1476. //} else {
  1477. sSndMsg += astfPrintOut(30, 290, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd1") + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd2")
  1478. + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthd3"),"");
  1479. //}
  1480. //용법2
  1481. sSndMsg += astfPrintOut(30, 360, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts4"),"");
  1482. //}
  1483. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  1484. var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
  1485. var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  1486. var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
  1487. var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
  1488. var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
  1489. if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
  1490. && !fChkSumcls(j)){
  1491. //if(model.getValue("/root/main/lbllist/lbllist["+j+"]/fst_prnt") == "Y"){
  1492. /* var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims") ;
  1493. prcpqty = Math.ceil( prcpqty * tims*1000)/1000;
  1494. var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
  1495. +" "+prcpqty
  1496. +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
  1497. sSndMsg += astfPrintOut(30+((cnt%2)*380), 440+((parseInt(cnt/2, 10))*40), 2, val, "");*/
  1498. //}
  1499. //cnt++;
  1500. // 2010.02.17 pymi
  1501. var lblcnts2 = model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2");
  1502. bordflag += j + "/"; // 포장라벨 처방코드 순서
  1503. if(lblcnts2.length > 0) {
  1504. sSndMsg += astfPrintOut(30, 440 +(60 * ordCnt), 4, lblcnts2, "");
  1505. //if(ordCnt == 0) {sSndMsg += astfPrintOut(30, 440, 4, lblcnts2, ""); }
  1506. //if(ordCnt == 1) {sSndMsg += astfPrintOut(30, 500, 4, lblcnts2, ""); }
  1507. //if(ordCnt == 2) {sSndMsg += astfPrintOut(30, 560, 4, lblcnts2, ""); }
  1508. ordCnt++; // 포장라벨 갯수
  1509. }
  1510. // (e)
  1511. } else {
  1512. // 용법이 바뀌는 시점 2010.02.10 pymi
  1513. // 처방출력
  1514. fGnrlPrintnm(ordCnt, bordflag);
  1515. bordflag = "";
  1516. // (e)
  1517. break;
  1518. }
  1519. //if(cnt == 8){
  1520. if(ordCnt == 3){ //2010.02.17 pymi
  1521. j++;
  1522. if(j <= getNodesetCount("/root/main/lbllist/lbllist")) {
  1523. var drugkind3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
  1524. var dayno3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  1525. var mthd7 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
  1526. var mthd8 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
  1527. var mthd9 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
  1528. if((drugkind1 == drugkind3) && (dayno1 == dayno3) && (mthd1 == mthd7 && mthd2 == mthd8 && mthd3 == mthd9)
  1529. && !fChkSumcls(j)){
  1530. // 페이지 넘겨서도 용법 바뀌지 않으면 계속 진행
  1531. } else {
  1532. // 페이지 넘길때 용법이 바뀌면 처방 출력
  1533. //종료(매수)
  1534. nextPage = true;
  1535. nCnt = ordCnt;
  1536. //fGnrlPrintnm(ordCnt, bordflag);
  1537. }
  1538. }
  1539. // (e)
  1540. break;
  1541. }
  1542. }
  1543. iPoint = j-1;
  1544. // 용법 바뀌지 않는 마지막 처방 출력 2010.02.17 pymi
  1545. if(iPoint == getNodesetCount("/root/main/lbllist/lbllist") ) {
  1546. if(ordCnt == 3) {
  1547. nextPage = true;
  1548. nCnt = ordCnt;
  1549. }
  1550. else {
  1551. fGnrlPrintnm(ordCnt, bordflag);
  1552. bordflag = "";
  1553. }
  1554. }
  1555. // (e)
  1556. }
  1557. }
  1558. /*
  1559. * 2010.02.17 pymi 처방출력
  1560. */
  1561. function fGnrlPrintnm(linecnt, ordflag) {
  1562. var cnt = 0;
  1563. var xValue = 440;
  1564. var valCnt = 14; // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
  1565. var lblup = false;
  1566. var xtims = 0;
  1567. var sordflag = "";
  1568. sordflag = ordflag.split("/");
  1569. if(linecnt == 1) { xValue = 490; valCnt = 6; }
  1570. if(linecnt == 2) { xValue = 550; valCnt = 2; }
  1571. if(linecnt == 3) { xValue = 440; valCnt = 8; lblup = true;}
  1572. //약종류(내복약/주사약/외용약)
  1573. for(mPoint = parseInt(sordflag[0]); mPoint <= parseInt(sordflag[sordflag.length - 2]); mPoint++) {
  1574. if(lblup) {
  1575. //시작(X, Y)
  1576. xValue = 440;
  1577. valCnt = 14; // 20101101_laboru_경북대병원_라벨 한 페이지에 최고 8개에서 14개 출력되게 변경
  1578. cnt = 0;
  1579. //
  1580. /*PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  1581. PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
  1582. PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
  1583. commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
  1584. Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
  1585. PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  1586. if(commkind == "02") {
  1587. PortNm = 1;
  1588. } else {
  1589. PortNm = 2;
  1590. }
  1591. BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);*/
  1592. //
  1593. var reprint ="";
  1594. if ( model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/lblprnttims")>0 ){
  1595. reprint ="(재)";
  1596. }
  1597. sSndMsg += astfStartFormat(0, 0, "B");
  1598. iPageCnt++;
  1599. //alert(iPageCnt);
  1600. //////////////////////////////////////////////////
  1601. // 라벨 상단내용 //
  1602. /////////////////////////////////////////////////
  1603. //병실
  1604. sSndMsg += astfPrintOut(30, 30, 6, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/roomcd"),"");
  1605. //환자명
  1606. sSndMsg += astfPrintOut(180, 30, 6, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/patnm").substring(0,5),"");
  1607. //바코드(변환)
  1608. // 20101101_laboru_경북대병원_atc drugkind 구분자에 의한 바코드 출력 형식
  1609. // t : "ATC" , p : 산제 바코드, e : blank
  1610. if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "t" ) {
  1611. sSndMsg += astfPrintOut(390, 40, 6, "ATC","");
  1612. } else if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/atc_drugkind") == "p") {
  1613. //model.setValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode" , model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode") + iPoint );
  1614. sSndMsg += astfBarCode_Code39(390, 40, "N", 70, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/barcode"));
  1615. } else {
  1616. // 공백
  1617. }
  1618. //sSndMsg += astfBarCode_Code39(390, 40, "N", 70, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/barcode"));
  1619. //환자번호(투약번호)
  1620. //sSndMsg += astfPrintOut(30, 85, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid") +
  1621. // " (" + model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno") + reprint+")","");
  1622. //환자번호
  1623. sSndMsg += astfPrintOut(30, 85, 3, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/pid") ,"");
  1624. //(투약번호)=>20091014 이선경 : 크고 진하게 변경
  1625. sSndMsg += astfPrintOut(130, 85, 6, " (" + model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugno") + ")","");
  1626. //(재)성별나이
  1627. sSndMsg += astfPrintOut(280, 85, 3, reprint+model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/sexage"),"");
  1628. //처방과약어명
  1629. sSndMsg += astfPrintOut(30, 135, 3, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/deptengabbr"),"");
  1630. //의사명
  1631. sSndMsg += astfPrintOut(120, 135, 3, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/orddrnm"),"");
  1632. //처방일자
  1633. sSndMsg += astfPrintOut(270, 135, 3, fDateFormat(model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdd")),"");
  1634. //페이지수
  1635. sSndMsg += astfPrintOut(430, 135, 3, iPageCnt+"/"+iTotalPageNum,"");
  1636. //바코드
  1637. // 20101101_laboru_경북대병원_바코드 아래 내용 삭제
  1638. //sSndMsg += astfPrintOut(510, 130, 3, "*"+model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/barcode")+"*","");
  1639. //선그리기
  1640. // 201011101_laboru_경북대병원_라벨 하단 안내문구 삭제
  1641. /*
  1642. sSndMsg += astfGraphicBox(5, 180, 815, 0, 4);
  1643. if(PrnKind == "2" || PrnKind == "7") {
  1644. sSndMsg += astfPrintOut(20, 600, 2, "*의약품은 그 특성상 보관및관리가 엄격해야하므로, ");
  1645. sSndMsg += astfPrintOut(20, 630, 2, " 일단 조제투약된 약은 반납할 수 없습니다.");
  1646. } else {
  1647. sSndMsg += astfPrintOut(20, 630, 2, "*의약품은 그 특성상 보관및관리가 엄격해야하므로, 일단 조제투약된 약은 반납할 수 없습니다.");
  1648. }
  1649. */
  1650. lblup = false;
  1651. //}
  1652. sSndMsg += astfPrintOut(30, 220, 7, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm"),"");
  1653. //라벨내용
  1654. var drugkindnm = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm");
  1655. var qty = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpqty");
  1656. var dayqty = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/dayprcpqty");
  1657. var tims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims");
  1658. var dayno = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdayno");//처방일수
  1659. var mthddayno = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/dayno"); //용법일수
  1660. //약코드 출력
  1661. var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm");
  1662. var dayno1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdayno");
  1663. var mthd1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd1");
  1664. var mthd2 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd2");
  1665. var mthd3 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd3");
  1666. var mthdcd = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthdcd");
  1667. var lbltims =0;
  1668. lbl_tims = mthd2.split(",");
  1669. if ( mthdcd == "ZZZ" ){
  1670. lbltims = tims;
  1671. } else if ( mthd3.indexOf("취침") > -1 ) {
  1672. lbltims = lbl_tims.length +1;
  1673. } else if(mthd2.indexOf("마다") > -1){
  1674. lbltims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims");
  1675. } else {
  1676. lbltims = lbl_tims.length;
  1677. }
  1678. tims = lbltims;
  1679. xtims = tims;
  1680. if(lbltims == 1) {
  1681. if(mthd2.indexOf("마다") == -1) {
  1682. sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno * mthddayno)+"일분","");
  1683. } else {
  1684. sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+tims+ "회 1포씩 "+(dayno*mthddayno)+"일분","");
  1685. }
  1686. } else {
  1687. sSndMsg += astfPrintOut(210, 220, 7, mthddayno + "일 "+lbltims+ "회 1포씩 "+(dayno*mthddayno)+"일분","");
  1688. }
  1689. //용법1
  1690. var val = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd1") + model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd2")
  1691. + model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd3");
  1692. sSndMsg += astfPrintOut(30, 290, 7, val,"");
  1693. //용법2
  1694. sSndMsg += astfPrintOut(30, 360, 7, model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthdcnts4"),"");
  1695. } else{
  1696. //약코드 출력
  1697. var drugkind1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/drugkindnm");
  1698. var dayno1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcpdayno");
  1699. var mthd1 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd1");
  1700. var mthd2 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd2");
  1701. var mthd3 = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthd3");
  1702. var mthdcd = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/mthdcd");
  1703. var tims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims");
  1704. var lbltims =0;
  1705. lbl_tims = mthd2.split(",");
  1706. if ( mthdcd == "ZZZ" ){
  1707. lbltims = tims;
  1708. } else if ( mthd3.indexOf("취침") > -1 ) {
  1709. lbltims = lbl_tims.length +1;
  1710. } else if(mthd2.indexOf("마다") > -1){
  1711. lbltims = model.getValue("/root/main/lbllist/lbllist["+mPoint+"]/prcptims");
  1712. } else {
  1713. lbltims = lbl_tims.length;
  1714. }
  1715. tims = lbltims;
  1716. xtims = tims;
  1717. }
  1718. for(var j = mPoint; j <= parseInt(sordflag[sordflag.length - 2]) ; j++){
  1719. //var drugkind2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/drugkindnm");
  1720. //var dayno2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  1721. //var mthd4 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd1");
  1722. //var mthd5 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd2");
  1723. //var mthd6 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthd3");
  1724. //if((drugkind1 == drugkind2) && (dayno1 == dayno2) && (mthd1 == mthd4 && mthd2 == mthd5 && mthd3 == mthd6)
  1725. // && !fChkSumcls(j)){
  1726. //if(model.getValue("/root/main/lbllist/lbllist["+j+"]/fst_prnt") == "Y"){
  1727. var prcpqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/totdrugqty")/model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
  1728. prcpqty = Math.ceil( prcpqty * xtims*1000)/1000 ;
  1729. //20100224 이선경 수정 : zebra는 명칭 길게 나오도록 함 사토만 잘라서 출력
  1730. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  1731. // 2010.03.22 pymi
  1732. if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/drugflag") == "L" && !fChkSumcls(j) && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
  1733. var val = "";
  1734. } else {
  1735. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  1736. var val = prcpqty
  1737. +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
  1738. /*
  1739. var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
  1740. +" "+prcpqty
  1741. +" "+(model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm")).substring(0,6);
  1742. */
  1743. }
  1744. // (e)
  1745. } else {
  1746. // 2010.03.22 pymi
  1747. if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/drugflag") == "L" && !fChkSumcls(j) && model.getValue("/root/hidden/srchinfo/lbl5") == "Y") {
  1748. var val = "";
  1749. } else {
  1750. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  1751. var val = prcpqty
  1752. +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  1753. /*
  1754. var val = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd")
  1755. +" "+prcpqty
  1756. +" "+model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  1757. */
  1758. }
  1759. // (e)
  1760. }
  1761. sSndMsg += astfPrintOut(30+((cnt%2)*380), xValue+((parseInt(cnt/2, 10))*40), 2, val, "");
  1762. //}
  1763. cnt++;
  1764. //} else {
  1765. // break;
  1766. //}
  1767. //if(cnt == 8){
  1768. if(cnt == valCnt){
  1769. j++;
  1770. lblup = true;
  1771. break;
  1772. }
  1773. }
  1774. mPoint = j-1;
  1775. //var s ="복용기간: "+(rcptdd.toDate("YYYYMMDD")).getDateFormat("YYYY/MM/DD") +" - "+ ((rcptdd.toDate("YYYYMMDD")).getAddDate( parseInt(dayno),"D")).getDateFormat("YYYY/MM/DD") ;
  1776. //sSndMsg +=astfPrintOut(30, 630, 3, s);
  1777. //종료(매수)
  1778. sSndMsg += astfEndFormat(0);
  1779. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  1780. BarOCX.SendMsg(sSndMsg);
  1781. BarOCX.PortClose();
  1782. sSndMsg = "";
  1783. } else {
  1784. BarOCX.SendMessage(sSndMsg);
  1785. //BarOCX.PortClose();
  1786. sSndMsg = "";
  1787. }
  1788. }
  1789. model.refresh();
  1790. }
  1791. /**
  1792. *
  1793. */
  1794. function fDateFormat(sDD, sYMD) {
  1795. if(sYMD == "MD"){
  1796. return sDD.substr(4,2)+"/"+sDD.substr(6,2);
  1797. } else {
  1798. return sDD.substr(0,4)+"/"+sDD.substr(4,2)+"/"+sDD.substr(6,2);
  1799. }
  1800. }
  1801. /**
  1802. *
  1803. */
  1804. function fPrntTime(sDD, sTM) {
  1805. if(PrnKind == "2" || PrnKind == "7" ) {
  1806. return sDD.substr(4,2)+"/"+sDD.substr(6,2)+" "+sTM.substr(0,2)+":"+sTM.substr(2,2);
  1807. } else {
  1808. return sDD.substr(4,2)+" / "+sDD.substr(6,2)+" "+sTM.substr(0,2)+":"+sTM.substr(2,2)+":"+sTM.substr(4,2);
  1809. }
  1810. }
  1811. /**
  1812. *
  1813. */
  1814. function fChkFloat(qty) {
  1815. var fQty = parseFloat(qty);
  1816. var fRst = "";
  1817. if(fQty%1 == 0){
  1818. fRst = parseInt(qty);
  1819. } else {
  1820. fRst = qty;
  1821. }
  1822. return fRst;
  1823. }
  1824. /**
  1825. *
  1826. */
  1827. function fChkSumcls(cnt) {
  1828. var chk = false;
  1829. var sSumcls = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/sumcls");
  1830. var sSnglyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/atcifsnglyn");
  1831. var sDrugindependpackflag = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/drugindependpackflag");
  1832. if(sSumcls == "DI" || sSumcls == "DS"|| sSumcls == "DX"|| sSumcls == "DT" || sSumcls == "DM" || sSumcls == "DP"
  1833. || sSumcls == "IH"|| sSumcls == "IO" || sSumcls == "IS"|| sSumcls == "IX"|| sSumcls == "X" || sSumcls == "I"){
  1834. chk = true;
  1835. }
  1836. if ( sSumcls == "D" && sSnglyn =="Y" ) {
  1837. chk = true;
  1838. }
  1839. if ( sDrugindependpackflag =="Y"){
  1840. chk = true;
  1841. }
  1842. //2010-06-29 [보관방법:냉장주사/고위험주사] 단독출력
  1843. var sDngryn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/dngryn"); //고위험주사 여부
  1844. var sKeepmthdyn = model.getValue("/root/main/lbllist/lbllist["+cnt+"]/keepmthdyn"); //냉장주사 여부
  1845. if(sDngryn == "Y" || sKeepmthdyn=="Y" ) chk = true;
  1846. return chk;
  1847. }
  1848. /**
  1849. * 물약라벨출력
  1850. */
  1851. function fLiquidLBLPrint() {
  1852. // Comm 설정
  1853. //BarOCX.CommPort = "1"; // 출력 Port
  1854. //BarOCX.Settings = "9600,n,8,1"; // Comm 설정
  1855. //BarOCX.Settings = "127.0.0.1"; // Comm 설정
  1856. PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  1857. PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
  1858. PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
  1859. commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
  1860. Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
  1861. PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  1862. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  1863. BarOCX = CommAX1;
  1864. } else {
  1865. BarOCX = CommAX2;
  1866. }
  1867. if(commkind == "02") {
  1868. PortNm = 1;
  1869. } else {
  1870. PortNm = 2;
  1871. }
  1872. //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
  1873. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  1874. BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);
  1875. } else {
  1876. BarOCX.CommPort = "1"; // 출력 Port
  1877. BarOCX.Settings = "9600,n,8,1"; // Comm 설정
  1878. var ocxcnt = 0;
  1879. while(!BarOCX.PortOpen() && ocxcnt < 10) {
  1880. BarOCX.PortClose();
  1881. fSleep(2000);
  1882. ocxcnt++;
  1883. }
  1884. }
  1885. var reprint ="";
  1886. for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
  1887. if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid") == "") {
  1888. return;
  1889. }
  1890. if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
  1891. reprint ="(재)";
  1892. }
  1893. //시작(X, Y)
  1894. sSndMsg += astfStartFormat(0, 0, "S");
  1895. //////////////////////////////////////////////////
  1896. // 라벨 상단내용 //
  1897. /////////////////////////////////////////////////
  1898. //병실
  1899. //sSndMsg += astfPrintOut(50, 30, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),"");
  1900. //환자명
  1901. //sSndMsg += astfPrintOut(50, 85, 6, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),"");
  1902. //내복약
  1903. //sSndMsg += astfPrintOut(250, 30, 3, "내복약","");
  1904. //처방일자
  1905. //sSndMsg += astfPrintOut(250, 70, 3, fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd")),"");
  1906. //환자번호(투약번호)
  1907. //sSndMsg += astfPrintOut(250, 110, 3, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+ " ( "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+" )","");
  1908. //선그리기
  1909. //sSndMsg += astfGraphicBox(5, 145, 465, 0, 4);
  1910. var sDD = getCurrentDate();
  1911. var sTM = getCurrentTime();
  1912. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  1913. //라벨이름(내복약/주사약/마약)
  1914. sSndMsg += astfPrintOut(20, 25, 20, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  1915. //출력일자
  1916. sSndMsg += astfPrintOut(190, 25, 21, "출력:"+fPrntTime(sDD, sTM),"");
  1917. //출력일자
  1918. sSndMsg += astfPrintOut(190, 55, 21, "처방:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  1919. } else {
  1920. //라벨이름(내복약/주사약/마약)
  1921. sSndMsg += astfPrintOut(20, 25, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  1922. //출력일자
  1923. sSndMsg += astfPrintOut(220, 25, 21, "출 력 : "+fPrntTime(sDD, sTM),"");
  1924. //출력일자
  1925. sSndMsg += astfPrintOut(220, 55, 21, "처 방 : "+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  1926. }
  1927. //병실
  1928. sSndMsg += astfPrintOut(20, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),"");
  1929. //환자이름
  1930. sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),"");
  1931. //환자번호
  1932. sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+")","");
  1933. //선그리기
  1934. sSndMsg += astfGraphicBox(5, 120, 465, 0, 4);
  1935. //////////////////////////////////////////////////
  1936. // 라벨 하단내용 //
  1937. /////////////////////////////////////////////////
  1938. //라벨내용
  1939. var dayqty = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/dayprcpqty");
  1940. var qtyunit = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpqtyunit");
  1941. var tims = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims");
  1942. var dayno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno");
  1943. var qty = Math.ceil(dayqty / tims * 1000)/1000 ;
  1944. var totqty = parseInt(dayqty)*parseInt(dayno);
  1945. var mthd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts1");
  1946. var mthd2 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts2");
  1947. var mthd3 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcnts3");
  1948. //용법
  1949. if ( mthd1 == "" && mthd2 == "" && mthd3 == "" ){
  1950. //1일 X회 Xml씩 X일분
  1951. sSndMsg += astfPrintOut(40, 126, 27, "1일 "+tims+"회 "+qty+qtyunit+"씩 "+dayno+"일분","");
  1952. var val = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/abbrnm");
  1953. if (val.length > 17) {
  1954. sSndMsg += astfPrintOut(40, 171, 27, val.substring(0,17) ,"");
  1955. sSndMsg += astfPrintOut(40, 210, 27, val.substring(17,val.length) ,"");
  1956. } else {
  1957. sSndMsg += astfPrintOut(40, 210, 27, val ,"");
  1958. }
  1959. } else {
  1960. //1일 X회 Xml씩 X일분
  1961. var val = mthd1 + " " + mthd2 + " " + mthd3;
  1962. if (val.length > 17) {
  1963. sSndMsg += astfPrintOut(40, 126, 27, "1일 "+tims+"회 "+qty+qtyunit+"씩 "+dayno+"일분","");
  1964. sSndMsg += astfPrintOut(40, 171, 27, val.substring(0,17) ,"");
  1965. sSndMsg += astfPrintOut(40, 210, 27, val.substring(17,val.length) ,"");
  1966. } else {
  1967. sSndMsg += astfPrintOut(40, 165, 27, "1일 "+tims+"회 "+qty+qtyunit+"씩 "+dayno+"일분","");
  1968. sSndMsg += astfPrintOut(40, 210, 27, val ,"");
  1969. }
  1970. }
  1971. //용법
  1972. //sSndMsg += astfPrintOut(40, 210, 27, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/abbrnm"),"");
  1973. //약품코드 + 총용량
  1974. //sSndMsg += astfPrintOut(40, 255, 27, "[ "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd")+" ] "+totqty,"");
  1975. //약품코드 + 총용량 + 약품명
  1976. var prcpnm = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpnm");
  1977. if(PrnKind == "2") {
  1978. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  1979. var val = parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")) + " " +
  1980. prcpnm;
  1981. /*
  1982. var val = "[ "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd")+" ] "+
  1983. parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")) + " " +
  1984. prcpnm;
  1985. */
  1986. sSndMsg += astfPrintOut(20, 255, 27, val,"");
  1987. } else {
  1988. if(prcpnm.length > 12) {
  1989. prcpnm = prcpnm.substring(0,12);
  1990. }
  1991. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  1992. sSndMsg += astfPrintOut(20, 255, 27, parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")) + " " +
  1993. prcpnm,"");
  1994. /*
  1995. sSndMsg += astfPrintOut(20, 255, 27, "[ "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpcd")+" ] "+
  1996. parseFloat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/totdrugqty")) + " " +
  1997. prcpnm,"");
  1998. */
  1999. }
  2000. //보관방법
  2001. var lblcnts1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblcnts1");
  2002. lblcnts1 = lblcnts1.setReplaceWord("~", "-"); //20090728
  2003. if ( lblcnts1 == "" ) {
  2004. if(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd") != ""){
  2005. sSndMsg += astfPrintOut(40, 300, 27, "< "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd")+" >","");
  2006. }
  2007. } else {
  2008. if(lblcnts1.length > 17){
  2009. //주의사항
  2010. sSndMsg += astfPrintOut(20, 285, 3, lblcnts1.substring(0,17),"");
  2011. sSndMsg += astfPrintOut(20, 315, 3, lblcnts1.substring(17,lblcnts1.length),"");
  2012. } else {
  2013. //주의사항
  2014. sSndMsg += astfPrintOut(40, 300, 27, lblcnts1,"");
  2015. }
  2016. }
  2017. //종료(매수)
  2018. sSndMsg += astfEndFormat(0);
  2019. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  2020. BarOCX.SendMsg(sSndMsg);
  2021. BarOCX.PortClose();
  2022. sSndMsg = "";
  2023. } else {
  2024. BarOCX.SendMessage(sSndMsg);
  2025. //BarOCX.PortClose();
  2026. sSndMsg = "";
  2027. }
  2028. }
  2029. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  2030. } else {
  2031. BarOCX.PortClose();
  2032. //alert("close 3");
  2033. }
  2034. model.refresh();
  2035. }
  2036. /*
  2037. * 산제처방을 용법코드별로 라벨출력
  2038. */
  2039. function fPowderlLBLPrint() {
  2040. PrnKind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
  2041. PrnMarginLeft = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/left");
  2042. PrnMarginTop = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/blank/top");
  2043. commkind = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/commkind");
  2044. Comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
  2045. PrtNm = model.getvalue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm01/setupval");
  2046. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  2047. BarOCX = CommAX1;
  2048. } else {
  2049. BarOCX = CommAX2;
  2050. }
  2051. if(commkind == "02") {
  2052. PortNm = 1;
  2053. } else {
  2054. PortNm = 2;
  2055. }
  2056. //alert("PrnKind : " + PrnKind + "\nportnm:" + PortNm + "\nprtnm:" + PrtNm + "\ncomm:" + Comm);
  2057. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  2058. BarOCX.setPrt(PrnKind, PortNm, PrtNm, Comm);
  2059. } else {
  2060. BarOCX.CommPort = "1"; // 출력 Port
  2061. BarOCX.Settings = "9600,n,8,1"; // Comm 설정
  2062. var ocxcnt = 0;
  2063. while(!BarOCX.PortOpen() && ocxcnt < 10) {
  2064. BarOCX.PortClose();
  2065. fSleep(2000);
  2066. ocxcnt++;
  2067. }
  2068. }
  2069. var sDD = getCurrentDate();
  2070. var sTM = getCurrentTime();
  2071. var reprint ="";
  2072. totcnt = 0;
  2073. pg = 0;
  2074. totpg = 0;
  2075. for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){
  2076. if(model.getValue("/root/main/lbllist/lbllist["+i+"]/pid") == "") {
  2077. return;
  2078. }
  2079. if ( model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DI" && model.getValue("/root/main/lbllist/lbllist["+i+"]/lblgrup") != "DS" ){
  2080. totcnt++;
  2081. }
  2082. }
  2083. // 2010.02.12 pymi
  2084. if( (totcnt%6) != 0) totcnt ++; // 라벨찍기 전에 한줄 띄우기
  2085. for ( var i = 1; i <= getNodesetCount("/root/main/lbllist/lbllist") ; i++){
  2086. if(model.getValue("/root/main/lbllist/lbllist["+ i +"]/lblcnts2").length > 0) { totcnt++; vlblcnt = true;}
  2087. }
  2088. // (e)
  2089. for(iPoint = 1; iPoint <= getNodesetCount("/root/main/lbllist/lbllist") ; iPoint++){
  2090. if ( model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/lblprnttims")>0 ){
  2091. reprint ="(재)";
  2092. }
  2093. //시작(X, Y)
  2094. sSndMsg += astfStartFormat(0, 0, "S");
  2095. if(PrnKind == "2" || PrnKind == "7") {
  2096. //라벨이름(내복약/주사약/마약)
  2097. sSndMsg += astfPrintOut(20, 25, 21, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  2098. //출력일자
  2099. sSndMsg += astfPrintOut(190, 25, 21, "출력:"+fPrntTime(sDD, sTM),"");
  2100. //출력일자
  2101. sSndMsg += astfPrintOut(190, 55, 21, "처방:"+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  2102. } else {
  2103. //라벨이름(내복약/주사약/마약)
  2104. sSndMsg += astfPrintOut(20, 25, 7, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm"),"");
  2105. //출력일자
  2106. sSndMsg += astfPrintOut(220, 25, 21, "출 력 : "+fPrntTime(sDD, sTM),"");
  2107. //출력일자
  2108. sSndMsg += astfPrintOut(220, 55, 21, "처 방 : "+fDateFormat(model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdd"), "MD"),"");
  2109. }
  2110. //병실
  2111. sSndMsg += astfPrintOut(20, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/roomcd"),"");
  2112. //환자이름
  2113. sSndMsg += astfPrintOut(120, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/patnm"),"");
  2114. //환자번호
  2115. sSndMsg += astfPrintOut(240, 80, 31, model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/pid")+" ("+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugno")+reprint+")","");
  2116. //선그리기
  2117. sSndMsg += astfGraphicBox(5, 120, 465, 0, 4);
  2118. var sDrugKindcd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/drugkindnm");
  2119. var sMixno = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpmixno");
  2120. if(sDrugKindcd == "[내복약]"){
  2121. fInPwdDrugLBL();
  2122. // 2010.02.19 pymi
  2123. if((vcnt < 4) && (ordflag.length > 0)) {
  2124. mlblcnt1 = true;
  2125. fPrntLblCnt1(vcnt, ordflag);
  2126. ordflag = "";
  2127. vcnt = 0;
  2128. }
  2129. // (e)
  2130. }
  2131. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  2132. BarOCX.SendMsg(sSndMsg);
  2133. BarOCX.PortClose();
  2134. sSndMsg = "";
  2135. } else {
  2136. BarOCX.SendMessage(sSndMsg);
  2137. //BarOCX.PortClose();
  2138. sSndMsg = "";
  2139. }
  2140. // 2010.02.11 pymi
  2141. if(sDrugKindcd == "[내복약]"){
  2142. if( iPoint == getNodesetCount("/root/main/lbllist/lbllist") ) {
  2143. if(vlblcnt && (!mlblcnt1) && (ordflag.length > 0)) {
  2144. fPrntLblCnt1(vcnt, ordflag);
  2145. ordflag = "";
  2146. vcnt = 0;
  2147. }
  2148. }
  2149. /*else if( iPoint < getNodesetCount("/root/main/lbllist/lbllist") ){
  2150. if(vcnt > 4 && (ordflag.length > 0) ) {
  2151. fPrntLblCnt1(vcnt, ordflag);
  2152. ordflag = "";
  2153. vcnt = 0;
  2154. }
  2155. }*/
  2156. mlblcnt1= false;
  2157. }
  2158. // (e)
  2159. }
  2160. if(PrnKind == "2" || PrnKind == "7" ) {//sato
  2161. } else {
  2162. BarOCX.PortClose();
  2163. //alert("close 4");
  2164. }
  2165. model.refresh();
  2166. }
  2167. /**
  2168. * 산제 용법코드별 라벨상세(용법코드별 분류)
  2169. */
  2170. function fInPwdDrugLBL() {
  2171. // var sSumCls1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/sumcls");
  2172. var sMthdcd1 = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/mthdcd");
  2173. var qty = "";
  2174. var dayqty = "";
  2175. var qtyunit = "";
  2176. var tims = "";
  2177. var dayno = "";
  2178. var cnt = 0;
  2179. var chgMth = false; // 2010.02.17 pymi
  2180. for(var j = iPoint; j <= getNodesetCount("/root/main/lbllist/lbllist") ; j++){
  2181. //if(cnt != 0 && fChkIpwdDrug(j)){
  2182. // break;
  2183. //}
  2184. // sSumCls2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/sumcls");
  2185. sMthdcd2 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
  2186. qty = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqty");
  2187. dayqty = model.getValue("/root/main/lbllist/lbllist["+j+"]/dayprcpqty");
  2188. qtyunit = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpqtyunit");
  2189. tims = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcptims");
  2190. dayno = model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpdayno");
  2191. if(PrnKind == "2") {
  2192. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  2193. prcpnm = prcpnm.substr(0,7);
  2194. } else {
  2195. var prcpnm= model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm");
  2196. }
  2197. if((sMthdcd1 == sMthdcd2)){
  2198. if(PrnKind == "2") {
  2199. //
  2200. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  2201. //sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  2202. //
  2203. sSndMsg += astfPrintOut(165, 140+(cnt*30), 11, prcpnm.substr(0,7),"");
  2204. //
  2205. sSndMsg += astfPrintOut(360, 140+(cnt*30), 2, dayqty,"");
  2206. //
  2207. sSndMsg += astfPrintOut(430, 140+(cnt*30), 2, tims,"");
  2208. //
  2209. sSndMsg += astfPrintOut(460, 140+(cnt*30), 2, dayno,"");
  2210. // 2010.02.17 pymi
  2211. if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
  2212. // (e)
  2213. } else {
  2214. //
  2215. // 20101101_laboru_경북대병원_라벨 출력물 처방코드 삭제
  2216. //sSndMsg += astfPrintOut(20, 140+(cnt*30), 24, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpcd"),"");
  2217. //
  2218. sSndMsg += astfPrintOut(135, 140+(cnt*30), 11, model.getValue("/root/main/lbllist/lbllist["+j+"]/prcpnm"),"");
  2219. //
  2220. sSndMsg += astfPrintOut(330, 140+(cnt*30), 2, dayqty,"");
  2221. //
  2222. sSndMsg += astfPrintOut(390, 140+(cnt*30), 2, tims,"");
  2223. //
  2224. sSndMsg += astfPrintOut(420, 140+(cnt*30), 2, dayno,"");
  2225. // 2010.02.17 pymi
  2226. if(model.getValue("/root/main/lbllist/lbllist["+ j +"]/lblcnts2").length > 0 ) {ordflag += j + "/";}
  2227. // (e)
  2228. }
  2229. cnt++;
  2230. } else {
  2231. // 용법바뀔때 2010.02.17 pymi
  2232. chgMth = true;
  2233. // (e)
  2234. break;
  2235. }
  2236. //if(fChkIpwdDrug(j)){
  2237. // j++;
  2238. // break;
  2239. //}
  2240. if(cnt == fMthdnmLength(iPoint)){
  2241. j++;
  2242. // 다음 용법이 다를때 2010.02.17 pymi
  2243. sMthdcd3 = model.getValue("/root/main/lbllist/lbllist["+j+"]/mthdcd");
  2244. if((sMthdcd1 != sMthdcd3) && (ordflag.length > 0) ){
  2245. prntflag = true;
  2246. }
  2247. break;
  2248. }
  2249. }
  2250. iPoint = j-1;
  2251. //보관방법 고가 출력
  2252. var sKeepmthd = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/keepmthd");
  2253. var sExpnyn = model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/expnyn");
  2254. var sExpnnm = "";
  2255. if(sExpnyn == "Y") sExpnnm = "고가";
  2256. //if(sKeepmthd != "" && sExpnnm != ""){
  2257. // sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">","");
  2258. //} else
  2259. if(sKeepmthd != ""){
  2260. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
  2261. }
  2262. if(sExpnnm != ""){
  2263. sSndMsg += astfPrintOut(135, 180, 3, "<"+sExpnnm+">","");
  2264. }
  2265. /*
  2266. if(sKeepmthd != "" && sExpnnm != ""){
  2267. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+sExpnnm+">","");
  2268. } else if(sKeepmthd != ""){
  2269. sSndMsg += astfPrintOut(20, 180, 3, "<"+sKeepmthd+">","");
  2270. } if(sExpnnm != ""){
  2271. sSndMsg += astfPrintOut(20, 180, 3, "<"+sExpnnm+">","");
  2272. }*/
  2273. //용법의 길이에 따라 찍는 위치를 달리한다(용법찍을 공간을 확보)
  2274. var iYPoint = 0;
  2275. if( fMthdnmLength(iPoint) == 4){
  2276. iYPoint = 280;
  2277. } else {
  2278. iYPoint = 245;
  2279. }
  2280. sSndMsg += astfPrintOut(20, iYPoint, 3, "1일 "+model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcptims")+"회 "
  2281. +model.getValue("/root/main/lbllist/lbllist["+iPoint+"]/prcpdayno")+"일분","");
  2282. //
  2283. sSndMsg += fMthdnm(iPoint);
  2284. //종료(매수)
  2285. //sSndMsg += astfEndFormat(0);
  2286. // 용법바뀔때 2010.02.17 pymi
  2287. //if(chgMth) {
  2288. if(ordflag.length > 0) {
  2289. cnt++; //라벨내용찍기전 한줄 띄우기
  2290. if(cnt >= 4) sSndMsg += astfEndFormat(0);
  2291. } else {
  2292. sSndMsg += astfEndFormat(0);
  2293. }
  2294. //}
  2295. // (e)
  2296. vcnt = cnt;
  2297. }
  2298. function fChkIpwdDrug() {
  2299. }