source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORXTABS4.m@ 1458

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

initial load of FOIAVistA 6/30/08 version

File size: 8.6 KB
Line 
1ORXTABS4 ; SLC/PKS - Edit calls, tab parameters preferences. [9/28/00 3:05pm]
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**9,47,84**;Dec 17, 1997
3 ;
4 ; NOTES: The routines herein are called by those of the same tag
5 ; name in ORXTABS2. Most variables are NEW'd and assigned
6 ; by one or more routines in the preceding call chains.
7 ; Refer to comments and notes there for additional infor-
8 ; mation.
9 ;
10 ; Each tag in this routine must return one of the following:
11 ;
12 ; 1 - A new value entered or selected by the user,
13 ; 2 - A null string,
14 ; 3 - The string "*Invalid*" - to repeat due to invalid entry,
15 ; 4 - The "^" character, indicating user's cancel action.
16 ;
17 Q
18 ;
19STATUS(TYPE) ; Status, for various tabs.
20 ;
21 ; Internal variables used:
22 ;
23 ; ORXAUTH = Holds current value of AUTHOR value for some TYPEs.
24 ; ORXFLAG = Used in set/reset of ORDSTS^ORCHANG2 values.
25 ; ORXP1 = Prompt piece holder.
26 ; ORXP2 = Prompt piece holder.
27 ; ORXSCNT = Loop counter.
28 ; ORXSETC = Set of codes for assignment to DIR(0) variable.
29 ; ORXSTAGS = Orders STATUS tags, in routine ORXCHANG2 or herein.
30 ; TYPE = Type of STATUS being processed; must be one of:
31 ;
32 ; - ORDERS
33 ; - CONSULTS
34 ; - NOTES
35 ; - D/C SUMMARIES
36 ; - PROBLEMS
37 ;
38 N ORXAUTH,ORXFLAG,ORXP1,ORXP2,ORXSCNT,ORXSETC,ORXSTAGS
39 ;
40 ; Process DIR call through IF statements below, based on TYPE.
41 ;
42 ; Orders and Consults:
43 ;
44 ; NOTE: Displayed choices are numerically sequential as coded.
45 ; Actual storage number values come from routine data tags.
46 ; Thus, the default entry must be converted before
47 ; display, reset before updates - as is done below.
48 ;
49 I ((TYPE="ORDERS")!(TYPE="CONSULTS")) D
50 .K ORXSTAGS ; Clean up each time.
51 .S ORXSCNT=0 ; Initialize counter.
52 .S ORXFLAG=1 ; Start true each time.
53 .;
54 .; Establish loop for tag entries:
55 .F D Q:(ORXSTAGS(ORXSCNT)="")!(ORXSTAGS(ORXSCNT)["ZZZ")
56 ..S ORXSCNT=ORXSCNT+1 ; Increment counter.
57 ..;
58 ..; Assign retrieved values to ORXSTAGS array:
59 ..S ORXSTAGS="ORDSTS+"_ORXSCNT_"^ORCHANG2" ; ORDERS data tag.
60 ..;
61 ..; For CONSULTS set a different data tag:
62 ..I TYPE="CONSULTS" S ORXSTAGS="CORDSTS+"_ORXSCNT
63 ..;
64 ..S ORXSTAGS(ORXSCNT)=ORXSCNT_";"_$P($T(@ORXSTAGS),";;",2)
65 ..I (ORXSTAGS(ORXSCNT)="")!(ORXSTAGS(ORXSCNT)["ZZZ") Q
66 ..;
67 ..; Reset ORXNOW (current value) number when found:
68 ..I ORXFLAG D
69 ...I $P(ORXSTAGS(ORXSCNT),";",2)=ORXNOW S ORXNOW=$P(ORXSTAGS(ORXSCNT),";",1) S ORXFLAG=0 ; Do only once each time.
70 ..;
71 ..; Continue building prompt strings from retrieved values:
72 ..S ORXP1=$P(ORXSTAGS(ORXSCNT),";",1) ; First prompt piece.
73 ..S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
74 ..S ORXP2=$P(ORXSTAGS(ORXSCNT),";",3) ; Second prompt piece.
75 ..S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
76 ..;
77 ..; Assign DIR("A") display array:
78 ..S DIR("A",ORXSCNT)=ORXP1_ORXP2 ; Complete prompt string.
79 .;
80 .; Check for bad/missing tag data:
81 .I ORXSCNT<2 W !!,"ERROR: Bad data tag entry(ies)." S ORXNOW="^" Q
82 .;
83 .; Assign remaining DIR variables:
84 .S DIR("T")=120 ; Two minute maximum timeout for response.
85 .S DIR("A")=" Enter # for type of "_ORXPDIS_" to display: "
86 .S DIR("?")=" Entry must be between 1 and "_(ORXSCNT-1)
87 .S DIR(0)="NA^1:"_(ORXSCNT-1) ; Numerical, required.
88 .;
89 .; Call tag to get/assign input:
90 .D INPUT^ORXTABS2
91 .;
92 .; Check for user abort:
93 .I ORXNOW="^" Q
94 .;
95 .; Reset user entry to actual number from data tag in use:
96 .S:ORXNOW'="" ORXNOW=$P(ORXSTAGS(ORXNOW),";",2)
97 ;
98 ; Notes and D/C Summaries:
99 I ((TYPE="NOTES")!(TYPE="D/C SUMMARIES")) D
100 .;
101 .; Assign values retrieved to ORXSTAGS array:
102 .S ORXP1="1" ; First piece.
103 .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
104 .S ORXP2="All Signed" ; Second piece.
105 .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
106 .S DIR("A",1)=ORXP1_ORXP2 ; First prompt string.
107 .S ORXP1="2" ; First piece.
108 .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
109 .S ORXP2="My Unsigned" ; Second piece.
110 .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
111 .S DIR("A",2)=ORXP1_ORXP2 ; Second prompt string.
112 .S ORXP1="3" ; First piece.
113 .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
114 .S ORXP2="My Un-cosigned" ; Second piece.
115 .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
116 .S DIR("A",3)=ORXP1_ORXP2 ; Third prompt string.
117 .S ORXP1="4" ; First piece.
118 .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
119 .S ORXP2="Signed/Author" ; Second piece.
120 .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
121 .S DIR("A",4)=ORXP1_ORXP2 ; Fourth prompt string.
122 .S ORXP1="5" ; First piece.
123 .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
124 .S ORXP2="Signed/Dates" ; Second piece.
125 .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
126 .S DIR("A",5)=ORXP1_ORXP2 ; Fifth prompt string.
127 .;
128 .; Assign remaining DIR variables:
129 .S DIR("T")=120 ; Two minute maximum timeout for response.
130 .S DIR("A")=" Enter # for type of "_ORXPDIS_" to display: "
131 .S DIR("?")=" Entry must be between 1 and 5"
132 .S DIR(0)="NA^1:5" ; Numerical, required.
133 .;
134 .; Call tag to get/assign input:
135 .D INPUT^ORXTABS2
136 .;
137 .; Check for user abort:
138 .I ORXNOW="^" Q
139 .;
140 .; Use ORXAUTH twice to Check for valid entry:
141 .I ORXNOW'="" D
142 ..I (ORXCNT+1)<1 W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
143 ..S ORXAUTH=$P($G(ORXSETS),";",ORXCNT+1)
144 ..I ORXAUTH'="AUTHOR" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
145 ..S ORXAUTH=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT+1))
146 ..I ((ORXAUTH="")&(ORXNOW=4)) S $P(ORXCUR,";",$P($G(ORXPCS),";",ORXCNT+1))=+DUZ Q ; STATUS 4 = DUZ AUTHOR.
147 ..I ORXAUTH="" Q ; Stop if already null.
148 ..;
149 ..; For all other entries, set matching AUTHOR value to null:
150 ..S $P(ORXCUR,";",$P($G(ORXPCS),";",ORXCNT+1))=""
151 .;
152 .; Check for deletion entry:
153 .I ORXNOW="@" S ORXNOW=""
154 ;
155 ; Problems:
156 I TYPE="PROBLEMS" D
157 .K ORXSTAGS ; Clean up each time.
158 .S ORXSETC="" ; Clear each time.
159 .S ORXSCNT=0 ; Initialize counter.
160 .;
161 .; Establish loop for tag entries:
162 .F D Q:(ORXSTAGS(ORXSCNT)="")!(ORXSTAGS(ORXSCNT)["ZZZ")
163 ..S ORXSCNT=ORXSCNT+1 ; Increment counter.
164 ..;
165 ..; Assign retrieved values to ORXSTAGS array:
166 ..S ORXSTAGS="PLSTS+"_ORXSCNT_"^ORCHANG2" ; Data tags.
167 ..S ORXSTAGS(ORXSCNT)=$P($T(@ORXSTAGS),";;",2)
168 ..I (ORXSTAGS(ORXSCNT)="")!(ORXSTAGS(ORXSCNT)["ZZZ") Q
169 ..S ORXP1=$P(ORXSTAGS(ORXSCNT),";",1) ; First prompt piece.
170 ..S:ORXSCNT=1 ORXSETC=ORXP1_":" ; DIR codes string.
171 ..S:ORXSCNT>1 ORXSETC=ORXSETC_";"_ORXP1_":" ; "
172 ..S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
173 ..S ORXP2=$P(ORXSTAGS(ORXSCNT),";",2) ; Second prompt piece.
174 ..S ORXSETC=ORXSETC_ORXP2 ; DIR codes string.
175 ..S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
176 ..;
177 ..; Assign DIR("A") display array:
178 ..S DIR("A",ORXSCNT)=ORXP1_ORXP2 ; Complete prompt string.
179 .;
180 .; Check for bad/missing data:
181 .I ORXSCNT<2 W !!,"ERROR: Bad PLSTS tag data." S ORXNOW="^" Q
182 .;
183 .; Assign remaining DIR variables:
184 .S DIR("T")=120 ; Two minute maximum timeout for response.
185 .S DIR("A")=" Enter types of "_ORXPDIS_" to display: "
186 .S DIR(0)="SAO^"_ORXSETC ; Optional, Set of Codes.
187 .;
188 .; Call tag to get/assign input:
189 .D INPUT^ORXTABS2
190 .;
191 .; Check for user abort:
192 .I ORXNOW="^" Q
193 .;
194 .; Check for deletion entry:
195 .I ORXNOW="@" S ORXNOW=""
196 ;
197 Q
198 ;
199 ;
200 ; NOTES ON ENTRIES FOR "CORDSTS" TAG:
201 ; CORDSTS entries below match previous LM CONSULTS ORDERS
202 ; "STATUS" settings allowed. They are also listed in the
203 ; ORQ1 routine. The listings consist of 2 pieces:
204 ;
205 ; ValueToBeStoredInParam;ListingDescription
206 ;
207CORDSTS ; Consults ORDERS "STATUS" settings.
208 ;;1;Discontinued
209 ;;2;Complete
210 ;;5;Pending
211 ;;6;Active
212 ;;8;Scheduled
213 ;;9;Partial Results
214 ;;13;Cancelled
215 ;;;All Statuses
216 ;;;ZZZZ
217 ;
218 Q
219 ;
Note: See TracBrowser for help on using the repository browser.