source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODGDG1.m@ 1484

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

initial load of WorldVistAEHR

File size: 5.3 KB
RevLine 
[613]1PSODGDG1 ;BHAM ISC/SAB - DRUG INTERACTION PROCESSOR ; 02/25/94 9:14
2 ;;7.0;OUTPATIENT PHARMACY;;DEC 1997
3 G PROC^PSODGDG2
4PROCESS ;verification
5 Q:$P(^PSRX(PSONV,"STA"),"^")=13
6 W @IOF,!,$P(^DPT(DFN,0),"^"),?40,"ID#:"_VA("PID")_" RX #"_$P(INT,"^") D CUTDATE^PSOFUNC:'$G(PSODTCUT),^PSOBUILD:'+$G(PSOZVER),^PSODSPL
7 S DIR("?",1)="Answer 'YES' if you DO want to "_$S($P(SER,"^",4)=1:"continue processing",1:"enter an intervention for")_" this medication,"
8 S DIR("?",2)=" 'NO' if you DON'T want to "_$S($P(SER,"^",4)=1:"continue processing",1:"enter an intervention for")_" this medication,",DIR("?")=" or 'P' to review medication profile."
9 W $C(7),$C(7) S DIR("A",1)="",DIR("A",2)="***"_$S($P(SER,"^",4)=1:"CRITICAL",1:"SIGNIFICANT")_"*** "_"Drug Interaction with RX #"_$P(^PSRX($P($P(MED,",",INA),"^"),0),"^"),DIR("A",3)=" Drug: "_$P($G(^PSDRUG($P(^(0),"^",6),0)),"^")
10 S DIR(0)="SA^1:YES;0:NO;P:PROFILE",DIR("A")="Do you want to "_$S($P(SER,"^",4)=1:"Continue? ",1:"Intervene? "),DIR("B")="Y" D ^DIR I Y="P" W ! K Y G PROCESS
11 I 'Y,$P(SER,"^",4)=1 S PSVERFLG=1
12 I Y,$P(SER,"^",4)=1 S PSORX("INTERVENE")=1 K DIR,DTOUT,DIRUT,DIROUT,DUOUT D CRI Q
13 I Y,$P(SER,"^",4)=2 S PSORX("INTERVENE")=2,DA=IFN D INV
14 K DIR,DTOUT,DIRUT,DIROUT,DUOUT Q
15 Q
16CRI ;new interactions
17 K DIR I $P(RX,"^",15)=4 D CRITN Q
18 S DIR("A",1)="",DIR("A",2)="Do you want to Process or Cancel medication?",DIR("A")="Rx #"_$P(INT,"^")_" DRUG: "_$P(^PSDRUG($P(INT,"^",6),0),"^")_": ",DIR(0)="SA^1:PROCESS;0:CANCEL MEDICATION",DIR("B")="PROCESS"
19 K ANSDIR
20 S DIR("?",1)="Enter '1' or 'P' to Activate medication",DIR("?")=" '^' to EXIT Process",DIR("?",2)=" '0' or 'C' to Cancel Medication" D ^DIR K DIR
21 I $D(DIRUT) S PSVERFLG=1 Q
22 S ANSDIR=Y
23 D SIG^XUSESIG I X1="" S PSVERFLG=1 K ANSDIR Q
24 I 'ANSDIR D
25 .D NOOR^PSOCAN4 I $D(DIRUT) D UPOUT Q
26 .S DA=IFN D RXV S DA=IFN D INV S DA=IFN D PSDEL,DEL
27 I ANSDIR S DA=IFN D INV S DA=IFN I 'PSVERFLG,'$P(MED,",",(INA+1)) D ^PSODGDG2 S $P(^PSRX(IFN,"STA"),"^")=1 S ZONE=IFN D ONE
28 K DIK,DTOUT,DIRUT,DIROUT,DUOUT,LST,ANSDIR,PSONOOR Q
29CRITN ;multiple interactions
30 S PSOTHER=$P($P(MED,",",INA),"^")
31 K DIR S DIR("A",1)="",DIR("A",2)="Do you want to: ",DIR("A",3)=" 1. Cancel Rx #"_$P(INT,"^")_" DRUG: "_$P(^PSDRUG($P(INT,"^",6),0),"^")
32 S DIR("A",4)=" 2. Cancel Rx #"_$P(RX,"^")_" DRUG: "_$P(^PSDRUG($P(RX,"^",6),0),"^"),DIR("A",5)=" 3. Cancel Both 1 and 2",DIR("A")=" 5. Leave Both Pending (do nothing) ?: ",DIR("A",6)=" 4. Activate Both 1 and 2"
33 S DIR(0)="SA^1:1 to be Canceled;2:2 to be Canceled;3:Cancel BOTH 1 and 2;4:ACTIVATE 1 and 2;5:DO NOTHING TO 1 and 2"
34 S DIR("?",1)="Enter '1' to Cancel Rx #"_$P(INT,"^")_" DRUG: "_$P(^PSDRUG($P(INT,"^",6),0),"^"),DIR("?",2)=" '2' to Cancel Rx #"_$P(RX,"^")_" DRUG: "_$P(^PSDRUG($P(RX,"^",6),0),"^")
35 S DIR("?",3)=" '3' or 'B' to Cancel Both 1 and 2",DIR("?",4)=" '4' or 'A' to Activate both RXs",DIR("?")=" '5' or 'D' to do nothing/leave both RXs in a Pending Status" D ^DIR K DIR I Y["^"!(Y=5)!($D(DIRUT)) S PSVERFLG=1 G CRIZ
36 S PSAN=Y D SIG^XUSESIG I X1="" K PSAN S PSVERFLG=1 G CRIZ
37 I PSAN=1 D D KILL Q
38 .D NOOR^PSOCAN4 I $D(DIRUT) D UPOUT,KILL K PSONORR,PSORX("INTERVENE") Q
39 .S DA=IFN D RXV
40 .S DA=IFN D PSDEL,DEL
41 .S:$G(PSOSD) PSOSD=PSOSD-1 S DA=IFN D INV S DA=$P(MED,",",INA) S DA=PSOTHER
42 .D INV S DA=PSOTHER S $P(^PSRX(PSOTHER,"STA"),"^")=1,ZONE=PSOTHER
43 .D ONE K PSONOOR
44 I PSAN=2 D D KILL K PSONOOR Q
45 .D NOOR^PSOCAN4 I $D(DIRUT) D UPOUT,KILL K PSONOOR,PSORX("INTERVENE") Q
46 .S DA=$P(MED,",",INA) D PSDEL,DEL
47 .K PSONOOR S:$G(PSOSD) PSOSD=PSOSD-1 S DA=$P(MED,",",INA)
48 .D INV S DA=IFN D INV S DA=IFN
49 .I 'PSVERFLG,'$P(MED,",",(INA+1)) D ^PSODGDG2 S DA=IFN,$P(^PSRX(DA,"STA"),"^")=1 S ZONE=DA D ONE
50 I PSAN=3 D D KILL K PSONOOR Q
51 .D NOOR^PSOCAN4 I $D(DIRUT) D UPOUT,KILL K PSONOOR,PSORX("INTERVENE") Q
52 .F DA=$P(MED,",",INA),IFN S PSHOLDDA=DA D PSDEL,DEL S DA=PSHOLDDA D INV K DTOUT,DIROUT,DIRUT,DUOUT,PSAN,PSHOLDDA
53 I $G(PSAN)=4 S LST=1,PPL="" D
54 .S DA=$P(MED,",",INA) D INV S $P(^PSRX(PSOTHER,"STA"),"^")=1 S ZONE=PSOTHER S PSOTHER(PSOTHER)=PSOTHER D ONE
55 .S DA=IFN D INV I 'PSVERFLG,'$P(MED,",",(INA+1)) D ^PSODGDG2 S DA=IFN,$P(^PSRX(DA,"STA"),"^")=1 S ZONE=DA D ONE
56 .S:$G(PSOSD) PSOSD=PSOSD-2
57 D KILL
58CRIZ ;
59 Q
60RXV S DIK="^PS(52.4," D ^DIK Q
61INV D EN1^PSORXI(.DA) Q
62PSDEL Q:$G(STAT)']""
63 S STA="ACTIVE^NON-VERIFIED^R^HOLD^NON-VERIFIED^ACTIVE^^^^^^ACTIVE^DISCONTINUE^^DISCONTINUE^DISCONTINUE^HOLD",STAT=$P(STA,"^",$P(^PSRX(DA,"STA"),"^")+1)
64 I $P($G(PSOSD(STAT,$P(^PSDRUG($P(^PSRX(DA,0),"^",6),0),"^"))),"^")=DA K PSOSD(STAT,$P(^PSDRUG($P(^PSRX(DA,0),"^",6),0),"^"))
65 E K PSOSD(STAT,$P(^PSDRUG($P(^PSRX(DA,0),"^",6),0),"^")_"^"_DA)
66 Q
67DEL W !!,"Canceling Rx: "_$P($G(^PSRX(DA,0)),"^")_" "_"Drug: "_$P($G(^PSDRUG($P(^PSRX(DA,0),"^",6),0)),"^"),! D ENQ^PSORXDL Q
68 Q
69ONE S STA="ACTIVE^NON-VERIFIED^R^HOLD^NON-VERIFIED^ACTIVE^^^^^^ACTIVE^DISCONTINUE^^DISCONTINUE^DISCONTINUE^HOLD",STAT=$P(STA,"^",$P(^PSRX(ZONE,"STA"),"^")+1)
70 I $P($G(PSOSD(STAT,$P(^PSDRUG($P(^PSRX(ZONE,0),"^",6),0),"^"))),"^")=ZONE S $P(PSOSD(STAT,$P(^PSDRUG($P(^PSRX(ZONE,0),"^",6),0),"^")),"^",2)=1
71 E I $G(PSOSD(STAT,$P(^PSDRUG($P(^PSRX(ZONE,0),"^",6),0),"^")_"^"_ZONE)) S $P(PSOSD(STAT,$P(^PSDRUG($P(^PSRX(ZONE,0),"^",6),0),"^")_"^"_ZONE),"^",2)=1
72 K ZONE,STA,STAT Q
73KILL K DIR,DIK,DTOUT,DIROUT,DIRUT,DUOUT,LST,PPL,PSAN Q
74 ;
75UPOUT W " ACTION NOT TAKEN!",! K DIR S DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR K DIR S PSVERFLG=1 Q
Note: See TracBrowser for help on using the repository browser.