source: FOIAVistA/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DIFGGSB1.m@ 1354

Last change on this file since 1354 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.9 KB
Line 
1DIFGGSB1 ;SFISC/XAK,EDE(OHPRD)-FILEGRAM SPECIAL BLOCK PART 2 ;8/12/98 13:16
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4BODY S DIFGSB(DILL,"SPSPEC")=0
5 I $D(DIFG(DILL,"FUNC")),"AL"[DIFG(DILL,"FUNC") I 1
6 E I $D(DIFG(DILL,"NOKEY"))
7 E D SPSPEC^DIFGGSB2
8 Q:DIFGSB(DILL,"SPSPEC")
9 D P01
10 D SPEC
11 D IDENT
12 Q
13 ;
14P01 ; .01 FIELD WHEN IT IS A POINTER
15 Q:$P(^DD(DIFG(DILL,"FILE"),.01,0),U,2)'["P"
16 S DIFGSB(DILL,"FLD")=.01
17 D SETXY
18 Q:Y=""
19 D PTRCHK^DIFGGSB2
20 Q
21 ;
22SPEC ; SPECIFIERS
23 S DIFGSB(DILL,"SBT")="SPECIFIER:",%=""
24 F DIFGSB(DILL,"FLD")=0:0 D SPEC2 Q:DIFGSB(DILL,"FLD")'=+DIFGSB(DILL,"FLD") S %=%_$S(%="":DIFGSB(DILL,"FLD"),1:";"_DIFGSB(DILL,"FLD"))
25 I '$D(DIFG(DILL,"MUL")) S DR=% D:%'="" FIELDS I 1
26 E S DR(DIFG(DILL,"FILE"))=% D:%'="" FIELDS
27 K ^UTILITY("DIQ1",$J,DIFG(DILL,"FILE"))
28 I '$D(DIFG(DILL,"MUL")) K DA,DIC,DR
29 K % Q
30 ;
31SPEC2 S DIFGSB(DILL,"FLD")=$O(^DD(DIFG(DILL,"FILE"),0,"SP",DIFGSB(DILL,"FLD")))
32 Q
33 ;
34IDENT ; IDENTIFIERS
35 S DIFGSB(DILL,"SBT")="IDENTIFIER:",%=""
36 N DIXIEN,DIKEY S DIXIEN=0,DIKEY=";"
37 I $G(DIAR)=4 S DIXIEN=$O(^DD("KEY","AP",DIFG(DILL,"FILE"),"P",0))
38 F DIFGSB(DILL,"FLD")=0:0 D IDENT2 Q:DIFGSB(DILL,"FLD")'=+DIFGSB(DILL,"FLD") D:'$D(^DD(DIFG(DILL,"FILE"),0,"SP",DIFGSB(DILL,"FLD"))) IDENT3
39 I '$D(DIFG(DILL,"MUL")) S DR=% D:%'="" FIELDS I 1
40 E S DR(DIFG(DILL,"FILE"))=% D:%'="" FIELDS
41 K ^UTILITY("DIQ1",$J,DIFG(DILL,"FILE"))
42 I '$D(DIFG(DILL,"MUL")) K DA,DIC,DR
43 K %
44 Q
45 ;
46IDENT2 N DIOUT S DIOUT=0
47 I DIXIEN F D Q:DIOUT!('DIFGSB(DILL,"FLD"))
48 . S DIFGSB(DILL,"FLD")=$O(^DD("KEY",DIXIEN,2,"BB",DIFGSB(DILL,"FLD")))
49 . Q:'DIFGSB(DILL,"FLD")!(DIFGSB(DILL,"FLD")=.01)
50 . Q:$O(^DD("KEY",DIXIEN,2,"BB",DIFGSB(DILL,"FLD"),0))'=DIFG(DILL,"FILE")
51 . Q:'$D(^DD(DIFG(DILL,"FILE"),DIFGSB(DILL,"FLD"),0))
52 . S DIOUT=1,DIKEY=DIKEY_DIFGSB(DILL,"FLD")_";" Q
53 Q:DIOUT S DIXIEN=0
54 F S DIFGSB(DILL,"FLD")=$O(^DD(DIFG(DILL,"FILE"),0,"ID",DIFGSB(DILL,"FLD"))) Q:'DIFGSB(DILL,"FLD") Q:DIKEY'[(";"_DIFGSB(DILL,"FLD"))
55 Q
56 ;
57IDENT3 S %=%_$S(%="":DIFGSB(DILL,"FLD"),1:";"_DIFGSB(DILL,"FLD"))
58 Q
59 ;
60FIELDS I $D(DIFGGU(DIFG(DILL,"FILE"),DIFG(DILL,"FE"))) D DRFIX
61 I '$D(DIFG(DILL,"MUL")) Q:DR=""
62 E Q:DR(DIFG(DILL,"FILE"))=""
63 K ^UTILITY("DIQ1",$J,DIFG(DILL,"FILE"))
64 S:'$D(DIFG(DILL,"MUL")) DIC=DIFG(DILL,"FILE"),DA=DIFG(DILL,"FE")
65 S DIQ(0)="N" D EN^DIQ1 K DIQ
66 F DIFGSB(DILL,"FLD")=0:0 D FIELDS2 Q:DIFGSB(DILL,"FLD")'=+DIFGSB(DILL,"FLD") S X=^(DIFGSB(DILL,"FLD")) D FIELDS3
67 Q
68 ;
69DRFIX ; ADJUST DR FOR MODIFIED/DELETED VALUES
70 NEW T
71 I '$D(DIFG(DILL,"MUL")) S T=DR
72 E S T=DR(DIFG(DILL,"FILE"))
73 F %=1:1 S X=$P(T,";",%) Q:X="" S %(X)="" I $D(DIFGGU(DIFG(DILL,"FILE"),DIFG(DILL,"FE"),X)) K %(X) S DIFGSB(DILL,"FLD")=X,X=DIFGGU(DIFG(DILL,"FILE"),DIFG(DILL,"FE"),X) D DRFIX2
74 S (T,X)=""
75 F %=0:0 S X=$O(%(X)) Q:X="" S T=T_$S(T="":"",1:";")_X
76 I '$D(DIFG(DILL,"MUL")) S DR=T
77 E S DR(DIFG(DILL,"FILE"))=T
78 Q
79 ;
80DRFIX2 NEW %,DR,T
81 D FIELDS3
82 Q
83 ;
84FIELDS2 S DIFGSB(DILL,"FLD")=$O(^UTILITY("DIQ1",$J,DIFG(DILL,"FILE"),DIFG(DILL,"FE"),DIFGSB(DILL,"FLD")))
85 Q
86 ;
87FIELDS3 Q:X=""
88 D SETXY
89 K F,N,P,W
90 S V=DIFGSB(DILL,"SBT")_$P(^DD(DIFG(DILL,"FILE"),DIFGSB(DILL,"FLD"),0),U,1)_U_$S(DIFG("PARM")["N":DIFGSB(DILL,"FLD"),1:"")
91 S:DIFGSB(DILL,"SBT")["KEY" V=V_U_$P(DIFGSB(DILL,"SPSPEC"),U,2)
92 S V=V_"="_X
93 D INCSET^DIFGGU
94 D:Y'="" PTRCHK^DIFGGSB2
95 K X,Y
96 Q
97SETXY ; If previously looked up pointer set @LINK
98 S Y=""
99 Q:$P(^DD(DIFG(DILL,"FILE"),DIFGSB(DILL,"FLD"),0),U,2)'["P"
100 S F=+$P($P(^DD(DIFG(DILL,"FILE"),DIFGSB(DILL,"FLD"),0),U,2),"P",2),W=$P(^(0),U,4),N=$P(W,";",1),P=$P(W,";",2)
101 I $D(DIFGGU(DIFG(DILL,"FILE"),DIFG(DILL,"FE"),DIFGSB(DILL,"FLD"),"P")) S Y=DIFGGU(DIFG(DILL,"FILE"),DIFG(DILL,"FE"),DIFGSB(DILL,"FLD"),"P") I 1
102 E S Y=$P(@(DIFG(DILL,"FGBL")_DIFG(DILL,"FE")_",N)"),U,P)
103 I $D(^UTILITY("DIFGLINK",$J,F,Y)) S X="@"_^UTILITY("DIFGLINK",$J,F,Y),Y="" Q
104 S ^UTILITY("DIFGLINK",$J)=$S($D(^UTILITY("DIFGLINK",$J))#2:^UTILITY("DIFGLINK",$J)+1,1:1)
105 S ^UTILITY("DIFGLINK",$J,F,Y)=^UTILITY("DIFGLINK",$J)
106 S Y="@"_^UTILITY("DIFGLINK",$J)
107 Q
Note: See TracBrowser for help on using the repository browser.