source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORXTABS3.m

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

initial load of WorldVistAEHR

File size: 6.5 KB
Line 
1ORXTABS3 ; SLC/PKS - Edit calls, tab parameters preferences. [10/17/00 2:39pm]
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 ;
19BEG ; Beginning date.
20 ;
21 ; Internal variables used:
22 ;
23 ; ORXBDAT = Current "BEG" date entry.
24 ; ORXDATE = ORXNOW passed variable converted to external format.
25 ; ORXEDAT = Matching "END" date data.
26 ; ORXREQ = Flag for required or optional date entry.
27 ; X = Passed variable used in date format conversion.
28 ; Y = Passed variable used in date format conversion.
29 ; %DT = Passed variable in date conversion.
30 ;
31 N ORXBDAT,ORXDATE,ORXEDAT,ORXREQ,X,Y,%DT
32 K ORXDATE
33 S ORXREQ="O"
34 ;
35 ; Assign DIR variables and call DIR:
36 S DIR("T")=120 ; Two minute maximum timeout for response.
37 S DIR("A")=" Enter "_ORXPDIS_" value: "
38 S DIR("?")=" Enter beginning date; an empty response means an unrestricted beginning date range"
39 I ORXPDIR="IMAGING"!(ORXPDIR="REPORTS") D ; Required in some cases.
40 .S ORXREQ=""
41 .S DIR("A")=" Enter "_ORXPDIS_" value (required): "
42 .S DIR("?")=" Enter beginning date (required)"
43 ;
44 ; Assign DIR default, if any:
45 I $L($G(ORXNOW)) S DIR("B")=$S(ORXNOW?7N.1".".6N:$$FMTE^XLFDT(ORXNOW),1:ORXNOW)
46 S DIR(0)="DA"_ORXREQ_"^::ETX" ; DIR input restrictions.
47 W !! ; For screen display.
48 D ^DIR ; FM user input call.
49 S:$D(DTOUT) Y="^" ; Handle time-outs.
50 S (ORXNOW,ORXBDAT)=Y ; ORXBDAT for comparison.
51 S:X="@" ORXNOW="",ORXBDAT="" ; User wants null entry.
52 S:(X'="@")&(X'="^") ORXNOW=X ; Or use X value.
53 K DIR,X,Y ; Clean up each time.
54 ;
55 ; Use ORXEDAT twice to Check for valid date entry:
56 I ORXBDAT'="" D
57 .I ORXNOW="^" Q
58 .I (ORXCNT+1)>ORXNUM W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
59 .S ORXEDAT=$P($G(ORXSETS),";",ORXCNT+1)
60 .I ORXEDAT'="END" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
61 .S ORXEDAT=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT+1))
62 .I ('$D(ORXEDAT)!(ORXEDAT="")) Q ; Null END = accept.
63 .S %DT="",X=ORXEDAT D ^%DT S ORXEDAT=Y ; Convert all dates.
64 .I ORXEDAT<ORXBDAT W !!,"ERROR: Beginning date cannot be later than ending date." S ORXNOW="*Invalid*"
65 ;
66 Q
67 ;
68END ; Ending date.
69 ;
70 ; Internal variables used:
71 ;
72 ; ORXBDAT = Matching "BEG" date data.
73 ; ORXEDAT = Current "END" date entry.
74 ; ORXDATE = ORXNOW passed variable converted to external format.
75 ; ORXREQ = Flag for required or optional date entry.
76 ; X = Passed variable used in date format conversion.
77 ; Y = Passed variable used in date format conversion.
78 ; %DT = Passed variable in date conversion.
79 ;
80 N ORXBDAT,ORXEDAT,ORXDATE,ORXREQ,X,Y,%DT
81 K ORXDATE
82 S ORXREQ="O"
83 ;
84 ; Assign DIR variables and call DIR:
85 S DIR("T")=120 ; Two minute maximum timeout for response.
86 S DIR("A")=" Enter "_ORXPDIS_" value: "
87 S DIR("?")=" Enter ending date; a null response means an unlimited ending date range"
88 I ORXPDIR="IMAGING"!(ORXPDIR="REPORTS") D ; Required in some cases.
89 .S ORXREQ=""
90 .S DIR("A")=" Enter "_ORXPDIS_" value (required): "
91 .S DIR("?")=" Enter ending date (required)"
92 ;
93 ; Assign DIR default, if any:
94 I $L($G(ORXNOW)) S DIR("B")=$S(ORXNOW?7N.1".".6N:$$FMTE^XLFDT(ORXNOW),1:ORXNOW)
95 S DIR(0)="DA"_ORXREQ_"^::ETX" ; DIR input restrictions.
96 W !! ; For screen display.
97 D ^DIR ; FM user input call.
98 S:$D(DTOUT) Y="^" ; Handle time-outs.
99 S (ORXNOW,ORXEDAT)=Y ; ORXEDAT for comparison.
100 S:X="@" ORXNOW="",ORXEDAT="" ; User wants null entry.
101 S:(X'="@")&(X'="^") ORXNOW=X ; Or use X value.
102 K DIR,X,Y ; Clean up each time.
103 ;
104 ; Use ORXBDAT twice to Check for valid date entry:
105 I ORXEDAT'="" D
106 .I ORXNOW="^" Q
107 .I (ORXCNT-1)<1 W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
108 .S ORXBDAT=$P($G(ORXSETS),";",ORXCNT-1)
109 .I ORXBDAT'="BEG" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
110 .S ORXBDAT=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT-1))
111 .I ('$D(ORXBDAT)!(ORXBDAT="")) Q ; Null BEG = accept.
112 .S %DT="",X=ORXBDAT D ^%DT S ORXBDAT=Y ; Convert all dates.
113 .I ORXBDAT>ORXEDAT W !!,"ERROR: Ending date cannot be earlier than beginning date." S ORXNOW="*Invalid*"
114 ;
115 Q
116 ;
117MAX ; Maximum.
118 ;
119 ; Assign DIR variables:
120 S DIR("T")=120 ; Two minute maximum timeout for response.
121 S DIR("A")=" Enter "_ORXPDIS_" # of items to display: "
122 S DIR("?")=" Entry must be between 1 and 999"
123 S DIR(0)="NA^1:999" ; Numerical, required.
124 I ORXPDIR="IMAGING" S DIR(0)="NAO^1:999" ; Imaging not required.
125 ;
126 ; Call tag to get/assign input:
127 D INPUT^ORXTABS2
128 ;
129 Q
130 ;
131AUTHOR ; Author, for D/C Summaries or Notes.
132 ;
133 ; Internal variables used:
134 ;
135 ; DIC,X,Y,DTOUT,DUOUT = Variables for call to DIC.
136 ; ORXSTAT = Used to hold current value of related STATUS value.
137 ;
138 N DIC,X,Y,DTOUT,DUOUT,ORXSTAT
139 ;
140 ; Assign DIC variables and call DIC:
141 S DIC=200
142 S DIC(0)="AEFMQ"
143 S DIC("A")=" Select author: "
144 S DIC("B")=$P($G(^VA(200,DUZ,0)),U)
145 S DTIME=120
146 W !! ; Screen formatting.
147 D ^DIC
148 ;
149 I $D(DUOUT) S ORXNOW="^"
150 I $D(DTOUT) S ORXNOW="^"
151 ;
152 ; Examine user entry, treat if needed, and assign it for return:
153 I ORXNOW'="^" S:+Y'>0 Y=""
154 I ORXNOW'="^" S ORXNOW=+Y
155 ;
156 ; Use ORXSTAT twice to Check for valid entry:
157 I ORXNOW'="" D
158 .I (ORXCNT-1)<1 W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
159 .S ORXSTAT=$P($G(ORXSETS),";",ORXCNT-1)
160 .I ORXSTAT'="STATUS" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
161 .S ORXSTAT=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT-1))
162 .I '$D(ORXSTAT) Q ; Null STATUS = accept.
163 .I ((ORXSTAT=5)!(ORXNOW<4)) S ORXNOW="" ; If STATUS'=4, set null.
164 ;
165 K DIC,X,Y,DTOUT,DUOUT
166 ;
167 Q
168 ;
Note: See TracBrowser for help on using the repository browser.