source: WorldVistAEHR/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DICUF.m@ 841

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1DICUF ;SEA/TOAD,SF/TKW-FileMan: Lookup Tools, Files ;2/6/98 08:13
2 ;;22.0;VA FileMan;;Mar 30, 1999;
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ;
6FILE(DIFILE,DIFIEN,DIFLAGS) ;
7 ; retrieve and calculate info about indexed file
8 ;
9F1 ; set and check source file number.
10 ;
11 S DIFILE=+$G(DIFILE) I 'DIFILE D ERR(202,"","","","","file") Q
12 ;
13F2 ; get the file's .01 definition; quit & error if bad
14 ;
15 N DINODE S DINODE=$G(^DD(DIFILE,.01,0))
16 I DINODE="" D ERR($S('$D(^DD(DIFILE)):401,1:406),DIFILE) Q
17 I $P(DINODE,U,2)["W" D ERR(407,DIFILE) Q
18 ;
19F3 ; set and check the Lister's IENS parameter
20 ;
21 S DIFIEN=$G(DIFIEN) I DIFIEN="" S DIFIEN=","
22 I '$$IEN^DIDU1(DIFIEN) D Q
23 . I '$$IEN^DIDU1(DIFIEN_",") D ERR(202,"","","","","IENS") Q
24 . E D ERR(304,"",DIFIEN) Q
25 I $P(DIFIEN,",")'="" D ERR(306,"",DIFIEN) Q
26 ;
27F4 ; calculate the source file's global root (open & closed)
28 ;
29 S DIFILE(DIFILE)=$$ROOT^DIQGU(DIFILE,DIFIEN,1,1) Q:$G(DIERR)
30 I DIFILE(DIFILE)'?1"^"1U.7UN.ANP,DIFILE(DIFILE)'?1"^%".7UN.ANP D Q
31 . D ERR(402,DIFILE,DIFIEN,"",DIFILE(DIFILE))
32 S DIFILE(DIFILE,"O")=$$OREF^DIQGU(DIFILE(DIFILE))
33 Q
34 ;
35SCREEN(DIFLAGS,DIFILE,DISCREEN) ;
36 ; Set user defined and whole file screen variables.
37 ;
38 I $G(DISCREEN("S"))="" S DISCREEN("S")=$G(DISCREEN)
39 I $G(DISCREEN("V"))]"",$G(DISCREEN("V",1))']"" S DISCREEN("V",1)=DISCREEN("V")
40 S DISCREEN("F")="" I DIFLAGS'["U" D
41 . Q:$P($G(@DIFILE(DIFILE)@(0)),U,2)'["s"
42 . S DISCREEN("F")=$G(^DD(DIFILE,0,"SCR"))
43 . Q
44 Q
45 ;
46VPDATA(DINDEX,DISCREEN) ; Add variable pointer info to DINDEX array for executing DIC("V") type screen
47 N DISUB,F,I,F1,F2,G,Y
48 F DISUB=1:1:DINDEX("#") I $G(DISCREEN("V",DISUB))]"" D
49 . S F1=DINDEX(DISUB,"FILE"),F2=DINDEX(DISUB,"FIELD") Q:'F1!('F2)
50 . F F=0:0 S F=$O(^DD(F1,F2,"V","B",F)) Q:'F D
51 . . S I=$O(^DD(F1,F2,"V","B",F,0)) Q:'I
52 . . S Y(0)=$G(^DD(F1,F2,"V",I,0)) Q:Y(0)=""
53 . . X DISCREEN("V",DISUB) Q:'$T
54 . . S G=$G(^DIC(F,0,"GL")) Q:G=""
55 . . S DINDEX(DISUB,"VP",G)="" Q
56 . Q
57 Q
58 ;
59ERR(DIERN,DIFILE,DIIENS,DIFIELD,DIROOT,DI1,DI2,DI3) ;
60 ;
61 ; error logging procedure
62 ;
63E1 N DIPE,P
64 N DI F DI="FILE","IENS","FIELD","ROOT",1:1:3 D
65 . S P=$G(@("DI"_DI)) Q:P=""
66 . S DIPE(DI)=P
67 D BLD^DIALOG(DIERN,.DIPE,.DIPE)
68 Q
69 ;
Note: See TracBrowser for help on using the repository browser.