PSS50TMP ;BIR/TSS - CONTINUATION OF API FOR INFORMATION FROM FILE 50; 5 Sep 03
;;1.0;PHARMACY DATA MANAGEMENT;**112**;9/30/97;Build 30
;Reference to ^PSNDF(50.68 is supported by DBIA 3735
;Reference to ^PSNDF(50.6 is supported by DBIA 2079
;Reference to ^PSNDF(50.605 is supported by DBIA 2138
;Reference to ^PSNDF(50.606 is supported by DBIA 2174
;Reference to ^PSNDF(50.3 is supported by DBIA 2612
DIRREAD ; PERFORMS ALL NON-MULTIPLE DIRECT READING FOR PSS50DAT
N PSSZTMP
S ^TMP($J,LIST,PSSIEN2,.01)=$P($G(^PSDRUG(PSSIEN2,0)),U,1)
S ^TMP($J,LIST,PSSIEN2,2)=$P($G(^PSDRUG(PSSIEN2,0)),U,2)
I $P($G(^PSDRUG(PSSIEN2,2)),U,1)'="" D
.S ^TMP($J,LIST,PSSIEN2,2.1)=$P($G(^PSDRUG(PSSIEN2,2)),U,1)_U_$P($G(^PS(50.7,$P($G(^PSDRUG(PSSIEN2,2)),U,1),0)),U,1)_U_$P($G(^PS(50.7,$P($G(^PSDRUG(PSSIEN2,2)),U,1),0)),U,2)
.S ^TMP($J,LIST,PSSIEN2,2.1)=^TMP($J,LIST,PSSIEN2,2.1)_U_$P($G(^PS(50.606,$P($G(^PS(50.7,$P($G(^PSDRUG(PSSIEN2,2)),U,1),0)),U,2),0)),U,1)
ELSE S ^TMP($J,LIST,PSSIEN2,2.1)=""
S PSSZTMP=$G(^PSDRUG(PSSIEN2,0))
S ^TMP($J,LIST,PSSIEN2,3)=$P($G(PSSZTMP),U,3)
S ^TMP($J,LIST,PSSIEN2,4)=$P($G(PSSZTMP),U,4)
S ^TMP($J,LIST,PSSIEN2,5)=$P($G(PSSZTMP),U,5)
S ^TMP($J,LIST,PSSIEN2,6)=$P($G(PSSZTMP),U,6)
S ^TMP($J,LIST,PSSIEN2,8)=$P($G(PSSZTMP),U,8)
I $P($G(^PSDRUG(PSSIEN2,660)),U,2)'="" D
. S ^TMP($J,LIST,PSSIEN2,12)=$P($G(^PSDRUG(PSSIEN2,660)),U,2)_U_$P($G(^DIC(51.5,$P($G(^PSDRUG(PSSIEN2,660)),U,2),0)),U,1)_U_$P($G(^DIC(51.5,$P($G(^PSDRUG(PSSIEN2,660)),U,2),0)),U,2)
ELSE S ^TMP($J,LIST,PSSIEN2,12)=""
S PSSZTMP=$G(^PSDRUG(PSSIEN2,660))
S ^TMP($J,LIST,PSSIEN2,13)=$P($G(PSSZTMP),U,3)
S ^TMP($J,LIST,PSSIEN2,14.5)=$P($G(PSSZTMP),U,8)
S ^TMP($J,LIST,PSSIEN2,15)=$P($G(PSSZTMP),U,5)
S ^TMP($J,LIST,PSSIEN2,16)=$P($G(PSSZTMP),U,6)
S ^TMP($J,LIST,PSSIEN2,21)=$P($G(PSSZTMP),U,2)
I $P($G(^PSDRUG(PSSIEN2,"ND")),U,1)'="" D
.S ^TMP($J,LIST,PSSIEN2,20)=$P($G(^PSDRUG(PSSIEN2,"ND")),U,1)_U_$P($G(^PSNDF(50.6,$P($G(^PSDRUG(PSSIEN2,"ND")),U,1),0)),U,1)
ELSE S ^TMP($J,LIST,PSSIEN2,20)=""
I $P($G(^PSDRUG(PSSIEN2,"ND")),U,3)'="" D
.S ^TMP($J,LIST,PSSIEN2,22)=$P($G(^PSDRUG(PSSIEN2,"ND")),U,3)_U_$P($G(^PSNDF(50.68,$P($G(^PSDRUG(PSSIEN2,"ND")),U,3),0)),U,1)
ELSE S ^TMP($J,LIST,PSSIEN2,22)=""
I $P($G(^PSDRUG(PSSIEN2,"ND")),U,6)'="" D
. S ^TMP($J,LIST,PSSIEN2,25)=$P($G(^PSDRUG(PSSIEN2,"ND")),U,6)_U_$P($G(^PS(50.605,$P($G(^PSDRUG(PSSIEN2,"ND")),U,6),0)),U,1)_U_$P($G(^PS(50.605,$P($G(^PSDRUG(PSSIEN2,"ND")),U,6),0)),U,2)
ELSE S ^TMP($J,LIST,PSSIEN2,25)=""
S ^TMP($J,LIST,PSSIEN2,27)=$P($G(^PSDRUG(PSSIEN2,"ND")),U,10)
S ^TMP($J,LIST,PSSIEN2,31)=$P($G(^PSDRUG(PSSIEN2,2)),U,4)
S ^TMP($J,LIST,PSSIEN2,40)=$P($G(^PSDRUG(PSSIEN2,"PSO")),U,1)
I $P($G(^PSDRUG(PSSIEN2,0)),U,9) D
.S ^TMP($J,LIST,PSSIEN2,51)=$P($G(^PSDRUG(PSSIEN2,0)),U,9)
.I ^TMP($J,LIST,PSSIEN2,51)="1" S ^TMP($J,LIST,PSSIEN2,51)=^TMP($J,LIST,PSSIEN2,51)_U_"N/F" Q
.I ^TMP($J,LIST,PSSIEN2,51)="" S ^TMP($J,LIST,PSSIEN2,51)=^TMP($J,LIST,PSSIEN2,51)_U Q
ELSE S ^TMP($J,LIST,PSSIEN2,51)=""
I $P($G(^PSDRUG(PSSIEN2,0)),U,11) D
.S ^TMP($J,LIST,PSSIEN2,52)=$P($G(^PSDRUG(PSSIEN2,0)),U,11)
.I ^TMP($J,LIST,PSSIEN2,52)="1" S ^TMP($J,LIST,PSSIEN2,52)=^TMP($J,LIST,PSSIEN2,52)_U_"V-N/F" Q
.I ^TMP($J,LIST,PSSIEN2,52)="" S ^TMP($J,LIST,PSSIEN2,52)=^TMP($J,LIST,PSSIEN2,52)_U Q
ELSE S ^TMP($J,LIST,PSSIEN2,52)=""
S ^TMP($J,LIST,PSSIEN2,63)=$P($G(^PSDRUG(PSSIEN2,2)),U,3)
I $P($G(^PSDRUG(PSSIEN2,2)),U,6)'="" D
.S ^TMP($J,LIST,PSSIEN2,64)=$P($G(^PSDRUG(PSSIEN2,2)),U,6)_U_$P($G(^PS(50.3,$P($G(^PSDRUG(PSSIEN2,2)),U,6),0)),U,1)
ELSE S ^TMP($J,LIST,PSSIEN2,64)=""
I $P($G(^PSDRUG(PSSIEN2,"I")),U,1) D
.N Y S Y=$P($G(^PSDRUG(PSSIEN2,"I")),U,1) X ^DD("DD")
.S ^TMP($J,LIST,PSSIEN2,100)=$P($G(^PSDRUG(PSSIEN2,"I")),U,1)_U_$G(Y)
ELSE S ^TMP($J,LIST,PSSIEN2,100)=""
S ^TMP($J,LIST,PSSIEN2,101)=$P($G(^PSDRUG(PSSIEN2,0)),U,10)
S ^TMP($J,LIST,PSSIEN2,102)=$P($G(^PSDRUG(PSSIEN2,2)),U,2)
I $P($G(^PSDRUG(PSSIEN2,"PSG")),U,2) D
.S ^TMP($J,LIST,PSSIEN2,301)=$P($G(^PSDRUG(PSSIEN2,"PSG")),U,2)
.S PSSZTMP=^TMP($J,LIST,PSSIEN2,301)
.I ^TMP($J,LIST,PSSIEN2,301)="0" S ^TMP($J,LIST,PSSIEN2,301)=PSSZTMP_U_"Field 03 or 04 - Doses by Type" Q
.I ^TMP($J,LIST,PSSIEN2,301)="1" S ^TMP($J,LIST,PSSIEN2,301)=PSSZTMP_U_"Field 06 or 07 - Units of Issue" Q
.I ^TMP($J,LIST,PSSIEN2,301)="2" S ^TMP($J,LIST,PSSIEN2,301)=PSSZTMP_U_"Field 17 - Fluids and Admin Sets" Q
.I ^TMP($J,LIST,PSSIEN2,301)="3" S ^TMP($J,LIST,PSSIEN2,301)=PSSZTMP_U_"Field 22 - Blood Products" Q
ELSE S ^TMP($J,LIST,PSSIEN2,301)=""
S ^TMP($J,LIST,PSSIEN2,302)=$P($G(^PSDRUG(PSSIEN2,"PSG")),U,3)
S ^TMP($J,LIST,PSSIEN2,400)=$P($G(^PSDRUG(PSSIEN2,"PFS")),U,1)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSS50TMP 4690 printed Nov 22, 2024@17:40:02 Page 2
PSS50TMP ;BIR/TSS - CONTINUATION OF API FOR INFORMATION FROM FILE 50; 5 Sep 03
+1 ;;1.0;PHARMACY DATA MANAGEMENT;**112**;9/30/97;Build 30
+2 ;Reference to ^PSNDF(50.68 is supported by DBIA 3735
+3 ;Reference to ^PSNDF(50.6 is supported by DBIA 2079
+4 ;Reference to ^PSNDF(50.605 is supported by DBIA 2138
+5 ;Reference to ^PSNDF(50.606 is supported by DBIA 2174
+6 ;Reference to ^PSNDF(50.3 is supported by DBIA 2612
DIRREAD ; PERFORMS ALL NON-MULTIPLE DIRECT READING FOR PSS50DAT
+1 NEW PSSZTMP
+2 SET ^TMP($JOB,LIST,PSSIEN2,.01)=$PIECE($GET(^PSDRUG(PSSIEN2,0)),U,1)
+3 SET ^TMP($JOB,LIST,PSSIEN2,2)=$PIECE($GET(^PSDRUG(PSSIEN2,0)),U,2)
+4 IF $PIECE($GET(^PSDRUG(PSSIEN2,2)),U,1)'=""
Begin DoDot:1
+5 SET ^TMP($JOB,LIST,PSSIEN2,2.1)=$PIECE($GET(^PSDRUG(PSSIEN2,2)),U,1)_U_$PIECE($GET(^PS(50.7,$PIECE($GET(^PSDRUG(PSSIEN2,2)),U,1),0)),U,1)_U_$PIECE($GET(^PS(50.7,$PIECE($GET(^PSDRUG(PSSIEN2,2)),U,1),0)),U,2)
+6 SET ^TMP($JOB,LIST,PSSIEN2,2.1)=^TMP($JOB,LIST,PSSIEN2,2.1)_U_$PIECE($GET(^PS(50.606,$PIECE($GET(^PS(50.7,$PIECE($GET(^PSDRUG(PSSIEN2,2)),U,1),0)),U,2),0)),U,1)
End DoDot:1
+7 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,2.1)=""
+8 SET PSSZTMP=$GET(^PSDRUG(PSSIEN2,0))
+9 SET ^TMP($JOB,LIST,PSSIEN2,3)=$PIECE($GET(PSSZTMP),U,3)
+10 SET ^TMP($JOB,LIST,PSSIEN2,4)=$PIECE($GET(PSSZTMP),U,4)
+11 SET ^TMP($JOB,LIST,PSSIEN2,5)=$PIECE($GET(PSSZTMP),U,5)
+12 SET ^TMP($JOB,LIST,PSSIEN2,6)=$PIECE($GET(PSSZTMP),U,6)
+13 SET ^TMP($JOB,LIST,PSSIEN2,8)=$PIECE($GET(PSSZTMP),U,8)
+14 IF $PIECE($GET(^PSDRUG(PSSIEN2,660)),U,2)'=""
Begin DoDot:1
+15 SET ^TMP($JOB,LIST,PSSIEN2,12)=$PIECE($GET(^PSDRUG(PSSIEN2,660)),U,2)_U_$PIECE($GET(^DIC(51.5,$PIECE($GET(^PSDRUG(PSSIEN2,660)),U,2),0)),U,1)_U_$PIECE($GET(^DIC(51.5,$PIECE($GET(^PSDRUG(PSSIEN2,660)),U,2),0)),U,2)
End DoDot:1
+16 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,12)=""
+17 SET PSSZTMP=$GET(^PSDRUG(PSSIEN2,660))
+18 SET ^TMP($JOB,LIST,PSSIEN2,13)=$PIECE($GET(PSSZTMP),U,3)
+19 SET ^TMP($JOB,LIST,PSSIEN2,14.5)=$PIECE($GET(PSSZTMP),U,8)
+20 SET ^TMP($JOB,LIST,PSSIEN2,15)=$PIECE($GET(PSSZTMP),U,5)
+21 SET ^TMP($JOB,LIST,PSSIEN2,16)=$PIECE($GET(PSSZTMP),U,6)
+22 SET ^TMP($JOB,LIST,PSSIEN2,21)=$PIECE($GET(PSSZTMP),U,2)
+23 IF $PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,1)'=""
Begin DoDot:1
+24 SET ^TMP($JOB,LIST,PSSIEN2,20)=$PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,1)_U_$PIECE($GET(^PSNDF(50.6,$PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,1),0)),U,1)
End DoDot:1
+25 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,20)=""
+26 IF $PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,3)'=""
Begin DoDot:1
+27 SET ^TMP($JOB,LIST,PSSIEN2,22)=$PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,3)_U_$PIECE($GET(^PSNDF(50.68,$PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,3),0)),U,1)
End DoDot:1
+28 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,22)=""
+29 IF $PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,6)'=""
Begin DoDot:1
+30 SET ^TMP($JOB,LIST,PSSIEN2,25)=$PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,6)_U_$PIECE($GET(^PS(50.605,$PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,6),0)),U,1)_U_$PIECE($GET(^PS(50.605,$PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,6),0)),U,2)
End DoDot:1
+31 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,25)=""
+32 SET ^TMP($JOB,LIST,PSSIEN2,27)=$PIECE($GET(^PSDRUG(PSSIEN2,"ND")),U,10)
+33 SET ^TMP($JOB,LIST,PSSIEN2,31)=$PIECE($GET(^PSDRUG(PSSIEN2,2)),U,4)
+34 SET ^TMP($JOB,LIST,PSSIEN2,40)=$PIECE($GET(^PSDRUG(PSSIEN2,"PSO")),U,1)
+35 IF $PIECE($GET(^PSDRUG(PSSIEN2,0)),U,9)
Begin DoDot:1
+36 SET ^TMP($JOB,LIST,PSSIEN2,51)=$PIECE($GET(^PSDRUG(PSSIEN2,0)),U,9)
+37 IF ^TMP($JOB,LIST,PSSIEN2,51)="1"
SET ^TMP($JOB,LIST,PSSIEN2,51)=^TMP($JOB,LIST,PSSIEN2,51)_U_"N/F"
QUIT
+38 IF ^TMP($JOB,LIST,PSSIEN2,51)=""
SET ^TMP($JOB,LIST,PSSIEN2,51)=^TMP($JOB,LIST,PSSIEN2,51)_U
QUIT
End DoDot:1
+39 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,51)=""
+40 IF $PIECE($GET(^PSDRUG(PSSIEN2,0)),U,11)
Begin DoDot:1
+41 SET ^TMP($JOB,LIST,PSSIEN2,52)=$PIECE($GET(^PSDRUG(PSSIEN2,0)),U,11)
+42 IF ^TMP($JOB,LIST,PSSIEN2,52)="1"
SET ^TMP($JOB,LIST,PSSIEN2,52)=^TMP($JOB,LIST,PSSIEN2,52)_U_"V-N/F"
QUIT
+43 IF ^TMP($JOB,LIST,PSSIEN2,52)=""
SET ^TMP($JOB,LIST,PSSIEN2,52)=^TMP($JOB,LIST,PSSIEN2,52)_U
QUIT
End DoDot:1
+44 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,52)=""
+45 SET ^TMP($JOB,LIST,PSSIEN2,63)=$PIECE($GET(^PSDRUG(PSSIEN2,2)),U,3)
+46 IF $PIECE($GET(^PSDRUG(PSSIEN2,2)),U,6)'=""
Begin DoDot:1
+47 SET ^TMP($JOB,LIST,PSSIEN2,64)=$PIECE($GET(^PSDRUG(PSSIEN2,2)),U,6)_U_$PIECE($GET(^PS(50.3,$PIECE($GET(^PSDRUG(PSSIEN2,2)),U,6),0)),U,1)
End DoDot:1
+48 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,64)=""
+49 IF $PIECE($GET(^PSDRUG(PSSIEN2,"I")),U,1)
Begin DoDot:1
+50 NEW Y
SET Y=$PIECE($GET(^PSDRUG(PSSIEN2,"I")),U,1)
XECUTE ^DD("DD")
+51 SET ^TMP($JOB,LIST,PSSIEN2,100)=$PIECE($GET(^PSDRUG(PSSIEN2,"I")),U,1)_U_$GET(Y)
End DoDot:1
+52 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,100)=""
+53 SET ^TMP($JOB,LIST,PSSIEN2,101)=$PIECE($GET(^PSDRUG(PSSIEN2,0)),U,10)
+54 SET ^TMP($JOB,LIST,PSSIEN2,102)=$PIECE($GET(^PSDRUG(PSSIEN2,2)),U,2)
+55 IF $PIECE($GET(^PSDRUG(PSSIEN2,"PSG")),U,2)
Begin DoDot:1
+56 SET ^TMP($JOB,LIST,PSSIEN2,301)=$PIECE($GET(^PSDRUG(PSSIEN2,"PSG")),U,2)
+57 SET PSSZTMP=^TMP($JOB,LIST,PSSIEN2,301)
+58 IF ^TMP($JOB,LIST,PSSIEN2,301)="0"
SET ^TMP($JOB,LIST,PSSIEN2,301)=PSSZTMP_U_"Field 03 or 04 - Doses by Type"
QUIT
+59 IF ^TMP($JOB,LIST,PSSIEN2,301)="1"
SET ^TMP($JOB,LIST,PSSIEN2,301)=PSSZTMP_U_"Field 06 or 07 - Units of Issue"
QUIT
+60 IF ^TMP($JOB,LIST,PSSIEN2,301)="2"
SET ^TMP($JOB,LIST,PSSIEN2,301)=PSSZTMP_U_"Field 17 - Fluids and Admin Sets"
QUIT
+61 IF ^TMP($JOB,LIST,PSSIEN2,301)="3"
SET ^TMP($JOB,LIST,PSSIEN2,301)=PSSZTMP_U_"Field 22 - Blood Products"
QUIT
End DoDot:1
+62 IF '$TEST
SET ^TMP($JOB,LIST,PSSIEN2,301)=""
+63 SET ^TMP($JOB,LIST,PSSIEN2,302)=$PIECE($GET(^PSDRUG(PSSIEN2,"PSG")),U,3)
+64 SET ^TMP($JOB,LIST,PSSIEN2,400)=$PIECE($GET(^PSDRUG(PSSIEN2,"PFS")),U,1)
+65 QUIT