PSJXR520 ; COMPILED XREF FOR FILE #55.07 ; 11/17/04
;
S DA(1)=0 S DA=0
A1 ;
I $D(DISET) K DIKLM S:DIKM1=2 DIKLM=1 S:DIKM1'=2&'$G(DIKPUSH(2)) DIKPUSH(2)=1,DA(2)=DA(1),DA(1)=DA,DA=0 G @DIKM1
A S DA(1)=$O(^PS(55,DA(2),5,DA(1))) I DA(1)'>0 S DA(1)=0 G END
1 ;
B S DA=$O(^PS(55,DA(2),5,DA(1),1,DA)) I DA'>0 S DA=0 Q:DIKM1=1 G A
2 ;
S DIKZ(0)=$G(^PS(55,DA(2),5,DA(1),1,DA,0))
S X=$P(DIKZ(0),U,1)
I X'="" I '$D(DIU(0)) D:$D(PSGAL(701))#2 KILL^PSGAL5:PSGAL(701)=X K PSGAL
S X=$P(DIKZ(0),U,1)
I X'="" S ^PS(55,DA(2),5,DA(1),1,"B",$E(X,1,30),DA)=""
S X=$P(DIKZ(0),U,2)
I X'="" I '$D(DIU(0)) D:$D(PSGAL(702))#2 KILL^PSGAL5:PSGAL(702)=X K PSGAL
S X=$P(DIKZ(0),U,5)
I X'="" I '$D(DIU(0)) D:$D(PSGAL(705))#2 KILL^PSGAL5:PSGAL(705)=X K PSGAL
S X=$P(DIKZ(0),U,6)
I X'="" I '$D(DIU(0)) D:$D(PSGAL(706))#2 KILL^PSGAL5:PSGAL(706)=X K PSGAL
S X=$P(DIKZ(0),U,7)
I X'="" I '$D(DIU(0)) D:$D(PSGAL(707))#2 KILL^PSGAL5:PSGAL(707)=X K PSGAL
S X=$P(DIKZ(0),U,8)
I X'="" D
.N DIK,DIV,DIU,DIN
.I X S DIU=$P($G(^PS(55,DA(2),5,DA(1),1,DA,0)),"^",7),$P(^(0),"^",7)=DIU+X I $O(^DD(55.07,.07,1,0)) K DIV S (DIV(0),D0)=DA(2),(DIV(1),D1)=DA(1),(DIV(2),D2)=DA,DIV=DIU+X,DIH=55.07,DIG=.07 D ^DICR
S X=$P(DIKZ(0),U,8)
I X'="" I '$D(DIU(0)),X D EN^PSGAMSA(DA(2),DA(1),DA,4)
S X=$P(DIKZ(0),U,9)
I X'="" I '$D(DIU(0)) D:$D(PSGAL(709))#2 KILL^PSGAL5:PSGAL(709)=X K PSGAL
S X=$P(DIKZ(0),U,9)
I X'="" I '$D(DIU(0)),X D EN^PSGAMSA(DA(2),DA(1),DA,2)
S X=$P(DIKZ(0),U,9)
I X'="" D
.N DIK,DIV,DIU,DIN
.I X S DIU=$P($G(^PS(55,DA(2),5,DA(1),1,DA,0)),"^",12) S $P(^(0),"^",12)=DIU+X I $O(^DD(55.07,.12,1,0)) K DIV S (DIV,D0)=DA(2),(DIV(1),D1)=DA(1),(DIV(2),D2)=DA,DIV=DIU+X,DIH=55.07,DIG=.12 D ^DICR
S X=$P(DIKZ(0),U,10)
I X'="" I '$D(DIU(0)) D:$D(PSGAL(710)) KILL^PSGAL5:PSGAL(710)=X K PSGAL
S X=$P(DIKZ(0),U,11)
I X'="" D
.N DIK,DIV,DIU,DIN
.I X S DIU=$P($G(^PS(55,DA(2),5,DA(1),1,DA,0)),"^",10),$P(^(0),"^",10)=DIU+X I $O(^DD(55.07,.1,1,0)) K DIV S (DIV(0),D0)=DA(2),(DIV(1),D1)=DA(1),(DIV(2),D2)=DA,DIV=DIU+X,DIH=55.07,DIG=.1 D ^DICR
S X=$P(DIKZ(0),U,11)
I X'="" I '$D(DIU(0)),X D EN^PSGAMSA(DA(2),DA(1),DA,3)
S X=$P(DIKZ(0),U,12)
I X'="" I '$D(DIU(0)) D:$D(PSGAL(712))#2 KILL^PSGAL5:PSGAL(712)=X K PSGAL
G:'$D(DIKLM) B Q:$D(DISET)
END G ^PSJXR521
PSJXR520 ; COMPILED XREF FOR FILE #55.07 ; 11/17/04
+1 ;
+2 SET DA(1)=0
SET DA=0
A1 ;
+1 IF $DATA(DISET)
KILL DIKLM
IF DIKM1=2
SET DIKLM=1
IF DIKM1'=2&'$GET(DIKPUSH(2))
SET DIKPUSH(2)=1
SET DA(2)=DA(1)
SET DA(1)=DA
SET DA=0
GOTO @DIKM1
A SET DA(1)=$ORDER(^PS(55,DA(2),5,DA(1)))
IF DA(1)'>0
SET DA(1)=0
GOTO END
1 ;
B SET DA=$ORDER(^PS(55,DA(2),5,DA(1),1,DA))
IF DA'>0
SET DA=0
IF DIKM1=1
QUIT
GOTO A
2 ;
+1 SET DIKZ(0)=$GET(^PS(55,DA(2),5,DA(1),1,DA,0))
+2 SET X=$PIECE(DIKZ(0),U,1)
+3 IF X'=""
IF '$DATA(DIU(0))
IF $DATA(PSGAL(701))#2
IF PSGAL(701)=X
DO KILL^PSGAL5
KILL PSGAL
+4 SET X=$PIECE(DIKZ(0),U,1)
+5 IF X'=""
SET ^PS(55,DA(2),5,DA(1),1,"B",$EXTRACT(X,1,30),DA)=""
+6 SET X=$PIECE(DIKZ(0),U,2)
+7 IF X'=""
IF '$DATA(DIU(0))
IF $DATA(PSGAL(702))#2
IF PSGAL(702)=X
DO KILL^PSGAL5
KILL PSGAL
+8 SET X=$PIECE(DIKZ(0),U,5)
+9 IF X'=""
IF '$DATA(DIU(0))
IF $DATA(PSGAL(705))#2
IF PSGAL(705)=X
DO KILL^PSGAL5
KILL PSGAL
+10 SET X=$PIECE(DIKZ(0),U,6)
+11 IF X'=""
IF '$DATA(DIU(0))
IF $DATA(PSGAL(706))#2
IF PSGAL(706)=X
DO KILL^PSGAL5
KILL PSGAL
+12 SET X=$PIECE(DIKZ(0),U,7)
+13 IF X'=""
IF '$DATA(DIU(0))
IF $DATA(PSGAL(707))#2
IF PSGAL(707)=X
DO KILL^PSGAL5
KILL PSGAL
+14 SET X=$PIECE(DIKZ(0),U,8)
+15 IF X'=""
Begin DoDot:1
+16 NEW DIK,DIV,DIU,DIN
+17 IF X
SET DIU=$PIECE($GET(^PS(55,DA(2),5,DA(1),1,DA,0)),"^",7)
SET $PIECE(^(0),"^",7)=DIU+X
IF $ORDER(^DD(55.07,.07,1,0))
KILL DIV
SET (DIV(0),D0)=DA(2)
SET (DIV(1),D1)=DA(1)
SET (DIV(2),D2)=DA
SET DIV=DIU+X
SET DIH=55.07
SET DIG=.07
DO ^DICR
End DoDot:1
+18 SET X=$PIECE(DIKZ(0),U,8)
+19 IF X'=""
IF '$DATA(DIU(0))
IF X
DO EN^PSGAMSA(DA(2),DA(1),DA,4)
+20 SET X=$PIECE(DIKZ(0),U,9)
+21 IF X'=""
IF '$DATA(DIU(0))
IF $DATA(PSGAL(709))#2
IF PSGAL(709)=X
DO KILL^PSGAL5
KILL PSGAL
+22 SET X=$PIECE(DIKZ(0),U,9)
+23 IF X'=""
IF '$DATA(DIU(0))
IF X
DO EN^PSGAMSA(DA(2),DA(1),DA,2)
+24 SET X=$PIECE(DIKZ(0),U,9)
+25 IF X'=""
Begin DoDot:1
+26 NEW DIK,DIV,DIU,DIN
+27 IF X
SET DIU=$PIECE($GET(^PS(55,DA(2),5,DA(1),1,DA,0)),"^",12)
SET $PIECE(^(0),"^",12)=DIU+X
IF $ORDER(^DD(55.07,.12,1,0))
KILL DIV
SET (DIV,D0)=DA(2)
SET (DIV(1),D1)=DA(1)
SET (DIV(2),D2)=DA
SET DIV=DIU+X
SET DIH=55.07
SET DIG=.12
DO ^DICR
End DoDot:1
+28 SET X=$PIECE(DIKZ(0),U,10)
+29 IF X'=""
IF '$DATA(DIU(0))
IF $DATA(PSGAL(710))
IF PSGAL(710)=X
DO KILL^PSGAL5
KILL PSGAL
+30 SET X=$PIECE(DIKZ(0),U,11)
+31 IF X'=""
Begin DoDot:1
+32 NEW DIK,DIV,DIU,DIN
+33 IF X
SET DIU=$PIECE($GET(^PS(55,DA(2),5,DA(1),1,DA,0)),"^",10)
SET $PIECE(^(0),"^",10)=DIU+X
IF $ORDER(^DD(55.07,.1,1,0))
KILL DIV
SET (DIV(0),D0)=DA(2)
SET (DIV(1),D1)=DA(1)
SET (DIV(2),D2)=DA
SET DIV=DIU+X
SET DIH=55.07
SET DIG=.1
DO ^DICR
End DoDot:1
+34 SET X=$PIECE(DIKZ(0),U,11)
+35 IF X'=""
IF '$DATA(DIU(0))
IF X
DO EN^PSGAMSA(DA(2),DA(1),DA,3)
+36 SET X=$PIECE(DIKZ(0),U,12)
+37 IF X'=""
IF '$DATA(DIU(0))
IF $DATA(PSGAL(712))#2
IF PSGAL(712)=X
DO KILL^PSGAL5
KILL PSGAL
+38 IF '$DATA(DIKLM)
GOTO B
IF $DATA(DISET)
QUIT
END GOTO ^PSJXR521