PSSJXR2 ; COMPILED XREF FOR FILE #55.01 ; 08/08/13
;
S DA(1)=DA S DA=0
A1 ;
I $D(DIKILL) K DIKLM S:DIKM1=1 DIKLM=1 G @DIKM1
0 ;
K ^PS(55,DA(1),"IV","AIN")
A S DA=$O(^PS(55,DA(1),"IV",DA)) I DA'>0 S DA=0 G END
1 ;
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X=$P($G(DIKZ(0)),U,2)
I X'="" X ^DD(55.01,.02,1,1,2)
S X=$P($G(DIKZ(0)),U,2)
I X'="" K ^PS(55,"AIVS",$E(X,1,30),DA(1),DA)
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X=$P($G(DIKZ(0)),U,3)
I X'="" K ^PS(55,"AIV",+$E(X,1,30),DA(1),DA)
S X=$P($G(DIKZ(0)),U,3)
I X'="" X ^DD(55.01,.03,1,2,2)
S X=$P($G(DIKZ(0)),U,3)
I X'="" K ^PS(55,DA(1),"IV","AIS",$E(X,1,30),DA)
S X=$P($G(DIKZ(0)),U,3)
I X'="" I $P($G(^PS(55,DA(1),"IV",DA,0)),U,4)]"" K ^PS(55,DA(1),"IV","AIT",$P(^(0),U,4),+X,DA)
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X=$P($G(DIKZ(0)),U,4)
I X'="" X ^DD(55.01,.04,1,1,2)
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X=$P($G(DIKZ(0)),U,6)
I X'="" X ^DD(55.01,.06,1,1,2)
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X=$P($G(DIKZ(0)),U,8)
I X'="" X ^DD(55.01,.08,1,1,2)
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X=$P($G(DIKZ(0)),U,9)
I X'="" X ^DD(55.01,.09,1,1,2)
S DIKZ(1)=$G(^PS(55,DA(1),"IV",DA,1))
S X=$P($G(DIKZ(1)),U,1)
I X'="" X ^DD(55.01,.1,1,1,2)
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X=$P($G(DIKZ(0)),U,11)
I X'="" X ^DD(55.01,.12,1,1,2)
S DIKZ(3)=$G(^PS(55,DA(1),"IV",DA,3))
S X=$P($G(DIKZ(3)),U,1)
I X'="" X ^DD(55.01,31,1,1,2)
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X=$P($G(DIKZ(0)),U,17)
I X'="" X ^DD(55.01,100,1,1,2)
S X=$P($G(DIKZ(0)),U,17)
I X'="" K:X'="N" ^PS(55,"ANVO",DA(1),DA)
S X=$P($G(DIKZ(0)),U,17)
I X'="" K:X'="D"&($D(^PS(55,DA(1),"IV",DA,"ADC"))) ^PS(55,"ADC",^PS(55,DA(1),"IV",DA,"ADC"),DA(1),DA)
S DIKZ(4)=$G(^PS(55,DA(1),"IV",DA,4))
S X=$P($G(DIKZ(4)),U,9)
I X'="" X ^DD(55.01,142,1,1,2)
S X=$P($G(DIKZ(4)),U,9)
I X'="" K ^PS(55,"APIV",DA(1),DA)
S DIKZ(4)=$G(^PS(55,DA(1),"IV",DA,4))
S X=$P($G(DIKZ(4)),U,10)
I X'="" X ^DD(55.01,143,1,1,2)
S X=$P($G(DIKZ(4)),U,10)
I X'="" K ^PS(55,"ANIV",DA(1),DA)
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X=$P($G(DIKZ(0)),U,1)
I X'="" K ^PS(55,DA(1),"IV","B",$E(X,1,30),DA)
CR1 S DIXR=432
K X
S DIKZ(.2)=$G(^PS(55,DA(1),"IV",DA,.2))
S X(1)=$P(DIKZ(.2),U,8)
S X(2)=$P(DIKZ(0),U,21)
S X=$G(X(1))
I $G(X(1))]"",$G(X(2))]"" D
. K X1,X2 M X1=X,X2=X
. S:$D(DIKIL) (X2,X2(1),X2(2))=""
. N DIKXARR M DIKXARR=X S DIKCOND=1
. S X=1
. S DIKCOND=$G(X) K X M X=DIKXARR
. Q:'DIKCOND
. K ^PS(55,"ACX",$E(X(1),1,30),$E(X(2),1,30),DA_"V")
CR2 S DIXR=435
K X
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X(1)=$P(DIKZ(0),U,2)
S X(2)=$P(DIKZ(0),U,3)
S X=$G(X(1))
I $G(X(1))]"",$G(X(2))]"" D
. K X1,X2 M X1=X,X2=X
. S:$D(DIKIL) (X2,X2(1),X2(2))=""
. N DIKXARR M DIKXARR=X S DIKCOND=1
. S X=$$PATCH^XPDUTL("PXRM*1.5*12")
. S DIKCOND=$G(X) K X M X=DIKXARR
. Q:'DIKCOND
. D KPSPA^PSJXRFK(.X,.DA,"IV")
CR3 S DIXR=451
K X
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X(1)=$P(DIKZ(0),U,3)
S DIKZ("DSS")=$G(^PS(55,DA(1),"IV",DA,"DSS"))
S X(2)=$P(DIKZ("DSS"),U,1)
S X=$G(X(1))
I $G(X(1))]"",$G(X(2))]"" D
. K X1,X2 M X1=X,X2=X
. S:$D(DIKIL) (X2,X2(1),X2(2))=""
. K ^PS(55,"AIVC",$E(X(1),1,20),$E(X(2),1,20),DA(1),DA)
CR4 S DIXR=453
K X
S DIKZ(0)=$G(^PS(55,DA(1),"IV",DA,0))
S X(1)=$P(DIKZ(0),U,3)
S DIKZ("DSS")=$G(^PS(55,DA(1),"IV",DA,"DSS"))
S X(2)=$P(DIKZ("DSS"),U,1)
S X=$G(X(1))
I $G(X(1))]"",$G(X(2))]"" D
. K X1,X2 M X1=X,X2=X
. S:$D(DIKIL) (X2,X2(1),X2(2))=""
. K ^PS(55,DA(1),"IV","AIN",X(1),X(2),DA)
CR5 K X
G:'$D(DIKLM) A Q:$D(DIKILL)
END G ^PSSJXR3
PSSJXR2 ; COMPILED XREF FOR FILE #55.01 ; 08/08/13
+1 ;
+2 SET DA(1)=DA
SET DA=0
A1 ;
+1 IF $DATA(DIKILL)
KILL DIKLM
IF DIKM1=1
SET DIKLM=1
GOTO @DIKM1
0 ;
+1 KILL ^PS(55,DA(1),"IV","AIN")
A SET DA=$ORDER(^PS(55,DA(1),"IV",DA))
IF DA'>0
SET DA=0
GOTO END
1 ;
+1 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+2 SET X=$PIECE($GET(DIKZ(0)),U,2)
+3 IF X'=""
XECUTE ^DD(55.01,.02,1,1,2)
+4 SET X=$PIECE($GET(DIKZ(0)),U,2)
+5 IF X'=""
KILL ^PS(55,"AIVS",$EXTRACT(X,1,30),DA(1),DA)
+6 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+7 SET X=$PIECE($GET(DIKZ(0)),U,3)
+8 IF X'=""
KILL ^PS(55,"AIV",+$EXTRACT(X,1,30),DA(1),DA)
+9 SET X=$PIECE($GET(DIKZ(0)),U,3)
+10 IF X'=""
XECUTE ^DD(55.01,.03,1,2,2)
+11 SET X=$PIECE($GET(DIKZ(0)),U,3)
+12 IF X'=""
KILL ^PS(55,DA(1),"IV","AIS",$EXTRACT(X,1,30),DA)
+13 SET X=$PIECE($GET(DIKZ(0)),U,3)
+14 IF X'=""
IF $PIECE($GET(^PS(55,DA(1),"IV",DA,0)),U,4)]""
KILL ^PS(55,DA(1),"IV","AIT",$PIECE(^(0),U,4),+X,DA)
+15 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+16 SET X=$PIECE($GET(DIKZ(0)),U,4)
+17 IF X'=""
XECUTE ^DD(55.01,.04,1,1,2)
+18 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+19 SET X=$PIECE($GET(DIKZ(0)),U,6)
+20 IF X'=""
XECUTE ^DD(55.01,.06,1,1,2)
+21 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+22 SET X=$PIECE($GET(DIKZ(0)),U,8)
+23 IF X'=""
XECUTE ^DD(55.01,.08,1,1,2)
+24 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+25 SET X=$PIECE($GET(DIKZ(0)),U,9)
+26 IF X'=""
XECUTE ^DD(55.01,.09,1,1,2)
+27 SET DIKZ(1)=$GET(^PS(55,DA(1),"IV",DA,1))
+28 SET X=$PIECE($GET(DIKZ(1)),U,1)
+29 IF X'=""
XECUTE ^DD(55.01,.1,1,1,2)
+30 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+31 SET X=$PIECE($GET(DIKZ(0)),U,11)
+32 IF X'=""
XECUTE ^DD(55.01,.12,1,1,2)
+33 SET DIKZ(3)=$GET(^PS(55,DA(1),"IV",DA,3))
+34 SET X=$PIECE($GET(DIKZ(3)),U,1)
+35 IF X'=""
XECUTE ^DD(55.01,31,1,1,2)
+36 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+37 SET X=$PIECE($GET(DIKZ(0)),U,17)
+38 IF X'=""
XECUTE ^DD(55.01,100,1,1,2)
+39 SET X=$PIECE($GET(DIKZ(0)),U,17)
+40 IF X'=""
IF X'="N"
KILL ^PS(55,"ANVO",DA(1),DA)
+41 SET X=$PIECE($GET(DIKZ(0)),U,17)
+42 IF X'=""
IF X'="D"&($DATA(^PS(55,DA(1),"IV",DA,"ADC")))
KILL ^PS(55,"ADC",^PS(55,DA(1),"IV",DA,"ADC"),DA(1),DA)
+43 SET DIKZ(4)=$GET(^PS(55,DA(1),"IV",DA,4))
+44 SET X=$PIECE($GET(DIKZ(4)),U,9)
+45 IF X'=""
XECUTE ^DD(55.01,142,1,1,2)
+46 SET X=$PIECE($GET(DIKZ(4)),U,9)
+47 IF X'=""
KILL ^PS(55,"APIV",DA(1),DA)
+48 SET DIKZ(4)=$GET(^PS(55,DA(1),"IV",DA,4))
+49 SET X=$PIECE($GET(DIKZ(4)),U,10)
+50 IF X'=""
XECUTE ^DD(55.01,143,1,1,2)
+51 SET X=$PIECE($GET(DIKZ(4)),U,10)
+52 IF X'=""
KILL ^PS(55,"ANIV",DA(1),DA)
+53 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+54 SET X=$PIECE($GET(DIKZ(0)),U,1)
+55 IF X'=""
KILL ^PS(55,DA(1),"IV","B",$EXTRACT(X,1,30),DA)
CR1 SET DIXR=432
+1 KILL X
+2 SET DIKZ(.2)=$GET(^PS(55,DA(1),"IV",DA,.2))
+3 SET X(1)=$PIECE(DIKZ(.2),U,8)
+4 SET X(2)=$PIECE(DIKZ(0),U,21)
+5 SET X=$GET(X(1))
+6 IF $GET(X(1))]""
IF $GET(X(2))]""
Begin DoDot:1
+7 KILL X1,X2
MERGE X1=X,X2=X
+8 IF $DATA(DIKIL)
SET (X2,X2(1),X2(2))=""
+9 NEW DIKXARR
MERGE DIKXARR=X
SET DIKCOND=1
+10 SET X=1
+11 SET DIKCOND=$GET(X)
KILL X
MERGE X=DIKXARR
+12 IF 'DIKCOND
QUIT
+13 KILL ^PS(55,"ACX",$EXTRACT(X(1),1,30),$EXTRACT(X(2),1,30),DA_"V")
End DoDot:1
CR2 SET DIXR=435
+1 KILL X
+2 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+3 SET X(1)=$PIECE(DIKZ(0),U,2)
+4 SET X(2)=$PIECE(DIKZ(0),U,3)
+5 SET X=$GET(X(1))
+6 IF $GET(X(1))]""
IF $GET(X(2))]""
Begin DoDot:1
+7 KILL X1,X2
MERGE X1=X,X2=X
+8 IF $DATA(DIKIL)
SET (X2,X2(1),X2(2))=""
+9 NEW DIKXARR
MERGE DIKXARR=X
SET DIKCOND=1
+10 SET X=$$PATCH^XPDUTL("PXRM*1.5*12")
+11 SET DIKCOND=$GET(X)
KILL X
MERGE X=DIKXARR
+12 IF 'DIKCOND
QUIT
+13 DO KPSPA^PSJXRFK(.X,.DA,"IV")
End DoDot:1
CR3 SET DIXR=451
+1 KILL X
+2 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+3 SET X(1)=$PIECE(DIKZ(0),U,3)
+4 SET DIKZ("DSS")=$GET(^PS(55,DA(1),"IV",DA,"DSS"))
+5 SET X(2)=$PIECE(DIKZ("DSS"),U,1)
+6 SET X=$GET(X(1))
+7 IF $GET(X(1))]""
IF $GET(X(2))]""
Begin DoDot:1
+8 KILL X1,X2
MERGE X1=X,X2=X
+9 IF $DATA(DIKIL)
SET (X2,X2(1),X2(2))=""
+10 KILL ^PS(55,"AIVC",$EXTRACT(X(1),1,20),$EXTRACT(X(2),1,20),DA(1),DA)
End DoDot:1
CR4 SET DIXR=453
+1 KILL X
+2 SET DIKZ(0)=$GET(^PS(55,DA(1),"IV",DA,0))
+3 SET X(1)=$PIECE(DIKZ(0),U,3)
+4 SET DIKZ("DSS")=$GET(^PS(55,DA(1),"IV",DA,"DSS"))
+5 SET X(2)=$PIECE(DIKZ("DSS"),U,1)
+6 SET X=$GET(X(1))
+7 IF $GET(X(1))]""
IF $GET(X(2))]""
Begin DoDot:1
+8 KILL X1,X2
MERGE X1=X,X2=X
+9 IF $DATA(DIKIL)
SET (X2,X2(1),X2(2))=""
+10 KILL ^PS(55,DA(1),"IV","AIN",X(1),X(2),DA)
End DoDot:1
CR5 KILL X
+1 IF '$DATA(DIKLM)
GOTO A
IF $DATA(DIKILL)
QUIT
END GOTO ^PSSJXR3