1 | DGPFLF1 ;ALB/KCL - PRF FLAG MANAGEMENT BUILD LIST AREA ; 3/11/03
|
---|
2 | ;;5.3;Registration;**425**;Aug 13, 1993
|
---|
3 | ;
|
---|
4 | ;no direct entry
|
---|
5 | QUIT
|
---|
6 | ;
|
---|
7 | EN(DGARY,DGCAT,DGSRTBY,DGCNT) ;Entry point to build list area for PRF Flags.
|
---|
8 | ;
|
---|
9 | ; The following variables are 'system wide variables' in the
|
---|
10 | ; DGPF RECORD FLAG MANAGEMENT List Manager application:
|
---|
11 | ; Input:
|
---|
12 | ; DGARY - global array subscript
|
---|
13 | ; DGCAT - flag category (1=National, 2=Local)
|
---|
14 | ; DGSRTBY - list sort by criteria (N=Flag Name, T=Flage Type)
|
---|
15 | ;
|
---|
16 | ; Output:
|
---|
17 | ; DGCNT - number of lines in the list
|
---|
18 | ;
|
---|
19 | ;display wait msg
|
---|
20 | D WAIT^DICD
|
---|
21 | ;
|
---|
22 | ;retrieve all flags for the category specified
|
---|
23 | D GET(DGARY,DGCAT,DGSRTBY)
|
---|
24 | ;
|
---|
25 | ;build list area for flag screen
|
---|
26 | D BLD(DGSRTBY,.DGCNT)
|
---|
27 | ;
|
---|
28 | ;if no entries in list, display message in list area
|
---|
29 | I 'DGCNT D
|
---|
30 | . D SET^DGPFLMU1(DGARY,1,"",1,,,.DGCNT)
|
---|
31 | . D SET^DGPFLMU1(DGARY,2,"There are currently no flags on file to display.",4,$G(IOINHI),$G(IOINORM),.DGCNT)
|
---|
32 | ;
|
---|
33 | Q
|
---|
34 | ;
|
---|
35 | ;
|
---|
36 | GET(DGARY,DGCAT,DGSRTBY) ;Get flag entries for display.
|
---|
37 | ;
|
---|
38 | ; Input:
|
---|
39 | ; DGARY - global array subscript
|
---|
40 | ; DGCAT - flag category (1=National, 2=Local)
|
---|
41 | ; DGSRTBY - list sort by criteria (N=Flag Name, T=Flage Type)
|
---|
42 | ;
|
---|
43 | ; Output: None
|
---|
44 | ;
|
---|
45 | N DGFILE ;file root of LOCAL or NATIONAL flag file
|
---|
46 | N DGFLAG ;local array used to hold flag record
|
---|
47 | N DGIEN ;ien of record in LOCAL or NATIONAL flag file
|
---|
48 | N DGVPTR ;IEN of record in PRF NATIONAL FLAG or PRF LOCAL FLAG file
|
---|
49 | N DGRSULT
|
---|
50 | ;
|
---|
51 | ;determine LOCAL or NATIONAL flag file
|
---|
52 | S DGFILE=$S(DGCAT=1:"^DGPF(26.15)",DGCAT=2:"^DGPF(26.11)",1:0)
|
---|
53 | ;
|
---|
54 | ;loop through each ien of flag file determined by value of DGFILE
|
---|
55 | S DGIEN=0 F S DGIEN=$O(@DGFILE@(DGIEN)) Q:'DGIEN D
|
---|
56 | . K DGFLAG
|
---|
57 | . ;- if national, get flag into DGFLAG array
|
---|
58 | . I DGCAT=1 D Q:'$G(DGRSULT)
|
---|
59 | . . S DGRSULT=$$GETNF^DGPFANF(DGIEN,.DGFLAG)
|
---|
60 | . . S:DGRSULT DGVPTR=DGIEN_";DGPF(26.15,"
|
---|
61 | . ;
|
---|
62 | . ;- if local, get flag into DGFLAG array
|
---|
63 | . I DGCAT=2 D Q:'$G(DGRSULT)
|
---|
64 | . . S DGRSULT=$$GETLF^DGPFALF(DGIEN,.DGFLAG)
|
---|
65 | . . S:DGRSULT DGVPTR=DGIEN_";DGPF(26.11,"
|
---|
66 | . ;
|
---|
67 | . ;- set flag entry into sorted output array
|
---|
68 | . D SORT(DGVPTR,DGSRTBY,DGIEN,.DGFLAG)
|
---|
69 | ;
|
---|
70 | Q
|
---|
71 | ;
|
---|
72 | ;
|
---|
73 | SORT(DGVPTR,DGSRTBY,DGIEN,DGFLAG) ;Set flag data into sorted output array based on the sort criteria passed.
|
---|
74 | ;
|
---|
75 | ; Input:
|
---|
76 | ; DGVPTR - IEN of record in PRF NATIONAL FLAG or PRF LOCAL FLAG file
|
---|
77 | ; [ex: "1;DGPF(26.15,"]
|
---|
78 | ; DGSRTBY - list sort by criteria (N=Flag Name, T=Flage Type)
|
---|
79 | ; DGIEN - ien of record in LOCAL or NATIONAL flag file
|
---|
80 | ; DGFLAG - local array containing flag record
|
---|
81 | ;
|
---|
82 | ; Output:
|
---|
83 | ; Temporary global with following structure -
|
---|
84 | ; Flag list sorted by flag name:
|
---|
85 | ; ^TMP("DGPFSORT",$J,<status>,<flag name>,<ien>)=<var pointer>^<flag name>^<flag type>^<flag status>
|
---|
86 | ; OR
|
---|
87 | ; Flag list sorted by flag type:
|
---|
88 | ; ^TMP("DGPFSORT",$J,<status>,<flag type>,<ien>)=<var pointer>^<flag name>^<flag type>^<flag status>
|
---|
89 | ;
|
---|
90 | I DGSRTBY="N" D ;flag name
|
---|
91 | . S ^TMP("DGPFSORT",$J,$P($G(DGFLAG("STAT")),U),$P($G(DGFLAG("FLAG")),U,2),DGIEN)=DGVPTR_U_$P($G(DGFLAG("FLAG")),U,2)_U_$P($G(DGFLAG("TYPE")),U,2)_U_$P($G(DGFLAG("STAT")),U,2)
|
---|
92 | E D ;else flag type
|
---|
93 | . S ^TMP("DGPFSORT",$J,$P($G(DGFLAG("STAT")),U),$P($G(DGFLAG("TYPE")),U,2),DGIEN)=DGVPTR_U_$P($G(DGFLAG("FLAG")),U,2)_U_$P($G(DGFLAG("TYPE")),U,2)_U_$P($G(DGFLAG("STAT")),U,2)
|
---|
94 | ;
|
---|
95 | Q
|
---|
96 | ;
|
---|
97 | ;
|
---|
98 | BLD(DGSRTBY,DGCNT) ;Build list area for flag screen.
|
---|
99 | ;
|
---|
100 | ; Input:
|
---|
101 | ; DGSRTBY - list sort by criteria (N=Flag Name, T=Flage Type)
|
---|
102 | ;
|
---|
103 | ; Output:
|
---|
104 | ; DGCNT - number of lines in the list
|
---|
105 | ;
|
---|
106 | N DGFIEN ;^tmp global subscript (flag ien)
|
---|
107 | N DGLINE ;line counter
|
---|
108 | N DGNAME ;flag name
|
---|
109 | N DGNUM ;list selction number
|
---|
110 | N DGSI ;flag status internal value
|
---|
111 | N DGSTAT ;flag status
|
---|
112 | N DGSUB ;^tmp global subscript (flag name or type)
|
---|
113 | N DGTYPE ;flag type
|
---|
114 | N DGVPTR ;IEN of record in PRF NATIONAL FLAG or PRF LOCAL FLAG file
|
---|
115 | ; [ex: "1;DGPF(26.15,"]
|
---|
116 | N DGTEMP ;sort array root
|
---|
117 | ;
|
---|
118 | ;init line counter and selection number
|
---|
119 | S (DGLINE,DGNUM)=0
|
---|
120 | ;- loop through ^TMP global by status, active (1) then inactive (0)
|
---|
121 | F DGSI=1,0 D
|
---|
122 | . ;- loop through sort selection by flag name or flag type
|
---|
123 | . S DGSUB=$S(DGSRTBY="N":"",1:0)
|
---|
124 | . F S DGSUB=$O(^TMP("DGPFSORT",$J,DGSI,DGSUB)) Q:DGSUB="" D
|
---|
125 | . . ;- loop through flag file ien's
|
---|
126 | . . S DGFIEN=0
|
---|
127 | . . F S DGFIEN=$O(^TMP("DGPFSORT",$J,DGSI,DGSUB,DGFIEN)) Q:'DGFIEN D
|
---|
128 | . . . ;-- get flag data fields from entry in ^TMP global
|
---|
129 | . . . S DGTEMP=$NA(^TMP("DGPFSORT",$J))
|
---|
130 | . . . S DGVPTR=$P($G(@DGTEMP@(DGSI,DGSUB,DGFIEN)),U) ;flag IEN
|
---|
131 | . . . S DGNAME=$P($G(@DGTEMP@(DGSI,DGSUB,DGFIEN)),U,2) ;flag name
|
---|
132 | . . . S DGTYPE=$P($G(@DGTEMP@(DGSI,DGSUB,DGFIEN)),U,3) ;flag type
|
---|
133 | . . . S DGSTAT=$P($G(@DGTEMP@(DGSI,DGSUB,DGFIEN)),U,4) ;flag status
|
---|
134 | . . . ;
|
---|
135 | . . . ;-- increment selection number
|
---|
136 | . . . S DGNUM=DGNUM+1
|
---|
137 | . . . ;
|
---|
138 | . . . ;-- increment line counter
|
---|
139 | . . . S DGLINE=DGLINE+1
|
---|
140 | . . . ;
|
---|
141 | . . . ;-- set line into list area
|
---|
142 | . . . D SET(DGARY,DGLINE,DGNUM,1,,,DGVPTR,DGNUM,.DGCNT)
|
---|
143 | . . . D SET(DGARY,DGLINE,DGNAME,6,,,DGVPTR,DGNUM,.DGCNT)
|
---|
144 | . . . D SET(DGARY,DGLINE,DGTYPE,38,,,DGVPTR,DGNUM,.DGCNT)
|
---|
145 | . . . D SET(DGARY,DGLINE,DGSTAT,65,,,DGVPTR,DGNUM,.DGCNT)
|
---|
146 | ;
|
---|
147 | Q
|
---|
148 | ;
|
---|
149 | ;
|
---|
150 | SET(DGARY,DGLINE,DGTEXT,DGCOL,DGON,DGOFF,DGVPTR,DGNUM,DGCNT) ;This procedure will set the lines of flag details in the LM display area.
|
---|
151 | ;
|
---|
152 | ; Input:
|
---|
153 | ; DGARY - global array subscript
|
---|
154 | ; DGLINE - line number
|
---|
155 | ; DGTEXT - text
|
---|
156 | ; DGVPTR - (optional) IEN of record in PRF NATIONAL FLAG or PRF LOCAL
|
---|
157 | ; FLAG file [ex: "1;DGPF(26.15,"]
|
---|
158 | ; DGNUM - (optional) selection number
|
---|
159 | ; DGCOL - starting column
|
---|
160 | ; DGON - highlighting on
|
---|
161 | ; DGOFF - highlighting off
|
---|
162 | ;
|
---|
163 | ; Output:
|
---|
164 | ; DGCNT - number of lines in the list, pass by reference
|
---|
165 | ;
|
---|
166 | N DGX
|
---|
167 | S:DGLINE>DGCNT DGCNT=DGLINE
|
---|
168 | S DGX=$S($D(^TMP(DGARY,$J,DGLINE,0)):^(0),1:"")
|
---|
169 | S ^TMP(DGARY,$J,DGLINE,0)=$$SETSTR^VALM1(DGTEXT,DGX,DGCOL,$L(DGTEXT))
|
---|
170 | D:$G(DGON)]""!($G(DGOFF)]"") CNTRL^VALM10(DGLINE,DGCOL,$L(DGTEXT),$G(DGON),$G(DGOFF))
|
---|
171 | ;
|
---|
172 | ;associate flag ien with list item for flag selection
|
---|
173 | S:($G(DGVPTR)]"")&($G(DGNUM)) ^TMP(DGARY,$J,"IDX",DGLINE,DGNUM)=""
|
---|
174 | S:($G(DGVPTR)]"")&($G(DGNUM)) ^TMP(DGARY,$J,"IDX",DGNUM)=DGVPTR
|
---|
175 | Q
|
---|