source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORXTABS.m@ 1757

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

initial load of FOIAVistA 6/30/08 version

File size: 7.8 KB
Line 
1ORXTABS ; SLC/PKS - Edit tab parameters preferences. [10/17/00 2:44pm]
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**9,47,84**;Dec 17, 1997
3 ;
4 ; Main control routine is herein for Tab Preferences Editing.
5 ; Works with routines ORXTABS1 and ORXTABS2. ORXTABS1 contains
6 ; additional control tags that work in conjunction with the
7 ; control code at the top of this routine, in order to keep this
8 ; one below 10K size maximum. ORXTABS2 contains tags to handle
9 ; individual preference edit/input, making calls to ORXTABS3,
10 ; ORXTABS4, etc., where code for individual dialogues reside.
11 ;
12 Q
13 ;
14EN ; Entry point - called by option [ORX PARAM TAB PREF].
15 ;
16 ; Variables used:
17 ;
18 ; DIR,X,Y = FM user input variables.
19 ; ORXANY = Flag for number of changes.
20 ; ORXCDIS = Display holder for counter display.
21 ; ORXCHC = User's choice of parameter value to edit.
22 ; ORXCNT = Loop counter; re-used in various tags.
23 ; ORXCUR = Existing settings for a parameter.
24 ; ORXERR = Error array used in call to XPAR.
25 ; ORXNEW = New value entered by user.
26 ; ORXNOW = Cuttent setting of a parameter piece value.
27 ; ORXNUM = Array count holder.
28 ; ORXPAR = Working variable for parameter definitions, etc.
29 ; ORXPARS = Becomes array of parameters from TABS tag.
30 ; ORXPCS = Array of formal parameter string's piece settings.
31 ; ORXPDIR = Display prompt piece (first piece).
32 ; ORXPDIS = Holder for prompt piece of each value.
33 ; ORXPNAM = Stores name of current parameter definition.
34 ; ORXPRO = Current prompt.
35 ; ORXPSTR = String of prompts.
36 ; ORXSETS = Setting(s) pieces for a parameter.
37 ; ORXSTOP = Flag to stop editing.
38 ; ORXTAB = Becomes current tab, as exists in last part of formal
39 ; parameter definition string.
40 ; ORXTAG = Current data tag.
41 ; ORXTCNT = Current tab line counter.
42 ; ORXTNM = First piece of current tab from text entry.
43 ; ORXVAL = Value holder.
44 ;
45 N DIR,X,Y,ORXANY,ORXCDIS,ORXCHC,ORXCNT,ORXCUR,ORXERR,ORXNEW,ORXNOW,ORXNUM,ORXPAR,ORXPARS,ORXPCS,ORXPDIR,ORXPDIS,ORXPNAM,ORXPRO,ORXPSTR,ORXSETS,ORXSTOP,ORXTAB,ORXTAG,ORXTCNT,ORXTNM,ORXVAL
46 ;
47 S ORXSTOP=0 ; Preset flag before starting.
48 ;
49 ; Establish control loop for entire editing process.
50 F Q:ORXSTOP D
51 .D BLDLIST Q:ORXSTOP ; ORXSTOP here = list problem.
52 .D CHOOSE Q:ORXSTOP ; ORXSTOP here = user punted.
53 .D PARAMS(ORXTAB) ; ORXTAB set by CHOOSE tag.
54 .D EDIT^ORXTABS1 ; User editing.
55 .;
56 .; ORXANY will be set by EACH, SOME, or ALL calls in ORXTABS1:
57 .I ORXANY D SAVE^ORXTABS1 ; If changes made, save?
58 .S ORXSTOP=0 ; Assure loop restart.
59 ;
60 Q
61 ;
62BLDLIST ; Get list of tabs with editable parameters for display.
63 ;
64 K ORXPARS ; Clean out array each time.
65 S ORXTAG="TABS" ; Data tag herein.
66 S ORXCNT=0 ; Initialize counter.
67 F D Q:ORXPARS(ORXCNT)="" ; Get each tag's entry.
68 .S ORXCNT=ORXCNT+1 ; Increment counter.
69 .S ORXPARS(ORXCNT)=$P($T(@ORXTAG+ORXCNT),";;",2)
70 ;
71 ; Check for no parameters listed or problem with reading data:
72 I ORXCNT<2 S ORXSTOP=1
73 ;
74 Q
75 ;
76CHOOSE ; Display tabs, allow user to choose.
77 ;
78 ; Clear, reset DIR variables:
79 K DIR,X,Y
80 S DIR("A")=" Select tab for preferences editing"
81 S DIR("?")=" Select by entry of item number:"
82 ;
83 ; Assign array [DIR("A")] items for display:
84 S ORXCNT=0
85 S ORXVAL=""
86 F D Q:ORXVAL=""
87 .S ORXCNT=ORXCNT+1 ; Increment counter.
88 .S ORXVAL=$P($G(ORXPARS(ORXCNT)),U) ; Get first piece of string.
89 .;
90 .; Assign the actual display line:
91 .S ORXCDIS=ORXCNT
92 .S ORXCDIS=$$RJ^XLFSTR(ORXCDIS,2) ; Right justify to 2 places.
93 .S:(ORXVAL'="") DIR("A",ORXCNT)=" "_ORXCDIS_" "_ORXVAL
94 ;
95 ; Check for errors:
96 I ORXCNT<2 W !!," Problem reading TABS data!" S ORXSTOP=1 Q
97 ;
98 ; Define DIR input requirements:
99 S DIR(0)="NO^1:"_(ORXCNT-1)_":0"
100 ;
101 ; Call DIR for user choice:
102 W !! ; Spacing for screen display.
103 D ^DIR
104 ;
105 ; Check user response:
106 I '$L($G(Y)) S ORXSTOP=1 Q ; Punt if Y not assigned.
107 I Y="" S ORXSTOP=1 Q ; Punt if Y is null.
108 I Y="^" S ORXSTOP=1 Q ; Punt if Y is "^" character.
109 I Y<1 S ORXSTOP=1 Q ; Punt if Y is less than one.
110 I Y>(ORXCNT-1) S ORXSTOP=1 Q ; Punt if Y isn't within range.
111 S (ORXTCNT,ORXTAB)=Y ; Otherwise, get entry and go.
112 ;
113 Q
114 ;
115PARAMS(ORXPAR) ; Retrieve selected tab's current parameter values.
116 ;
117 S ORXTAB=$P(ORXPARS(ORXPAR),U) ; Tab name from user display.
118 S ORXTNM=ORXTAB ; Comparison value holder.
119 S ORXSETS=$P(ORXPARS(ORXPAR),U,2) ; Settings info.
120 S ORXTAB=$$EXCX ; Display name differences.
121 S ORXPAR="ORCH CONTEXT "_ORXTAB ; Construct formal param name.
122 S ORXPNAM=ORXPAR ; Store for saving changes.
123 ;
124 ; Get current parameter values from Parameters file:
125 S ORXCUR=""
126 S ORXCUR=$$GET^XPAR("ALL",ORXPAR)
127 ;
128 Q
129 ;
130EXCX() ; Deal with exceptions in spelling.
131 ;
132 I ORXTAB="D/C SUMMARIES" S ORXTAB="SUMMRIES" ; Shorter spelling.
133 I ORXTAB="IMAGING" S ORXTAB="XRAYS" ; IMAGING is XRAYS.
134 I ORXTAB="INPATIENT LABS" S ORXTAB="INPT LABS" ; Shorter spelling.
135 I ORXTAB="OUTPATIENT LABS" S ORXTAB="OUTPT LABS" ; Shorter spelling.
136 ;
137 Q ORXTAB
138 ;
139 ;
140 ; NOTES ON ENTRIES FOR THE FOLLOWING "TABS" TAG:
141 ; Each TABS entry MUST have a corresponding PROMPTS entry in
142 ; PROMPTS^ORXTABS, in the same order and with matching first
143 ; pieces. There MUST ALSO be a tag in ORXTABS2, to get user
144 ; input, which matches the actual name of the parameter in the
145 ; Parameter Definition [^XTV(8989.51,] file. For example,
146 ; the NOTES entry in TABS below is the last word of the "ORCH
147 ; CONTEXT NOTES" entry in the Parameter Definition file. If
148 ; the first piece listed in the TABS tag below differs from the
149 ; actual Parameter Definition file entry - as is the case for
150 ; XRAYS, which is the IMAGING entry below - add code in the EXCX
151 ; tag above to deal with it. The third "^" piece in each TABS
152 ; entry represents the positions in the parameter string entry
153 ; itself, i.e. in the Parameters [^XTV(8989.5,] file, where
154 ; each individual value is stored, in the order listed in the
155 ; second "^" piece of the TABS entry. IMPORTANT: Keep all "BEG"
156 ; and "END" pairs together consecutively - with "BEG" first, and
157 ; all "STATUS" and "AUTHOR" pairs together - with "STATUS" first.
158 ;
159TABS ; Data strings for parameters/preferences.
160 ;;CONSULTS^BEG;END;STATUS;SERVICE^1;2;3;4
161 ;;INPATIENT LABS^BEG;END;TYPE^1;2;3
162 ;;OUTPATIENT LABS^BEG;END;TYPE^1;2;3
163 ;;MEDS^BEG;END;OUTPT^1;2;3
164 ;;NOTES^BEG;END;STATUS;AUTHOR;OCCLIM;SUBJECT^1;2;3;4;5;6
165 ;;ORDERS^BEG;END;STATUS;DISPGRP;FORMAT^1;2;3;4;5
166 ;;PROBLEMS^STATUS;COMMENTS^3;4
167 ;;REPORTS^BEG;END;MAX^1;2;5
168 ;;D/C SUMMARIES^BEG;END;STATUS;AUTHOR^1;2;3;4
169 ;;IMAGING^BEG;END;MAX^1;2;5
170 ;
171 Q
172 ;
173 ; NOTES ON ENTRIES FOR "PROMPTS" TAG:
174 ; Each PROMPTS entry below needs a corresponding TABS entry
175 ; in TABS^ORXTABS, must be listed in the same order, and with
176 ; a matching number of pieces.
177 ;
178PROMPTS ; 24 char-max Prompts - MUST match TABS^ORXTABS entries/piece counts!
179 ;;CONSULTS^Begin Date;End Date;Status;Service
180 ;;INPATIENT LABS^Begin Date;End Date;Type
181 ;;OUTPATIENT LABS^Begin Date;End Date;Type
182 ;;MEDS^Begin Date;End Date;Outpatient or Inpatient Meds Default Display
183 ;;NOTES^Begin Date;End Date;Status;Author;Occurrence Limit;Show/Hide Subject
184 ;;ORDERS^Begin Date;End Date;Status;Service/Section;Format
185 ;;PROBLEMS^Status;Comments
186 ;;REPORTS^Begin Date;End Date;Maximum
187 ;;D/C SUMMARIES^Begin Date;End Date;Status;Author
188 ;;IMAGING^Begin Date;End Date;Maximum
189 ;
190 Q
191 ;
Note: See TracBrowser for help on using the repository browser.