1 | PSOLLL8 ;BIR/JLC - LASER LABEL - CRITICAL INTERACTION ;12/13/02
|
---|
2 | ;;7.0;OUTPATIENT PHARMACY;**120**;DEC 1997
|
---|
3 | ;
|
---|
4 | ;Reference to PS(56 supported by DBIA 2229
|
---|
5 | ;Reference to PSDRUG supported by DBIA 221
|
---|
6 | ;
|
---|
7 | S HOLDCOPY=COPIES
|
---|
8 | START ;
|
---|
9 | I $G(PSOIO("CDII"))]"" X PSOIO("CDII")
|
---|
10 | I $G(PSOIO(PSOFONT))]"" X PSOIO(PSOFONT)
|
---|
11 | K PSOSERV
|
---|
12 | S COPIES=COPIES-1,Y=$P(^PSRX(RX,2),"^",6) X ^DD("DD") S EXPDT=Y,Y=$P(^PSRX(RX,0),"^",13) X ^DD("DD") S ISD=Y
|
---|
13 | S Y=DATE X ^DD("DD") S DATE1=Y D NOW^%DTC S Y=% X ^DD("DD") S NOW=Y
|
---|
14 | I '$D(^PS(52.4,RX,0)),$P(^PSRX(RX,"STA"),"^")=4 D UNKNOWN Q
|
---|
15 | I '$G(RXRP(RX)) S T=$P(PS2,"^",2)_" "_"("_$P(RXY,"^",16)_"/"_$S(+$G(VRPH):VRPH,1:" ")_")"_" "_$P(NOW,":",1,2) D PRINT(T)
|
---|
16 | 2 S PSOY=PSOY+PSOYI,T="This prescription has caused a DRUG-DRUG INTERACTION." D PRINT(T)
|
---|
17 | S PSOY=PSOY+PSOYI,T="Rx# "_RXN_" has caused a DRUG-DRUG INTERACTION with the following prescription(s):" D PRINT(T) S PSOY=PSOY+PSOYI
|
---|
18 | I $D(^PS(52.4,RX,0)) S SCRIPT=$P(^PS(52.4,RX,0),"^",10),SEV=$P(^PS(52.4,RX,0),"^",9) F X=1:1 S RXX(X)=$P(SCRIPT,",",X),SEV(X)=$P(SEV,",",X) Q:RXX(X)="" D
|
---|
19 | .S SER=$P(^PS(56,SEV(X),0),"^",4) S:$G(SER)=1 PSOSERV=1
|
---|
20 | .S T=$P($G(^PSRX(RXX(X),0)),"^")_" "_$S(SER=1:"CRITICAL",SER=2:"SIGNIFICANT",1:"UNKNOWN")_" INTERACTION "_$P(^PSDRUG($P(^PSRX(RXX(X),0),"^",6),0),"^") D PRINT(T)
|
---|
21 | I '$D(^PS(52.4,RX,0)),$D(^PSRX(RX,"DRI")) S SCRIPT=$P(^PSRX(RX,"DRI"),"^",2),SEV=$P(^PSRX(RX,"DRI"),"^") F X=1:1 S RXX(X)=$P(SCRIPT,",",X),SEV(X)=$P(SEV,",",X) Q:RXX(X)="" D
|
---|
22 | .S SER=$P(^PS(56,SEV(X),0),"^",4)
|
---|
23 | .S T=$P($G(^PSRX(RXX(X),0)),"^")_" "_$S(SER=1:"CRITICAL",SER=2:"SIGNIFICANT",1:"UNKNOWN")_" INTERACTION "_$P(^PSDRUG($P(^PSRX(RXX(X),0),"^",6),0),"^") D PRINT(T)
|
---|
24 | S PSOY=PSOY+PSOYI
|
---|
25 | S T="This prescription was entered by: "_TECH D PRINT(T)
|
---|
26 | S PSOY=PSOY+PSOYI,T="This prescription "_$S('$G(PSOSERV):"may require",1:"requires")_" "_$S('$G(PSOSERV):"reviewing",1:"intervention")_" by a pharmacist" D PRINT(T)
|
---|
27 | S PSOY=PSOY+PSOYI
|
---|
28 | S T=DATE1_" Fill "_(RXF+1)_" of "_(1+$P(RXY,"^",9)) D PRINT(T)
|
---|
29 | S T=PNM_" "_SSNP D PRINT(T)
|
---|
30 | F SSG=1:1 Q:$G(SGY(SSG))="" S T=SGY(SSG) D PRINT(T)
|
---|
31 | S T="Qty: "_$G(QTY)_" "_$G(PHYS) D PRINT(T)
|
---|
32 | S T="Tech__________RPh__________" D PRINT(T)
|
---|
33 | S T=DRUG D PRINT(T)
|
---|
34 | S T="Routing: "_$S("W"[$E(MW):MW,1:MW_" MAIL") D PRINT(T)
|
---|
35 | S T="Days supply: "_$G(DAYS)_" Cap: "_$S(PSCAP:"**NON-SFTY**",1:"SAFETY") D PRINT(T)
|
---|
36 | S T="Isd: "_ISD_" Exp: "_EXPDT D PRINT(T)
|
---|
37 | S T="Last Fill: "_$G(PSOFLAST) D PRINT(T)
|
---|
38 | S T="Pat. Stat "_PATST_" Clinic: "_PSCLN D PRINT(T)
|
---|
39 | W @IOF
|
---|
40 | I COPIES>0 G START
|
---|
41 | S COPIES=HOLDCOPY K HOLDCOPY
|
---|
42 | STORE ;LABEL PRINT NODE
|
---|
43 | D NOW^%DTC S NOW=% K %,%H,%I I $G(RXF)="" S RXF=0 F I=0:0 S I=$O(^PSRX(RX,1,I)) Q:'I S RXF=I
|
---|
44 | F IR=0 F FDA=0:0 S FDA=$O(^PSRX(RX,"L",FDA)) Q:'FDA S IR=FDA
|
---|
45 | S IR=IR+1,^PSRX(RX,"L",0)="^52.032DA^"_IR_"^"_IR,^PSRX(RX,"L",IR,0)=NOW_"^"_RXF_"^"_$S($G(PCOMX)]"":$G(PCOMX),1:"From RX number "_$P(^PSRX(RX,0),"^"))_" Drug-Drug interaction"_$S($G(RXRP(RX)):" (Reprint)",1:"")_"^"_PDUZ_"^1"
|
---|
46 | K:$D(^PS(52.4,RX,0)) RXF,IR,FDA,NOW,I
|
---|
47 | END K:$D(^PS(52.4,RX,0)) PSCLN,DATE1,DRUG,RFLMSG,COPIES,DRUG,LMI,LINE,PS,PS1,PS2,INT,ISD,I1,MW,STATE,SIDE,SGY,PATST,PRTFL,PHYS,SGC,VRPH,NLWS,X1,X2,X,Y,TECH,EXPDT,NURSE,SEV,SCRIPT,RXX,SGY,SER,SSG,RXY,SIGPH,PS55,PS55X K PSOSERV
|
---|
48 | Q
|
---|
49 | UNKNOWN S PSOY=PSOY+(3*PSOYI),T="",$P(T,"*",100)="" D PRINT(T)
|
---|
50 | S T="THIS PRESCRIPTION HAS CAUSED A DRUG-DRUG INTERACTION " D PRINT(T)
|
---|
51 | S T="",$P(T,"*",100)="" D PRINT(T)
|
---|
52 | S T="PRESCRIPTION # "_$P(^PSRX(RX,0),"^")_" "_$P(^PSDRUG($P(^PSRX(RX,0),"^",6),0),"^") D PRINT(T)
|
---|
53 | S T="The above prescription has a status of PENDING due to a DRUG-DRUG INTERACTION." D PRINT(T)
|
---|
54 | S T=PNM_" "_SSNP D PRINT(T)
|
---|
55 | S T=$P(PS2,"^",2)_" ("_$P(RXY,"^",16)_"/"_$S(+$G(VRPH):VRPH,1:" ")_")"_" "_$P($P(NOW,":",1,2),"@") D PRINT(T)
|
---|
56 | S T=RXN_" "_DATE1_" Fill "_(RXF+1)_" of "_(1+$P(RXY,"^",9)) D PRINT(T)
|
---|
57 | F SSG=1:1 Q:$G(SGY(SSG))="" S T=SGY(SSG) D PRINT(T)
|
---|
58 | S PSOY=PSOY+PSOYI,T="Please review printouts of all labels for this patient that follow." D PRINT(T),STORE
|
---|
59 | W @IOF K PSCLN,DATE1,DRUG,RFLMSG,COPIES,DRUG,LMI,LINE,PS,PS1,PS2,INT,ISD,I1,MW,STATE,SIDE,SIGPH,SGY,PATST,PRTFL,PHYS,SGC,VRPH,NLWS,X1,X2,X,Y,TECH,EXPDT,NURSE,SEV,SCRIPT,RXX,SGY,SER,SSG,RXY,PSOSERV Q
|
---|
60 | ;
|
---|
61 | PRINT(T) ;
|
---|
62 | I $G(PSOIO("ST"))]"" X PSOIO("ST")
|
---|
63 | W T,!
|
---|
64 | I $G(PSOIO("ET"))]"" X PSOIO("ET")
|
---|
65 | Q
|
---|