PSSCSPD ;BIR/RTR-Corresponding drug functions ;03/28/00
;;1.0;PHARMACY DATA MANAGEMENT;**34,47**;9/30/97
;
REP ;
W !!,"Since this report must check every drug in the DRUG (#50) File, we recommend",!,"that you queue this report to a printer.",!
K IOP,%ZIS,POP S %ZIS="QM" D ^%ZIS I $G(POP) W !!,"Nothing queued to print.",! Q
I $D(IO("Q")) S ZTRTN="START^PSSCSPD",ZTDESC="Corresponding drug report" D ^%ZTLOAD K %ZIS W !,"Report queued to print.",! Q
START ;
U IO
K ^TMP($J,"PSSC")
S (PSSOUT,PSSHV,PSSONE)=0,PSSDV=$S($E(IOST)="C":"C",1:"P"),PSSCT=1
K PSSLINE S $P(PSSLINE,"-",78)=""
D HDC
S PSSN="" F S PSSN=$O(^PSDRUG("B",PSSN)) Q:PSSN=""!($G(PSSOUT)) F PSSIEN=0:0 S PSSIEN=$O(^PSDRUG("B",PSSN,PSSIEN)) Q:'PSSIEN!($G(PSSOUT)) D
.Q:'$D(^PSDRUG(PSSIEN,0))
.S PSSINDTE=0 I $P($G(^PSDRUG(PSSIEN,"I")),"^"),$P($G(^("I")),"^")'>DT S PSSINDTE=1
.S PSSNODE=$G(^PSDRUG(PSSIEN,8))
.I '$P(PSSNODE,"^",5),'$P(PSSNODE,"^",6) Q
.I ($Y+5)>IOSL D HDC Q:$G(PSSOUT)
.S PSSONE=1
.W !!,$P($G(^PSDRUG(PSSIEN,0)),"^")
.I ($Y+5)>IOSL D HDC Q:$G(PSSOUT)
.S PSSUSE=$P($G(^PSDRUG(PSSIEN,2)),"^",3)
.K PSSI,PSSO,PSSOX,PSSIX
.I $P(PSSNODE,"^",5) W !?3,"Corresponding Outpatient drug: ",?36,$P($G(^PSDRUG(+$P(PSSNODE,"^",5),0)),"^") D
..S PSSOX=+$P(PSSNODE,"^",5) I 'PSSOX!($P($G(^PSDRUG(+$G(PSSOX),0)),"^")="") Q
..Q:$P($G(^PSDRUG(PSSOX,8)),"^",6)
..Q:$D(^TMP($J,"PSSC",$P($G(^PSDRUG(+$G(PSSOX),0)),"^"),1))
..Q:$G(PSSINDTE)
..I PSSUSE["I"!(PSSUSE["U") S ^TMP($J,"PSSC",$P($G(^PSDRUG(+$G(PSSOX),0)),"^"),1)=$P($G(^PSDRUG(PSSIEN,0)),"^")
.I $P(PSSNODE,"^",6) W !?3," Corresponding Inpatient drug: ",?36,$P($G(^PSDRUG(+$P(PSSNODE,"^",6),0)),"^") D
..S PSSIX=+$P(PSSNODE,"^",6) I 'PSSIX!($P($G(^PSDRUG(+$G(PSSIX),0)),"^")="") Q
..Q:$P($G(^PSDRUG(PSSIX,8)),"^",5)
..Q:$D(^TMP($J,"PSSC",$P($G(^PSDRUG(+$G(PSSIX),0)),"^"),2))
..Q:$G(PSSINDTE)
..I PSSUSE["O" S ^TMP($J,"PSSC",$P($G(^PSDRUG(+$G(PSSIX),0)),"^"),2)=$P($G(^PSDRUG(PSSIEN,0)),"^")
I '$G(PSSOUT),'$G(PSSONE) W !?5,"No Corresponding Drugs were found.",!
I $G(PSSOUT) G END
S PSSHV=1 S:PSSCT=1 PSSCT=2 D HDC I $G(PSSOUT) G END
I '$D(^TMP($J,"PSSC")) W !!?5,"There are no potential matches!",! G END
S PSSNM="" F S PSSNM=$O(^TMP($J,"PSSC",PSSNM)) Q:PSSNM=""!($G(PSSOUT)) D
.I ($Y+5)>IOSL D HDC Q:$G(PSSOUT)
.W !!,$G(PSSNM)
.I ($Y+5)>IOSL D HDC Q:$G(PSSOUT)
.I $D(^TMP($J,"PSSC",PSSNM,2)) W !," ** Potential corr. Outpatient Drug: "_$G(^(2))
.I $D(^TMP($J,"PSSC",PSSNM,1)) W !," ** Potential corr. Inpatient Drug: "_$G(^(1))
END ;
I '$G(PSSOUT),$G(PSSDV)="C" W !!,"End of Report." K DIR S DIR(0)="E",DIR("A")="Press Return to continue" D ^DIR K DIR
I $G(PSSDV)="C" W !
E W @IOF
K ^TMP($J,"PSSC")
K PSSI,PSSINDTE,PSSNM,PSSONE,PSSHV,PSSO,PSSIX,PSSOX,PSSB,PSSUSE,PSSLINE,PSSOUT,PSSNODE,PSSN,PSSIEN D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
Q
HDC ;
I $G(PSSDV)="C",$G(PSSCT)'=1 W ! K DIR S DIR(0)="E",DIR("A")="Press Return to continue, '^' to exit" D ^DIR K DIR I 'Y S PSSOUT=1 Q
W @IOF W !,$S('$G(PSSHV):"Current Corresponding Inpatient/Outpatient Drug Matches",1:" *** Potential Corresponding Inpatient/Outpatient Drug Matches"),?68,"PAGE: "_$G(PSSCT),!,PSSLINE S PSSCT=PSSCT+1
Q
EDIT ;
W !! K DIC S DIC(0)="QEAMZ",DIC("A")="Select Drug: ",DIC="^PSDRUG(" D ^DIC K DIC I Y<1!($D(DTOUT))!($D(DUOUT)) W ! K PSSA,PSSI,PSSN,DA,DIE,DR Q
S PSSI=+Y,PSSN=$P($G(^PSDRUG(PSSI,0)),"^"),PSSA=$P($G(^(2)),"^",3)
W !!,"This entry is marked for the following PHARMACY packages:" W:PSSA["O" !," Outpatient" W:PSSA["U" !," Unit Dose" W:PSSA["I" !," IV" W:PSSA["W" !," Ward Stock" W:PSSA["N" !," Controlled Substances"
I PSSA["O" I PSSA["I"!(PSSA["U") W ! K DIR S DIR(0)="E",DIR("A")="Press Return to continue" D ^DIR K DIR G EDIT
I PSSA'["O",PSSA'["U",PSSA'["I",PSSA'["W",PSSA'["N" W !," (none)"
I PSSA'["O" W ! K DIE S DA=PSSI,DIE="^PSDRUG(",DR=62.05 D ^DIE K DIE I $D(Y)!($D(DTOUT)) G EDIT
I PSSA'["I",PSSA'["U" W ! K DIE S DA=PSSI,DIE="^PSDRUG(",DR=905 D ^DIE K DIE
G EDIT
Q
PAT ;
W ! K PSSOTH,DIC S DIC(0)="QEAMZ",DIC("A")="Select Pharmacy Orderable Item: ",DIC="^PS(50.7," D ^DIC K DIC I Y<1!($D(DTOUT))!($D(DUOUT)) G PATQ
S PSSOTH=$S($P($G(^PS(59.7,1,40.2)),"^"):1,1:0)
K DIE W ! S DA=+Y,DIE="^PS(50.7,",DR="7;S:'$G(PSSOTH) Y=""@1"";7.1;@1"
D ^DIE G:$D(Y)!($D(DTOUT)) PATQ
G PAT
PATQ W ! K DA,DIC,DIE,PSSOTH
Q
MARK ;
W !!,"This option will automatically mark all corresponding Inpatient and Outpatient",!,"drugs that are listed in the 'Potential Corresponding Inpatient/Outpatient Drug",!,"Matches' section of the 'Report of Corresponding Drugs'.",!
W !,"Before using this option, please make sure you print a current 'Report of",!,"Corresponding Drugs' for review.",!
K DIR S DIR(0)="Y",DIR("A")="Mark potential corresponding drugs",DIR("B")="Y" D D ^DIR K DIR I Y'=1 G MARKQ
.S DIR("?")=" ",DIR("?",1)="Enter 'Yes' to mark corresponding inpatient and outpatient drugs as displayed",DIR("?",2)="in the 'Potential Corresponding Inpatient/Outpatient Drug Matches' section of"
.S DIR("?",3)="the 'Report of Corresponding Drugs'."
W !!,"This job must be queued. You will receive a mail message upon completion.",!
S PSSDUZX=$G(DUZ)
K ZTDTH S ZTIO="",ZTRTN="MARKT^PSSCSPD",ZTDESC="AUTO-MARK CORRESPONDING DRUGS",ZTSAVE("PSSDUZX")="" D ^%ZTLOAD I $D(ZTSK)[0 W !!,"Nothing queued.",!
MARKQ K PSSDUZX
Q
MARKT ;
N PSSN,PSSIEN,PSSINDTE,PSSNODE
S PSSN="" F S PSSN=$O(^PSDRUG("B",PSSN)) Q:PSSN="" F PSSIEN=0:0 S PSSIEN=$O(^PSDRUG("B",PSSN,PSSIEN)) Q:'PSSIEN D
.Q:'$D(^PSDRUG(PSSIEN,0))
.I $P($G(^PSDRUG(PSSIEN,"I")),"^"),$P($G(^("I")),"^")'>DT Q
.S PSSNODE=$G(^PSDRUG(PSSIEN,8))
.I '$P(PSSNODE,"^",5),'$P(PSSNODE,"^",6) Q
.S PSSUSE=$P($G(^PSDRUG(PSSIEN,2)),"^",3)
.K PSSI,PSSO,PSSOX,PSSIX
.I $P(PSSNODE,"^",5) D
..S PSSOX=+$P(PSSNODE,"^",5) I 'PSSOX!($P($G(^PSDRUG(+$G(PSSOX),0)),"^")="") Q
..Q:$P($G(^PSDRUG(PSSOX,8)),"^",6)
..I PSSUSE["I"!(PSSUSE["U") S $P(^PSDRUG(PSSOX,8),"^",6)=PSSIEN
.I $P(PSSNODE,"^",6) D
..S PSSIX=+$P(PSSNODE,"^",6) I 'PSSIX!($P($G(^PSDRUG(+$G(PSSIX),0)),"^")="") Q
..Q:$P($G(^PSDRUG(PSSIX,8)),"^",5)
..I PSSUSE["O" S $P(^PSDRUG(PSSIX,8),"^",5)=PSSIEN
I '$G(PSSDUZX) G MMM
S XMDUZ="PHARMACY DATA MANAGEMENT",XMY(PSSDUZX)="",XMSUB="PDM CORRESPONDING DRUGS"
K PSSXTEXT S PSSXTEXT(1)="The PDM job that automatically marks corresponding inpatient and",PSSXTEXT(2)="outpatient drugs is complete."
S XMTEXT="PSSXTEXT(" D ^XMD K PSSXTEXT,XMDUZ,XMY,XMSUB,XMTEXT
MMM K PSSI,PSSO,PSSOX,PSSIX
S:$D(ZTQUEUED) ZTREQ="@"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSSCSPD 6544 printed Dec 13, 2024@02:30:36 Page 2
PSSCSPD ;BIR/RTR-Corresponding drug functions ;03/28/00
+1 ;;1.0;PHARMACY DATA MANAGEMENT;**34,47**;9/30/97
+2 ;
REP ;
+1 WRITE !!,"Since this report must check every drug in the DRUG (#50) File, we recommend",!,"that you queue this report to a printer.",!
+2 KILL IOP,%ZIS,POP
SET %ZIS="QM"
DO ^%ZIS
IF $GET(POP)
WRITE !!,"Nothing queued to print.",!
QUIT
+3 IF $DATA(IO("Q"))
SET ZTRTN="START^PSSCSPD"
SET ZTDESC="Corresponding drug report"
DO ^%ZTLOAD
KILL %ZIS
WRITE !,"Report queued to print.",!
QUIT
START ;
+1 USE IO
+2 KILL ^TMP($JOB,"PSSC")
+3 SET (PSSOUT,PSSHV,PSSONE)=0
SET PSSDV=$SELECT($EXTRACT(IOST)="C":"C",1:"P")
SET PSSCT=1
+4 KILL PSSLINE
SET $PIECE(PSSLINE,"-",78)=""
+5 DO HDC
+6 SET PSSN=""
FOR
SET PSSN=$ORDER(^PSDRUG("B",PSSN))
if PSSN=""!($GET(PSSOUT))
QUIT
FOR PSSIEN=0:0
SET PSSIEN=$ORDER(^PSDRUG("B",PSSN,PSSIEN))
if 'PSSIEN!($GET(PSSOUT))
QUIT
Begin DoDot:1
+7 if '$DATA(^PSDRUG(PSSIEN,0))
QUIT
+8 SET PSSINDTE=0
IF $PIECE($GET(^PSDRUG(PSSIEN,"I")),"^")
IF $PIECE($GET(^("I")),"^")'>DT
SET PSSINDTE=1
+9 SET PSSNODE=$GET(^PSDRUG(PSSIEN,8))
+10 IF '$PIECE(PSSNODE,"^",5)
IF '$PIECE(PSSNODE,"^",6)
QUIT
+11 IF ($Y+5)>IOSL
DO HDC
if $GET(PSSOUT)
QUIT
+12 SET PSSONE=1
+13 WRITE !!,$PIECE($GET(^PSDRUG(PSSIEN,0)),"^")
+14 IF ($Y+5)>IOSL
DO HDC
if $GET(PSSOUT)
QUIT
+15 SET PSSUSE=$PIECE($GET(^PSDRUG(PSSIEN,2)),"^",3)
+16 KILL PSSI,PSSO,PSSOX,PSSIX
+17 IF $PIECE(PSSNODE,"^",5)
WRITE !?3,"Corresponding Outpatient drug: ",?36,$PIECE($GET(^PSDRUG(+$PIECE(PSSNODE,"^",5),0)),"^")
Begin DoDot:2
+18 SET PSSOX=+$PIECE(PSSNODE,"^",5)
IF 'PSSOX!($PIECE($GET(^PSDRUG(+$GET(PSSOX),0)),"^")="")
QUIT
+19 if $PIECE($GET(^PSDRUG(PSSOX,8)),"^",6)
QUIT
+20 if $DATA(^TMP($JOB,"PSSC",$PIECE($GET(^PSDRUG(+$GET(PSSOX),0)),"^"),1))
QUIT
+21 if $GET(PSSINDTE)
QUIT
+22 IF PSSUSE["I"!(PSSUSE["U")
SET ^TMP($JOB,"PSSC",$PIECE($GET(^PSDRUG(+$GET(PSSOX),0)),"^"),1)=$PIECE($GET(^PSDRUG(PSSIEN,0)),"^")
End DoDot:2
+23 IF $PIECE(PSSNODE,"^",6)
WRITE !?3," Corresponding Inpatient drug: ",?36,$PIECE($GET(^PSDRUG(+$PIECE(PSSNODE,"^",6),0)),"^")
Begin DoDot:2
+24 SET PSSIX=+$PIECE(PSSNODE,"^",6)
IF 'PSSIX!($PIECE($GET(^PSDRUG(+$GET(PSSIX),0)),"^")="")
QUIT
+25 if $PIECE($GET(^PSDRUG(PSSIX,8)),"^",5)
QUIT
+26 if $DATA(^TMP($JOB,"PSSC",$PIECE($GET(^PSDRUG(+$GET(PSSIX),0)),"^"),2))
QUIT
+27 if $GET(PSSINDTE)
QUIT
+28 IF PSSUSE["O"
SET ^TMP($JOB,"PSSC",$PIECE($GET(^PSDRUG(+$GET(PSSIX),0)),"^"),2)=$PIECE($GET(^PSDRUG(PSSIEN,0)),"^")
End DoDot:2
End DoDot:1
+29 IF '$GET(PSSOUT)
IF '$GET(PSSONE)
WRITE !?5,"No Corresponding Drugs were found.",!
+30 IF $GET(PSSOUT)
GOTO END
+31 SET PSSHV=1
if PSSCT=1
SET PSSCT=2
DO HDC
IF $GET(PSSOUT)
GOTO END
+32 IF '$DATA(^TMP($JOB,"PSSC"))
WRITE !!?5,"There are no potential matches!",!
GOTO END
+33 SET PSSNM=""
FOR
SET PSSNM=$ORDER(^TMP($JOB,"PSSC",PSSNM))
if PSSNM=""!($GET(PSSOUT))
QUIT
Begin DoDot:1
+34 IF ($Y+5)>IOSL
DO HDC
if $GET(PSSOUT)
QUIT
+35 WRITE !!,$GET(PSSNM)
+36 IF ($Y+5)>IOSL
DO HDC
if $GET(PSSOUT)
QUIT
+37 IF $DATA(^TMP($JOB,"PSSC",PSSNM,2))
WRITE !," ** Potential corr. Outpatient Drug: "_$GET(^(2))
+38 IF $DATA(^TMP($JOB,"PSSC",PSSNM,1))
WRITE !," ** Potential corr. Inpatient Drug: "_$GET(^(1))
End DoDot:1
END ;
+1 IF '$GET(PSSOUT)
IF $GET(PSSDV)="C"
WRITE !!,"End of Report."
KILL DIR
SET DIR(0)="E"
SET DIR("A")="Press Return to continue"
DO ^DIR
KILL DIR
+2 IF $GET(PSSDV)="C"
WRITE !
+3 IF '$TEST
WRITE @IOF
+4 KILL ^TMP($JOB,"PSSC")
+5 KILL PSSI,PSSINDTE,PSSNM,PSSONE,PSSHV,PSSO,PSSIX,PSSOX,PSSB,PSSUSE,PSSLINE,PSSOUT,PSSNODE,PSSN,PSSIEN
DO ^%ZISC
if $DATA(ZTQUEUED)
SET ZTREQ="@"
+6 QUIT
HDC ;
+1 IF $GET(PSSDV)="C"
IF $GET(PSSCT)'=1
WRITE !
KILL DIR
SET DIR(0)="E"
SET DIR("A")="Press Return to continue, '^' to exit"
DO ^DIR
KILL DIR
IF 'Y
SET PSSOUT=1
QUIT
+2 WRITE @IOF
WRITE !,$SELECT('$GET(PSSHV):"Current Corresponding Inpatient/Outpatient Drug Matches",1:" *** Potential Corresponding Inpatient/Outpatient Drug Matches"),?68,"PAGE: "_$GET(PSSCT),!,PSSLINE
SET PSSCT=PSSCT+1
+3 QUIT
EDIT ;
+1 WRITE !!
KILL DIC
SET DIC(0)="QEAMZ"
SET DIC("A")="Select Drug: "
SET DIC="^PSDRUG("
DO ^DIC
KILL DIC
IF Y<1!($DATA(DTOUT))!($DATA(DUOUT))
WRITE !
KILL PSSA,PSSI,PSSN,DA,DIE,DR
QUIT
+2 SET PSSI=+Y
SET PSSN=$PIECE($GET(^PSDRUG(PSSI,0)),"^")
SET PSSA=$PIECE($GET(^(2)),"^",3)
+3 WRITE !!,"This entry is marked for the following PHARMACY packages:"
if PSSA["O"
WRITE !," Outpatient"
if PSSA["U"
WRITE !," Unit Dose"
if PSSA["I"
WRITE !," IV"
if PSSA["W"
WRITE !," Ward Stock"
if PSSA["N"
WRITE !," Controlled Substances"
+4 IF PSSA["O"
IF PSSA["I"!(PSSA["U")
WRITE !
KILL DIR
SET DIR(0)="E"
SET DIR("A")="Press Return to continue"
DO ^DIR
KILL DIR
GOTO EDIT
+5 IF PSSA'["O"
IF PSSA'["U"
IF PSSA'["I"
IF PSSA'["W"
IF PSSA'["N"
WRITE !," (none)"
+6 IF PSSA'["O"
WRITE !
KILL DIE
SET DA=PSSI
SET DIE="^PSDRUG("
SET DR=62.05
DO ^DIE
KILL DIE
IF $DATA(Y)!($DATA(DTOUT))
GOTO EDIT
+7 IF PSSA'["I"
IF PSSA'["U"
WRITE !
KILL DIE
SET DA=PSSI
SET DIE="^PSDRUG("
SET DR=905
DO ^DIE
KILL DIE
+8 GOTO EDIT
+9 QUIT
PAT ;
+1 WRITE !
KILL PSSOTH,DIC
SET DIC(0)="QEAMZ"
SET DIC("A")="Select Pharmacy Orderable Item: "
SET DIC="^PS(50.7,"
DO ^DIC
KILL DIC
IF Y<1!($DATA(DTOUT))!($DATA(DUOUT))
GOTO PATQ
+2 SET PSSOTH=$SELECT($PIECE($GET(^PS(59.7,1,40.2)),"^"):1,1:0)
+3 KILL DIE
WRITE !
SET DA=+Y
SET DIE="^PS(50.7,"
SET DR="7;S:'$G(PSSOTH) Y=""@1"";7.1;@1"
+4 DO ^DIE
if $DATA(Y)!($DATA(DTOUT))
GOTO PATQ
+5 GOTO PAT
PATQ WRITE !
KILL DA,DIC,DIE,PSSOTH
+1 QUIT
MARK ;
+1 WRITE !!,"This option will automatically mark all corresponding Inpatient and Outpatient",!,"drugs that are listed in the 'Potential Corresponding Inpatient/Outpatient Drug",!,"Matches' section of the 'Report of Corresponding Drugs'.",!
+2 WRITE !,"Before using this option, please make sure you print a current 'Report of",!,"Corresponding Drugs' for review.",!
+3 KILL DIR
SET DIR(0)="Y"
SET DIR("A")="Mark potential corresponding drugs"
SET DIR("B")="Y"
Begin DoDot:1
+4 SET DIR("?")=" "
SET DIR("?",1)="Enter 'Yes' to mark corresponding inpatient and outpatient drugs as displayed"
SET DIR("?",2)="in the 'Potential Corresponding Inpatient/Outpatient Drug Matches' section of"
+5 SET DIR("?",3)="the 'Report of Corresponding Drugs'."
End DoDot:1
DO ^DIR
KILL DIR
IF Y'=1
GOTO MARKQ
+6 WRITE !!,"This job must be queued. You will receive a mail message upon completion.",!
+7 SET PSSDUZX=$GET(DUZ)
+8 KILL ZTDTH
SET ZTIO=""
SET ZTRTN="MARKT^PSSCSPD"
SET ZTDESC="AUTO-MARK CORRESPONDING DRUGS"
SET ZTSAVE("PSSDUZX")=""
DO ^%ZTLOAD
IF $DATA(ZTSK)[0
WRITE !!,"Nothing queued.",!
MARKQ KILL PSSDUZX
+1 QUIT
MARKT ;
+1 NEW PSSN,PSSIEN,PSSINDTE,PSSNODE
+2 SET PSSN=""
FOR
SET PSSN=$ORDER(^PSDRUG("B",PSSN))
if PSSN=""
QUIT
FOR PSSIEN=0:0
SET PSSIEN=$ORDER(^PSDRUG("B",PSSN,PSSIEN))
if 'PSSIEN
QUIT
Begin DoDot:1
+3 if '$DATA(^PSDRUG(PSSIEN,0))
QUIT
+4 IF $PIECE($GET(^PSDRUG(PSSIEN,"I")),"^")
IF $PIECE($GET(^("I")),"^")'>DT
QUIT
+5 SET PSSNODE=$GET(^PSDRUG(PSSIEN,8))
+6 IF '$PIECE(PSSNODE,"^",5)
IF '$PIECE(PSSNODE,"^",6)
QUIT
+7 SET PSSUSE=$PIECE($GET(^PSDRUG(PSSIEN,2)),"^",3)
+8 KILL PSSI,PSSO,PSSOX,PSSIX
+9 IF $PIECE(PSSNODE,"^",5)
Begin DoDot:2
+10 SET PSSOX=+$PIECE(PSSNODE,"^",5)
IF 'PSSOX!($PIECE($GET(^PSDRUG(+$GET(PSSOX),0)),"^")="")
QUIT
+11 if $PIECE($GET(^PSDRUG(PSSOX,8)),"^",6)
QUIT
+12 IF PSSUSE["I"!(PSSUSE["U")
SET $PIECE(^PSDRUG(PSSOX,8),"^",6)=PSSIEN
End DoDot:2
+13 IF $PIECE(PSSNODE,"^",6)
Begin DoDot:2
+14 SET PSSIX=+$PIECE(PSSNODE,"^",6)
IF 'PSSIX!($PIECE($GET(^PSDRUG(+$GET(PSSIX),0)),"^")="")
QUIT
+15 if $PIECE($GET(^PSDRUG(PSSIX,8)),"^",5)
QUIT
+16 IF PSSUSE["O"
SET $PIECE(^PSDRUG(PSSIX,8),"^",5)=PSSIEN
End DoDot:2
End DoDot:1
+17 IF '$GET(PSSDUZX)
GOTO MMM
+18 SET XMDUZ="PHARMACY DATA MANAGEMENT"
SET XMY(PSSDUZX)=""
SET XMSUB="PDM CORRESPONDING DRUGS"
+19 KILL PSSXTEXT
SET PSSXTEXT(1)="The PDM job that automatically marks corresponding inpatient and"
SET PSSXTEXT(2)="outpatient drugs is complete."
+20 SET XMTEXT="PSSXTEXT("
DO ^XMD
KILL PSSXTEXT,XMDUZ,XMY,XMSUB,XMTEXT
MMM KILL PSSI,PSSO,PSSOX,PSSIX
+1 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 QUIT