1 | DIKZ2 ;SFISC/XAK-XREF COMPILER ;1:52 PM 7 Jan 2000
|
---|
2 | ;;22.0;VA FileMan;**27**;Mar 30, 1999
|
---|
3 | ;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
4 | S DIKR=DIKR+1
|
---|
5 | S DIK1=" I $D("_DIKVR_") K DIKLM S:DIKM1="_A_" DIKLM=1"
|
---|
6 | I A>1 D
|
---|
7 | . S DIK1=DIK1_" S:DIKM1'="_A_"&'$G(DIKPUSH("_A_")) DIKPUSH("_A_")=1,"
|
---|
8 | . F DIK4=A:-1:2 S DIK8=DIK4-1,DIK1=DIK1_"DA("_DIK4_")=DA("_DIK8_"),"
|
---|
9 | . S DIK1=DIK1_"DA(1)=DA,DA=0"
|
---|
10 | . F DIK4=2:1:A-1 S DIK1=DIK1_" S:DIKM1<"_DIK4_" DA("_(A-DIK4)_")=0"
|
---|
11 | S ^UTILITY($J,DIKR)=DIK1_" G @DIKM1"
|
---|
12 | S DIKR=DIKR+1,DIKCT=0 I A>1 D DAR
|
---|
13 | S ^UTILITY($J,DIKR)=A-1_" ;",DIKR=DIKR+1
|
---|
14 | D:DIKVR="DIKILL" WFK
|
---|
15 | S DIKCT=DIKCT+1,DIKL2=A-1,DIK1=$C(64+DIKCT)_" S DA=$O("_DIK2_DIK8(DH)_"DA))"
|
---|
16 | S ^UTILITY($J,DIKR)=DIK1_" I DA'>0 S DA=0 "_$S(DIKL2=0:"",1:"Q:DIKM1="_DIKL2_" ")_"G "_$S(A'<2:$C(64+A-1),1:"END"),DIKR=DIKR+1
|
---|
17 | K DIK6
|
---|
18 | Q
|
---|
19 | CRT ;
|
---|
20 | I '$D(^DD(DV,"IX")),'$D(^TMP("DIKC",$J,DV)) K DU(DV) Q
|
---|
21 | S DIK(X,DV)="",DIK4(DV)=DW,DIK2(DV)="DA("_A_"),,DIKM1="_A_",DIKUM'<"_A
|
---|
22 | I A=1 S DIK8(DV)=$P(DIK2(DV),",",1,2)_DIK4(DV)_","
|
---|
23 | E I $D(DIK2(DH)) S DIKC=DV,DIK8(DV)="" F DIK8=1:1:A D
|
---|
24 | . S DIK8(DV)="DA("_DIK8_"),"_DIK4(DIKC)_","_DIK8(DV)
|
---|
25 | . S DIKC=^DD(DIKC,0,"UP")
|
---|
26 | Q
|
---|
27 | DAR ;
|
---|
28 | S (DIKC,DIK1,%,DIKL2)=1,DIKQ=0
|
---|
29 | F DIK8=A-1:-1:1 S DIKC=DIKC+2,DIKCT=DIKCT+1,DIK4=" S DA("_DIK8_")=$O("_DIK2_$P(DIK8(DH),",",1,DIKC)_"))" S:'$D(%) ^UTILITY($J,DIKR)=DIKL2_" ;",DIKR=DIKR+1,DIKL2=DIKL2+1 K % D DAR2 K DIK1
|
---|
30 | Q
|
---|
31 | DAR2 ;
|
---|
32 | S ^UTILITY($J,DIKR)=$C(64+DIKCT)_DIK4_" I DA("_DIK8_")'>0 S DA("_DIK8_")=0 "_$S($D(DIK6)&('$D(DIK1)):"Q:DIKM1="_DIKQ_" ",1:"")_"G "_$S($D(DIK1):"END",1:$C(64+DIKCT-1)),DIKR=DIKR+1,DIKQ=DIKQ+1,DIK6=1
|
---|
33 | Q
|
---|
34 | ;
|
---|
35 | WFK ;Get whole file kill xrefs
|
---|
36 | N DIKXR,DIKKW,DIKKW0,DIKCODE
|
---|
37 | S DIKXR=0 F S DIKXR=$O(^TMP("DIKC",$J,"KW",DH,DIKXR)) Q:'DIKXR D
|
---|
38 | . S DIKKW=$G(^TMP("DIKC",$J,"KW",DH,DIKXR))
|
---|
39 | . Q:DIKKW?."^"!(DIKKW="Q")
|
---|
40 | . S DIKKW0=$G(^TMP("DIKC",$J,"KW",DH,DIKXR,0))
|
---|
41 | . I DIKKW0="" D DOTLINE^DIKZ0(" "_DIKKW) Q
|
---|
42 | . Q:$P(DIKKW0,U)'="W"
|
---|
43 | . ;
|
---|
44 | . ;Build code to push down DA array
|
---|
45 | . S DIKCODE=$$BCPDA(A,$P(DIKKW0,U,2))
|
---|
46 | . I DIKCODE]"" D LINE^DIKZ0(" "_DIKCODE)
|
---|
47 | . D DOTLINE^DIKZ0(" "_DIKKW)
|
---|
48 | . I DIKCODE]"" D LINE^DIKZ0(" K DA M DA=DIKSVDA")
|
---|
49 | Q
|
---|
50 | ;
|
---|
51 | BCPDA(LEV,RFILE) ;Build code to push down DA array
|
---|
52 | N DIFF,COD,I,RLEV
|
---|
53 | S RLEV=$$FLEV^DIKCU(RFILE)
|
---|
54 | S DIFF=RLEV-LEV
|
---|
55 | Q:DIFF<1 ""
|
---|
56 | ;
|
---|
57 | S COD=""
|
---|
58 | F I=RLEV:-1:DIFF S COD=COD_"DA("_I_")=DA("_(I-DIFF)_"),"
|
---|
59 | F I=DIFF-1:-1:0 S COD=COD_"DA("_I_")=0,"
|
---|
60 | I COD]"" D
|
---|
61 | . S COD=$E(COD,1,$L(COD)-1)
|
---|
62 | . F Q:COD'["DA(0)" S COD=$P(COD,"DA(0)")_"DA"_$P(COD,"DA(0)",2,999)
|
---|
63 | . S COD="K DIKSVDA M DIKSVDA=DA S "_COD
|
---|
64 | Q COD
|
---|