DIDH ;SFISC/XAK-HDR FOR DD LISTS ;05:35 PM 24 Apr 2002 [ 12/09/2003 4:35 PM ]
;;22.0;VA FileMan;**76,1002**;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
D ^DIDH1 I $G(M)=U S DN=0
Q K DDV,%F,M1 Q
;
XR S X=2,J=0,DG=F(Z) W:$Y !
XL S J=$O(^DD(DA,0,"IX",J)) I J="" S F(Z)=DG Q
F K=0:0 S K=$O(^DD(DA,0,"IX",J,K)) G XL:K'>0 F N=0:0 S N=$O(^DD(DA,0,"IX",J,K,N)) Q:N'>0 I 1 S F(Z)=K,DJ(Z)=N X:$D(DIGR) DIGR D:$T XL1
XL1 F %=0:0 S %=$O(^DD(K,N,1,%)) Q:'%!(M=U) I $D(^(%,0)),+^(0)=DA,$P(^(0),U,2)=J W:X=2 !,"CROSS",! W $P(", ^REFERENCED BY: ",U,X) S X=$P(^DD(K,N,0),U)_"("_J_")" W:($L(X)+$X+4)'<IOM !?15 W X S X=1 Q:$Y+4'>IOSL I '$D(DIU) D H S X=2
Q
POINT ; CALLED BY ^DD(1,.01,"DEL",.5,0)
S W1="W:$Y ! W !,""POINTED TO BY: "",?15" I $O(^DD(DA,0,"PT",""))'="" S DDPT=1
S X="" F S X=$O(^DD(DA,0,"PT",X)) Q:X="" S DG=0 F S DG=$O(^DD(DA,0,"PT",X,DG)) Q:DG="" D PD W:$D(^DD(DA,0,"PT",X,DG)) !?15 I '$D(DIU) D H G Q:M=U
S (DG,X)=-1 K W1,DDPT Q
PD I $S('$D(^DD(X,DG,0)):1,$P(^(0),U,2)["V":0,1:$P($P(^(0),U,2),"P",2)-DA) K ^DD(DA,0,"PT",X,DG) Q
S %=X,%F=DG
WR I '$D(IOM) S IOP="HOME" N %X D ^%ZIS Q:POP
I $D(DDPT) X W1 K DDPT
S X1=$P(^DD(%,%F,0),U)_" field (#"_%F_")"
UP I $L(X1)+$L(%)+$L($O(^DD(%,0,"NM",0)))>225 S X1=X1_" etc... ^" G L1
S X1=X1_" of the "_$O(^(0))
I $D(^DD(%,0,"UP")) S X1=X1_" sub-field (#"_%_")",%=^("UP") G UP
S X1=X1_" File (#"_%_") ^"
L1 F DDC=1:1 S DDV=$P(X1," ",DDC)_" " Q:DDV["^" W:$L(DDV)+$X>IOM !,?19 W DDV
K DDC,DDV,X1 Q
;
TRIG ;CALLED BY ^DD(1,.01,"DEL","TRB",0)
S W1="W:$Y ! W !,""A FIELD IS"",!,""TRIGGERED BY :"",?15",DDPT=1
K X S X="" F S X=$O(^DD(DA,"TRB",X)) Q:X="" I X-DA,'$D(^DD(DA,"SB",X)) S %=0 F S %=$O(^DD(DA,"TRB",X,%)) Q:%="" S %X=0 F S %X=$O(^DD(DA,"TRB",X,%,%X)) Q:%X="" S %Y=0 F S %Y=$O(^DD(DA,"TRB",X,%,%X,%Y)) Q:%Y'>0 D TT
S %Y=-1 I $D(X)>9 S %X=0 F S %X=$O(X(%X)) Q:%X="" S X=0 F S X=$O(X(%X,X)) Q:X="" S %F=X,%=%X D WR:$D(^DD(%,X,0)) W !?15 D:'$D(DIU) H I 1
K X,%X,%Y,W1,DDPT Q
;
TT S X(X,%)=0 I $D(^DD(X,%,0)) Q:$P(^(0),U,2) I $D(^(1,%X,0)),^(0)["TRIGGER" Q
K X(X,%),^DD(DA,"TRB",X,%,%X,%Y)
Q
H I $D(IOSL),$Y+4>IOSL S DC=DC+1 D ^DIDH1 G Q:M=U
Q
W F K=0:1 W:$D(DDF) !?25 S %Y=$E(W,IOM-$X,999) W $E(W,1,IOM-$X-1) Q:%Y="" S W=%Y,DDF=1
K DDF Q
PTR(X) ;finds pointers to file being deleted
N Y,Z S (Y,Z)=0
I $O(^DD(X,0,"PT",Y))="" Q Z
D Q Z
. F S Y=$O(^DD(X,0,"PT",Y)) Q:Y="" I $$FNO^DILIBF(Y)'=X S Z=1 Q
. Q
DIDH ;SFISC/XAK-HDR FOR DD LISTS ;05:35 PM 24 Apr 2002 [ 12/09/2003 4:35 PM ]
+1 ;;22.0;VA FileMan;**76,1002**;Mar 30, 1999
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
+3 DO ^DIDH1
IF $GET(M)=U
SET DN=0
Q KILL DDV,%F,M1
QUIT
+1 ;
XR SET X=2
SET J=0
SET DG=F(Z)
IF $Y
WRITE !
XL SET J=$ORDER(^DD(DA,0,"IX",J))
IF J=""
SET F(Z)=DG
QUIT
+1 FOR K=0:0
SET K=$ORDER(^DD(DA,0,"IX",J,K))
IF K'>0
GOTO XL
FOR N=0:0
SET N=$ORDER(^DD(DA,0,"IX",J,K,N))
IF N'>0
QUIT
IF 1
SET F(Z)=K
SET DJ(Z)=N
IF $DATA(DIGR)
XECUTE DIGR
IF $TEST
DO XL1
XL1 FOR %=0:0
SET %=$ORDER(^DD(K,N,1,%))
IF '%!(M=U)
QUIT
IF $DATA(^(%,0))
IF +^(0)=DA
IF $PIECE(^(0),U,2)=J
IF X=2
WRITE !,"CROSS",!
WRITE $PIECE(", ^REFERENCED BY: ",U,X)
SET X=$PIECE(^DD(K,N,0),U)_"("_J_")"
IF ($LENGTH(X)+$X+4)'<IOM
WRITE !?15
WRITE X
SET X=1
IF $Y+4'>IOSL
QUIT
IF '$DATA(DIU)
DO H
SET X=2
+1 QUIT
POINT ; CALLED BY ^DD(1,.01,"DEL",.5,0)
+1 SET W1="W:$Y ! W !,""POINTED TO BY: "",?15"
IF $ORDER(^DD(DA,0,"PT",""))'=""
SET DDPT=1
+2 SET X=""
FOR
SET X=$ORDER(^DD(DA,0,"PT",X))
IF X=""
QUIT
SET DG=0
FOR
SET DG=$ORDER(^DD(DA,0,"PT",X,DG))
IF DG=""
QUIT
DO PD
IF $DATA(^DD(DA,0,"PT",X,DG))
WRITE !?15
IF '$DATA(DIU)
DO H
IF M=U
GOTO Q
+3 SET (DG,X)=-1
KILL W1,DDPT
QUIT
PD IF $SELECT('$DATA(^DD(X,DG,0)):1,$PIECE(^(0),U,2)["V":0,1:$PIECE($PIECE(^(0),U,2),"P",2)-DA)
KILL ^DD(DA,0,"PT",X,DG)
QUIT
+1 SET %=X
SET %F=DG
WR IF '$DATA(IOM)
SET IOP="HOME"
NEW %X
DO ^%ZIS
IF POP
QUIT
+1 IF $DATA(DDPT)
XECUTE W1
KILL DDPT
+2 SET X1=$PIECE(^DD(%,%F,0),U)_" field (#"_%F_")"
UP IF $LENGTH(X1)+$LENGTH(%)+$LENGTH($ORDER(^DD(%,0,"NM",0)))>225
SET X1=X1_" etc... ^"
GOTO L1
+1 SET X1=X1_" of the "_$ORDER(^(0))
+2 IF $DATA(^DD(%,0,"UP"))
SET X1=X1_" sub-field (#"_%_")"
SET %=^("UP")
GOTO UP
+3 SET X1=X1_" File (#"_%_") ^"
L1 FOR DDC=1:1
SET DDV=$PIECE(X1," ",DDC)_" "
IF DDV["^"
QUIT
IF $LENGTH(DDV)+$X>IOM
WRITE !,?19
WRITE DDV
+1 KILL DDC,DDV,X1
QUIT
+2 ;
TRIG ;CALLED BY ^DD(1,.01,"DEL","TRB",0)
+1 SET W1="W:$Y ! W !,""A FIELD IS"",!,""TRIGGERED BY :"",?15"
SET DDPT=1
+2 KILL X
SET X=""
FOR
SET X=$ORDER(^DD(DA,"TRB",X))
IF X=""
QUIT
IF X-DA
IF '$DATA(^DD(DA,"SB",X))
SET %=0
FOR
SET %=$ORDER(^DD(DA,"TRB",X,%))
IF %=""
QUIT
SET %X=0
FOR
SET %X=$ORDER(^DD(DA,"TRB",X,%,%X))
IF %X=""
QUIT
SET %Y=0
FOR
SET %Y=$ORDER(^DD(DA,"TRB",X,%,%X,%Y))
IF %Y'>0
QUIT
DO TT
+3 SET %Y=-1
IF $DATA(X)>9
SET %X=0
FOR
SET %X=$ORDER(X(%X))
IF %X=""
QUIT
SET X=0
FOR
SET X=$ORDER(X(%X,X))
IF X=""
QUIT
SET %F=X
SET %=%X
IF $DATA(^DD(%,X,0))
DO WR
WRITE !?15
IF '$DATA(DIU)
DO H
IF 1
+4 KILL X,%X,%Y,W1,DDPT
QUIT
+5 ;
TT SET X(X,%)=0
IF $DATA(^DD(X,%,0))
IF $PIECE(^(0),U,2)
QUIT
IF $DATA(^(1,%X,0))
IF ^(0)["TRIGGER"
QUIT
+1 KILL X(X,%),^DD(DA,"TRB",X,%,%X,%Y)
+2 QUIT
H IF $DATA(IOSL)
IF $Y+4>IOSL
SET DC=DC+1
DO ^DIDH1
IF M=U
GOTO Q
+1 QUIT
W FOR K=0:1
IF $DATA(DDF)
WRITE !?25
SET %Y=$EXTRACT(W,IOM-$X,999)
WRITE $EXTRACT(W,1,IOM-$X-1)
IF %Y=""
QUIT
SET W=%Y
SET DDF=1
+1 KILL DDF
QUIT
PTR(X) ;finds pointers to file being deleted
+1 NEW Y,Z
SET (Y,Z)=0
+2 IF $ORDER(^DD(X,0,"PT",Y))=""
QUIT Z
+3 Begin DoDot:1
+4 FOR
SET Y=$ORDER(^DD(X,0,"PT",Y))
IF Y=""
QUIT
IF $$FNO^DILIBF(Y)'=X
SET Z=1
QUIT
+5 QUIT
End DoDot:1
QUIT Z