source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLLLHN.m@ 1177

Last change on this file since 1177 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1PSOLLLHN ;BIR/SJA - HIPAA/NCPDP LASER LABELS ;2/21/07 10:21am
2 ;;7.0;OUTPATIENT PHARMACY;**200,268**;DEC 1997;Build 9
3 ;
4 ;*244 ignore Rx status > 11
5 ;
6ST ; ENTRY POINT TO SPEED SIGNATURE LOG REPRINT
7 I '$D(PSOPAR) D ^PSOLSET I '$D(PSOPAR) Q
8 N REPRINT,PS,STATE,PS2,PSOHZIP,PSODISP,PSOOELSE,PSOIEN,VALMCNT
9 S PS=$S($D(^PS(59,PSOSITE,0)):^(0),1:"")
10 S PS2=$P(PS,"^")_"^"_$P(PS,"^",6)
11 I $P(PSOSYS,"^",4),$D(^PS(59,+$P($G(PSOSYS),"^",4),0)) S PS=^PS(59,$P($G(PSOSYS),"^",4),0)
12 S VAADDR1=$P(PS,"^"),VASTREET=$P(PS,"^",2),STATE=$S($D(^DIC(5,+$P(PS,"^",8),0)):$P(^(0),"^",2),1:"UNKNOWN")
13 S PSZIP=$P(PS,"^",5),PSOHZIP=$S(PSZIP["-":PSZIP,1:$E(PSZIP,1,5)_$S($E(PSZIP,6,9)]"":"-"_$E(PSZIP,6,9),1:""))
14 D 6^VADPT,PID^VADPT6 S SSNP=$G(VA("BID"))
15 S REPRINT=1
16 I '$G(PSOCNT) S VALMSG="This patient has no Prescriptions!" S VALMBCK="" Q
17OS K DIR,DUOUT,DIRUT S DIR("A")="Select Orders by number",DIR(0)="LO^1:"_PSOCNT D ^DIR S LST=Y I $D(DTOUT)!($D(DUOUT)) K DIR,DIRUT,DTOUT,DUOUT S VALMBCK="" Q
18 K DIR,DIRUT,DTOUT,PSOOELSE,PSOREPX I '+LST D KILL S VALMBCK="" Q
19 S PSOOELSE=1 D FULL^VALM1
20Q1 K POP,ZTSK S %ZIS("B")="",%ZIS="MNQ",%ZIS("A")="Select LABEL DEVICE: " D ^%ZIS S PSLION=ION K %ZIS("A")
21 I $G(POP) S VALMBCK="R",VALMSG="No Labels Reprinted." Q
22 I $G(IOST(0)),'$D(^%ZIS(2,IOST(0),55,"B","LL")) W !,"Must specify a laser labels printer for Signature Log Reprint" G Q1
23 I '$G(IOST(0)) S VALMBCK="R",VALMSG="Nothing queued to print." Q
24 D DEM^VADPT S PNM=VADM(1)
25 I $P(VADM(6),"^",2)]"" D G OS
26 .W $C(7),!!,PNM_" Died "_$P(VADM(6),"^",2)_".",!
27 S PPL="" F ORD=1:1:$L(LST,",") Q:$P(LST,",",ORD)']"" S ORN=$P(LST,",",ORD),PSOIEN=$P(PSOLST(ORN),"^",2) D
28 .I '$P($G(^PSRX(PSOIEN,0)),"^",2)!($G(^("STA"),"^")>11) Q
29 .I $P($G(^PSRX(PSOIEN,0)),"^",2) S PPL=$S(PPL:PPL_",",1:"")_PSOIEN
30 .S VALMBCK="R"
31 I +PPL D QUEUE W:$D(ZTSK) !!,"Signature Log Reprint queued",!! H 1
32 I '$G(PSOOELSE) S VALMBCK=""
33 D ^PSOBUILD
34 D KILL D KVA^VADPT
35 Q
36QUEUE D NOW^%DTC S Y=$P(%,"."),PSOFNOW=% X ^DD("DD") S PSONOW=Y
37 F G="PPL","REPRINT","PNM","STATE","PS2","PSOHZIP","PSOPAR","PSOSITE","PS","PSONOW","PSOSYS","RX","SSNP" S:$D(@G) ZTSAVE(G)=""
38 S ZTRTN="DQ^PSOLLLH",ZTIO=PSLION,ZTDESC="Outpatient Pharmacy Signature Log Reprint",ZTDTH=$H,PDUZ=DUZ
39 D ^%ZISC,^%ZTLOAD K G
40 Q
41 ;
42KILL ; CLEAN UP VARIABLES
43 K DIC,LST,ORD,ORN,PSOIEN,PNM,PPL,PSZIP,RX,SSNP,VA,VADDR1,VADM,VAEL,VAPA,VASTREET
44 Q
Note: See TracBrowser for help on using the repository browser.