DGPMXX2 ; COMPILED XREF FOR FILE #405 ; 03/21/13
;
S DIKZK=1
S DIKZ(0)=$G(^DGPM(DA,0))
S X=$P($G(DIKZ(0)),U,1)
I X'="" S ^DGPM("B",$E(X,1,30),DA)=""
S X=$P($G(DIKZ(0)),U,1)
I X'="" S DGPMDDF=1 D ^DGPMDD1
S X=$P($G(DIKZ(0)),U,1)
I X'="" D
.N DIK,DIV,DIU,DIN
.X ^DD(405,.01,1,3,1.3) I X S X=DIV X ^DD(405,.01,1,3,89.2) S X=$P(Y(101),U,1) S D0=I(0,0) S DIU=X K Y S X=DIV S X=DIV X ^DD(405,.01,1,3,1.4)
S X=$P($G(DIKZ(0)),U,1)
I X'="" S:$P(^DGPM(DA,0),U,22)="" $P(^(0),U,22)=0
S X=$P($G(DIKZ(0)),U,1)
I X'="" D
.N DIK,DIV,DIU,DIN
.K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X=$S('$D(^DGPM(+$P(^DGPM(DA,0),U,24),0)):0,1:X'=+^(0)) I X S X=DIV S Y(1)=$S($D(^DGPM(D0,0)):^(0),1:"") S X=$P(Y(1),U,24),X=X S DIU=X K Y S X="" X ^DD(405,.01,1,5,1.4)
S X=$P($G(DIKZ(0)),U,1)
I X'="" S:$P(^DGPM(DA,0),U,3) ^DGPM("ADFN"_$P(^(0),U,3),X,DA)=""
S X=$P($G(DIKZ(0)),U,1)
I X'="" S Y=$P(^DGPM(DA,0),U,2) I Y,Y'=4,Y'=5,X,X<DT S DGHNYT=$S(Y=1:$S($D(DGIDX):3,1:1),Y=2:$S($D(DGIDX):6,1:4),Y=3:$S($D(DGIDX):9,1:7),1:15) D ^DGPMGLC K DGIDX
S X=$P($G(DIKZ(0)),U,1)
I X'="" I "^1^3^"[("^"_$P(^DGPM(DA,0),"^",2)_"^") S A1B2TAG="ADM" D ^A1B2XFR
S X=$P($G(DIKZ(0)),U,1)
I X'="" S DH=405,DV=.01,DU=1 S DIIX=3 D:$G(DIK(0))'["A" AUDIT^DIK1
S DIKZ(0)=$G(^DGPM(DA,0))
S X=$P($G(DIKZ(0)),U,2)
I X'="" S DGPMDDF=2 D ^DGPMDD1
S X=$P($G(DIKZ(0)),U,3)
I X'="" S ^DGPM("C",$E(X,1,30),DA)=""
S X=$P($G(DIKZ(0)),U,3)
I X'="" S DGPMDDF=3 D ^DGPMDD1
S X=$P($G(DIKZ(0)),U,3)
I X'="" S ^DGPM("ADFN"_X,+^DGPM(DA,0),DA)=""
S X=$P($G(DIKZ(0)),U,4)
I X'="" D
.N DIK,DIV,DIU,DIN
.K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGPM(D0,0)):^(0),1:"") S X=$P(Y(1),U,18),X=X S DIU=X K Y X ^DD(405,.04,1,1,1.1) X ^DD(405,.04,1,1,1.4)
S DIKZ(0)=$G(^DGPM(DA,0))
S X=$P($G(DIKZ(0)),U,5)
I X'="" I $P(^DGPM(DA,0),"^",2)=3 S A1B2TAG="ADM" D ^A1B2XFR
S X=$P($G(DIKZ(0)),U,6)
I X'="" S DGPMDDF=6,DGPMDDT=1 D ^DGPMDDCN
S X=$P($G(DIKZ(0)),U,6)
I X'="" D
.N DIK,DIV,DIU,DIN
.K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGPM(D0,0)):^(0),1:"") S X=$P(Y(1),U,7),X=X S DIU=X K Y S X="" S DIH=$S($D(^DGPM(DIV(0),0)):^(0),1:""),DIV=X S $P(^(0),U,7)=DIV,DIH=405,DIG=.07 D ^DICR:$N(^DD(DIH,DIG,1,0))>0
S X=$P($G(DIKZ(0)),U,6)
I X'="" S Y=^DGPM(DA,0) I +Y,Y<DT S Y=$P(Y,U,2) I Y<3,$D(DGOWD) S DGHNYT=$S(Y=1:10,1:12) D ^DGPMGLC K DGIDX
S DIKZ(0)=$G(^DGPM(DA,0))
S X=$P($G(DIKZ(0)),U,7)
I X'="" S DGPMDDF=7,DGPMDDT=1 D ^DGPMDDCN
S X=$P($G(DIKZ(0)),U,8)
I X'="" S DGPMDDF=8,DGPMDDT=1 D ^DGPMDDCN
S X=$P($G(DIKZ(0)),U,9)
I X'="" S DGPMDDF=9 D ^DGPMDD1
S X=$P($G(DIKZ(0)),U,9)
I X'="" S DGPMDDF=9,DGPMDDT=1 D ^DGPMDDCN
S X=$P($G(DIKZ(0)),U,9)
I X'="" I $D(^DGPM(+$P(^DGPM(DA,0),"^",24),0)),($P(^(0),"^",2)=1) S A1B2TAG="ADM1" D ^A1B2XFR
S X=$P($G(DIKZ(0)),U,9)
I X'="" S Y=^DGPM(DA,0) I +Y,Y<DT S Y=$P(Y,U,2) I Y=6,X'=$P(Y,U,9) S DGHNYT=13 D ^DGPMGLC
S X=$P($G(DIKZ(0)),U,9)
I X'="" D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01($$GET1^DIQ(405,DA,.03,"I"))
S X=$P($G(DIKZ(0)),U,9)
I X'="" S DH=405,DV=.09,DU=1 S DIIX=3 D:$G(DIK(0))'["A" AUDIT^DIK1
S X=$P($G(DIKZ(0)),U,14)
I X'="" S DGPMDDF=14 D ^DGPMDD1
S X=$P($G(DIKZ(0)),U,14)
I X'="" S ^DGPM("CA",$E(X,1,30),DA)=""
S X=$P($G(DIKZ(0)),U,14)
I X'="" D
.N DIK,DIV,DIU,DIN
.K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X I "^3^5^"[("^"_$P(^DGPM(DA,0),"^",2)_"^") I X S X=DIV X ^DD(405,.14,1,3,89.2) S X=$S('$D(^DGPM(+$P(Y(101),U,17),0)):"",1:$P(^(0),U,1)) S D0=I(0,0) S DIU=X K Y S X=DIV S X=DA X ^DD(405,.14,1,3,1.4)
S DIKZ(0)=$G(^DGPM(DA,0))
S X=$P($G(DIKZ(0)),U,16)
I X'="" S ^DGPM("APTF",$E(X,1,30),DA)=""
S X=$P($G(DIKZ(0)),U,17)
I X'="" D XREF^DGPMDDCN
S X=$P($G(DIKZ(0)),U,18)
I X'="" D
.N DIK,DIV,DIU,DIN
.K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X I "MAS MOVEMENT TYPE"'="TRANSFER IN"&("MAS MOVEMENT TYPE"'="TRANSFER OUT") I X S X=DIV S Y(1)=$S($D(^DGPM(D0,0)):^(0),1:"") S X=$P(Y(1),U,5),X=X S DIU=X K Y S X="" X ^DD(405,.18,1,1,1.4)
S X=$P($G(DIKZ(0)),U,18)
I X'="" D
.N DIK,DIV,DIU,DIN
.K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X=$S('$D(^DG(405.2,+Y(0),0)):"",1:$P(^(0),U,1))["DEATH" I X S X=DIV X ^DD(405,.18,1,2,89.2) S X=$P(Y(101),U,1) S D0=I(0,0) S DIU=X K Y X ^DD(405,.18,1,2,1.1) X ^DD(405,.18,1,2,1.4)
S X=$P($G(DIKZ(0)),U,18)
I X'="" S Y=^DGPM(DA,0) I +Y,Y<DT S Y=$P(Y,U,2) I Y<4,$D(DGOTY) S DGHNYT=11 D ^DGPMGLC K DGIDX
S X=$P($G(DIKZ(0)),U,18)
I X'="" I $P(^DGPM(DA,0),"^",2)=3 S A1B2TAG="ADM" D ^A1B2XFR
S DIKZ(0)=$G(^DGPM(DA,0))
S X=$P($G(DIKZ(0)),U,19)
I X'="" S DGPMDDF=19,DGPMDDT=1 D ^DGPMDDCN
S X=$P($G(DIKZ(0)),U,22)
I X'="" S DGPMDDF=22 D ^DGPMDD1
S X=$P($G(DIKZ(0)),U,23)
I X'="" S DGPMDDF=23 D ^DGPMDD1
S X=$P($G(DIKZ(0)),U,24)
I X'="" S ^DGPM("APHY",$E(X,1,30),DA)=""
S X=$P($G(DIKZ(0)),U,27)
I X'="" S ^DGPM("AVISIT",$E(X,1,30),DA)=""
S X=$P($G(DIKZ(0)),U,27)
I X'="" S:$P(^DGPM(DA,0),U,3) ^DGPM("AVST",$P(^DGPM(DA,0),U,3),X,DA)=""
S DIKZ("DIR")=$G(^DGPM(DA,"DIR"))
S X=$P($G(DIKZ("DIR")),U,1)
I X'="" D
.N DIK,DIV,DIU,DIN
.K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGPM(D0,"DIR")):^("DIR"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X=DIV N %I,%H,% D NOW^%DTC S X=% X ^DD(405,41,1,1,1.4)
S X=$P($G(DIKZ("DIR")),U,1)
I X'="" D
.N DIK,DIV,DIU,DIN
.K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGPM(D0,"DIR")):^("DIR"),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X=DIV S X=$G(DUZ) S DIH=$G(^DGPM(DIV(0),"DIR")),DIV=X S $P(^("DIR"),U,3)=DIV,DIH=405,DIG=43 D ^DICR
S X=$P($G(DIKZ("DIR")),U,1)
I X'="" S DGPMDDF=41,DGPMDDT=1 D ^DGPMDDCN
S DIKZ("USR")=$G(^DGPM(DA,"USR"))
S X=$P($G(DIKZ("USR")),U,3)
I X'="" S DH=405,DV=102,DU=1 S DIIX=3 D:$G(DIK(0))'["A" AUDIT^DIK1
S DIKZ("ODS")=$G(^DGPM(DA,"ODS"))
S X=$P($G(DIKZ("ODS")),U,2)
I X'="" S A1B2TAG="ADM" D ^A1B2XFR
S X=$P($G(DIKZ("ODS")),U,4)
I X'="" S ^DGPM("AODSA",$E(X,1,30),DA)=""
S X=$P($G(DIKZ("ODS")),U,6)
I X'="" S A1B2TAG="ADM" D ^A1B2XFR
S X=$P($G(DIKZ("ODS")),U,7)
I X'="" S ^DGPM("AODSD",$E(X,1,30),DA)=""
END Q
DGPMXX2 ; COMPILED XREF FOR FILE #405 ; 03/21/13
+1 ;
+2 SET DIKZK=1
+3 SET DIKZ(0)=$GET(^DGPM(DA,0))
+4 SET X=$PIECE($GET(DIKZ(0)),U,1)
+5 IF X'=""
SET ^DGPM("B",$EXTRACT(X,1,30),DA)=""
+6 SET X=$PIECE($GET(DIKZ(0)),U,1)
+7 IF X'=""
SET DGPMDDF=1
DO ^DGPMDD1
+8 SET X=$PIECE($GET(DIKZ(0)),U,1)
+9 IF X'=""
Begin DoDot:1
+10 NEW DIK,DIV,DIU,DIN
+11 XECUTE ^DD(405,.01,1,3,1.3)
IF X
SET X=DIV
XECUTE ^DD(405,.01,1,3,89.2)
SET X=$PIECE(Y(101),U,1)
SET D0=I(0,0)
SET DIU=X
KILL Y
SET X=DIV
SET X=DIV
XECUTE ^DD(405,.01,1,3,1.4)
End DoDot:1
+12 SET X=$PIECE($GET(DIKZ(0)),U,1)
+13 IF X'=""
IF $PIECE(^DGPM(DA,0),U,22)=""
SET $PIECE(^(0),U,22)=0
+14 SET X=$PIECE($GET(DIKZ(0)),U,1)
+15 IF X'=""
Begin DoDot:1
+16 NEW DIK,DIV,DIU,DIN
+17 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X=$SELECT('$DATA(^DGPM(+$PIECE(^DGPM(DA,0),U,24),0)):0,1:X'=+^(0))
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGPM(D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,24)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(405,.01,1,5,1.4)
End DoDot:1
+18 SET X=$PIECE($GET(DIKZ(0)),U,1)
+19 IF X'=""
IF $PIECE(^DGPM(DA,0),U,3)
SET ^DGPM("ADFN"_$PIECE(^(0),U,3),X,DA)=""
+20 SET X=$PIECE($GET(DIKZ(0)),U,1)
+21 IF X'=""
SET Y=$PIECE(^DGPM(DA,0),U,2)
IF Y
IF Y'=4
IF Y'=5
IF X
IF X<DT
SET DGHNYT=$SELECT(Y=1:$SELECT($DATA(DGIDX):3,1:1),Y=2:$SELECT($DATA(DGIDX):6,1:4),Y=3:$SELECT($DATA(DGIDX):9,1:7),1:15)
DO ^DGPMGLC
KILL DGIDX
+22 SET X=$PIECE($GET(DIKZ(0)),U,1)
+23 IF X'=""
IF "^1^3^"[("^"_$PIECE(^DGPM(DA,0),"^",2)_"^")
SET A1B2TAG="ADM"
DO ^A1B2XFR
+24 SET X=$PIECE($GET(DIKZ(0)),U,1)
+25 IF X'=""
SET DH=405
SET DV=.01
SET DU=1
SET DIIX=3
IF $GET(DIK(0))'["A"
DO AUDIT^DIK1
+26 SET DIKZ(0)=$GET(^DGPM(DA,0))
+27 SET X=$PIECE($GET(DIKZ(0)),U,2)
+28 IF X'=""
SET DGPMDDF=2
DO ^DGPMDD1
+29 SET X=$PIECE($GET(DIKZ(0)),U,3)
+30 IF X'=""
SET ^DGPM("C",$EXTRACT(X,1,30),DA)=""
+31 SET X=$PIECE($GET(DIKZ(0)),U,3)
+32 IF X'=""
SET DGPMDDF=3
DO ^DGPMDD1
+33 SET X=$PIECE($GET(DIKZ(0)),U,3)
+34 IF X'=""
SET ^DGPM("ADFN"_X,+^DGPM(DA,0),DA)=""
+35 SET X=$PIECE($GET(DIKZ(0)),U,4)
+36 IF X'=""
Begin DoDot:1
+37 NEW DIK,DIV,DIU,DIN
+38 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGPM(D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,18)
SET X=X
SET DIU=X
KILL Y
XECUTE ^DD(405,.04,1,1,1.1)
XECUTE ^DD(405,.04,1,1,1.4)
End DoDot:1
+39 SET DIKZ(0)=$GET(^DGPM(DA,0))
+40 SET X=$PIECE($GET(DIKZ(0)),U,5)
+41 IF X'=""
IF $PIECE(^DGPM(DA,0),"^",2)=3
SET A1B2TAG="ADM"
DO ^A1B2XFR
+42 SET X=$PIECE($GET(DIKZ(0)),U,6)
+43 IF X'=""
SET DGPMDDF=6
SET DGPMDDT=1
DO ^DGPMDDCN
+44 SET X=$PIECE($GET(DIKZ(0)),U,6)
+45 IF X'=""
Begin DoDot:1
+46 NEW DIK,DIV,DIU,DIN
+47 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGPM(D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,7)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$SELECT($DATA(^DGPM(DIV(0),0)):^(0),1:"")
SET DIV=X
SET $PIECE(^(0),U,7)=DIV
SET DIH=405
SET DIG=.07