PSDUTL1 ;BIR/JPW-Utility FM and X-Refs (cont'd) ; 18 Jan 94
;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
SACT ;set 'ACT' x-ref on field 3 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDDRU=$P(^(0),"^",5),PSDTYPE=$P(^(0),"^",2)
I ('PSDNL)!('PSDDRU)!('PSDTYPE) K PSDNL,PSDDRU,PSDTYPE Q
S ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA)="" K PSDNL,PSDDRU,PSDTYPE
Q
KACT ;kill 'ACT' x-ref on field 3 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDDRU=$P(^(0),"^",5),PSDTYPE=$P(^(0),"^",2)
I ('PSDNL)!('PSDDRU)!('PSDTYPE) K PSDNL,PSDDRU,PSDTYPE Q
K ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA),PSDNL,PSDDRU,PSDTYPE
Q
SACT1 ;set 'ACT' x-ref on field 1 in 58.81
S PSDATT=$P(^PSD(58.81,DA,0),"^",4),PSDNL=$P(^(0),"^",3),PSDDRU=$P(^(0),"^",5)
I ('PSDATT)!('PSDNL)!('PSDDRU) K PSDATT,PSDNL,PSDDRU Q
S ^PSD(58.81,"ACT",PSDATT,PSDNL,PSDDRU,X,DA)="" K PSDNL,PSDATT,PSDDRU
Q
KACT1 ;kill 'ACT' x-ref on field 1 in 58.81
S PSDATT=$P(^PSD(58.81,DA,0),"^",4),PSDNL=$P(^(0),"^",3),PSDDRU=$P(^(0),"^",5)
I ('PSDATT)!('PSDNL)!('PSDDRU) K PSDATT,PSDNL,PSDDRU Q
K ^PSD(58.81,"ACT",PSDATT,PSDNL,PSDDRU,X,DA),PSDNL,PSDATT,PSDDRU
Q
SACT2 ;set 'ACT' x-ref on field 2 in 58.81
S PSDATT=$P(^PSD(58.81,DA,0),"^",4),PSDDRU=$P(^(0),"^",5),PSDTYPE=$P(^(0),"^",2)
I ('PSDATT)!('PSDDRU)!('PSDTYPE) K PSDATT,PSDDRU,PSDTYPE Q
S ^PSD(58.81,"ACT",PSDATT,X,PSDDRU,PSDTYPE,DA)="" K PSDATT,PSDDRU,PSDTYPE
Q
KACT2 ;kill 'ACT' x-ref on field 2 in 58.81
S PSDATT=$P(^PSD(58.81,DA,0),"^",4),PSDDRU=$P(^(0),"^",5),PSDTYPE=$P(^(0),"^",2)
I ('PSDATT)!('PSDDRU)!('PSDTYPE) K PSDATT,PSDDRU,PSDTYPE Q
K ^PSD(58.81,"ACT",PSDATT,X,PSDDRU,PSDTYPE,DA),PSDATT,PSDDRU,PSDTYPE
Q
SACT3 ;set 'ACT' x-ref on field 4 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDATT=$P(^(0),"^",4),PSDTYPE=$P(^(0),"^",2)
I 'PSDNL!('PSDATT)!('PSDTYPE) K PSDNL,PSDATT,PSDTYPE Q
S ^PSD(58.81,"ACT",PSDATT,PSDNL,X,PSDTYPE,DA)="" K PSDATT,PSDNL,PSDTYPE
Q
KACT3 ;kill 'ACT' x-ref on field 4 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDATT=$P(^(0),"^",4),PSDTYPE=$P(^(0),"^",2)
I ('PSDNL)!('PSDATT)!('PSDTYPE) K PSDNL,PSDATT,PSDTYPE Q
K ^PSD(58.81,"ACT",PSDATT,PSDNL,X,PSDTYPE,DA),PSDNL,PSDATT,PSDTYPE
Q
SACT4 ;set 'ACT' x-ref on field 34 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDDRU=$P(^(0),"^",5),PSDTYPE=3
I ('PSDNL)!('PSDDRU)!('PSDTYPE) K PSDNL,PSDDRU,PSDTYPE Q
S ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA)="" K PSDNL,PSDDRU,PSDTYPE
Q
KACT4 ;kill 'ACT' x-ref on field 34 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDDRU=$P(^(0),"^",5),PSDTYPE=3
I ('PSDNL)!('PSDDRU)!('PSDTYPE) K PSDNL,PSDDRU,PSDTYPE Q
K ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA),PSDNL,PSDDRU,PSDTYPE
Q
SACT5 ;set 'ACT' x-ref on field 48 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDDRU=$P(^(0),"^",5),PSDTYPE=14
I ('PSDNL)!('PSDDRU)!('PSDTYPE) K PSDNL,PSDDRU,PSDTYPE Q
S ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA)="" K PSDNL,PSDDRU,PSDTYPE
Q
KACT5 ;kill 'ACT' x-ref on field 48 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDDRU=$P(^(0),"^",5),PSDTYPE=14
I ('PSDNL)!('PSDDRU)!('PSDTYPE) K PSDNL,PSDDRU,PSDTYPE Q
K ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA),PSDNL,PSDDRU,PSDTYPE
Q
SACT6 ;set 'ACT' x-ref on field 55 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDDRU=$P(^(0),"^",5),PSDTYPE=13
I ('PSDNL)!('PSDDRU)!('PSDTYPE) K PSDNL,PSDDRU,PSDTYPE Q
S ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA)="" K PSDNL,PSDDRU,PSDTYPE
Q
KACT6 ;kill 'ACT' x-ref on field 55 in 58.81
S PSDNL=$P(^PSD(58.81,DA,0),"^",3),PSDDRU=$P(^(0),"^",5),PSDTYPE=13
I ('PSDNL)!('PSDDRU)!('PSDTYPE) K PSDNL,PSDDRU,PSDTYPE Q
K ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA),PSDNL,PSDDRU,PSDTYPE
Q
SAD ;set 'AD' x-ref on field 17 in 58.81
S PSDOST=+$P(^PSD(58.81,DA,0),"^",11) I 'PSDOST K PSDOST Q
S ^PSD(58.81,"AD",PSDOST,X,DA)="" K PSDOST
Q
KAD ;kill 'AD' x-ref on field 17 in 58.81
S PSDOST=+$P(^PSD(58.81,DA,0),"^",11) I 'PSDOST K PSDOST Q
K ^PSD(58.81,"AD",PSDOST,X,DA),PSDOST
Q
SAW ;set 'AW' x-ref on field 13 in 58.85
S PSDDS=$P(^PSD(58.85,DA,0),"^",2) I 'PSDDS K PSDDS Q
S ^PSD(58.85,"AW",PSDDS,X,DA)="" K PSDDS
Q
KAW ;kill 'AW' x-ref on field 13 in 58.85
S PSDDS=$P(^PSD(58.85,DA,0),"^",2) I 'PSDDS K PSDDS Q
K ^PSD(58.85,"AW",PSDDS,X,DA),PSDDS
Q
SAW1 ;set 'AW' x-ref on field 1 in 58.85
Q:'$D(^PSD(58.85,DA,2))
S PSDPRT=$P(^PSD(58.85,DA,2),"^") I 'PSDPRT K PSDPRT Q
S ^PSD(58.85,"AW",X,PSDPRT,DA)="" K PSDPRT
Q
KAW1 ;kill 'AW' x-ref on field 1 in 58.85
Q:'$D(^PSD(58.85,DA,2))
S PSDPRT=$P(^PSD(58.85,DA,2),"^") I 'PSDPRT K PSDPRT Q
K ^PSD(58.85,"AW",X,PSDPRT,DA),PSDPRT
Q
PSDUTL1 ;BIR/JPW-Utility FM and X-Refs (cont'd) ; 18 Jan 94
+1 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
SACT ;set 'ACT' x-ref on field 3 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=$PIECE(^(0),"^",2)
+2 IF ('PSDNL)!('PSDDRU)!('PSDTYPE)
KILL PSDNL,PSDDRU,PSDTYPE
QUIT
+3 SET ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA)=""
KILL PSDNL,PSDDRU,PSDTYPE
+4 QUIT
KACT ;kill 'ACT' x-ref on field 3 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=$PIECE(^(0),"^",2)
+2 IF ('PSDNL)!('PSDDRU)!('PSDTYPE)
KILL PSDNL,PSDDRU,PSDTYPE
QUIT
+3 KILL ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA),PSDNL,PSDDRU,PSDTYPE
+4 QUIT
SACT1 ;set 'ACT' x-ref on field 1 in 58.81
+1 SET PSDATT=$PIECE(^PSD(58.81,DA,0),"^",4)
SET PSDNL=$PIECE(^(0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
+2 IF ('PSDATT)!('PSDNL)!('PSDDRU)
KILL PSDATT,PSDNL,PSDDRU
QUIT
+3 SET ^PSD(58.81,"ACT",PSDATT,PSDNL,PSDDRU,X,DA)=""
KILL PSDNL,PSDATT,PSDDRU
+4 QUIT
KACT1 ;kill 'ACT' x-ref on field 1 in 58.81
+1 SET PSDATT=$PIECE(^PSD(58.81,DA,0),"^",4)
SET PSDNL=$PIECE(^(0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
+2 IF ('PSDATT)!('PSDNL)!('PSDDRU)
KILL PSDATT,PSDNL,PSDDRU
QUIT
+3 KILL ^PSD(58.81,"ACT",PSDATT,PSDNL,PSDDRU,X,DA),PSDNL,PSDATT,PSDDRU
+4 QUIT
SACT2 ;set 'ACT' x-ref on field 2 in 58.81
+1 SET PSDATT=$PIECE(^PSD(58.81,DA,0),"^",4)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=$PIECE(^(0),"^",2)
+2 IF ('PSDATT)!('PSDDRU)!('PSDTYPE)
KILL PSDATT,PSDDRU,PSDTYPE
QUIT
+3 SET ^PSD(58.81,"ACT",PSDATT,X,PSDDRU,PSDTYPE,DA)=""
KILL PSDATT,PSDDRU,PSDTYPE
+4 QUIT
KACT2 ;kill 'ACT' x-ref on field 2 in 58.81
+1 SET PSDATT=$PIECE(^PSD(58.81,DA,0),"^",4)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=$PIECE(^(0),"^",2)
+2 IF ('PSDATT)!('PSDDRU)!('PSDTYPE)
KILL PSDATT,PSDDRU,PSDTYPE
QUIT
+3 KILL ^PSD(58.81,"ACT",PSDATT,X,PSDDRU,PSDTYPE,DA),PSDATT,PSDDRU,PSDTYPE
+4 QUIT
SACT3 ;set 'ACT' x-ref on field 4 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDATT=$PIECE(^(0),"^",4)
SET PSDTYPE=$PIECE(^(0),"^",2)
+2 IF 'PSDNL!('PSDATT)!('PSDTYPE)
KILL PSDNL,PSDATT,PSDTYPE
QUIT
+3 SET ^PSD(58.81,"ACT",PSDATT,PSDNL,X,PSDTYPE,DA)=""
KILL PSDATT,PSDNL,PSDTYPE
+4 QUIT
KACT3 ;kill 'ACT' x-ref on field 4 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDATT=$PIECE(^(0),"^",4)
SET PSDTYPE=$PIECE(^(0),"^",2)
+2 IF ('PSDNL)!('PSDATT)!('PSDTYPE)
KILL PSDNL,PSDATT,PSDTYPE
QUIT
+3 KILL ^PSD(58.81,"ACT",PSDATT,PSDNL,X,PSDTYPE,DA),PSDNL,PSDATT,PSDTYPE
+4 QUIT
SACT4 ;set 'ACT' x-ref on field 34 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=3
+2 IF ('PSDNL)!('PSDDRU)!('PSDTYPE)
KILL PSDNL,PSDDRU,PSDTYPE
QUIT
+3 SET ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA)=""
KILL PSDNL,PSDDRU,PSDTYPE
+4 QUIT
KACT4 ;kill 'ACT' x-ref on field 34 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=3
+2 IF ('PSDNL)!('PSDDRU)!('PSDTYPE)
KILL PSDNL,PSDDRU,PSDTYPE
QUIT
+3 KILL ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA),PSDNL,PSDDRU,PSDTYPE
+4 QUIT
SACT5 ;set 'ACT' x-ref on field 48 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=14
+2 IF ('PSDNL)!('PSDDRU)!('PSDTYPE)
KILL PSDNL,PSDDRU,PSDTYPE
QUIT
+3 SET ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA)=""
KILL PSDNL,PSDDRU,PSDTYPE
+4 QUIT
KACT5 ;kill 'ACT' x-ref on field 48 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=14
+2 IF ('PSDNL)!('PSDDRU)!('PSDTYPE)
KILL PSDNL,PSDDRU,PSDTYPE
QUIT
+3 KILL ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA),PSDNL,PSDDRU,PSDTYPE
+4 QUIT
SACT6 ;set 'ACT' x-ref on field 55 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=13
+2 IF ('PSDNL)!('PSDDRU)!('PSDTYPE)
KILL PSDNL,PSDDRU,PSDTYPE
QUIT
+3 SET ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA)=""
KILL PSDNL,PSDDRU,PSDTYPE
+4 QUIT
KACT6 ;kill 'ACT' x-ref on field 55 in 58.81
+1 SET PSDNL=$PIECE(^PSD(58.81,DA,0),"^",3)
SET PSDDRU=$PIECE(^(0),"^",5)
SET PSDTYPE=13
+2 IF ('PSDNL)!('PSDDRU)!('PSDTYPE)
KILL PSDNL,PSDDRU,PSDTYPE
QUIT
+3 KILL ^PSD(58.81,"ACT",X,PSDNL,PSDDRU,PSDTYPE,DA),PSDNL,PSDDRU,PSDTYPE
+4 QUIT
SAD ;set 'AD' x-ref on field 17 in 58.81
+1 SET PSDOST=+$PIECE(^PSD(58.81,DA,0),"^",11)
IF 'PSDOST
KILL PSDOST
QUIT
+2 SET ^PSD(58.81,"AD",PSDOST,X,DA)=""
KILL PSDOST
+3 QUIT
KAD ;kill 'AD' x-ref on field 17 in 58.81
+1 SET PSDOST=+$PIECE(^PSD(58.81,DA,0),"^",11)
IF 'PSDOST
KILL PSDOST
QUIT
+2 KILL ^PSD(58.81,"AD",PSDOST,X,DA),PSDOST
+3 QUIT
SAW ;set 'AW' x-ref on field 13 in 58.85
+1 SET PSDDS=$PIECE(^PSD(58.85,DA,0),"^",2)
IF 'PSDDS
KILL PSDDS
QUIT
+2 SET ^PSD(58.85,"AW",PSDDS,X,DA)=""
KILL PSDDS
+3 QUIT
KAW ;kill 'AW' x-ref on field 13 in 58.85
+1 SET PSDDS=$PIECE(^PSD(58.85,DA,0),"^",2)
IF 'PSDDS
KILL PSDDS
QUIT
+2 KILL ^PSD(58.85,"AW",PSDDS,X,DA),PSDDS
+3 QUIT
SAW1 ;set 'AW' x-ref on field 1 in 58.85
+1 IF '$DATA(^PSD(58.85,DA,2))
QUIT
+2 SET PSDPRT=$PIECE(^PSD(58.85,DA,2),"^")
IF 'PSDPRT
KILL PSDPRT
QUIT
+3 SET ^PSD(58.85,"AW",X,PSDPRT,DA)=""
KILL PSDPRT
+4 QUIT
KAW1 ;kill 'AW' x-ref on field 1 in 58.85
+1 IF '$DATA(^PSD(58.85,DA,2))
QUIT
+2 SET PSDPRT=$PIECE(^PSD(58.85,DA,2),"^")
IF 'PSDPRT
KILL PSDPRT
QUIT
+3 KILL ^PSD(58.85,"AW",X,PSDPRT,DA),PSDPRT
+4 QUIT