Updated Canvas
[openemr.git] / interface / forms / eye_mag / php / eye_mag_functions.php
blob8c975511f8ffd114e669ef4aed817d5a947a2208
1 <?php
2 /**
3 * forms/eye_mag/php/eye_mag_functions.php
5 * Functions which extend clinical forms
7 * Copyright (C) 2016 Raymond Magauran <magauran@MedFetch.com>
9 * LICENSE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, either version 3 of the
12 * License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 * @package OpenEMR
23 * @author Ray Magauran <magauran@MedFetch.com>
24 * @link http://www.open-emr.org
27 $form_folder = "eye_mag";
28 require_once(dirname(__FILE__)."/../../../../custom/code_types.inc.php");
29 require_once(dirname(__FILE__)."/../../../../library/options.inc.php");
30 require_once(dirname(__FILE__)."/../../../../library/formatting.inc.php");
31 global $PMSFH;
33 /**
34 * This function returns HTML old record selector widget when needed (4 input values)
36 * @param string $zone options ALL,EXT,ANTSEG,RETINA,NEURO, DRAW_PRIORS_$zone
37 * @param string $visit_date Future functionality to limit result set. UTC DATE Formatted
38 * @param string $pid value = patient id
39 * @param string $type options text(default) image
40 * @return string returns the HTML old record/image selector widget for the desired zone and type
42 function priors_select($zone,$orig_id,$id_to_show,$pid,$type='text') {
43 global $form_folder;
44 global $form_name;
45 global $visit_date;
46 global $priors;
47 global $form_id;
48 global $earlier;
49 $Form_Name = "Eye Exam";
50 $output_return ="<span id='".attr($zone)."_prefix_oldies' name='".attr($zone)."_prefix_oldies' class='oldies_prefix'>";
51 $selected='';
52 $current='';
53 if (!$priors) {
54 $query="select form_encounter.date as encounter_date,form_eye_mag.id as form_id, form_eye_mag.*
55 from form_eye_mag,forms,form_encounter
56 where
57 form_encounter.encounter = forms.encounter and
58 form_eye_mag.id=forms.form_id and
59 forms.form_name =? and
60 forms.deleted != '1' and
61 forms.pid =form_eye_mag.pid and
62 forms.formdir='eye_mag' and form_eye_mag.pid=? ORDER BY encounter_date DESC";
63 //This is actually picking up every form_eye_mag variable from every visit for $pid.
64 //We may need to put a LIMIT on this, or do we really need to retrieve form_eye_mag.*?
65 //Say there were 100 visits and we have a 200 variables(?) in form_eye_mag, we
66 //are probably going to be fine... It'd be a big select list though...
67 //Think Mister Geppetto. What would an AI do with this data for an end-user?
68 //We already use it for the Orders placed on the prior visit.
69 //If we passed this "priors" variable via JSON,
70 // then we could do the following client side (wicked fast):
71 // Carry forward function
72 // build comparison lists, like the IOP graphs by date and by hour
73 // more? Or do the current methods work well enough? Need to ask a programmer.
74 // Unlike the obj data(PMSFH,Clinical,IMPPLAN etc), this data is static.
75 // It only needs to be passed once to the client side.
76 $result = sqlStatement($query,array($Form_Name,$pid));
77 $counter = sqlNumRows($result);
78 $priors = array();
79 if ($counter < 2) return;
80 $i="0";
81 while ($prior= sqlFetchArray($result)) {
82 $dated = new DateTime($prior['encounter_date']);
83 $dated = $dated->format('Y-m-d');
84 $oeexam_date = oeFormatShortDate($dated);
85 $priors[$i] = $prior;
86 $selected ='';
87 $priors[$i]['visit_date'] = $prior['encounter_date'];
88 $priors[$i]['exam_date'] = $oeexam_date;
89 if ($id_to_show ==$prior['form_id']) {
90 $selected = 'selected="selected"';
91 $current = $i;
93 $output .= "<option value='".attr($prior['id'])."' ".attr($selected).">".$oeexam_date."</option>";
94 $selected ='';
95 $i++;
97 } else {
98 //priors[] exists, containing the visits data AND the priors[earlier] field at the end, so iterate through all but the last one.
99 $visit_count = count($priors)-1;
100 for ($i=0; $i< count($priors); $i++) {
101 if ($form_id ==$priors[$i]['id']) {
102 $selected = 'selected=selected';
103 $current = $i;
104 } else {
105 $selected ='';
107 $output .= "<option value='".attr($priors[$i]['id'])."' ".attr($selected).">".text($priors[$i]['exam_date'])."</option>";
110 $i--;
111 if ($current < $i) { $earlier = $current + 1;} else { $earlier = $current; }
112 if ($current > '0') { $later = ($current - 1);} else { $later = "0"; }
113 if ($GLOBALS['date_display_format'] == 1) // mm/div/yyyy
114 { $priors[$i]['encounter_date'] = date("m/d/Y", strtotime($priors[$i]['encounter_date']));
115 $priors[$earlier]['encounter_date'] = date("m/d/Y", strtotime($priors[$earlier]['encounter_date']));
116 $priors[$later]['encounter_date'] = date("m/d/Y", strtotime($priors[$later]['encounter_date']));
117 $priors[0]['encounter_date'] = date("m/d/Y", strtotime($priors[0]['encounter_date']));
118 $priors[$current]['encounter_date'] = date("m/d/Y", strtotime($priors[$current]['encounter_date']));
119 } else {
120 $priors[$i]['encounter_date'] = date("d/m/Y", strtotime($priors[$i]['encounter_date']));
121 $priors[$earlier]['encounter_date'] = date("d/m/Y", strtotime($priors[$earlier]['encounter_date']));
122 $priors[$later]['encounter_date'] = date("d/m/Y", strtotime($priors[$later]['encounter_date']));
123 $priors[0]['encounter_date'] = date("d/m/Y", strtotime($priors[0]['encounter_date']));
124 $priors[$current]['encounter_date'] = date("d/m/Y", strtotime($priors[$current]['encounter_date']));
126 $earlier['PLAN'] = $priors[$earlier]['PLAN'];
127 if ($id_to_show != $orig_id) {
128 $output_return .= '
129 <span title="'.xla($zone).': '.xla("Copy these values into current visit.").'
130 '.xla("Updated fields will be purple."). '"
132 id="COPY_'.attr($zone).'"
133 name="COPY_'.attr($zone).'"
134 value="'.attr($id_to_show).'" onclick=\'$("#COPY_SECTION").val("'.attr($zone).'-'.attr($id_to_show).'").trigger("change");\'>
135 <i class="fa fa-paste fa-lg"></i>
136 </span>
137 &nbsp;&nbsp;';
139 $output_return .= '
140 <span onclick=\'$("#PRIOR_'.attr($zone).'").val("'.attr($priors[$i][id]).'").trigger("change");\'
141 id="PRIORS_'.attr($zone).'_earliest"
142 name="PRIORS_'.attr($zone).'_earliest"
143 class="fa fa-fast-backward fa-sm PRIORS"
144 title="'.attr($zone).': '.attr($priors[$i]['encounter_date']).'">
145 </span>
146 &nbsp;
147 <span onclick=\'$("#PRIOR_'.attr($zone).'").val("'.attr($priors[$earlier][id]).'").trigger("change");\'
148 id="PRIORS_'.attr($zone).'_minus_one"
149 name="PRIORS_'.attr($zone).'_minus_one"
150 class="fa fa-step-backward fa-sm PRIORS"
151 title="'.attr($zone).': '.attr($priors[$earlier]['encounter_date']).'">
152 </span>&nbsp;&nbsp;
153 <select name="PRIOR_'.attr($zone).'"
154 id="PRIOR_'.attr($zone).'"
155 style="padding:0 0;font-size:1.2em;"
156 class="PRIORS">
157 '.$output.'
158 </select>
159 &nbsp;
160 <span onclick=\'$("#PRIOR_'.attr($zone).'").val("'.attr($priors[$later][id]).'").trigger("change");\'
161 id="PRIORS_'.attr($zone).'_plus_one"
162 name="PRIORS_'.attr($zone).'_plus_one"
163 class="fa fa-step-forward PRIORS"
164 title="'.attr($zone).': '.attr($priors[$later]['encounter_date']).'">
165 </span>&nbsp;&nbsp;
166 <span onclick=\'$("#PRIOR_'.attr($zone).'").val("'.attr($priors[0][id]).'").trigger("change");\'
167 id="PRIORS_'.attr($zone).'_latest"
168 name="PRIORS_'.attr($zone).'_latest"
169 class="fa fa-fast-forward PRIORS"
170 title="'.attr($zone).': '.attr($priors[0]['encounter_date']).'"> &nbsp;
171 </span>
172 </span>';
173 return $output_return;
177 * This function returns ZONE specific HTML for a PRIOR record (3 input values)
179 * This is where the magic of displaying the old records happens.
180 * Each section is a duplicate of the base html except the values are from a prior visit,
181 * the background and background-color are different, and the input fields are disabled.
183 * @param string $zone options ALL,EXT,ANTSEG,RETINA,NEURO. DRAW_PRIORS_$zone and IMPPLAN to do.
184 * @param string $visit_date. Future functionality to limit result set. UTC DATE Formatted
185 * @param string $pid value = patient id
186 * @return true : when called outputs the ZONE specific HTML for a prior record + "priors_select" widget for the desired zone
188 function display_PRIOR_section($zone,$orig_id,$id_to_show,$pid,$report = '0') {
189 global $form_folder;
190 global $id;
191 global $ISSUE_TYPES;
192 global $ISSUE_TYPE_STYLES;
194 $query = "SELECT * FROM form_eye_mag_prefs
195 where PEZONE='PREFS' AND id=?
196 ORDER BY ZONE_ORDER,ordering";
198 $result = sqlStatement($query,array($_SESSION['authUserID']));
199 while ($prefs= sqlFetchArray($result)) {
200 ${$prefs['LOCATION']} = $prefs['GOVALUE'];
203 $query = "SELECT * FROM form_".$form_folder." where pid =? and id = ?";
204 $result = sqlQuery($query, array($pid,$id_to_show));
205 @extract($result);
206 ob_start();
207 if ($zone == "EXT") {
208 if ($report =='0') $output = priors_select($zone,$orig_id,$id_to_show,$pid);
210 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
211 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
212 <div name="prior_selector">
213 <?php
214 echo $output;//prior visit selector - already sanitized
216 </div>
218 <?php
219 if ($report =='0') { echo xlt('Prior Exam'); } else { echo xlt($zone);}
220 ?>: </b><br />
221 <div id="PRIORS_EXT_left_1">
222 <table>
223 <?php
224 list($imaging,$episode) = display($pid,$encounter, "EXT");
225 echo $episode;
227 </table>
228 <table>
229 <tr>
230 <td></td><td><?php echo xlt('R'); ?></td><td><?php echo xlt('L'); ?></td>
231 </tr>
232 <tr>
233 <td class="right"><?php echo xlt('Lev Fn{{Levator Function}}'); ?></td>
234 <td><input disabled type="text" size="1" name="PRIOR_RLF" id="PRIOR_RLF" value="<?php echo attr($RLF); ?>"></td>
235 <td><input disabled type="text" size="1" name="PRIOR_LLF" id="PRIOR_LLF" value="<?php echo attr($LLF); ?>"></td>
236 </tr>
237 <tr>
238 <td class="right"><?php echo xlt('MRD{{marginal reflex distance}}'); ?></td>
239 <td><input disabled type="text" size="1" name="PRIOR_RMRD" id="PRIOR_RMRD" value="<?php echo attr($RMRD); ?>"></td>
240 <td><input disabled type="text" size="1" name="PRIOR_LMRD" id="PRIOR_LMRD" value="<?php echo attr($LMRD); ?>"></td>
241 </tr>
242 <tr>
243 <td class="right"><?php echo xlt('Vert Fissure{{vertical fissure height}}'); ?></td>
244 <td><input disabled type="text" size="1" name="PRIOR_RVFISSURE" id="PRIOR_RVFISSURE" value="<?php echo attr($RVFISSURE); ?>"></td>
245 <td><input disabled type="text" size="1" name="PRIOR_LVFISSURE" id="PRIOR_LVFISSURE" value="<?php echo attr($LVFISSURE); ?>"></td>
246 </tr>
247 <tr>
248 <td class="right"><?php echo xlt('Carotid Bruit'); ?></td>
249 <td><input disabled type="text" name="PRIOR_RCAROTID" id="PRIOR_RCAROTID" value="<?php echo attr($RCAROTID); ?>"></td>
250 <td><input disabled type="text" name="PRIOR_LCAROTID" id="PRIOR_LCAROTID" value="<?php echo attr($LCAROTID); ?>"></td>
251 </tr>
252 <tr>
253 <td class="right"><?php echo xlt('Temporal Art.{{Temporal Artery}}'); ?></td>
254 <td><input disabled type="text" size="1" name="PRIOR_RTEMPART" id="PRIOR_RTEMPART" value="<?php echo attr($RTEMPART); ?>"></td>
255 <td><input disabled type="text" size="1" name="PRIOR_LTEMPART" id="PRIOR_LTEMPART" value="<?php echo attr($LTEMPART); ?>"></td>
256 </tr>
257 <tr>
258 <td class="right"><?php echo xlt('CN V{{Cranial Nerve Five}}'); ?></td>
259 <td><input disabled type="text" size="1" name="PRIOR_RCNV" id="PRIOR_RCNV" value="<?php echo attr($RCNV); ?>"></td>
260 <td><input disabled type="text" size="1" name="PRIOR_LCNV" id="PRIOR_LCNV" value="<?php echo attr($LCNV); ?>"></td>
261 </tr>
262 <tr>
263 <td class="right"><?php echo xlt('CN VII{{Cranial Nerve Seven}}'); ?></td>
264 <td><input disabled type="text" size="1" name="PRIOR_RCNVII" id="PRIOR_RCNVII" value="<?php echo attr($RCNVII); ?>"></td>
265 <td><input disabled type="text" size="1" name="PRIOR_LCNVII" id="PRIOR_LCNVII" value="<?php echo attr($LCNVII); ?>"></td>
266 </tr>
267 <tr><td colspan=3 class="underline"><?php echo xlt('Hertel Exophthalmometry'); ?></td></tr>
268 <tr class="center">
269 <td>
270 <input disabled type=text size=1 id="PRIOR_ODHERTEL" name="PRIOR_ODHERTEL" value="<?php echo attr($ODHERTEL); ?>">
271 <i class="fa fa-minus"></i>
272 </td>
273 <td>
274 <input disabled type=text size=3 id="PRIOR_HERTELBASE" name="PRIOR_HERTELBASE" value="<?php echo attr($HERTELBASE); ?>">
275 <i class="fa fa-minus"></i>
276 </td>
277 <td>
278 <input disabled type=text size=1 id="PRIOR_OSHERTEL" name="PRIOR_OSHERTEL" value="<?php echo attr($OSHERTEL); ?>">
279 </td>
280 </tr>
281 <tr><td>&nbsp;</td></tr>
282 </table>
283 </div>
285 <?php ($EXT_VIEW ==1) ? ($display_EXT_view = "wide_textarea") : ($display_EXT_view= "narrow_textarea");?>
286 <?php ($display_EXT_view == "wide_textarea") ? ($marker ="fa-minus-square-o") : ($marker ="fa-plus-square-o");?>
287 <div id="PRIOR_EXT_text_list" name="PRIOR_EXT_text_list" class="borderShadow PRIORS <?php echo attr($display_EXT_view); ?>" >
288 <span class="top_right fa <?php echo attr($marker); ?>" name="PRIOR_EXT_text_view" id="PRIOR_EXT_text_view"></span>
289 <table cellspacing="0" cellpadding="0" >
290 <tr>
291 <th><?php echo xlt('Right'); ?></th><td style="width:100px;"></td><th><?php echo xlt('Left'); ?> </th>
292 </tr>
293 <tr>
294 <td><textarea disabled name="PRIOR_RBROW" id="PRIOR_RBROW" class="right EXT"><?php echo text($RBROW); ?></textarea></td>
295 <td class="ident"><?php echo xlt('Brow'); ?></td>
296 <td><textarea disabled name="PRIOR_LBROW" id="PRIOR_LBROW" class=""><?php echo text($LBROW); ?></textarea></td>
297 </tr>
298 <tr>
299 <td><textarea disabled name="PRIOR_RUL" id="PRIOR_RUL" class="right"><?php echo text($RUL); ?></textarea></td>
300 <td class="ident"><?php echo xlt('Upper Lids'); ?></td>
301 <td><textarea disabled name="PRIOR_LUL" id="PRIOR_LUL" class=""><?php echo text($LUL); ?></textarea></td>
302 </tr>
303 <tr>
304 <td><textarea disabled name="PRIOR_RLL" id="PRIOR_RLL" class="right"><?php echo text($RLL); ?></textarea></td>
305 <td class="ident"><?php echo xlt('Lower Lids'); ?></td>
306 <td><textarea disabled name="PRIOR_LLL" id="PRIOR_LLL" class=""><?php echo text($LLL); ?></textarea></td>
307 </tr>
308 <tr>
309 <td><textarea disabled name="PRIOR_RMCT" id="PRIOR_RMCT" class="right"><?php echo text($RMCT); ?></textarea></td>
310 <td class="ident"><?php echo xlt('Medial Canthi'); ?></td>
311 <td><textarea disabled name="PRIOR_LMCT" id="PRIOR_LMCT" class=""><?php echo text($LMCT); ?></textarea></td>
312 </tr>
313 <tr>
314 <td><textarea disabled name="PRIOR_RADNEXA" id="PRIOR_RADNEXA" class="right"><?php echo text($RADNEXA); ?></textarea></td>
315 <td class="ident"><?php echo xlt('Adnexa'); ?></td>
316 <td><textarea disabled name="PRIOR_LADNEXA" id="PRIOR_LADNEXA" class=""><?php echo text($LADNEXA); ?></textarea></td>
317 </tr>
318 </table>
319 </div> <br />
320 <div class="QP_lengthen"> <b><?php echo xlt('Comments'); ?>:</b><br />
321 <textarea disabled id="PRIOR_EXT_COMMENTS" name="PRIOR_EXT_COMMENTS" Xstyle="width:4.0in;height:3em;"><?php echo text($EXT_COMMENTS); ?></textarea>
322 </div>
324 <?php
325 } elseif ($zone =="ANTSEG") {
326 if ($report =='0') $output = priors_select($zone,$orig_id,$id_to_show,$pid);
328 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
329 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
330 <div name="prior_selector">
331 <?php
332 echo $output;
334 </div>
336 <b> <?php echo xlt('Prior Exam'); ?>:</b><br />
337 <div class="text_clinical" id="PRIORS_ANTSEG_left_1">
338 <table>
339 <?php
340 list($imaging,$episode) = display($pid,$encounter, "ANTSEG");
341 echo $episode;
343 </table>
344 <table>
345 <tr >
346 <td></td><td><?php echo xlt('R{{right}}'); ?></td><td><?php echo xlt('L{{left}}'); ?></td>
347 </tr>
348 <tr>
349 <td class="right" ><?php echo xlt('Gonio{{Gonioscopy abbreviation}}'); ?></td>
350 <td><input disabled type="text" name="PRIOR_ODGONIO" id="PRIOR_ODGONIO" value="<?php echo attr($ODGONIO); ?>"></td>
351 <td><input disabled type="text" name="PRIOR_OSGONIO" id="PRIOR_OSGONIO" value="<?php echo attr($OSGONIO); ?>"></td>
352 </tr>
353 <tr>
354 <td class="right" ><?php echo xlt('Pachymetry'); ?></td>
355 <td><input disabled type="text" name="PRIOR_ODKTHICKNESS" id="PRIOR_ODKTHICKNESS" value="<?php echo attr($ODKTHICKNESS); ?>"></td>
356 <td><input disabled type="text" name="PRIOR_OSKTHICKNESS" id="PRIOR_OSKTHICKNESS" value="<?php echo attr($OSKTHICKNESS); ?>"></td>
357 </tr>
358 <tr>
359 <td class="right" title="<?php echo xla('Schirmers I (w/o anesthesia)'); ?>"><?php echo xlt('Schirmer I'); ?></td>
360 <td><input disabled type="text" name="PRIOR_ODSCHIRMER1" id="PRIOR_ODSCHIRMER1" value="<?php echo attr($ODSCHIRMER1); ?>"></td>
361 <td><input disabled type="text" name="PRIOR_OSSCHRIMER2" id="PRIOR_OSSCHIRMER1" value="<?php echo attr($OSSCHIRMER1); ?>"></td>
362 </tr>
363 <tr>
364 <td class="right" title="<?php echo xla('Schirmers II (w/ anesthesia)'); ?>"><?php echo xlt('Schirmer II'); ?></td>
365 <td><input disabled type="text" name="PRIOR_ODSCHIRMER2" id="PRIOR_ODSCHIRMER2" value="<?php echo attr($ODSCHIRMER2); ?>"></td>
366 <td><input disabled type="text" name="PRIOR_OSSCHRIMER2" id="PRIOR_OSSCHIRMER2" value="<?php echo attr($OSSCHIRMER2); ?>"></td>
367 </tr>
368 <tr>
369 <td class="right" title="<?php echo xla('Tear Break Up Time'); ?>"><?php echo xlt('TBUT{{tear break-up time}}'); ?></td>
370 <td><input disabled type="text" name="PRIOR_ODTBUT" id="PRIOR_ODTBUT" value="<?php echo attr($ODTBUT); ?>"></td>
371 <td><input disabled type="text" name="PRIOR_OSTBUT" id="PRIOR_OSTBUT" value="<?php echo attr($OSTBUT); ?>"></td>
372 </tr>
373 <tr>
374 <td colspan="3" rowspan="4" id="PRIORS_dil_box">
375 <br />
376 <?php
377 // This is going to be based off a list in the near future
378 // to allow for end-user customization
380 <span id="PRIORS_dil_listbox_title"><?php echo xlt('Dilated with'); ?>:</span><br />
381 <table id="PRIORS_dil_listbox">
382 <tr>
383 <td>
384 <input disabled type="checkbox" class="dil_drug" id="PRIORS_CycloMydril" name="PRIORS_CYCLOMYDRIL" value="Cyclomydril" <?php if ($CYCLOMYDRIL == 'Cyclomydril') echo "checked='checked'"; ?> />
385 <label for="CycloMydril" class="input-helper input-helper--checkbox"><?php echo text('CycloMydril'); ?></label>
386 </td>
387 <td>
388 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Tropicamide" name="PRIORS_TROPICAMIDE" value="Tropicamide 2.5%" <?php if ($TROPICAMIDE == 'Tropicamide 2.5%') echo "checked='checked'"; ?> />
389 <label for="Tropicamide" class="input-helper input-helper--checkbox"><?php echo text('Tropic 2.5%'); ?></label>
390 </td>
391 </tr>
392 <tr>
393 <td>
394 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Neo25" name="PRIORS_NEO25" value="Neosynephrine 2.5%" <?php if ($NEO25 =='Neosynephrine 2.5%') echo "checked='checked'"; ?> />
395 <label for="Neo25" class="input-helper input-helper--checkbox"><?php echo text('Neo 2.5%'); ?></label>
396 </td>
397 <td>
398 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Neo10" name="PRIORS_NEO10" value="Neosynephrine 10%" <?php if ($NEO10 =='Neosynephrine 10%') echo "checked='checked'"; ?> />
399 <label for="Neo10" class="input-helper input-helper--checkbox"><?php echo text('Neo 10%'); ?></label>
400 </td>
401 </tr>
402 <tr>
403 <td>
404 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Cyclogyl" style="left:150px;" name="PRIORS_CYCLOGYL" value="Cyclopentolate 1%" <?php if ($CYCLOGYL == 'Cyclopentolate 1%') echo "checked='checked'"; ?> />
405 <label for="Cyclogyl" class="input-helper input-helper--checkbox"><?php echo text('Cyclo 1%'); ?></label>
406 </td>
407 <td>
408 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Atropine" name="PRIORS_ATROPINE" value="Atropine 1%" <?php if ($ATROPINE == 'Atropine 1%') echo "checked='checked'"; ?> />
409 <label for="Atropine" class="input-helper input-helper--checkbox"><?php echo text('Atropine 1%'); ?></label>
410 </td>
411 </tr>
412 </table>
413 </td>
414 </tr>
415 </table>
416 </div>
417 <?php ($ANTSEG_VIEW =='1') ? ($display_ANTSEG_view = "wide_textarea") : ($display_ANTSEG_view= "narrow_textarea");?>
418 <?php ($display_ANTSEG_view == "wide_textarea") ? ($marker ="fa-minus-square-o") : ($marker ="fa-plus-square-o");?>
419 <div id="PRIOR_ANTSEG_text_list" name="PRIOR_ANTSEG_text_list" class="borderShadow PRIORS <?php echo attr($display_ANTSEG_view); ?>" >
420 <span class="top_right fa <?php echo attr($marker); ?>" name="PRIOR_ANTSEG_text_view" id="PRIOR_ANTSEG_text_view"></span>
421 <table>
422 <tr>
423 <th><?php echo xlt('OD{{right eye}}'); ?></th><th></th><th><?php echo xlt('OS{{left eye}}'); ?></th></td>
424 </tr>
425 <tr>
426 <td><textarea disabled name="PRIOR_ODCONJ" id="PRIOR_ODCONJ" class="right"><?php echo text($ODCONJ); ?></textarea></td>
427 <td class="ident"><?php echo xlt('Conj{{Conjunctiva}}'); ?> / <?php echo xlt('Sclera'); ?></td>
428 <td><textarea disabled name="PRIOR_OSCONJ" id="PRIOR_OSCONJ" class=""><?php echo text($OSCONJ); ?></textarea></td>
429 </tr>
430 <tr>
431 <td><textarea disabled name="PRIOR_ODCORNEA" id="PRIOR_ODCORNEA" class="right"><?php echo text($ODCORNEA); ?></textarea></td>
432 <td class="ident"><?php echo xlt('Cornea'); ?></td>
433 <td><textarea disabled name="PRIOR_OSCORNEA" id="PRIOR_OSCORNEA" class=""><?php echo text($OSCORNEA); ?></textarea></td>
434 </tr>
435 <tr>
436 <td><textarea disabled name="PRIOR_ODAC" id="PRIOR_ODAC" class="right"><?php echo text($ODAC); ?></textarea></td>
437 <td class="ident"><?php echo xlt('A/C{{Anterior Chamber}}'); ?></td>
438 <td><textarea disabled name="PRIOR_OSAC" id="PRIOR_OSAC" class=""><?php echo text($OSAC); ?></textarea></td>
439 </tr>
440 <tr>
441 <td><textarea disabled name="PRIOR_ODLENS" id="PRIOR_ODLENS" class=" right"><?php echo text($ODLENS); ?></textarea></td>
442 <td class="ident" ><?php echo xlt('Lens'); ?></td>
443 <td><textarea disabled name="PRIOR_OSLENS" id="PRIOR_OSLENS" class=""><?php echo text($OSLENS); ?></textarea></td>
444 </tr>
445 <tr>
446 <td><textarea disabled name="PRIOR_ODIRIS" id="PRIOR_ODIRIS" class="right"><?php echo text($ODIRIS); ?></textarea></td>
447 <td class="ident"><?php echo xlt('Iris'); ?></td>
448 <td><textarea disabled name="PRIOR_OSIRIS" id="PRIOR_OSIRIS" class=""><?php echo text($OSIRIS); ?></textarea></td>
449 </tr>
450 </table>
451 </div> <br />
452 <div class="QP_lengthen"> <b><?php echo xlt('Comments'); ?>:</b><br />
453 <textarea disabled id="PRIOR_ANTSEG_COMMENTS" name="PRIOR_ANTSEG_COMMENTS"><?php echo text($ANTSEG_COMMENTS); ?></textarea>
454 </div>
456 <?php
457 } elseif ($zone=="RETINA") {
458 if ($report =='0') $output = priors_select($zone,$orig_id,$id_to_show,$pid);
460 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
461 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
462 <div name="prior_selector">
463 <?php
464 echo $output;
466 </div>
467 <b><?php echo xlt('Prior Exam'); ?>:</b><br />
468 <div style="position:relative;float:right;top:0.2in;">
469 <table style="float:right;text-align:right;font-size:0.8em;font-weight:bold;">
470 <?php
471 list($imaging,$episode) = display($pid,$encounter, "POSTSEG");
472 echo $episode;
474 </table>
475 <br />
476 <table style="width:50%;text-align:right;font-size:1.0em;font-weight:bold;padding:10px;margin: 5px 0px;">
477 <tr style="text-align:center;">
478 <td></td>
479 <td><br /><?php echo xlt('OD{{right eye}}'); ?> </td><td><br /><?php echo xlt('OS{{left eye}}'); ?> </td>
480 </tr>
481 <tr>
482 <td>
483 <?php echo xlt('CMT{{Central Macular Thickness}}'); ?>:</td>
484 <td>
485 <input disabled name="PRIOR_ODCMT" size="4" id="PRIOR_ODCMT" value="<?php echo attr($ODCMT); ?>">
486 </td>
487 <td>
488 <input disabled name="PRIOR_OSCMT" size="4" id="PRIOR_OSCMT" value="<?php echo attr($OSCMT); ?>">
489 </td>
490 </tr>
491 </table>
492 <br />
493 <table style="text-align:right;font-size:0.8em;font-weight:bold;float:right;">
494 <?php
495 list($imaging,$episode) = display($pid,$encounter, "NEURO");
496 echo $episode;
498 </table>
499 </div>
501 <?php ($RETINA_VIEW ==1) ? ($display_RETINA_view = "wide_textarea") : ($display_RETINA_view= "narrow_textarea");?>
502 <?php ($display_RETINA_view == "wide_textarea") ? ($marker ="fa-minus-square-o") : ($marker ="fa-plus-square-o");?>
503 <div>
504 <div id="PRIOR_RETINA_text_list" name="PRIOR_RETINA_text_list" class="borderShadow PRIORS <?php echo attr($display_RETINA_view); ?>">
505 <span class="top_right fa <?php echo attr($marker); ?>" name="PRIOR_RETINA_text_view" id="PRIOR_RETINA_text_view"></span>
506 <table cellspacing="0" cellpadding="0">
507 <tr>
508 <th><?php echo xlt('OD{{right eye}}'); ?></th><td style="width:100px;"></td><th><?php echo xlt('OS{{left eye}}'); ?></th></td>
509 </tr>
510 <tr>
511 <td><textarea disabled name="ODDISC" id="ODDISC" class="right"><?php echo text($ODDISC); ?></textarea></td>
512 <td style="text-align:center;font-size:0.9em;"><?php echo xlt('Disc'); ?></td>
513 <td><textarea disabled name="OSDISC" id="OSDISC" class=""><?php echo text($OSDISC); ?></textarea></td>
514 </tr>
515 <tr>
516 <td><textarea disabled name="ODCUP" id="ODCUP" class="right"><?php echo text($ODCUP); ?></textarea></td>
517 <td style="text-align:center;font-size:0.9em;"><?php echo xlt('Cup'); ?></td>
518 <td><textarea disabled name="OSCUP" id="OSCUP" class=""><?php echo text($OSCUP); ?></textarea></td>
519 </tr>
520 <tr>
521 <td><textarea disabled name="ODMACULA" id="ODMACULA" class="right"><?php echo text($ODMACULA); ?></textarea></td>
522 <td style="text-align:center;font-size:0.9em;"><?php echo xlt('Macula'); ?></td>
523 <td><textarea disabled name="OSMACULA" id="OSMACULA" class=""><?php echo text($OSMACULA); ?></textarea></td>
524 </tr>
525 <tr>
526 <td><textarea disabled name="ODVESSELS" id="ODVESSELS" class="right"><?php echo text($ODVESSELS); ?></textarea></td>
527 <td style="text-align:center;font-size:0.9em;" class=""><?php echo xlt('Vessels'); ?></td>
528 <td><textarea disabled name="OSVESSELS" id="OSVESSELS" class=""><?php echo text($OSVESSELS); ?></textarea></td>
529 </tr>
530 <tr>
531 <td><textarea disabled name="ODPERIPH" id="ODPERIPH" class="right"><?php echo text($ODPERIPH); ?></textarea></td>
532 <td style="text-align:center;font-size:0.9em;" class=""><?php echo xlt('Periph'); ?></td>
533 <td><textarea disabled name="OSPERIPH" id="OSPERIPH" class=""><?php echo text($OSPERIPH); ?></textarea></td>
534 </tr>
535 </table>
536 </div>
537 </div>
538 <br />
539 <br />
540 <div class="QP_lengthen">
541 <b><?php echo xlt('Comments'); ?>:</b><br />
542 <textarea disabled id="RETINA_COMMENTS" name="RETINA_COMMENTS" style="width:4.0in;height:3.0em;"><?php echo text($RETINA_COMMENTS); ?></textarea>
543 </div>
544 <?php
545 } elseif ($zone=="NEURO") {
546 if ($report =='0') $output = priors_select($zone,$orig_id,$id_to_show,$pid);
548 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
549 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
550 <div name="prior_selector">
551 <?php
552 echo $output;
554 </div>
555 <b><?php echo xlt('Prior Exam'); ?>:</b><br />
556 <div style="float:left;margin-top:0.8em;font-size:0.8em;">
557 <div id="PRIOR_NEURO_text_list" class="borderShadow PRIORS" style="border:1pt solid black;float:left;width:175px;padding:10px;text-align:center;margin:2 2;font-weight:bold;">
558 <table style="font-size:1.0em;font-weight:600;">
559 <tr>
560 <td></td><td style="text-align:center;"><?php echo xlt('OD{{right eye}}'); ?></td><td style="text-align:center;"><?php echo xlt('OS{{left eye}}'); ?></td></tr>
561 <tr>
562 <td class="right">
563 <?php echo xlt('Color'); ?>:
564 </td>
565 <td>
566 <input disabled type="text" id="PRIOR_ODCOLOR" name="PRIOR_ODCOLOR" value="<?php if ($ODCOLOR) { echo attr($ODCOLOR); } else { echo " / "; } ?>"/>
567 </td>
568 <td>
569 <input disabled type="text" id="PRIOR_OSCOLOR" name="PRIOR_OSCOLOR" value="<?php if ($OSCOLOR) { echo attr($OSCOLOR); } else { echo " / "; } ?>"/>
570 </td>
571 <td style="text-align:bottom;">
572 &nbsp;<span title="<?php echo xla('Insert normals - 11/11'); ?>" class="fa fa-share-square-o fa-flip-horizontal"></span>
573 </td>
574 </tr>
575 <tr>
576 <td class="right" style="white-space: nowrap;font-size:0.9em;">
577 <span title="<?php echo xla('Variation in red color discrimination between the eyes (eg. OD=100, OS=75)'); ?>"><?php echo xlt('Red Desat{{Red Desaturation}}'); ?>:</span>
578 </td>
579 <td>
580 <input disabled type="text" size="6" name="PRIOR_ODREDDESAT" id="PRIOR_ODREDDESAT" value="<?php echo attr($ODREDDESAT); ?>"/>
581 </td>
582 <td>
583 <input disabled type="text" size="6" name="PRIOR_OSREDDESAT" id="PRIOR_OSREDDESAT" value="<?php echo attr($OSREDDESAT); ?>"/>
584 </td>
585 <td>&nbsp;
586 <span id="" class="fa fa-share-square-o fa-flip-horizontal" name="" title="<?php echo xla('Insert normals - 100/100'); ?>"></span>
587 </td>
588 </tr>
589 <tr>
590 <td class="right" style="white-space: nowrap;font-size:0.9em;">
591 <span title="<?php echo xla('Variation in white (muscle) light brightness discrimination between the eyes (eg. OD=$1.00, OS=$0.75)'); ?>"><?php echo xlt('Coins'); ?>:</span>
592 </td>
593 <td>
594 <input disabled type="text" size="6" name="PRIOR_ODCOINS" id="PRIOR_ODCOINS" value="<?php echo attr($ODCOINS); ?>"/>
595 </td>
596 <td>
597 <input disabled type="text" size="6" name="PRIOR_OSCOINS" id="PRIOR_OSCOINS" value="<?php echo attr($OSCOINS); ?>"/>
598 </td>
599 <td>&nbsp;
600 <span id="" class="fa fa-share-square-o fa-flip-horizontal" name="" title="<?php echo xla('Insert normals - 100/100'); ?>"></span>
601 </td>
602 </tr>
603 </table>
604 </div>
605 <div class="borderShadow" style="position:relative;float:right;text-align:center;width:238px;height:250px;z-index:1;margin:2 0 2 2;">
606 <span class="closeButton fa fa-th" id="PRIOR_Close_ACTMAIN" name="PRIOR_Close_ACTMAIN"></span>
607 <table style="position:relative;float:left;font-size:0.9em;width:210px;font-weight:600;">
608 <tr style="text-align:left;height:26px;vertical-align:middle;width:180px;">
609 <td >
610 <span id="PRIOR_ACTTRIGGER" name="PRIOR_ACTTRIGGER" style="text-decoration:underline;"><?php echo ('Alternate Cover Test'); ?>:</span>
611 </td>
612 <td>
613 <span id="PRIOR_ACTNORMAL_CHECK" name="PRIOR_ACTNORMAL_CHECK">
614 <label for="PRIOR_ACT" class="input-helper input-helper--checkbox"><?php echo xlt('Ortho'); ?></label>
615 <input disabled type="checkbox" name="PRIOR_ACT" id="PRIOR_ACT" checked="<?php if ($ACT =='1') echo "checked"; ?>"></span>
616 </td>
617 </tr>
618 <tr>
619 <td colspan="2" style="text-align:center;">
620 <div id="PRIOR_ACTMAIN" name="PRIOR_ACTMAIN" class="ACT_TEXT nodisplay" style="position:relative;z-index:1;margin 10 auto;">
621 <table cellpadding="0" style="position:relative;text-align:center;font-size:0.9em;margin: 7 5 19 5;border-collapse: separate;">
622 <tr>
623 <td id="PRIOR_ACT_tab_SCDIST" name="PRIOR_ACT_tab_SCDIST" class="ACT_selected"> <?php echo xlt('scDist{{ACT without Correction Distance}}'); ?> </td>
624 <td id="PRIOR_ACT_tab_CCDIST" name="PRIOR_ACT_tab_CCDIST" class="ACT_deselected"> <?php echo xlt('ccDist{{ACT with Correction Distance}}'); ?> </td>
625 <td id="PRIOR_ACT_tab_SCNEAR" name="PRIOR_ACT_tab_SCNEAR" class="ACT_deselected"> <?php echo xlt('scNear{{ACT without Correction Near}}'); ?> </td>
626 <td id="PRIOR_ACT_tab_CCNEAR" name="PRIOR_ACT_tab_CCNEAR" class="ACT_deselected"> <?php echo xlt('ccNear{{ACT with Correction Near}}'); ?> </td>
627 </tr>
628 <tr>
629 <td colspan="4" style="text-align:center;font-size:0.8em;">
630 <div id="PRIOR_ACT_SCDIST" name="PRIOR_ACT_SCDIST" class="ACT_box">
631 <br />
632 <table>
633 <tr>
634 <td style="text-align:center;"><?php echo xlt('R{{Right}}'); ?></td>
635 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:right;">
636 <textarea disabled id="PRIOR_ACT1SCDIST" name="PRIOR_ACT1SCDIST" class="ACT"><?php echo text($ACT1SCDIST); ?></textarea></td>
637 <td style="border:1pt solid black;border-top:0pt;text-align:center;">
638 <textarea disabled id="PRIOR_ACT2SCDIST" name="PRIOR_ACT2SCDIST"class="ACT"><?php echo text($ACT2SCDIST); ?></textarea></td>
639 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:left;">
640 <textarea disabled id="PRIOR_ACT3SCDIST" name="PRIOR_ACT3SCDIST" class="ACT"><?php echo text($ACT3SCDIST); ?></textarea></td>
641 <td style="text-align:center;"><?php echo xlt('L{{Left}}'); ?></td>
642 </tr>
643 <tr>
644 <td style="text-align:right;"><i class="fa fa-reply rotate-left right"></i></td>
645 <td style="border:1pt solid black;border-left:0pt;text-align:right;">
646 <textarea disabled id="PRIOR_ACT4SCDIST" name="PRIOR_ACT4SCDIST" class="ACT"><?php echo text($ACT4SCDIST); ?></textarea></td>
647 <td style="border:1pt solid black;text-align:center;">
648 <textarea disabled id="PRIOR_ACT5SCDIST" name="PRIOR_ACT5SCDIST" class="ACT"><?php echo text($ACT5SCDIST); ?></textarea></td>
649 <td style="border:1pt solid black;border-right:0pt;text-align:left;">
650 <textarea disabled id="PRIOR_ACT6SCDIST" name="PRIOR_ACT6SCDIST" class="ACT"><?php echo text($ACT6SCDIST); ?></textarea></td>
651 <td><i class="fa fa-share rotate-right"></i></td>
652 </tr>
653 <tr>
654 <td style="border:0; border-top:2pt solid black;border-right:2pt solid black;text-align:right;">
655 <textarea disabled id="PRIOR_ACT10SCDIST" name="PRIOR_ACT10SCDIST" class="ACT"><?php echo text($ACT10SCDIST); ?></textarea></td>
656 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:right;">
657 <textarea disabled id="PRIOR_ACT7SCDIST" name="PRIOR_ACT7SCDIST" class="ACT"><?php echo text($ACT7SCDIST); ?></textarea></td>
658 <td style="border:1pt solid black;border-bottom:0pt;text-align:center;">
659 <textarea disabled id="PRIOR_ACT8SCDIST" name="PRIOR_ACT8SCDIST" class="ACT"><?php echo text($ACT8SCDIST); ?></textarea></td>
660 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:left;">
661 <textarea disabled id="PRIOR_ACT9SCDIST" name="PRIOR_ACT9SCDIST" class="ACT"><?php echo text($ACT9SCDIST); ?></textarea></td>
662 <td style="border:0; border-top:2pt solid black;border-left:2pt solid black;text-align:left;vertical-align:middle;">
663 <textarea disabled id="PRIOR_ACT11SCDIST" name="PRIOR_ACT11SCDIST" class="ACT"><?php echo text($ACT11SCDIST); ?></textarea>
664 </td>
665 </tr>
666 </table>
667 <br />
668 </div>
669 <div id="PRIOR_ACT_CCDIST" name="PRIOR_ACT_CCDIST" class="nodisplay ACT_box">
670 <br />
671 <table>
672 <tr>
673 <td style="text-align:center;"><?php echo xlt('R{{Right}}'); ?></td>
674 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:right;">
675 <textarea disabled id="PRIOR_ACT1CCDIST" name="PRIOR_ACT1CCDIST" class="ACT"><?php echo text($ACT1CCDIST); ?></textarea></td>
676 <td style="border:1pt solid black;border-top:0pt;text-align:center;">
677 <textarea disabled id="PRIOR_ACT2CCDIST" name="PRIOR_ACT2CCDIST"class="ACT"><?php echo text($ACT2CCDIST); ?></textarea></td>
678 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:left;">
679 <textarea disabled id="PRIOR_ACT3CCDIST" name="PRIOR_ACT3CCDIST" class="ACT"><?php echo text($ACT3CCDIST); ?></textarea></td>
680 <td style="text-align:center;"><?php echo xlt('L{{Left}}'); ?></td>
681 </tr>
682 <tr>
683 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
684 <td style="border:1pt solid black;border-left:0pt;text-align:right;">
685 <textarea disabled id="PRIOR_ACT4CCDIST" name="PRIOR_ACT4CCDIST" class="ACT"><?php echo text($ACT4CCDIST); ?></textarea></td>
686 <td style="border:1pt solid black;text-align:center;">
687 <textarea disabled id="PRIOR_ACT5CCDIST" name="PRIOR_ACT5CCDIST" class="ACT"><?php echo text($ACT5CCDIST); ?></textarea></td>
688 <td style="border:1pt solid black;border-right:0pt;text-align:left;">
689 <textarea disabled id="PRIOR_ACT6CCDIST" name="PRIOR_ACT6CCDIST" class="ACT"><?php echo text($ACT6CCDIST); ?></textarea></td>
690 <td><i class="fa fa-share rotate-right"></i></td>
691 </tr>
692 <tr>
693 <td style="border:0; border-top:2pt solid black;border-right:2pt solid black;text-align:right;">
694 <textarea disabled id="PRIOR_ACT10CCDIST" name="PRIOR_ACT10CCDIST" class="ACT"><?php echo text($ACT10CCDIST); ?></textarea></td>
695 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:right;">
696 <textarea disabled id="PRIOR_ACT7CCDIST" name="PRIOR_ACT7CCDIST" class="ACT"><?php echo text($ACT7CCDIST); ?></textarea></td>
697 <td style="border:1pt solid black;border-bottom:0pt;text-align:center;">
698 <textarea disabled id="PRIOR_ACT8CCDIST" name="PRIOR_ACT8CCDIST" class="ACT"><?php echo text($ACT8CCDIST); ?></textarea></td>
699 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:left;">
700 <textarea disabled id="PRIOR_ACT9CCDIST" name="PRIOR_ACT9CCDIST" class="ACT"><?php echo text($ACT9CCDIST); ?></textarea></td>
701 <td style="border:0; border-top:2pt solid black;border-left:2pt solid black;text-align:left;vertical-align:middle;">
702 <textarea disabled id="PRIOR_ACT11CCDIST" name="PRIOR_ACT11CCDIST" class="ACT"><?php echo text($ACT11CCDIST); ?></textarea></td>
703 </tr>
704 </table>
705 <br />
706 </div>
707 <div id="PRIOR_ACT_SCNEAR" name="PRIOR_ACT_SCNEAR" class="nodisplay ACT_box">
708 <br />
709 <table>
710 <tr>
711 <td style="text-align:center;"><?php echo xlt('R{{Right}}'); ?></td>
712 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:right;">
713 <textarea disabled id="PRIOR_ACT1SCNEAR" name="PRIOR_ACT1SCNEAR" class="ACT"><?php echo text($ACT1SCNEAR); ?></textarea></td>
714 <td style="border:1pt solid black;border-top:0pt;text-align:center;">
715 <textarea disabled id="PRIOR_ACT2SCNEAR" name="PRIOR_ACT2SCNEAR"class="ACT"><?php echo text($ACT2SCNEAR); ?></textarea></td>
716 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:left;">
717 <textarea disabled id="PRIOR_ACT3SCNEAR" name="PRIOR_ACT3SCNEAR" class="ACT"><?php echo text($ACT3SCNEAR); ?></textarea></td>
718 <td style="text-align:center;"><?php echo xlt('L{{Left}}'); ?></td>
719 </tr>
720 <tr>
721 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
722 <td style="border:1pt solid black;border-left:0pt;text-align:right;">
723 <textarea disabled id="PRIOR_ACT4SCNEAR" name="PRIOR_ACT4SCNEAR" class="ACT"><?php echo text($ACT4SCNEAR); ?></textarea></td>
724 <td style="border:1pt solid black;text-align:center;">
725 <textarea disabled id="PRIOR_ACT5SCNEAR" name="PRIOR_ACT5SCNEAR" class="ACT"><?php echo text($ACT5SCNEAR); ?></textarea></td>
726 <td style="border:1pt solid black;border-right:0pt;text-align:left;">
727 <textarea disabled id="PRIOR_ACT6SCNEAR" name="PRIOR_ACT6SCNEAR" class="ACT"><?php echo text($ACT6SCNEAR); ?></textarea></td>
728 <td><i class="fa fa-share rotate-right"></i></td>
729 </tr>
730 <tr>
731 <td style="border:0; border-top:2pt solid black;border-right:2pt solid black;text-align:right;">
732 <textarea disabled id="PRIOR_ACT10SCNEAR" name="PRIOR_ACT10SCNEAR" class="ACT"><?php echo text($ACT10SCNEAR); ?></textarea></td>
733 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:right;">
734 <textarea disabled id="PRIOR_ACT7SCNEAR" name="PRIOR_ACT7SCNEAR" class="ACT"><?php echo text($ACT7SCNEAR); ?></textarea></td>
735 <td style="border:1pt solid black;border-bottom:0pt;text-align:center;">
736 <textarea disabled id="PRIOR_ACT8SCNEAR" name="PRIOR_ACT8SCNEAR" class="ACT"><?php echo text($ACT8SCNEAR); ?></textarea></td>
737 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:left;">
738 <textarea disabled id="PRIOR_ACT9SCNEAR" name="PRIOR_ACT9SCNEAR" class="ACT"><?php echo text($ACT9SCNEAR); ?></textarea></td>
739 <td style="border:0; border-top:2pt solid black;border-left:2pt solid black;text-align:left;vertical-align:middle;">
740 <textarea disabled id="PRIOR_ACT11SCNEAR" name="PRIOR_ACT11SCNEAR" class="ACT"><?php echo text($ACT11SCNEAR); ?></textarea>
741 </td>
742 </tr>
743 </table>
744 <br />
745 </div>
746 <div id="PRIOR_ACT_CCNEAR" name="PRIOR_ACT_CCNEAR" class="nodisplay ACT_box">
747 <br />
748 <table>
749 <tr>
750 <td style="text-align:center;"><?php echo xlt('R{{Right}}'); ?></td>
751 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:right;">
752 <textarea disabled id="PRIOR_ACT1CCNEAR" name="PRIOR_ACT1CCNEAR" class="ACT"><?php echo text($ACT1CCNEAR); ?></textarea></td>
753 <td style="border:1pt solid black;border-top:0pt;text-align:center;">
754 <textarea disabled id="PRIOR_ACT2CCNEAR" name="PRIOR_ACT2CCNEAR"class="ACT"><?php echo text($ACT2CCNEAR); ?></textarea></td>
755 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:left;">
756 <textarea disabled id="PRIOR_ACT3CCNEAR" name="PRIOR_ACT3CCNEAR" class="ACT"><?php echo text($ACT3CCNEAR); ?></textarea></td>
757 <td style="text-align:center;"><?php echo xlt('L{{Left}}'); ?></td>
758 </tr>
759 <tr>
760 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
761 <td style="border:1pt solid black;border-left:0pt;text-align:right;">
762 <textarea disabled id="PRIOR_ACT4CCNEAR" name="PRIOR_ACT4CCNEAR" class="ACT"><?php echo text($ACT4CCNEAR); ?></textarea></td>
763 <td style="border:1pt solid black;text-align:center;">
764 <textarea disabled id="PRIOR_ACT5CCNEAR" name="PRIOR_ACT5CCNEAR" class="ACT"><?php echo text($ACT5CCNEAR); ?></textarea></td>
765 <td style="border:1pt solid black;border-right:0pt;text-align:left;">
766 <textarea disabled id="PRIOR_ACT6CCNEAR" name="PRIOR_ACT6CCNEAR" class="ACT"><?php echo text($ACT6CCNEAR); ?></textarea></td><td><i class="fa fa-share rotate-right"></i></td>
767 </tr>
768 <tr>
769 <td style="border:0; border-top:2pt solid black;border-right:2pt solid black;text-align:right;">
770 <textarea disabled id="PRIOR_ACT10CCNEAR" name="PRIOR_ACT10CCNEAR" class="ACT"><?php echo text($ACT10CCNEAR); ?></textarea></td>
771 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:right;">
772 <textarea disabled id="PRIOR_ACT7CCNEAR" name="PRIOR_ACT7CCNEAR" class="ACT"><?php echo text($ACT7CCNEAR); ?></textarea></td>
773 <td style="border:1pt solid black;border-bottom:0pt;text-align:center;">
774 <textarea disabled id="PRIOR_ACT8CCNEAR" name="PRIOR_ACT8CCNEAR" class="ACT"><?php echo text($ACT8CCNEAR); ?></textarea></td>
775 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:left;">
776 <textarea disabled id="PRIOR_ACT9CCNEAR" name="PRIOR_ACT9CCNEAR" class="ACT"><?php echo text($ACT9CCNEAR); ?></textarea></td>
777 <td style="border:0; border-top:2pt solid black;border-left:2pt solid black;text-align:left;vertical-align:middle;">
778 <textarea disabled id="PRIOR_ACT11CCNEAR" name="PRIOR_ACT11CCNEAR" class="ACT"><?php echo text($ACT11CCNEAR); ?></textarea>
779 </td>
780 </tr>
781 </table>
782 <br />
783 </div>
784 </td>
785 </tr>
786 </table>
787 </div>
788 </td>
789 </tr>
790 </table>
791 <div id="PRIOR_NPCNPA" name="PRIOR_NPCNPA">
792 <table style="position:relative;float:left;text-align:center;margin: 4 2;width:100%;font-size:1.0em;padding:4px;">
793 <tr style="">
794 <td style="width:50%;"></td>
795 <td style="font-weight:bold;"><?php echo xlt('OD{{right eye}}'); ?></td>
796 <td style="font-weight:bold;"><?php echo xlt('OS{{left eye}}'); ?></td>
797 </tr>
798 <tr>
799 <td class="right"><span title="<?php echo xla('Near Point of Accomodation'); ?>"><?php echo xlt('NPA{{Near Point of Accomodation}}'); ?>:</span></td>
800 <td><input disabled type="text" id="PRIOR_ODNPA" style="width:70%;" name="PRIOR_ODNPA" value="<?php echo attr($ODNPA); ?>"></td>
801 <td><input disabled type="text" id="PRIOR_OSNPA" style="width:70%;" name="PRIOR_OSNPA" value="<?php echo attr($OSNPA); ?>"></td>
802 </tr>
803 <tr>
804 <td class="right"><span title="<?php echo xla('Near Point of Convergence'); ?>"><?php echo xlt('NPC{{Near Point of Convergence}}'); ?>:</span></td>
805 <td colspan="2" ><input disabled type="text" style="width:85%;" id="PRIOR_NPC" name="PRIOR_NPC" value="<?php echo attr($NPC); ?>">
806 </td>
807 </tr>
808 <tr>
809 <td class="right">
810 <?php echo xlt('Stereopsis'); ?>:
811 </td>
812 <td colspan="2">
813 <input disabled type="text" style="width:85%;" name="PRIOR_STEREOPSIS" id="PRIOR_STEREOPSIS" value="<?php echo attr($STEREOPSIS); ?>">
814 </td>
815 </tr>
816 <tr>
817 <td colspan="3" style="font-weight:bold;"><br /><u><?php echo xlt('Amplitudes'); ?></u><br />
818 </td>
819 </tr>
820 <tr><td ></td><td ><?php echo xlt('Distance'); ?></td><td><?php echo xlt('Near'); ?></td></tr>
821 <tr>
822 <td style="text-align:right;"><?php echo xlt('Divergence'); ?>:</td>
823 <td><input disabled type="text" id="PRIOR_DACCDIST" name="PRIOR_DACCDIST" value="<?php echo attr($DACCDIST); ?>"></td>
824 <td><input disabled type="text" id="PRIOR_DACCNEAR" name="PRIOR_DACCNEAR" value="<?php echo attr($DACCNEAR); ?>"></td></tr>
825 <tr>
826 <td style="text-align:right;"><?php echo xlt('Convergence'); ?>:</td>
827 <td><input disabled type="text" id="PRIOR_CACCDIST" name="PRIOR_CACCDIST" value="<?php echo attr($CACCDIST); ?>"></td>
828 <td><input disabled type="text" id="PRIOR_CACCNEAR" name="PRIOR_CACCNEAR" value="<?php echo attr($CACCNEAR); ?>"></td></tr>
829 </tr>
830 <tr>
831 <td class="right">
832 <?php echo xlt('Vertical Fusional'); ?>:
833 </td>
834 <td colspan="2">
835 <input disabled type="text" style="width:90%;" name="PRIOR_VERTFUSAMPS" id="PRIOR_VERTFUSAMPS" value="<?php echo attr($VERTFUSAMPS); ?>">
836 <br />
837 </td>
838 </tr>
839 </table>
840 </div>
841 </div>
842 <?php
843 $hash_tag = '<i class="fa fa-minus"></i>';
844 if ($MOTILITY_RS > '0') {
845 $PRIOR_MOTILITYNORMAL='';
846 for ($index =1; $index <= $MOTILITY_RS; ++$index) {
847 $here = "PRIOR_MOTILITY_RS_".$index;
848 $$here= $hash_tag;
851 if ($MOTILITY_RI > '0') {
852 $PRIOR_MOTILITYNORMAL='';
853 for ($index =1; $index <= $MOTILITY_RI; ++$index) {
854 $here ="PRIOR_MOTILITY_RI_".$index;
855 $$here = $hash_tag;
858 if ($MOTILITY_LS > '0') {
859 $PRIOR_MOTILITYNORMAL='';
860 for ($index =1; $index <= $MOTILITY_LS; ++$index) {
861 $here ="PRIOR_MOTILITY_LS_".$index;
862 $$here = $hash_tag;
865 if ($MOTILITY_LI > '0') {
866 $PRIOR_MOTILITYNORMAL='';
867 for ($index =1; $index <= $MOTILITY_LI; ++$index) {
868 $here ="PRIOR_MOTILITY_LI_".$index;
869 $$here = $hash_tag;
873 if ($MOTILITY_RRSO > '0') {
874 $PRIOR_MOTILITYNORMAL='';
875 for ($index =1; $index <= $MOTILITY_RRSO; ++$index) {
876 $here ="PRIOR_MOTILITY_RRSO_".$index;
877 $$here = $hash_tag;
880 if ($MOTILITY_LRSO > '0') {
881 $PRIOR_MOTILITYNORMAL='';
882 for ($index =1; $index <= $MOTILITY_LRSO; ++$index) {
883 $here ="PRIOR_MOTILITY_LRSO_".$index;
884 $$here = $hash_tag;
887 if ($MOTILITY_RLIO > '0') {
888 $PRIOR_MOTILITYNORMAL='';
889 for ($index =1; $index <= $MOTILITY_RLIO; ++$index) {
890 $here ="PRIOR_MOTILITY_RLIO_".$index;
891 $$here = $hash_tag;
894 if ($MOTILITY_LLIO > '0') {
895 $PRIOR_MOTILITYNORMAL='';
896 for ($index =1; $index <= $MOTILITY_LLIO; ++$index) {
897 $here ="PRIOR_MOTILITY_LLIO_".$index;
898 $$here = $hash_tag;
902 if ($MOTILITY_RLSO > '0') {
903 $PRIOR_MOTILITYNORMAL='';
904 for ($index =1; $index <= $MOTILITY_RLSO; ++$index) {
905 $here ="PRIOR_MOTILITY_RLSO_".$index;
906 $$here = $hash_tag;
909 if ($MOTILITY_LLSO > '0') {
910 $PRIOR_MOTILITYNORMAL='';
911 for ($index =1; $index <= $MOTILITY_LLSO; ++$index) {
912 $here ="PRIOR_MOTILITY_LLSO_".$index;
913 $$here = $hash_tag;
916 if ($MOTILITY_RRIO > '0') {
917 $PRIOR_MOTILITYNORMAL='';
918 for ($index =1; $index <= $MOTILITY_RRIO; ++$index) {
919 $here ="PRIOR_MOTILITY_RRIO_".$index;
920 $$here = $hash_tag;
923 if ($MOTILITY_LRIO > '0') {
924 $PRIOR_MOTILITYNORMAL='';
925 for ($index =1; $index <= $MOTILITY_LRIO; ++$index) {
926 $here ="PRIOR_MOTILITY_LRIO_".$index;
927 $$here = $hash_tag;
932 $hash_tag = '<i class="fa fa-minus rotate-left"></i>';
933 if ($MOTILITY_LR > '0') {
934 $PRIOR_MOTILITYNORMAL='';
935 for ($index =1; $index <= $MOTILITY_LR; ++$index) {
936 $here ="PRIOR_MOTILITY_LR_".$index;
937 $$here = $hash_tag;
940 if ($MOTILITY_LL > '0') {
941 $PRIOR_MOTILITYNORMAL='';
942 for ($index =1; $index <= $MOTILITY_LL; ++$index) {
943 $here ="PRIOR_MOTILITY_LL_".$index;
944 $$here = $hash_tag;
947 if ($MOTILITY_RR > '0') {
948 $PRIOR_MOTILITYNORMAL='';
949 for ($index =1; $index <= $MOTILITY_RR; ++$index) {
950 $here ="PRIOR_MOTILITY_RR_".$index;
951 $$here = $hash_tag;
954 if ($MOTILITY_RL > '0') {
955 $PRIOR_MOTILITYNORMAL='';
956 for ($index =1; $index <= $MOTILITY_RL; ++$index) {
957 $here ="PRIOR_MOTILITY_RL_".$index;
958 $$here = $hash_tag;
962 <div id="PRIOR_NEURO_MOTILITY" class="text_clinical borderShadow"
963 style="float:left;font-size:0.9em;margin:2 2;padding: 0 10;font-weight:bold;height:134px;width:175px;">
964 <div>
965 <table style="width:100%;margin:0 0 1 0;">
966 <tr>
967 <td style="width:40%;font-size:0.9em;margin:0 auto;font-weight:bold;"><?php echo xlt('Motility'); ?>:</td>
968 <td style="font-size:0.9em;vertical-align:middle;text-align:right;top:0.0in;right:0.1in;height:30px;">
969 <label for="PRIOR_MOTILITYNORMAL" class="input-helper input-helper--checkbox"><?php echo xlt('Normal'); ?></label>
970 <input disabled id="PRIOR_MOTILITYNORMAL" name="PRIOR_MOTILITYNORMAL" type="checkbox" value="1" <?php if ($MOTILITYNORMAL >'0') echo "checked"; ?> disabled>
971 </td>
972 </tr>
973 </table>
974 </div>
975 <input disabled type="hidden" name="PRIOR_MOTILITY_RS" id="PRIOR_MOTILITY_RS" value="<?php echo attr($MOTILITY_RS); ?>">
976 <input disabled type="hidden" name="PRIOR_MOTILITY_RI" id="PRIOR_MOTILITY_RI" value="<?php echo attr($MOTILITY_RI); ?>">
977 <input disabled type="hidden" name="PRIOR_MOTILITY_RR" id="PRIOR_MOTILITY_RR" value="<?php echo attr($MOTILITY_RR); ?>">
978 <input disabled type="hidden" name="PRIOR_MOTILITY_RL" id="PRIOR_MOTILITY_RL" value="<?php echo attr($MOTILITY_RL); ?>">
979 <input disabled type="hidden" name="PRIOR_MOTILITY_LS" id="PRIOR_MOTILITY_LS" value="<?php echo attr($MOTILITY_LS); ?>">
980 <input disabled type="hidden" name="PRIOR_MOTILITY_LI" id="PRIOR_MOTILITY_LI" value="<?php echo attr($MOTILITY_LI); ?>">
981 <input disabled type="hidden" name="PRIOR_MOTILITY_LR" id="PRIOR_MOTILITY_LR" value="<?php echo attr($MOTILITY_LR); ?>">
982 <input disabled type="hidden" name="PRIOR_MOTILITY_LL" id="PRIOR_MOTILITY_LL" value="<?php echo attr($MOTILITY_LL); ?>">
983 <input disabled type="hidden" name="PRIOR_MOTILITY_RRSO" id="PRIOR_MOTILITY_RRSO" value="<?php echo attr($MOTILITY_RRSO); ?>">
984 <input disabled type="hidden" name="PRIOR_MOTILITY_RLSO" id="PRIOR_MOTILITY_RLSO" value="<?php echo attr($MOTILITY_RLSO); ?>">
985 <input disabled type="hidden" name="PRIOR_MOTILITY_RRIO" id="PRIOR_MOTILITY_RRIO" value="<?php echo attr($MOTILITY_RRIO); ?>">
986 <input disabled type="hidden" name="PRIOR_MOTILITY_RLIO" id="PRIOR_MOTILITY_RLIO" value="<?php echo attr($MOTILITY_RLIO); ?>">
988 <input disabled type="hidden" name="PRIOR_MOTILITY_LRSO" id="PRIOR_MOTILITY_LRSO" value="<?php echo attr($MOTILITY_LRSO); ?>">
989 <input disabled type="hidden" name="PRIOR_MOTILITY_LLSO" id="PRIOR_MOTILITY_LLSO" value="<?php echo attr($MOTILITY_LLSO); ?>">
990 <input disabled type="hidden" name="PRIOR_MOTILITY_LRIO" id="PRIOR_MOTILITY_LRIO" value="<?php echo attr($MOTILITY_LRIO); ?>">
991 <input disabled type="hidden" name="PRIOR_MOTILITY_LLIO" id="PRIOR_MOTILITY_LLIO" value="<?php echo attr($MOTILITY_LLIO); ?>">
993 <div style="float:left;left:0.4in;text-decoration:underline;"><?php echo xlt('OD{{right eye}}'); ?></div>
994 <div style="float:right;right:0.4in;text-decoration:underline;"><?php echo xlt('OS{{left eye}}'); ?></div><br />
995 <div class="divTable" style="background: url(../../forms/<?php echo $form_folder; ?>/images/eom.bmp) no-repeat center center;background-size: 90% 75%;height:0.77in;width:0.71in;padding:1px;margin:6 1 1 2;">
996 <div class="divRow">
997 <div class="divCell">&nbsp;</div>
998 </div>
999 <div class="divRow">
1000 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRSO_4; ?></div>
1001 <div class="divCell">&nbsp;</div>
1002 <div class="divCell">&nbsp;</div>
1003 <div class="divCell">&nbsp;</div>
1004 <div class="divCell" name="PRIOR_MOTILITY_RS_4_3" id="PRIOR_MOTILITY_RS_4_3">&nbsp;</div>
1005 <div class="divCell" name="PRIOR_MOTILITY_RS_4_1" id="PRIOR_MOTILITY_RS_4_1">&nbsp;</div>
1006 <div class="divCell" name="PRIOR_MOTILITY_RS_4" id="PRIOR_MOTILITY_RS_4"><?php echo $PRIOR_MOTILITY_RS_4; ?></div>
1007 <div class="divCell" name="PRIOR_MOTILITY_RS_4_2" id="PRIOR_MOTILITY_RS_4_2">&nbsp;</div>
1008 <div class="divCell" name="PRIOR_MOTILITY_RS_4_4" id="PRIOR_MOTILITY_RS_4_4">&nbsp;</div>
1009 <div class="divCell">&nbsp;</div>
1010 <div class="divCell">&nbsp;</div>
1011 <div class="divCell">&nbsp;</div>
1012 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLSO_4; ?></div>
1013 </div>
1014 <div class="divRow">
1015 <div class="divCell">&nbsp;</div>
1016 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRSO_3; ?></div>
1017 <div class="divCell">&nbsp;</div>
1018 <div class="divCell">&nbsp;</div>
1019 <div class="divCell">&nbsp;</div>
1020 <div class="divCell" name="PRIOR_MOTILITY_RS_3_1" id="PRIOR_MOTILITY_RS_3_1">&nbsp;</div>
1021 <div class="divCell" name="PRIOR_MOTILITY_RS_3" id="PRIOR_MOTILITY_RS_3"><?php echo $PRIOR_MOTILITY_RS_3; ?></div>
1022 <div class="divCell" name="PRIOR_MOTILITY_RS_3_2" id="PRIOR_MOTILITY_RS_3_2">&nbsp;</div>
1023 <div class="divCell">&nbsp;</div>
1024 <div class="divCell">&nbsp;</div>
1025 <div class="divCell">&nbsp;</div>
1026 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLSO_3; ?></div>
1027 <div class="divCell">&nbsp;</div>
1028 </div>
1029 <div class="divRow">
1030 <div class="divCell">&nbsp;</div>
1031 <div class="divCell">&nbsp;</div>
1032 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRSO_2; ?></div>
1033 <div class="divCell">&nbsp;</div>
1034 <div class="divCell">&nbsp;</div>
1035 <div class="divCell" name="PRIOR_MOTILITY_RS_2_1" id="PRIOR_MOTILITY_RS_2_1">&nbsp;</div>
1036 <div class="divCell" name="PRIOR_MOTILITY_RS_2" id="PRIOR_MOTILITY_RS_2"><?php echo $PRIOR_MOTILITY_RS_2; ?></div>
1037 <div class="divCell" name="PRIOR_MOTILITY_RS_2_2" id="PRIOR_MOTILITY_RS_2_2">&nbsp;</div>
1038 <div class="divCell">&nbsp;</div>
1039 <div class="divCell">&nbsp;</div>
1040 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLSO_2; ?></div>
1041 <div class="divCell">&nbsp;</div>
1042 <div class="divCell">&nbsp;</div>
1043 </div>
1044 <div class="divRow">
1045 <div class="divCell">&nbsp;</div>
1046 <div class="divCell">&nbsp;</div>
1047 <div class="divCell">&nbsp;</div>
1048 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRSO_1; ?></div>
1049 <div class="divCell">&nbsp;</div>
1050 <div class="divCell" name="PRIOR_MOTILITY_RS_1_1" id="PRIOR_MOTILITY_RS_1_1">&nbsp;</div>
1051 <div class="divCell" name="PRIOR_MOTILITY_RS_1" id="PRIOR_MOTILITY_RS_1"><?php echo $PRIOR_MOTILITY_RS_1; ?></div>
1052 <div class="divCell" name="PRIOR_MOTILITY_RS_1_2" id="PRIOR_MOTILITY_RS_1_2">&nbsp;</div>
1053 <div class="divCell">&nbsp;</div>
1054 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLSO_1; ?></div>
1055 <div class="divCell">&nbsp;</div>
1056 <div class="divCell">&nbsp;</div>
1057 <div class="divCell">&nbsp;</div>
1058 </div>
1059 <div class="divRow">
1060 <div class="divCell">&nbsp;</div>
1061 <div class="divCell">&nbsp;</div>
1062 <div class="divCell">&nbsp;</div>
1063 <div class="divCell">&nbsp;</div>
1064 <div class="divCell">&nbsp;</div>
1065 <div class="divCell" name="PRIOR_MOTILITY_RS_0_1" id="PRIOR_MOTILITY_RS_0_1">&nbsp;</div>
1066 <div class="divCell" name="PRIOR_MOTILITY_RS_0" id="PRIOR_MOTILITY_RS_0">&nbsp;</div>
1067 <div class="divCell" name="PRIOR_MOTILITY_RS_0_1" id="PRIOR_MOTILITY_RS_0_1">&nbsp;</div>
1068 <div class="divCell">&nbsp;</div>
1069 <div class="divCell">&nbsp;</div>
1070 <div class="divCell">&nbsp;</div>
1071 <div class="divCell">&nbsp;</div>
1072 <div class="divCell">&nbsp;</div>
1073 </div>
1074 <div class="divMiddleRow">
1075 <div class="divCell">&nbsp;</div>
1076 <div class="divCell" name="PRIOR_MOTILITY_RR_4" id="PRIOR_MOTILITY_RR_4"><?php echo $PRIOR_MOTILITY_RR_4; ?></div>
1077 <div class="divCell" name="PRIOR_MOTILITY_RR_3" id="PRIOR_MOTILITY_RR_3"><?php echo $PRIOR_MOTILITY_RR_3; ?></div>
1078 <div class="divCell" name="PRIOR_MOTILITY_RR_2" id="PRIOR_MOTILITY_RR_2"><?php echo $PRIOR_MOTILITY_RR_2; ?></div>
1079 <div class="divCell" name="PRIOR_MOTILITY_RR_1" id="PRIOR_MOTILITY_RR_1"><?php echo $PRIOR_MOTILITY_RR_1; ?></div>
1080 <div class="divCell" name="PRIOR_MOTILITY_RR_0" id="PRIOR_MOTILITY_RR_0">&nbsp;</div>
1081 <div class="divCell" name="PRIOR_MOTILITY_R0" id="PRIOR_MOTILITY_R0">&nbsp;</div>
1082 <div class="divCell" name="PRIOR_MOTILITY_RL_0" id="PRIOR_MOTILITY_RL_0">&nbsp;</div>
1083 <div class="divCell" name="PRIOR_MOTILITY_RL_1" id="PRIOR_MOTILITY_RL_1"><?php echo $PRIOR_MOTILITY_RL_1; ?></div>
1084 <div class="divCell" name="PRIOR_MOTILITY_RL_2" id="PRIOR_MOTILITY_RL_2"><?php echo $PRIOR_MOTILITY_RL_2; ?></div>
1085 <div class="divCell" name="PRIOR_MOTILITY_RL_3" id="PRIOR_MOTILITY_RL_3"><?php echo $PRIOR_MOTILITY_RL_3; ?></div>
1086 <div class="divCell" name="PRIOR_MOTILITY_RL_4" id="PRIOR_MOTILITY_RL_4"><?php echo $PRIOR_MOTILITY_RL_4; ?></div>
1087 <div class="divCell">&nbsp;</div>
1088 </div>
1089 <div class="divRow">
1090 <div class="divCell">&nbsp;</div>
1091 <div class="divCell">&nbsp;</div>
1092 <div class="divCell">&nbsp;</div>
1093 <div class="divCell">&nbsp;</div>
1094 <div class="divCell">&nbsp;</div>
1095 <div class="divCell" name="PRIOR_MOTILITY_RI_0_1" id="PRIOR_MOTILITY_RI_0_1">&nbsp;</div>
1096 <div class="divCell" id="PRIOR_MOTILITY_RI_0" name="PRIOR_MOTILITY_RI_0">&nbsp;</div>
1097 <div class="divCell" name="PRIOR_MOTILITY_RI_0_2" id="PRIOR_MOTILITY_RI_0_2">&nbsp;</div>
1098 <div class="divCell">&nbsp;</div>
1099 <div class="divCell">&nbsp;</div>
1100 <div class="divCell">&nbsp;</div>
1101 <div class="divCell">&nbsp;</div>
1102 <div class="divCell">&nbsp;</div>
1103 </div>
1104 <div class="divRow">
1105 <div class="divCell">&nbsp;</div>
1106 <div class="divCell">&nbsp;</div>
1107 <div class="divCell">&nbsp;</div>
1108 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRIO_1; ?></div>
1109 <div class="divCell">&nbsp;</div>
1110 <div class="divCell" name="PRIOR_MOTILITY_RI_1_1" id="PRIOR_MOTILITY_RI_1_1">&nbsp;</div>
1111 <div class="divCell" id="PRIOR_MOTILITY_RI_1" name="PRIOR_MOTILITY_RI_1"><?php echo $PRIOR_MOTILITY_RI_1; ?></div>
1112 <div class="divCell" name="PRIOR_MOTILITY_RI_1_2" id="PRIOR_MOTILITY_RI_1_2">&nbsp;</div>
1113 <div class="divCell">&nbsp;</div>
1114 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLIO_1; ?></div>
1115 <div class="divCell">&nbsp;</div>
1116 <div class="divCell">&nbsp;</div>
1117 <div class="divCell">&nbsp;</div>
1118 </div>
1119 <div class="divRow">
1120 <div class="divCell">&nbsp;</div>
1121 <div class="divCell">&nbsp;</div>
1122 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRIO_2; ?></div>
1123 <div class="divCell">&nbsp;</div>
1124 <div class="divCell">&nbsp;</div>
1125 <div class="divCell" name="PRIOR_MOTILITY_RI_2_1" id="PRIOR_MOTILITY_RI_2_1">&nbsp;</div>
1126 <div class="divCell" id="PRIOR_MOTILITY_RI_2" name="PRIOR_MOTILITY_RI_2"><?php echo $PRIOR_MOTILITY_RI_2; ?></div>
1127 <div class="divCell" name="PRIOR_MOTILITY_RI_2_2" id="PRIOR_MOTILITY_RI_2_2">&nbsp;</div>
1128 <div class="divCell">&nbsp;</div>
1129 <div class="divCell">&nbsp;</div>
1130 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLIO_2; ?></div>
1131 <div class="divCell">&nbsp;</div>
1132 <div class="divCell">&nbsp;</div>
1133 </div>
1134 <div class="divRow">
1135 <div class="divCell">&nbsp;</div>
1136 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRIO_3; ?></div>
1137 <div class="divCell">&nbsp;</div>
1138 <div class="divCell" name="PRIOR_MOTILITY_RI_3_5" id="PRIOR_MOTILITY_RI_3_5">&nbsp;</div>
1139 <div class="divCell" name="PRIOR_MOTILITY_RI_3_3" id="PRIOR_MOTILITY_RI_3_3">&nbsp;</div>
1140 <div class="divCell" name="PRIOR_MOTILITY_RI_3_1" id="PRIOR_MOTILITY_RI_3_1">&nbsp;</div>
1141 <div class="divCell" id="PRIOR_MOTILITY_RI_3" name="PRIOR_MOTILITY_RI_3"><?php echo $PRIOR_MOTILITY_RI_3; ?></div>
1142 <div class="divCell" name="PRIOR_MOTILITY_RI_3_2" id="PRIOR_MOTILITY_RI_3_2">&nbsp;</div>
1143 <div class="divCell" name="PRIOR_MOTILITY_RI_3_4" id="PRIOR_MOTILITY_RI_3_4">&nbsp;</div>
1144 <div class="divCell" name="PRIOR_MOTILITY_RI_3_6" id="PRIOR_MOTILITY_RI_3_6">&nbsp;</div>
1145 <div class="divCell">&nbsp;</div>
1146 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLIO_3; ?></div>
1147 <div class="divCell"></div>
1148 </div>
1149 <div class="divRow">
1150 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRIO_4; ?></div>
1151 <div class="divCell">&nbsp;</div>
1152 <div class="divCell">&nbsp;</div>
1153 <div class="divCell" name="PRIOR_MOTILITY_RI_4_5" id="PRIOR_MOTILITY_RI_4_5">&nbsp;</div>
1154 <div class="divCell" name="PRIOR_MOTILITY_RI_4_3" id="PRIOR_MOTILITY_RI_4_3">&nbsp;</div>
1155 <div class="divCell" name="PRIOR_MOTILITY_RI_4_1" id="PRIOR_MOTILITY_RI_4_1">&nbsp;</div>
1156 <div class="divCell" id="PRIOR_MOTILITY_RI_4" name="PRIOR_MOTILITY_RI_4"><?php echo $PRIOR_MOTILITY_RI_4; ?></div>
1157 <div class="divCell" name="PRIOR_MOTILITY_RI_4_2" id="PRIOR_MOTILITY_RI_4_2">&nbsp;</div>
1158 <div class="divCell" name="PRIOR_MOTILITY_RI_4_4" id="PRIOR_MOTILITY_RI_4_4">&nbsp;</div>
1159 <div class="divCell" name="PRIOR_MOTILITY_RI_4_6" id="PRIOR_MOTILITY_RI_4_6">&nbsp;</div>
1160 <div class="divCell">&nbsp;</div>
1161 <div class="divCell">&nbsp;</div>
1162 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLIO_4; ?></div>
1163 </div>
1164 <div class="divRow">
1165 <div class="divCell">&nbsp;</div>
1166 </div>
1167 </div>
1168 <div class="divTable" style="float:right;background: url(../../forms/<?php echo $form_folder; ?>/images/eom.bmp) no-repeat center center;background-size: 90% 75%;height:0.77in;width:0.71in;padding:1px;margin:6 2 0 0;">
1169 <div class="divRow">
1170 <div class="divCell">&nbsp;</div>
1171 </div>
1172 <div class="divRow">
1173 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRSO_4; ?></div>
1174 <div class="divCell">&nbsp;</div>
1175 <div class="divCell">&nbsp;</div>
1176 <div class="divCell">&nbsp;</div>
1177 <div class="divCell" name="PRIOR_MOTILITY_LS_4_3" id="PRIOR_MOTILITY_LS_4_3">&nbsp;</div>
1178 <div class="divCell" name="PRIOR_MOTILITY_LS_4_1" id="PRIOR_MOTILITY_LS_4_1">&nbsp;</div>
1179 <div class="divCell" name="PRIOR_MOTILITY_LS_4" id="PRIOR_MOTILITY_LS_4"><?php echo $PRIOR_MOTILITY_LS_4; ?></div>
1180 <div class="divCell" name="PRIOR_MOTILITY_LS_4_2" id="PRIOR_MOTILITY_LS_4_2">&nbsp;</div>
1181 <div class="divCell" name="PRIOR_MOTILITY_LS_4_4" id="PRIOR_MOTILITY_LS_4_4">&nbsp;</div>
1182 <div class="divCell">&nbsp;</div>
1183 <div class="divCell">&nbsp;</div>
1184 <div class="divCell">&nbsp;</div>
1185 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLSO_4; ?></div>
1186 </div>
1187 <div class="divRow">
1188 <div class="divCell">&nbsp;</div>
1189 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRSO_3; ?></div>
1190 <div class="divCell">&nbsp;</div>
1191 <div class="divCell">&nbsp;</div>
1192 <div class="divCell">&nbsp;</div>
1193 <div class="divCell" name="PRIOR_MOTILITY_LS_3_1" id="PRIOR_MOTILITY_LS_3_1">&nbsp;</div>
1194 <div class="divCell" name="PRIOR_MOTILITY_LS_3" id="PRIOR_MOTILITY_LS_3"><?php echo $PRIOR_MOTILITY_LS_3; ?></div>
1195 <div class="divCell" name="PRIOR_MOTILITY_LS_3_2" id="PRIOR_MOTILITY_LS_3_2">&nbsp;</div>
1196 <div class="divCell">&nbsp;</div>
1197 <div class="divCell">&nbsp;</div>
1198 <div class="divCell">&nbsp;</div>
1199 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLSO_3; ?></div>
1200 <div class="divCell">&nbsp;</div>
1201 </div>
1202 <div class="divRow">
1203 <div class="divCell">&nbsp;</div>
1204 <div class="divCell">&nbsp;</div>
1205 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRSO_2; ?></div>
1206 <div class="divCell">&nbsp;</div>
1207 <div class="divCell">&nbsp;</div>
1208 <div class="divCell" name="PRIOR_MOTILITY_LS_2_1" id="PRIOR_MOTILITY_LS_2_1">&nbsp;</div>
1209 <div class="divCell" name="PRIOR_MOTILITY_LS_2" id="PRIOR_MOTILITY_LS_2"><?php echo $PRIOR_MOTILITY_LS_2; ?></div>
1210 <div class="divCell" name="PRIOR_MOTILITY_LS_2_2" id="PRIOR_MOTILITY_LS_2_2">&nbsp;</div>
1211 <div class="divCell">&nbsp;</div>
1212 <div class="divCell">&nbsp;</div>
1213 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLSO_2; ?></div>
1214 <div class="divCell">&nbsp;</div>
1215 <div class="divCell">&nbsp;</div>
1216 </div>
1217 <div class="divRow">
1218 <div class="divCell">&nbsp;</div>
1219 <div class="divCell">&nbsp;</div>
1220 <div class="divCell">&nbsp;</div>
1221 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRSO_1; ?></div>
1222 <div class="divCell">&nbsp;</div>
1223 <div class="divCell" name="PRIOR_MOTILITY_LS_1_1" id="PRIOR_MOTILITY_LS_1_1">&nbsp;</div>
1224 <div class="divCell" name="PRIOR_MOTILITY_LS_1" id="PRIOR_MOTILITY_LS_1"><?php echo $PRIOR_MOTILITY_LS_1; ?></div>
1225 <div class="divCell" name="PRIOR_MOTILITY_LS_1_2" id="PRIOR_MOTILITY_LS_1_2">&nbsp;</div>
1226 <div class="divCell">&nbsp;</div>
1227 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLSO_1; ?></div>
1228 <div class="divCell">&nbsp;</div>
1229 <div class="divCell">&nbsp;</div>
1230 <div class="divCell">&nbsp;</div>
1231 </div>
1232 <div class="divRow">
1233 <div class="divCell">&nbsp;</div>
1234 <div class="divCell">&nbsp;</div>
1235 <div class="divCell">&nbsp;</div>
1236 <div class="divCell">&nbsp;</div>
1237 <div class="divCell">&nbsp;</div>
1238 <div class="divCell" name="PRIOR_MOTILITY_LS_0_1" id="PRIOR_MOTILITY_LS_0_1">&nbsp;</div>
1239 <div class="divCell" name="PRIOR_MOTILITY_LS_0" id="PRIOR_MOTILITY_LS_0">&nbsp;</div>
1240 <div class="divCell" name="PRIOR_MOTILITY_LS_0_1" id="PRIOR_MOTILITY_LS_0_1">&nbsp;</div>
1241 <div class="divCell">&nbsp;</div>
1242 <div class="divCell">&nbsp;</div>
1243 <div class="divCell">&nbsp;</div>
1244 <div class="divCell">&nbsp;</div>
1245 <div class="divCell">&nbsp;</div>
1246 </div>
1247 <div class="divMiddleRow">
1248 <div class="divCell">&nbsp;</div>
1249 <div class="divCell" name="PRIOR_MOTILITY_LR_4" id="PRIOR_MOTILITY_LR_4"><?php echo $PRIOR_MOTILITY_LR_4; ?></div>
1250 <div class="divCell" name="PRIOR_MOTILITY_LR_3" id="PRIOR_MOTILITY_LR_3"><?php echo $PRIOR_MOTILITY_LR_3; ?></div>
1251 <div class="divCell" name="PRIOR_MOTILITY_LR_2" id="PRIOR_MOTILITY_LR_2"><?php echo $PRIOR_MOTILITY_LR_2; ?></div>
1252 <div class="divCell" name="PRIOR_MOTILITY_LR_1" id="PRIOR_MOTILITY_LR_1"><?php echo $PRIOR_MOTILITY_LR_1; ?></div>
1253 <div class="divCell" name="PRIOR_MOTILITY_LR_0" id="PRIOR_MOTILITY_LR_0">&nbsp;</div>
1254 <div class="divCell" name="PRIOR_MOTILITY_L0" id="PRIOR_MOTILITY_L0">&nbsp;</div>
1255 <div class="divCell" name="PRIOR_MOTILITY_LL_0" id="PRIOR_MOTILITY_LL_0">&nbsp;</div>
1256 <div class="divCell" name="PRIOR_MOTILITY_LL_1" id="PRIOR_MOTILITY_LL_1"><?php echo $PRIOR_MOTILITY_LL_1; ?></div>
1257 <div class="divCell" name="PRIOR_MOTILITY_LL_2" id="PRIOR_MOTILITY_LL_2"><?php echo $PRIOR_MOTILITY_LL_2; ?></div>
1258 <div class="divCell" name="PRIOR_MOTILITY_LL_3" id="PRIOR_MOTILITY_LL_3"><?php echo $PRIOR_MOTILITY_LL_3; ?></div>
1259 <div class="divCell" name="PRIOR_MOTILITY_LL_4" id="PRIOR_MOTILITY_LL_4"><?php echo $PRIOR_MOTILITY_LL_4; ?></div>
1260 <div class="divCell">&nbsp;</div>
1261 </div>
1262 <div class="divRow">
1263 <div class="divCell">&nbsp;</div>
1264 <div class="divCell" name="PRIOR_MOTILITY_LR_4_1" id="PRIOR_MOTILITY_LR_4_1">&nbsp;</div>
1265 <div class="divCell" name="PRIOR_MOTILITY_LR_3_1" id="PRIOR_MOTILITY_LR_3_1">&nbsp;</div>
1266 <div class="divCell" name="PRIOR_MOTILITY_LR_2_1" id="PRIOR_MOTILITY_LR_2_1">&nbsp;</div>
1267 <div class="divCell" name="PRIOR_MOTILITY_RO_I_1" id="PRIOR_MOTILITY_RO_I_1">&nbsp;</div>
1268 <div class="divCell">&nbsp;</div>
1269 <div class="divCell" id="PRIOR_MOTILITY_LI_0" name="PRIOR_MOTILITY_LI_0">&nbsp;</div>
1270 <div class="divCell">&nbsp;</div>
1271 <div class="divCell" name="PRIOR_MOTILITY_LO_I_1" id="PRIOR_MOTILITY_LO_I_1">&nbsp;</div>
1272 <div class="divCell" name="PRIOR_MOTILITY_LL_2_2" id="PRIOR_MOTILITY_LL_2_2">&nbsp;</div>
1273 <div class="divCell" name="PRIOR_MOTILITY_LL_3_2" id="PRIOR_MOTILITY_LL_3_2">&nbsp;</div>
1274 <div class="divCell" name="PRIOR_MOTILITY_LL_4_2" id="PRIOR_MOTILITY_LL_4_2">&nbsp;</div>
1275 <div class="divCell">&nbsp;</div>
1276 </div>
1277 <div class="divRow">
1278 <div class="divCell">&nbsp;</div>
1279 <div class="divCell" name="PRIOR_MOTILITY_LR_4_3" id="PRIOR_MOTILITY_LR_4_3">&nbsp;</div>
1280 <div class="divCell" name="PRIOR_MOTILITY_LR_3_3" id="PRIOR_MOTILITY_LR_3_3">&nbsp;</div>
1281 <div class="divCell" name="PRIOR_MOTILITY_RO_I_2" id="PRIOR_MOTILITY_RO_I_2"><?php echo $PRIOR_MOTILITY_LRIO_1; ?></div>
1282 <div class="divCell">&nbsp;</div>
1283 <div class="divCell">&nbsp;</div>
1284 <div class="divCell" id="PRIOR_MOTILITY_LI_1" name="PRIOR_MOTILITY_LI_1"><?php echo $PRIOR_MOTILITY_LI_1; ?></div>
1285 <div class="divCell">&nbsp;</div>
1286 <div class="divCell">&nbsp;</div>
1287 <div class="divCell" name="PRIOR_MOTILITY_LO_I_2" id="PRIOR_MOTILITY_LO_I_2"><?php echo $PRIOR_MOTILITY_LLIO_1; ?></div>
1288 <div class="divCell" name="PRIOR_MOTILITY_LL_3_4" id="PRIOR_MOTILITY_LL_3_4">&nbsp;</div>
1289 <div class="divCell" name="PRIOR_MOTILITY_LL_4_4" id="PRIOR_MOTILITY_LL_4_4">&nbsp;</div>
1290 <div class="divCell">&nbsp;</div>
1291 </div>
1292 <div class="divRow">
1293 <div class="divCell" name="PRIOR_MOTILITY_RO_I_3_1" id="PRIOR_MOTILITY_RO_I_3_1">&nbsp;</div>
1294 <div class="divCell" name="PRIOR_MOTILITY_RO_I_3" id="PRIOR_MOTILITY_RO_I_3">&nbsp;</div>
1295 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRIO_2; ?></div>
1296 <div class="divCell">&nbsp;</div>
1297 <div class="divCell">&nbsp;</div>
1298 <div class="divCell" name="PRIOR_MOTILITY_LI_2_1" id="PRIOR_MOTILITY_LI_2_1">&nbsp;</div>
1299 <div class="divCell" id="PRIOR_MOTILITY_LI_2" name="PRIOR_MOTILITY_LI_2"><?php echo $PRIOR_MOTILITY_LI_2; ?></div>
1300 <div class="divCell" name="PRIOR_MOTILITY_LI_2_2" id="PRIOR_MOTILITY_LI_2_2">&nbsp;</div>
1301 <div class="divCell">&nbsp;</div>
1302 <div class="divCell">&nbsp;</div>
1303 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLIO_2; ?></div>
1304 <div class="divCell" name="PRIOR_MOTILITY_LO_I_2" id="PRIOR_MOTILITY_RO_I_2">&nbsp;</div>
1305 <div class="divCell" name="PRIOR_MOTILITY_LO_I_3_1" id="PRIOR_MOTILITY_LO_I_3_1">&nbsp;</div>
1306 </div>
1307 <div class="divRow">
1308 <div class="divCell" name="PRIOR_MOTILITY_LO_I_3" id="PRIOR_MOTILITY_RO_I_3">&nbsp;</div>
1309 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRIO_3; ?></div>
1310 <div class="divCell">&nbsp;</div>
1311 <div class="divCell" name="PRIOR_MOTILITY_LI_3_5" id="PRIOR_MOTILITY_LI_3_5">&nbsp;</div>
1312 <div class="divCell" name="PRIOR_MOTILITY_LI_3_3" id="PRIOR_MOTILITY_LI_3_3">&nbsp;</div>
1313 <div class="divCell" name="PRIOR_MOTILITY_LI_3_1" id="PRIOR_MOTILITY_LI_3_1">&nbsp;</div>
1314 <div class="divCell" name="PRIOR_MOTILITY_LI_3" id="PRIOR_MOTILITY_LI_3"><?php echo $PRIOR_MOTILITY_LI_3; ?></div>
1315 <div class="divCell" name="PRIOR_MOTILITY_LI_3_2" id="PRIOR_MOTILITY_LI_3_2">&nbsp;</div>
1316 <div class="divCell" name="PRIOR_MOTILITY_LI_3_4" id="PRIOR_MOTILITY_LI_3_4">&nbsp;</div>
1317 <div class="divCell" name="PRIOR_MOTILITY_LI_3_6" id="PRIOR_MOTILITY_LI_3_6">&nbsp;</div>
1318 <div class="divCell">&nbsp;</div>
1319 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLIO_3; ?></div>
1320 <div class="divCell" name="PRIOR_MOTILITY_LO_I_3" id="PRIOR_MOTILITY_LO_I_3">&nbsp;</div>
1322 </div>
1323 <div class="divRow">
1324 <div class="divCell" name="PRIOR_MOTILITY_RO_I_4" id="PRIOR_MOTILITY_RO_I_4"><?php echo $PRIOR_MOTILITY_LRIO_4; ?></div>
1325 <div class="divCell">&nbsp;</div>
1326 <div class="divCell">&nbsp;</div>
1327 <div class="divCell" name="PRIOR_MOTILITY_LI_4_5" id="PRIOR_MOTILITY_LI_4_5">&nbsp;</div>
1328 <div class="divCell" name="PRIOR_MOTILITY_LI_4_3" id="PRIOR_MOTILITY_LI_4_3">&nbsp;</div>
1329 <div class="divCell" name="PRIOR_MOTILITY_LI_4_1" id="PRIOR_MOTILITY_LI_4_1">&nbsp;</div>
1330 <div class="divCell" id="PRIOR_MOTILITY_LI_4" name="PRIOR_MOTILITY_LI_4"><?php echo $PRIOR_MOTILITY_LI_4; ?></div>
1331 <div class="divCell" name="PRIOR_MOTILITY_LI_4_2" id="PRIOR_MOTILITY_LI_4_2">&nbsp;</div>
1332 <div class="divCell" name="PRIOR_MOTILITY_LI_4_4" id="PRIOR_MOTILITY_LI_4_4">&nbsp;</div>
1333 <div class="divCell" name="PRIOR_MOTILITY_LI_4_6" id="PRIOR_MOTILITY_LI_4_6">&nbsp;</div>
1334 <div class="divCell">&nbsp;</div>
1335 <div class="divCell">&nbsp;</div>
1336 <div class="divCell" name="PRIOR_MOTILITY_LO_I_4" id="PRIOR_MOTILITY_LO_I_4"><?php echo $PRIOR_MOTILITY_LLIO_4; ?></div>
1337 </div>
1338 <div class="divRow"><div class="divCell">&nbsp;</div>
1339 </div>
1340 </div>
1341 </div>
1342 </div>
1343 <br />
1344 <div style="position: absolute;bottom:0.05in;clear:both;font-size:0.9em;text-align:left;padding-left:25px;">
1345 <b><?php echo xlt('Comments'); ?>:</b><br />
1346 <textarea disabled id="PRIOR_NEURO_COMMENTS" name="PRIOR_NEURO_COMMENTS" style="width:4.0in;height:3.0em;"><?php echo text($NEURO_COMMENTS); ?></textarea>
1347 </div>
1348 <input type="hidden" name="PRIOR_PREFS_ACT_SHOW" id="PRIOR_PREFS_ACT_SHOW" value="<?php echo attr($ACT_SHOW); ?>">
1350 <script type="text/javascript">
1351 $("#PRIOR_ACTTRIGGER").mouseover(function() {
1352 $("#PRIOR_ACTTRIGGER").toggleClass('buttonRefraction_selected').toggleClass('underline');
1354 $("#PRIOR_ACTTRIGGER").mouseout(function() {
1355 $("#PRIOR_ACTTRIGGER").toggleClass('buttonRefraction_selected').toggleClass('underline');
1357 $("#PRIOR_ACTTRIGGER").click(function() {
1358 $("#PRIOR_ACTMAIN").toggleClass('nodisplay'); //.toggleClass('fullscreen');
1359 $("#PRIOR_NPCNPA").toggleClass('nodisplay');
1360 $("#PRIOR_ACTNORMAL_CHECK").toggleClass('nodisplay');
1361 $("#PRIOR_ACTTRIGGER").toggleClass('underline');
1362 $("#PRIOR_Close_ACTMAIN").toggleClass('fa-random').toggleClass('fa-eye');
1364 $("[name^='PRIOR_ACT_tab_']").click(function() {
1365 var section = this.id.match(/PRIOR_ACT_tab_(.*)/)[1];
1366 $("[name^='PRIOR_ACT_']").addClass('nodisplay');
1367 $("[name^='PRIOR_ACT_tab_']").removeClass('nodisplay').removeClass('ACT_selected').addClass('ACT_deselected');
1368 $("#PRIOR_ACT_tab_" + section).addClass('ACT_selected').removeClass('ACT_deselected');
1369 $("#PRIOR_ACT_" + section).removeClass('nodisplay');
1370 $("#PRIOR_PREFS_ACT_SHOW").val(section);
1373 $("[name^='PRIOR_Close_']").click(function() {
1374 var section = this.id.match(/PRIOR_Close_(.*)$/)[1];
1375 if (section =="ACTMAIN") {
1376 $("#PRIOR_ACTTRIGGER").trigger( "click" );
1377 } else {
1378 $("#LayerVision_"+section+"_lightswitch").click();
1381 if ($("#PREFS_ACT_VIEW").val() == '1') {
1382 $("#PRIOR_ACTMAIN").toggleClass('nodisplay');
1383 $("#PRIOR_NPCNPA").toggleClass('nodisplay');
1384 $("#PRIOR_ACTNORMAL_CHECK").toggleClass('nodisplay');
1385 $("#PRIOR_ACTTRIGGER").toggleClass('underline');
1386 var show = $("#PREFS_ACT_SHOW").val();
1387 $("#PRIOR_ACT_tab_"+show).trigger('click');
1389 </script>
1390 <?php
1391 } elseif ($zone=="IMPPLAN") {
1392 if ($report =='0') $output = priors_select($zone,$orig_id,$id_to_show,$pid);
1394 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
1395 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
1396 <div name="prior_selector" class="PRIORS">
1397 <?php
1398 echo $output;
1400 </div>
1401 <b> <?php echo xlt('Prior IMP/PLAN'); ?>:</b><br />
1402 <?php
1403 $PRIOR_IMPPLAN_items = build_IMPPLAN_items($pid,$id_to_show);
1405 if ($PRIOR_IMPPLAN_items) {
1406 echo "<br /><br /><div style='width:90%;'>";
1407 $i='0';$k='1';
1408 foreach ($PRIOR_IMPPLAN_items as $item) {
1409 echo "<div class='IMPPLAN_class' style='clear:both;margin:10px;'>";
1410 echo " <span>$k. ".text($item['title'])."</span><span class='pull-right'>".$item['code']."</span><br />";
1411 echo ' <div class="fake-textarea-disabled-4">'.nl2br(text($item['plan'])).'</div>';
1412 echo '</div>';
1413 $i++;$k++;
1415 echo "</div>";
1417 } elseif ($zone =="ALL") {
1418 echo $selector = priors_select($zone,$orig_id,$id_to_show,$pid);
1419 } elseif ($zone =="PMSFH") {
1420 // Check authorization.
1421 if (acl_check('patients','med')) {
1422 $tmp = getPatientData($pid);
1424 // We are going to build the PMSFH panel.
1425 // There are two rows in our panel.
1426 echo "<div style='height:auto;'>";
1427 echo $display_PMSFH = display_PMSFH('2');
1428 echo "</div>";
1430 $output = ob_get_contents();
1432 ob_end_clean();
1433 return $output;
1437 * Function to prepare for sending the PMSFH_panel and PMSFH_right_panel
1438 * via display_PMSFH('2') and show_PMSFH_panel($PMSFH) respectively,
1439 * to javascript to display changes to the user.
1440 * @param associative array $PMSFH if it exists
1441 * @return json encoded string
1443 function send_json_values($PMSFH="") {
1444 global $pid;
1445 global $form_id;
1446 if (!$PMSFH) build_PMSFH();
1447 $send['PMSFH'] = $PMSFH[0]; //actual array
1448 $send['PMH_panel'] = display_PMSFH('2');//display PMSFH next to the PMSFH Builder
1449 $send['right_panel'] = show_PMSFH_panel($PMSFH);//display PMSFH in a slidable right-sided panel
1450 $send['IMPPLAN_items'] = build_IMPPLAN_items($pid,$form_id);
1451 echo json_encode($send);
1455 * This function builds the complete PMSFH array for a given patient, including the ROS for this encounter.
1457 * It returns the PMSFH array to be used to display it anyway you like.
1458 * Currently it is used to display the expanded PMSFH 3 ways:
1459 * in the Quick Pick square;
1460 * as a persistent/hideable Right Panel;
1461 * and in the Printable Report form.
1462 * For other specialties, breaking out subtypes of surgeries, meds and
1463 * medical_problems should be done here by defining new ISSUE_TYPES which are subcategories of the current
1464 * ISSUE_TYPES medical_problem, surgery and medication. This way we do not change the base install ISSUE_TYPES,
1465 * we merely extend them through subcategorization, allowing the reporting features built in for MU1/2/3/100?
1466 * to function at their base level.
1468 * @param string $pid is the patient identifier
1469 * @return $PMSFH array, access items as $PMSFH[0]
1471 function build_PMSFH($pid) {
1472 global $form_folder;
1473 global $form_id;
1474 global $id;
1475 global $ISSUE_TYPES;
1476 global $ISSUE_TYPE_STYLES;
1477 //Define the PMSFH array elements as you need them:
1478 $PMSFH_labels = array("POH", "POS", "PMH", "Surgery", "Medication", "Allergy", "SOCH", "FH", "ROS");
1480 foreach ($PMSFH_labels as $panel_type) {
1481 $PMSFH[$panel_type] ='';
1482 $subtype = " and (subtype is NULL or subtype ='' )";
1483 $order = "ORDER BY title";
1484 if ($panel_type == "FH" || $panel_type == "SOCH" || $panel_type == "ROS") {
1486 * We are going to build SocHx, FH and ROS separately below since they don't feed off of
1487 * the pre-existing ISSUE_TYPE array - so for now do nothing
1489 continue;
1490 } elseif ($panel_type =='POH') {
1491 $focusISSUE = "medical_problem"; //openEMR ISSUE_TYPE
1492 $subtype=" and subtype ='eye'";
1493 /* This is an "eye" form: providers would like ophthalmic medical problems listed separately.
1494 * Thus we split the ISSUE_TYPE 'medical_problem' using subtype "eye"
1495 * but it could be "GYN", "ONC", "GU" etc - for whoever wants to
1496 * extend this for their own specific "sub"-lists.
1497 * Similarly, consider Past Ocular Surgery, or Past GYN Surgery, etc for specialty-specific
1498 * surgery lists. They would be subtypes of the ISSUE_TYPE 'surgery'...
1499 * eg.
1500 * if ($panel_type =='POS') { //Past Ocular Surgery
1501 * $focusISSUE = "surgery";
1502 * $subtype=" and subtype ='eye'";
1504 * The concept is extensible to sub lists for Allergies & Medications too.
1505 * eg.
1506 * if ($panel_type =='OncMeds') {
1507 * $focusISSUE = "medication";
1508 * $subtype=" and subtype ='onc'";
1511 } elseif ($panel_type =='POS') {
1512 $focusISSUE = "surgery"; //openEMR ISSUE_TYPE
1513 $subtype=" and subtype ='eye'";
1514 } elseif ($panel_type =='PMH') {
1515 $focusISSUE = "medical_problem"; //openEMR ISSUE_TYPE
1516 $subtype=" and (subtype = ' ' OR subtype IS NULL)"; //fee_sheet makes subtype=
1517 $PMSFH['CHRONIC'] = '';
1518 } elseif ($panel_type =='Surgery') {
1519 $focusISSUE = "surgery"; //openEMR ISSUE_TYPE
1520 $subtype=" and (subtype = ' ' OR subtype IS NULL)";
1521 $order = "ORDER BY begdate DESC";
1522 } elseif ($panel_type =='Allergy') {
1523 $focusISSUE = "allergy"; //openEMR ISSUE_TYPE
1524 $subtype="";
1525 } elseif ($panel_type =='Medication') {
1526 $focusISSUE = "medication"; //openEMR ISSUE_TYPE
1527 $subtype="";
1529 $pres = sqlStatement("SELECT * FROM lists WHERE pid = ? AND type = ? " .
1530 $subtype." ".$order, array($pid,$focusISSUE) );
1531 $row_counter='0';
1532 while ($row = sqlFetchArray($pres)) {
1533 $rowid = $row['id'];
1534 $disptitle = text(trim($row['title'])) ? text($row['title']) : "[".xlt("Missing Title")."]";
1535 // I don't like this [Missing Title] business. It is from the original "issue" code.
1536 // It should not happen. Need to write something to prevent this from occurring
1537 // on submission, but for now it needs to stay because it is also in the original
1538 // /interface/patient_file/summary code. Both areas need to prevent a blank submission,
1539 // and when fixed, remove this note.
1541 // look up the diag codes
1542 $codetext = "";
1543 $codedesc = "";
1544 $codetype = "";
1545 $code = "";
1546 if ($row['diagnosis'] != "") {
1547 $diags = explode(";", $row['diagnosis']);
1548 foreach ($diags as $diag) {
1549 $codedesc = lookup_code_descriptions($diag);
1550 list($codetype, $code) = explode(':', $diag);
1551 $order = array("\r\n", "\n","\r");
1552 $codedesc = str_replace($order,'',$codedesc);
1553 $codetext .= text($diag) . " (" . text($codedesc) . ")";
1557 // calculate the status
1558 if ($row['outcome'] == "1" && $row['enddate'] != NULL) {
1559 // Resolved
1560 $statusCompute = generate_display_field(array('data_type'=>'1','list_id'=>'outcome'), $row['outcome']);
1561 } else if($row['enddate'] == NULL) {
1562 $statusCompute = xlt("Active");
1563 } else {
1564 $statusCompute = xlt("Inactive");
1566 ($row['comments'] != NULL)? ($comments = $row['comments']): ($comments="");
1567 $counter_here = count($PMSFH[$panel_type]);
1568 $newdata = array (
1569 'title' => $disptitle,
1570 'status' => $statusCompute,
1571 'begdate' => $row['begdate'],
1572 'enddate' => $row['enddate'],
1573 'returndate' => $row['returndate'],
1574 'occurrence' => $row['occurrence'],
1575 'classification' => $row['classification'],
1576 'referredby' => $row['referredby'],
1577 'extrainfo' => $row['extrainfo'],
1578 'diagnosis' => $row['diagnosis'],
1579 'activity' => $row['activity'],
1580 'code' => $code,
1581 'codedesc' => $codedesc,
1582 'codetext' => $codetext,
1583 'codetype' => $codetype,
1584 'comments' => $comments,
1585 'issue' => $row['id'],
1586 'rowid' => $row['id'],
1587 'row_type' => $row['type'],
1588 'row_subtype' => $row['subtype'],
1589 'user' => $row['user'],
1590 'groupname' => $row['groupname'],
1591 'outcome' => $row['outcome'],
1592 'destination' => $row['destination'],
1593 'reinjury_id' => $row['reinjury_id'],
1594 'injury_part' => $row['injury_part'],
1595 'injury_type' => $row['injury_type'],
1596 'injury_grade' => $row['injury_grade'],
1597 'reaction' => $row['reaction'],
1598 'external_allergyid' => $row['external_allergyid'],
1599 'erx_source' => $row['erx_source'],
1600 'erx_uploaded' => $row['erx_uploaded'],
1601 'modifydate' => $row['modifydate'],
1602 'PMSFH_link' => $panel_type."_".$row_counter
1604 //let the end user decide on display elsewhere... This is all about the array itself.
1605 $PMSFH[$panel_type][] = $newdata;
1606 if ($row['occurrence'] =='4') $PMSFH['CHRONIC'][]=$newdata;
1607 $row_counter++;
1610 //Build the SocHx portion of $PMSFH for this patient.
1611 //$given ="coffee,tobacco,alcohol,sleep_patterns,exercise_patterns,seatbelt_use,counseling,hazardous_activities,recreational_drugs";
1612 $result1 = sqlQuery("select * from history_data where pid=? order by date DESC limit 0,1", array($pid) );
1614 $group_fields_query = sqlStatement("SELECT * FROM layout_options " .
1615 "WHERE form_id = 'HIS' AND group_name = '4Lifestyle' AND uor > 0 " .
1616 "ORDER BY seq");
1617 while ($group_fields = sqlFetchArray($group_fields_query)) {
1618 $titlecols = $group_fields['titlecols'];
1619 $datacols = $group_fields['datacols'];
1620 $data_type = $group_fields['data_type'];
1621 $field_id = $group_fields['field_id'];
1622 $list_id = $group_fields['list_id'];
1623 $currvalue = '';
1624 if ((preg_match("/^\|?0\|?\|?/", $result1[$field_id]))|| ($result1[$field_id]=='')) {
1625 continue;
1626 } else {
1627 $currvalue = $result1[$field_id];
1629 if ($data_type == 28 || $data_type == 32) {
1630 $tmp = explode('|', $currvalue);
1631 switch(count($tmp)) {
1632 case "4": {
1633 $PMSFH['SOCH'][$field_id]['resnote'] = $tmp[0];
1634 $PMSFH['SOCH'][$field_id]['restype'] = $tmp[1];
1635 $PMSFH['SOCH'][$field_id]['resdate'] = $tmp[2];
1636 $PMSFH['SOCH'][$field_id]['reslist'] = $tmp[3];
1637 } break;
1638 case "3": {
1639 $PMSFH['SOCH'][$field_id]['resnote'] = $tmp[0];
1640 $PMSFH['SOCH'][$field_id]['restype'] = $tmp[1];
1641 $PMSFH['SOCH'][$field_id]['resdate'] = $tmp[2];
1642 } break;
1643 case "2": {
1644 $PMSFH['SOCH'][$field_id]['resnote'] = $tmp[0];
1645 $PMSFH['SOCH'][$field_id]['restype'] = $tmp[1];
1646 $PMSFH['SOCH'][$field_id]['resdate'] = "";
1647 } break;
1648 case "1": {
1649 $PMSFH['SOCH'][$field_id]['resnote'] = $tmp[0];
1650 $PMSFH['SOCH'][$field_id]['resdate'] = $PMSFH['SOCH'][$field_id]['restype'] = "";
1651 } break;
1652 default: {
1653 $PMSFH['SOCH'][$field_id]['restype'] = $PMSFH['SOCH'][$field_id]['resdate'] = $PMSFH['SOCH'][$field_id]['resnote'] = "";
1654 } break;
1656 $PMSFH['SOCH'][$field_id]['resnote'] = text($PMSFH['SOCH'][$field_id]['resnote']);
1657 $PMSFH['SOCH'][$field_id]['resdate'] = text($PMSFH['SOCH'][$field_id]['resdate']);
1658 } else if ($data_type == 2) {
1659 $PMSFH['SOCH'][$field_id]['resnote'] = nl2br(htmlspecialchars($currvalue,ENT_NOQUOTES));
1661 if ($PMSFH['SOCH'][$field_id]['resnote'] > '') {
1662 $PMSFH['SOCH'][$field_id]['display'] = substr($PMSFH['SOCH'][$field_id]['resnote'],0,10);
1663 } elseif ($PMSFH['SOCH'][$field_id]['restype']) {
1664 $PMSFH['SOCH'][$field_id]['display'] = str_replace($field_id,'',$PMSFH['SOCH'][$field_id]['restype']);
1666 //coffee,tobacco,alcohol,sleep_patterns,exercise_patterns,seatbelt_use,counseling,hazardous_activities,recreational_drugs
1667 if ($field_id =="coffee") $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Caffeine");
1668 if ($field_id =="tobacco") $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Cigs");
1669 if ($field_id =="alcohol") $PMSFH['SOCH'][$field_id]['short_title'] = xlt("ETOH");
1670 if ($field_id =="sleep_patterns") $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Sleep");
1671 if ($field_id =="exercise_patterns") $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Exercise");
1672 if ($field_id =="seatbelt_use") $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Seatbelt");
1673 if ($field_id =="counseling") $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Therapy");
1674 if ($field_id =="hazardous_activities") $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Thrills");
1675 if ($field_id =="recreational_drugs") $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Drug Use");
1678 // Drag in Marital status and Employment history to this Social Hx area.
1679 $patient = getPatientData($pid, "*");
1680 $PMSFH['SOCH']['marital_status']['short_title']=xlt("Marital");
1681 $PMSFH['SOCH']['marital_status']['display']=text($patient['status']);
1682 $PMSFH['SOCH']['occupation']['short_title']=xlt("Occupation");
1683 $PMSFH['SOCH']['occupation']['display']=text($patient['occupation']);
1686 // Build the FH portion of $PMSFH,$PMSFH['FH']
1687 // history_mother history_father history_siblings history_offspring history_spouse
1688 // relatives_cancer relatives_tuberculosis relatives_diabetes relatives_high_blood_pressure relatives_heart_problems relatives_stroke relatives_epilepsy relatives_mental_illness relatives_suicide
1689 // There are two ways FH is stored in the history area, one on a specific relationship basis
1690 // ie. parent,sibling, offspring has X, or the other by "relatives_disease" basis.
1691 // Hmmm, neither really meets our needs. This is an eye form; we do a focused family history.
1692 // Cataracts, glaucoma, AMD, RD, cancer, heart disease etc.
1693 // The openEMR people who want to adapt this for another specialty will no doubt
1694 // have different diseases they want listed in the FH specifically. We all need to be able to
1695 // adjust the form. Perhaps we should use the UserDefined fields at the end of this history_data table?
1696 // Question 1. is, does anything use this family history data - any higher function like reporting?
1697 // Also 2., if there is an engine to validate level of exam, how do we tell it that this was completed?
1698 // First we would need to know the criteria this engine looks for and I don't think in reality there is anything
1699 // written yet that does validate exams for coding level, so maybe we should create a flag in the user defined area of the history_data
1700 // table to notate that the FH portion of the exam was completed? TBD.
1702 Cancer: Tuberculosis:
1703 Diabetes: High Blood Pressure:
1704 Heart Problems: Stroke:
1705 Epilepsy: Mental Illness:
1706 Suicide:
1708 $group_fields_query = sqlStatement("SELECT * FROM layout_options " .
1709 "WHERE form_id = 'HIS' AND group_name = '3Relatives' AND uor > 0 " .
1710 "ORDER BY seq");
1711 while ($group_fields = sqlFetchArray($group_fields_query)) {
1712 $titlecols = $group_fields['titlecols'];
1713 $datacols = $group_fields['datacols'];
1714 $data_type = $group_fields['data_type'];
1715 $field_id = $group_fields['field_id'];
1716 $list_id = $group_fields['list_id'];
1717 $currvalue = '';
1718 if ((preg_match("/^\|?0\|?\|?/", $result1[$field_id]))|| ($result1[$field_id]=='')) {
1719 continue;
1720 } else {
1721 $currvalue = $result1[$field_id];
1723 $PMSFH['FH'][$field_id]['resnote'] = nl2br(htmlspecialchars($currvalue,ENT_NOQUOTES));
1724 if ($PMSFH['FH'][$field_id]['resnote'] > '') {
1725 $PMSFH['FH'][$field_id]['display'] = substr($PMSFH['FH'][$field_id]['resnote'],0,100);
1726 } elseif ($PMSFH['FH'][$field_id]['restype']) {
1727 $PMSFH['FH'][$field_id]['display'] = str_replace($field_id,'',$PMSFH['FH'][$field_id]['restype']);
1728 } else {
1729 $PMSFH['FH'][$field_id]['display'] = xlt("denies");
1731 //coffee,tobacco,alcohol,sleep_patterns,exercise_patterns,seatbelt_use,counseling,hazardous_activities,recreational_drugs
1732 if ($field_id =="relatives_cancer") $PMSFH['FH'][$field_id]['short_title'] = xlt("Cancer");
1733 if ($field_id =="relatives_diabetes") $PMSFH['FH'][$field_id]['short_title'] = xlt("Diabetes");
1734 if ($field_id =="relatives_high_blood_pressure") $PMSFH['FH'][$field_id]['short_title'] = xlt("HTN");
1735 if ($field_id =="relatives_heart_problems") $PMSFH['FH'][$field_id]['short_title'] = xlt("Cor Disease");
1736 if ($field_id =="relatives_epilepsy") $PMSFH['FH'][$field_id]['short_title'] = xlt("Epilepsy");
1737 if ($field_id =="relatives_mental_illness") $PMSFH['FH'][$field_id]['short_title'] = xlt("Psych");
1738 if ($field_id =="relatives_suicide") $PMSFH['FH'][$field_id]['short_title'] = xlt("Suicide");
1739 if ($field_id =="relatives_stroke") $PMSFH['FH'][$field_id]['short_title'] = xlt("Stroke");
1740 if ($field_id =="relatives_tuberculosis") $PMSFH['FH'][$field_id]['short_title'] = xlt("TB");
1742 // Now make some of our own using the usertext11-30 fields
1743 // These can be customized for specialties but remember this is just an array,
1744 // you will need to check the code re: how it is displayed elsewhere...
1745 // For now, just changing the short_titles will display intelligently
1746 // but it is best to change both in the long run.
1747 // $PMSFH['FH']['my_term']['display'] = (substr($result1['usertext11'],0,10));
1748 // $PMSFH['FH']['my_term']['short_title'] = xlt("My Term");
1750 $PMSFH['FH']['glaucoma']['display'] = (substr($result1['usertext11'],0,100));
1751 $PMSFH['FH']['glaucoma']['short_title'] = xlt("Glaucoma");
1752 $PMSFH['FH']['cataract']['display'] = (substr($result1['usertext12'],0,100));
1753 $PMSFH['FH']['cataract']['short_title'] = xlt("Cataract");
1754 $PMSFH['FH']['amd']['display'] = (substr($result1['usertext13'],0,100));
1755 $PMSFH['FH']['amd']['short_title'] = xlt("AMD{{Age-related Macular Degeneration}}");
1756 $PMSFH['FH']['RD']['display'] = (substr($result1['usertext14'],0,100));
1757 $PMSFH['FH']['RD']['short_title'] = xlt("RD{{Retinal detachment}}");
1758 $PMSFH['FH']['blindness']['display'] = (substr($result1['usertext15'],0,100));
1759 $PMSFH['FH']['blindness']['short_title'] = xlt("Blindness");
1760 $PMSFH['FH']['amblyopia']['display'] = (substr($result1['usertext16'],0,100));
1761 $PMSFH['FH']['amblyopia']['short_title'] = xlt("Amblyopia");
1762 $PMSFH['FH']['strabismus']['display'] = (substr($result1['usertext17'],0,100));
1763 $PMSFH['FH']['strabismus']['short_title'] = xlt("Strabismus");
1764 $PMSFH['FH']['other']['display'] = (substr($result1['usertext18'],0,100));
1765 $PMSFH['FH']['other']['short_title'] = xlt("Other");
1767 // Thinking this might be a good place to put in last_retinal exam and last_HbA1C?
1768 // I don't know enough about the reporting parameters - it is probably some alreay in openEMR?
1769 // Pull it in if it is and put it where?
1770 // $PMSFH['SOCH'][$field_id]['resnote'] = nl2br(htmlspecialchars($currvalue,ENT_NOQUOTES));
1772 // Build ROS into $PMSFH['ROS'] also for this patient.
1773 // ROS is not static and is directly linked to each encounter
1774 // True it could be a separate table, but it is currently in form_eye_mag for each visit
1775 // To use this for any other forms, we should consider making this its own separate table with id,pid and ?encounter link,
1776 // just like we are doing for Impression Plan. Mybe we can piggybak onto one of the ROS tables already in OpenEMR?
1778 //define the ROS area to include = $given
1779 $given="ROSGENERAL,ROSHEENT,ROSCV,ROSPULM,ROSGI,ROSGU,ROSDERM,ROSNEURO,ROSPSYCH,ROSMUSCULO,ROSIMMUNO,ROSENDOCRINE";
1780 $ROS_table = "form_eye_mag";
1781 $query="SELECT $given from ". $ROS_table ." where id=? and pid=?";
1783 $ROS = sqlStatement($query,array($form_id,$pid));
1784 while ($row = sqlFetchArray($ROS)) {
1785 foreach (explode(',',$given) as $item) {
1786 $PMSFH['ROS'][$item]['display']= $row[$item];
1789 // translator will need to translate each item in $given
1790 $PMSFH['ROS']['ROSGENERAL']['short_title']=xlt("GEN{{General}}");
1791 $PMSFH['ROS']['ROSHEENT']['short_title']=xlt("HEENT");
1792 $PMSFH['ROS']['ROSCV']['short_title']=xlt("CV{{Cardiovascular}}");
1793 $PMSFH['ROS']['ROSPULM']['short_title']=xlt("PULM{{Pulmonary}}");
1794 $PMSFH['ROS']['ROSGI']['short_title']=xlt("GI{{Gastrointestinal}}");
1795 $PMSFH['ROS']['ROSGU']['short_title']=xlt("GU{{Genitourinary}}");
1796 $PMSFH['ROS']['ROSDERM']['short_title']=xlt("DERM{{Dermatology}}");
1797 $PMSFH['ROS']['ROSNEURO']['short_title']=xlt("NEURO{{Neurology}}");
1798 $PMSFH['ROS']['ROSPSYCH']['short_title']=xlt("PSYCH{{Psychiatry}}");
1799 $PMSFH['ROS']['ROSMUSCULO']['short_title']=xlt("ORTHO{{Orthopedics}}");
1800 $PMSFH['ROS']['ROSIMMUNO']['short_title']=xlt("IMMUNO{{Immunology/Rheumatology}}");
1801 $PMSFH['ROS']['ROSENDOCRINE']['short_title']=xlt("ENDO{{Endocrine}}");
1803 $PMSFH['ROS']['ROSGENERAL']['title']=xlt("General");
1804 $PMSFH['ROS']['ROSHEENT']['title']=xlt("HEENT");
1805 $PMSFH['ROS']['ROSCV']['title']=xlt("Cardiovascular");
1806 $PMSFH['ROS']['ROSPULM']['title']=xlt("Pulmonary");
1807 $PMSFH['ROS']['ROSGI']['title']=xlt("GI");
1808 $PMSFH['ROS']['ROSGU']['title']=xlt("GU");
1809 $PMSFH['ROS']['ROSDERM']['title']=xlt("Dermatology");
1810 $PMSFH['ROS']['ROSNEURO']['title']=xlt("Neurology");
1811 $PMSFH['ROS']['ROSPSYCH']['title']=xlt("Pyschiatry");
1812 $PMSFH['ROS']['ROSMUSCULO']['title']=xlt("Musculoskeletal");
1813 $PMSFH['ROS']['ROSIMMUNO']['title']=xlt("Immune System");
1814 $PMSFH['ROS']['ROSENDOCRINE']['title']=xlt("Endocrine");
1816 return array($PMSFH); //yowsah!
1819 * This function uses the complete PMSFH array for a given patient, including the ROS for this encounter
1820 * and returns the PMSFH display square.
1821 * @param integer rows is the number of rows you want to display
1822 * @param option string view defaults to white on beige, versus right sliding panel (text on beige only).
1823 * @param option string min_height to set min height for the row
1824 * @return $display_PMSFH HTML pane when PMSFH is expanded to two panes.
1826 function display_PMSFH($rows,$view="pending",$min_height="min-height:344px;") {
1827 global $PMSFH;
1828 global $pid;
1829 global $PMSFH_titles;
1830 if (!$PMFSH) $PMSFH = build_PMSFH($pid);
1831 ob_start();
1832 // There are two rows in our PMH section, only one in the side panel.
1833 // If you want it across the bottom in a panel with 8 rows? Or other wise?
1834 // This should be able to handle that too.
1836 // We are building the PMSFH panel.
1837 // Let's put half in each of the 2 rows... or try to at least.
1838 // Find out the number of items present now and put half in each column.
1839 foreach ($PMSFH[0] as $key => $value) {
1840 $total_PMSFH += count($PMSFH[0][$key]);
1841 $total_PMSFH += 2; //add two for the title and a space
1842 $count[$key] = count($PMSFH[0][$key]) + 1;
1844 //SOCH, FH and ROS are listed in $PMSFH even if negative, only count positives
1845 foreach($PMSFH[0]['ROS'] as $key => $value) {
1846 if ($value['display'] =='') {
1847 $total_PMSFH--;
1848 $count['ROS']--;
1851 foreach($PMSFH[0]['FH'] as $key => $value) {
1852 if ($value['display'] =='') {
1853 $total_PMSFH--;
1854 $count['FH']--;
1857 foreach($PMSFH[0]['SOCH'] as $key => $value) {
1858 if (($value['display'] =='') || ($item['display'] == 'not_applicable')) {
1859 $total_PMSFH--;
1860 $count['SOCH']--;
1863 $counter = "0";
1864 $column_max = round($total_PMSFH/$rows);
1865 if ($column_max < "18") $column_max ='18';
1866 $open_table = "<table class='PMSFH_table'><tr><td>";
1867 $close_table = "</td></tr></table>";
1868 // $div is used when $counter reaches $column_max and a new row is needed.
1869 // It is used only if $row_count <= $rows, ie. $rows -1 times.
1870 $div = '</div>
1871 <div id="PMSFH_block_2" name="PMSFH_block_2" class="QP_block_outer borderShadow text_clinical" style="'.attr($min_height).'">';
1873 echo $header = '
1874 <div id="PMSFH_block_1" name="PMSFH_block_1" class="QP_block borderShadow text_clinical" style="'.attr($min_height).';">
1876 $row_count=1;
1878 foreach ($PMSFH[0] as $key => $value) {
1879 if ($key == "FH" || $key == "SOCH" || $key == "ROS") {
1880 // We are going to build SocHx, FH and ROS separately below since they are different..
1881 continue;
1883 $table='';
1884 $header='';
1885 $header .=' <table class="PMSFH_header">
1886 <tr>
1887 <td width="90%">
1888 <span class="left" style="font-weight:800;font-size:0.9em;">'.xlt($key).'</span>
1889 </td>
1890 <td>
1891 <span class="right btn-sm" href="#PMH_anchor" onclick="alter_issue2(\'0\',\''.attr($key).'\',\'0\');" style="text-align:right;font-size:8px;">'. xlt("New") .'</span>
1892 </td>
1893 </tr>
1894 </table>
1897 if ($PMSFH[0][$key] > "") {
1898 $index=0;
1899 foreach ($PMSFH[0][$key] as $item) {
1900 if ($key == "Allergy") {
1901 if ($item['reaction']) { $reaction = " (".text($item['reaction']).")";} else { $reaction =""; }
1902 $red = "style='color:red;'";
1903 } else { $red =''; }
1904 $table .= "<span $red name='QP_PMH_".$item['rowid']."' href='#PMH_anchor' id='QP_PMH_".$item['rowid']."'
1905 onclick=\"alter_issue2('".attr($item['rowid'])."','".attr($key)."','".attr($index)."');\">".text($item['title']).$reaction."</span><br />";
1906 $index++;
1908 } else {
1909 if ($key == "Allergy") {
1910 $table .= xlt("NKDA{{No known drug allergies}}");
1911 } else {
1912 $table .= xlt("None");
1914 $counter++;
1916 $display_PMSFH[$key] = $header.$open_table.$table.$close_table;
1918 echo $display_PMSFH['POH'];
1919 $count = $count['POH'] + $count['PMH'] + 4;
1920 if ($count >= $column_max) echo $div.$header1;
1921 echo $display_PMSFH['POS'];
1922 $count = $count + $count['POS'] + 4;
1923 if ($count >= $column_max) echo $div.$header1;
1924 echo $display_PMSFH['PMH'];
1925 $count = $count + $count['Surgery'] + 4;
1926 if (($count >= $column_max) && ($row_count < $rows)) { echo $div; $count=0; $row_count =2;}
1927 echo $display_PMSFH['Surgery'];
1929 $count = $count + $count['Medication'] + 4;
1930 if (($count >= $column_max) && ($row_count < $rows)) { echo $div; $count=0; $row_count =2;}
1931 echo $display_PMSFH['Medication'];
1933 $count = $count + $count['Allergy'] + 4;
1934 if (($count >= $column_max) && ($row_count < $rows)) { echo $div; $count=0; $row_count =2;}
1935 echo $display_PMSFH['Allergy'];
1937 $count = $count + $count['FH'] + 4;
1938 if (($count >= $column_max) && ($row_count < $rows)) { echo $div; $count=0; $row_count =2;}
1940 <table style="width:1.6in;">
1941 <tr>
1942 <td width="90%">
1943 <span class="left" style="font-weight:800;font-size:0.9em;"><?php echo xlt("FH{{Family History}}"); ?></span>
1944 </td>
1945 <td >
1946 <span class="right btn-sm" href="#PMH_anchor" onclick="alter_issue2('0','FH','');" style="text-align:right;font-size:8px;"><?php echo xlt("New"); ?></span>
1947 </td>
1948 </tr>
1949 </table>
1950 <?php
1951 echo $open_table;
1952 $mentions_FH='';
1953 if (count($PMSFH[0]['FH']) > 0) {
1955 foreach ($PMSFH[0]['FH'] as $item) {
1956 if (($counter > $column_max) && ($row_count < $rows)) {echo $close_table.$div.$open_table; $counter="0";$row_count++;}
1957 if ($item['display'] > '') {
1958 $counter++;
1959 echo "<span name='QP_PMH_".$item['rowid']."' href='#PMH_anchor' id='QP_PMH_".$item['rowid']."'
1960 onclick=\"alter_issue2('0','FH','');\">".xlt($item['short_title']).": ".text($item['display'])."</span><br />";
1961 $mentions_FH++;
1965 if ($mentions_FH < '1') {
1967 <span href="#PMH_anchor"
1968 onclick="alter_issue2('0','FH','');" style="text-align:right;"><?php echo xlt("Negative"); ?></span><br />
1969 <?php
1970 $counter = $counter+3;
1972 echo $close_table;
1974 $count = $count + $count['SOCH'] + 4;
1975 if (($count > $column_max) && ($row_count < $rows)) { echo $div; $count=0; $row_count =2;}
1978 <table style="width:1.6in;">
1979 <tr>
1980 <td width="90%">
1981 <span class="left" style="font-weight:800;font-size:0.9em;"><?php echo xlt("Social"); ?></span>
1982 </td>
1983 <td >
1984 <span class="right btn-sm" href="#PMH_anchor" onclick="alter_issue2('0','SOCH','');" style="text-align:right;font-size:8px;"><?php echo xlt("New"); ?></span>
1985 </td>
1986 </tr>
1987 </table>
1988 <?php
1989 echo $open_table;
1990 foreach ($PMSFH[0]['SOCH'] as $item) {
1991 if (($counter > $column_max) && ($row_count < $rows)) {echo $close_table.$div.$open_table; $counter="0";$row_count++;}
1993 if (($item['display'] > '') && ($item['display'] != 'not_applicable')) {
1994 echo "<span name='QP_PMH_".$item['rowid']."' href='#PMH_anchor' id='QP_PMH_".$item['rowid']."'
1995 onclick=\"alter_issue2('0','SOCH','');\">".xlt($item['short_title']).": ".text($item['display'])."</span><br />";
1996 $counter++;
1997 $mentions_SOCH++;
2000 if (!$mentions_SOCH) {
2002 <span href="#PMH_anchor"
2003 onclick="alter_issue2('0','SOCH','');" style="text-align:right;"><?php echo xlt("Not documented"); ?></span><br />
2004 <?php
2005 $counter=$counter+2;
2008 echo $close_table;
2010 $count = $count + $count['ROS'] + 4;
2011 if (($count > $column_max) && ($row_count < $rows)) { echo $div; $count=0; $row_count =2;}
2015 <table style="width:1.6in;">
2016 <tr>
2017 <td width="90%">
2018 <span class="left" style="font-weight:800;font-size:0.9em;"><?php echo xlt("ROS{{Review of Systems}}"); ?></span>
2019 </td>
2020 <td >
2021 <span class="right btn-sm" href="#PMH_anchor" onclick="alter_issue2('0','ROS','');" style="text-align:right;font-size:8px;"><?php echo xlt("New"); ?></span>
2022 </td>
2023 </tr>
2024 </table>
2025 <?php
2026 echo $open_table;
2027 foreach ($PMSFH[0]['ROS'] as $item) {
2028 if ($item['display'] > '') {
2029 if (($counter > $column_max)&& ($row_count < $rows)) {echo $close_table.$div.$open_table; $counter="0";$row_count++;}
2031 //xlt($item['short_title']) - for a list of short_titles, see the predefined ROS categories
2032 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2033 onclick=\"alter_issue2('0','ROS','');\">".xlt($item['short_title']).": ".text($item['display'])."</span><br />";
2034 $mention++;
2035 $counter++;
2038 if ($mention < 1) {
2039 echo xlt("Negative") ."<br />";
2040 $counter=$counter++;
2042 echo $close_table;
2044 </div>
2045 <?php
2046 $PMH_panel = ob_get_contents();
2047 ob_end_clean();
2048 return $PMH_panel;
2052 * This function uses the complete PMSFH array for a given patient, including the ROS for this encounter
2053 * and returns the PMSFH/ROS sliding Right Panel
2055 * @param array $PMSFH
2056 * @return $right_panel html
2058 function show_PMSFH_panel($PMSFH,$columns='1') {
2059 ob_start();
2060 echo '<div style="font-size:1.2em;padding:25 2 2 5;z-index:1;">
2061 <div>';
2063 //<!-- POH -->
2064 echo "<br /><span class='panel_title' title='".xla('Past Ocular History')."'>".xlt("POH{{Past Oculoar History}}").":</span>";
2066 <span class="top-right btn-sm" href="#PMH_anchor"
2067 onclick="alter_issue2('0','POH','');"
2068 style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2069 <br />
2070 <?php
2071 if ($PMSFH[0]['POH'] > "") {
2072 $i=0;
2073 foreach ($PMSFH[0]['POH'] as $item) {
2074 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2075 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','POH','$i');\">".text($item['title'])."</span><br />";
2076 $i++;
2078 } else { ?>
2079 <span href="#PMH_anchor"
2080 onclick="alter_issue2('0','POH','');" style="text-align:right;"><?php echo xlt("None"); ?><br /></span>
2081 <?php
2083 //<!-- POS -->
2084 echo "<br /><span class='panel_title' title='".xla('Past Ocular Surgery')."'>".xlt("POS{{Past Ocular Surgery}}").":</span>";
2086 <span class="top-right btn-sm" href="#PMH_anchor"
2087 onclick="alter_issue2('0','POS','');"
2088 style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2089 <br />
2090 <?php
2091 if ($PMSFH[0]['POS'] > "") {
2092 $i=0;
2093 foreach ($PMSFH[0]['POS'] as $item) {
2094 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2095 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','POS','$i');\">".text($item['title'])."</span><br />";
2096 $i++;
2098 } else { ?>
2099 <span href="#PMH_anchor"
2100 onclick="alter_issue2('0','POS','');" style="text-align:right;"><?php echo xlt("None"); ?><br /></span>
2101 <?php
2103 //<!-- PMH -->
2104 echo "<br /> <span class='panel_title' title='".xla('Past Medical History')."'>".xlt("PMH{{Past Medical History}}").":</span>";
2105 ?><span class="top-right btn-sm" href="#PMH_anchor"
2106 onclick="alter_issue2('0','PMH','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2107 <br />
2108 <?php
2109 if ($PMSFH[0]['PMH'] > "") {
2110 $i=0;
2111 foreach ($PMSFH[0]['PMH'] as $item) {
2112 if ($item['enddate'] !==" ") {
2113 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2114 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','PMH','$i');\">".text($item['title'])."</span><br />";
2115 $i++;
2118 } else { ?>
2119 <span href="#PMH_anchor"
2120 onclick="alter_issue2('0','PMH','');" style="text-align:right;"><?php echo xlt("None"); ?></br></span>
2121 <?php
2124 //<!-- Surgeries -->
2125 echo "<br /><span class='panel_title' title='".xlt("Past Surgical History")."'>".xlt("Surgery").":</span>";
2126 ?><span class="top-right btn-sm" href="#PMH_anchor"
2127 onclick="alter_issue2('0','Surgery','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2128 <br />
2129 <?php
2130 if ($PMSFH[0]['Surgery'] > "") {
2131 $i=0;
2132 foreach ($PMSFH[0]['Surgery'] as $item) {
2133 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2134 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','Surgery','$i');\">".text($item['title'])."<br /></span>";
2135 $i++;
2137 } else { ?>
2138 <span href="#PMH_anchor"
2139 onclick="alter_issue2('0','Surgery','');" style="text-align:right;"><?php echo xlt("None"); ?><br /></span>
2140 <?php
2143 //<!-- Meds -->
2144 echo "<br /><span class='panel_title' title='".xlt("Medications")."'>".xlt("Medication").":</span>";
2145 ?><span class="top-right btn-sm" href="#PMH_anchor"
2146 onclick="alter_issue2('0','Medication','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2147 <br />
2148 <?php
2149 if ($PMSFH[0]['Medication'] > "") {
2150 $i=0;
2151 foreach ($PMSFH[0]['Medication'] as $item) {
2152 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2153 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','Medication','$i');\">".text($item['title'])."</span><br />";
2154 $i++;
2156 } else { ?>
2157 <span href="#PMH_anchor"
2158 onclick="alter_issue2('0','Medication','');" style="text-align:right;"><?php echo xlt("None"); ?><br /></span>
2159 <?php
2163 //<!-- Allergies -->
2164 echo "<br /><span class='panel_title' title='".xlt("Allergies")."'>".xlt("Allergy").":</span>";
2165 ?><span class="top-right btn-sm" href="#PMH_anchor"
2166 onclick="alter_issue2('0','Allergy','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2167 <br />
2168 <?php
2169 if ($PMSFH[0]['Allergy'] > "") {
2170 $i=0;
2171 foreach ($PMSFH[0]['Allergy'] as $item) {
2172 if ($item['reaction']) {
2173 $reaction = "(".text($item['reaction']).")";
2174 } else { $reaction =""; }
2175 echo "<span ok style='color:red;' name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2176 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','Allergy','$i');\">".text($item['title'])." ".$reaction."</span><br />";
2177 $i++;
2179 } else { ?>
2180 <span href="#PMH_anchor"
2181 onclick="alter_issue2('0','Allergy','');" style="text-align:right;"><?php echo xlt("NKDA{{No Known Drug Allergies}}"); ?><br /></span>
2182 <?php
2185 //<!-- Social History -->
2186 echo "<br /><span class='panel_title' title='".xlt("Social History")."'>".xlt('Soc Hx{{Social History}}').":</span>";
2187 ?><span class="top-right btn-sm" href="#PMH_anchor"
2188 onclick="alter_issue2('0','SOCH','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?>
2189 </span><br />
2190 <?php
2191 foreach ($PMSFH[0]['SOCH'] as $k => $item) {
2192 if (($item['display']) && ($item['display'] != 'not_applicable')) {
2193 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2194 onclick=\"alter_issue2('0','SOCH','');\">".xlt($item['short_title']).": ".text($item['display'])."<br /></span>";
2196 $mention_SOCH++;
2199 if (!$mention_SOCH) {
2201 <span href="#PMH_anchor"
2202 onclick="alter_issue2('0','SOCH','');" style="text-align:right;"><?php echo xlt("Negative"); ?><br /></span>
2203 <?php }
2205 //<!-- Family History -->
2206 echo "<br /><span class='panel_title' title='".xlt("Family History")."'>".xlt("FH{{Family History}}").":</span>";
2207 ?><span class="top-right btn-sm" href="#PMH_anchor"
2208 onclick="alter_issue2('0','FH','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span><br />
2210 <?php
2211 if (count($PMSFH[0]['FH']) > 0) {
2212 foreach ($PMSFH[0]['FH'] as $item) {
2213 if ($item['display'] > '') {
2214 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2215 onclick=\"alter_issue2('0','FH','');\">".xlt($item['short_title']).": ".text($item['display'])."<br /></span>";
2216 $mention_FH++;
2220 if (!$mention_FH) {
2222 <span href="#PMH_anchor"
2223 onclick="alter_issue2('0','FH','');" style="text-align:right;"><?php echo xlt("Negative"); ?><br /></span>
2224 <?php
2226 echo "<br /><span class='panel_title' title='".xlt("Review of System")."'>".xlt("ROS{{Review of Systems}}").":</span>";
2227 ?><span class="top-right btn-sm" href="#PMH_anchor"
2228 onclick="alter_issue('0','ROS','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2229 <br />
2230 <?php
2231 foreach ($PMSFH[0]['ROS'] as $item) {
2232 if ($item['display']) {
2233 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2234 onclick=\"alter_issue2('0','ROS','');\">".text($item['short_title']).": ".text($item['display'])."</span><br />";
2235 $mention_ROS++;
2239 if (!$mention_ROS) { ?>
2240 <span href="#PMH_anchor"
2241 onclick="alter_issue2('0','ROS','');" style="text-align:right;"><?php echo xlt('Negative'); ?><br /></span>
2242 <?php
2244 echo "<br /><br /><br />";
2245 $right_panel = ob_get_contents();
2247 ob_end_clean();
2248 return $right_panel;
2252 * This function displays via echo the PMSFH/ROS in the report
2254 * @param array $PMSFH
2257 function show_PMSFH_report($PMSFH) {
2258 global $pid;
2259 global $ISSUE_TYPES;
2261 //4 panels
2262 $rows = '4';
2263 if (!$PMFSH) $PMSFH = build_PMSFH($pid);
2264 // Find out the number of items present now and put 1/4 in each column.
2265 foreach ($PMSFH[0] as $key => $value) {
2266 $total_PMSFH += count($PMSFH[0][$key]);
2267 $total_PMSFH += 2; //add two for the title and a space
2268 $count[$key] = count($PMSFH[0][$key]) + 1;
2270 //SOCH, FH and ROS are listed in $PMSFH even if negative, only count positives
2271 foreach($PMSFH[0]['ROS'] as $key => $value) {
2272 if ($value['display'] =='') {
2273 $total_PMSFH--;
2274 $count['ROS']--;
2277 foreach($PMSFH[0]['FH'] as $key => $value) {
2278 if ($value['display'] =='') {
2279 $total_PMSFH--;
2280 $count['FH']--;
2283 foreach($PMSFH[0]['SOCH'] as $key => $value) {
2284 if (($value['display'] =='') || ($value['display'] == 'not_applicable')) {
2285 $total_PMSFH--;
2286 $count['SOCH']--;
2289 $counter = "0";
2290 $column_max = round($total_PMSFH/$rows) ;
2291 $panel_size = round($total_PMSFH/$rows) ;
2293 //<!-- POH -->
2294 $counter++;
2295 $counter++;
2296 echo "<table style='width:700px;'><tr><td style='vertical-align:top;width:150px;' class='show_report'><br /><b>".xlt("POH").":</b>";
2297 //note the HTML2PDF does not like <span style="font-weight:bold;"></span> so we are using the deprecated <b></b>
2299 <br />
2300 <?php
2301 if ($PMSFH[0]['POH'] > "") {
2302 foreach ($PMSFH[0]['POH'] as $item) {
2303 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2304 $counter++;
2306 } else {
2307 echo xlt("None")."<br />";
2310 if (($counter + $count['POS']) > $panel_size) { echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>"; $counter ="0"; }
2311 $counter++;
2312 $counter++;
2313 //<!-- PMH -->
2314 echo "<br /><b>".xlt("Eye Surgery").":</b>";
2316 <br />
2317 <?php
2318 if ($PMSFH[0]['POS'] > "") {
2319 foreach ($PMSFH[0]['POS'] as $item) {
2320 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2321 $counter++;
2323 } else {
2324 echo xlt("None")."<br />";
2327 if (($counter + $count['PMH']) > $panel_size) { echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>"; $counter ="0"; }
2328 $counter++;
2329 $counter++;
2330 //<!-- PMH -->
2331 echo "<br /><b>".xlt("PMH").":</b>";
2333 <br />
2334 <?php
2335 if ($PMSFH[0]['PMH'] > "") {
2336 foreach ($PMSFH[0]['PMH'] as $item) {
2337 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2338 $counter++;
2340 } else {
2341 echo xlt("None")."<br />";
2345 if ($counter + $count['Medication'] > $panel_size) { echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>"; $counter ="0"; }
2346 $counter++;
2347 $counter++;
2348 //<!-- Meds -->
2349 echo "<br /><b>".xlt("Medication").":</b>";
2351 <br />
2352 <?php
2353 if ($PMSFH[0]['Medication'] > "") {
2354 foreach ($PMSFH[0]['Medication'] as $item) {
2355 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2356 $counter++;
2358 } else {
2359 echo xlt("None")."<br />";
2362 if ($counter + $count['Surgery'] > $panel_size) { echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>"; $counter ="0"; }
2363 //<!-- Surgeries -->
2364 $counter++;
2365 $counter++;
2366 echo "<br /><b>".xlt("Surgery").":</b>";
2367 ?><br />
2368 <?php
2369 if ($PMSFH[0]['Surgery'] > "") {
2370 foreach ($PMSFH[0]['Surgery'] as $item) {
2371 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2372 $counter++;
2374 } else {
2375 echo xlt("None")."<br />";
2378 if ($counter + $count['Allergy'] > $panel_size) { echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>"; $counter ="0"; }
2379 $counter++;
2380 $counter++;
2381 //<!-- Allergies -->
2382 echo "<br /><b>".xlt("Allergy").":</b>";
2384 <br />
2385 <?php
2386 if ($PMSFH[0]['Allergy'] > "") {
2387 foreach ($PMSFH[0]['Allergy'] as $item) {
2388 echo text($item['title'])."<br />";
2389 $counter++;
2391 } else {
2392 echo xlt("NKDA")."<br />";
2395 if ($counter + $count['SOCH'] > $panel_size) { echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>"; $counter ="0"; }
2396 $counter++;
2397 $counter++;
2398 //<!-- SocHx -->
2399 echo "<br /><b>".xlt("Soc Hx{{Social History}}").":</b>";
2401 <br />
2402 <?php
2403 foreach ($PMSFH[0]['SOCH'] as $k => $item) {
2404 if (($item['display']) && ($item['display'] != 'not_applicable')) {
2405 echo xlt($item['short_title']).": ".text($item['display'])."<br />";
2406 $mention_PSOCH++;
2407 $counter++;
2410 if (!$mention_PSOCH) {
2411 echo xlt("Negative")."<br />";
2414 if (($counter + $count['FH']) > $panel_size) { echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>"; $counter ="0"; }
2415 $counter++;
2416 $counter++;
2417 //<!-- FH -->
2418 echo "<br /><b>".xlt("FH{{Family History}}").":</b>";
2420 <br />
2421 <?php
2422 foreach ($PMSFH[0]['FH'] as $item) {
2423 if ($item['display']) {
2424 echo xlt($item['short_title']).": ".text($item['display'])."<br />";
2425 $mention_FH++;
2426 $counter++;
2429 if (!$mention_FH) {
2430 echo xlt("Negative")."<br />";
2433 if (($counter!=="0") && (($counter + $count['ROS']) > $panel_size)) { echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>"; $counter ="0"; }
2434 $counter++;
2435 $counter++;
2436 //<!-- ROS -->
2437 echo "<br /><b>".xlt("ROS{{Review of Systems}}").":</b>";
2438 ?><br />
2439 <?php
2440 foreach ($PMSFH[0]['ROS'] as $item) {
2441 if ($item['display']) {
2442 echo xlt($item['short_title']).": ".$item['display']."<br />";
2443 $mention_ROS++;
2444 $counter++;
2447 if ($mention_ROS < '1') {
2448 echo xlt("Negative");
2450 echo "</td></tr></table>";
2454 * This function returns the Provider-specific Quick Pick selections for a zone (2 input values)
2456 * These selctions are draw from an openEMR list, Eye_QP_$zone_$providerID.
2457 * This list is created from Eye_QP_$zone_defaults when a new provider opens the form.
2458 * Because it is a "list", the end-user can modify it.
2459 * A link to the list "the pencil icon" is provided to allow customization - displayed in RTop frame.
2460 * If frames are ever removed, this will need to be reworked.
2462 * @param string $zone options EXT,ANTSEG,RETINA,NEURO
2463 * @param string $providerID
2464 * @return QP text : when called directly outputs the ZONE specific HTML5 CANVAS widget
2466 function display_QP($zone,$providerID){
2467 global $prov_data;
2468 if (!$zone || !$providerID) return;
2469 ob_start();
2470 $query = "SELECT * FROM list_options where list_id =? ORDER BY seq";
2471 $result = sqlStatement($query,array("Eye_QP_".$zone."_$providerID"));
2472 if (sqlNumRows($result) < '1') {
2473 //this provider's list has not been created yet.
2474 $query = "REPLACE INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`) VALUES ('lists', ?, ?, '0', '1', '0')";
2475 sqlStatement($query,array('Eye_QP_'.$zone.'_'.$providerID,'Eye QP List '.$zone.' for '.$prov_data['lname']));
2476 $query = "SELECT * FROM list_options where list_id =? ORDER BY seq";
2477 $result = sqlStatement($query,array("Eye_QP_".$zone."_defaults"));
2478 $SQL_INSERT = "INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `mapping`, `notes`, `codes`, `activity`, `subtype`) VALUES (?,?,?,?,?,?,?,?,?)";
2480 while ($QP= sqlFetchArray($result)) {
2481 if ($SQL_INSERT) sqlStatement($SQL_INSERT, array("Eye_QP_".$zone."_".$providerID,$QP['option_id'],$QP['title'],$QP['seq'],$QP['mapping'],$QP['notes'],$QP['codes'],$QP['activity'],$QP['subtype']));
2482 $here[$QP['title']][$QP['subtype']]['notes'] = $QP['notes']; //the text to fill into form
2483 $here[$QP['title']][$QP['subtype']]['codes'] = $QP['codes']; //the code if attached.
2484 $here[$QP['title']][$QP['subtype']]['mapping'] = $QP['mapping']; //the fieldname without laterality eg CONJ
2485 $here[$QP['title']][$QP['subtype']]['activity'] = $QP['activity']; //1 to replace, 0 to append
2487 foreach ($here as $title => $values) { //start QP section items
2488 $title_show = (strlen($title) > 19) ? substr($title,0,16).'...' : $title;
2489 if (preg_match('/clear field/',$title)) {
2490 $title_show = "<em><strong>$title</strong></em>";
2492 if ($values['OD']) {
2493 if ($values['OD']['activity'] == '0') $action = "ADD";
2494 if ($values['OD']['activity'] == '1') $action = "REPLACE" ;
2495 if ($values['OD']['activity'] == '2') $action = "APPEND" ;
2497 <span>
2498 <a class="underline QP" onclick="fill_QP_field('<?php echo attr($zone); ?>','OD','<?php echo attr($values['OD']['mapping']); ?>','<?php echo attr($values['OD']['notes']); ?>','<?php echo attr($action); ?>');"><?php echo xlt('OD{{right eye}}'); ?></a> |
2499 <a class="underline QP" onclick="fill_QP_field('<?php echo attr($zone); ?>','OS','<?php echo attr($values['OS']['mapping']); ?>','<?php echo attr($values['OS']['notes']); ?>','<?php echo attr($action); ?>');"><?php echo xlt('OS{{left eye}}'); ?></a> |
2500 <a class="underline QP" onclick="fill_QP_2fields('<?php echo attr($zone); ?>','OU','<?php echo attr($values['OU']['mapping']); ?>','<?php echo attr($values['OU']['notes']); ?>','<?php echo attr($action); ?>');"><?php echo xlt('OU{{both eyes}}'); ?></a>
2501 </span>
2502 &nbsp;
2503 <?php
2504 } else if ($values['R']) {
2505 if ($values['R']['activity'] == '0') $action = "ADD";
2506 if ($values['R']['activity'] == '1') $action = "REPLACE" ;
2507 if ($values['R']['activity'] == '2') $action = "APPEND" ;
2509 <span>
2510 <a class="underline QP" onclick="fill_QP_field('<?php echo attr($zone); ?>','R','<?php echo attr($values['R']['mapping']); ?>','<?php echo attr($values['R']['notes']); ?>','<?php echo attr($action); ?>');"><?php echo xlt('R{{right side}}'); ?></a> |
2511 <a class="underline QP" onclick="fill_QP_field('<?php echo attr($zone); ?>','L','<?php echo attr($values['L']['mapping']); ?>','<?php echo attr($values['L']['notes']); ?>','<?php echo attr($action); ?>');"><?php echo xlt('L{{left side}}'); ?></a> |
2512 <a class="underline QP" onclick="fill_QP_2fields('<?php echo attr($zone); ?>','B','<?php echo attr($values['B']['mapping']); ?>','<?php echo attr($values['B']['notes']); ?>','<?php echo attr($action); ?>');"><?php echo xlt('B{{both sides}}'); ?></a>
2513 </span>
2514 &nbsp;
2515 <?php
2517 echo $title_show;
2518 $number_rows++;
2519 ?><br />
2520 <?php
2521 if ($number_rows==19) { ?>
2522 </div>
2523 <div class="QP_block_outer borderShadow text_clinical" ><?php
2525 if ($number_rows == 38) break;
2526 } //end QP section items
2528 <a href="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_list.php?list_id=Eye_QP_<?php echo attr($zone)."_".attr($providerID); ?>" target="RTop"
2529 title="<?php echo xla('Click here to Edit this Doctor\'s Quick Pick list'); ?>"
2530 name="provider_todo" style="color:black;font-weight:600;"><i class="closeButton pull-right fa fa-pencil fa-fw"></i> </a>
2531 <?php
2532 $QP_panel = ob_get_contents();
2533 ob_end_clean();
2534 return $QP_panel;
2539 * This function returns display the draw/sketch diagram for a zone (4 input values)
2541 * If there is already a drawing for this zone in this encounter, it is pulled from
2542 * from its stored location:
2543 * $GLOBALS['web_root']."/sites/".$_SESSION['site_id']."/".$form_folder."/".$pid."/".$encounter."/".$side."_".$zone."_VIEW.png?".rand();
2545 * Otherwise a "BASE" image is pulled from the images directory of the form... Customizable.
2547 * @param string $zone options ALL,EXT,ANTSEG,RETINA,NEURO
2548 * @param string $visit_date Future functionality to limit result set. UTC DATE Formatted
2549 * @param string $pid value = patient id
2550 * @param string OU by default. Future functionality will allow OD and OS values- not implemented yet.
2551 * @return true : when called directly outputs the ZONE specific HTML5 CANVAS widget
2553 function display_draw_section($zone,$encounter,$pid,$side ='OU',$counter='') {
2554 global $form_folder;
2555 $filepath = $GLOBALS['oer_config']['documents']['repository'] . $pid ."/";
2556 $base_name = $pid."_".$encounter."_".$side."_".$zone."_VIEW";
2557 $file_history = $filepath.$base_name;
2558 $file_store= $file_history.".jpg";
2560 <div id="Draw_<?php echo attr($zone); ?>" name="Draw_<?php echo attr($zone); ?>" style="text-align:center;height: 2.5in;" class="Draw_class canvas">
2561 <span class="fa fa-file-text-o closeButton" id="BUTTON_TEXT_<?php echo attr($zone); ?>" name="BUTTON_TEXT_<?php echo attr($zone); ?>"></span>
2562 <i class="closeButton_2 fa fa-database" id="BUTTON_QP_<?php echo attr($zone); ?>_2" name="BUTTON_QP_<?php echo attr($zone); ?>"></i>
2563 <i class="closeButton_3 fa fa-user-md fa-sm fa-2" name="Shorthand_kb" title="<?php echo xla("Open the Shorthand Window and display Shorthand Codes"); ?>"></i>
2565 <?php
2566 /* This will provide a way to scroll back through prior VISIT images, to copy forward to today's visit,
2567 * just like we do in the text fields.
2568 * Will need to do a lot of thinking to create this. Jist is ajax call to server for image retrieval.
2569 * To get this to work we need a way to select an old image to work from, use current or return to baseline.
2570 * This will require a global BACK button like above (BUTTON_BACK_<?php echo attr($zone); ?>).
2571 * The Undo Redo buttons are currently javascript client side.
2572 * The Undo Redo features will only work for changes made since form was loaded locally.
2574 * If we want to look back at a prior VISITs saved final images,
2575 * we will need to create this logic.
2576 * Need to think about how to display this visually so it's intuitive, without cluttering the page...
2577 * At first glance, using the text PRIORS selection method should work... Not yet.
2579 //$output = priors_select($zone,$orig_id,$id_to_show,$pid); echo $output;
2581 <div class="tools" style="text-align:center;width:100%;text-align:left;margin-left:2em;">
2582 <div id="sketch_tooled_<?php echo attr($zone); ?>_8" style="position: relative;
2583 float: left;
2584 background-image: url(../../forms/eye_mag/images/pencil_white.png);
2585 background-size: 40px 80px;
2586 margin-right:50px;">
2587 <input class="jscolor {mode:'HVS',
2588 position:'right',
2589 borderColor:'#FFF #666 #666 #FFF',
2590 insetColor:'#666 #FFF #FFF #666',
2591 backgroundColor:'#CCC',
2592 hash:'true',
2593 styleElement:'sketch_tool_<?php echo attr($zone); ?>_color',
2594 valueElement: 'selColor_<?php echo attr($zone); ?>',
2595 refine:true
2597 id="sketch_tool_<?php echo attr($zone); ?>_color"
2598 type="text" style="width: 38px;
2599 height: 20px;
2600 padding: 11px 0px;
2601 background-color: blue;
2602 margin-top: 26px;
2603 color: white;
2604 background-image: none;" />
2605 </div>
2606 <?php
2607 $sql = "SELECT * from documents where url like ?";
2608 $doc = sqlQuery($sql,array("%". $base_name ."%"));
2609 $base_filetoshow = $GLOBALS['web_root']."/interface/forms/".$form_folder."/images/".$side."_".$zone."_BASE.jpg";
2611 // random to not pull from cache.
2612 if (file_exists($file_store) && ($doc['id'] > '0')) {
2613 $filetoshow = $GLOBALS['web_root']."/controller.php?document&retrieve&patient_id=".attr($pid)."&document_id=".attr($doc['id'])."&as_file=false&blahblah=".rand();
2614 } else {
2615 //base image.
2616 $filetoshow = $base_filetoshow;
2620 <input type="hidden" id="url_<?php echo attr($zone); ?>" name="url_<?php echo attr($zone); ?>" value="<?php echo $filetoshow; ?>" />
2621 <input type="hidden" id="base_url_<?php echo attr($zone); ?>" name="base_url_<?php echo attr($zone); ?>" value="<?php echo $base_filetoshow; ?>" />
2622 <input type="hidden" id="selWidth_<?php echo attr($zone); ?>" value="1">
2623 <input type="hidden" id="selColor_<?php echo attr($zone); ?>" value="#000" />
2627 <img id="sketch_tools_<?php echo attr($zone); ?>_1" onclick='$("#selColor_<?php echo attr($zone); ?>").val("#1AA2E1");' src="../../forms/<?php echo $form_folder; ?>/images/pencil_blue.png" style="height:30px;width:15px;">
2628 <img id="sketch_tools_<?php echo attr($zone); ?>_2" onclick='$("#selColor_<?php echo attr($zone); ?>").val("#ff0");' src="../../forms/<?php echo $form_folder; ?>/images/pencil_yellow.png" style="height:30px;width:15px;">
2629 <img id="sketch_tools_<?php echo attr($zone); ?>_3" onclick='$("#selColor_<?php echo attr($zone); ?>").val("#ffad00");' src="../../forms/<?php echo $form_folder; ?>/images/pencil_orange.png" style="height:30px;width:15px;">
2630 <img id="sketch_tools_<?php echo attr($zone); ?>_4" onclick='$("#selColor_<?php echo attr($zone); ?>").val("#AC8359");' src="../../forms/<?php echo $form_folder; ?>/images/pencil_brown.png" style="height:30px;width:15px;">
2631 <img id="sketch_tools_<?php echo attr($zone); ?>_5" onclick='$("#selColor_<?php echo attr($zone); ?>").val("#E10A17");' src="../../forms/<?php echo $form_folder; ?>/images/pencil_red.png" style="height:30px;width:15px;">
2632 <img id="sketch_tools_<?php echo attr($zone); ?>_6" onclick='$("#selColor_<?php echo attr($zone); ?>").val("#000");' src="../../forms/<?php echo $form_folder; ?>/images/pencil_black.png" style="height:50px;width:15px;">
2633 <img id="sketch_tools_<?php echo attr($zone); ?>_7" onclick='$("#selColor_<?php echo attr($zone); ?>").val("#fff");' src="../../forms/<?php echo $form_folder; ?>/images/pencil_white.png" style="height:30px;width:15px;">
2635 <span style="min-width:1in;">&nbsp;</span>
2636 <!-- now to pencil size -->
2637 <img id="sketch_sizes_<?php echo attr($zone); ?>_1" onclick='$("#selWidth_<?php echo attr($zone); ?>").val("1");' src="../../forms/<?php echo $form_folder; ?>/images/brush_1.png" style="height:20px;width:20px; border-bottom: 2pt solid black;">
2638 <img id="sketch_sizes_<?php echo attr($zone); ?>_3" onclick='$("#selWidth_<?php echo attr($zone); ?>").val("3");' src="../../forms/<?php echo $form_folder; ?>/images/brush_3.png" style="height:20px;width:20px;">
2639 <img id="sketch_sizes_<?php echo attr($zone); ?>_5" onclick='$("#selWidth_<?php echo attr($zone); ?>").val("5");' src="../../forms/<?php echo $form_folder; ?>/images/brush_5.png" style="height:20px;width:20px;">
2640 <img id="sketch_sizes_<?php echo attr($zone); ?>_10" onclick='$("#selWidth_<?php echo attr($zone); ?>").val("10");' src="../../forms/<?php echo $form_folder; ?>/images/brush_10.png" style="height:20px;width:20px;">
2641 <img id="sketch_sizes_<?php echo attr($zone); ?>_15" onclick='$("#selWidth_<?php echo attr($zone); ?>").val("15");' src="../../forms/<?php echo $form_folder; ?>/images/brush_15.png" style="height:20px;width:20px;">
2642 </div>
2644 <div align="center" class="borderShadow">
2645 <canvas id="myCanvas_<?php echo attr($zone); ?>" name="myCanvas_<?php echo attr($zone); ?>" width="450" height="225"></canvas>
2646 </div>
2647 <div style="margin-top: 7px;">
2648 <button onclick="javascript:cUndo('<?php echo attr($zone); ?>');return false;" id="Undo_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("Undo"); ?></button>
2649 <button onclick="javascript:cRedo('<?php echo attr($zone); ?>');return false;" id="Redo_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("Redo"); ?></button>
2650 <button onclick="javascript:drawImage('<?php echo attr($zone); ?>');return false;" id="Revert_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("Revert"); ?></button>
2651 <button onclick="javascript:cReload('<?php echo attr($zone); ?>');return false;" id="Clear_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("New"); ?></button>
2652 <button id="Blank_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("Blank"); ?></button>
2653 </div>
2654 <br />
2655 </div>
2656 <?php
2660 * This function returns a JSON object to replace a requested section with copy_forward values (3 input values)
2661 * It will not replace the drawings with older encounter drawings... Not yet anyway.
2663 * @param string $zone options ALL,EXT,ANTSEG,RETINA,NEURO, EXT_DRAW, ANTSEG_DRAW, RETINA_DRAW, NEURO_DRAW
2664 * @param string $form_id is the form_eye_mag.id where the data to carry forward is located
2665 * @param string $pid value = patient id
2666 * @return true : when called directly outputs the ZONE specific HTML for a prior record + widget for the desired zone
2668 function copy_forward($zone,$copy_from,$copy_to,$pid) {
2669 global $form_id;
2670 $query="select form_encounter.date as encounter_date,form_eye_mag.* from form_eye_mag ,forms,form_encounter
2671 where
2672 form_encounter.encounter = forms.encounter and
2673 form_eye_mag.id=forms.form_id and
2674 forms.pid =form_eye_mag.pid and
2675 form_eye_mag.pid=?
2676 and form_eye_mag.id =? ";
2678 $objQuery =sqlQuery($query,array($pid,$copy_from));
2679 if ($zone =="EXT") {
2680 $result['RUL']=$objQuery['RUL'];
2681 $result['LUL']=$objQuery['LUL'];
2682 $result['RLL']=$objQuery['RLL'];
2683 $result['LLL']=$objQuery['LLL'];
2684 $result['RBROW']=$objQuery['RBROW'];
2685 $result['LBROW']=$objQuery['LBROW'];
2686 $result['RMCT']=$objQuery['RMCT'];
2687 $result['LMCT']=$objQuery['LMCT'];
2688 $result['RADNEXA']=$objQuery['RADNEXA'];
2689 $result['LADNEXA']=$objQuery['LADNEXA'];
2690 $result['RMRD']=$objQuery['RMRD'];
2691 $result['LMRD']=$objQuery['LMRD'];
2692 $result['RLF']=$objQuery['RLF'];
2693 $result['LLF']=$objQuery['LLF'];
2694 $result['RVFISSURE']=$objQuery['RVFISSURE'];
2695 $result['LVFISSURE']=$objQuery['LVFISSURE'];
2696 $result['RCAROTID']=$objQuery['RCAROTID'];
2697 $result['LCAROTID']=$objQuery['LCAROTID'];
2698 $result['RTEMPART']=$objQuery['RTEMPART'];
2699 $result['LTEMPART']=$objQuery['LTEMPART'];
2700 $result['RCNV']=$objQuery['RCNV'];
2701 $result['LCNV']=$objQuery['LCNV'];
2702 $result['RCNVII']=$objQuery['RCNVII'];
2703 $result['LCNVII']=$objQuery['LCNVII'];
2704 $result['ODSCHIRMER1']=$objQuery['ODSCHIRMER1'];
2705 $result['OSSCHIRMER1']=$objQuery['OSSCHIRMER1'];
2706 $result['ODSCHIRMER2']=$objQuery['ODSCHIRMER2'];
2707 $result['OSSCHIRMER2']=$objQuery['OSSCHIRMER2'];
2708 $result['ODTBUT']=$objQuery['ODTBUT'];
2709 $result['OSTBUT']=$objQuery['OSTBUT'];
2710 $result['OSHERTEL']=$objQuery['OSHERTEL'];
2711 $result['HERTELBASE']=$objQuery['HERTELBASE'];
2712 $result['ODPIC']=$objQuery['ODPIC'];
2713 $result['OSPIC']=$objQuery['OSPIC'];
2714 $result['EXT_COMMENTS']=$objQuery['EXT_COMMENTS'];
2715 $result["json"] = json_encode($result);
2716 echo json_encode($result);
2717 } elseif ($zone =="ANTSEG") {
2718 $result['OSCONJ']=$objQuery['OSCONJ'];
2719 $result['ODCONJ']=$objQuery['ODCONJ'];
2720 $result['ODCORNEA']=$objQuery['ODCORNEA'];
2721 $result['OSCORNEA']=$objQuery['OSCORNEA'];
2722 $result['ODAC']=$objQuery['ODAC'];
2723 $result['OSAC']=$objQuery['OSAC'];
2724 $result['ODLENS']=$objQuery['ODLENS'];
2725 $result['OSLENS']=$objQuery['OSLENS'];
2726 $result['ODIRIS']=$objQuery['ODIRIS'];
2727 $result['OSIRIS']=$objQuery['OSIRIS'];
2728 $result['ODKTHICKNESS']=$objQuery['ODKTHICKNESS'];
2729 $result['OSKTHICKNESS']=$objQuery['OSKTHICKNESS'];
2730 $result['ODGONIO']=$objQuery['ODGONIO'];
2731 $result['OSGONIO']=$objQuery['OSGONIO'];
2732 $result['ODSHRIMER1']=$objQuery['ODSHIRMER1'];
2733 $result['OSSHRIMER1']=$objQuery['OSSHIRMER1'];
2734 $result['ODSHRIMER2']=$objQuery['ODSHIRMER2'];
2735 $result['OSSHRIMER2']=$objQuery['OSSHIRMER2'];
2736 $result['ODTBUT']=$objQuery['ODTBUT'];
2737 $result['OSTBUT']=$objQuery['OSTBUT'];
2738 $result['ANTSEG_COMMENTS']=$objQuery['ANTSEG_COMMENTS'];
2739 $result["json"] = json_encode($result);
2740 echo json_encode($result);
2741 } elseif ($zone =="RETINA") {
2742 $result['ODDISC']=$objQuery['ODDISC'];
2743 $result['OSDISC']=$objQuery['OSDISC'];
2744 $result['ODCUP']=$objQuery['ODCUP'];
2745 $result['OSCUP']=$objQuery['OSCUP'];
2746 $result['ODMACULA']=$objQuery['ODMACULA'];
2747 $result['OSMACULA']=$objQuery['OSMACULA'];
2748 $result['ODVESSELS']=$objQuery['ODVESSELS'];
2749 $result['OSVESSELS']=$objQuery['OSVESSELS'];
2750 $result['ODPERIPH']=$objQuery['ODPERIPH'];
2751 $result['OSPERIPH']=$objQuery['OSPERIPH'];
2752 $result['ODDRAWING']=$objQuery['ODDRAWING'];
2753 $result['OSDRAWING']=$objQuery['OSDRAWING'];
2754 $result['ODCMT']=$objQuery['ODCMT'];
2755 $result['OSCMT']=$objQuery['OSCMT'];
2756 $result['RETINA_COMMENTS']=$objQuery['RETINA_COMMENTS'];
2757 $result["json"] = json_encode($result);
2758 echo json_encode($result);
2759 } elseif ($zone =="NEURO") {
2760 $result['ACT']=$objQuery['ACT'];
2761 $result['ACT5CCDIST']=$objQuery['ACT5CCDIST'];
2762 $result['ACT1CCDIST']=$objQuery['ACT1CCDIST'];
2763 $result['ACT2CCDIST']=$objQuery['ACT2CCDIST'];
2764 $result['ACT3CCDIST']=$objQuery['ACT3CCDIST'];
2765 $result['ACT4CCDIST']=$objQuery['ACT4CCDIST'];
2766 $result['ACT6CCDIST']=$objQuery['ACT6CCDIST'];
2767 $result['ACT7CCDIST']=$objQuery['ACT7CCDIST'];
2768 $result['ACT8CCDIST']=$objQuery['ACT8CCDIST'];
2769 $result['ACT9CCDIST']=$objQuery['ACT9CCDIST'];
2770 $result['ACT10CCDIST']=$objQuery['ACT10CCDIST'];
2771 $result['ACT11CCDIST']=$objQuery['ACT11CCDIST'];
2772 $result['ACT1SCDIST']=$objQuery['ACT1SCDIST'];
2773 $result['ACT2SCDIST']=$objQuery['ACT2SCDIST'];
2774 $result['ACT3SCDIST']=$objQuery['ACT3SCDIST'];
2775 $result['ACT4SCDIST']=$objQuery['ACT4SCDIST'];
2776 $result['ACT5SCDIST']=$objQuery['ACT5SCDIST'];
2777 $result['ACT6SCDIST']=$objQuery['ACT6SCDIST'];
2778 $result['ACT7SCDIST']=$objQuery['ACT7SCDIST'];
2779 $result['ACT8SCDIST']=$objQuery['ACT8SCDIST'];
2780 $result['ACT9SCDIST']=$objQuery['ACT9SCDIST'];
2781 $result['ACT10SCDIST']=$objQuery['ACT10SCDIST'];
2782 $result['ACT11SCDIST']=$objQuery['ACT11SCDIST'];
2783 $result['ACT1SCNEAR']=$objQuery['ACT1SCNEAR'];
2784 $result['ACT2SCNEAR']=$objQuery['ACT2SCNEAR'];
2785 $result['ACT3SCNEAR']=$objQuery['ACT3SCNEAR'];
2786 $result['ACT4SCNEAR']=$objQuery['ACT4SCNEAR'];
2787 $result['ACT5CCNEAR']=$objQuery['ACT5CCNEAR'];
2788 $result['ACT6CCNEAR']=$objQuery['ACT6CCNEAR'];
2789 $result['ACT7CCNEAR']=$objQuery['ACT7CCNEAR'];
2790 $result['ACT8CCNEAR']=$objQuery['ACT8CCNEAR'];
2791 $result['ACT9CCNEAR']=$objQuery['ACT9CCNEAR'];
2792 $result['ACT10CCNEAR']=$objQuery['ACT10CCNEAR'];
2793 $result['ACT11CCNEAR']=$objQuery['ACT11CCNEAR'];
2794 $result['ACT5SCNEAR']=$objQuery['ACT5SCNEAR'];
2795 $result['ACT6SCNEAR']=$objQuery['ACT6SCNEAR'];
2796 $result['ACT7SCNEAR']=$objQuery['ACT7SCNEAR'];
2797 $result['ACT8SCNEAR']=$objQuery['ACT8SCNEAR'];
2798 $result['ACT9SCNEAR']=$objQuery['ACT9SCNEAR'];
2799 $result['ACT10SCNEAR']=$objQuery['ACT10SCNEAR'];
2800 $result['ACT11SCNEAR']=$objQuery['ACT11SCNEAR'];
2801 $result['ACT1CCNEAR']=$objQuery['ACT1CCNEAR'];
2802 $result['ACT2CCNEAR']=$objQuery['ACT2CCNEAR'];
2803 $result['ACT3CCNEAR']=$objQuery['ACT3CCNEAR'];
2804 $result['ACT4CCNEAR']=$objQuery['ACT4CCNEAR'];
2805 $result['ODVF1']=$objQuery['ODVF1'];
2806 $result['ODVF2']=$objQuery['ODVF2'];
2807 $result['ODVF3']=$objQuery['ODVF3'];
2808 $result['ODVF4']=$objQuery['ODVF4'];
2809 $result['OSVF1']=$objQuery['OSVF1'];
2810 $result['OSVF2']=$objQuery['OSVF2'];
2811 $result['OSVF3']=$objQuery['OSVF3'];
2812 $result['OSVF4']=$objQuery['OSVF4'];
2813 $result['MOTILITY_RS']=$objQuery['MOTILITY_RS'];
2814 $result['MOTILITY_RI']=$objQuery['MOTILITY_RI'];
2815 $result['MOTILITY_RR']=$objQuery['MOTILITY_RR'];
2816 $result['MOTILITY_RL']=$objQuery['MOTILITY_RL'];
2817 $result['MOTILITY_LS']=$objQuery['MOTILITY_LS'];
2818 $result['MOTILITY_LI']=$objQuery['MOTILITY_LI'];
2819 $result['MOTILITY_LR']=$objQuery['MOTILITY_LR'];
2820 $result['MOTILITY_LL']=$objQuery['MOTILITY_LL'];
2821 $result['NEURO_COMMENTS']=$objQuery['NEURO_COMMENTS'];
2822 $result['STEREOPSIS']=$objQuery['STEREOPSIS'];
2823 $result['ODNPA']=$objQuery['ODNPA'];
2824 $result['OSNPA']=$objQuery['OSNPA'];
2825 $result['VERTFUSAMPS']=$objQuery['VERTFUSAMPS'];
2826 $result['DIVERGENCEAMPS']=$objQuery['DIVERGENCEAMPS'];
2827 $result['NPC']=$objQuery['NPC'];
2828 $result['DACCDIST']=$objQuery['DACCDIST'];
2829 $result['DACCNEAR']=$objQuery['DACCNEAR'];
2830 $result['CACCDIST']=$objQuery['CACCDIST'];
2831 $result['CACCNEAR']=$objQuery['CACCNEAR'];
2832 $result['ODCOLOR']=$objQuery['ODCOLOR'];
2833 $result['OSCOLOR']=$objQuery['OSCOLOR'];
2834 $result['ODCOINS']=$objQuery['ODCOINS'];
2835 $result['OSCOINS']=$objQuery['OSCOINS'];
2836 $result['ODREDDESAT']=$objQuery['ODREDDESAT'];
2837 $result['OSREDDESAT']=$objQuery['OSREDDESAT'];
2838 $result['ODPUPILSIZE1']=$objQuery['ODPUPILSIZE1'];
2839 $result['ODPUPILSIZE2']=$objQuery['ODPUPILSIZE2'];
2840 $result['ODPUPILREACTIVITY']=$objQuery['ODPUPILREACTIVITY'];
2841 $result['ODAPD']=$objQuery['ODAPD'];
2842 $result['OSPUPILSIZE1']=$objQuery['OSPUPILSIZE1'];
2843 $result['OSPUPILSIZE2']=$objQuery['OSPUPILSIZE2'];
2844 $result['OSPUPILREACTIVITY']=$objQuery['OSPUPILREACTIVITY'];
2845 $result['OSAPD']=$objQuery['OSAPD'];
2846 $result['DIMODPUPILSIZE1']=$objQuery['DIMODPUPILSIZE1'];
2847 $result['DIMODPUPILSIZE2']=$objQuery['DIMODPUPILSIZE2'];
2848 $result['DIMODPUPILREACTIVITY']=$objQuery['DIMODPUPILREACTIVITY'];
2849 $result['DIMOSPUPILSIZE1']=$objQuery['DIMOSPUPILSIZE1'];
2850 $result['DIMOSPUPILSIZE2']=$objQuery['DIMOSPUPILSIZE2'];
2851 $result['DIMOSPUPILREACTIVITY']=$objQuery['DIMOSPUPILREACTIVITY'];
2852 $result['PUPIL_COMMENTS']=$objQuery['PUPIL_COMMENTS'];
2853 $result['ODVFCONFRONTATION1']=$objQuery['ODVFCONFRONTATION1'];
2854 $result['ODVFCONFRONTATION2']=$objQuery['ODVFCONFRONTATION2'];
2855 $result['ODVFCONFRONTATION3']=$objQuery['ODVFCONFRONTATION3'];
2856 $result['ODVFCONFRONTATION4']=$objQuery['ODVFCONFRONTATION4'];
2857 $result['ODVFCONFRONTATION5']=$objQuery['ODVFCONFRONTATION5'];
2858 $result['OSVFCONFRONTATION1']=$objQuery['OSVFCONFRONTATION1'];
2859 $result['OSVFCONFRONTATION2']=$objQuery['OSVFCONFRONTATION2'];
2860 $result['OSVFCONFRONTATION3']=$objQuery['OSVFCONFRONTATION3'];
2861 $result['OSVFCONFRONTATION4']=$objQuery['OSVFCONFRONTATION4'];
2862 $result['OSVFCONFRONTATION5']=$objQuery['OSVFCONFRONTATION5'];
2863 $result["json"] = json_encode($result);
2864 echo json_encode($result);
2865 } elseif ($zone =="IMPPLAN") {
2866 $result['IMPPLAN'] = build_IMPPLAN_items($pid,$copy_from);
2867 echo json_encode($result);
2868 } elseif ($zone =="ALL") {
2869 $result['RUL']=$objQuery['RUL'];
2870 $result['LUL']=$objQuery['LUL'];
2871 $result['RLL']=$objQuery['RLL'];
2872 $result['LLL']=$objQuery['LLL'];
2873 $result['RBROW']=$objQuery['RBROW'];
2874 $result['LBROW']=$objQuery['LBROW'];
2875 $result['RMCT']=$objQuery['RMCT'];
2876 $result['LMCT']=$objQuery['LMCT'];
2877 $result['RADNEXA']=$objQuery['RADNEXA'];
2878 $result['LADNEXA']=$objQuery['LADNEXA'];
2879 $result['RMRD']=$objQuery['RMRD'];
2880 $result['LMRD']=$objQuery['LMRD'];
2881 $result['RLF']=$objQuery['RLF'];
2882 $result['LLF']=$objQuery['LLF'];
2883 $result['RVFISSURE']=$objQuery['RVFISSURE'];
2884 $result['LVFISSURE']=$objQuery['LVFISSURE'];
2885 $result['ODHERTEL']=$objQuery['ODHERTEL'];
2886 $result['OSHERTEL']=$objQuery['OSHERTEL'];
2887 $result['HERTELBASE']=$objQuery['HERTELBASE'];
2888 $result['ODPIC']=$objQuery['ODPIC'];
2889 $result['OSPIC']=$objQuery['OSPIC'];
2890 $result['EXT_COMMENTS']=$objQuery['EXT_COMMENTS'];
2892 $result['OSCONJ']=$objQuery['OSCONJ'];
2893 $result['ODCONJ']=$objQuery['ODCONJ'];
2894 $result['ODCORNEA']=$objQuery['ODCORNEA'];
2895 $result['OSCORNEA']=$objQuery['OSCORNEA'];
2896 $result['ODAC']=$objQuery['ODAC'];
2897 $result['OSAC']=$objQuery['OSAC'];
2898 $result['ODLENS']=$objQuery['ODLENS'];
2899 $result['OSLENS']=$objQuery['OSLENS'];
2900 $result['ODIRIS']=$objQuery['ODIRIS'];
2901 $result['OSIRIS']=$objQuery['OSIRIS'];
2902 $result['ODKTHICKNESS']=$objQuery['ODKTHICKNESS'];
2903 $result['OSKTHICKNESS']=$objQuery['OSKTHICKNESS'];
2904 $result['ODGONIO']=$objQuery['ODGONIO'];
2905 $result['OSGONIO']=$objQuery['OSGONIO'];
2906 $result['ANTSEG_COMMENTS']=$objQuery['ANTSEG_COMMENTS'];
2908 $result['ODDISC']=$objQuery['ODDISC'];
2909 $result['OSDISC']=$objQuery['OSDISC'];
2910 $result['ODCUP']=$objQuery['ODCUP'];
2911 $result['OSCUP']=$objQuery['OSCUP'];
2912 $result['ODMACULA']=$objQuery['ODMACULA'];
2913 $result['OSMACULA']=$objQuery['OSMACULA'];
2914 $result['ODVESSELS']=$objQuery['ODVESSELS'];
2915 $result['OSVESSELS']=$objQuery['OSVESSELS'];
2916 $result['ODPERIPH']=$objQuery['ODPERIPH'];
2917 $result['OSPERIPH']=$objQuery['OSPERIPH'];
2918 $result['ODDRAWING']=$objQuery['ODDRAWING'];
2919 $result['OSDRAWING']=$objQuery['OSDRAWING'];
2920 $result['ODCMT']=$objQuery['ODCMT'];
2921 $result['OSCMT']=$objQuery['OSCMT'];
2922 $result['RETINA_COMMENTS']=$objQuery['RETINA_COMMENTS'];
2924 $result['ACT']=$objQuery['ACT'];
2925 $result['ACT5CCDIST']=$objQuery['ACT5CCDIST'];
2926 $result['ACT1CCDIST']=$objQuery['ACT1CCDIST'];
2927 $result['ACT2CCDIST']=$objQuery['ACT2CCDIST'];
2928 $result['ACT3CCDIST']=$objQuery['ACT3CCDIST'];
2929 $result['ACT4CCDIST']=$objQuery['ACT4CCDIST'];
2930 $result['ACT6CCDIST']=$objQuery['ACT6CCDIST'];
2931 $result['ACT7CCDIST']=$objQuery['ACT7CCDIST'];
2932 $result['ACT8CCDIST']=$objQuery['ACT8CCDIST'];
2933 $result['ACT9CCDIST']=$objQuery['ACT9CCDIST'];
2934 $result['ACT10CCDIST']=$objQuery['ACT10CCDIST'];
2935 $result['ACT11CCDIST']=$objQuery['ACT11CCDIST'];
2936 $result['ACT1SCDIST']=$objQuery['ACT1SCDIST'];
2937 $result['ACT2SCDIST']=$objQuery['ACT2SCDIST'];
2938 $result['ACT3SCDIST']=$objQuery['ACT3SCDIST'];
2939 $result['ACT4SCDIST']=$objQuery['ACT4SCDIST'];
2940 $result['ACT5SCDIST']=$objQuery['ACT5SCDIST'];
2941 $result['ACT6SCDIST']=$objQuery['ACT6SCDIST'];
2942 $result['ACT7SCDIST']=$objQuery['ACT7SCDIST'];
2943 $result['ACT8SCDIST']=$objQuery['ACT8SCDIST'];
2944 $result['ACT9SCDIST']=$objQuery['ACT9SCDIST'];
2945 $result['ACT10SCDIST']=$objQuery['ACT10SCDIST'];
2946 $result['ACT11SCDIST']=$objQuery['ACT11SCDIST'];
2947 $result['ACT1SCNEAR']=$objQuery['ACT1SCNEAR'];
2948 $result['ACT2SCNEAR']=$objQuery['ACT2SCNEAR'];
2949 $result['ACT3SCNEAR']=$objQuery['ACT3SCNEAR'];
2950 $result['ACT4SCNEAR']=$objQuery['ACT4SCNEAR'];
2951 $result['ACT5CCNEAR']=$objQuery['ACT5CCNEAR'];
2952 $result['ACT6CCNEAR']=$objQuery['ACT6CCNEAR'];
2953 $result['ACT7CCNEAR']=$objQuery['ACT7CCNEAR'];
2954 $result['ACT8CCNEAR']=$objQuery['ACT8CCNEAR'];
2955 $result['ACT9CCNEAR']=$objQuery['ACT9CCNEAR'];
2956 $result['ACT10CCNEAR']=$objQuery['ACT10CCNEAR'];
2957 $result['ACT11CCNEAR']=$objQuery['ACT11CCNEAR'];
2958 $result['ACT5SCNEAR']=$objQuery['ACT5SCNEAR'];
2959 $result['ACT6SCNEAR']=$objQuery['ACT6SCNEAR'];
2960 $result['ACT7SCNEAR']=$objQuery['ACT7SCNEAR'];
2961 $result['ACT8SCNEAR']=$objQuery['ACT8SCNEAR'];
2962 $result['ACT9SCNEAR']=$objQuery['ACT9SCNEAR'];
2963 $result['ACT10SCNEAR']=$objQuery['ACT10SCNEAR'];
2964 $result['ACT11SCNEAR']=$objQuery['ACT11SCNEAR'];
2965 $result['ACT1CCNEAR']=$objQuery['ACT1CCNEAR'];
2966 $result['ACT2CCNEAR']=$objQuery['ACT2CCNEAR'];
2967 $result['ACT3CCNEAR']=$objQuery['ACT3CCNEAR'];
2968 $result['ACT4CCNEAR']=$objQuery['ACT4CCNEAR'];
2969 $result['ODVF1']=$objQuery['ODVF1'];
2970 $result['ODVF2']=$objQuery['ODVF2'];
2971 $result['ODVF3']=$objQuery['ODVF3'];
2972 $result['ODVF4']=$objQuery['ODVF4'];
2973 $result['OSVF1']=$objQuery['OSVF1'];
2974 $result['OSVF2']=$objQuery['OSVF2'];
2975 $result['OSVF3']=$objQuery['OSVF3'];
2976 $result['OSVF4']=$objQuery['OSVF4'];
2977 $result['MOTILITY_RS']=$objQuery['MOTILITY_RS'];
2978 $result['MOTILITY_RI']=$objQuery['MOTILITY_RI'];
2979 $result['MOTILITY_RR']=$objQuery['MOTILITY_RR'];
2980 $result['MOTILITY_RL']=$objQuery['MOTILITY_RL'];
2981 $result['MOTILITY_LS']=$objQuery['MOTILITY_LS'];
2982 $result['MOTILITY_LI']=$objQuery['MOTILITY_LI'];
2983 $result['MOTILITY_LR']=$objQuery['MOTILITY_LR'];
2984 $result['MOTILITY_LL']=$objQuery['MOTILITY_LL'];
2985 $result['NEURO_COMMENTS']=$objQuery['NEURO_COMMENTS'];
2986 $result['STEREOPSIS']=$objQuery['STEREOPSIS'];
2987 $result['ODNPA']=$objQuery['ODNPA'];
2988 $result['OSNPA']=$objQuery['OSNPA'];
2989 $result['VERTFUSAMPS']=$objQuery['VERTFUSAMPS'];
2990 $result['DIVERGENCEAMPS']=$objQuery['DIVERGENCEAMPS'];
2991 $result['NPC']=$objQuery['NPC'];
2992 $result['DACCDIST']=$objQuery['DACCDIST'];
2993 $result['DACCNEAR']=$objQuery['DACCNEAR'];
2994 $result['CACCDIST']=$objQuery['CACCDIST'];
2995 $result['CACCNEAR']=$objQuery['CACCNEAR'];
2996 $result['ODCOLOR']=$objQuery['ODCOLOR'];
2997 $result['OSCOLOR']=$objQuery['OSCOLOR'];
2998 $result['ODCOINS']=$objQuery['ODCOINS'];
2999 $result['OSCOINS']=$objQuery['OSCOINS'];
3000 $result['ODREDDESAT']=$objQuery['ODREDDESAT'];
3001 $result['OSREDDESAT']=$objQuery['OSREDDESAT'];
3002 $result['ODPUPILSIZE1']=$objQuery['ODPUPILSIZE1'];
3003 $result['ODPUPILSIZE2']=$objQuery['ODPUPILSIZE2'];
3004 $result['ODPUPILREACTIVITY']=$objQuery['ODPUPILREACTIVITY'];
3005 $result['ODAPD']=$objQuery['ODAPD'];
3006 $result['OSPUPILSIZE1']=$objQuery['OSPUPILSIZE1'];
3007 $result['OSPUPILSIZE2']=$objQuery['OSPUPILSIZE2'];
3008 $result['OSPUPILREACTIVITY']=$objQuery['OSPUPILREACTIVITY'];
3009 $result['OSAPD']=$objQuery['OSAPD'];
3010 $result['DIMODPUPILSIZE1']=$objQuery['DIMODPUPILSIZE1'];
3011 $result['DIMODPUPILSIZE2']=$objQuery['DIMODPUPILSIZE2'];
3012 $result['DIMODPUPILREACTIVITY']=$objQuery['DIMODPUPILREACTIVITY'];
3013 $result['DIMOSPUPILSIZE1']=$objQuery['DIMOSPUPILSIZE1'];
3014 $result['DIMOSPUPILSIZE2']=$objQuery['DIMOSPUPILSIZE2'];
3015 $result['DIMOSPUPILREACTIVITY']=$objQuery['DIMOSPUPILREACTIVITY'];
3016 $result['PUPIL_COMMENTS']=$objQuery['PUPIL_COMMENTS'];
3017 $result['ODVFCONFRONTATION1']=$objQuery['ODVFCONFRONTATION1'];
3018 $result['ODVFCONFRONTATION2']=$objQuery['ODVFCONFRONTATION2'];
3019 $result['ODVFCONFRONTATION3']=$objQuery['ODVFCONFRONTATION3'];
3020 $result['ODVFCONFRONTATION4']=$objQuery['ODVFCONFRONTATION4'];
3021 $result['ODVFCONFRONTATION5']=$objQuery['ODVFCONFRONTATION5'];
3022 $result['OSVFCONFRONTATION1']=$objQuery['OSVFCONFRONTATION1'];
3023 $result['OSVFCONFRONTATION2']=$objQuery['OSVFCONFRONTATION2'];
3024 $result['OSVFCONFRONTATION3']=$objQuery['OSVFCONFRONTATION3'];
3025 $result['OSVFCONFRONTATION4']=$objQuery['OSVFCONFRONTATION4'];
3026 $result['OSVFCONFRONTATION5']=$objQuery['OSVFCONFRONTATION5'];
3027 $result['IMP']=$objQuery['IMP'];
3028 $result["json"] = json_encode($result);
3029 echo json_encode($result);
3030 } elseif ($zone =="READONLY") {
3031 $result=$objQuery;
3032 $count_rx='0';
3033 $query = "select * from form_eye_mag_wearing where PID=? and ENCOUNTER=? and FORM_ID >'0' ORDER BY RX_NUMBER";
3034 $wear = sqlStatement($query,array($pid,$_SESSION['encounter']));
3035 while ($wearing = sqlFetchArray($wear)) {
3036 ${"display_W_$count_rx"} = '';
3037 ${"ODSPH_$count_rx"} = $wearing['ODSPH'];
3038 ${"ODCYL_$count_rx"} = $wearing['ODCYL'];
3039 ${"ODAXIS_$count_rx"} = $wearing['ODAXIS'];
3040 ${"OSSPH_$count_rx"} = $wearing['OSSPH'];
3041 ${"OSCYL_$count_rx"} = $wearing['OSCYL'];
3042 ${"OSAXIS_$count_rx"} = $wearing['OSAXIS'];
3043 ${"ODMIDADD_$count_rx"} = $wearing['ODMIDADD'];
3044 ${"OSMIDADD_$count_rx"} = $wearing['OSMIDADD'];
3045 ${"ODADD_$count_rx"} = $wearing['ODADD'];
3046 ${"OSADD_$count_rx"} = $wearing['OSADD'];
3047 ${"ODVA_$count_rx"} = $wearing['ODVA'];
3048 ${"OSVA_$count_rx"} = $wearing['OSVA'];
3049 ${"ODNEARVA_$count_rx"} = $wearing['ODNEARVA'];
3050 ${"OSNEARVA_$count_rx"} = $wearing['OSNEARVA'];
3051 ${"ODPRISM_$count_rx"} = $wearing['ODPRISM'];
3052 ${"OSPRISM_$count_rx"} = $wearing['OSPRISM'];
3053 ${"W_$count_rx"} = '1';
3054 ${"RX_TYPE_$count_rx"} = $wearing['RX_TYPE'];
3055 ${"ODHPD_$count_rx"} = $wearing['ODHPD'];
3056 ${"ODHBASE_$count_rx"} = $wearing['ODHBASE'];
3057 ${"ODVPD_$count_rx"} = $wearing['ODVPD'];
3058 ${"ODVBASE_$count_rx"} = $wearing['ODVBASE'];
3059 ${"ODSLABOFF_$count_rx"} = $wearing['ODSLABOFF'];
3060 ${"ODVERTEXDIST_$count_rx"} = $wearing['ODVERTEXDIST'];
3061 ${"OSHPD_$count_rx"} = $wearing['OSHPD'];
3062 ${"OSHBASE_$count_rx"} = $wearing['OSHBASE'];
3063 ${"OSVPD_$count_rx"} = $wearing['OSVPD'];
3064 ${"OSVBASE_$count_rx"} = $wearing['OSVBASE'];
3065 ${"OSSLABOFF_$count_rx"} = $wearing['OSSLABOFF'];
3066 ${"OSVERTEXDIST_$count_rx"} = $wearing['OSVERTEXDIST'];
3067 ${"ODMPDD_$count_rx"} = $wearing['ODMPDD'];
3068 ${"ODMPDN_$count_rx"} = $wearing['ODMPDN'];
3069 ${"OSMPDD_$count_rx"} = $wearing['OSMPDD'];
3070 ${"OSMPDN_$count_rx"} = $wearing['OSMPDN'];
3071 ${"BPDD_$count_rx"} = $wearing['BPDD'];
3072 ${"BPDN_$count_rx"} = $wearing['BPDN'];
3073 ${"LENS_MATERIAL_$count_rx"} = $wearing['LENS_MATERIAL'];
3074 ${"LENS_TREATMENTS_$count_rx"} = $wearing['LENS_TREATMENTS'];
3075 ${"COMMENTS_$count_rx"} = $wearing['COMMENTS'];
3077 $result["json"] = json_encode($result);
3078 echo json_encode($result);
3083 * This builds the IMPPLAN_items variable for a given pid and form_id.
3084 * @param string $pid patient_id
3085 * @param string $form_id field id in table form_eye_mag
3086 * @return object IMPPLAN_items
3088 function build_IMPPLAN_items($pid,$form_id) {
3089 global $form_folder;
3090 $query ="select * from form_".$form_folder."_impplan where form_id=? and pid=? ORDER BY IMPPLAN_order";
3091 $newdata = array();
3092 $fres = sqlStatement($query,array($form_id,$pid));
3093 $i=0; //there should only be one if all goes well...
3094 while ($frow = sqlFetchArray($fres)) {
3095 $IMPPLAN_items[$i]['form_id'] = $frow['form_id'];
3096 $IMPPLAN_items[$i]['pid'] = $frow['pid'];
3097 $IMPPLAN_items[$i]['id'] = $frow['id'];
3098 $IMPPLAN_items[$i]['title'] = $frow['title'];
3099 $IMPPLAN_items[$i]['code'] = $frow['code'];
3100 $IMPPLAN_items[$i]['codetype'] = $frow['codetype'];
3101 $IMPPLAN_items[$i]['codedesc'] = $frow['codedesc'];
3102 $IMPPLAN_items[$i]['codetext'] = $frow['codetext'];
3103 $IMPPLAN_items[$i]['plan'] = $frow['plan'];
3104 $IMPPLAN_items[$i]['PMSFH_link'] = $frow['PMSFH_link'];
3105 $IMPPLAN_items[$i]['IMPPLAN_order'] = $frow['IMPPLAN_order'];
3106 $i++;
3108 return $IMPPLAN_items;
3112 * This function builds an array of documents for this patient ($pid).
3113 * We first list all the categories this practice has created by name and by category_id
3114 * for this patient ($pid)
3115 * Each document info from documents table is added to these as arrays
3117 * @param string $pid patient_id
3118 * @return array($documents)
3120 function document_engine($pid) {
3121 $sql1 = sqlStatement("Select * from categories");
3122 while ($row1 = sqlFetchArray($sql1)) {
3123 $categories[] = $row1;
3124 $my_name[$row1['id']] = $row1['name'];
3125 $children_names[$row1['parent']][]=$row1['name'];
3126 $parent_name[$row1['name']] = $my_name[$row1['parent']];
3127 if ($row1['value'] >'') {
3128 //if there is a value, tells us what segment of exam ($zone) this belongs in...
3129 $zones[$row1['value']][] = $row1;
3130 } else {
3131 if ($row1['name'] != "Categories") {
3132 $zones['OTHER'][] = $row1;
3136 $query = "Select *
3137 from
3138 categories, documents,categories_to_documents
3139 where documents.foreign_id=? and documents.id=categories_to_documents.document_id and
3140 categories_to_documents.category_id=categories.id ORDER BY categories.name";
3141 $sql2 = sqlStatement($query,array($pid));
3142 while ($row2 = sqlFetchArray($sql2)) {
3143 //the document may not be created on the same day as the encounter, use encounter date first
3144 //get encounter date from encounter id
3145 if ($row2['encounter_id']) {
3146 $visit= getEncounterDateByEncounter($row2['encounter_id']);
3147 $row2['encounter_date'] = oeFormatSDFT(strtotime($visit['date']));
3148 } else {
3149 $row2['encounter_date'] = $row2['docdate'];
3151 $documents[]= $row2;
3152 $docs_in_cat_id[$row2['category_id']][] = $row2;
3153 if ($row2['value'] > '') {
3154 $docs_in_zone[$row2['value']][] = $row2;
3155 } else {
3156 $docs_in_zone['OTHER'][]=$row2;
3158 $docs_in_name[$row2['name']][] = $row2;
3159 $docs_by_date[$row2['encounter_date']][] = $row2;
3161 $documents['categories']=$categories;
3162 $documents['my_name']=$my_name;
3163 $documents['children_names']=$children_names;
3164 $documents['parent_name'] = $parent_name;
3165 $documents['zones'] = $zones;
3166 $documents['docs_in_zone'] = $docs_in_zone;
3167 $documents['docs_in_cat_id'] = $docs_in_cat_id;
3168 $documents['docs_in_name'] = $docs_in_name;
3169 $documents['docs_by_date'] = $docs_by_date;
3170 return array($documents);
3174 * This function returns ICONS with links for a specific clinical subsection of the Document Library.
3176 * @param string $pid value = patient id
3177 * @param string $encounter is the encounter_id
3178 * @param string $category_value options EXT,ANTSEG,POSTSEG,NEURO,OTHER
3179 * These values are taken from the "value" field in the Documents' table "categories".
3180 * They allow us to regroup the categories how we like them.
3181 * @return array($imaging,$episode)
3183 function display($pid,$encounter,$category_value) {
3184 global $form_folder;
3185 global $id;
3186 global $documents;
3188 * Each document is stored in a specific category. Think of a category as a Folder.
3189 * Practices can add/alter/delete category names as they wish.
3190 * In the Eye Form we link to these categories, not by name by by what part of the physical exam they belong to.
3191 * We needed a pointer to tell us if a document category is specific to a clinical section.
3192 * For example, a photo of the retina is stored in the category we named "Fundus".
3193 * A photo of the optic nerve is stored in the "Optic Disc" category. Someone else might change the
3194 * name to "Optic Nerve", or even a different language. No matter, these categories include documents
3195 * we would like to directly link to/open from the RETINA section of the link.
3196 * The categories table does have an unused field - "value".
3197 * This is where we link document categories to a clinical zone. We add the clinical section name
3198 * on install but the end user can change or add others as the devices evolve.
3199 * Currently the base install has EXT,ANTSEG,POSTSEG,NEURO
3200 * New names new categories. OCT would not have been a category 5 years ago.
3201 * Who knows what is next? Gene-lab construction?
3202 * So the name is user assigned as is the location.
3203 * Thus we need to build out the Documents section by adding another layer "zones"
3204 * to the associative array.
3206 if (!$documents) {
3207 list($documents) = document_engine($pid);
3209 for ($j=0; $j < count($documents['zones'][$category_value]); $j++) {
3210 $episode .= "<tr>
3211 <td class='right'><b>".text($documents['zones'][$category_value][$j]['name'])."</b>:&nbsp;</td>
3212 <td>
3213 <a href='../../../controller.php?document&upload&patient_id=".attr($pid)."&parent_id=".attr($documents['zones'][$category_value][$j]['id'])."&'>
3214 <img src='../../forms/".$form_folder."/images/upload_file.png' class='little_image'>
3215 </a>
3216 </td>
3217 <td>
3218 <img src='../../forms/".$form_folder."/images/upload_multi.png' class='little_image'>
3219 </td>
3220 <td>";
3221 // Choose how to display: ANythingSlider or OpenEMR Douments file.
3222 //open via anything Slider
3223 if (count($documents['docs_in_cat_id'][$documents['zones'][$category_value][$j]['id']]) > '0') {
3224 $episode .= '<a href="../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($documents['zones'][$category_value][$j]['id']).'&encounter='.$encounter.'&category_name='.urlencode(xla($category_value)).'"
3225 onclick="return dopopup(\'../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($documents['zones'][$category_value][$j]['id']).'&encounter='.$encounter.'&category_name='.urlencode(xla($category_value)).'\')">
3226 <img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" /></a>';
3227 //open via OpenEMR Documents with treemenu
3228 /*if (count($documents['docs_in_cat_id'][$documents['zones'][$category_value][$j]['id']]) > '0') {
3229 $episode .= '<a href="../../../controller.php?document&view&patient_id='.$pid.'&parent_idX='.$documents['zones'][$category_value][$j]['id'].'&"
3230 onclick="return dopopup(\'../../../controller.php?document&view&patient_id='.$pid.'&parent_idX='.$documents['zones'][$category_value][$j]['id'].'&document_id='.$doc[id].'&as_file=false\')">
3231 <img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" /></a>';
3234 $episode .= '</td></tr>';
3235 $i++;
3237 return array($documents,$episode);
3241 * This is an application style menu (bootstrap) to start shifting clinical functions into a single page.
3243 * @param string $pid is the patient id
3244 * @param string $encounter is the encounter_id
3245 * @param string $title is the form title
3247 * @return nothing, outputs directly to screen
3249 function menu_overhaul_top($pid,$encounter,$title="Eye Exam") {
3250 global $form_folder;
3251 global $prov_data;
3252 global $encounter;
3253 global $form_id;
3254 global $display;
3255 global $providerID;
3257 $providerNAME = $prov_data['fname']." ".$prov_data['lname'];
3258 if ($prov_data['suffix']) $providerNAME.= ", ".$prov_data['suffix'];
3259 if ($_REQUEST['display'] == "fullscreen") { $fullscreen_disable = 'disabled'; } else {
3260 $frame_disabled ='disabled';
3261 echo "<style>.tabHide{ display:none; }</style>";
3264 <!-- Navigation -->
3265 <nav class="navbar-fixed-top navbar-custom navbar-bright navbar-inner" data-role="page banner navigation" style="margin-bottom: 0;z-index:1000000;font-size: 1.2em;">
3266 <!-- Brand and toggle get grouped for better mobile display -->
3267 <div class="container-fluid" style="margin-top:0px;padding:2px;">
3268 <div class="navbar-header brand" style="color:black;">
3269 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oer-navbar-collapse-1">
3270 <span class="sr-only"><?php echo xlt("Toggle navigation"); ?></span>
3271 <span class="icon-bar"></span>
3272 <span class="icon-bar"></span>
3273 <span class="icon-bar"></span>
3274 </button>
3275 &nbsp;
3276 <img src="<?php echo $GLOBALS['webroot']; ?>/sites/default/images/login_logo.gif" class="little_image">
3277 <?php echo xlt('Eye Exam'); ?>
3278 </div>
3279 <div class="navbar-collapse collapse" id="oer-navbar-collapse-1">
3280 <ul class="navbar-nav">
3281 <li class="dropdown">
3282 <a class="dropdown-toggle" data-toggle="dropdown" id="menu_dropdown_file" role="button" aria-expanded="true"><?php echo xlt("File"); ?> </a>
3283 <ul class="dropdown-menu" role="menu">
3284 <li id="menu_PREFERENCES" name="menu_PREFERENCES" class="tabHide <?php echo $fullscreen_disabled; ?>"><a id="BUTTON_PREFERENCES_menu" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_globals.php">
3285 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3286 <?php echo xlt("Preferences"); ?></a></li>
3287 <li id="menu_PRINT_narrative" name="menu_PRINT_report"><a id="BUTTON_PRINT_report" target="_new" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/report/custom_report.php?printable=1&pdf=0&<?php echo $form_folder."_".$form_id."=".$encounter; ?>"><?php echo xlt("Print Report"); ?></a></li>
3288 <li id="menu_PRINT_narrative_2" name="menu_PRINT_report_2"><a id="BUTTON_PRINT_report_2" target="_new" href="#"
3289 onclick="top.restoreSession(); create_task('<?php echo attr($providerID); ?>','Report','menu'); return false;">
3290 <?php echo xlt("Save Report as PDF"); ?></a></li>
3291 <li class="divider tabHide"></li>
3292 <li id="menu_QUIT" name="menu_QUIT" class="tabHide <?php echo $frame_disable; ?>"><a href="#" onclick='window.close();'><?php echo xlt("Quit"); ?></a></li>
3293 </ul>
3294 </li>
3295 <li class="dropdown">
3296 <a class="dropdown-toggle" data-toggle="dropdown" id="menu_dropdown_edit" role="button" aria-expanded="true"><?php echo xlt("Edit"); ?> </a>
3297 <ul class="dropdown-menu" role="menu">
3298 <li id="menu_Undo" name="menu_Undo"> <a id="BUTTON_Undo_menu" href="#"> <?php echo xlt("Undo"); ?> <span class="menu_icon">Ctl-Z</span></a></li>
3299 <li id="menu_Redo" name="menu_Redo"> <a id="BUTTON_Redo_menu" href="#"> <?php echo xlt("Redo"); ?> <span class="menu_icon">Ctl-Shift-Z</span></a></li>
3300 <li class="divider tabHide"></li>
3301 <li id="menu_Defaults" name="menu_Defaults" class="tabHide"> <a id="BUTTON_Defaults_menu"
3302 href="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_list.php?list_id=Eye_defaults_<?php echo attr($providerID); ?>"
3303 target="RTop"
3304 title="<?php echo xla('Click here to Edit this Provider\'s Exam Default values'); ?>"
3305 name="provider_todo">
3306 <i class="fa fa-angle-double-up tabHide" title="<?php echo xla('Opens in Top frame'); ?>"></i> &nbsp;
3307 <?php echo xlt("My Default Values"); ?> &nbsp;
3308 <span class="menu_icon"><i class="fa fa-pencil fa-fw"></i> </span></a></li>
3309 </ul>
3310 </li>
3312 <li class="dropdown">
3313 <a class="dropdown-toggle" data-toggle="dropdown" id="menu_dropdown_view" role="button" aria-expanded="true"><?php echo xlt("View"); ?> </a>
3314 <ul class="dropdown-menu" role="menu">
3315 <li id="menu_TEXT" name="menu_TEXT" class="active"><a><?php echo xlt("Text"); ?><span class="menu_icon">Ctl-T</span></a></li>
3316 <li id="menu_DRAW" name="menu_DRAW"><a id="BUTTON_DRAW_menu" name="BUTTON_DRAW_menu"><?php echo xlt("Draw"); ?><span class="menu_icon">Ctl-D</span></a></li>
3317 <li id="menu_QP" name="menu_QP"><a id="BUTTON_QP_menu" name="BUTTON_QP_menu"><?php echo xlt("Quick Picks"); ?><span class="menu_icon">Ctl-B</span></a></li>
3318 <li id="menu_PRIORS" name="menu_PRIORS"><a><?php echo xlt("Prior Visits"); ?><span class="menu_icon">Ctl-P</span></a></li>
3319 <li id="menu_KB" name="menu_KB"><a><?php echo xlt("Shorthand"); ?><span class="menu_icon">Ctl-K</span></a></li>
3320 <li class="divider"></li>
3321 <li id="menu_HPI" name="menu_HPI"><a><?php echo xlt("HPI"); ?></a></li>
3322 <li id="menu_PMH" name="menu_PMH"><a><?php echo xlt("PMH"); ?></a></li>
3323 <li id="menu_EXT" name="menu_EXT" ><a><?php echo xlt("External"); ?></a></li>
3324 <li id="menu_ANTSEG" name="menu_ANTSEG" ><a><?php echo xlt("Anterior Segment"); ?></a></li>
3325 <li id="menu_POSTSEG" name="menu_POSTSEG" ><a><?php echo xlt("Posterior Segment"); ?></a></li>
3326 <li id="menu_NEURO" name="menu_NEURO" ><a><?php echo xlt("Neuro"); ?></a></li>
3327 <li class="divider"></li>
3328 <li id="menu_Right_Panel" name="menu_Right_Panel"><a><?php echo xlt("PMSFH Panel"); ?><span class="menu_icon"><i class="fa fa-list" ></i></span></a></li>
3330 <?php
3332 // This only shows up in fullscreen currently so hide it.
3333 // If the decision is made to show this is framed openEMR, then display it
3335 if ($display !== "fullscreen") { ?>
3336 <li class="divider"></li>
3337 <li id="menu_fullscreen" name="menu_fullscreen" <?php echo $fullscreen; ?>>
3338 <a onclick="openNewForm('<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/encounter/load_form.php?formname=fee_sheet');top.restoreSession();dopopup('<?php echo $_SERVER['REQUEST_URI']. '&display=fullscreen&encounter='.$encounter; ?>');" href="JavaScript:void(0);" class=""><?php echo xlt('Fullscreen'); ?></a>
3339 </li>
3340 <?php } ?>
3341 </ul>
3342 </li>
3343 <li class="dropdown tabHide">
3344 <a class="dropdown-toggle" class="disabled" role="button" id="menu_dropdown_patients" data-toggle="dropdown"><?php echo xlt("Patients"); ?> </a>
3345 <ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
3346 <li role="presentation"><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/main/finder/dynamic_finder.php">
3347 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3348 <?php echo xlt('Patients'); ?></a></li>
3349 <li role="presentation"><a tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/new/new.php">
3350 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3351 <?php echo xlt("New/Search"); ?></a> </li>
3352 <li role="presentation"><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/summary/demographics.php">
3353 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3354 <?php echo xlt("Summary"); ?></a></li>
3355 <!-- <li role="presentation" class="divider"></li>
3356 <li role="presentation"><a role="menuitem" tabindex="-1" href="#"><?php echo xlt("Create Visit"); ?></a></span></li>
3357 <li class="active"><a role="menuitem" id="BUTTON_DRAW_menu" tabindex="-1" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/encounter/forms.php"> <?php echo xlt("Current"); ?></a></li>
3358 <li role="presentation"><a role="menuitem" tabindex="-1" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/history/encounters.php"><?php echo xlt("Visit History"); ?></a></li>
3360 <li role="presentation" class="divider"></li>
3361 <li role="presentation"><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/transaction/record_request.php">
3362 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3363 <?php echo xlt("Record Request"); ?></a></li>
3364 <li role="presentation" class="divider"></li>
3365 <li role="presentation"><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/ccr_import.php">
3366 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3367 <?php echo xlt("Upload Item"); ?></a></li>
3368 <li role="presentation" ><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/ccr_pending_approval.php">
3369 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3370 <?php echo xlt("Pending Approval"); ?></a></li>
3371 </ul>
3372 </li>
3373 <!--
3374 <li class="dropdown">
3375 <a class="dropdown-toggle" role="button" id="menu_dropdown_clinical" data-toggle="dropdown"><?php echo xlt("Encounter"); ?></a>
3376 <?php
3378 * Here we need to incorporate the menu from openEMR too. What Forms are active for this installation?
3379 * openEMR uses Encounter Summary - Administrative - Clinical. Think about the menu as a new entity with
3380 * this + new functionaity. It is OK to keep or consider changing any NAMES when creating the menu. I assume
3381 * a consensus will develop.
3384 <ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
3385 <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#"><?php echo xlt("Eye Exam"); ?></a></li>
3386 <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#"><?php echo xlt("Documents"); ?></a></li>
3387 <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#"><?php echo xlt("Imaging"); ?></a></li>
3388 <li role="presentation" class="divider"></li>
3389 <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#IOP_CHART"><?php echo xlt("IOP Chart"); ?></a></li>
3390 </ul>
3391 </li>
3394 <!-- let's import the original openEMR menu_bar here. Needs to add restoreSession stuff? -->
3395 <?php
3396 $reg = Menu_myGetRegistered();
3397 if (!empty($reg)) {
3398 $StringEcho= '<li class="dropdown tabHide">';
3399 if ( $encounterLocked === false || !(isset($encounterLocked))) {
3400 foreach ($reg as $entry) {
3401 $new_category = trim($entry['category']);
3402 $new_nickname = trim($entry['nickname']);
3403 if ($new_category == '') {$new_category = xlt('Miscellaneous');}
3404 if ($new_nickname != '') {$nickname = $new_nickname;}
3405 else {$nickname = $entry['name'];}
3406 if ($old_category != $new_category) { //new category, new menu section
3407 $new_category_ = $new_category;
3408 $new_category_ = str_replace(' ','_',$new_category_);
3409 if ($old_category != '') {
3410 $StringEcho.= "
3411 </ul>
3412 </li>
3413 <li class='dropdown'>
3416 $StringEcho.= '
3417 <a class="dropdown-toggle tabHide" data-toggle="dropdown"
3418 id="menu_dropdown_'.xla($new_category_).'" role="button"
3419 aria-expanded="false">'.xlt($new_category).' </a>
3420 <ul class="dropdown-menu" role="menu">
3422 $old_category = $new_category;
3424 $StringEcho.= "<li>
3425 <a role='menuitem' tabindex='-1' href='".$GLOBALS['webroot']."/interface/patient_file/encounter/load_form.php?formname=" .urlencode($entry['directory'])."'>
3426 <i class='fa fa-angle-double-down' title='". xla('Opens in Bottom frame')."'></i>".
3427 xlt($nickname) . "</a></li>";
3430 $StringEcho.= '
3431 </ul>
3432 </li>
3435 echo $StringEcho;
3437 <li class="dropdown">
3438 <a class="dropdown-toggle" data-toggle="dropdown"
3439 id="menu_dropdown_library" role="button"
3440 aria-expanded="true"><?php echo xlt("Library"); ?> </a>
3441 <ul class="dropdown-menu" role="menu">
3442 <li role="presentation" class="tabHide"><a role="menuitem" tabindex="-1" target="RTop"
3443 href="<?php echo $GLOBALS['webroot']; ?>/interface/main/calendar/index.php?module=PostCalendar&viewtype=day&func=view&framewidth=1020">
3444 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>&nbsp;<?php echo xlt("Calendar"); ?><span class="menu_icon"><i class="fa fa-calendar"></i> </span></a></li>
3445 <li role="presentation" class="divider tabHide"></li>
3446 <li role="presentation" class="tabHide"><a target="RTop" role="menuitem" tabindex="-1"
3447 href="<?php echo $GLOBALS['webroot']; ?>/controller.php?document&list&patient_id=<?php echo xla($pid); ?>">
3448 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3449 <?php echo xlt("Documents"); ?></a></li>
3450 <li><?php echo $episode .= '<a href="'.$GLOBALS['webroot'].'/interface/forms/'.$form_folder.'/php/Anything_simple.php?display=i&encounter='.$encounter.'&category_name=OTHER&panel1-1">
3451 Imaging<span class="menu_icon"><img src="'.$GLOBALS['webroot'].'/interface/forms/'.$form_folder.'/images/jpg.png" class="little_image" />'; ?></span></a></li>
3452 <li role="presentation" class="divider tabHide"></li>
3453 <li id="menu_IOP_graph" name="menu_IOP_graph" ><a><?php echo xlt("IOP Graph"); ?></a></li>
3454 </ul>
3455 </li>
3456 <li class="dropdown">
3457 <a class="dropdown-toggle" data-toggle="dropdown"
3458 id="menu_dropdown_help" role="button"
3459 aria-expanded="true"><?php echo xlt("Help"); ?> </a>
3460 <ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
3461 <li role="presentation">
3462 <a role="menuitem" tabindex="-1" id="tooltips_toggle" name="tooltips_toggle">
3463 <i class="fa fa-help"></i> <?php echo xlt("Tooltips"); ?>
3464 <span id="tooltips_status" name="tooltips_status"></span>
3465 <span class="menu_icon"><i title="<?php echo xla('Turn the Tooltips on/off'); ?>" id="qtip_icon" class="fa fa-check fa-1"></i></span></a>
3466 </li>
3467 <li role="presentation"><a role="menuitem" tabindex="-1" target="_blank" href="<?php echo $GLOBALS['webroot']; ?>/interface/forms/eye_mag/help.php">
3468 <i class="fa fa-help"></i> <?php echo xlt("Shorthand Help"); ?><span class="menu_icon"><i title="<?php echo xla('Click for Shorthand Help.'); ?>" class="fa fa-info-circle fa-1"></i></span></a>
3469 </li>
3470 </ul>
3471 </li>
3472 </ul>
3473 <ul class="nav navbar-nav navbar-right">
3474 <li ><span id="active_flag" name="active_flag" style="margin-right:15px;color:red;"> <?php echo xlt('Active Chart'); ?> </span>
3475 <span name="active_icon" id="active_icon" style="color:black;"><i class='fa fa-toggle-on'></i></span></li>
3477 </ul>
3479 </div><!-- /.navbar-collapse -->
3480 </div>
3481 </nav>
3482 <?php
3483 return;
3486 * This is currently a floating div top with patient demographics and such.
3487 * Used in fullscreen mode at the top and in AnythingSlider at the bottom.
3488 * Moving towards containing info similar to main_title.php.
3490 * @param string $pid patient_id
3491 * @param string $encounter is the current encounter number
3492 * @return nothing, outputs directly to screen
3494 function menu_overhaul_left($pid,$encounter) {
3495 global $form_folder;
3496 global $pat_data;
3497 global $visit_date;
3498 global $documents;
3499 global $dated;
3500 global $display;
3501 global $providerNAME;
3504 * find out if the patient has a photo
3506 if (!$documents) list($documents) = document_engine($pid);
3508 <div class="borderShadow" style="font-size:1.2em;width:80%;display:inline-block;">
3509 <div id="left_menu" name="left_menu" class="col-md-4">
3510 <div style="padding-left: 18px;">
3511 <table style="text-align:left;">
3512 <?php if ($display == 'fullscreen') { ?>
3513 <tr><td class="right" >
3514 <?php
3515 $age = getPatientAgeDisplay($pat_data['DOB'], $encounter_date);
3516 $DOB = oeFormatShortDate($pat_data['DOB']);
3517 echo "<b>".xlt('Name').":</b> </td><td nowrap> &nbsp;".text($pat_data['fname'])." ".text($pat_data['lname'])." (".text($pid).")</td></tr>
3518 <tr><td class='right'><b>".xlt('DOB').":</b></td><td nowrap> &nbsp;".text($DOB). "&nbsp;&nbsp;(".text($age).")";
3520 <?php
3522 </td>
3523 </tr>
3524 <?php }
3525 echo "<tr><td class='right' nowrap><b>".xlt('Visit Date').":</b></td><td>&nbsp;".$visit_date."</td></tr>";
3527 <tr><td class="right" style="vertical-align:top;" nowrap><b><?php echo xlt("Provider"); ?>:</b>&nbsp;</td>
3528 <td><?php echo text($providerNAME); ?></td>
3529 </tr>
3531 <tr><td class="right" style="vertical-align:top;" nowrap><b><?php echo xlt("Reason/Plan"); ?>:</b>&nbsp;</td>
3532 <td style="vertical-align:top;">
3533 <?php
3534 // Start with Appt reason from calendar
3535 // Consider using last visit's PLAN field?
3536 //think about this space and how to use it...
3537 $query = "select * from openemr_postcalendar_events where pc_pid=? and pc_eventDate=?";
3538 $res = sqlStatement($query,array($pid,$dated));
3539 $reason = sqlFetchArray($res);
3540 ?>&nbsp;<?php echo text($reason['pc_hometext']);
3541 global $priors;
3542 $PLAN_today = preg_replace("/\|/","<br />",$earlier['PLAN']);
3543 if ($PLAN_today) echo "<br />".text($PLAN_today);
3545 </td>
3546 </tr>
3547 </table>
3548 </div>
3549 </div>
3550 <div id="left_menu3" name="left_menu3" class="col-md-3" style="font-size:1.0em;">
3551 <?php //if the patient has a photograph, use it else use generic avitar thing.
3552 if ($documents['docs_in_name']['Patient Photograph'][0]['id']) {
3554 <object><embed src="<?php echo $GLOBALS['webroot']; ?>/controller.php?document&amp;retrieve&amp;patient_id=<?php echo attr($pid); ?>&amp;document_id=<?php echo attr($documents['docs_in_name']['Patient Photograph'][0]['id']); ?>&amp;as_file=false" frameborder="0"
3555 type="<?php echo attr($documents['docs_in_name']['Patient Photograph'][0]['mimetype']); ?>" allowscriptaccess="always" allowfullscreen="false" height="50"></embed></object>
3556 <?php
3557 } else {
3559 <object><embed src="<?php echo $GLOBALS['web_root']; ?>/interface/forms/<?php echo $form_folder; ?>/images/anon.gif" frameborder="0"
3560 type="image/gif" height="50"></embed></object>
3561 <?php
3564 </div>
3566 <div id="left_menu2" name="left_menu2" class="col-md-4" style="font-size:1.0em;">
3567 <?php
3568 $query = "Select * from users where id =?";
3569 $prov = sqlQuery($query,array($pat_data['ref_providerID']));
3570 $Ref_provider = $prov['fname']." ".$prov['lname'];
3571 $prov = sqlQuery($query,array($pat_data['providerID']));
3572 // $PCP = $prov['fname']." ".$prov['lname'];
3574 $query = "Select * from insurance_companies where id in (select provider from insurance_data where pid =? and type='primary')";
3575 $ins = sqlQuery($query,array($pid));
3576 $ins_co1 = $ins['name'];
3577 $query = "Select * from insurance_companies where id in (select provider from insurance_data where pid =? and type='secondary')";
3578 $ins = sqlQuery($query,array($pid));
3579 $ins_co2 = $ins['name'];
3582 <div style="position:relative;float:left;padding-left:18px;top:0px;">
3583 <table style="border:1pt;font-size:1.0em;">
3584 <tr>
3585 <td class="right"><b><?php echo xlt("PCP"); ?>:</b>&nbsp;</td><td style="font-size:0.8em;">&nbsp;
3586 <?php
3587 $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " .
3588 "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " .
3589 "AND ( authorized = 1 OR ( username = '' AND npi != '' ) ) " .
3590 "ORDER BY lname, fname");
3591 echo "<select name='form_PCP' id='form_PCP' title='".xla('Primary Care Provider')."'>";
3592 echo "<option value=''>" . xlt($empty_title) . "</option>";
3593 $got_selected = false;
3594 while ($urow = sqlFetchArray($ures)) {
3595 $uname = text($urow['lname'] . ' ' . $urow['fname']);
3596 $optionId = attr($urow['id']);
3597 echo "<option value='$optionId'";
3598 if ($urow['id'] == $pat_data['providerID']) {
3599 echo " selected";
3600 $got_selected = true;
3602 echo ">$uname</option>";
3604 if (!$got_selected && $currvalue) {
3605 echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>";
3606 echo "</select>";
3607 echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>";
3609 else {
3610 echo "</select>";
3612 //need to develop a select list that when changed updates the PCP for this patient
3615 </td>
3616 </tr>
3617 <tr><td class="right" nowrap><b><?php echo xlt("Referred By"); ?>:</b>&nbsp;</td><td style="font-size:0.8em;">&nbsp;
3618 <?php
3619 $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " .
3620 "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " .
3621 "AND ( authorized = 1 OR ( username = '') ) " .
3622 "ORDER BY lname, fname");
3623 echo "<select name='form_rDOC' id='form_rDOC' title='".xla('Every name in the address book appears here, not only physicians.')."'>";
3624 echo "<option value=''>" . xlt($empty_title) . "</option>";
3625 $got_selected = false;
3626 while ($urow = sqlFetchArray($ures)) {
3627 $uname = text($urow['lname'] . ' ' . $urow['fname']);
3628 $optionId = attr($urow['id']);
3629 echo "<option value='$optionId'";
3630 if ($urow['id'] == $pat_data['ref_providerID']) {
3631 echo " selected";
3632 $got_selected = true;
3634 echo ">$uname</option>";
3636 if (!$got_selected && $currvalue) {
3637 echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>";
3638 echo "</select>";
3639 echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>";
3641 else {
3642 echo "</select>";
3644 //need to develop a select list that when changed updates the PCP for this patient
3647 </td></tr>
3648 <tr><td class="right"><b><?php echo xlt("Insurance"); ?>:</b>&nbsp;</td><td>&nbsp;<?php echo text($ins_co1); ?></td></tr>
3649 <tr><td class="right"><b><?php echo xlt("Secondary"); ?>:</b>&nbsp;</td><td>&nbsp;<?php echo text($ins_co2); ?></td></tr>
3650 </table>
3651 </div>
3652 </div>
3654 </div>
3655 <?php
3658 * This is currently not used. It can easily be a footer with the practice info
3659 * or whatever you like. Maybe a placeholder for user groups or link outs to data repositories
3660 * such as Medfetch.com/PubMed/UpToDate/DynaMed????
3661 * It could provide information as to available data imports from connected machines - yes we have
3662 * data from an autorefractor needed to be imported. The footer can be fixed or floating.
3663 * It could have balance info, notes, or an upside down menu mirroring the header menu, maybe allowing
3664 * the user to decide which is fixed and which is not? Messaging? Oh the possibilities.
3666 * @param string $pid patient_id
3667 * @param string $encounter is the current encounter number
3668 * @return nothing, outputs directly to screen
3671 function menu_overhaul_bottom($pid,$encounter) {
3672 ?><div class="navbar-custom" style="width:100%;height:25px;position:relative;border-top:1pt solid black;bottom:0px;z-index:1000000;">&nbsp;</div><?php
3676 * This was taken from new_form.php and is helping to integrate new menu with openEMR
3677 * menu seen on encounter page.
3679 function Menu_myGetRegistered($state="1", $limit="unlimited", $offset="0") {
3680 $sql = "SELECT category, nickname, name, state, directory, id, sql_run, " .
3681 "unpackaged, date FROM registry WHERE " .
3682 "state LIKE ? ORDER BY category, priority, name";
3683 if ($limit != "unlimited") $sql .= " limit " . escape_limit($limit) . ", " . escape_limit($offset);
3684 $res = sqlStatement($sql,array($state));
3685 if ($res) {
3686 for($iter=0; $row=sqlFetchArray($res); $iter++) {
3687 $all[$iter] = $row;
3689 } else {
3690 return false;
3692 return $all;
3695 * This prints a header for documents. Keeps the brand uniform...
3696 * @param string $pid patient_id
3697 * @param string $direction, options "web" or anything else. Web provides apache-friendly url links.
3698 * @return outputs directly to screen
3700 function report_header($pid,$direction='shell') {
3701 global $form_name;
3702 global $encounter;
3703 global $visit_date;
3704 /*******************************************************************
3705 $titleres = getPatientData($pid, "fname,lname,providerID");
3706 $sql = "SELECT * FROM facility ORDER BY billing_location DESC LIMIT 1";
3707 *******************************************************************/
3708 //$titleres = getPatientData($pid, "fname,lname,providerID,DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
3709 $titleres = getPatientData($pid, "fname,lname,providerID,DOB");
3710 if ($_SESSION['pc_facility']) {
3711 $sql = "select * from facility where id=?";
3712 $facility = sqlQuery($sql,array($_SESSION['pc_facility']));
3713 } else {
3714 $sql = "SELECT * FROM facility ORDER BY billing_location DESC LIMIT 1";
3715 $facility = sqlQuery($sql);
3717 $DOB = oeFormatShortDate($titleres['DOB']);
3718 /******************************************************************/
3719 ob_start();
3720 // Use logo if it exists as 'practice_logo.gif' in the site dir
3721 // old code used the global custom dir which is no longer a valid
3723 <table style="width:100%;">
3724 <tr>
3725 <td style='width:150px;text-align:top;'>
3726 <?php
3727 if ($direction == "web") {
3728 global $OE_SITE_DIR;
3729 $practice_logo = $GLOBALS['webroot']."/sites/default/images/practice_logo.gif";
3730 if (file_exists($OE_SITE_DIR."/images/practice_logo.gif")) {
3731 echo "<img src='$practice_logo' align='left' style='width:150px;margin:0px 10px;'><br />\n";
3733 } else {
3734 global $OE_SITE_DIR;
3735 $practice_logo = "$OE_SITE_DIR/images/practice_logo.gif";
3736 if (file_exists($practice_logo)) {
3737 echo "<img src='$practice_logo' align='left' style='width:100px;margin:0px 10px;'><br />\n";
3741 </td>
3742 <td style='width:40%;'>
3743 <em style="font-weight:bold;font-size:1.4em;"><?php echo text($facility['name']); ?></em><br />
3744 <?php echo text($facility['street']); ?><br />
3745 <?php echo text($facility['city']); ?>, <?php echo text($facility['state']); ?> <?php echo text($facility['postal_code']); ?><br />
3746 <?php echo xlt('Phone').': ' .text($facility['phone']); ?><br />
3747 <?php echo xlt('Fax').': ' .text($facility['fax']); ?><br />
3748 <br clear='all' />
3749 <?php
3750 $visit= getEncounterDateByEncounter($encounter);
3751 $visit_date = $visit['date'];
3753 </td>
3754 <td>
3755 <em style="font-weight:bold;font-size:1.4em;"><?php echo text($titleres['fname']) . " " . text($titleres['lname']); ?></em><br />
3756 <b style="font-weight:bold;"><?php echo xlt('DOB'); ?>:</b> <?php echo text($DOB); ?><br />
3757 <b style="font-weight:bold;"><?php echo xlt('Generated on'); ?>:</b> <?php echo oeFormatShortDate(); ?><br />
3758 <b><?php echo xlt('Visit Date'); ?>:</b> <?php echo oeFormatSDFT(strtotime($visit_date)); ?><br />
3759 <b><?php echo xlt('Provider') . ':</b> ' . text(getProviderName(getProviderIdOfEncounter($encounter))).'<br />'; ?>
3761 </td>
3762 </tr>
3763 </table>
3764 <?php
3765 $output = ob_get_contents();
3766 ob_end_clean();
3767 return $output;
3771 * This function mines the clinical fields for potential diagnostic codes.
3772 * The clinical fields are found in table list_options with list_id = Eye_Coding_Fields_
3773 * The clinical terms to mine for are in table list_options with list_id = Eye_Coding_Terms
3774 * Both can be directly extended by the user the via Administration -> Lists interface.
3775 * The Coding_Eye_Form_Terms list includes the following important fields:
3776 * Title (the term),
3777 * Notes (the form_field to search for the term)
3778 * Code(s) (the optional user-defined code).
3779 * Terms found in a form_field (Notes) with a predefined Code(s), have that code applied.
3780 * Terms found in a form_field (Notes) without a predefined Code(s) are concated with
3781 * the text value for the form_field (Notes) (found in the list Coding_Eye_Form_Fields: Notes)
3782 * and the codebase is searched for a match.
3783 * For example: the term "ptosis" is found in the RUL clinical field, and there is no Code value in the
3784 * Coding_Eye_Form_Terms Code(s) field. Thus openEMR Eye Form searches the active codebases for a match.
3785 * The codebases are determined in Administration->Lists->Code Types and includes those Codesets flagged
3786 * as active and as Diagnostic codes. The terms "ptosis right upper eyelid" are sent to the
3787 * standard openEMR code search engine.
3788 * @param string $FIELDS - all the clinical fields we are going to scour for clinical terms to code.
3789 * @return outputs directly to screen
3791 function start_your_engines($FIELDS) {//pass an assoc array of fields with terms in it and search them
3792 global $pid;
3793 global $codes_found;
3794 global $PMSFH;
3795 if (!$PMFSH) $PMSFH = build_PMSFH($pid);
3796 $query = "select * from list_options where list_id ='Eye_Coding_Fields' Order by seq";
3797 $result = sqlStatement($query);
3798 while ($fielding =sqlFetchArray($result)) {//build the list of clinical fields to search through
3799 $fields[$fielding['title']] =$fielding['notes'];
3801 //get the clinical terms to search for (title) and what field/where to look for it (notes)
3802 $query = "SELECT * FROM list_options WHERE list_id = 'Eye_Coding_Terms' order by seq";
3803 $result = sqlStatement($query);
3804 while ($term_sheet =sqlFetchArray($result)) {
3805 if ($term_sheet['title'] > '') {
3806 $newdata = array (
3807 'term' => $term_sheet['title'], //the term =/- possible option_values eg. CSME:DM|IOL|RVO
3808 'location' => $term_sheet['notes'], //the form field to search for the term
3809 'codes' => $term_sheet['codes'] //the specific code for this term/location, may be blank
3811 $clinical_terms[] =$newdata;
3814 if (!$clinical_terms) return;
3815 $positives = array();
3816 // Terms are sequenced in the DB (seq) from detailed (more complex descriptions) to a simple (one word) description.
3817 // $clinical_terms[] is built in this sequence also.
3818 // eg. "cicatricial ectropion","spastic ectropion", "ectropion".
3819 // If "cicatricial ectropion" is present in this clinical field (or "spastic ectropion" for that matter),
3820 // then there is no need to report the presence of "ectropion" as a clinical finding to the Imp/Plan Builder.
3821 // needle/haystack lookup $positives[] = $term;
3822 // For terms that overlap other diseases, use term:option|option|option. These are always last to process.
3824 foreach ($clinical_terms as $amihere) {
3825 $option_values="";
3826 $term="";
3827 $code_found = array();
3828 if (stripos($amihere['term'],":") !== false) { //options are stored here code:option_values
3829 list ($term,$option_values) = explode(":",$amihere['term']);
3830 } else {
3831 $term = $amihere['term'];
3833 if (stripos($FIELDS[$amihere['location']],$term) !==false) {
3834 //the term is in the field
3835 $within_array = 'no';
3836 if (isset($positives[$amihere['location']]) > '') { //true if anything was already found in this field
3837 //do any of the previous hits found in in this location contain this term already?
3838 //if so stop; if not, continue onward to add to Builder.
3839 foreach( $positives[$amihere['location']] as $k=>$v ){
3840 if( preg_match("/$term/",$v)) {
3841 $within_array = 'yes';
3842 break;
3846 if ($within_array =="yes") continue;
3847 $positives[$amihere['location']][]=$term;
3848 if (preg_match("/^(OD)/",$amihere['location'])) {
3849 $side = "right eye";
3850 $side1 = "OD";
3851 $side2 = "R";
3852 } else {
3853 $side = "left eye";
3854 $side1 = "OS";
3855 $side2 = "L";
3857 if (($amihere['codes'] > '') && ($option_values=="")) { //did the user define a code for this term in list Eye_Coding_Terms?
3858 //If so process - we are primed and don't need the carburetor for the Builder
3859 //eg ICD10:H02.891
3860 if (stripos($amihere['codes'],":") !== false) {
3861 list($code_type,$code) = explode(":",$amihere['codes']);
3862 } else {
3863 //default to ICD10. Maybe there is a GLOBALS value for this? Maybe there should be?
3864 $code_type="ICD10";
3866 $code_found['code'] = $code_type.":".$code;
3867 $code_found['code_type'] = $code_type;
3868 list($sub_term,$newdata) = coding_engine($term,$code_found,$amihere['location']);
3869 $codes_found[$sub_term][] = $newdata;
3870 $positives[$location][]=$term;
3871 } else { //no code was defined, further processing needed.
3872 if ($option_values) {
3873 // This clinical finding (term) can be found in more than one disease process ('option_values')
3874 // This special group of terms should be processed last, to identify all
3875 // possible results for the Builder.
3876 // 'option_values' contains pertinent DXs separated by '|', eg. CSME has option values='DM|IOL|RVO'
3877 // Need to see if any of these DX apply and builder Codes_found based on the currently installed list of codes
3878 // Currently for most users this is ICD10 but it is built to allow extension to any code sets in openEMR,
3879 // including foreign laguage code sets.
3880 $options = explode("|",$option_values);
3881 $hit_here="0";
3883 foreach ($options as $option) {
3884 // if it has mass, try to execute it.
3885 $term_now="";
3886 if ($option=="DM") {
3887 //This option is run for 3 conditions at present:
3888 //CSME/NVD/NVE per eye. It is the same every time so only do it once, per eye.
3889 //Did we already code this? If so move on.
3890 if ($hit_DM[$side1]=='1') continue;
3892 //Are ICD10 etc codes used in other languages? Via Snomed? Via user?
3893 //Assume there is a standard for xlt/xla purposes...
3895 //is the patient diabetic?
3896 //search medical_problem for DM
3897 $within_array="";
3898 foreach( $PMSFH[0]['PMH'] as $k=>$v ){
3899 if ( stripos($v['codedesc'],"diabetes")) {
3900 $DM_code = $v['codedesc'];
3901 $within_array = 'yes';
3904 if ($within_array =="yes") {
3905 if (stripos($DM_code,"1")) {
3906 $DM_text = "Type 1 diabetes mellitus";
3907 $label = "DM 1";
3908 } else if (stripos($DM_code,"2")) {
3909 $DM_text = "Type 2 diabetes mellitus";
3910 $label = "DM 2";
3911 } else {
3912 $DM_text = "Other specified diabetes";
3913 $label = "DM";
3915 } else { //there is no code that lists diabetes in the PMH
3916 continue;
3918 //is there CSME
3919 if ($side=="right eye") {
3920 $location ="ODMACULA";
3921 $location1 ="ODDISC";
3922 $location2 ="ODVESSELS";
3923 $location3 ="ODPERIPH";
3924 } else if ($side=="left eye") {
3925 $location ="OSMACULA";
3926 $location1 ="OSDISC";
3927 $location2 ="OSVESSELS";
3928 $location3 ="OSPERIPH";
3930 if ((stripos($FIELDS[$location],"flat") ===false) && (stripos($FIELDS[$location],"CSME") !==false)) {
3931 //what if they type "no CSME" or "not flat"?
3932 $MAC_text = "with macular edema";
3933 $hit_CSME = "w/ CSME";
3934 } else {
3935 $MAC_text="without macular edema";
3936 $hit_CSME="w/o CSME";
3938 //is there (NVD or NVE) or BDR?
3939 $NVD = "NVD";
3940 $NVE = "NVE";
3941 $PPDR = "PPDR";
3942 $PDR = "PDR";
3943 $BDR = "BDR";
3944 $IRMA = "IrMA";
3945 if ((stripos($FIELDS[$location1],$NVD) !==false) ||
3946 (stripos($FIELDS[$location2],$NVE) !==false) ||
3947 (stripos($FIELDS[$location3],$NVE) !==false)) {
3948 $DX="with proliferative";
3949 $label = $label. "w/ PDR ".$hit_CSME;
3950 $hit_PDR[$side]='1';
3951 } else if (
3952 (stripos($FIELDS[$location2],$PPDR) !==false) ||
3953 (stripos($FIELDS[$location2],$PPDR) !==false) ||
3954 (stripos($FIELDS[$location],$IRMA) !==false) ||
3955 (stripos($FIELDS[$location2],$IRMA) !==false) ||
3956 (stripos($FIELDS[$location3],$IRMA) !==false))
3958 $DX="with severe nonproliferative";
3959 $label = $label." w/ PPDR ".$hit_CSME;
3960 $hit_PPDR[$side]='1';
3961 } else if (
3962 (stripos($FIELDS[$location],$BDR) !==false) ||
3963 (stripos($FIELDS[$location2],$BDR) !==false))
3965 $trace = "tr";
3966 if (
3967 (stripos($FIELDS[$location],$trace." ".$BDR) !==false) ||
3968 (stripos($FIELDS[$location2],"+1 ".$BDR) !==false) ||
3969 (stripos($FIELDS[$location],$trace." ".$BDR) !==false) ||
3970 (stripos($FIELDS[$location2],"+1 ".$BDR) !==false)) {
3971 $DX="with mild nonproliferative";
3972 $label = $label." w/ mild BDR ".$hit_CSME;
3973 $hit_BDR[$side]='1';
3974 } else {
3975 $DX="with moderate nonproliferative";
3976 $label = $label." w/ mod BDR ".$hit_CSME;
3977 $hit_BDR[$side] = '1';
3980 $code_found = coding_carburetor($DM_text,$MAC_text);
3981 if (isset($code_found)) { //there are matches, present them to the engine
3982 foreach ($code_found as $found) {
3983 list($sub_term,$newdata) = coding_engine($label,$found,$amihere['location'],$side1);
3984 // The carburetor is a simple machine - it has no boolean options -
3985 // so "with" and "without" match a search for "with"...
3986 // We need to be specific to whittle down the options.
3987 if ((stripos($newdata['codedesc'],$MAC_text)) && (stripos($newdata['codedesc'],$DX))) {
3988 //does this code already exist for the other eye (right eye is always first)?
3989 //if so, change OD to OU and skip adding this code.
3990 if ($side1=="OS"){
3991 $count='0';
3992 for ($i=0; $i < count($codes_found[$sub_term]); $i++) {
3993 $swap="OD";
3994 $codes_found[$sub_term][$i]['title'] = str_replace($swap, "OU", $codes_found[$sub_term][$i]['title']);
3995 break 2;
3996 $count++;
3999 $codes_found[$sub_term][] = $newdata;
4000 $positives["DM".$side1][] = $newdata['code'];
4001 $hit_DM[$side1]='1';
4005 } else if ($option=="RVO") {
4006 //is there a CRVO or BRVO associated?
4007 //check Clinical fields for these terms
4008 if ($side=="right eye") {
4009 $location ="ODVESSELS";
4010 } else {
4011 $location ="OSVESSELS";
4013 if ($hit_RVO[$location] == '1') continue;
4014 if (stripos($FIELDS[$location],"CRVO") !==false) {
4015 // this is a CRVO, look up code for location
4016 $terms = "CRVO";
4017 $code_found = coding_carburetor("central retinal vein",$side);
4018 if (isset($code_found)) { //there are matches, present them to the Builder
4019 foreach ($code_found as $found) {
4020 list($sub_term,$newdata) = coding_engine($terms,$found,$location,$side1);
4021 $codes_found[$sub_term][] = $newdata;
4022 $positives[$location][]="CRVO";
4023 $hit_RVO[$location] ="1";
4026 } else if (stripos($FIELDS[$location],"BRVO") !==false) {
4027 // this is a BRVO, look up code for location
4028 $code_found = coding_carburetor("branch retinal vein",$side);
4029 $terms = "BRVO ".$term;
4030 if (isset($code_found)) { //there are matches, present them to the Builder
4031 foreach ($code_found as $found) {
4032 list($sub_term,$newdata) = coding_engine($terms,$found,$location,$side1);
4033 $codes_found[$sub_term][] = $newdata;
4034 $positives[$location][]="BRVO";
4035 $hit_RVO[$location]='1';
4039 if (($term=="CSME") && ($hit_RVO[$location]=='1')) {
4040 //$code = "H35.81";
4041 $code_found = coding_carburetor("retinal","edema");
4042 $terms = "Vein occlusion and macular edema";
4043 if (isset($code_found)) { //there are matches, present them to the Builder
4044 foreach ($code_found as $found) {
4045 if ($found['code'] == "ICD10:H35.81") {
4046 list($sub_term,$newdata) = coding_engine($terms,$found,$location,$side1);
4047 $codes_found[$sub_term][] = $newdata;
4048 $positives[$location][]="CSME";
4049 $hit_RVO_CSME='1';
4054 } else if ($option=="IOL") {
4055 //are they within 3 months of cataract surgery on this eye? Yag?
4056 //search the same side Lens field for term IOL, ? procedure this eye in last 3 months?
4057 //search surgery_issue_list or even search the billng engine
4058 $query = "select begdate as surg_date from lists where pid=? and type='surgery' and title like '%IOL%' and (title like '%".xlt($side1)."%')";
4059 $surg = sqlQuery($query,array($pid));
4060 if ($surg['surg_date']>'') {
4061 $date1 = date('Y-m-d');
4062 //$date2 = (DateTime($surg['surg_date']));
4063 //echo $term."\n".$date."\n";continue;
4064 $date_diff=strtotime($date1) - strtotime($surg['surg_date']);
4065 $interval = $date_diff/(60 * 60 * 24);
4066 //$interval = 200;
4067 if (($interval < '180') && ($term=="CSME")) {
4068 //then this could be post procedure CSME cystoid macular edema H59.031,2 OD OS
4069 $code_found = coding_carburetor("cystoid macular edema",$side);
4070 if (isset($code_found)) { //there are matches, present them to the Builder
4071 foreach ($code_found as $found) {
4072 $term = "Post-cataract CME";
4073 list($sub_term,$newdata) = coding_engine($term,$found,$amihere['location'],$side1);
4074 $codes_found[$sub_term][] = $newdata;
4075 $positives[$amihere['location']][]= $term;
4076 $hit_IOL='1';
4078 if ($side1=="OS"){
4079 $count='0';
4080 for ($i=0; $i < count($codes_found[$sub_term]); $i++) {
4081 $swap="OD";
4082 $codes_found[$sub_term][$i]['title'] = str_replace($swap, "OU", $codes_found[$sub_term][$i]['title']);
4083 break 2;
4084 $count++;
4087 } else {
4088 //echo "Not here. $term. $interval \n";
4092 } else {
4093 //should we have another big Dx often altering what a finding means to a coder; this is a placeholder.
4094 //include $option in our code search for this term
4095 $term_now = $term ." ".$option;
4096 $code_found = coding_carburetor($term_now,$fields[$amihere['location']]);
4097 if (isset($code_found)) { //there are matches, present them to the Builder
4098 foreach ($code_found as $found) {
4099 list($sub_term,$newdata) = coding_engine($term,$found,$amihere['location'],$side1);
4100 $codes_found[$sub_term][] = $newdata;
4101 $positives[$amihere['location']][]= $term_now;
4106 } else {
4107 //there are no options and no code identified,
4108 //search via carburetor for possible matches to term and description of the form field
4109 $code_found = coding_carburetor($term,$fields[$amihere['location']]);
4110 if ($code_found !== NULL) { //there are matches, present them to the Builder
4111 foreach ($code_found as $found) {
4112 list($sub_term,$newdata) = coding_engine($term,$found,$amihere['location']);
4113 $codes_found[$sub_term][] = $newdata;
4114 $positives[$amihere['location']][]= $term;
4121 // $codes_found contains the PE/Clinical findings for the Imp/Plan Builder engine.
4122 // It also gets "horsepower" from the POH/POS and PMH findings.
4123 // Together these three form the Imp/Plan Builder's suggestions available to the end user to build the Imp/Plan,
4124 // and by extension one of the data sources for the Coding Engine to populate the fee sheet.
4125 // When entering a Dx in the PMSFH, it pays to assign these codes up front...
4126 // The rest is exhaust fumes for the muffler.
4127 return $codes_found;
4130 * This function checks a single field for a term and, if found, codes it.
4131 * It is not called directly but via the wrapper function start_your_engines().
4133 * @param string $term, text to search for in the coding tables.
4134 * @param string $field, location where to search. In fact any text that refines the search can be contained here.
4135 * @return outputs array of $codes matching the $term & $field
4137 function coding_carburetor($term,$field) {
4138 if (!$term||!$field) return;
4139 $codes = array();
4140 $code_type = "ICD10"; //only option is PROD (product or drug search) or NOT PROD...
4141 $search_term = $term." ".$field;
4142 $res = main_code_set_search($code_type,$search_term);
4143 while ($row = sqlFetchArray($res)) {
4144 $newdata = array (
4145 'code' => $row['code'],
4146 'code_text' => $row['code_text'],
4147 'code_type' => $row['code_type_name'],
4148 'code_desc' => $row['code_desc']
4150 $codes[] =$newdata;
4152 return $codes;
4155 * This function prepares a code found in a clinical field and returns it in $codes_found format.
4156 * @param $code is in the format code_type:code eg. ICD10:H34.811
4157 * @param $location is the descruiptive name of the clinical field in question
4158 * @param $side is optional. Used as the descriptive text for the finding in the Builder
4159 * and IMP/Plan if selected from the Builder
4160 * @return $subterm,$newdata. $subterm is used to link items in IMP/PLAN back to its orgin.
4161 * $newdata is the array of newly found items to include in the Builder.
4163 * This function is not called directly but via the wrapper function start_your_engines().
4165 function coding_engine($term, $code_found,$location,$side='') {
4166 if (strpos($code_found['code'],":")) {
4167 list($code_type, $code) = explode(':', $code_found['code']);
4168 } else {
4169 $code = $code_found['code'];
4170 $code_type = "ICD10";//default to ICD10
4171 $code_found['code'] = $code_type.":".$code_found['code'];
4173 $code_desc = lookup_code_descriptions($code_found['code']);
4174 $order = array("\r\n", "\n","\r");
4175 $code_desc = str_replace($order,'',$code_desc);
4177 $code_text = text($code_found['code']). " (" . text($code_desc) . ")";
4178 $replace =" ";
4179 $sub_term = str_replace($replace,"",$term);
4180 //some codes are bilateral, some not, some are per eyelid. Comment this out for now:
4181 //(preg_match("/right/",$code_desc))? $side = xlt('OD{{right eye}}') : $side = xlt('OS{{left eye}}');
4183 $newdata = array (
4184 'title' => ucfirst($term). " ".$side,
4185 'location' => $location,
4186 'diagnosis' => $code,
4187 'code' => $code,
4188 'codetype' => $code_found['code_type'],
4189 'codedesc' => $code_desc,
4190 'codetext' => $code_text,
4191 'PMSFH_link' => "Clinical_".$sub_term
4193 return array($sub_term,$newdata);
4196 * This is a function to sort an array of dates/times etc
4197 * Anything strtotime() can recognize at least.
4199 function cmp($a, $b) {
4200 if ($a == $b) return 0;
4201 return (strtotime($a) < strtotime($b))? -1 : 1;
4205 * This function returns the TARGET IOP values for a given ($pid) if ever set, otherwise returns the DEFAULT IOP.
4206 * when a value is found for a given field in the Eye Form for a given patient ($pid)
4207 * @param $name is in the name of the field
4209 * @return $ranges. A mysqlArray(max_FIELD,max_date,min_date)
4211 function display_GlaucomaFlowSheet($pid,$bywhat='byday') {
4212 global $PMSFH;
4213 global $documents;
4214 global $form_folder;
4215 global $priors;
4216 global $providerID;
4217 global $documents;
4218 global $encounter_data;
4219 global $ODIOPTARGET;
4220 global $OSIOPTARGET;
4221 global $dated;
4223 if (!$documents) {
4224 list($documents) = document_engine($pid);
4226 $count_OCT = count($documents['docs_in_name']['OCT']);
4227 if ($count_OCT > 0) {
4228 foreach ($documents['docs_in_name']['OCT'] as $OCT) {
4229 $OCT_date[] = $OCT['docdate'];
4232 $count_VF = count($documents['docs_in_name']['VF']);
4233 if ($count_VF > 0) {
4234 foreach ($documents['docs_in_name']['VF'] as $VF) {
4235 $VF_date[] = $VF['docdate'];
4238 $i=0;
4239 //if there are no priors, this is the first visit, display a generic splash screen.
4240 if ($priors) {
4241 foreach ($priors as $visit) {
4242 //we need to build the lists - dates_OU,times_OU,gonio_OU,OCT_OU,VF_OU,ODIOP,OSIOP,IOPTARGETS
4243 $old_date_timestamp = strtotime($visit['visit_date']);
4244 $visit['exam_date'] = date('Y-m-d', $old_date_timestamp);
4245 $VISITS_date[$i] = $visit['exam_date'];
4247 //$date_OU[$i] = $visit['exam_date'];
4249 $time_here = explode(":",$visit['IOPTIME']);
4250 $time = $time_here[0].":".$time_here[1];
4251 $time_OU[$i] = $time;
4253 if (($visit['ODGONIO'] > '')||($visit['OSGONIO'] > '')) {
4254 $GONIO_date[$i] = $visit["exam_date"];
4255 $GONIO[$i]["list"] = '1';
4256 } else {
4257 $GONIO[$i]["list"] = '';
4259 if ($visit['ODIOPAP']>'') {
4260 $ODIOP[$i]['IOP'] = $visit['ODIOPAP'];
4261 $ODIOP[$i]['method'] = "AP";
4262 } else if ($visit['ODIOPTPN']>'') {
4263 $ODIOP[$i]['IOP'] = $visit['ODIOPTPN'];
4264 $ODIOP[$i]['method'] = "TPN";
4265 } else {
4266 $ODIOP[$i]['IOP'] ="";
4268 if ($visit['OSIOPAP']>'') {
4269 $OSIOP[$i]['IOP'] = $visit['OSIOPAP'];
4270 $OSIOPMETHOD[$i]['method'] = "AP";
4271 } else if ($visit['OSIOPTPN']>'') {
4272 $OSIOP[$i]['IOP'] = $visit['OSIOPTPN'];
4273 $OSIOPMETHOD[$i]['method'] = "TPN";
4274 } else {
4275 $OSIOP[$i]['IOP'] = "null";
4276 //we are ignoring finger tension for graphing purposes but include this should another form of IOP measurement arrive...
4277 //What about the Triggerfish contact lens continuous IOP device for example...
4280 //build the Target line values for each date.
4281 $j = $i - 1;
4282 if ($visit['ODIOPTARGET']>'') {
4283 $ODIOPTARGETS[$i]= $visit['ODIOPTARGET'];
4284 } else if (!$ODIOPTARGETS[$j]) { //get this from the provider's default list_option
4285 $query = "SELECT * FROM `list_options` WHERE `list_id` LIKE 'Eye_defaults_".$providerID."' and (option_id = 'ODIOPTARGET' OR option_id = 'OSIOPTARGET')";
4286 $results = sqlQuery($query);
4287 while ($default_TARGETS = sqlFetchArray($result)) {
4288 if ($default_TARGETS['option_id']=='ODIOPTARGET') {
4289 $ODIOPTARGETS[$i] = $default_TARGETS["title"];
4291 if ($default_TARGETS['option_id']=='OSIOPTARGET') {
4292 $OSIOPTARGETS[$i] = $default_TARGETS["title"];
4295 } else {
4296 $ODIOPTARGETS[$i] = $ODIOPTARGETS[$j];
4298 if ($visit['OSIOPTARGET']>'') {
4299 $OSIOPTARGETS[$i] = $visit['OSIOPTARGET'];
4300 } else if (!$OSIOPTARGETS[$j] > ''){
4301 if (!$OSIOPTARGETS[$i]) {
4302 $query = "SELECT * FROM `list_options` WHERE `list_id` LIKE 'Eye_defaults_".$providerID."' and (option_id = 'ODIOPTARGET' OR option_id = 'OSIOPTARGET')";
4303 $results = sqlQuery($query);
4304 while ($default_TARGETS = sqlFetchArray($result)) {
4305 if ($default_TARGETS['option_id']=='OSIOPTARGET') {
4306 $OSIOPTARGETS[$i] = $default_TARGETS["title"];
4310 } else {
4311 $OSIOPTARGETS[$i] = $OSIOPTARGETS[$j];
4313 $i++;
4315 } else { //there are no priors, get info for this visit
4316 $VISITS_date[0] = $dated;
4317 if ($encounter_data['IOPTIME']) {
4318 $time_here = explode(":",$encounter_data['IOPTIME']);
4319 $time = $time_here[0].":".$time_here[1];
4320 $time_OU[] = $time;
4322 if ($encounter_data['ODGONIO']||$encounter_data['OSGONIO']) {
4323 $GONIO_date[$i] = $dated;
4325 $ODIOP[$i]['time'] = $time;
4326 $OSIOP[$i]['time'] = $time;
4327 //$IOPTARGET['visit_date'] = $encounter_data['exam_date'];
4328 if ($encounter_data['ODIOPAP']>'') {
4329 $ODIOP[$i]['IOP'] = $encounter_data['ODIOPAP'];
4330 $ODIOP[$i]['method'] = "AP";
4331 } else if ($encounter_data['ODIOPTPN']>'') {
4332 $ODIOP[$i]['IOP'] = $encounter_data['ODIOPTPN'];
4333 $ODIOP[$i]['method'] = "TPN";
4335 if ($encounter_data['OSIOPAP']>'') {
4336 $OSIOP[$i]['IOP'] = $encounter_data['OSIOPAP'];
4337 $OSIOP[$i]['method'] = "AP";
4338 } else if ($encounter_data['OSIOPTPN']>'') {
4339 $OSIOP[$i]['IOP'] = $encounter_data['OSIOPTPN'];
4340 $OSIOP[$i]['method'] = "TPN";
4341 } else {
4342 //we are ignoring finger tension for graphing purposes but include this should another form of IOP measurement arrive...
4343 //What about the Triggerfish contact lens continuous IOP device for example...
4346 if ($encounter_data['ODIOPTARGET']>'') {
4347 $ODIOPTARGETS[$i] = $encounter_data['ODIOPTARGET'];
4348 } else {
4349 $query = "SELECT * FROM `list_options` WHERE `list_id` LIKE 'Eye_defaults_".$providerID."' and (option_id = 'ODIOPTARGET' OR option_id = 'OSIOPTARGET')";
4350 $results = sqlQuery($query);
4351 while ($default_TARGETS = sqlFetchArray($result)) {
4352 if ($default_TARGETS['option_id']=='ODIOPTARGET') {
4353 $ODIOPTARGETS[$i] = $default_TARGETS["title"];
4355 if ($default_TARGETS['option_id']=='OSIOPTARGET') {
4356 $OSIOPTARGETS[$i] = $default_TARGETS["title"];
4361 if ($encounter_data['OSIOPTARGET']>'') {
4362 $OSIOPTARGETS[$i] = $encounter_data['ODIOPTARGET'];
4363 } else if (!$OSIOPTARGETS[$i] > ''){
4364 $query = "SELECT * FROM `list_options` WHERE `list_id` LIKE 'Eye_defaults_".$providerID."' and (option_id = 'ODIOPTARGET' OR option_id = 'OSIOPTARGET')";
4365 $results = sqlQuery($query);
4366 while ($default_TARGETS = sqlFetchArray($result)) {
4367 if ($default_TARGETS['option_id']=='OSIOPTARGET') {
4368 $OSIOPTARGETS[$i] = $default_TARGETS["title"];
4373 //There are visits for testing only, no IOP.
4374 //We need to insert these dates into the arrays created above.
4375 //recreate them to include the testing only dates, placing null values for those dates if not done.
4377 //can't merge empty arrays
4378 $list = array();
4379 $arrs[]=$OCT_date;
4380 $arrs[]=$VF_date;
4381 $arrs[]=$GONIO_date;
4382 $arrs[]=$VISITS_date;
4384 foreach($arrs as $arr) {
4385 if(is_array($arr)) {
4386 $list = array_merge($list, $arr);
4390 $date_OU = array_unique($list);
4391 usort($date_OU,"cmp");
4392 $times_OU=$time_OU;
4393 usort($times_OU,"cmp");
4395 for ($a=0; $a < count($date_OU); $a++) {
4396 foreach ($GONIO_date as $GONIO) {
4397 if ($date_OU[$a] == $GONIO) {
4398 $GONIO_values[$a] = "1";
4399 break;
4402 if (!$GONIO_values[$a]) $GONIO_values[$a] = "";
4404 if ($count_OCT > 0) {
4405 foreach ($OCT_date as $OCT) {
4406 if ($date_OU[$a] == $OCT) {
4407 $OCT_values[$a] = "1";
4408 break;
4412 if (!$OCT_values[$a]) $OCT_values[$a] = "";
4414 if ($count_VF > 0) {
4415 foreach ($VF_date as $VF) {
4416 if ($date_OU[$a] == $VF) {
4417 $VF_values[$a] = "1";
4418 break;
4422 if (!$VF_values[$a]) $VF_values[] ="";
4424 for ($k=0; $k < count($VISITS_date); $k++) {
4425 if ($date_OU[$a] == $VISITS_date[$k]) {
4426 $OD_values[$a] = "'".$ODIOP[$k]['IOP']."'";
4427 $OD_methods[$a] = $ODIOP[$k]['method'];
4428 $OS_values[$a] = $OSIOP[$k]['IOP'];
4429 $OS_methods[$a] = $OSIOP[$k]['method'];
4430 $ODIOPTARGET_values[$a] = $ODIOPTARGETS[$k];
4431 $OSIOPTARGET_values[$a] = $OSIOPTARGETS[$k];
4432 break;
4435 if (!$OD_values[$a]) $OD_values[$a] = '';
4436 if (!$OS_values[$a]) $OS_values[$a] = '';
4437 if (!$OD_methods[$a]) $OD_methods[$a] = "";
4438 if (!$OS_methods[$a]) $OS_methods[$a] = "";
4439 if (!$ODIOPTARGET_values[$a]) $ODIOPTARGET_values[$a] = "";
4440 if (!$OSIOPTARGET_values[$a]) $OSIOPTARGET_values[$a] = "";
4443 for ($a=0; $a < count($times_OU); $a++) {
4444 for ($k=0; $k < count($ODIOP); $k++) {
4445 if ($times_OU[$a] == $time_OU[$k]) {
4446 $OD_time_values[$a] = $ODIOP[$k]['IOP'];
4447 $OS_time_values[$a] = $OSIOP[$k]['IOP'];
4448 break;
4451 if (!$OD_time_values[$a]) $OD_time_values[$a] = "";
4452 if (!$OS_time_values[$a]) $OS_time_values[$a] = "";
4456 $dates_OU = "'".implode("','",$date_OU)."'";
4457 $OD_values = implode(",",$OD_values);
4458 $OS_values = implode(",",$OS_values);
4459 $OCT_values = "'".implode("','",$OCT_values)."'";
4460 $VF_values = "'".implode("','",$VF_values)."'";
4461 $GONIO_values = "'".implode("','",$GONIO_values)."'";
4462 $IOPTARGET_values = implode(",",$ODIOPTARGET_values);
4463 $times_OU = "'".implode("','",$times_OU)."'";
4464 $OD_time_values = "'".implode("','",$OD_time_values)."'";
4465 $OS_time_values = "'".implode("','",$OS_time_values)."'";
4467 ?> <b> <?php echo xlt('Glaucoma Zone'); ?>:</b>
4468 <br /><br />
4469 <span class="closeButton fa fa-close" id="Close_IOP" name="Close_IOP"></span>
4470 <div id="GFS_table" name="GFS_table" class="table-responsive borderShadow" style="position:relative;display:table;float:left;margin-top:10px;padding:15px;text-align:left;vertical-align:center;width:30%;">
4471 <table class="GFS_table">
4472 <tr >
4473 <td colspan="1" class="GFS_title_1" style="padding-bottom:3px;border:none;" nowrap><?php echo xlt('Current Target'); ?>:
4474 <td class='GFS_title center' style="padding-bottom:3px;border:none;" nowrap><?php echo xlt('OD{{right eye}}'); ?>: <input type="text" style="width: 20px;" name="ODIOPTARGET" id="ODIOPTARGET" value="<?php echo attr($ODIOPTARGET); ?>" /></td>
4475 <td class='GFS_title center' style="padding-bottom:3px;border:none;" nowrap><?php echo xlt('OS{{left eye}}'); ?>: <input type="text" style="width: 20px;" name="OSIOPTARGET" id="OSIOPTARGET" value="<?php echo attr($OSIOPTARGET); ?>" /></td>
4476 </tr>
4477 <tr>
4478 <td colspan="3" class="hideme nodisplay">
4479 TARGET IOP HISTORY
4480 </td>
4481 </tr>
4482 <?php
4483 //what active meds have a subtype eye?
4484 $i=0;
4485 $count_Meds = count($PMSFH[0]['Medication']);
4486 if ($count_Meds > '0') {
4487 foreach ($PMSFH[0]['Medication'] as $drug) {
4488 if (($drug['row_subtype'] =="eye") && ($drug['enddate'] !== "")) {
4489 $current_drugs .= "<tr><td colspan='2' class='GFS_td_1'><span name='QP_PMH_".attr($drug['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($drug['rowid'])."'
4490 onclick=\"alter_issue2('".attr(addslashes($drug['rowid']))."','Medication','$i');\">".text($drug['title'])."</span></td>
4491 <td class='GFS_td'>".oeFormatShortDate($drug['begdate'])."</td></tr>";
4493 } else if (($drug['row_subtype'] =="eye")&&($drug['enddate'] > "")&&(strtotime($drug['enddate']) < strtotime($visit_date))) {//what meds have a subtype eye that are discontinued?
4494 $hideme = "hideme_drugs nodisplay";
4495 $FAILED_drugs .= "<tr class='".$hideme."'><td colspan='1' class='GFS_td_1'><span name='QP_PMH_".attr($drug['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($drug['rowid'])."'
4496 onclick=\"alter_issue2('".attr(addslashes($drug['rowid']))."','Medication','$i');\">".text($drug['title'])."</span></td>
4497 <td class='GFS_td'>".oeFormatShortDate($drug['begdate'])."</td><td class='GFS_td'>".oeFormatShortDate($drug['enddate'])."</td></tr>";
4499 $i++;
4501 if (!$current_drugs) {$current_drugs = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('None documented')."</td></tr>"; $no_drugs='1'; }
4502 foreach ($PMSFH[0]['Medication'] as $drug) {
4503 if (($drug['row_subtype'] =="eye")&&($drug['enddate'] > "")) $FAILED_drug .= "<li>".text($drug['title'])."</li>";
4507 <tr class="GFS_tr">
4508 <td colspan="2" class="GFS_title"><?php echo xlt('Current Eye Meds'); ?>:</td>
4509 <?php ($no_drugs) ? ($meds_here = '') : $meds_here = xlt('Start'); ?>
4510 <td class="GFS_title" style="text-align:center;"><?php echo $meds_here; ?></td>
4511 <?php if ($FAILED_drugs) echo '<td><span class="right toggleme" id="toggle_drugs"><i class="fa fa-toggle-down"></i></span></td>'; ?>
4512 </tr>
4513 <?php
4514 echo $current_drugs;
4515 if ($FAILED_drugs) echo '<tr class="'.$hideme.'"><td class="GFS_title" colspan="1">'.xlt('Prior Eye Meds').'</td><td class="GFS_title" style="text-align:center;">'. xlt('Start').'</td><td style="text-align:center;" class="GFS_title">End</td></tr>';
4516 echo $FAILED_drugs;
4518 //start VF section
4519 if ($count_VF > '0') { //need to decide how many to show on open, and hide the rest? For now the first only.
4520 $count=0;
4521 foreach ($documents['docs_in_name']['VF'] as $VF) {
4522 if ($count < 1) {
4523 $current_VF = '<tr><td colspan="3" class="GFS_td_1 blue"><a href="../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($VF['parent']).'&encounter='.$encounter.'&category_name=VF" '.
4524 'onclick="return dopopup(\'../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($VF['parent']).'&encounter='.$encounter.'&category_name=VF">
4525 '.$VF['encounter_date'].'&nbsp;<img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" style="width:15px; height:15px;" /></a></td></tr>';
4526 } else {
4527 $old_VFs .= '<tr><td colspan="3" class="GFS_td_1 hideme_VFs nodisplay""><a href="../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($VF['parent']).'&encounter='.$encounter.'&category_name=VF" '.
4528 'onclick="return dopopup(\'../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($VF['parent']).'&encounter='.$encounter.'&category_name=VF">
4529 '.$VF['encounter_date'].'&nbsp;<img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" style="width:15px; height:15px;" /></a></td></tr>';
4531 $count++;
4533 } else {
4534 $current_VF = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('Not documented')."</td></tr>";
4537 <tr class="GFS_tr">
4538 <td colspan="3" class="GFS_title"><?php echo xlt('Visual Fields'); ?>:
4539 <?php
4540 if ($old_VFs) echo '<td><span class="top right" id="toggle_VFs"><i class="fa fa-toggle-down"></i></span></td>';
4542 </tr>
4543 <?php echo $current_VF.$old_VFs;
4544 //end VF section
4546 //start Optic Nerve section
4548 <tr>
4549 <td colspan="3" class="GFS_title"><?php echo xlt('Optic Nerve Analysis'); ?>:&nbsp;
4550 <?php
4551 if ($count_OCT > '0') { //need to decide how many to show on open, and hide the rest? For now show first, hide rest.
4552 $count=0;
4553 foreach ($documents['docs_in_name']['OCT'] as $OCT) {
4554 //get encounter date from encounter id
4555 if ($count < 1) {
4556 $current_OCT = '<tr><td colspan="3" class="GFS_td_1"><a href="../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($OCT['parent']).'&encounter='.$encounter.'&category_name=OCT" '.
4557 'onclick="return dopopup(\'../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($OCT['parent']).'&encounter='.$encounter.'&category_name=OCT">
4558 '.$OCT['encounter_date'].'&nbsp;<img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" style="width:15px; height:15px;" /></a></td></tr>';
4559 } else {
4560 $old_OCTs .= '<tr><td class="hideme_OCTs nodisplay GFS_td_1" colspan="3"><a href="../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($OCT['parent']).'&encounter='.$encounter.'&category_name=OCT" '.
4561 'onclick="return dopopup(\'../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($OCT['parent']).'&encounter='.$encounter.'&category_name=OCT">
4562 '.$OCT['encounter_date'].'&nbsp;<img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" style="width:15px; height:15px;" /></a></td></tr>';
4564 $count++;
4566 } else {
4567 $current_OCT = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('Not documented')."</td></tr>";
4569 if ($old_OCTs) { echo '<td><span class="top right " id="toggle_OCTs"><i class="fa fa-toggle-down"></i></span></td>'; }
4570 echo "</tr>";
4571 echo $current_OCT.$old_OCTs;
4573 $count=0;
4574 $hideme='';
4575 foreach ($priors as $visit) {
4576 if (($visit['ODGONIO'] > " ")||($visit['OSGONIO'] > " ")) { // something is here
4577 if ($count >0) $hideme = "hideme_gonios nodisplay";// show the first only, hide the rest for now
4578 $gonios .= "<tr><td class='GFS_td_1 ".$hideme."'>".$visit['exam_date']."</td><td class='GFS_td ".$hideme."' style='border:1pt dotted gray;'>".$visit['ODGONIO']."</td><td class='GFS_td ".$hideme."' style='border:1pt dotted gray;'>".$visit['OSGONIO']."</td></tr>";
4579 $GONIO_chart .='"1",';
4580 $count++;
4581 } else {
4582 $GONIO_chart .= ',';
4585 $GONIO = chop($GONIO,",");
4586 if ($count ==0) $gonios = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('Not documented')."</td></tr>";
4588 <tr>
4589 <td class="GFS_title_1" id="GFS_gonios" name="GFS_gonios" style="position:relative;"><?php echo xlt('Gonioscopy'); ?>:</td>
4590 <?php
4591 if ($count > '0') {
4592 echo "<td class='GFS_title center'>".xlt('OD{{right eye}}')."</td><td class='GFS_title center'>".xlt('OS{{left eye}}')."</td>";
4593 } else { echo "<td class='GFS_title center'></td><td class='GFS_title center'></td>"; }
4594 if ($hideme) { echo '<td><span class="top right" id="toggle_gonios"><i class="fa fa-toggle-down"></i></span></td>'; }
4596 </tr>
4597 <?php echo $gonios;
4599 $count='0';
4600 $hideme='';
4601 foreach ($priors as $visit) {
4602 if (($visit['ODCUP'] > "")||($visit['OSCUP'] > "")) {
4603 if ($count >0) $hideme = "hideme_cups nodisplay";
4604 $cups .= "<tr><td class='GFS_td_1 ".$hideme." '>".text($visit['exam_date'])."</td><td class='GFS_td ".$hideme."' style='border:1pt dotted gray;'>".text($visit['ODCUP'])."</td><td class='GFS_td ".$hideme."' style='border:1pt dotted gray;''>".text($visit['OSCUP'])."</td></tr>";
4605 $DISCS_chart .='"1",';
4606 $count++;
4607 } else {
4608 $DISCS_chart .= '"",';
4611 $DISCS_chart = chop($DISCS_chart,",");
4612 if ($count ==0) $cups = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('Not documented')."</td></tr>";
4614 <tr>
4615 <td class="GFS_title_1" id="GFS_cups" name="GFS_cups" title="<?php echo xla('Click this to display/hide additional tests'); ?>"style="position:relative;"><?php echo xlt('Optic Discs'); ?>:
4616 <?php
4617 if ($hideme) $plus = '<td><span class="top right" id="toggle_cups"><i class="fa fa-toggle-down"></i></span></td>';
4618 if ($count > '0') {
4619 echo "<td class='GFS_title center'>".xlt('OD{{right eye}}')."</td><td class='GFS_title center'>".xlt('OS{{left eye}}')."</td>".$plus;
4620 } else {
4621 echo "<td class='GFS_title center'></td><td class='GFS_title center'></td>";
4624 </tr>
4625 <?php echo $cups; ?>
4627 </table>
4628 </div>
4629 <script src="<?php echo $GLOBALS['assets_static_relative'] ?>/Chart.js-2-1-3/dist/Chart.bundle.min.js"></script>
4630 <div style="position:relative;float:right; margin: 0px 5px;text-align:center;width:60%;">
4631 <?php
4632 if ($priors) {
4633 if ($bywhat=='byday') { //$bywhat='byday'
4634 $class_1 = "nodisplay";
4635 $class_2 = "";
4636 } else {
4637 $class_2 = "nodisplay";
4638 $class_1 = "";
4643 <canvas id="canvas_byday" class="<?php echo $class_2; ?>"></canvas>
4644 <canvas id="canvas_byhour" class="<?php echo $class_1; ?>"></canvas>
4646 <button id="dailyData" class="<?php echo $class_1; ?>" style="background: #063f80;"><?php echo xlt('Show IOP by Date'); ?></button>
4647 <button id="hourlyData" class="<?php echo $class_2; ?>" style="background: #063f80;"><?php echo xlt('Show IOP by Time'); ?></button>
4648 <script>
4650 * Below is the Chart.js code to render IOP by day and IOP by time
4653 var visit_date = '<?php echo attr($dated); ?>';
4654 var dateFormat = 'YYYY-MM-DD';
4655 var timeFormat = 'HH tt';
4656 var customTooltips = function(tooltip) {
4657 // Tooltip Element
4658 var tooltipEl = $('#chartjs-tooltip');
4659 if (!tooltipEl[0]) {
4660 $('body').append('<div id="chartjs-tooltip"></div>');
4661 tooltipEl = $('#chartjs-tooltip');
4663 // Hide if no tooltip
4664 if (!tooltip.opacity) {
4665 tooltipEl.css({
4666 opacity: 0.3
4668 $('.chartjs-wrap canvas')
4669 .each(function(index, el) {
4670 $(el).css('cursor', 'default');
4672 return;
4674 $(this._chart.canvas).css('cursor', 'pointer');
4675 // Set caret Position
4676 tooltipEl.removeClass('above below no-transform');
4677 if (tooltip.yAlign) {
4678 tooltipEl.addClass(tooltip.yAlign);
4679 } else {
4680 tooltipEl.addClass('no-transform');
4683 // Set Text
4684 if (tooltip.body) {
4685 var innerHtml = [
4686 (tooltip.beforeTitle || []).join('\n'), (tooltip.title || []).join('\n'), (tooltip.afterTitle || []).join('\n'), (tooltip.beforeBody || []).join('\n'), (tooltip.body || []).join('\n'), (tooltip.afterBody || []).join('\n'), (tooltip.beforeFooter || [])
4687 .join('\n'), (tooltip.footer || []).join('\n'), (tooltip.afterFooter || []).join('\n')
4689 tooltipEl.html(innerHtml.join('\n'));
4692 // Find Y Location on page
4693 var top = 0;
4694 if (tooltip.yAlign) {
4695 if (tooltip.yAlign == 'above') {
4696 top = tooltip.y - tooltip.caretHeight - tooltip.caretPadding;
4697 } else {
4698 top = tooltip.y + tooltip.caretHeight + tooltip.caretPadding;
4701 var position = $(this._chart.canvas)[0].getBoundingClientRect();
4702 // Display, position, and set styles for font
4703 tooltipEl.css({
4704 opacity: 0.5,
4705 width: tooltip.width ? (tooltip.width + 'px') : 'auto',
4706 left: position.left + tooltip.x + 'px',
4707 top: position.top + top + 'px',
4708 fontFamily: tooltip._fontFamily,
4709 fontSize: tooltip.fontSize,
4710 fontStyle: tooltip._fontStyle,
4711 padding: tooltip.yPadding + 'px ' + tooltip.xPadding + 'px',
4715 var config_byhour = {
4716 type: 'line',
4717 data: {
4718 labels: [<?php echo $times_OU; ?>],
4719 datasets: [{
4720 label: "OD",
4721 data: [<?php echo $OD_time_values; ?>],
4722 fill: false,
4723 borderColor : "#44a3a7",
4724 backgroundColor : "#44a3a7",
4725 pointBorderColor : "#055d2b",
4726 pointBackgroundColor : "#44a3a7",
4727 pointBorderWidth : 3,
4728 lineTension: 0.3,
4729 borderCapStyle: 'butt',
4730 borderDashOffset: 0.0,
4731 borderJoinStyle: 'miter',
4732 pointHoverRadius: 5,
4733 pointHoverBorderWidth: 2,
4734 pointRadius: 1,
4735 pointHitRadius: 3
4736 }, {
4737 label: 'OS',
4738 data: [<?php echo $OS_time_values; ?>],
4739 fill: false,
4740 lineTension: 3,
4741 borderColor : "#000099",
4742 backgroundColor : "#000099",
4743 pointBorderColor : "black",
4744 pointBackgroundColor : "#000099",
4745 pointBorderWidth : 3,
4746 lineTension: 0.3,
4747 borderCapStyle: 'butt',
4748 borderJoinStyle: 'miter',
4749 pointHoverRadius: 5,
4750 pointHoverBorderWidth: 2,
4751 pointRadius: 1,
4752 pointHitRadius: 3,
4755 options: {
4756 responsive: true,
4757 animation: false,
4758 onAnimationComplete: function () {
4759 // prevents the update from triggering an infinite loop
4760 if (!this.clearCycle) {
4761 this.clearCycle = true;
4763 this.datasets.forEach(function (dataset) {
4764 dataset.points.forEach(function (point) {
4765 if (point.value === 0) {
4766 point.display = false;
4767 point.hasValue = function () {
4768 return false;
4773 this.update();
4775 else
4776 delete this.clearCycle;
4778 scaleShowHorizontalLines: true,
4779 title:{
4780 display:true,
4781 text:'<?php echo xla("Intraocular Pressures") . " (" . xla("mmHg") . ") by Hour"; ?>'
4783 tooltips: {
4784 mode: 'label'
4786 hover: {
4787 mode: 'dataset'
4789 scales: {
4790 xAxes: [{
4791 type: "time",
4792 time: {
4793 format: "HH:mm",
4794 unit: 'hour',
4795 unitStepSize: 2,
4796 displayFormats: {
4797 'minute': 'h:mm a',
4798 'hour': 'h:mm a'
4800 tooltipFormat: 'h:mm a'
4802 scaleLabel: {
4803 display: true,
4804 labelString: 'Time'
4806 ticks: {
4807 suggestedMin: 4,
4808 suggestedMax: 24,
4810 } ],
4811 yAxes: [{
4812 type: "linear",
4813 display: true,
4814 position: "left",
4815 //id: "y-axis-2",
4816 gridLines:{
4817 display: false
4819 labels: {
4820 show:true,
4823 scaleLabel: {
4824 display: true,
4825 labelString: 'IOP (mmHg)'
4827 ticks: {
4828 suggestedMin: 0,
4829 suggestedMax: 24,
4836 $('#dailyData').click(function(event) {
4837 event.preventDefault();
4838 $('#canvas_byday').removeClass('nodisplay');
4839 $('#canvas_byhour').addClass('nodisplay');
4841 $('#dailyData').addClass('nodisplay');
4842 $('#hourlyData').removeClass('nodisplay');
4843 $('#showTesting').addClass('nodisplay');
4845 $('#hourlyData').click(function(event) {
4846 event.preventDefault();
4847 $('#canvas_byhour').removeClass('nodisplay');
4848 $('#canvas_byday').addClass('nodisplay');
4849 $('#dailyData').removeClass('nodisplay');
4850 $('#hourlyData').addClass('nodisplay');
4851 $('#showTesting').removeClass('nodisplay');
4853 var config_byday = {
4854 type: 'bar',
4855 data: {
4856 labels: [<?php echo $dates_OU; ?>],
4857 datasets: [
4859 type: 'line',
4860 label: "Target",
4861 data: [<?php echo $IOPTARGET_values; ?>],
4862 fill: false,
4863 borderColor : "#f28282",
4864 backgroundColor : "#f28282",
4865 pointBorderColor : "black",
4866 pointBackgroundColor : "#f28282",
4867 pointBorderWidth : 3,
4868 drugs: ["test1\ntimoptic","test2","test3"],
4869 yAxisID: 'y-axis-1',
4870 lineTension: 0.3,
4871 borderCapStyle: 'round',
4872 borderDash: [1,5],
4873 borderJoinStyle: 'miter',
4874 pointHoverRadius: 5,
4875 pointHoverBorderWidth: 2,
4876 pointRadius: 1,
4877 pointHitRadius: 3
4878 },{ type: 'line',
4879 label: "OD",
4880 data: [<?php echo $OD_values; ?>],
4881 fill: false,
4882 borderColor : "#44a3a7",
4883 backgroundColor : "#44a3a7",
4884 pointBorderColor : "#055d2b",
4885 pointBackgroundColor : "#44a3a7",
4886 pointBorderWidth : 3,
4887 yAxisID: 'y-axis-1',
4888 lineTension: 0.3,
4889 borderCapStyle: 'butt',
4890 borderDashOffset: 0.0,
4891 borderJoinStyle: 'miter',
4892 pointHoverRadius: 5,
4893 pointHoverBorderWidth: 2,
4894 pointRadius: 1,
4895 pointHitRadius: 3
4896 }, {
4897 type: 'line',
4898 label: 'OS',
4899 data: [<?php echo $OS_values; ?>],
4900 fill: false,
4901 lineTension: 3,
4902 borderColor : "#000099",
4903 backgroundColor : "#000099",
4904 pointBorderColor : "black",
4905 pointBackgroundColor : "#000099",
4906 pointBorderWidth : 3,
4907 yAxisID: 'y-axis-1',
4908 lineTension: 0.3,
4909 borderCapStyle: 'butt',
4910 borderJoinStyle: 'miter',
4911 pointHoverRadius: 5,
4912 pointHoverBorderWidth: 2,
4913 pointRadius: 1,
4914 pointHitRadius: 3,
4916 type: 'bar',
4917 label: "VF",
4918 strokeColor: '#5CABFA',
4919 fillColor:"#5CABFA",
4920 data: [<?php echo $VF_values; ?>],
4921 fill: false,
4922 backgroundColor: '#5CABFA',
4923 borderColor: '#000000',
4924 yAxisID: 'y-axis-2'
4926 type: 'bar',
4927 label: "OCT",
4928 data: [<?php echo $OCT_values; ?>],//0/null is not done, 1 if performed.
4929 fill: true,
4930 backgroundColor: '#71B37C',
4931 borderColor: '#000000',
4932 yAxisID: 'y-axis-2'
4934 type: 'bar',
4935 label: "Gonio",
4936 data: [<?php echo $GONIO_values; ?>],
4937 fill: false,
4938 strokeColor: 'rgba(209, 30, 93, 0.3)',
4939 fillColor:'rgba(209, 30, 93, 0.3)',
4940 backgroundColor: 'red',
4941 borderColor: '#000000',
4942 yAxisID: 'y-axis-2'
4945 options: {
4946 responsive: true,
4947 scaleShowHorizontalLines: true,
4948 title:{
4949 display: true,
4950 text:'<?php echo xla("Intraocular Pressures (mmHg) by Date"); ?>'
4952 tooltips: {
4953 enabled: true,
4954 //id: "tooltip-1",
4955 //backgroundColor: '#FCFFC5',
4956 //mode: 'label',
4957 enabled: true,
4958 shared: false,
4960 callbacks: {
4961 label: function(tooltipItem, data) {
4962 if (tooltipItem.yLabel =='0') {
4963 return data.datasets[tooltipItem.datasetIndex].label + " --- "; ;
4964 } else if (tooltipItem.yLabel =='1') {
4965 return data.datasets[tooltipItem.datasetIndex].label + " <?php echo xlt('performed'); ?>";
4966 } else if (tooltipItem.yLabel > '1') {
4967 return data.datasets[tooltipItem.datasetIndex].label + ": "+tooltipItem.yLabel;
4970 afterBody: function(tooltipItems, data) {
4971 //console.log(tooltipItems);
4972 //return data.datasets[2].drugs[tagme];
4976 hover: {
4977 mode: 'label'
4979 scales: {
4980 xAxes: [{
4981 type: "time",
4982 stacked:false,
4983 id: "x-axis-1",
4984 time: {
4985 format: dateFormat,
4986 round: 'day',
4987 tooltipFormat: 'll'
4989 categoryPercentage: 0.5,
4990 barPercentage:1.0,
4991 //categoryPercentage:0.3,
4992 scaleLabel: {
4993 display: true,
4994 labelString: 'Date'
4996 ticks: {
4997 suggestedMin: 3,
4998 suggestedMax: 6
5000 }, ],
5001 yAxes: [{
5002 type: "linear",
5003 display: false,
5004 position: "right",
5005 id: "y-axis-2",
5006 stacked: false,
5007 gridLines:{
5008 display: false
5010 labels: {
5011 show:true,
5013 scaleLabel: {
5014 display: false,
5015 labelString: 'Testing'
5017 ticks: {
5018 suggestedMin: 4,
5019 suggestedMax: 4
5021 }, {
5022 type: "linear",
5023 display: true,
5024 position: "left",
5025 id: "y-axis-1",
5026 gridLines:{
5027 display: true
5029 labels: {
5030 show:true,
5032 scaleLabel: {
5033 display: true,
5034 labelString: 'IOP (mmHg)'
5036 ticks: {
5037 suggestedMin: 4,
5038 suggestedMax: 24,
5045 var ctx1 = document.getElementById("canvas_byday").getContext("2d");
5046 var ctx2 = document.getElementById("canvas_byhour").getContext("2d");
5048 var myLine = new Chart.Bar(ctx1, config_byday);
5049 var myLine2 = new Chart(ctx2, config_byhour);
5050 </script>
5051 <?php
5052 } else {
5053 echo "<div style='text-align:left;padding-left:20px;'><h4>The Glaucoma Flow Sheet graphically displays:
5054 <ul>
5055 <li> IOP measurements</li>
5056 <li> Target IOPs </li>
5057 <li> related tests (OCT/VF/Gonio)</li>
5058 <li> diurnal IOP curve</li>
5059 </ul>
5060 The graphs are not generated on the initial visit...</h4></div>";
5061 } ?>
5062 </div>
5063 </div>
5064 <?php
5067 # gets the provider from the encounter file , or from the logged on user or from the patient file
5068 function findProvider($pid,$encounter) {
5069 $find_provider = sqlQuery("SELECT * FROM form_encounter " .
5070 "WHERE pid = ? AND encounter = ? " .
5071 "ORDER BY id DESC LIMIT 1", array($pid,$encounter) );
5072 $providerid = $find_provider['provider_id'];
5073 if($providerid < '1') {
5074 //find the default providerID from the calendar
5075 $visit_date = date('Y-m-d',strtotime($find_provider['date']));
5076 $query = "select * from openemr_postcalendar_events where pc_pid=? and pc_eventDate=?";
5077 $find_provider3 = sqlQuery($query,array($pid,$visit_date));
5078 $new_providerid = $find_provider3['pc_aid'];
5079 if (($new_providerid < '1')||(!$new_providerid)) {
5080 $get_authorized = $_SESSION['userauthorized'];
5081 if($get_authorized ==1) {
5082 $find_provider2 = sqlQuery("SELECT providerID FROM patient_data WHERE pid = ? ", array($pid) );
5083 $new_providerid = $find_provider2['providerID'];
5086 $providerid = $new_providerid;
5087 sqlStatement("UPDATE form_encounter set provider_id =? WHERE pid = ? AND encounter = ?",array($providerid,$pid,$encounter));
5088 sqlStatement("UPDATE patient_data set providerID =? WHERE pid = ?",array($providerid,$pid));
5090 return $providerid;
5093 function generate_lens_treatments($W,$LTs_present) {
5094 ob_start();
5095 $query = "SELECT * FROM list_options where list_id =? and activity='1' ORDER BY seq";
5096 $TXs_data = sqlStatement($query,array("Eye_Lens_Treatments"));
5097 $counter=0;
5098 $TXs_arr = explode("|",$LTs_present);
5099 $tabindex=$W."0144";
5100 while ($row = sqlFetchArray($TXs_data)) {
5101 $checked ='';
5102 $ID=$row['option_id'];
5103 if (in_array($ID,$TXs_arr)) {
5104 $checked = "checked='yes'";
5106 echo "<input type='checkbox' id='TXs_".$W."_".$counter."' name='LENS_TREATMENTS_".$W."[]' $checked value='".attr($ID)."' tabindex='$tabindex'> ";
5107 $label = text(substr($row['title'],0,30));
5108 echo "<label for='TXs_".$W."_".$counter."' class='input-helper input-helper--checkbox' title='".attr($row['notes'])."'>";
5109 echo $label."</label><br />";
5110 $counter++;
5111 $tabindex++;
5113 $output = ob_get_contents();
5114 ob_end_clean();
5115 return $output;
5119 * Function to display the fields for a currently worn glasses/spectacle Rx.
5120 * @param $W - the Rx number, in order of documentation
5122 function generate_specRx($W) {
5123 global $pid,$form_id,$encounter,$display_W_width;
5125 $query = "select * from form_eye_mag_wearing where PID=? and FORM_ID=? and ENCOUNTER=? and RX_NUMBER =?";
5126 $wear = sqlQuery($query,array($pid,$form_id,$encounter,$W));
5127 if ($wear) {
5128 $RX_VALUE='1';
5129 @extract($wear);
5130 } else {
5131 $RX_VALUE='';
5132 $display_W='nodisplay';
5134 ob_start();
5136 <input type="hidden" id="W_<?php echo attr($W); ?>" name="W_<?php echo attr($W); ?>" value="<?php echo attr($RX_VALUE); ?>">
5138 <div id="LayerVision_W_<?php echo attr($W); ?>" name="currentRX" class="refraction current_W borderShadow <?php echo attr($display_W); ?> <?php echo $display_W_width; ?>">
5139 <i class="closeButton fa fa-close" id="Close_W_<?php echo attr($W); ?>" name="Close_W_<?php echo attr($W); ?>"
5140 title="<?php echo xla('Close this panel and delete this Rx'); ?>"></i>
5141 <i class="closeButton2 fa fa-arrows-h " id="W_width_display_<?php echo attr($W); ?>" name="W_width_display"
5142 title="<?php echo xla("Rx Details"); ?>" ></i>
5143 <i onclick="top.restoreSession(); doscript('W','<?php echo attr($pid); ?>','<?php echo attr($encounter); ?>','<?php echo attr($W); ?>'); return false;"
5144 title="<?php echo xla("Dispense Rx"); ?>" class="closeButton3 fa fa-print"></i>
5145 <i onclick="top.restoreSession(); dispensed('<?php echo attr($pid); ?>');return false;"
5146 title="<?php echo xla("List of previously dispensed Spectacle and Contact Lens Rxs"); ?>" class="closeButton4 fa fa-list-ul"></i>
5147 <table id="wearing_<?php echo attr($W); ?>" >
5148 <tr>
5149 <th colspan="7"><?php echo xlt('Current Glasses'); ?>: #<?php echo attr($W); ?>
5150 </th>
5151 </tr>
5152 <tr>
5153 <td></td>
5154 <td><i class="fa fa-gamepad" name="reverseme" title="<?php echo xla('Convert between plus and minus cylinder'); ?>"aria-hidden="true" id="revW<?php echo attr($W); ?>" ></i></td>
5155 <td><?php echo xlt('Sph{{Sphere}}'); ?></td>
5156 <td><?php echo xlt('Cyl{{Cylinder}}'); ?></td>
5157 <td><?php echo xlt('Axis'); ?></td>
5158 <td><?php echo xlt('Acuity'); ?></td>
5159 <td name="W_wide"></td>
5160 <td name="W_wide" title="<?php echo xla('Horizontal Prism Power'); ?>"><?php echo xlt('HP{{abbreviation for Horizontal Prism Power}}'); ?></td>
5161 <td name="W_wide" title="<?php echo xla('Horizontal Prism Base'); ?>"><?php echo xlt('HB{{abbreviation for Horizontal Prism Base}}'); ?></td>
5162 <td name="W_wide" title="<?php echo xla('Vertical Prism Power'); ?>"><?php echo xlt('VP{{abbreviation for Vertical Prism Power}}'); ?></td>
5163 <td name="W_wide" title="<?php echo xla('Vertical Prism Base'); ?>"><?php echo xlt('VB{{abbreviation for Vertical Prism Base}}'); ?></td>
5164 <td name="W_wide" title="<?php echo xla('Slab Off'); ?>"><?php echo xlt('Slab Off'); ?></td>
5165 <td name="W_wide" title="<?php echo xla('Vertex Distance'); ?>"><?php echo xlt('VD{{abbreviation for Vertex Distance}}'); ?></td>
5166 <td name="W_wide" title="<?php echo xla('Monocular Pupillary Diameter - Distance'); ?>"><?php echo xlt('MPD-D{{abbreviation for Monocular Pupillary Diameter - Distance}}'); ?></td>
5167 <td name="W_wide" title="<?php echo xla('Monocular Pupillary Diameter - Near'); ?>"><?php echo xlt('MPD-N{{abbreviation for Monocular Pupillary Diameter - Near}}'); ?></td>
5169 <td rowspan="6" class="right">
5170 <?php echo xlt('Rx Type{{Type of glasses prescription}}'); ?></span><br />
5171 <label for="Single_<?php echo attr($W); ?>" class="input-helper input-helper--checkbox"><?php echo xlt('Single'); ?></label>
5172 <input type="radio" value="0" id="Single_<?php echo attr($W); ?>" name="RX_TYPE_<?php echo attr($W); ?>" <?php if ($RX_TYPE == '0') echo 'checked="checked"'; ?> /></span><br /><br />
5173 <label for="Bifocal_<?php echo attr($W); ?>" class="input-helper input-helper--checkbox"><?php echo xlt('Bifocal'); ?></label>
5174 <input type="radio" value="1" id="Bifocal_<?php echo attr($W); ?>" name="RX_TYPE_<?php echo attr($W); ?>" <?php if ($RX_TYPE == '1') echo 'checked="checked"'; ?> /></span><br /><br />
5175 <label for="Trifocal_<?php echo attr($W); ?>" class="input-helper input-helper--checkbox"><?php echo xlt('Trifocal'); ?></label>
5176 <input type="radio" value="2" id="Trifocal_<?php echo attr($W); ?>" name="RX_TYPE_<?php echo attr($W); ?>" <?php if ($RX_TYPE == '2') echo 'checked="checked"'; ?> /></span><br /><br />
5177 <label for="Progressive_<?php echo attr($W); ?>" class="input-helper input-helper--checkbox"><?php echo xlt('Prog.{{abbreviation for Progressive Lens Type}}'); ?></label>
5178 <input type="radio" value="3" id="Progressive_<?php echo attr($W); ?>" name="RX_TYPE_<?php echo attr($W); ?>" <?php if ($RX_TYPE == '3') echo 'checked="checked"'; ?> /></span><br />
5179 </td>
5180 </tr>
5181 <tr>
5182 <td rowspan="2"><?php echo xlt('Dist{{distance}}'); ?></td>
5183 <td><b><?php echo xlt('OD{{right eye}}'); ?>:</b></td>
5184 <td><?php echo ${"ODSPH_$W"}; ?><input type="text" class="sphere" id="ODSPH_<?php echo attr($W); ?>" name="ODSPH_<?php echo attr($W); ?>" value="<?php echo attr($ODSPH); ?>" tabindex="<?php echo attr($W); ?>0100"></td>
5185 <td><input type="text" class="cylinder" id="ODCYL_<?php echo attr($W); ?>" name="ODCYL_<?php echo attr($W); ?>" value="<?php echo attr($ODCYL); ?>" tabindex="<?php echo attr($W); ?>0101"></td>
5186 <td><input type="text" class="axis" id="ODAXIS_<?php echo attr($W); ?>" name="ODAXIS_<?php echo attr($W); ?>" value="<?php echo attr($ODAXIS); ?>" tabindex="<?php echo attr($W); ?>0102"></td>
5187 <td><input type="text" class="acuity" id="ODVA_<?php echo attr($W); ?>" name="ODVA_<?php echo attr($W); ?>" value="<?php echo attr($ODVA); ?>" tabindex="<?php echo attr($W); ?>0108"></td>
5189 <td name="W_wide"></td>
5190 <td name="W_wide"><input type="text" class="prism" id="ODHPD_<?php echo attr($W); ?>" name="ODHPD_<?php echo attr($W); ?>" value="<?php echo attr($ODHPD); ?>" tabindex="<?php echo attr($W); ?>0112"></td>
5191 <td name="W_wide"><input type="text" class="prism" id="ODHBASE_<?php echo attr($W); ?>" name="ODHBASE_<?php echo attr($W); ?>" value="<?php echo attr($ODHBASE); ?>" tabindex="<?php echo attr($W); ?>0114"></td>
5192 <td name="W_wide"><input type="text" class="prism" id="ODVPD_<?php echo attr($W); ?>" name="ODVPD_<?php echo attr($W); ?>" value="<?php echo attr($ODVPD); ?>" tabindex="<?php echo attr($W); ?>0116"></td>
5193 <td name="W_wide"><input type="text" class="prism" id="ODVBASE_<?php echo attr($W); ?>" name="ODVBASE_<?php echo attr($W); ?>" value="<?php echo attr($ODVBASE); ?>" tabindex="<?php echo attr($W); ?>0118"></td>
5194 <td name="W_wide"><input type="text" class="prism" id="ODSLABOFF_<?php echo attr($W); ?>" name="ODSLABOFF_<?php echo attr($W); ?>" value="<?php echo attr($ODSLABOFF); ?>" tabindex="<?php echo attr($W); ?>0120"></td>
5195 <td name="W_wide"><input type="text" class="prism" id="ODVERTEXDIST_<?php echo attr($W); ?>" name="ODVERTEXDIST_<?php echo attr($W); ?>" value="<?php echo attr($ODVERTEXDIST); ?>" tabindex="<?php echo attr($W); ?>0122"></td>
5196 <td name="W_wide"><input type="text" class="prism" id="ODMPDD_<?php echo attr($W); ?>" name="ODMPDD_<?php echo attr($W); ?>" value="<?php echo attr($ODMPDD); ?>" tabindex="<?php echo attr($W); ?>0124"></td>
5197 <td name="W_wide"><input type="text" class="prism" id="ODMPDN_<?php echo attr($W); ?>" name="ODMPDN_<?php echo attr($W); ?>" value="<?php echo attr($ODMPDN); ?>" tabindex="<?php echo attr($W); ?>0126"></td>
5198 </tr>
5199 <tr>
5200 <td><b><?php echo xlt('OS{{left eye}}'); ?>:</b></td>
5201 <td><input type="text" class="sphere" id="OSSPH_<?php echo attr($W); ?>" name="OSSPH_<?php echo attr($W); ?>" value="<?php echo attr($OSSPH); ?>" tabindex="<?php echo attr($W); ?>0103"></td>
5202 <td><input type="text" class="cylinder" id="OSCYL_<?php echo attr($W); ?>" name="OSCYL_<?php echo attr($W); ?>" value="<?php echo attr($OSCYL); ?>" tabindex="<?php echo attr($W); ?>0104"></td>
5203 <td><input type="text" class="axis" id="OSAXIS_<?php echo attr($W); ?>" name="OSAXIS_<?php echo attr($W); ?>" value="<?php echo attr($OSAXIS); ?>" tabindex="<?php echo attr($W); ?>0105"></td>
5204 <td><input type="text" class="acuity" id="OSVA_<?php echo attr($W); ?>" name="OSVA_<?php echo attr($W); ?>" value="<?php echo attr($OSVA); ?>" tabindex="<?php echo attr($W); ?>0109"></td>
5206 <td name="W_wide"></td>
5207 <td name="W_wide"><input type="text" class="prism" id="OSHPD_<?php echo attr($W); ?>" name="OSHPD_<?php echo attr($W); ?>" value="<?php echo attr($OSHPD); ?>" tabindex="<?php echo attr($W); ?>0113"></td>
5208 <td name="W_wide"><input type="text" class="prism" id="OSHBASE_<?php echo attr($W); ?>" name="OSHBASE_<?php echo attr($W); ?>" value="<?php echo attr($OSHBASE); ?>" tabindex="<?php echo attr($W); ?>0115"></td>
5209 <td name="W_wide"><input type="text" class="prism" id="OSVPD_<?php echo attr($W); ?>" name="OSVPD_<?php echo attr($W); ?>" value="<?php echo attr($OSVPD); ?>" tabindex="<?php echo attr($W); ?>0117"></td>
5210 <td name="W_wide"><input type="text" class="prism" id="OSVBASE_<?php echo attr($W); ?>" name="OSVBASE_<?php echo attr($W); ?>" value="<?php echo attr($OSVBASE); ?>" tabindex="<?php echo attr($W); ?>0119"></td>
5211 <td name="W_wide"><input type="text" class="prism" id="OSSLABOFF_<?php echo attr($W); ?>" name="OSSLABOFF_<?php echo attr($W); ?>" value="<?php echo attr($OSSLABOFF); ?>" tabindex="<?php echo attr($W); ?>0121"></td>
5212 <td name="W_wide"><input type="text" class="prism" id="OSVERTEXDIST_<?php echo attr($W); ?>" name="OSVERTEXDIST_<?php echo attr($W); ?>" value="<?php echo attr($OSVERTEXDIST); ?>" tabindex="<?php echo attr($W); ?>0123"></td>
5213 <td name="W_wide"><input type="text" class="prism" id="OSMPDD_<?php echo attr($W); ?>" name="OSMPDD_<?php echo attr($W); ?>" value="<?php echo attr($OSMPDD); ?>" tabindex="<?php echo attr($W); ?>0125"></td>
5214 <td name="W_wide"><input type="text" class="prism" id="OSMPDN_<?php echo attr($W); ?>" name="OSMPDN_<?php echo attr($W); ?>" value="<?php echo attr($OSMPDN); ?>" tabindex="<?php echo attr($W); ?>0127"></td>
5215 </tr>
5216 <tr class="WNEAR">
5217 <td rowspan=2><?php echo xlt('Mid{{middle Rx strength}}'); ?>/<br /><?php echo xlt('Near'); ?></td>
5218 <td><b><?php echo xlt('OD{{right eye}}'); ?>:</b></td>
5219 <?php echo '<input type="hidden" name="RXStart_'.$W.' id="RXStart_'.$W.'" value="'.attr($RX_TYPE).'">'; ?>
5220 <td class="WMid"><input type="text" class="presbyopia" id="ODMIDADD_<?php echo attr($W); ?>" name="ODMIDADD_<?php echo attr($W); ?>" value="<?php echo attr($ODMIDADD); ?>"></td>
5221 <td class="WAdd2"><input type="text" class="presbyopia" id="ODADD_<?php echo attr($W); ?>" name="ODADD_<?php echo attr($W); ?>" value="<?php echo attr($ODADD); ?>" tabindex="<?php echo attr($W); ?>0106"></td>
5222 <td></td>
5223 <td><input class="jaeger" type="text" id="NEARODVA_<?php echo attr($W); ?>" name="NEARODVA_<?php echo attr($W); ?>" value="<?php echo attr($NEARODVA); ?>" tabindex="<?php echo attr($W); ?>0110"></td>
5225 <td name="W_wide"></td>
5227 <td name="W_wide" title="<?php echo xla('Binocular Pupillary Diameter - Distance'); ?>"><?php echo xlt('PD-D{{abbreviation for Binocular Pupillary Diameter - Distance}}'); ?></td>
5228 <td name="W_wide" title="<?php echo xla('Binocular Pupillary Diameter - Near'); ?>"><?php echo xlt('PD-N{{abbreviation for Binocular Pupillary Diameter - Near}}'); ?></td>
5229 <td name="W_wide" title="<?php echo xla('Lens Material'); ?>" colspan="2">
5230 <a href="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_list.php?list_id=Eye_Lens_Material" target="RTop"
5231 title="<?php echo xla('Click here to edit list of available Lens Materials'); ?>"
5232 name="Lens_mat"><span class="underline"><?php echo xlt('Lens Material'); ?></span> <i class="fa fa-pencil fa-fw"></i> </a>
5233 </td>
5234 <td name="W_wide2" colspan="4" rowspan="4">
5235 <a href="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_list.php?list_id=Eye_Lens_Treatments" target="RTop"
5236 title="<?php echo xla('Click here to edit list of available Lens Treatment Options'); ?>"
5237 name="Lens_txs"><span class="underline"><?php echo xlt('Lens Treatments'); ?></span> <i class="fa fa-pencil fa-fw"></i> </a>
5238 <br />
5239 <?php echo generate_lens_treatments($W,$LENS_TREATMENTS); ?>
5240 </td>
5241 </tr>
5242 <tr class="WNEAR">
5243 <td><b><?php echo xlt('OS{{left eye}}'); ?>:</b></td>
5244 <td class="WMid"><input type="text" class="presbyopia" id="OSMIDADD_<?php echo attr($W); ?>" name="OSMIDADD_<?php echo attr($W); ?>" value="<?php echo attr($OSMIDADD); ?>"></td>
5245 <td class="WAdd2"><input type="text" class="presbyopia" id="OSADD_<?php echo attr($W); ?>" name="OSADD_<?php echo attr($W); ?>" value="<?php echo attr($OSADD); ?>" tabindex="<?php echo attr($W); ?>0107"></td>
5246 <td></td>
5247 <td><input class="jaeger" type="text" id="NEAROSVA_<?php echo attr($W); ?>" name="NEAROSVA_<?php echo attr($W); ?>" value="<?php echo attr($NEAROSVA); ?>" tabindex="<?php echo attr($W); ?>0111"></td>
5249 <td name="W_wide"></td>
5251 <td name="W_wide"><input type="text" class="prism" id="BPDD_<?php echo attr($W); ?>" name="BPDD_<?php echo attr($W); ?>" value="<?php echo attr($BPDD); ?>" tabindex="<?php echo attr($W); ?>0128"></td>
5252 <td name="W_wide"><input type="text" class="prism" id="BPDN_<?php echo attr($W); ?>" name="BPDN_<?php echo attr($W); ?>" value="<?php echo attr($BPDN); ?>" tabindex="<?php echo attr($W); ?>0129"></td>
5253 <td name="W_wide" title="<?php echo xla('Lens Material Options'); ?>" colspan="2">
5254 <?php echo generate_select_list("LENS_MATERIAL_".$W, "Eye_Lens_Material", "$LENS_MATERIAL",'',' ','','restoreSession;submit_form();','',array('style'=>'width:120px','tabindex'=>$W.'0130')); ?>
5255 </td>
5256 </tr>
5257 <tr>
5258 <td colspan="2"><b><?php echo xlt('Comments'); ?>:</b>
5259 </td>
5260 <td colspan="4" class="up"></td>
5261 </tr>
5262 <tr>
5263 <td colspan="6">
5264 <textarea id="COMMENTS_<?php echo attr($W); ?>" name="COMMENTS_W" tabindex="<?php echo attr($W); ?>0110"><?php echo text($COMMENTS); ?></textarea>
5265 </td>
5266 <td colspan="2">
5267 </td>
5268 </tr>
5269 </table>
5270 </div>
5271 <?php
5272 $output = ob_get_contents();
5273 ob_end_clean();
5274 return $output;