source: EDIS/tags/ed/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigParams.mxml@ 1240

Last change on this file since 1240 was 1240, checked in by George Lilly, 13 years ago

new version from the VA

File size: 7.6 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<mx:VBox
3 xmlns:mx="http://www.adobe.com/2006/mxml"
4 xmlns:widget="gov.va.med.edp.widget.*"
5 width="100%" height="100%"
6 creationComplete="resetModified()" >
7
8 <mx:Script>
9 <![CDATA[
10 import gov.va.med.edp.control.config.ConfigurationEvent;
11 import gov.va.med.edp.control.config.ChangeFieldEvent;
12 import mx.controls.CheckBox;
13 import gov.va.med.edp.model.TrackingModelLocator;
14 import gov.va.med.edp.util.AccessibilityTools;
15 import gov.va.med.edp.widget.ValueComboBox;
16
17 [Bindable]
18 private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
19
20 private function resetModified(): void
21 {
22 new ConfigurationEvent(ConfigurationEvent.EVENT_PARAM_MODIFIED_RESET).dispatch();
23 }
24
25 //hours = int(totSec / 3600)
26 //mins = int((totSec % 3600) / 60)
27 //secs = totSec % 60
28 private function buildShiftStart(startMin: int): String
29 {
30 var hours: String = String(int(startMin / 60));
31 var mins: String = String(int(startMin % 60));
32 mins = (mins.length == 1) ? "0" + mins : mins;
33 hours = (hours.length == 1) ? "0" + hours : hours;
34 return hours + ":" + mins;
35 }
36
37 private function changeParam(event: Event): void
38 {
39 var e: ChangeFieldEvent = new ChangeFieldEvent(ChangeFieldEvent.EVENT_CHANGE_PARAM_FIELD);
40 e.field = event.currentTarget.id;
41
42 if (event.currentTarget is CheckBox) {
43 e.value = (event.currentTarget as CheckBox).selected;
44 }
45 if (event.currentTarget is AccessibleNumericStepper) {
46 e.value = (event.currentTarget as AccessibleNumericStepper).value;
47 }
48 if (event.currentTarget is ValueComboBox) {
49 e.value = (event.currentTarget as ValueComboBox).value;
50 }
51 e.dispatch();
52 }
53
54 private function changeShiftStart(): void
55 {
56 var e: ChangeFieldEvent = new ChangeFieldEvent(ChangeFieldEvent.EVENT_CHANGE_PARAM_FIELD);
57 e.field = "shiftOne";
58 var times: Array = shiftStart.text.split(":");
59 if (times.length != 2) return;
60 var hours: int = times[0];
61 var mins: int = times[1];
62 e.value = (hours * 60) + mins;
63 e.dispatch();
64 }
65
66 private function changeShiftLen(): void
67 {
68 var e: ChangeFieldEvent = new ChangeFieldEvent(ChangeFieldEvent.EVENT_CHANGE_PARAM_FIELD);
69 e.field = "shiftLen";
70 var hours: int = shiftLenHours.value;
71 var mins: int = shiftLenMins.value;
72 e.value = (hours * 60) + mins;
73 e.dispatch();
74 }
75
76 private function saveParams(): void
77 {
78 var e: ConfigurationEvent = new ConfigurationEvent(ConfigurationEvent.EVENT_SAVE_PARAM_CONFIG);
79 e.dispatch();
80 }
81 ]]>
82
83 </mx:Script>
84 <mx:Form width="100%">
85 <mx:FormItem width="100%">
86 <mx:CheckBox id="residents"
87 label="Show residents on entry form."
88 change="changeParam(event)"
89 selected="{model.config.params.promptResidents}"
90 styleName="normalLabel"
91 tabIndex="1100"/>
92 </mx:FormItem>
93 <mx:FormItem width="100%">
94 <mx:CheckBox id="clinics"
95 label="Show clinics on entry form."
96 change="changeParam(event)"
97 selected="{model.config.params.promptClinics}"
98 styleName="normalLabel"
99 tabIndex="1101"/>
100 </mx:FormItem>
101 <mx:FormItem width="100%" paddingTop="18">
102 <mx:CheckBox id="reqDiag"
103 label="Diagnosis is required before removing patient."
104 change="changeParam(event)"
105 selected="{model.config.params.requireDiagnosis}"
106 styleName="normalLabel"
107 tabIndex="1102" />
108 </mx:FormItem>
109 <mx:FormItem width="100%" paddingTop="18">
110 <mx:CheckBox id="codedDiag"
111 label="Diagnosis must be coded as ICD."
112 change="changeParam(event)"
113 selected="{model.config.params.codedDiagnosis}"
114 enabled="{reqDiag.selected}"
115 styleName="normalLabel"
116 tabIndex="1103" />
117 </mx:FormItem>
118 <mx:FormItem width="100%" paddingTop="18">
119 <mx:CheckBox id="reqDisp"
120 label="Disposition is required before removing patient."
121 change="changeParam(event)"
122 selected="{model.config.params.requireDisposition}"
123 styleName="normalLabel"
124 tabIndex="1104" />
125 </mx:FormItem>
126 <mx:FormItem width="100%" paddingTop="18">
127 <mx:HBox>
128 <mx:CheckBox id="reqDelay"
129 label="Delay reason is required for visits exceeding"
130 change="changeParam(event)"
131 selected="{model.config.params.requireDelay}"
132 paddingTop="2" styleName="normalLabel"
133 tabIndex="1105" />
134 <widget:AccessibleNumericStepper
135 id="minDelay"
136 name="Minutes"
137 keyDown="changeParam(event)"
138 value="{model.config.params.delayMinutes}"
139 change="changeParam(event)"
140 enabled="{reqDelay.selected}"
141 maximum="9999"
142 styleName="normalLabel"
143 tabIndex="1106" />
144 <mx:Label text="minutes." paddingTop="2" styleName="normalLabel" />
145 </mx:HBox>
146 </mx:FormItem>
147 <mx:FormItem width="100%" paddingTop="18">
148
149 <mx:FormItem label="First shift begins at" paddingTop="2" styleName="normalLabel" >
150 <mx:TextInput
151 id="shiftStart"
152 initialize="{AccessibilityTools.accessComponentName(shiftStart,'First shift begins at time')}"
153 text="{buildShiftStart(model.config.params.shiftStart)}"
154 width="50"
155 change="changeShiftStart()"
156 styleName="normalLabel"
157 tabIndex="1107"/>
158 </mx:FormItem>
159
160 </mx:FormItem>
161 <mx:FormItem width="100%" paddingTop="6">
162 <mx:HBox horizontalGap="3">
163 <mx:FormItem label="Shift duration is" styleName="normalLabel" paddingTop="2">
164 <widget:AccessibleNumericStepper
165 id="shiftLenHours"
166 name="Hours"
167 value="{int(model.config.params.shiftDuration / 60)}"
168 change="changeShiftLen()"
169 maximum="24"
170 styleName="normalLabel"
171 tabIndex="1108" />
172 </mx:FormItem>
173
174 <mx:Label
175 text="hours"
176 styleName="normalLabel" paddingTop="3" paddingRight="6" />
177
178 <mx:FormItem> <!-- necessary to put formitem so it would not be read the label above by JAWS -->
179 <widget:AccessibleNumericStepper
180 id="shiftLenMins"
181 name="Minutes"
182 value="{int(model.config.params.shiftDuration % 60)}"
183 change="changeShiftLen()"
184 maximum="60"
185 styleName="normalLabel"
186 tabIndex="1109" />
187 </mx:FormItem>
188 <mx:Label text="minutes" styleName="normalLabel" paddingTop="2" />
189 </mx:HBox>
190 </mx:FormItem>
191
192 <mx:FormItem paddingTop="18">
193 <mx:HBox horizontalGap="3">
194 <mx:FormItem label="Arriving Ambulance Room/Area is " paddingTop="2" styleName="normalLabel">
195 <widget:ValueComboBox
196 id="ambulance"
197 dataProvider="{model.config.defaultRoomList}"
198 value="{model.config.params.ambulanceArea}"
199 change="changeParam(event)"
200 styleName="normalLabel"
201 tabIndex="1110" />
202 </mx:FormItem>
203 </mx:HBox>
204 </mx:FormItem>
205 <mx:FormItem paddingTop="6">
206 <mx:HBox horizontalGap="3" >
207 <mx:FormItem label="Default Room/Area is " paddingTop="2" styleName="normalLabel" >
208 <widget:ValueComboBox
209 id="dfltRoom"
210 dataProvider="{model.config.defaultRoomList}"
211 value="{model.config.params.defaultRoom}"
212 change="changeParam(event)"
213 styleName="normalLabel"
214 tabIndex="1111" />
215 </mx:FormItem>
216 </mx:HBox>
217 </mx:FormItem>
218 </mx:Form>
219 <mx:Canvas width="100%" >
220 <mx:Button
221 label="Save Parameter Changes"
222 enabled="{(model.config.paramMods &amp;&amp; model.config.paramLoaded)}"
223 horizontalCenter="0" top="6" bottom="6"
224 click="saveParams()"
225 tabIndex="1900" />
226 </mx:Canvas>
227</mx:VBox>
Note: See TracBrowser for help on using the repository browser.