Highway to PSR2
[openemr.git] / interface / forms / eye_mag / php / eye_mag_functions.php
blobdd91ed182f25bf48afce3e5b3715ef0524dfc214
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 global $PMSFH;
32 $facilityService = new \services\FacilityService();
34 /**
35 * This function returns HTML old record selector widget when needed (4 input values)
37 * @param string $zone options ALL,EXT,ANTSEG,RETINA,NEURO, DRAW_PRIORS_$zone
38 * @param string $visit_date Future functionality to limit result set. UTC DATE Formatted
39 * @param string $pid value = patient id
40 * @param string $type options text(default) image
41 * @return string returns the HTML old record/image selector widget for the desired zone and type
43 function priors_select($zone, $orig_id, $id_to_show, $pid, $type = 'text')
45 global $form_folder;
46 global $form_name;
47 global $visit_date;
48 global $priors;
49 global $form_id;
50 global $earlier;
51 $Form_Name = "Eye Exam";
52 $output_return ="<span id='".attr($zone)."_prefix_oldies' name='".attr($zone)."_prefix_oldies' class='oldies_prefix'>";
53 $selected='';
54 $current='';
55 if (!$priors) {
56 $query="select form_encounter.date as encounter_date,form_eye_mag.id as form_id, form_eye_mag.*
57 from form_eye_mag,forms,form_encounter
58 where
59 form_encounter.encounter = forms.encounter and
60 form_eye_mag.id=forms.form_id and
61 forms.form_name =? and
62 forms.deleted != '1' and
63 forms.pid =form_eye_mag.pid and
64 forms.formdir='eye_mag' and form_eye_mag.pid=? ORDER BY encounter_date DESC";
65 //This is actually picking up every form_eye_mag variable from every visit for $pid.
66 //We may need to put a LIMIT on this, or do we really need to retrieve form_eye_mag.*?
67 //Say there were 100 visits and we have a 200 variables(?) in form_eye_mag, we
68 //are probably going to be fine... It'd be a big select list though...
69 //Think Mister Geppetto. What would an AI do with this data for an end-user?
70 //We already use it for the Orders placed on the prior visit.
71 //If we passed this "priors" variable via JSON,
72 // then we could do the following client side (wicked fast):
73 // Carry forward function
74 // build comparison lists, like the IOP graphs by date and by hour
75 // more? Or do the current methods work well enough? Need to ask a programmer.
76 // Unlike the obj data(PMSFH,Clinical,IMPPLAN etc), this data is static.
77 // It only needs to be passed once to the client side.
78 $result = sqlStatement($query, array($Form_Name,$pid));
79 $counter = sqlNumRows($result);
80 $priors = array();
81 if ($counter < 2) {
82 return;
85 $i="0";
86 while ($prior= sqlFetchArray($result)) {
87 $dated = new DateTime($prior['encounter_date']);
88 $dated = $dated->format('Y-m-d');
89 $oeexam_date = oeFormatShortDate($dated);
90 $priors[$i] = $prior;
91 $selected ='';
92 $priors[$i]['visit_date'] = $prior['encounter_date'];
93 $priors[$i]['exam_date'] = $oeexam_date;
94 if ($id_to_show ==$prior['form_id']) {
95 $selected = 'selected="selected"';
96 $current = $i;
99 $output .= "<option value='".attr($prior['id'])."' ".attr($selected).">".$oeexam_date."</option>";
100 $selected ='';
101 $i++;
103 } else {
104 //priors[] exists, containing the visits data AND the priors[earlier] field at the end, so iterate through all but the last one.
105 $visit_count = count($priors)-1;
106 for ($i=0; $i< count($priors); $i++) {
107 if ($form_id ==$priors[$i]['id']) {
108 $selected = 'selected=selected';
109 $current = $i;
110 } else {
111 $selected ='';
114 $output .= "<option value='".attr($priors[$i]['id'])."' ".attr($selected).">".text($priors[$i]['exam_date'])."</option>";
118 $i--;
119 if ($current < $i) {
120 $earlier = $current + 1;
121 } else {
122 $earlier = $current;
125 if ($current > '0') {
126 $later = ($current - 1);
127 } else {
128 $later = "0";
131 if ($GLOBALS['date_display_format'] == 1) { // mm/div/yyyy
132 $priors[$i]['encounter_date'] = date("m/d/Y", strtotime($priors[$i]['encounter_date']));
133 $priors[$earlier]['encounter_date'] = date("m/d/Y", strtotime($priors[$earlier]['encounter_date']));
134 $priors[$later]['encounter_date'] = date("m/d/Y", strtotime($priors[$later]['encounter_date']));
135 $priors[0]['encounter_date'] = date("m/d/Y", strtotime($priors[0]['encounter_date']));
136 $priors[$current]['encounter_date'] = date("m/d/Y", strtotime($priors[$current]['encounter_date']));
137 } else {
138 $priors[$i]['encounter_date'] = date("d/m/Y", strtotime($priors[$i]['encounter_date']));
139 $priors[$earlier]['encounter_date'] = date("d/m/Y", strtotime($priors[$earlier]['encounter_date']));
140 $priors[$later]['encounter_date'] = date("d/m/Y", strtotime($priors[$later]['encounter_date']));
141 $priors[0]['encounter_date'] = date("d/m/Y", strtotime($priors[0]['encounter_date']));
142 $priors[$current]['encounter_date'] = date("d/m/Y", strtotime($priors[$current]['encounter_date']));
145 $earlier['PLAN'] = $priors[$earlier]['PLAN'];
146 if ($id_to_show != $orig_id) {
147 $output_return .= '
148 <span title="'.xla($zone).': '.xla("Copy these values into current visit.").'
149 '.xla("Updated fields will be purple."). '"
151 id="COPY_'.attr($zone).'"
152 name="COPY_'.attr($zone).'"
153 value="'.attr($id_to_show).'" onclick=\'$("#COPY_SECTION").val("'.attr($zone).'-'.attr($id_to_show).'").trigger("change");\'>
154 <i class="fa fa-paste fa-lg"></i>
155 </span>
156 &nbsp;&nbsp;';
159 $output_return .= '
160 <span onclick=\'$("#PRIOR_'.attr($zone).'").val("'.attr($priors[$i][id]).'").trigger("change");\'
161 id="PRIORS_'.attr($zone).'_earliest"
162 name="PRIORS_'.attr($zone).'_earliest"
163 class="fa fa-fast-backward fa-sm PRIORS"
164 title="'.attr($zone).': '.attr($priors[$i]['encounter_date']).'">
165 </span>
166 &nbsp;
167 <span onclick=\'$("#PRIOR_'.attr($zone).'").val("'.attr($priors[$earlier][id]).'").trigger("change");\'
168 id="PRIORS_'.attr($zone).'_minus_one"
169 name="PRIORS_'.attr($zone).'_minus_one"
170 class="fa fa-step-backward fa-sm PRIORS"
171 title="'.attr($zone).': '.attr($priors[$earlier]['encounter_date']).'">
172 </span>&nbsp;&nbsp;
173 <select name="PRIOR_'.attr($zone).'"
174 id="PRIOR_'.attr($zone).'"
175 style="padding:0 0;font-size:1.2em;"
176 class="PRIORS">
177 '.$output.'
178 </select>
179 &nbsp;
180 <span onclick=\'$("#PRIOR_'.attr($zone).'").val("'.attr($priors[$later][id]).'").trigger("change");\'
181 id="PRIORS_'.attr($zone).'_plus_one"
182 name="PRIORS_'.attr($zone).'_plus_one"
183 class="fa fa-step-forward PRIORS"
184 title="'.attr($zone).': '.attr($priors[$later]['encounter_date']).'">
185 </span>&nbsp;&nbsp;
186 <span onclick=\'$("#PRIOR_'.attr($zone).'").val("'.attr($priors[0][id]).'").trigger("change");\'
187 id="PRIORS_'.attr($zone).'_latest"
188 name="PRIORS_'.attr($zone).'_latest"
189 class="fa fa-fast-forward PRIORS"
190 title="'.attr($zone).': '.attr($priors[0]['encounter_date']).'"> &nbsp;
191 </span>
192 </span>';
193 return $output_return;
197 * This function returns ZONE specific HTML for a PRIOR record (3 input values)
199 * This is where the magic of displaying the old records happens.
200 * Each section is a duplicate of the base html except the values are from a prior visit,
201 * the background and background-color are different, and the input fields are disabled.
203 * @param string $zone options ALL,EXT,ANTSEG,RETINA,NEURO. DRAW_PRIORS_$zone and IMPPLAN to do.
204 * @param string $visit_date. Future functionality to limit result set. UTC DATE Formatted
205 * @param string $pid value = patient id
206 * @return true : when called outputs the ZONE specific HTML for a prior record + "priors_select" widget for the desired zone
208 function display_PRIOR_section($zone, $orig_id, $id_to_show, $pid, $report = '0')
210 global $form_folder;
211 global $id;
212 global $ISSUE_TYPES;
213 global $ISSUE_TYPE_STYLES;
215 $query = "SELECT * FROM form_eye_mag_prefs
216 where PEZONE='PREFS' AND id=?
217 ORDER BY ZONE_ORDER,ordering";
219 $result = sqlStatement($query, array($_SESSION['authUserID']));
220 while ($prefs= sqlFetchArray($result)) {
221 ${$prefs['LOCATION']} = $prefs['GOVALUE'];
224 $query = "SELECT * FROM form_".$form_folder." where pid =? and id = ?";
225 $result = sqlQuery($query, array($pid,$id_to_show));
226 @extract($result);
227 ob_start();
228 if ($zone == "EXT") {
229 if ($report =='0') {
230 $output = priors_select($zone, $orig_id, $id_to_show, $pid);
233 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
234 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
235 <div name="prior_selector">
236 <?php
237 echo $output;//prior visit selector - already sanitized
239 </div>
241 <?php
242 if ($report =='0') {
243 echo xlt('Prior Exam');
244 } else {
245 echo xlt($zone);
246 } ?>: </b><br />
247 <div id="PRIORS_EXT_left_1">
248 <table>
249 <?php
250 list($imaging,$episode) = display($pid, $encounter, "EXT");
251 echo $episode;
253 </table>
254 <table>
255 <tr>
256 <td></td><td><?php echo xlt('R'); ?></td><td><?php echo xlt('L{{left}}'); ?></td>
257 </tr>
258 <tr>
259 <td class="right"><?php echo xlt('Lev Fn{{levator function}}'); ?></td>
260 <td><input disabled type="text" size="1" name="PRIOR_RLF" id="PRIOR_RLF" value="<?php echo attr($RLF); ?>"></td>
261 <td><input disabled type="text" size="1" name="PRIOR_LLF" id="PRIOR_LLF" value="<?php echo attr($LLF); ?>"></td>
262 </tr>
263 <tr>
264 <td class="right"><?php echo xlt('MRD{{marginal reflex distance}}'); ?></td>
265 <td><input disabled type="text" size="1" name="PRIOR_RMRD" id="PRIOR_RMRD" value="<?php echo attr($RMRD); ?>"></td>
266 <td><input disabled type="text" size="1" name="PRIOR_LMRD" id="PRIOR_LMRD" value="<?php echo attr($LMRD); ?>"></td>
267 </tr>
268 <tr>
269 <td class="right"><?php echo xlt('Vert Fissure{{vertical fissure height}}'); ?></td>
270 <td><input disabled type="text" size="1" name="PRIOR_RVFISSURE" id="PRIOR_RVFISSURE" value="<?php echo attr($RVFISSURE); ?>"></td>
271 <td><input disabled type="text" size="1" name="PRIOR_LVFISSURE" id="PRIOR_LVFISSURE" value="<?php echo attr($LVFISSURE); ?>"></td>
272 </tr>
273 <tr>
274 <td class="right"><?php echo xlt('Carotid Bruit'); ?></td>
275 <td><input disabled type="text" name="PRIOR_RCAROTID" id="PRIOR_RCAROTID" value="<?php echo attr($RCAROTID); ?>"></td>
276 <td><input disabled type="text" name="PRIOR_LCAROTID" id="PRIOR_LCAROTID" value="<?php echo attr($LCAROTID); ?>"></td>
277 </tr>
278 <tr>
279 <td class="right"><?php echo xlt('Temporal Art.{{Temporal Artery}}'); ?></td>
280 <td><input disabled type="text" size="1" name="PRIOR_RTEMPART" id="PRIOR_RTEMPART" value="<?php echo attr($RTEMPART); ?>"></td>
281 <td><input disabled type="text" size="1" name="PRIOR_LTEMPART" id="PRIOR_LTEMPART" value="<?php echo attr($LTEMPART); ?>"></td>
282 </tr>
283 <tr>
284 <td class="right"><?php echo xlt('CN V{{cranial nerve five}}'); ?></td>
285 <td><input disabled type="text" size="1" name="PRIOR_RCNV" id="PRIOR_RCNV" value="<?php echo attr($RCNV); ?>"></td>
286 <td><input disabled type="text" size="1" name="PRIOR_LCNV" id="PRIOR_LCNV" value="<?php echo attr($LCNV); ?>"></td>
287 </tr>
288 <tr>
289 <td class="right"><?php echo xlt('CN VII{{cranial nerve seven}}'); ?></td>
290 <td><input disabled type="text" size="1" name="PRIOR_RCNVII" id="PRIOR_RCNVII" value="<?php echo attr($RCNVII); ?>"></td>
291 <td><input disabled type="text" size="1" name="PRIOR_LCNVII" id="PRIOR_LCNVII" value="<?php echo attr($LCNVII); ?>"></td>
292 </tr>
293 <tr><td colspan=3 class="underline"><?php echo xlt('Hertel Exophthalmometry'); ?></td></tr>
294 <tr class="center">
295 <td>
296 <input disabled type=text size=1 id="PRIOR_ODHERTEL" name="PRIOR_ODHERTEL" value="<?php echo attr($ODHERTEL); ?>">
297 <i class="fa fa-minus"></i>
298 </td>
299 <td>
300 <input disabled type=text size=3 id="PRIOR_HERTELBASE" name="PRIOR_HERTELBASE" value="<?php echo attr($HERTELBASE); ?>">
301 <i class="fa fa-minus"></i>
302 </td>
303 <td>
304 <input disabled type=text size=1 id="PRIOR_OSHERTEL" name="PRIOR_OSHERTEL" value="<?php echo attr($OSHERTEL); ?>">
305 </td>
306 </tr>
307 <tr><td>&nbsp;</td></tr>
308 </table>
309 </div>
311 <?php ($EXT_VIEW ==1) ? ($display_EXT_view = "wide_textarea") : ($display_EXT_view= "narrow_textarea");?>
312 <?php ($display_EXT_view == "wide_textarea") ? ($marker ="fa-minus-square-o") : ($marker ="fa-plus-square-o");?>
313 <div id="PRIOR_EXT_text_list" name="PRIOR_EXT_text_list" class="borderShadow PRIORS <?php echo attr($display_EXT_view); ?>" >
314 <span class="top_right fa <?php echo attr($marker); ?>" name="PRIOR_EXT_text_view" id="PRIOR_EXT_text_view"></span>
315 <table cellspacing="0" cellpadding="0" >
316 <tr>
317 <th><?php echo xlt('Right'); ?></th><td style="width:100px;"></td><th><?php echo xlt('Left'); ?> </th>
318 </tr>
319 <tr>
320 <td><textarea disabled name="PRIOR_RBROW" id="PRIOR_RBROW" class="right EXT"><?php echo text($RBROW); ?></textarea></td>
321 <td class="ident"><?php echo xlt('Brow'); ?></td>
322 <td><textarea disabled name="PRIOR_LBROW" id="PRIOR_LBROW" class=""><?php echo text($LBROW); ?></textarea></td>
323 </tr>
324 <tr>
325 <td><textarea disabled name="PRIOR_RUL" id="PRIOR_RUL" class="right"><?php echo text($RUL); ?></textarea></td>
326 <td class="ident"><?php echo xlt('Upper Lids'); ?></td>
327 <td><textarea disabled name="PRIOR_LUL" id="PRIOR_LUL" class=""><?php echo text($LUL); ?></textarea></td>
328 </tr>
329 <tr>
330 <td><textarea disabled name="PRIOR_RLL" id="PRIOR_RLL" class="right"><?php echo text($RLL); ?></textarea></td>
331 <td class="ident"><?php echo xlt('Lower Lids'); ?></td>
332 <td><textarea disabled name="PRIOR_LLL" id="PRIOR_LLL" class=""><?php echo text($LLL); ?></textarea></td>
333 </tr>
334 <tr>
335 <td><textarea disabled name="PRIOR_RMCT" id="PRIOR_RMCT" class="right"><?php echo text($RMCT); ?></textarea></td>
336 <td class="ident"><?php echo xlt('Medial Canthi'); ?></td>
337 <td><textarea disabled name="PRIOR_LMCT" id="PRIOR_LMCT" class=""><?php echo text($LMCT); ?></textarea></td>
338 </tr>
339 <tr>
340 <td><textarea disabled name="PRIOR_RADNEXA" id="PRIOR_RADNEXA" class="right"><?php echo text($RADNEXA); ?></textarea></td>
341 <td class="ident"><?php echo xlt('Adnexa'); ?></td>
342 <td><textarea disabled name="PRIOR_LADNEXA" id="PRIOR_LADNEXA" class=""><?php echo text($LADNEXA); ?></textarea></td>
343 </tr>
344 </table>
345 </div> <br />
346 <div class="QP_lengthen"> <b><?php echo xlt('Comments'); ?>:</b><br />
347 <textarea disabled id="PRIOR_EXT_COMMENTS" name="PRIOR_EXT_COMMENTS" Xstyle="width:4.0in;height:3em;"><?php echo text($EXT_COMMENTS); ?></textarea>
348 </div>
350 <?php
351 } elseif ($zone =="ANTSEG") {
352 if ($report =='0') {
353 $output = priors_select($zone, $orig_id, $id_to_show, $pid);
356 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
357 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
358 <div name="prior_selector">
359 <?php
360 echo $output;
362 </div>
364 <b> <?php echo xlt('Prior Exam'); ?>:</b><br />
365 <div class="text_clinical" id="PRIORS_ANTSEG_left_1">
366 <table>
367 <?php
368 list($imaging,$episode) = display($pid, $encounter, "ANTSEG");
369 echo $episode;
371 </table>
372 <table>
373 <tr >
374 <td></td><td><?php echo xlt('R{{right}}'); ?></td><td><?php echo xlt('L{{left}}'); ?></td>
375 </tr>
376 <tr>
377 <td class="right" ><?php echo xlt('Gonio{{Gonioscopy abbreviation}}'); ?></td>
378 <td><input disabled type="text" name="PRIOR_ODGONIO" id="PRIOR_ODGONIO" value="<?php echo attr($ODGONIO); ?>"></td>
379 <td><input disabled type="text" name="PRIOR_OSGONIO" id="PRIOR_OSGONIO" value="<?php echo attr($OSGONIO); ?>"></td>
380 </tr>
381 <tr>
382 <td class="right" ><?php echo xlt('Pachymetry'); ?></td>
383 <td><input disabled type="text" name="PRIOR_ODKTHICKNESS" id="PRIOR_ODKTHICKNESS" value="<?php echo attr($ODKTHICKNESS); ?>"></td>
384 <td><input disabled type="text" name="PRIOR_OSKTHICKNESS" id="PRIOR_OSKTHICKNESS" value="<?php echo attr($OSKTHICKNESS); ?>"></td>
385 </tr>
386 <tr>
387 <td class="right" title="<?php echo xla('Schirmers I (w/o anesthesia)'); ?>"><?php echo xlt('Schirmer I'); ?></td>
388 <td><input disabled type="text" name="PRIOR_ODSCHIRMER1" id="PRIOR_ODSCHIRMER1" value="<?php echo attr($ODSCHIRMER1); ?>"></td>
389 <td><input disabled type="text" name="PRIOR_OSSCHRIMER2" id="PRIOR_OSSCHIRMER1" value="<?php echo attr($OSSCHIRMER1); ?>"></td>
390 </tr>
391 <tr>
392 <td class="right" title="<?php echo xla('Schirmers II (w/ anesthesia)'); ?>"><?php echo xlt('Schirmer II'); ?></td>
393 <td><input disabled type="text" name="PRIOR_ODSCHIRMER2" id="PRIOR_ODSCHIRMER2" value="<?php echo attr($ODSCHIRMER2); ?>"></td>
394 <td><input disabled type="text" name="PRIOR_OSSCHRIMER2" id="PRIOR_OSSCHIRMER2" value="<?php echo attr($OSSCHIRMER2); ?>"></td>
395 </tr>
396 <tr>
397 <td class="right" title="<?php echo xla('Tear Break Up Time'); ?>"><?php echo xlt('TBUT{{tear breakup time}}'); ?></td>
398 <td><input disabled type="text" name="PRIOR_ODTBUT" id="PRIOR_ODTBUT" value="<?php echo attr($ODTBUT); ?>"></td>
399 <td><input disabled type="text" name="PRIOR_OSTBUT" id="PRIOR_OSTBUT" value="<?php echo attr($OSTBUT); ?>"></td>
400 </tr>
401 <tr>
402 <td colspan="3" rowspan="4" id="PRIORS_dil_box">
403 <br />
404 <?php
405 // This is going to be based off a list in the near future
406 // to allow for end-user customization
408 <span id="PRIORS_dil_listbox_title"><?php echo xlt('Dilated with'); ?>:</span><br />
409 <table id="PRIORS_dil_listbox">
410 <tr>
411 <td>
412 <input disabled type="checkbox" class="dil_drug" id="PRIORS_CycloMydril" name="PRIORS_CYCLOMYDRIL" value="Cyclomydril" <?php
413 if ($CYCLOMYDRIL == 'Cyclomydril') {
414 echo "checked='checked'";
415 } ?> />
416 <label for="CycloMydril" class="input-helper input-helper--checkbox"><?php echo text('CycloMydril'); ?></label>
417 </td>
418 <td>
419 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Tropicamide" name="PRIORS_TROPICAMIDE" value="Tropicamide 2.5%" <?php
420 if ($TROPICAMIDE == 'Tropicamide 2.5%') {
421 echo "checked='checked'";
422 } ?> />
423 <label for="Tropicamide" class="input-helper input-helper--checkbox"><?php echo text('Tropic 2.5%'); ?></label>
424 </td>
425 </tr>
426 <tr>
427 <td>
428 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Neo25" name="PRIORS_NEO25" value="Neosynephrine 2.5%" <?php
429 if ($NEO25 =='Neosynephrine 2.5%') {
430 echo "checked='checked'";
431 } ?> />
432 <label for="Neo25" class="input-helper input-helper--checkbox"><?php echo text('Neo 2.5%'); ?></label>
433 </td>
434 <td>
435 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Neo10" name="PRIORS_NEO10" value="Neosynephrine 10%" <?php
436 if ($NEO10 =='Neosynephrine 10%') {
437 echo "checked='checked'";
438 } ?> />
439 <label for="Neo10" class="input-helper input-helper--checkbox"><?php echo text('Neo 10%'); ?></label>
440 </td>
441 </tr>
442 <tr>
443 <td>
444 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Cyclogyl" style="left:150px;" name="PRIORS_CYCLOGYL" value="Cyclopentolate 1%" <?php
445 if ($CYCLOGYL == 'Cyclopentolate 1%') {
446 echo "checked='checked'";
447 } ?> />
448 <label for="Cyclogyl" class="input-helper input-helper--checkbox"><?php echo text('Cyclo 1%'); ?></label>
449 </td>
450 <td>
451 <input disabled type="checkbox" class="dil_drug" id="PRIORS_Atropine" name="PRIORS_ATROPINE" value="Atropine 1%" <?php
452 if ($ATROPINE == 'Atropine 1%') {
453 echo "checked='checked'";
454 } ?> />
455 <label for="Atropine" class="input-helper input-helper--checkbox"><?php echo text('Atropine 1%'); ?></label>
456 </td>
457 </tr>
458 </table>
459 </td>
460 </tr>
461 </table>
462 </div>
463 <?php ($ANTSEG_VIEW =='1') ? ($display_ANTSEG_view = "wide_textarea") : ($display_ANTSEG_view= "narrow_textarea");?>
464 <?php ($display_ANTSEG_view == "wide_textarea") ? ($marker ="fa-minus-square-o") : ($marker ="fa-plus-square-o");?>
465 <div id="PRIOR_ANTSEG_text_list" name="PRIOR_ANTSEG_text_list" class="borderShadow PRIORS <?php echo attr($display_ANTSEG_view); ?>" >
466 <span class="top_right fa <?php echo attr($marker); ?>" name="PRIOR_ANTSEG_text_view" id="PRIOR_ANTSEG_text_view"></span>
467 <table>
468 <tr>
469 <th><?php echo xlt('OD{{right eye}}'); ?></th><th></th><th><?php echo xlt('OS{{left eye}}'); ?></th></td>
470 </tr>
471 <tr>
472 <td><textarea disabled name="PRIOR_ODCONJ" id="PRIOR_ODCONJ" class="right"><?php echo text($ODCONJ); ?></textarea></td>
473 <td class="ident"><?php echo xlt('Conj{{Conjunctiva}}'); ?> / <?php echo xlt('Sclera'); ?></td>
474 <td><textarea disabled name="PRIOR_OSCONJ" id="PRIOR_OSCONJ" class=""><?php echo text($OSCONJ); ?></textarea></td>
475 </tr>
476 <tr>
477 <td><textarea disabled name="PRIOR_ODCORNEA" id="PRIOR_ODCORNEA" class="right"><?php echo text($ODCORNEA); ?></textarea></td>
478 <td class="ident"><?php echo xlt('Cornea'); ?></td>
479 <td><textarea disabled name="PRIOR_OSCORNEA" id="PRIOR_OSCORNEA" class=""><?php echo text($OSCORNEA); ?></textarea></td>
480 </tr>
481 <tr>
482 <td><textarea disabled name="PRIOR_ODAC" id="PRIOR_ODAC" class="right"><?php echo text($ODAC); ?></textarea></td>
483 <td class="ident"><?php echo xlt('A/C{{anterior chamber}}'); ?></td>
484 <td><textarea disabled name="PRIOR_OSAC" id="PRIOR_OSAC" class=""><?php echo text($OSAC); ?></textarea></td>
485 </tr>
486 <tr>
487 <td><textarea disabled name="PRIOR_ODLENS" id="PRIOR_ODLENS" class=" right"><?php echo text($ODLENS); ?></textarea></td>
488 <td class="ident" ><?php echo xlt('Lens'); ?></td>
489 <td><textarea disabled name="PRIOR_OSLENS" id="PRIOR_OSLENS" class=""><?php echo text($OSLENS); ?></textarea></td>
490 </tr>
491 <tr>
492 <td><textarea disabled name="PRIOR_ODIRIS" id="PRIOR_ODIRIS" class="right"><?php echo text($ODIRIS); ?></textarea></td>
493 <td class="ident"><?php echo xlt('Iris'); ?></td>
494 <td><textarea disabled name="PRIOR_OSIRIS" id="PRIOR_OSIRIS" class=""><?php echo text($OSIRIS); ?></textarea></td>
495 </tr>
496 </table>
497 </div> <br />
498 <div class="QP_lengthen"> <b><?php echo xlt('Comments'); ?>:</b><br />
499 <textarea disabled id="PRIOR_ANTSEG_COMMENTS" name="PRIOR_ANTSEG_COMMENTS"><?php echo text($ANTSEG_COMMENTS); ?></textarea>
500 </div>
502 <?php
503 } elseif ($zone=="RETINA") {
504 if ($report =='0') {
505 $output = priors_select($zone, $orig_id, $id_to_show, $pid);
508 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
509 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
510 <div name="prior_selector">
511 <?php
512 echo $output;
514 </div>
515 <b><?php echo xlt('Prior Exam'); ?>:</b><br />
516 <div style="position:relative;float:right;top:0.2in;">
517 <table style="float:right;text-align:right;font-size:0.8em;font-weight:bold;">
518 <?php
519 list($imaging,$episode) = display($pid, $encounter, "POSTSEG");
520 echo $episode;
522 </table>
523 <br />
524 <table style="width:50%;text-align:right;font-size:1.0em;font-weight:bold;padding:10px;margin: 5px 0px;">
525 <tr style="text-align:center;">
526 <td></td>
527 <td><br /><?php echo xlt('OD{{right eye}}'); ?> </td><td><br /><?php echo xlt('OS{{left eye}}'); ?> </td>
528 </tr>
529 <tr>
530 <td>
531 <?php echo xlt('CMT{{Central Macular Thickness}}'); ?>:</td>
532 <td>
533 <input disabled name="PRIOR_ODCMT" size="4" id="PRIOR_ODCMT" value="<?php echo attr($ODCMT); ?>">
534 </td>
535 <td>
536 <input disabled name="PRIOR_OSCMT" size="4" id="PRIOR_OSCMT" value="<?php echo attr($OSCMT); ?>">
537 </td>
538 </tr>
539 </table>
540 <br />
541 <table style="text-align:right;font-size:0.8em;font-weight:bold;float:right;">
542 <?php
543 list($imaging,$episode) = display($pid, $encounter, "NEURO");
544 echo $episode;
546 </table>
547 </div>
549 <?php ($RETINA_VIEW ==1) ? ($display_RETINA_view = "wide_textarea") : ($display_RETINA_view= "narrow_textarea");?>
550 <?php ($display_RETINA_view == "wide_textarea") ? ($marker ="fa-minus-square-o") : ($marker ="fa-plus-square-o");?>
551 <div>
552 <div id="PRIOR_RETINA_text_list" name="PRIOR_RETINA_text_list" class="borderShadow PRIORS <?php echo attr($display_RETINA_view); ?>">
553 <span class="top_right fa <?php echo attr($marker); ?>" name="PRIOR_RETINA_text_view" id="PRIOR_RETINA_text_view"></span>
554 <table cellspacing="0" cellpadding="0">
555 <tr>
556 <th><?php echo xlt('OD{{right eye}}'); ?></th><td style="width:100px;"></td><th><?php echo xlt('OS{{left eye}}'); ?></th></td>
557 </tr>
558 <tr>
559 <td><textarea disabled name="ODDISC" id="ODDISC" class="right"><?php echo text($ODDISC); ?></textarea></td>
560 <td style="text-align:center;font-size:0.9em;"><?php echo xlt('Disc'); ?></td>
561 <td><textarea disabled name="OSDISC" id="OSDISC" class=""><?php echo text($OSDISC); ?></textarea></td>
562 </tr>
563 <tr>
564 <td><textarea disabled name="ODCUP" id="ODCUP" class="right"><?php echo text($ODCUP); ?></textarea></td>
565 <td style="text-align:center;font-size:0.9em;"><?php echo xlt('Cup'); ?></td>
566 <td><textarea disabled name="OSCUP" id="OSCUP" class=""><?php echo text($OSCUP); ?></textarea></td>
567 </tr>
568 <tr>
569 <td><textarea disabled name="ODMACULA" id="ODMACULA" class="right"><?php echo text($ODMACULA); ?></textarea></td>
570 <td style="text-align:center;font-size:0.9em;"><?php echo xlt('Macula'); ?></td>
571 <td><textarea disabled name="OSMACULA" id="OSMACULA" class=""><?php echo text($OSMACULA); ?></textarea></td>
572 </tr>
573 <tr>
574 <td><textarea disabled name="ODVESSELS" id="ODVESSELS" class="right"><?php echo text($ODVESSELS); ?></textarea></td>
575 <td style="text-align:center;font-size:0.9em;" class=""><?php echo xlt('Vessels'); ?></td>
576 <td><textarea disabled name="OSVESSELS" id="OSVESSELS" class=""><?php echo text($OSVESSELS); ?></textarea></td>
577 </tr>
578 <tr>
579 <td><textarea disabled name="ODPERIPH" id="ODPERIPH" class="right"><?php echo text($ODPERIPH); ?></textarea></td>
580 <td style="text-align:center;font-size:0.9em;" class=""><?php echo xlt('Periph'); ?></td>
581 <td><textarea disabled name="OSPERIPH" id="OSPERIPH" class=""><?php echo text($OSPERIPH); ?></textarea></td>
582 </tr>
583 </table>
584 </div>
585 </div>
586 <br />
587 <br />
588 <div class="QP_lengthen">
589 <b><?php echo xlt('Comments'); ?>:</b><br />
590 <textarea disabled id="RETINA_COMMENTS" name="RETINA_COMMENTS" style="width:4.0in;height:3.0em;"><?php echo text($RETINA_COMMENTS); ?></textarea>
591 </div>
592 <?php
593 } elseif ($zone=="NEURO") {
594 if ($report =='0') {
595 $output = priors_select($zone, $orig_id, $id_to_show, $pid);
598 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
599 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
600 <div name="prior_selector">
601 <?php
602 echo $output;
604 </div>
605 <b><?php echo xlt('Prior Exam'); ?>:</b><br />
606 <div style="float:left;margin-top:0.8em;font-size:0.8em;">
607 <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;">
608 <table style="font-size:1.0em;font-weight:600;">
609 <tr>
610 <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>
611 <tr>
612 <td class="right">
613 <?php echo xlt('Color'); ?>:
614 </td>
615 <td>
616 <input disabled type="text" id="PRIOR_ODCOLOR" name="PRIOR_ODCOLOR" value="<?php
617 if ($ODCOLOR) {
618 echo attr($ODCOLOR);
619 } else {
620 echo " / ";
621 } ?>"/>
622 </td>
623 <td>
624 <input disabled type="text" id="PRIOR_OSCOLOR" name="PRIOR_OSCOLOR" value="<?php
625 if ($OSCOLOR) {
626 echo attr($OSCOLOR);
627 } else {
628 echo " / ";
629 } ?>"/>
630 </td>
631 <td style="text-align:bottom;">
632 &nbsp;<span title="<?php echo xla('Insert normals - 11/11'); ?>" class="fa fa-share-square-o fa-flip-horizontal"></span>
633 </td>
634 </tr>
635 <tr>
636 <td class="right" style="white-space: nowrap;font-size:0.9em;">
637 <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>
638 </td>
639 <td>
640 <input disabled type="text" size="6" name="PRIOR_ODREDDESAT" id="PRIOR_ODREDDESAT" value="<?php echo attr($ODREDDESAT); ?>"/>
641 </td>
642 <td>
643 <input disabled type="text" size="6" name="PRIOR_OSREDDESAT" id="PRIOR_OSREDDESAT" value="<?php echo attr($OSREDDESAT); ?>"/>
644 </td>
645 <td>&nbsp;
646 <span id="" class="fa fa-share-square-o fa-flip-horizontal" name="" title="<?php echo xla('Insert normals - 100/100'); ?>"></span>
647 </td>
648 </tr>
649 <tr>
650 <td class="right" style="white-space: nowrap;font-size:0.9em;">
651 <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>
652 </td>
653 <td>
654 <input disabled type="text" size="6" name="PRIOR_ODCOINS" id="PRIOR_ODCOINS" value="<?php echo attr($ODCOINS); ?>"/>
655 </td>
656 <td>
657 <input disabled type="text" size="6" name="PRIOR_OSCOINS" id="PRIOR_OSCOINS" value="<?php echo attr($OSCOINS); ?>"/>
658 </td>
659 <td>&nbsp;
660 <span id="" class="fa fa-share-square-o fa-flip-horizontal" name="" title="<?php echo xla('Insert normals - 100/100'); ?>"></span>
661 </td>
662 </tr>
663 </table>
664 </div>
665 <div class="borderShadow" style="position:relative;float:right;text-align:center;width:238px;height:250px;z-index:1;margin:2 0 2 2;">
666 <span class="closeButton fa fa-th" id="PRIOR_Close_ACTMAIN" name="PRIOR_Close_ACTMAIN"></span>
667 <table style="position:relative;float:left;font-size:0.9em;width:210px;font-weight:600;">
668 <tr style="text-align:left;height:26px;vertical-align:middle;width:180px;">
669 <td >
670 <span id="PRIOR_ACTTRIGGER" name="PRIOR_ACTTRIGGER" style="text-decoration:underline;"><?php echo ('Alternate Cover Test'); ?>:</span>
671 </td>
672 <td>
673 <span id="PRIOR_ACTNORMAL_CHECK" name="PRIOR_ACTNORMAL_CHECK">
674 <label for="PRIOR_ACT" class="input-helper input-helper--checkbox"><?php echo xlt('Ortho'); ?></label>
675 <input disabled type="checkbox" name="PRIOR_ACT" id="PRIOR_ACT" checked="<?php
676 if ($ACT =='1') {
677 echo "checked";
678 } ?>"></span>
679 </td>
680 </tr>
681 <tr>
682 <td colspan="2" style="text-align:center;">
683 <div id="PRIOR_ACTMAIN" name="PRIOR_ACTMAIN" class="ACT_TEXT nodisplay" style="position:relative;z-index:1;margin 10 auto;">
684 <table cellpadding="0" style="position:relative;text-align:center;font-size:0.9em;margin: 7 5 19 5;border-collapse: separate;">
685 <tr>
686 <td id="PRIOR_ACT_tab_SCDIST" name="PRIOR_ACT_tab_SCDIST" class="ACT_selected"> <?php echo xlt('scDist{{ACT without Correction Distance}}'); ?> </td>
687 <td id="PRIOR_ACT_tab_CCDIST" name="PRIOR_ACT_tab_CCDIST" class="ACT_deselected"> <?php echo xlt('ccDist{{ACT with Correction Distance}}'); ?> </td>
688 <td id="PRIOR_ACT_tab_SCNEAR" name="PRIOR_ACT_tab_SCNEAR" class="ACT_deselected"> <?php echo xlt('scNear{{ACT without Correction Near}}'); ?> </td>
689 <td id="PRIOR_ACT_tab_CCNEAR" name="PRIOR_ACT_tab_CCNEAR" class="ACT_deselected"> <?php echo xlt('ccNear{{ACT with Correction Near}}'); ?> </td>
690 </tr>
691 <tr>
692 <td colspan="4" style="text-align:center;font-size:0.8em;">
693 <div id="PRIOR_ACT_SCDIST" name="PRIOR_ACT_SCDIST" class="ACT_box">
694 <br />
695 <table>
696 <tr>
697 <td style="text-align:center;"><?php echo xlt('R{{right}}'); ?></td>
698 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:right;">
699 <textarea disabled id="PRIOR_ACT1SCDIST" name="PRIOR_ACT1SCDIST" class="ACT"><?php echo text($ACT1SCDIST); ?></textarea></td>
700 <td style="border:1pt solid black;border-top:0pt;text-align:center;">
701 <textarea disabled id="PRIOR_ACT2SCDIST" name="PRIOR_ACT2SCDIST"class="ACT"><?php echo text($ACT2SCDIST); ?></textarea></td>
702 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:left;">
703 <textarea disabled id="PRIOR_ACT3SCDIST" name="PRIOR_ACT3SCDIST" class="ACT"><?php echo text($ACT3SCDIST); ?></textarea></td>
704 <td style="text-align:center;"><?php echo xlt('L{{left}}'); ?></td>
705 </tr>
706 <tr>
707 <td style="text-align:right;"><i class="fa fa-reply rotate-left right"></i></td>
708 <td style="border:1pt solid black;border-left:0pt;text-align:right;">
709 <textarea disabled id="PRIOR_ACT4SCDIST" name="PRIOR_ACT4SCDIST" class="ACT"><?php echo text($ACT4SCDIST); ?></textarea></td>
710 <td style="border:1pt solid black;text-align:center;">
711 <textarea disabled id="PRIOR_ACT5SCDIST" name="PRIOR_ACT5SCDIST" class="ACT"><?php echo text($ACT5SCDIST); ?></textarea></td>
712 <td style="border:1pt solid black;border-right:0pt;text-align:left;">
713 <textarea disabled id="PRIOR_ACT6SCDIST" name="PRIOR_ACT6SCDIST" class="ACT"><?php echo text($ACT6SCDIST); ?></textarea></td>
714 <td><i class="fa fa-share rotate-right"></i></td>
715 </tr>
716 <tr>
717 <td style="border:0; border-top:2pt solid black;border-right:2pt solid black;text-align:right;">
718 <textarea disabled id="PRIOR_ACT10SCDIST" name="PRIOR_ACT10SCDIST" class="ACT"><?php echo text($ACT10SCDIST); ?></textarea></td>
719 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:right;">
720 <textarea disabled id="PRIOR_ACT7SCDIST" name="PRIOR_ACT7SCDIST" class="ACT"><?php echo text($ACT7SCDIST); ?></textarea></td>
721 <td style="border:1pt solid black;border-bottom:0pt;text-align:center;">
722 <textarea disabled id="PRIOR_ACT8SCDIST" name="PRIOR_ACT8SCDIST" class="ACT"><?php echo text($ACT8SCDIST); ?></textarea></td>
723 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:left;">
724 <textarea disabled id="PRIOR_ACT9SCDIST" name="PRIOR_ACT9SCDIST" class="ACT"><?php echo text($ACT9SCDIST); ?></textarea></td>
725 <td style="border:0; border-top:2pt solid black;border-left:2pt solid black;text-align:left;vertical-align:middle;">
726 <textarea disabled id="PRIOR_ACT11SCDIST" name="PRIOR_ACT11SCDIST" class="ACT"><?php echo text($ACT11SCDIST); ?></textarea>
727 </td>
728 </tr>
729 </table>
730 <br />
731 </div>
732 <div id="PRIOR_ACT_CCDIST" name="PRIOR_ACT_CCDIST" class="nodisplay ACT_box">
733 <br />
734 <table>
735 <tr>
736 <td style="text-align:center;"><?php echo xlt('R{{right}}'); ?></td>
737 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:right;">
738 <textarea disabled id="PRIOR_ACT1CCDIST" name="PRIOR_ACT1CCDIST" class="ACT"><?php echo text($ACT1CCDIST); ?></textarea></td>
739 <td style="border:1pt solid black;border-top:0pt;text-align:center;">
740 <textarea disabled id="PRIOR_ACT2CCDIST" name="PRIOR_ACT2CCDIST"class="ACT"><?php echo text($ACT2CCDIST); ?></textarea></td>
741 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:left;">
742 <textarea disabled id="PRIOR_ACT3CCDIST" name="PRIOR_ACT3CCDIST" class="ACT"><?php echo text($ACT3CCDIST); ?></textarea></td>
743 <td style="text-align:center;"><?php echo xlt('L{{left}}'); ?></td>
744 </tr>
745 <tr>
746 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
747 <td style="border:1pt solid black;border-left:0pt;text-align:right;">
748 <textarea disabled id="PRIOR_ACT4CCDIST" name="PRIOR_ACT4CCDIST" class="ACT"><?php echo text($ACT4CCDIST); ?></textarea></td>
749 <td style="border:1pt solid black;text-align:center;">
750 <textarea disabled id="PRIOR_ACT5CCDIST" name="PRIOR_ACT5CCDIST" class="ACT"><?php echo text($ACT5CCDIST); ?></textarea></td>
751 <td style="border:1pt solid black;border-right:0pt;text-align:left;">
752 <textarea disabled id="PRIOR_ACT6CCDIST" name="PRIOR_ACT6CCDIST" class="ACT"><?php echo text($ACT6CCDIST); ?></textarea></td>
753 <td><i class="fa fa-share rotate-right"></i></td>
754 </tr>
755 <tr>
756 <td style="border:0; border-top:2pt solid black;border-right:2pt solid black;text-align:right;">
757 <textarea disabled id="PRIOR_ACT10CCDIST" name="PRIOR_ACT10CCDIST" class="ACT"><?php echo text($ACT10CCDIST); ?></textarea></td>
758 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:right;">
759 <textarea disabled id="PRIOR_ACT7CCDIST" name="PRIOR_ACT7CCDIST" class="ACT"><?php echo text($ACT7CCDIST); ?></textarea></td>
760 <td style="border:1pt solid black;border-bottom:0pt;text-align:center;">
761 <textarea disabled id="PRIOR_ACT8CCDIST" name="PRIOR_ACT8CCDIST" class="ACT"><?php echo text($ACT8CCDIST); ?></textarea></td>
762 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:left;">
763 <textarea disabled id="PRIOR_ACT9CCDIST" name="PRIOR_ACT9CCDIST" class="ACT"><?php echo text($ACT9CCDIST); ?></textarea></td>
764 <td style="border:0; border-top:2pt solid black;border-left:2pt solid black;text-align:left;vertical-align:middle;">
765 <textarea disabled id="PRIOR_ACT11CCDIST" name="PRIOR_ACT11CCDIST" class="ACT"><?php echo text($ACT11CCDIST); ?></textarea></td>
766 </tr>
767 </table>
768 <br />
769 </div>
770 <div id="PRIOR_ACT_SCNEAR" name="PRIOR_ACT_SCNEAR" class="nodisplay ACT_box">
771 <br />
772 <table>
773 <tr>
774 <td style="text-align:center;"><?php echo xlt('R{{right}}'); ?></td>
775 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:right;">
776 <textarea disabled id="PRIOR_ACT1SCNEAR" name="PRIOR_ACT1SCNEAR" class="ACT"><?php echo text($ACT1SCNEAR); ?></textarea></td>
777 <td style="border:1pt solid black;border-top:0pt;text-align:center;">
778 <textarea disabled id="PRIOR_ACT2SCNEAR" name="PRIOR_ACT2SCNEAR"class="ACT"><?php echo text($ACT2SCNEAR); ?></textarea></td>
779 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:left;">
780 <textarea disabled id="PRIOR_ACT3SCNEAR" name="PRIOR_ACT3SCNEAR" class="ACT"><?php echo text($ACT3SCNEAR); ?></textarea></td>
781 <td style="text-align:center;"><?php echo xlt('L{{left}}'); ?></td>
782 </tr>
783 <tr>
784 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
785 <td style="border:1pt solid black;border-left:0pt;text-align:right;">
786 <textarea disabled id="PRIOR_ACT4SCNEAR" name="PRIOR_ACT4SCNEAR" class="ACT"><?php echo text($ACT4SCNEAR); ?></textarea></td>
787 <td style="border:1pt solid black;text-align:center;">
788 <textarea disabled id="PRIOR_ACT5SCNEAR" name="PRIOR_ACT5SCNEAR" class="ACT"><?php echo text($ACT5SCNEAR); ?></textarea></td>
789 <td style="border:1pt solid black;border-right:0pt;text-align:left;">
790 <textarea disabled id="PRIOR_ACT6SCNEAR" name="PRIOR_ACT6SCNEAR" class="ACT"><?php echo text($ACT6SCNEAR); ?></textarea></td>
791 <td><i class="fa fa-share rotate-right"></i></td>
792 </tr>
793 <tr>
794 <td style="border:0; border-top:2pt solid black;border-right:2pt solid black;text-align:right;">
795 <textarea disabled id="PRIOR_ACT10SCNEAR" name="PRIOR_ACT10SCNEAR" class="ACT"><?php echo text($ACT10SCNEAR); ?></textarea></td>
796 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:right;">
797 <textarea disabled id="PRIOR_ACT7SCNEAR" name="PRIOR_ACT7SCNEAR" class="ACT"><?php echo text($ACT7SCNEAR); ?></textarea></td>
798 <td style="border:1pt solid black;border-bottom:0pt;text-align:center;">
799 <textarea disabled id="PRIOR_ACT8SCNEAR" name="PRIOR_ACT8SCNEAR" class="ACT"><?php echo text($ACT8SCNEAR); ?></textarea></td>
800 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:left;">
801 <textarea disabled id="PRIOR_ACT9SCNEAR" name="PRIOR_ACT9SCNEAR" class="ACT"><?php echo text($ACT9SCNEAR); ?></textarea></td>
802 <td style="border:0; border-top:2pt solid black;border-left:2pt solid black;text-align:left;vertical-align:middle;">
803 <textarea disabled id="PRIOR_ACT11SCNEAR" name="PRIOR_ACT11SCNEAR" class="ACT"><?php echo text($ACT11SCNEAR); ?></textarea>
804 </td>
805 </tr>
806 </table>
807 <br />
808 </div>
809 <div id="PRIOR_ACT_CCNEAR" name="PRIOR_ACT_CCNEAR" class="nodisplay ACT_box">
810 <br />
811 <table>
812 <tr>
813 <td style="text-align:center;"><?php echo xlt('R{{right}}'); ?></td>
814 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:right;">
815 <textarea disabled id="PRIOR_ACT1CCNEAR" name="PRIOR_ACT1CCNEAR" class="ACT"><?php echo text($ACT1CCNEAR); ?></textarea></td>
816 <td style="border:1pt solid black;border-top:0pt;text-align:center;">
817 <textarea disabled id="PRIOR_ACT2CCNEAR" name="PRIOR_ACT2CCNEAR"class="ACT"><?php echo text($ACT2CCNEAR); ?></textarea></td>
818 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:left;">
819 <textarea disabled id="PRIOR_ACT3CCNEAR" name="PRIOR_ACT3CCNEAR" class="ACT"><?php echo text($ACT3CCNEAR); ?></textarea></td>
820 <td style="text-align:center;"><?php echo xlt('L{{left}}'); ?></td>
821 </tr>
822 <tr>
823 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
824 <td style="border:1pt solid black;border-left:0pt;text-align:right;">
825 <textarea disabled id="PRIOR_ACT4CCNEAR" name="PRIOR_ACT4CCNEAR" class="ACT"><?php echo text($ACT4CCNEAR); ?></textarea></td>
826 <td style="border:1pt solid black;text-align:center;">
827 <textarea disabled id="PRIOR_ACT5CCNEAR" name="PRIOR_ACT5CCNEAR" class="ACT"><?php echo text($ACT5CCNEAR); ?></textarea></td>
828 <td style="border:1pt solid black;border-right:0pt;text-align:left;">
829 <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>
830 </tr>
831 <tr>
832 <td style="border:0; border-top:2pt solid black;border-right:2pt solid black;text-align:right;">
833 <textarea disabled id="PRIOR_ACT10CCNEAR" name="PRIOR_ACT10CCNEAR" class="ACT"><?php echo text($ACT10CCNEAR); ?></textarea></td>
834 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:right;">
835 <textarea disabled id="PRIOR_ACT7CCNEAR" name="PRIOR_ACT7CCNEAR" class="ACT"><?php echo text($ACT7CCNEAR); ?></textarea></td>
836 <td style="border:1pt solid black;border-bottom:0pt;text-align:center;">
837 <textarea disabled id="PRIOR_ACT8CCNEAR" name="PRIOR_ACT8CCNEAR" class="ACT"><?php echo text($ACT8CCNEAR); ?></textarea></td>
838 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:left;">
839 <textarea disabled id="PRIOR_ACT9CCNEAR" name="PRIOR_ACT9CCNEAR" class="ACT"><?php echo text($ACT9CCNEAR); ?></textarea></td>
840 <td style="border:0; border-top:2pt solid black;border-left:2pt solid black;text-align:left;vertical-align:middle;">
841 <textarea disabled id="PRIOR_ACT11CCNEAR" name="PRIOR_ACT11CCNEAR" class="ACT"><?php echo text($ACT11CCNEAR); ?></textarea>
842 </td>
843 </tr>
844 </table>
845 <br />
846 </div>
847 </td>
848 </tr>
849 </table>
850 </div>
851 </td>
852 </tr>
853 </table>
854 <div id="PRIOR_NPCNPA" name="PRIOR_NPCNPA">
855 <table style="position:relative;float:left;text-align:center;margin: 4 2;width:100%;font-size:1.0em;padding:4px;">
856 <tr style="">
857 <td style="width:50%;"></td>
858 <td style="font-weight:bold;"><?php echo xlt('OD{{right eye}}'); ?></td>
859 <td style="font-weight:bold;"><?php echo xlt('OS{{left eye}}'); ?></td>
860 </tr>
861 <tr>
862 <td class="right"><span title="<?php echo xla('Near Point of Accomodation'); ?>"><?php echo xlt('NPA{{near point of accomodation}}'); ?>:</span></td>
863 <td><input disabled type="text" id="PRIOR_ODNPA" style="width:70%;" name="PRIOR_ODNPA" value="<?php echo attr($ODNPA); ?>"></td>
864 <td><input disabled type="text" id="PRIOR_OSNPA" style="width:70%;" name="PRIOR_OSNPA" value="<?php echo attr($OSNPA); ?>"></td>
865 </tr>
866 <tr>
867 <td class="right"><span title="<?php echo xla('Near Point of Convergence'); ?>"><?php echo xlt('NPC{{near point of convergence}}'); ?>:</span></td>
868 <td colspan="2" ><input disabled type="text" style="width:85%;" id="PRIOR_NPC" name="PRIOR_NPC" value="<?php echo attr($NPC); ?>">
869 </td>
870 </tr>
871 <tr>
872 <td class="right">
873 <?php echo xlt('Stereopsis'); ?>:
874 </td>
875 <td colspan="2">
876 <input disabled type="text" style="width:85%;" name="PRIOR_STEREOPSIS" id="PRIOR_STEREOPSIS" value="<?php echo attr($STEREOPSIS); ?>">
877 </td>
878 </tr>
879 <tr>
880 <td colspan="3" style="font-weight:bold;"><br /><u><?php echo xlt('Amplitudes'); ?></u><br />
881 </td>
882 </tr>
883 <tr><td ></td><td ><?php echo xlt('Distance'); ?></td><td><?php echo xlt('Near'); ?></td></tr>
884 <tr>
885 <td style="text-align:right;"><?php echo xlt('Divergence'); ?>:</td>
886 <td><input disabled type="text" id="PRIOR_DACCDIST" name="PRIOR_DACCDIST" value="<?php echo attr($DACCDIST); ?>"></td>
887 <td><input disabled type="text" id="PRIOR_DACCNEAR" name="PRIOR_DACCNEAR" value="<?php echo attr($DACCNEAR); ?>"></td></tr>
888 <tr>
889 <td style="text-align:right;"><?php echo xlt('Convergence'); ?>:</td>
890 <td><input disabled type="text" id="PRIOR_CACCDIST" name="PRIOR_CACCDIST" value="<?php echo attr($CACCDIST); ?>"></td>
891 <td><input disabled type="text" id="PRIOR_CACCNEAR" name="PRIOR_CACCNEAR" value="<?php echo attr($CACCNEAR); ?>"></td></tr>
892 </tr>
893 <tr>
894 <td class="right">
895 <?php echo xlt('Vertical Fusional'); ?>:
896 </td>
897 <td colspan="2">
898 <input disabled type="text" style="width:90%;" name="PRIOR_VERTFUSAMPS" id="PRIOR_VERTFUSAMPS" value="<?php echo attr($VERTFUSAMPS); ?>">
899 <br />
900 </td>
901 </tr>
902 </table>
903 </div>
904 </div>
905 <?php
906 $hash_tag = '<i class="fa fa-minus"></i>';
907 if ($MOTILITY_RS > '0') {
908 $PRIOR_MOTILITYNORMAL='';
909 for ($index =1; $index <= $MOTILITY_RS; ++$index) {
910 $here = "PRIOR_MOTILITY_RS_".$index;
911 $$here= $hash_tag;
915 if ($MOTILITY_RI > '0') {
916 $PRIOR_MOTILITYNORMAL='';
917 for ($index =1; $index <= $MOTILITY_RI; ++$index) {
918 $here ="PRIOR_MOTILITY_RI_".$index;
919 $$here = $hash_tag;
923 if ($MOTILITY_LS > '0') {
924 $PRIOR_MOTILITYNORMAL='';
925 for ($index =1; $index <= $MOTILITY_LS; ++$index) {
926 $here ="PRIOR_MOTILITY_LS_".$index;
927 $$here = $hash_tag;
931 if ($MOTILITY_LI > '0') {
932 $PRIOR_MOTILITYNORMAL='';
933 for ($index =1; $index <= $MOTILITY_LI; ++$index) {
934 $here ="PRIOR_MOTILITY_LI_".$index;
935 $$here = $hash_tag;
939 if ($MOTILITY_RRSO > '0') {
940 $PRIOR_MOTILITYNORMAL='';
941 for ($index =1; $index <= $MOTILITY_RRSO; ++$index) {
942 $here ="PRIOR_MOTILITY_RRSO_".$index;
943 $$here = $hash_tag;
947 if ($MOTILITY_LRSO > '0') {
948 $PRIOR_MOTILITYNORMAL='';
949 for ($index =1; $index <= $MOTILITY_LRSO; ++$index) {
950 $here ="PRIOR_MOTILITY_LRSO_".$index;
951 $$here = $hash_tag;
955 if ($MOTILITY_RLIO > '0') {
956 $PRIOR_MOTILITYNORMAL='';
957 for ($index =1; $index <= $MOTILITY_RLIO; ++$index) {
958 $here ="PRIOR_MOTILITY_RLIO_".$index;
959 $$here = $hash_tag;
963 if ($MOTILITY_LLIO > '0') {
964 $PRIOR_MOTILITYNORMAL='';
965 for ($index =1; $index <= $MOTILITY_LLIO; ++$index) {
966 $here ="PRIOR_MOTILITY_LLIO_".$index;
967 $$here = $hash_tag;
971 if ($MOTILITY_RLSO > '0') {
972 $PRIOR_MOTILITYNORMAL='';
973 for ($index =1; $index <= $MOTILITY_RLSO; ++$index) {
974 $here ="PRIOR_MOTILITY_RLSO_".$index;
975 $$here = $hash_tag;
979 if ($MOTILITY_LLSO > '0') {
980 $PRIOR_MOTILITYNORMAL='';
981 for ($index =1; $index <= $MOTILITY_LLSO; ++$index) {
982 $here ="PRIOR_MOTILITY_LLSO_".$index;
983 $$here = $hash_tag;
987 if ($MOTILITY_RRIO > '0') {
988 $PRIOR_MOTILITYNORMAL='';
989 for ($index =1; $index <= $MOTILITY_RRIO; ++$index) {
990 $here ="PRIOR_MOTILITY_RRIO_".$index;
991 $$here = $hash_tag;
995 if ($MOTILITY_LRIO > '0') {
996 $PRIOR_MOTILITYNORMAL='';
997 for ($index =1; $index <= $MOTILITY_LRIO; ++$index) {
998 $here ="PRIOR_MOTILITY_LRIO_".$index;
999 $$here = $hash_tag;
1004 $hash_tag = '<i class="fa fa-minus rotate-left"></i>';
1005 if ($MOTILITY_LR > '0') {
1006 $PRIOR_MOTILITYNORMAL='';
1007 for ($index =1; $index <= $MOTILITY_LR; ++$index) {
1008 $here ="PRIOR_MOTILITY_LR_".$index;
1009 $$here = $hash_tag;
1013 if ($MOTILITY_LL > '0') {
1014 $PRIOR_MOTILITYNORMAL='';
1015 for ($index =1; $index <= $MOTILITY_LL; ++$index) {
1016 $here ="PRIOR_MOTILITY_LL_".$index;
1017 $$here = $hash_tag;
1021 if ($MOTILITY_RR > '0') {
1022 $PRIOR_MOTILITYNORMAL='';
1023 for ($index =1; $index <= $MOTILITY_RR; ++$index) {
1024 $here ="PRIOR_MOTILITY_RR_".$index;
1025 $$here = $hash_tag;
1029 if ($MOTILITY_RL > '0') {
1030 $PRIOR_MOTILITYNORMAL='';
1031 for ($index =1; $index <= $MOTILITY_RL; ++$index) {
1032 $here ="PRIOR_MOTILITY_RL_".$index;
1033 $$here = $hash_tag;
1037 <div id="PRIOR_NEURO_MOTILITY" class="text_clinical borderShadow"
1038 style="float:left;font-size:0.9em;margin:2 2;padding: 0 10;font-weight:bold;height:134px;width:175px;">
1039 <div>
1040 <table style="width:100%;margin:0 0 1 0;">
1041 <tr>
1042 <td style="width:40%;font-size:0.9em;margin:0 auto;font-weight:bold;"><?php echo xlt('Motility'); ?>:</td>
1043 <td style="font-size:0.9em;vertical-align:middle;text-align:right;top:0.0in;right:0.1in;height:30px;">
1044 <label for="PRIOR_MOTILITYNORMAL" class="input-helper input-helper--checkbox"><?php echo xlt('Normal'); ?></label>
1045 <input disabled id="PRIOR_MOTILITYNORMAL" name="PRIOR_MOTILITYNORMAL" type="checkbox" value="1" <?php
1046 if ($MOTILITYNORMAL >'0') {
1047 echo "checked";
1048 } ?> disabled>
1049 </td>
1050 </tr>
1051 </table>
1052 </div>
1053 <input disabled type="hidden" name="PRIOR_MOTILITY_RS" id="PRIOR_MOTILITY_RS" value="<?php echo attr($MOTILITY_RS); ?>">
1054 <input disabled type="hidden" name="PRIOR_MOTILITY_RI" id="PRIOR_MOTILITY_RI" value="<?php echo attr($MOTILITY_RI); ?>">
1055 <input disabled type="hidden" name="PRIOR_MOTILITY_RR" id="PRIOR_MOTILITY_RR" value="<?php echo attr($MOTILITY_RR); ?>">
1056 <input disabled type="hidden" name="PRIOR_MOTILITY_RL" id="PRIOR_MOTILITY_RL" value="<?php echo attr($MOTILITY_RL); ?>">
1057 <input disabled type="hidden" name="PRIOR_MOTILITY_LS" id="PRIOR_MOTILITY_LS" value="<?php echo attr($MOTILITY_LS); ?>">
1058 <input disabled type="hidden" name="PRIOR_MOTILITY_LI" id="PRIOR_MOTILITY_LI" value="<?php echo attr($MOTILITY_LI); ?>">
1059 <input disabled type="hidden" name="PRIOR_MOTILITY_LR" id="PRIOR_MOTILITY_LR" value="<?php echo attr($MOTILITY_LR); ?>">
1060 <input disabled type="hidden" name="PRIOR_MOTILITY_LL" id="PRIOR_MOTILITY_LL" value="<?php echo attr($MOTILITY_LL); ?>">
1061 <input disabled type="hidden" name="PRIOR_MOTILITY_RRSO" id="PRIOR_MOTILITY_RRSO" value="<?php echo attr($MOTILITY_RRSO); ?>">
1062 <input disabled type="hidden" name="PRIOR_MOTILITY_RLSO" id="PRIOR_MOTILITY_RLSO" value="<?php echo attr($MOTILITY_RLSO); ?>">
1063 <input disabled type="hidden" name="PRIOR_MOTILITY_RRIO" id="PRIOR_MOTILITY_RRIO" value="<?php echo attr($MOTILITY_RRIO); ?>">
1064 <input disabled type="hidden" name="PRIOR_MOTILITY_RLIO" id="PRIOR_MOTILITY_RLIO" value="<?php echo attr($MOTILITY_RLIO); ?>">
1066 <input disabled type="hidden" name="PRIOR_MOTILITY_LRSO" id="PRIOR_MOTILITY_LRSO" value="<?php echo attr($MOTILITY_LRSO); ?>">
1067 <input disabled type="hidden" name="PRIOR_MOTILITY_LLSO" id="PRIOR_MOTILITY_LLSO" value="<?php echo attr($MOTILITY_LLSO); ?>">
1068 <input disabled type="hidden" name="PRIOR_MOTILITY_LRIO" id="PRIOR_MOTILITY_LRIO" value="<?php echo attr($MOTILITY_LRIO); ?>">
1069 <input disabled type="hidden" name="PRIOR_MOTILITY_LLIO" id="PRIOR_MOTILITY_LLIO" value="<?php echo attr($MOTILITY_LLIO); ?>">
1071 <div style="float:left;left:0.4in;text-decoration:underline;"><?php echo xlt('OD{{right eye}}'); ?></div>
1072 <div style="float:right;right:0.4in;text-decoration:underline;"><?php echo xlt('OS{{left eye}}'); ?></div><br />
1073 <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;">
1074 <div class="divRow">
1075 <div class="divCell">&nbsp;</div>
1076 </div>
1077 <div class="divRow">
1078 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRSO_4; ?></div>
1079 <div class="divCell">&nbsp;</div>
1080 <div class="divCell">&nbsp;</div>
1081 <div class="divCell">&nbsp;</div>
1082 <div class="divCell" name="PRIOR_MOTILITY_RS_4_3" id="PRIOR_MOTILITY_RS_4_3">&nbsp;</div>
1083 <div class="divCell" name="PRIOR_MOTILITY_RS_4_1" id="PRIOR_MOTILITY_RS_4_1">&nbsp;</div>
1084 <div class="divCell" name="PRIOR_MOTILITY_RS_4" id="PRIOR_MOTILITY_RS_4"><?php echo $PRIOR_MOTILITY_RS_4; ?></div>
1085 <div class="divCell" name="PRIOR_MOTILITY_RS_4_2" id="PRIOR_MOTILITY_RS_4_2">&nbsp;</div>
1086 <div class="divCell" name="PRIOR_MOTILITY_RS_4_4" id="PRIOR_MOTILITY_RS_4_4">&nbsp;</div>
1087 <div class="divCell">&nbsp;</div>
1088 <div class="divCell">&nbsp;</div>
1089 <div class="divCell">&nbsp;</div>
1090 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLSO_4; ?></div>
1091 </div>
1092 <div class="divRow">
1093 <div class="divCell">&nbsp;</div>
1094 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRSO_3; ?></div>
1095 <div class="divCell">&nbsp;</div>
1096 <div class="divCell">&nbsp;</div>
1097 <div class="divCell">&nbsp;</div>
1098 <div class="divCell" name="PRIOR_MOTILITY_RS_3_1" id="PRIOR_MOTILITY_RS_3_1">&nbsp;</div>
1099 <div class="divCell" name="PRIOR_MOTILITY_RS_3" id="PRIOR_MOTILITY_RS_3"><?php echo $PRIOR_MOTILITY_RS_3; ?></div>
1100 <div class="divCell" name="PRIOR_MOTILITY_RS_3_2" id="PRIOR_MOTILITY_RS_3_2">&nbsp;</div>
1101 <div class="divCell">&nbsp;</div>
1102 <div class="divCell">&nbsp;</div>
1103 <div class="divCell">&nbsp;</div>
1104 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLSO_3; ?></div>
1105 <div class="divCell">&nbsp;</div>
1106 </div>
1107 <div class="divRow">
1108 <div class="divCell">&nbsp;</div>
1109 <div class="divCell">&nbsp;</div>
1110 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRSO_2; ?></div>
1111 <div class="divCell">&nbsp;</div>
1112 <div class="divCell">&nbsp;</div>
1113 <div class="divCell" name="PRIOR_MOTILITY_RS_2_1" id="PRIOR_MOTILITY_RS_2_1">&nbsp;</div>
1114 <div class="divCell" name="PRIOR_MOTILITY_RS_2" id="PRIOR_MOTILITY_RS_2"><?php echo $PRIOR_MOTILITY_RS_2; ?></div>
1115 <div class="divCell" name="PRIOR_MOTILITY_RS_2_2" id="PRIOR_MOTILITY_RS_2_2">&nbsp;</div>
1116 <div class="divCell">&nbsp;</div>
1117 <div class="divCell">&nbsp;</div>
1118 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLSO_2; ?></div>
1119 <div class="divCell">&nbsp;</div>
1120 <div class="divCell">&nbsp;</div>
1121 </div>
1122 <div class="divRow">
1123 <div class="divCell">&nbsp;</div>
1124 <div class="divCell">&nbsp;</div>
1125 <div class="divCell">&nbsp;</div>
1126 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRSO_1; ?></div>
1127 <div class="divCell">&nbsp;</div>
1128 <div class="divCell" name="PRIOR_MOTILITY_RS_1_1" id="PRIOR_MOTILITY_RS_1_1">&nbsp;</div>
1129 <div class="divCell" name="PRIOR_MOTILITY_RS_1" id="PRIOR_MOTILITY_RS_1"><?php echo $PRIOR_MOTILITY_RS_1; ?></div>
1130 <div class="divCell" name="PRIOR_MOTILITY_RS_1_2" id="PRIOR_MOTILITY_RS_1_2">&nbsp;</div>
1131 <div class="divCell">&nbsp;</div>
1132 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLSO_1; ?></div>
1133 <div class="divCell">&nbsp;</div>
1134 <div class="divCell">&nbsp;</div>
1135 <div class="divCell">&nbsp;</div>
1136 </div>
1137 <div class="divRow">
1138 <div class="divCell">&nbsp;</div>
1139 <div class="divCell">&nbsp;</div>
1140 <div class="divCell">&nbsp;</div>
1141 <div class="divCell">&nbsp;</div>
1142 <div class="divCell">&nbsp;</div>
1143 <div class="divCell" name="PRIOR_MOTILITY_RS_0_1" id="PRIOR_MOTILITY_RS_0_1">&nbsp;</div>
1144 <div class="divCell" name="PRIOR_MOTILITY_RS_0" id="PRIOR_MOTILITY_RS_0">&nbsp;</div>
1145 <div class="divCell" name="PRIOR_MOTILITY_RS_0_1" id="PRIOR_MOTILITY_RS_0_1">&nbsp;</div>
1146 <div class="divCell">&nbsp;</div>
1147 <div class="divCell">&nbsp;</div>
1148 <div class="divCell">&nbsp;</div>
1149 <div class="divCell">&nbsp;</div>
1150 <div class="divCell">&nbsp;</div>
1151 </div>
1152 <div class="divMiddleRow">
1153 <div class="divCell">&nbsp;</div>
1154 <div class="divCell" name="PRIOR_MOTILITY_RR_4" id="PRIOR_MOTILITY_RR_4"><?php echo $PRIOR_MOTILITY_RR_4; ?></div>
1155 <div class="divCell" name="PRIOR_MOTILITY_RR_3" id="PRIOR_MOTILITY_RR_3"><?php echo $PRIOR_MOTILITY_RR_3; ?></div>
1156 <div class="divCell" name="PRIOR_MOTILITY_RR_2" id="PRIOR_MOTILITY_RR_2"><?php echo $PRIOR_MOTILITY_RR_2; ?></div>
1157 <div class="divCell" name="PRIOR_MOTILITY_RR_1" id="PRIOR_MOTILITY_RR_1"><?php echo $PRIOR_MOTILITY_RR_1; ?></div>
1158 <div class="divCell" name="PRIOR_MOTILITY_RR_0" id="PRIOR_MOTILITY_RR_0">&nbsp;</div>
1159 <div class="divCell" name="PRIOR_MOTILITY_R0" id="PRIOR_MOTILITY_R0">&nbsp;</div>
1160 <div class="divCell" name="PRIOR_MOTILITY_RL_0" id="PRIOR_MOTILITY_RL_0">&nbsp;</div>
1161 <div class="divCell" name="PRIOR_MOTILITY_RL_1" id="PRIOR_MOTILITY_RL_1"><?php echo $PRIOR_MOTILITY_RL_1; ?></div>
1162 <div class="divCell" name="PRIOR_MOTILITY_RL_2" id="PRIOR_MOTILITY_RL_2"><?php echo $PRIOR_MOTILITY_RL_2; ?></div>
1163 <div class="divCell" name="PRIOR_MOTILITY_RL_3" id="PRIOR_MOTILITY_RL_3"><?php echo $PRIOR_MOTILITY_RL_3; ?></div>
1164 <div class="divCell" name="PRIOR_MOTILITY_RL_4" id="PRIOR_MOTILITY_RL_4"><?php echo $PRIOR_MOTILITY_RL_4; ?></div>
1165 <div class="divCell">&nbsp;</div>
1166 </div>
1167 <div class="divRow">
1168 <div class="divCell">&nbsp;</div>
1169 <div class="divCell">&nbsp;</div>
1170 <div class="divCell">&nbsp;</div>
1171 <div class="divCell">&nbsp;</div>
1172 <div class="divCell">&nbsp;</div>
1173 <div class="divCell" name="PRIOR_MOTILITY_RI_0_1" id="PRIOR_MOTILITY_RI_0_1">&nbsp;</div>
1174 <div class="divCell" id="PRIOR_MOTILITY_RI_0" name="PRIOR_MOTILITY_RI_0">&nbsp;</div>
1175 <div class="divCell" name="PRIOR_MOTILITY_RI_0_2" id="PRIOR_MOTILITY_RI_0_2">&nbsp;</div>
1176 <div class="divCell">&nbsp;</div>
1177 <div class="divCell">&nbsp;</div>
1178 <div class="divCell">&nbsp;</div>
1179 <div class="divCell">&nbsp;</div>
1180 <div class="divCell">&nbsp;</div>
1181 </div>
1182 <div class="divRow">
1183 <div class="divCell">&nbsp;</div>
1184 <div class="divCell">&nbsp;</div>
1185 <div class="divCell">&nbsp;</div>
1186 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRIO_1; ?></div>
1187 <div class="divCell">&nbsp;</div>
1188 <div class="divCell" name="PRIOR_MOTILITY_RI_1_1" id="PRIOR_MOTILITY_RI_1_1">&nbsp;</div>
1189 <div class="divCell" id="PRIOR_MOTILITY_RI_1" name="PRIOR_MOTILITY_RI_1"><?php echo $PRIOR_MOTILITY_RI_1; ?></div>
1190 <div class="divCell" name="PRIOR_MOTILITY_RI_1_2" id="PRIOR_MOTILITY_RI_1_2">&nbsp;</div>
1191 <div class="divCell">&nbsp;</div>
1192 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLIO_1; ?></div>
1193 <div class="divCell">&nbsp;</div>
1194 <div class="divCell">&nbsp;</div>
1195 <div class="divCell">&nbsp;</div>
1196 </div>
1197 <div class="divRow">
1198 <div class="divCell">&nbsp;</div>
1199 <div class="divCell">&nbsp;</div>
1200 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRIO_2; ?></div>
1201 <div class="divCell">&nbsp;</div>
1202 <div class="divCell">&nbsp;</div>
1203 <div class="divCell" name="PRIOR_MOTILITY_RI_2_1" id="PRIOR_MOTILITY_RI_2_1">&nbsp;</div>
1204 <div class="divCell" id="PRIOR_MOTILITY_RI_2" name="PRIOR_MOTILITY_RI_2"><?php echo $PRIOR_MOTILITY_RI_2; ?></div>
1205 <div class="divCell" name="PRIOR_MOTILITY_RI_2_2" id="PRIOR_MOTILITY_RI_2_2">&nbsp;</div>
1206 <div class="divCell">&nbsp;</div>
1207 <div class="divCell">&nbsp;</div>
1208 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLIO_2; ?></div>
1209 <div class="divCell">&nbsp;</div>
1210 <div class="divCell">&nbsp;</div>
1211 </div>
1212 <div class="divRow">
1213 <div class="divCell">&nbsp;</div>
1214 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRIO_3; ?></div>
1215 <div class="divCell">&nbsp;</div>
1216 <div class="divCell" name="PRIOR_MOTILITY_RI_3_5" id="PRIOR_MOTILITY_RI_3_5">&nbsp;</div>
1217 <div class="divCell" name="PRIOR_MOTILITY_RI_3_3" id="PRIOR_MOTILITY_RI_3_3">&nbsp;</div>
1218 <div class="divCell" name="PRIOR_MOTILITY_RI_3_1" id="PRIOR_MOTILITY_RI_3_1">&nbsp;</div>
1219 <div class="divCell" id="PRIOR_MOTILITY_RI_3" name="PRIOR_MOTILITY_RI_3"><?php echo $PRIOR_MOTILITY_RI_3; ?></div>
1220 <div class="divCell" name="PRIOR_MOTILITY_RI_3_2" id="PRIOR_MOTILITY_RI_3_2">&nbsp;</div>
1221 <div class="divCell" name="PRIOR_MOTILITY_RI_3_4" id="PRIOR_MOTILITY_RI_3_4">&nbsp;</div>
1222 <div class="divCell" name="PRIOR_MOTILITY_RI_3_6" id="PRIOR_MOTILITY_RI_3_6">&nbsp;</div>
1223 <div class="divCell">&nbsp;</div>
1224 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLIO_3; ?></div>
1225 <div class="divCell"></div>
1226 </div>
1227 <div class="divRow">
1228 <div class="divCell"><?php echo $PRIOR_MOTILITY_RRIO_4; ?></div>
1229 <div class="divCell">&nbsp;</div>
1230 <div class="divCell">&nbsp;</div>
1231 <div class="divCell" name="PRIOR_MOTILITY_RI_4_5" id="PRIOR_MOTILITY_RI_4_5">&nbsp;</div>
1232 <div class="divCell" name="PRIOR_MOTILITY_RI_4_3" id="PRIOR_MOTILITY_RI_4_3">&nbsp;</div>
1233 <div class="divCell" name="PRIOR_MOTILITY_RI_4_1" id="PRIOR_MOTILITY_RI_4_1">&nbsp;</div>
1234 <div class="divCell" id="PRIOR_MOTILITY_RI_4" name="PRIOR_MOTILITY_RI_4"><?php echo $PRIOR_MOTILITY_RI_4; ?></div>
1235 <div class="divCell" name="PRIOR_MOTILITY_RI_4_2" id="PRIOR_MOTILITY_RI_4_2">&nbsp;</div>
1236 <div class="divCell" name="PRIOR_MOTILITY_RI_4_4" id="PRIOR_MOTILITY_RI_4_4">&nbsp;</div>
1237 <div class="divCell" name="PRIOR_MOTILITY_RI_4_6" id="PRIOR_MOTILITY_RI_4_6">&nbsp;</div>
1238 <div class="divCell">&nbsp;</div>
1239 <div class="divCell">&nbsp;</div>
1240 <div class="divCell"><?php echo $PRIOR_MOTILITY_RLIO_4; ?></div>
1241 </div>
1242 <div class="divRow">
1243 <div class="divCell">&nbsp;</div>
1244 </div>
1245 </div>
1246 <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;">
1247 <div class="divRow">
1248 <div class="divCell">&nbsp;</div>
1249 </div>
1250 <div class="divRow">
1251 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRSO_4; ?></div>
1252 <div class="divCell">&nbsp;</div>
1253 <div class="divCell">&nbsp;</div>
1254 <div class="divCell">&nbsp;</div>
1255 <div class="divCell" name="PRIOR_MOTILITY_LS_4_3" id="PRIOR_MOTILITY_LS_4_3">&nbsp;</div>
1256 <div class="divCell" name="PRIOR_MOTILITY_LS_4_1" id="PRIOR_MOTILITY_LS_4_1">&nbsp;</div>
1257 <div class="divCell" name="PRIOR_MOTILITY_LS_4" id="PRIOR_MOTILITY_LS_4"><?php echo $PRIOR_MOTILITY_LS_4; ?></div>
1258 <div class="divCell" name="PRIOR_MOTILITY_LS_4_2" id="PRIOR_MOTILITY_LS_4_2">&nbsp;</div>
1259 <div class="divCell" name="PRIOR_MOTILITY_LS_4_4" id="PRIOR_MOTILITY_LS_4_4">&nbsp;</div>
1260 <div class="divCell">&nbsp;</div>
1261 <div class="divCell">&nbsp;</div>
1262 <div class="divCell">&nbsp;</div>
1263 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLSO_4; ?></div>
1264 </div>
1265 <div class="divRow">
1266 <div class="divCell">&nbsp;</div>
1267 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRSO_3; ?></div>
1268 <div class="divCell">&nbsp;</div>
1269 <div class="divCell">&nbsp;</div>
1270 <div class="divCell">&nbsp;</div>
1271 <div class="divCell" name="PRIOR_MOTILITY_LS_3_1" id="PRIOR_MOTILITY_LS_3_1">&nbsp;</div>
1272 <div class="divCell" name="PRIOR_MOTILITY_LS_3" id="PRIOR_MOTILITY_LS_3"><?php echo $PRIOR_MOTILITY_LS_3; ?></div>
1273 <div class="divCell" name="PRIOR_MOTILITY_LS_3_2" id="PRIOR_MOTILITY_LS_3_2">&nbsp;</div>
1274 <div class="divCell">&nbsp;</div>
1275 <div class="divCell">&nbsp;</div>
1276 <div class="divCell">&nbsp;</div>
1277 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLSO_3; ?></div>
1278 <div class="divCell">&nbsp;</div>
1279 </div>
1280 <div class="divRow">
1281 <div class="divCell">&nbsp;</div>
1282 <div class="divCell">&nbsp;</div>
1283 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRSO_2; ?></div>
1284 <div class="divCell">&nbsp;</div>
1285 <div class="divCell">&nbsp;</div>
1286 <div class="divCell" name="PRIOR_MOTILITY_LS_2_1" id="PRIOR_MOTILITY_LS_2_1">&nbsp;</div>
1287 <div class="divCell" name="PRIOR_MOTILITY_LS_2" id="PRIOR_MOTILITY_LS_2"><?php echo $PRIOR_MOTILITY_LS_2; ?></div>
1288 <div class="divCell" name="PRIOR_MOTILITY_LS_2_2" id="PRIOR_MOTILITY_LS_2_2">&nbsp;</div>
1289 <div class="divCell">&nbsp;</div>
1290 <div class="divCell">&nbsp;</div>
1291 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLSO_2; ?></div>
1292 <div class="divCell">&nbsp;</div>
1293 <div class="divCell">&nbsp;</div>
1294 </div>
1295 <div class="divRow">
1296 <div class="divCell">&nbsp;</div>
1297 <div class="divCell">&nbsp;</div>
1298 <div class="divCell">&nbsp;</div>
1299 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRSO_1; ?></div>
1300 <div class="divCell">&nbsp;</div>
1301 <div class="divCell" name="PRIOR_MOTILITY_LS_1_1" id="PRIOR_MOTILITY_LS_1_1">&nbsp;</div>
1302 <div class="divCell" name="PRIOR_MOTILITY_LS_1" id="PRIOR_MOTILITY_LS_1"><?php echo $PRIOR_MOTILITY_LS_1; ?></div>
1303 <div class="divCell" name="PRIOR_MOTILITY_LS_1_2" id="PRIOR_MOTILITY_LS_1_2">&nbsp;</div>
1304 <div class="divCell">&nbsp;</div>
1305 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLSO_1; ?></div>
1306 <div class="divCell">&nbsp;</div>
1307 <div class="divCell">&nbsp;</div>
1308 <div class="divCell">&nbsp;</div>
1309 </div>
1310 <div class="divRow">
1311 <div class="divCell">&nbsp;</div>
1312 <div class="divCell">&nbsp;</div>
1313 <div class="divCell">&nbsp;</div>
1314 <div class="divCell">&nbsp;</div>
1315 <div class="divCell">&nbsp;</div>
1316 <div class="divCell" name="PRIOR_MOTILITY_LS_0_1" id="PRIOR_MOTILITY_LS_0_1">&nbsp;</div>
1317 <div class="divCell" name="PRIOR_MOTILITY_LS_0" id="PRIOR_MOTILITY_LS_0">&nbsp;</div>
1318 <div class="divCell" name="PRIOR_MOTILITY_LS_0_1" id="PRIOR_MOTILITY_LS_0_1">&nbsp;</div>
1319 <div class="divCell">&nbsp;</div>
1320 <div class="divCell">&nbsp;</div>
1321 <div class="divCell">&nbsp;</div>
1322 <div class="divCell">&nbsp;</div>
1323 <div class="divCell">&nbsp;</div>
1324 </div>
1325 <div class="divMiddleRow">
1326 <div class="divCell">&nbsp;</div>
1327 <div class="divCell" name="PRIOR_MOTILITY_LR_4" id="PRIOR_MOTILITY_LR_4"><?php echo $PRIOR_MOTILITY_LR_4; ?></div>
1328 <div class="divCell" name="PRIOR_MOTILITY_LR_3" id="PRIOR_MOTILITY_LR_3"><?php echo $PRIOR_MOTILITY_LR_3; ?></div>
1329 <div class="divCell" name="PRIOR_MOTILITY_LR_2" id="PRIOR_MOTILITY_LR_2"><?php echo $PRIOR_MOTILITY_LR_2; ?></div>
1330 <div class="divCell" name="PRIOR_MOTILITY_LR_1" id="PRIOR_MOTILITY_LR_1"><?php echo $PRIOR_MOTILITY_LR_1; ?></div>
1331 <div class="divCell" name="PRIOR_MOTILITY_LR_0" id="PRIOR_MOTILITY_LR_0">&nbsp;</div>
1332 <div class="divCell" name="PRIOR_MOTILITY_L0" id="PRIOR_MOTILITY_L0">&nbsp;</div>
1333 <div class="divCell" name="PRIOR_MOTILITY_LL_0" id="PRIOR_MOTILITY_LL_0">&nbsp;</div>
1334 <div class="divCell" name="PRIOR_MOTILITY_LL_1" id="PRIOR_MOTILITY_LL_1"><?php echo $PRIOR_MOTILITY_LL_1; ?></div>
1335 <div class="divCell" name="PRIOR_MOTILITY_LL_2" id="PRIOR_MOTILITY_LL_2"><?php echo $PRIOR_MOTILITY_LL_2; ?></div>
1336 <div class="divCell" name="PRIOR_MOTILITY_LL_3" id="PRIOR_MOTILITY_LL_3"><?php echo $PRIOR_MOTILITY_LL_3; ?></div>
1337 <div class="divCell" name="PRIOR_MOTILITY_LL_4" id="PRIOR_MOTILITY_LL_4"><?php echo $PRIOR_MOTILITY_LL_4; ?></div>
1338 <div class="divCell">&nbsp;</div>
1339 </div>
1340 <div class="divRow">
1341 <div class="divCell">&nbsp;</div>
1342 <div class="divCell" name="PRIOR_MOTILITY_LR_4_1" id="PRIOR_MOTILITY_LR_4_1">&nbsp;</div>
1343 <div class="divCell" name="PRIOR_MOTILITY_LR_3_1" id="PRIOR_MOTILITY_LR_3_1">&nbsp;</div>
1344 <div class="divCell" name="PRIOR_MOTILITY_LR_2_1" id="PRIOR_MOTILITY_LR_2_1">&nbsp;</div>
1345 <div class="divCell" name="PRIOR_MOTILITY_RO_I_1" id="PRIOR_MOTILITY_RO_I_1">&nbsp;</div>
1346 <div class="divCell">&nbsp;</div>
1347 <div class="divCell" id="PRIOR_MOTILITY_LI_0" name="PRIOR_MOTILITY_LI_0">&nbsp;</div>
1348 <div class="divCell">&nbsp;</div>
1349 <div class="divCell" name="PRIOR_MOTILITY_LO_I_1" id="PRIOR_MOTILITY_LO_I_1">&nbsp;</div>
1350 <div class="divCell" name="PRIOR_MOTILITY_LL_2_2" id="PRIOR_MOTILITY_LL_2_2">&nbsp;</div>
1351 <div class="divCell" name="PRIOR_MOTILITY_LL_3_2" id="PRIOR_MOTILITY_LL_3_2">&nbsp;</div>
1352 <div class="divCell" name="PRIOR_MOTILITY_LL_4_2" id="PRIOR_MOTILITY_LL_4_2">&nbsp;</div>
1353 <div class="divCell">&nbsp;</div>
1354 </div>
1355 <div class="divRow">
1356 <div class="divCell">&nbsp;</div>
1357 <div class="divCell" name="PRIOR_MOTILITY_LR_4_3" id="PRIOR_MOTILITY_LR_4_3">&nbsp;</div>
1358 <div class="divCell" name="PRIOR_MOTILITY_LR_3_3" id="PRIOR_MOTILITY_LR_3_3">&nbsp;</div>
1359 <div class="divCell" name="PRIOR_MOTILITY_RO_I_2" id="PRIOR_MOTILITY_RO_I_2"><?php echo $PRIOR_MOTILITY_LRIO_1; ?></div>
1360 <div class="divCell">&nbsp;</div>
1361 <div class="divCell">&nbsp;</div>
1362 <div class="divCell" id="PRIOR_MOTILITY_LI_1" name="PRIOR_MOTILITY_LI_1"><?php echo $PRIOR_MOTILITY_LI_1; ?></div>
1363 <div class="divCell">&nbsp;</div>
1364 <div class="divCell">&nbsp;</div>
1365 <div class="divCell" name="PRIOR_MOTILITY_LO_I_2" id="PRIOR_MOTILITY_LO_I_2"><?php echo $PRIOR_MOTILITY_LLIO_1; ?></div>
1366 <div class="divCell" name="PRIOR_MOTILITY_LL_3_4" id="PRIOR_MOTILITY_LL_3_4">&nbsp;</div>
1367 <div class="divCell" name="PRIOR_MOTILITY_LL_4_4" id="PRIOR_MOTILITY_LL_4_4">&nbsp;</div>
1368 <div class="divCell">&nbsp;</div>
1369 </div>
1370 <div class="divRow">
1371 <div class="divCell" name="PRIOR_MOTILITY_RO_I_3_1" id="PRIOR_MOTILITY_RO_I_3_1">&nbsp;</div>
1372 <div class="divCell" name="PRIOR_MOTILITY_RO_I_3" id="PRIOR_MOTILITY_RO_I_3">&nbsp;</div>
1373 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRIO_2; ?></div>
1374 <div class="divCell">&nbsp;</div>
1375 <div class="divCell">&nbsp;</div>
1376 <div class="divCell" name="PRIOR_MOTILITY_LI_2_1" id="PRIOR_MOTILITY_LI_2_1">&nbsp;</div>
1377 <div class="divCell" id="PRIOR_MOTILITY_LI_2" name="PRIOR_MOTILITY_LI_2"><?php echo $PRIOR_MOTILITY_LI_2; ?></div>
1378 <div class="divCell" name="PRIOR_MOTILITY_LI_2_2" id="PRIOR_MOTILITY_LI_2_2">&nbsp;</div>
1379 <div class="divCell">&nbsp;</div>
1380 <div class="divCell">&nbsp;</div>
1381 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLIO_2; ?></div>
1382 <div class="divCell" name="PRIOR_MOTILITY_LO_I_2" id="PRIOR_MOTILITY_RO_I_2">&nbsp;</div>
1383 <div class="divCell" name="PRIOR_MOTILITY_LO_I_3_1" id="PRIOR_MOTILITY_LO_I_3_1">&nbsp;</div>
1384 </div>
1385 <div class="divRow">
1386 <div class="divCell" name="PRIOR_MOTILITY_LO_I_3" id="PRIOR_MOTILITY_RO_I_3">&nbsp;</div>
1387 <div class="divCell"><?php echo $PRIOR_MOTILITY_LRIO_3; ?></div>
1388 <div class="divCell">&nbsp;</div>
1389 <div class="divCell" name="PRIOR_MOTILITY_LI_3_5" id="PRIOR_MOTILITY_LI_3_5">&nbsp;</div>
1390 <div class="divCell" name="PRIOR_MOTILITY_LI_3_3" id="PRIOR_MOTILITY_LI_3_3">&nbsp;</div>
1391 <div class="divCell" name="PRIOR_MOTILITY_LI_3_1" id="PRIOR_MOTILITY_LI_3_1">&nbsp;</div>
1392 <div class="divCell" name="PRIOR_MOTILITY_LI_3" id="PRIOR_MOTILITY_LI_3"><?php echo $PRIOR_MOTILITY_LI_3; ?></div>
1393 <div class="divCell" name="PRIOR_MOTILITY_LI_3_2" id="PRIOR_MOTILITY_LI_3_2">&nbsp;</div>
1394 <div class="divCell" name="PRIOR_MOTILITY_LI_3_4" id="PRIOR_MOTILITY_LI_3_4">&nbsp;</div>
1395 <div class="divCell" name="PRIOR_MOTILITY_LI_3_6" id="PRIOR_MOTILITY_LI_3_6">&nbsp;</div>
1396 <div class="divCell">&nbsp;</div>
1397 <div class="divCell"><?php echo $PRIOR_MOTILITY_LLIO_3; ?></div>
1398 <div class="divCell" name="PRIOR_MOTILITY_LO_I_3" id="PRIOR_MOTILITY_LO_I_3">&nbsp;</div>
1400 </div>
1401 <div class="divRow">
1402 <div class="divCell" name="PRIOR_MOTILITY_RO_I_4" id="PRIOR_MOTILITY_RO_I_4"><?php echo $PRIOR_MOTILITY_LRIO_4; ?></div>
1403 <div class="divCell">&nbsp;</div>
1404 <div class="divCell">&nbsp;</div>
1405 <div class="divCell" name="PRIOR_MOTILITY_LI_4_5" id="PRIOR_MOTILITY_LI_4_5">&nbsp;</div>
1406 <div class="divCell" name="PRIOR_MOTILITY_LI_4_3" id="PRIOR_MOTILITY_LI_4_3">&nbsp;</div>
1407 <div class="divCell" name="PRIOR_MOTILITY_LI_4_1" id="PRIOR_MOTILITY_LI_4_1">&nbsp;</div>
1408 <div class="divCell" id="PRIOR_MOTILITY_LI_4" name="PRIOR_MOTILITY_LI_4"><?php echo $PRIOR_MOTILITY_LI_4; ?></div>
1409 <div class="divCell" name="PRIOR_MOTILITY_LI_4_2" id="PRIOR_MOTILITY_LI_4_2">&nbsp;</div>
1410 <div class="divCell" name="PRIOR_MOTILITY_LI_4_4" id="PRIOR_MOTILITY_LI_4_4">&nbsp;</div>
1411 <div class="divCell" name="PRIOR_MOTILITY_LI_4_6" id="PRIOR_MOTILITY_LI_4_6">&nbsp;</div>
1412 <div class="divCell">&nbsp;</div>
1413 <div class="divCell">&nbsp;</div>
1414 <div class="divCell" name="PRIOR_MOTILITY_LO_I_4" id="PRIOR_MOTILITY_LO_I_4"><?php echo $PRIOR_MOTILITY_LLIO_4; ?></div>
1415 </div>
1416 <div class="divRow"><div class="divCell">&nbsp;</div>
1417 </div>
1418 </div>
1419 </div>
1420 </div>
1421 <br />
1422 <div style="position: absolute;bottom:0.05in;clear:both;font-size:0.9em;text-align:left;padding-left:25px;">
1423 <b><?php echo xlt('Comments'); ?>:</b><br />
1424 <textarea disabled id="PRIOR_NEURO_COMMENTS" name="PRIOR_NEURO_COMMENTS" style="width:4.0in;height:3.0em;"><?php echo text($NEURO_COMMENTS); ?></textarea>
1425 </div>
1426 <input type="hidden" name="PRIOR_PREFS_ACT_SHOW" id="PRIOR_PREFS_ACT_SHOW" value="<?php echo attr($ACT_SHOW); ?>">
1428 <script type="text/javascript">
1429 $("#PRIOR_ACTTRIGGER").mouseover(function() {
1430 $("#PRIOR_ACTTRIGGER").toggleClass('buttonRefraction_selected').toggleClass('underline');
1432 $("#PRIOR_ACTTRIGGER").mouseout(function() {
1433 $("#PRIOR_ACTTRIGGER").toggleClass('buttonRefraction_selected').toggleClass('underline');
1435 $("#PRIOR_ACTTRIGGER").click(function() {
1436 $("#PRIOR_ACTMAIN").toggleClass('nodisplay'); //.toggleClass('fullscreen');
1437 $("#PRIOR_NPCNPA").toggleClass('nodisplay');
1438 $("#PRIOR_ACTNORMAL_CHECK").toggleClass('nodisplay');
1439 $("#PRIOR_ACTTRIGGER").toggleClass('underline');
1440 $("#PRIOR_Close_ACTMAIN").toggleClass('fa-random').toggleClass('fa-eye');
1442 $("[name^='PRIOR_ACT_tab_']").click(function() {
1443 var section = this.id.match(/PRIOR_ACT_tab_(.*)/)[1];
1444 $("[name^='PRIOR_ACT_']").addClass('nodisplay');
1445 $("[name^='PRIOR_ACT_tab_']").removeClass('nodisplay').removeClass('ACT_selected').addClass('ACT_deselected');
1446 $("#PRIOR_ACT_tab_" + section).addClass('ACT_selected').removeClass('ACT_deselected');
1447 $("#PRIOR_ACT_" + section).removeClass('nodisplay');
1448 $("#PRIOR_PREFS_ACT_SHOW").val(section);
1451 $("[name^='PRIOR_Close_']").click(function() {
1452 var section = this.id.match(/PRIOR_Close_(.*)$/)[1];
1453 if (section =="ACTMAIN") {
1454 $("#PRIOR_ACTTRIGGER").trigger( "click" );
1455 } else {
1456 $("#LayerVision_"+section+"_lightswitch").click();
1459 if ($("#PREFS_ACT_VIEW").val() == '1') {
1460 $("#PRIOR_ACTMAIN").toggleClass('nodisplay');
1461 $("#PRIOR_NPCNPA").toggleClass('nodisplay');
1462 $("#PRIOR_ACTNORMAL_CHECK").toggleClass('nodisplay');
1463 $("#PRIOR_ACTTRIGGER").toggleClass('underline');
1464 var show = $("#PREFS_ACT_SHOW").val();
1465 $("#PRIOR_ACT_tab_"+show).trigger('click');
1467 </script>
1468 <?php
1469 } elseif ($zone=="IMPPLAN") {
1470 if ($report =='0') {
1471 $output = priors_select($zone, $orig_id, $id_to_show, $pid);
1474 <input disabled type="hidden" id="PRIORS_<?php echo attr($zone); ?>_prefix" name="PRIORS_<?php echo attr($zone); ?>_prefix" value="">
1475 <span class="closeButton pull-right fa fa-close" id="Close_PRIORS_<?php echo attr($zone); ?>" name="Close_PRIORS_<?php echo attr($zone); ?>"></span>
1476 <div name="prior_selector" class="PRIORS">
1477 <?php
1478 echo $output;
1480 </div>
1481 <b> <?php echo xlt('Prior IMP/PLAN'); ?>:</b><br />
1482 <?php
1483 $PRIOR_IMPPLAN_items = build_IMPPLAN_items($pid, $id_to_show);
1485 if ($PRIOR_IMPPLAN_items) {
1486 echo "<br /><br /><div style='width:90%;'>";
1487 $i='0';
1488 $k='1';
1489 foreach ($PRIOR_IMPPLAN_items as $item) {
1490 echo "<div class='IMPPLAN_class' style='clear:both;margin:10px;'>";
1491 echo " <span>$k. ".text($item['title'])."</span><span class='pull-right'>".$item['code']."</span><br />";
1492 echo ' <div class="fake-textarea-disabled-4">'.nl2br(text($item['plan'])).'</div>';
1493 echo '</div>';
1494 $i++;
1495 $k++;
1498 echo "</div>";
1500 } elseif ($zone =="ALL") {
1501 echo $selector = priors_select($zone, $orig_id, $id_to_show, $pid);
1502 } elseif ($zone =="PMSFH") {
1503 // Check authorization.
1504 if (acl_check('patients', 'med')) {
1505 $tmp = getPatientData($pid);
1508 // We are going to build the PMSFH panel.
1509 // There are two rows in our panel.
1510 echo "<div style='height:auto;'>";
1511 echo $display_PMSFH = display_PMSFH('2');
1512 echo "</div>";
1515 $output = ob_get_contents();
1517 ob_end_clean();
1518 return $output;
1522 * Function to prepare for sending the PMSFH_panel and PMSFH_right_panel
1523 * via display_PMSFH('2') and show_PMSFH_panel($PMSFH) respectively,
1524 * to javascript to display changes to the user.
1525 * @param associative array $PMSFH if it exists
1526 * @return json encoded string
1528 function send_json_values($PMSFH = "")
1530 global $pid;
1531 global $form_id;
1532 if (!$PMSFH) {
1533 build_PMSFH();
1536 $send['PMSFH'] = $PMSFH[0]; //actual array
1537 $send['PMH_panel'] = display_PMSFH('2');//display PMSFH next to the PMSFH Builder
1538 $send['right_panel'] = show_PMSFH_panel($PMSFH);//display PMSFH in a slidable right-sided panel
1539 $send['IMPPLAN_items'] = build_IMPPLAN_items($pid, $form_id);
1540 echo json_encode($send);
1544 * This function builds the complete PMSFH array for a given patient, including the ROS for this encounter.
1546 * It returns the PMSFH array to be used to display it anyway you like.
1547 * Currently it is used to display the expanded PMSFH 3 ways:
1548 * in the Quick Pick square;
1549 * as a persistent/hideable Right Panel;
1550 * and in the Printable Report form.
1551 * For other specialties, breaking out subtypes of surgeries, meds and
1552 * medical_problems should be done here by defining new ISSUE_TYPES which are subcategories of the current
1553 * ISSUE_TYPES medical_problem, surgery and medication. This way we do not change the base install ISSUE_TYPES,
1554 * we merely extend them through subcategorization, allowing the reporting features built in for MU1/2/3/100?
1555 * to function at their base level.
1557 * @param string $pid is the patient identifier
1558 * @return $PMSFH array, access items as $PMSFH[0]
1560 function build_PMSFH($pid)
1562 global $form_folder;
1563 global $form_id;
1564 global $id;
1565 global $ISSUE_TYPES;
1566 global $ISSUE_TYPE_STYLES;
1567 //Define the PMSFH array elements as you need them:
1568 $PMSFH_labels = array("POH", "POS", "PMH", "Surgery", "Medication", "Allergy", "SOCH", "FH", "ROS");
1570 foreach ($PMSFH_labels as $panel_type) {
1571 $PMSFH[$panel_type] ='';
1572 $subtype = " and (subtype is NULL or subtype ='' )";
1573 $order = "ORDER BY title";
1574 if ($panel_type == "FH" || $panel_type == "SOCH" || $panel_type == "ROS") {
1576 * We are going to build SocHx, FH and ROS separately below since they don't feed off of
1577 * the pre-existing ISSUE_TYPE array - so for now do nothing
1579 continue;
1580 } elseif ($panel_type =='POH') {
1581 $focusISSUE = "medical_problem"; //openEMR ISSUE_TYPE
1582 $subtype=" and subtype ='eye'";
1583 /* This is an "eye" form: providers would like ophthalmic medical problems listed separately.
1584 * Thus we split the ISSUE_TYPE 'medical_problem' using subtype "eye"
1585 * but it could be "GYN", "ONC", "GU" etc - for whoever wants to
1586 * extend this for their own specific "sub"-lists.
1587 * Similarly, consider Past Ocular Surgery, or Past GYN Surgery, etc for specialty-specific
1588 * surgery lists. They would be subtypes of the ISSUE_TYPE 'surgery'...
1589 * eg.
1590 * if ($panel_type =='POS') { //Past Ocular Surgery
1591 * $focusISSUE = "surgery";
1592 * $subtype=" and subtype ='eye'";
1594 * The concept is extensible to sub lists for Allergies & Medications too.
1595 * eg.
1596 * if ($panel_type =='OncMeds') {
1597 * $focusISSUE = "medication";
1598 * $subtype=" and subtype ='onc'";
1601 } elseif ($panel_type =='POS') {
1602 $focusISSUE = "surgery"; //openEMR ISSUE_TYPE
1603 $subtype=" and subtype ='eye'";
1604 } elseif ($panel_type =='PMH') {
1605 $focusISSUE = "medical_problem"; //openEMR ISSUE_TYPE
1606 $subtype=" and (subtype = ' ' OR subtype IS NULL)"; //fee_sheet makes subtype=
1607 $PMSFH['CHRONIC'] = '';
1608 } elseif ($panel_type =='Surgery') {
1609 $focusISSUE = "surgery"; //openEMR ISSUE_TYPE
1610 $subtype=" and (subtype = ' ' OR subtype IS NULL)";
1611 $order = "ORDER BY begdate DESC";
1612 } elseif ($panel_type =='Allergy') {
1613 $focusISSUE = "allergy"; //openEMR ISSUE_TYPE
1614 $subtype="";
1615 } elseif ($panel_type =='Medication') {
1616 $focusISSUE = "medication"; //openEMR ISSUE_TYPE
1617 $subtype="";
1620 $pres = sqlStatement("SELECT * FROM lists WHERE pid = ? AND type = ? " .
1621 $subtype." ".$order, array($pid,$focusISSUE));
1622 $row_counter='0';
1623 while ($row = sqlFetchArray($pres)) {
1624 $rowid = $row['id'];
1625 $disptitle = text(trim($row['title'])) ? text($row['title']) : "[".xlt("Missing Title")."]";
1626 // I don't like this [Missing Title] business. It is from the original "issue" code.
1627 // It should not happen. Need to write something to prevent this from occurring
1628 // on submission, but for now it needs to stay because it is also in the original
1629 // /interface/patient_file/summary code. Both areas need to prevent a blank submission,
1630 // and when fixed, remove this note.
1632 // look up the diag codes
1633 $codetext = "";
1634 $codedesc = "";
1635 $codetype = "";
1636 $code = "";
1637 if ($row['diagnosis'] != "") {
1638 $diags = explode(";", $row['diagnosis']);
1639 foreach ($diags as $diag) {
1640 $codedesc = lookup_code_descriptions($diag);
1641 list($codetype, $code) = explode(':', $diag);
1642 $order = array("\r\n", "\n","\r");
1643 $codedesc = str_replace($order, '', $codedesc);
1644 $codetext .= text($diag) . " (" . text($codedesc) . ")";
1648 // calculate the status
1649 if ($row['outcome'] == "1" && $row['enddate'] != null) {
1650 // Resolved
1651 $statusCompute = generate_display_field(array('data_type'=>'1','list_id'=>'outcome'), $row['outcome']);
1652 } else if ($row['enddate'] == null) {
1653 $statusCompute = xlt("Active");
1654 } else {
1655 $statusCompute = xlt("Inactive");
1658 ($row['comments'] != null)? ($comments = $row['comments']): ($comments="");
1659 $counter_here = count($PMSFH[$panel_type]);
1660 $newdata = array (
1661 'title' => $disptitle,
1662 'status' => $statusCompute,
1663 'begdate' => $row['begdate'],
1664 'enddate' => $row['enddate'],
1665 'returndate' => $row['returndate'],
1666 'occurrence' => $row['occurrence'],
1667 'classification' => $row['classification'],
1668 'referredby' => $row['referredby'],
1669 'extrainfo' => $row['extrainfo'],
1670 'diagnosis' => $row['diagnosis'],
1671 'activity' => $row['activity'],
1672 'code' => $code,
1673 'codedesc' => $codedesc,
1674 'codetext' => $codetext,
1675 'codetype' => $codetype,
1676 'comments' => $comments,
1677 'issue' => $row['id'],
1678 'rowid' => $row['id'],
1679 'row_type' => $row['type'],
1680 'row_subtype' => $row['subtype'],
1681 'user' => $row['user'],
1682 'groupname' => $row['groupname'],
1683 'outcome' => $row['outcome'],
1684 'destination' => $row['destination'],
1685 'reinjury_id' => $row['reinjury_id'],
1686 'injury_part' => $row['injury_part'],
1687 'injury_type' => $row['injury_type'],
1688 'injury_grade' => $row['injury_grade'],
1689 'reaction' => $row['reaction'],
1690 'external_allergyid' => $row['external_allergyid'],
1691 'erx_source' => $row['erx_source'],
1692 'erx_uploaded' => $row['erx_uploaded'],
1693 'modifydate' => $row['modifydate'],
1694 'PMSFH_link' => $panel_type."_".$row_counter
1696 //let the end user decide on display elsewhere... This is all about the array itself.
1697 $PMSFH[$panel_type][] = $newdata;
1698 if ($row['occurrence'] =='4') {
1699 $PMSFH['CHRONIC'][]=$newdata;
1702 $row_counter++;
1706 //Build the SocHx portion of $PMSFH for this patient.
1707 //$given ="coffee,tobacco,alcohol,sleep_patterns,exercise_patterns,seatbelt_use,counseling,hazardous_activities,recreational_drugs";
1708 $result1 = sqlQuery("select * from history_data where pid=? order by date DESC limit 0,1", array($pid));
1710 $group_fields_query = sqlStatement("SELECT * FROM layout_options " .
1711 "WHERE form_id = 'HIS' AND group_name = '4Lifestyle' AND uor > 0 " .
1712 "ORDER BY seq");
1713 while ($group_fields = sqlFetchArray($group_fields_query)) {
1714 $titlecols = $group_fields['titlecols'];
1715 $datacols = $group_fields['datacols'];
1716 $data_type = $group_fields['data_type'];
1717 $field_id = $group_fields['field_id'];
1718 $list_id = $group_fields['list_id'];
1719 $currvalue = '';
1720 if ((preg_match("/^\|?0\|?\|?/", $result1[$field_id]))|| ($result1[$field_id]=='')) {
1721 continue;
1722 } else {
1723 $currvalue = $result1[$field_id];
1726 if ($data_type == 28 || $data_type == 32) {
1727 $tmp = explode('|', $currvalue);
1728 switch (count($tmp)) {
1729 case "4":
1730 $PMSFH['SOCH'][$field_id]['resnote'] = $tmp[0];
1731 $PMSFH['SOCH'][$field_id]['restype'] = $tmp[1];
1732 $PMSFH['SOCH'][$field_id]['resdate'] = $tmp[2];
1733 $PMSFH['SOCH'][$field_id]['reslist'] = $tmp[3];
1734 break;
1735 case "3":
1736 $PMSFH['SOCH'][$field_id]['resnote'] = $tmp[0];
1737 $PMSFH['SOCH'][$field_id]['restype'] = $tmp[1];
1738 $PMSFH['SOCH'][$field_id]['resdate'] = $tmp[2];
1739 break;
1740 case "2":
1741 $PMSFH['SOCH'][$field_id]['resnote'] = $tmp[0];
1742 $PMSFH['SOCH'][$field_id]['restype'] = $tmp[1];
1743 $PMSFH['SOCH'][$field_id]['resdate'] = "";
1744 break;
1745 case "1":
1746 $PMSFH['SOCH'][$field_id]['resnote'] = $tmp[0];
1747 $PMSFH['SOCH'][$field_id]['resdate'] = $PMSFH['SOCH'][$field_id]['restype'] = "";
1748 break;
1749 default:
1750 $PMSFH['SOCH'][$field_id]['restype'] = $PMSFH['SOCH'][$field_id]['resdate'] = $PMSFH['SOCH'][$field_id]['resnote'] = "";
1751 break;
1754 $PMSFH['SOCH'][$field_id]['resnote'] = text($PMSFH['SOCH'][$field_id]['resnote']);
1755 $PMSFH['SOCH'][$field_id]['resdate'] = text($PMSFH['SOCH'][$field_id]['resdate']);
1756 } else if ($data_type == 2) {
1757 $PMSFH['SOCH'][$field_id]['resnote'] = nl2br(htmlspecialchars($currvalue, ENT_NOQUOTES));
1760 if ($PMSFH['SOCH'][$field_id]['resnote'] > '') {
1761 $PMSFH['SOCH'][$field_id]['display'] = substr($PMSFH['SOCH'][$field_id]['resnote'], 0, 10);
1762 } elseif ($PMSFH['SOCH'][$field_id]['restype']) {
1763 $PMSFH['SOCH'][$field_id]['display'] = str_replace($field_id, '', $PMSFH['SOCH'][$field_id]['restype']);
1766 //coffee,tobacco,alcohol,sleep_patterns,exercise_patterns,seatbelt_use,counseling,hazardous_activities,recreational_drugs
1767 if ($field_id =="coffee") {
1768 $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Caffeine");
1771 if ($field_id =="tobacco") {
1772 $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Cigs");
1775 if ($field_id =="alcohol") {
1776 $PMSFH['SOCH'][$field_id]['short_title'] = xlt("ETOH");
1779 if ($field_id =="sleep_patterns") {
1780 $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Sleep");
1783 if ($field_id =="exercise_patterns") {
1784 $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Exercise");
1787 if ($field_id =="seatbelt_use") {
1788 $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Seatbelt");
1791 if ($field_id =="counseling") {
1792 $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Therapy");
1795 if ($field_id =="hazardous_activities") {
1796 $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Thrills");
1799 if ($field_id =="recreational_drugs") {
1800 $PMSFH['SOCH'][$field_id]['short_title'] = xlt("Drug Use");
1804 // Drag in Marital status and Employment history to this Social Hx area.
1805 $patient = getPatientData($pid, "*");
1806 $PMSFH['SOCH']['marital_status']['short_title']=xlt("Marital");
1807 $PMSFH['SOCH']['marital_status']['display']=text($patient['status']);
1808 $PMSFH['SOCH']['occupation']['short_title']=xlt("Occupation");
1809 $PMSFH['SOCH']['occupation']['display']=text($patient['occupation']);
1812 // Build the FH portion of $PMSFH,$PMSFH['FH']
1813 // history_mother history_father history_siblings history_offspring history_spouse
1814 // relatives_cancer relatives_tuberculosis relatives_diabetes relatives_high_blood_pressure relatives_heart_problems relatives_stroke relatives_epilepsy relatives_mental_illness relatives_suicide
1815 // There are two ways FH is stored in the history area, one on a specific relationship basis
1816 // ie. parent,sibling, offspring has X, or the other by "relatives_disease" basis.
1817 // Hmmm, neither really meets our needs. This is an eye form; we do a focused family history.
1818 // Cataracts, glaucoma, AMD, RD, cancer, heart disease etc.
1819 // The openEMR people who want to adapt this for another specialty will no doubt
1820 // have different diseases they want listed in the FH specifically. We all need to be able to
1821 // adjust the form. Perhaps we should use the UserDefined fields at the end of this history_data table?
1822 // Question 1. is, does anything use this family history data - any higher function like reporting?
1823 // Also 2., if there is an engine to validate level of exam, how do we tell it that this was completed?
1824 // First we would need to know the criteria this engine looks for and I don't think in reality there is anything
1825 // 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
1826 // table to notate that the FH portion of the exam was completed? TBD.
1828 Cancer: Tuberculosis:
1829 Diabetes: High Blood Pressure:
1830 Heart Problems: Stroke:
1831 Epilepsy: Mental Illness:
1832 Suicide:
1834 $group_fields_query = sqlStatement("SELECT * FROM layout_options " .
1835 "WHERE form_id = 'HIS' AND group_name = '3Relatives' AND uor > 0 " .
1836 "ORDER BY seq");
1837 while ($group_fields = sqlFetchArray($group_fields_query)) {
1838 $titlecols = $group_fields['titlecols'];
1839 $datacols = $group_fields['datacols'];
1840 $data_type = $group_fields['data_type'];
1841 $field_id = $group_fields['field_id'];
1842 $list_id = $group_fields['list_id'];
1843 $currvalue = '';
1844 if ((preg_match("/^\|?0\|?\|?/", $result1[$field_id]))|| ($result1[$field_id]=='')) {
1845 continue;
1846 } else {
1847 $currvalue = $result1[$field_id];
1850 $PMSFH['FH'][$field_id]['resnote'] = nl2br(htmlspecialchars($currvalue, ENT_NOQUOTES));
1851 if ($PMSFH['FH'][$field_id]['resnote'] > '') {
1852 $PMSFH['FH'][$field_id]['display'] = substr($PMSFH['FH'][$field_id]['resnote'], 0, 100);
1853 } elseif ($PMSFH['FH'][$field_id]['restype']) {
1854 $PMSFH['FH'][$field_id]['display'] = str_replace($field_id, '', $PMSFH['FH'][$field_id]['restype']);
1855 } else {
1856 $PMSFH['FH'][$field_id]['display'] = xlt("denies");
1859 //coffee,tobacco,alcohol,sleep_patterns,exercise_patterns,seatbelt_use,counseling,hazardous_activities,recreational_drugs
1860 if ($field_id =="relatives_cancer") {
1861 $PMSFH['FH'][$field_id]['short_title'] = xlt("Cancer");
1864 if ($field_id =="relatives_diabetes") {
1865 $PMSFH['FH'][$field_id]['short_title'] = xlt("Diabetes");
1868 if ($field_id =="relatives_high_blood_pressure") {
1869 $PMSFH['FH'][$field_id]['short_title'] = xlt("HTN{{hypertension}}");
1872 if ($field_id =="relatives_heart_problems") {
1873 $PMSFH['FH'][$field_id]['short_title'] = xlt("Cor Disease");
1876 if ($field_id =="relatives_epilepsy") {
1877 $PMSFH['FH'][$field_id]['short_title'] = xlt("Epilepsy");
1880 if ($field_id =="relatives_mental_illness") {
1881 $PMSFH['FH'][$field_id]['short_title'] = xlt("Psych");
1884 if ($field_id =="relatives_suicide") {
1885 $PMSFH['FH'][$field_id]['short_title'] = xlt("Suicide");
1888 if ($field_id =="relatives_stroke") {
1889 $PMSFH['FH'][$field_id]['short_title'] = xlt("Stroke");
1892 if ($field_id =="relatives_tuberculosis") {
1893 $PMSFH['FH'][$field_id]['short_title'] = xlt("TB");
1897 // Now make some of our own using the usertext11-30 fields
1898 // These can be customized for specialties but remember this is just an array,
1899 // you will need to check the code re: how it is displayed elsewhere...
1900 // For now, just changing the short_titles will display intelligently
1901 // but it is best to change both in the long run.
1902 // $PMSFH['FH']['my_term']['display'] = (substr($result1['usertext11'],0,10));
1903 // $PMSFH['FH']['my_term']['short_title'] = xlt("My Term");
1905 $PMSFH['FH']['glaucoma']['display'] = (substr($result1['usertext11'], 0, 100));
1906 $PMSFH['FH']['glaucoma']['short_title'] = xlt("Glaucoma");
1907 $PMSFH['FH']['cataract']['display'] = (substr($result1['usertext12'], 0, 100));
1908 $PMSFH['FH']['cataract']['short_title'] = xlt("Cataract");
1909 $PMSFH['FH']['amd']['display'] = (substr($result1['usertext13'], 0, 100));
1910 $PMSFH['FH']['amd']['short_title'] = xlt("AMD{{age related macular degeneration}}");
1911 $PMSFH['FH']['RD']['display'] = (substr($result1['usertext14'], 0, 100));
1912 $PMSFH['FH']['RD']['short_title'] = xlt("RD{{retinal detachment}}");
1913 $PMSFH['FH']['blindness']['display'] = (substr($result1['usertext15'], 0, 100));
1914 $PMSFH['FH']['blindness']['short_title'] = xlt("Blindness");
1915 $PMSFH['FH']['amblyopia']['display'] = (substr($result1['usertext16'], 0, 100));
1916 $PMSFH['FH']['amblyopia']['short_title'] = xlt("Amblyopia");
1917 $PMSFH['FH']['strabismus']['display'] = (substr($result1['usertext17'], 0, 100));
1918 $PMSFH['FH']['strabismus']['short_title'] = xlt("Strabismus");
1919 $PMSFH['FH']['other']['display'] = (substr($result1['usertext18'], 0, 100));
1920 $PMSFH['FH']['other']['short_title'] = xlt("Other");
1922 // Thinking this might be a good place to put in last_retinal exam and last_HbA1C?
1923 // I don't know enough about the reporting parameters - it is probably some alreay in openEMR?
1924 // Pull it in if it is and put it where?
1925 // $PMSFH['SOCH'][$field_id]['resnote'] = nl2br(htmlspecialchars($currvalue,ENT_NOQUOTES));
1927 // Build ROS into $PMSFH['ROS'] also for this patient.
1928 // ROS is not static and is directly linked to each encounter
1929 // True it could be a separate table, but it is currently in form_eye_mag for each visit
1930 // To use this for any other forms, we should consider making this its own separate table with id,pid and ?encounter link,
1931 // just like we are doing for Impression Plan. Mybe we can piggybak onto one of the ROS tables already in OpenEMR?
1933 //define the ROS area to include = $given
1934 $given="ROSGENERAL,ROSHEENT,ROSCV,ROSPULM,ROSGI,ROSGU,ROSDERM,ROSNEURO,ROSPSYCH,ROSMUSCULO,ROSIMMUNO,ROSENDOCRINE";
1935 $ROS_table = "form_eye_mag";
1936 $query="SELECT $given from ". $ROS_table ." where id=? and pid=?";
1938 $ROS = sqlStatement($query, array($form_id,$pid));
1939 while ($row = sqlFetchArray($ROS)) {
1940 foreach (explode(',', $given) as $item) {
1941 $PMSFH['ROS'][$item]['display']= $row[$item];
1945 // translator will need to translate each item in $given
1946 $PMSFH['ROS']['ROSGENERAL']['short_title']=xlt("GEN{{General}}");
1947 $PMSFH['ROS']['ROSHEENT']['short_title']=xlt("HEENT");
1948 $PMSFH['ROS']['ROSCV']['short_title']=xlt("CV{{Cardiovascular}}");
1949 $PMSFH['ROS']['ROSPULM']['short_title']=xlt("PULM{{Pulmonary}}");
1950 $PMSFH['ROS']['ROSGI']['short_title']=xlt("GI{{Gastrointestinal}}");
1951 $PMSFH['ROS']['ROSGU']['short_title']=xlt("GU{{Genitourinary}}");
1952 $PMSFH['ROS']['ROSDERM']['short_title']=xlt("DERM{{Dermatology}}");
1953 $PMSFH['ROS']['ROSNEURO']['short_title']=xlt("NEURO{{Neurology}}");
1954 $PMSFH['ROS']['ROSPSYCH']['short_title']=xlt("PSYCH{{Psychiatry}}");
1955 $PMSFH['ROS']['ROSMUSCULO']['short_title']=xlt("ORTHO{{Orthopedics}}");
1956 $PMSFH['ROS']['ROSIMMUNO']['short_title']=xlt("IMMUNO{{Immunology/Rheumatology}}");
1957 $PMSFH['ROS']['ROSENDOCRINE']['short_title']=xlt("ENDO{{Endocrine}}");
1959 $PMSFH['ROS']['ROSGENERAL']['title']=xlt("General");
1960 $PMSFH['ROS']['ROSHEENT']['title']=xlt("HEENT");
1961 $PMSFH['ROS']['ROSCV']['title']=xlt("Cardiovascular");
1962 $PMSFH['ROS']['ROSPULM']['title']=xlt("Pulmonary");
1963 $PMSFH['ROS']['ROSGI']['title']=xlt("GI{{Gastrointestinal}}");
1964 $PMSFH['ROS']['ROSGU']['title']=xlt("GU{{Genitourinary}}");
1965 $PMSFH['ROS']['ROSDERM']['title']=xlt("Dermatology");
1966 $PMSFH['ROS']['ROSNEURO']['title']=xlt("Neurology");
1967 $PMSFH['ROS']['ROSPSYCH']['title']=xlt("Pyschiatry");
1968 $PMSFH['ROS']['ROSMUSCULO']['title']=xlt("Musculoskeletal");
1969 $PMSFH['ROS']['ROSIMMUNO']['title']=xlt("Immune System");
1970 $PMSFH['ROS']['ROSENDOCRINE']['title']=xlt("Endocrine");
1972 return array($PMSFH); //yowsah!
1975 * This function uses the complete PMSFH array for a given patient, including the ROS for this encounter
1976 * and returns the PMSFH display square.
1977 * @param integer rows is the number of rows you want to display
1978 * @param option string view defaults to white on beige, versus right sliding panel (text on beige only).
1979 * @param option string min_height to set min height for the row
1980 * @return $display_PMSFH HTML pane when PMSFH is expanded to two panes.
1982 function display_PMSFH($rows, $view = "pending", $min_height = "min-height:344px;")
1984 global $PMSFH;
1985 global $pid;
1986 global $PMSFH_titles;
1987 if (!$PMFSH) {
1988 $PMSFH = build_PMSFH($pid);
1991 ob_start();
1992 // There are two rows in our PMH section, only one in the side panel.
1993 // If you want it across the bottom in a panel with 8 rows? Or other wise?
1994 // This should be able to handle that too.
1996 // We are building the PMSFH panel.
1997 // Let's put half in each of the 2 rows... or try to at least.
1998 // Find out the number of items present now and put half in each column.
1999 foreach ($PMSFH[0] as $key => $value) {
2000 $total_PMSFH += count($PMSFH[0][$key]);
2001 $total_PMSFH += 2; //add two for the title and a space
2002 $count[$key] = count($PMSFH[0][$key]) + 1;
2005 //SOCH, FH and ROS are listed in $PMSFH even if negative, only count positives
2006 foreach ($PMSFH[0]['ROS'] as $key => $value) {
2007 if ($value['display'] =='') {
2008 $total_PMSFH--;
2009 $count['ROS']--;
2013 foreach ($PMSFH[0]['FH'] as $key => $value) {
2014 if ($value['display'] =='') {
2015 $total_PMSFH--;
2016 $count['FH']--;
2020 foreach ($PMSFH[0]['SOCH'] as $key => $value) {
2021 if (($value['display'] =='') || ($item['display'] == 'not_applicable')) {
2022 $total_PMSFH--;
2023 $count['SOCH']--;
2027 $counter = "0";
2028 $column_max = round($total_PMSFH/$rows);
2029 if ($column_max < "18") {
2030 $column_max ='18';
2033 $open_table = "<table class='PMSFH_table'><tr><td>";
2034 $close_table = "</td></tr></table>";
2035 // $div is used when $counter reaches $column_max and a new row is needed.
2036 // It is used only if $row_count <= $rows, ie. $rows -1 times.
2037 $div = '</div>
2038 <div id="PMSFH_block_2" name="PMSFH_block_2" class="QP_block_outer borderShadow text_clinical" style="'.attr($min_height).'">';
2040 echo $header = '
2041 <div id="PMSFH_block_1" name="PMSFH_block_1" class="QP_block borderShadow text_clinical" style="'.attr($min_height).';">
2043 $row_count=1;
2045 foreach ($PMSFH[0] as $key => $value) {
2046 if ($key == "FH" || $key == "SOCH" || $key == "ROS") {
2047 // We are going to build SocHx, FH and ROS separately below since they are different..
2048 continue;
2051 $table='';
2052 $header='';
2053 $header .=' <table class="PMSFH_header">
2054 <tr>
2055 <td width="90%">
2056 <span class="left" style="font-weight:800;font-size:0.9em;">'.xlt($key).'</span>
2057 </td>
2058 <td>
2059 <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>
2060 </td>
2061 </tr>
2062 </table>
2065 if ($PMSFH[0][$key] > "") {
2066 $index=0;
2067 foreach ($PMSFH[0][$key] as $item) {
2068 if ($key == "Allergy") {
2069 if ($item['reaction']) {
2070 $reaction = " (".text($item['reaction']).")";
2071 } else {
2072 $reaction ="";
2075 $red = "style='color:red;'";
2076 } else {
2077 $red ='';
2080 $table .= "<span $red name='QP_PMH_".$item['rowid']."' href='#PMH_anchor' id='QP_PMH_".$item['rowid']."'
2081 onclick=\"alter_issue2('".attr($item['rowid'])."','".attr($key)."','".attr($index)."');\">".text($item['title']).$reaction."</span><br />";
2082 $index++;
2084 } else {
2085 if ($key == "Allergy") {
2086 $table .= xlt("NKDA{{No known drug allergies}}");
2087 } else {
2088 $table .= xlt("None");
2091 $counter++;
2094 $display_PMSFH[$key] = $header.$open_table.$table.$close_table;
2097 echo $display_PMSFH['POH'];
2098 $count = $count['POH'] + $count['PMH'] + 4;
2099 if ($count >= $column_max) {
2100 echo $div.$header1;
2103 echo $display_PMSFH['POS'];
2104 $count = $count + $count['POS'] + 4;
2105 if ($count >= $column_max) {
2106 echo $div.$header1;
2109 echo $display_PMSFH['PMH'];
2110 $count = $count + $count['Surgery'] + 4;
2111 if (($count >= $column_max) && ($row_count < $rows)) {
2112 echo $div;
2113 $count=0;
2114 $row_count =2;
2117 echo $display_PMSFH['Surgery'];
2119 $count = $count + $count['Medication'] + 4;
2120 if (($count >= $column_max) && ($row_count < $rows)) {
2121 echo $div;
2122 $count=0;
2123 $row_count =2;
2126 echo $display_PMSFH['Medication'];
2128 $count = $count + $count['Allergy'] + 4;
2129 if (($count >= $column_max) && ($row_count < $rows)) {
2130 echo $div;
2131 $count=0;
2132 $row_count =2;
2135 echo $display_PMSFH['Allergy'];
2137 $count = $count + $count['FH'] + 4;
2138 if (($count >= $column_max) && ($row_count < $rows)) {
2139 echo $div;
2140 $count=0;
2141 $row_count =2;
2142 } ?>
2143 <table style="width:1.6in;">
2144 <tr>
2145 <td width="90%">
2146 <span class="left" style="font-weight:800;font-size:0.9em;"><?php echo xlt("FH{{Family History}}"); ?></span>
2147 </td>
2148 <td >
2149 <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>
2150 </td>
2151 </tr>
2152 </table>
2153 <?php
2154 echo $open_table;
2155 $mentions_FH='';
2156 if (count($PMSFH[0]['FH']) > 0) {
2157 foreach ($PMSFH[0]['FH'] as $item) {
2158 if (($counter > $column_max) && ($row_count < $rows)) {
2159 echo $close_table.$div.$open_table;
2160 $counter="0";
2161 $row_count++;
2164 if ($item['display'] > '') {
2165 $counter++;
2166 echo "<span name='QP_PMH_".$item['rowid']."' href='#PMH_anchor' id='QP_PMH_".$item['rowid']."'
2167 onclick=\"alter_issue2('0','FH','');\">".xlt($item['short_title']).": ".text($item['display'])."</span><br />";
2168 $mentions_FH++;
2173 if ($mentions_FH < '1') { ?>
2174 <span href="#PMH_anchor"
2175 onclick="alter_issue2('0','FH','');" style="text-align:right;"><?php echo xlt("Negative"); ?></span><br />
2176 <?php
2177 $counter = $counter+3;
2180 echo $close_table;
2181 $count = $count + $count['SOCH'] + 4;
2183 if (($count > $column_max) && ($row_count < $rows)) {
2184 echo $div;
2185 $count=0;
2186 $row_count =2;
2187 } ?>
2188 <table style="width:1.6in;">
2189 <tr>
2190 <td width="90%">
2191 <span class="left" style="font-weight:800;font-size:0.9em;"><?php echo xlt("Social"); ?></span>
2192 </td>
2193 <td >
2194 <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>
2195 </td>
2196 </tr>
2197 </table>
2198 <?php
2199 echo $open_table;
2200 foreach ($PMSFH[0]['SOCH'] as $item) {
2201 if (($counter > $column_max) && ($row_count < $rows)) {
2202 echo $close_table.$div.$open_table;
2203 $counter="0";
2204 $row_count++;
2207 if (($item['display'] > '') && ($item['display'] != 'not_applicable')) {
2208 echo "<span name='QP_PMH_".$item['rowid']."' href='#PMH_anchor' id='QP_PMH_".$item['rowid']."'
2209 onclick=\"alter_issue2('0','SOCH','');\">".xlt($item['short_title']).": ".text($item['display'])."</span><br />";
2210 $counter++;
2211 $mentions_SOCH++;
2215 if (!$mentions_SOCH) {
2217 <span href="#PMH_anchor"
2218 onclick="alter_issue2('0','SOCH','');" style="text-align:right;"><?php echo xlt("Not documented"); ?></span><br />
2219 <?php
2220 $counter=$counter+2;
2223 echo $close_table;
2224 $count = $count + $count['ROS'] + 4;
2226 if (($count > $column_max) && ($row_count < $rows)) {
2227 echo $div;
2228 $count=0;
2229 $row_count =2;
2230 } ?>
2231 <table style="width:1.6in;">
2232 <tr>
2233 <td width="90%">
2234 <span class="left" style="font-weight:800;font-size:0.9em;"><?php echo xlt("ROS{{Review of Systems}}"); ?></span>
2235 </td>
2236 <td >
2237 <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>
2238 </td>
2239 </tr>
2240 </table>
2241 <?php
2242 echo $open_table;
2243 foreach ($PMSFH[0]['ROS'] as $item) {
2244 if ($item['display'] > '') {
2245 if (($counter > $column_max)&& ($row_count < $rows)) {
2246 echo $close_table.$div.$open_table;
2247 $counter="0";
2248 $row_count++;
2251 //xlt($item['short_title']) - for a list of short_titles, see the predefined ROS categories
2252 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2253 onclick=\"alter_issue2('0','ROS','');\">".xlt($item['short_title']).": ".text($item['display'])."</span><br />";
2254 $mention++;
2255 $counter++;
2259 if ($mention < 1) {
2260 echo xlt("Negative") ."<br />";
2261 $counter=$counter++;
2264 echo $close_table;
2266 </div>
2267 <?php
2268 $PMH_panel = ob_get_contents();
2269 ob_end_clean();
2270 return $PMH_panel;
2274 * This function uses the complete PMSFH array for a given patient, including the ROS for this encounter
2275 * and returns the PMSFH/ROS sliding Right Panel
2277 * @param array $PMSFH
2278 * @return $right_panel html
2280 function show_PMSFH_panel($PMSFH, $columns = '1')
2282 ob_start();
2283 echo '<div style="font-size:1.2em;padding:25 2 2 5;z-index:1;">
2284 <div>';
2286 //<!-- POH -->
2287 echo "<br /><span class='panel_title' title='".xla('Past Ocular History')."'>".xlt("POH{{Past Ocular History}}").":</span>";
2289 <span class="top-right btn-sm" href="#PMH_anchor"
2290 onclick="alter_issue2('0','POH','');"
2291 style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2292 <br />
2293 <?php
2294 if ($PMSFH[0]['POH'] > "") {
2295 $i=0;
2296 foreach ($PMSFH[0]['POH'] as $item) {
2297 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2298 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','POH','$i');\">".text($item['title'])."</span><br />";
2299 $i++;
2301 } else { ?>
2302 <span href="#PMH_anchor"
2303 onclick="alter_issue2('0','POH','');" style="text-align:right;"><?php echo xlt("None"); ?><br /></span>
2304 <?php
2307 //<!-- POS -->
2308 echo "<br /><span class='panel_title' title='".xla('Past Ocular Surgery')."'>".xlt("POS{{Past Ocular Surgery}}").":</span>";
2310 <span class="top-right btn-sm" href="#PMH_anchor"
2311 onclick="alter_issue2('0','POS','');"
2312 style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2313 <br />
2314 <?php
2315 if ($PMSFH[0]['POS'] > "") {
2316 $i=0;
2317 foreach ($PMSFH[0]['POS'] as $item) {
2318 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2319 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','POS','$i');\">".text($item['title'])."</span><br />";
2320 $i++;
2322 } else { ?>
2323 <span href="#PMH_anchor"
2324 onclick="alter_issue2('0','POS','');" style="text-align:right;"><?php echo xlt("None"); ?><br /></span>
2325 <?php
2328 //<!-- PMH -->
2329 echo "<br /> <span class='panel_title' title='".xla('Past Medical History')."'>".xlt("PMH{{Past Medical History}}").":</span>";
2330 ?><span class="top-right btn-sm" href="#PMH_anchor"
2331 onclick="alter_issue2('0','PMH','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2332 <br />
2333 <?php
2334 if ($PMSFH[0]['PMH'] > "") {
2335 $i=0;
2336 foreach ($PMSFH[0]['PMH'] as $item) {
2337 if ($item['enddate'] !==" ") {
2338 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2339 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','PMH','$i');\">".text($item['title'])."</span><br />";
2340 $i++;
2343 } else { ?>
2344 <span href="#PMH_anchor"
2345 onclick="alter_issue2('0','PMH','');" style="text-align:right;"><?php echo xlt("None"); ?></br></span>
2346 <?php
2349 //<!-- Surgeries -->
2350 echo "<br /><span class='panel_title' title='".xlt("Past Surgical History")."'>".xlt("Surgery").":</span>";
2351 ?><span class="top-right btn-sm" href="#PMH_anchor"
2352 onclick="alter_issue2('0','Surgery','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2353 <br />
2354 <?php
2355 if ($PMSFH[0]['Surgery'] > "") {
2356 $i=0;
2357 foreach ($PMSFH[0]['Surgery'] as $item) {
2358 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2359 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','Surgery','$i');\">".text($item['title'])."<br /></span>";
2360 $i++;
2362 } else { ?>
2363 <span href="#PMH_anchor"
2364 onclick="alter_issue2('0','Surgery','');" style="text-align:right;"><?php echo xlt("None"); ?><br /></span>
2365 <?php
2368 //<!-- Meds -->
2369 echo "<br /><span class='panel_title' title='".xlt("Medications")."'>".xlt("Medication").":</span>";
2370 ?><span class="top-right btn-sm" href="#PMH_anchor"
2371 onclick="alter_issue2('0','Medication','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2372 <br />
2373 <?php
2374 if ($PMSFH[0]['Medication'] > "") {
2375 $i=0;
2376 foreach ($PMSFH[0]['Medication'] as $item) {
2377 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2378 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','Medication','$i');\">".text($item['title'])."</span><br />";
2379 $i++;
2381 } else { ?>
2382 <span href="#PMH_anchor"
2383 onclick="alter_issue2('0','Medication','');" style="text-align:right;"><?php echo xlt("None"); ?><br /></span>
2384 <?php
2388 //<!-- Allergies -->
2389 echo "<br /><span class='panel_title' title='".xlt("Allergies")."'>".xlt("Allergy").":</span>";
2390 ?><span class="top-right btn-sm" href="#PMH_anchor"
2391 onclick="alter_issue2('0','Allergy','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2392 <br />
2393 <?php
2394 if ($PMSFH[0]['Allergy'] > "") {
2395 $i=0;
2396 foreach ($PMSFH[0]['Allergy'] as $item) {
2397 if ($item['reaction']) {
2398 $reaction = "(".text($item['reaction']).")";
2399 } else {
2400 $reaction ="";
2403 echo "<span ok style='color:red;' name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2404 onclick=\"alter_issue2('".attr(addslashes($item['rowid']))."','Allergy','$i');\">".text($item['title'])." ".$reaction."</span><br />";
2405 $i++;
2407 } else { ?>
2408 <span href="#PMH_anchor"
2409 onclick="alter_issue2('0','Allergy','');" style="text-align:right;"><?php echo xlt("NKDA{{No known drug allergies}}"); ?><br /></span>
2410 <?php
2413 //<!-- Social History -->
2414 echo "<br /><span class='panel_title' title='".xlt("Social History")."'>".xlt('Soc Hx{{Social History}}').":</span>";
2415 ?><span class="top-right btn-sm" href="#PMH_anchor"
2416 onclick="alter_issue2('0','SOCH','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?>
2417 </span><br />
2418 <?php
2419 foreach ($PMSFH[0]['SOCH'] as $k => $item) {
2420 if (($item['display']) && ($item['display'] != 'not_applicable')) {
2421 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2422 onclick=\"alter_issue2('0','SOCH','');\">".xlt($item['short_title']).": ".text($item['display'])."<br /></span>";
2424 $mention_SOCH++;
2428 if (!$mention_SOCH) {
2430 <span href="#PMH_anchor"
2431 onclick="alter_issue2('0','SOCH','');" style="text-align:right;"><?php echo xlt("Negative"); ?><br /></span>
2432 <?php
2435 //<!-- Family History -->
2436 echo "<br /><span class='panel_title' title='".xlt("Family History")."'>".xlt("FH{{Family History}}").":</span>";
2437 ?><span class="top-right btn-sm" href="#PMH_anchor"
2438 onclick="alter_issue2('0','FH','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span><br />
2440 <?php
2441 if (count($PMSFH[0]['FH']) > 0) {
2442 foreach ($PMSFH[0]['FH'] as $item) {
2443 if ($item['display'] > '') {
2444 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2445 onclick=\"alter_issue2('0','FH','');\">".xlt($item['short_title']).": ".text($item['display'])."<br /></span>";
2446 $mention_FH++;
2451 if (!$mention_FH) {
2453 <span href="#PMH_anchor"
2454 onclick="alter_issue2('0','FH','');" style="text-align:right;"><?php echo xlt("Negative"); ?><br /></span>
2455 <?php
2458 echo "<br /><span class='panel_title' title='".xlt("Review of System")."'>".xlt("ROS{{Review of Systems}}").":</span>";
2459 ?><span class="top-right btn-sm" href="#PMH_anchor"
2460 onclick="alter_issue('0','ROS','');" style="text-align:right;font-size:8px;"><?php echo xlt("Add"); ?></span>
2461 <br />
2462 <?php
2463 foreach ($PMSFH[0]['ROS'] as $item) {
2464 if ($item['display']) {
2465 echo "<span name='QP_PMH_".attr($item['rowid'])."' href='#PMH_anchor' id='QP_PMH_".attr($item['rowid'])."'
2466 onclick=\"alter_issue2('0','ROS','');\">".text($item['short_title']).": ".text($item['display'])."</span><br />";
2467 $mention_ROS++;
2471 if (!$mention_ROS) { ?>
2472 <span href="#PMH_anchor"
2473 onclick="alter_issue2('0','ROS','');" style="text-align:right;"><?php echo xlt('Negative'); ?><br /></span>
2474 <?php
2477 echo "<br /><br /><br />";
2478 $right_panel = ob_get_contents();
2480 ob_end_clean();
2481 return $right_panel;
2485 * This function displays via echo the PMSFH/ROS in the report
2487 * @param array $PMSFH
2490 function show_PMSFH_report($PMSFH)
2492 global $pid;
2493 global $ISSUE_TYPES;
2495 //4 panels
2496 $rows = '4';
2497 if (!$PMFSH) {
2498 $PMSFH = build_PMSFH($pid);
2501 // Find out the number of items present now and put 1/4 in each column.
2502 foreach ($PMSFH[0] as $key => $value) {
2503 $total_PMSFH += count($PMSFH[0][$key]);
2504 $total_PMSFH += 2; //add two for the title and a space
2505 $count[$key] = count($PMSFH[0][$key]) + 1;
2508 //SOCH, FH and ROS are listed in $PMSFH even if negative, only count positives
2509 foreach ($PMSFH[0]['ROS'] as $key => $value) {
2510 if ($value['display'] =='') {
2511 $total_PMSFH--;
2512 $count['ROS']--;
2516 foreach ($PMSFH[0]['FH'] as $key => $value) {
2517 if ($value['display'] =='') {
2518 $total_PMSFH--;
2519 $count['FH']--;
2523 foreach ($PMSFH[0]['SOCH'] as $key => $value) {
2524 if (($value['display'] =='') || ($value['display'] == 'not_applicable')) {
2525 $total_PMSFH--;
2526 $count['SOCH']--;
2530 $counter = "0";
2531 $column_max = round($total_PMSFH/$rows) ;
2532 $panel_size = round($total_PMSFH/$rows) ;
2534 //<!-- POH -->
2535 $counter++;
2536 $counter++;
2537 echo "<table style='width:700px;'><tr><td style='vertical-align:top;width:150px;' class='show_report'><br /><b>".xlt("POH{{Past Ocular History}}").":</b>";
2538 //note the HTML2PDF does not like <span style="font-weight:bold;"></span> so we are using the deprecated <b></b>
2540 <br />
2541 <?php
2542 if ($PMSFH[0]['POH'] > "") {
2543 foreach ($PMSFH[0]['POH'] as $item) {
2544 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2545 $counter++;
2547 } else {
2548 echo xlt("None")."<br />";
2551 if (($counter + $count['POS']) > $panel_size) {
2552 echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>";
2553 $counter ="0";
2556 $counter++;
2557 $counter++;
2558 //<!-- PMH -->
2559 echo "<br /><b>".xlt("Eye Surgery").":</b>";
2561 <br />
2562 <?php
2563 if ($PMSFH[0]['POS'] > "") {
2564 foreach ($PMSFH[0]['POS'] as $item) {
2565 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2566 $counter++;
2568 } else {
2569 echo xlt("None")."<br />";
2572 if (($counter + $count['PMH']) > $panel_size) {
2573 echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>";
2574 $counter ="0";
2577 $counter++;
2578 $counter++;
2579 //<!-- PMH -->
2580 echo "<br /><b>".xlt("PMH").":</b>";
2582 <br />
2583 <?php
2584 if ($PMSFH[0]['PMH'] > "") {
2585 foreach ($PMSFH[0]['PMH'] as $item) {
2586 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2587 $counter++;
2589 } else {
2590 echo xlt("None")."<br />";
2594 if ($counter + $count['Medication'] > $panel_size) {
2595 echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>";
2596 $counter ="0";
2599 $counter++;
2600 $counter++;
2601 //<!-- Meds -->
2602 echo "<br /><b>".xlt("Medication").":</b>";
2604 <br />
2605 <?php
2606 if ($PMSFH[0]['Medication'] > "") {
2607 foreach ($PMSFH[0]['Medication'] as $item) {
2608 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2609 $counter++;
2611 } else {
2612 echo xlt("None")."<br />";
2615 if ($counter + $count['Surgery'] > $panel_size) {
2616 echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>";
2617 $counter ="0";
2620 //<!-- Surgeries -->
2621 $counter++;
2622 $counter++;
2623 echo "<br /><b>".xlt("Surgery").":</b>";
2624 ?><br />
2625 <?php
2626 if ($PMSFH[0]['Surgery'] > "") {
2627 foreach ($PMSFH[0]['Surgery'] as $item) {
2628 echo text($item['title'])." ".text($item['diagnosis'])."<br />";
2629 $counter++;
2631 } else {
2632 echo xlt("None")."<br />";
2635 if ($counter + $count['Allergy'] > $panel_size) {
2636 echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>";
2637 $counter ="0";
2640 $counter++;
2641 $counter++;
2642 //<!-- Allergies -->
2643 echo "<br /><b>".xlt("Allergy").":</b>";
2645 <br />
2646 <?php
2647 if ($PMSFH[0]['Allergy'] > "") {
2648 foreach ($PMSFH[0]['Allergy'] as $item) {
2649 echo text($item['title'])."<br />";
2650 $counter++;
2652 } else {
2653 echo xlt("NKDA{{No known drug allergies}}")."<br />";
2656 if ($counter + $count['SOCH'] > $panel_size) {
2657 echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>";
2658 $counter ="0";
2661 $counter++;
2662 $counter++;
2663 //<!-- SocHx -->
2664 echo "<br /><b>".xlt("Soc Hx{{Social History}}").":</b>";
2666 <br />
2667 <?php
2668 foreach ($PMSFH[0]['SOCH'] as $k => $item) {
2669 if (($item['display']) && ($item['display'] != 'not_applicable')) {
2670 echo xlt($item['short_title']).": ".text($item['display'])."<br />";
2671 $mention_PSOCH++;
2672 $counter++;
2676 if (!$mention_PSOCH) {
2677 echo xlt("Negative")."<br />";
2680 if (($counter + $count['FH']) > $panel_size) {
2681 echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>";
2682 $counter ="0";
2685 $counter++;
2686 $counter++;
2687 //<!-- FH -->
2688 echo "<br /><b>".xlt("FH{{Family History}}").":</b>";
2690 <br />
2691 <?php
2692 foreach ($PMSFH[0]['FH'] as $item) {
2693 if ($item['display']) {
2694 echo xlt($item['short_title']).": ".text($item['display'])."<br />";
2695 $mention_FH++;
2696 $counter++;
2700 if (!$mention_FH) {
2701 echo xlt("Negative")."<br />";
2704 if (($counter!=="0") && (($counter + $count['ROS']) > $panel_size)) {
2705 echo "</td><td class='show_report' style='vertical-align:top;width:150px;'>";
2706 $counter ="0";
2709 $counter++;
2710 $counter++;
2711 //<!-- ROS -->
2712 echo "<br /><b>".xlt("ROS{{Review of Systems}}").":</b>";
2713 ?><br />
2714 <?php
2715 foreach ($PMSFH[0]['ROS'] as $item) {
2716 if ($item['display']) {
2717 echo xlt($item['short_title']).": ".$item['display']."<br />";
2718 $mention_ROS++;
2719 $counter++;
2723 if ($mention_ROS < '1') {
2724 echo xlt("Negative");
2727 echo "</td></tr></table>";
2731 * This function returns the Provider-specific Quick Pick selections for a zone (2 input values)
2733 * These selctions are draw from an openEMR list, Eye_QP_$zone_$providerID.
2734 * This list is created from Eye_QP_$zone_defaults when a new provider opens the form.
2735 * Because it is a "list", the end-user can modify it.
2736 * A link to the list "the pencil icon" is provided to allow customization - displayed in RTop frame.
2737 * If frames are ever removed, this will need to be reworked.
2739 * @param string $zone options EXT,ANTSEG,RETINA,NEURO
2740 * @param string $providerID
2741 * @return QP text : when called directly outputs the ZONE specific HTML5 CANVAS widget
2743 function display_QP($zone, $providerID)
2745 global $prov_data;
2746 if (!$zone || !$providerID) {
2747 return;
2750 ob_start();
2751 $query = "SELECT * FROM list_options where list_id =? ORDER BY seq";
2752 $result = sqlStatement($query, array("Eye_QP_".$zone."_$providerID"));
2753 if (sqlNumRows($result) < '1') {
2754 //this provider's list has not been created yet.
2755 $query = "REPLACE INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `option_value`) VALUES ('lists', ?, ?, '0', '1', '0')";
2756 sqlStatement($query, array('Eye_QP_'.$zone.'_'.$providerID,'Eye QP List '.$zone.' for '.$prov_data['lname']));
2757 $query = "SELECT * FROM list_options where list_id =? ORDER BY seq";
2758 $result = sqlStatement($query, array("Eye_QP_".$zone."_defaults"));
2759 $SQL_INSERT = "INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `mapping`, `notes`, `codes`, `activity`, `subtype`) VALUES (?,?,?,?,?,?,?,?,?)";
2762 while ($QP= sqlFetchArray($result)) {
2763 if ($SQL_INSERT) {
2764 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']));
2767 $here[$QP['title']][$QP['subtype']]['notes'] = $QP['notes']; //the text to fill into form
2768 $here[$QP['title']][$QP['subtype']]['codes'] = $QP['codes']; //the code if attached.
2769 $here[$QP['title']][$QP['subtype']]['mapping'] = $QP['mapping']; //the fieldname without laterality eg CONJ
2770 $here[$QP['title']][$QP['subtype']]['activity'] = $QP['activity']; //1 to replace, 0 to append
2773 foreach ($here as $title => $values) { //start QP section items
2774 $title_show = (strlen($title) > 19) ? substr($title, 0, 16).'...' : $title;
2775 if (preg_match('/clear field/', $title)) {
2776 $title_show = "<em><strong>$title</strong></em>";
2779 if ($values['OD']) {
2780 if ($values['OD']['activity'] == '0') {
2781 $action = "ADD";
2784 if ($values['OD']['activity'] == '1') {
2785 $action = "REPLACE" ;
2788 if ($values['OD']['activity'] == '2') {
2789 $action = "APPEND" ;
2792 <span>
2793 <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> |
2794 <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> |
2795 <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>
2796 </span>
2797 &nbsp;
2798 <?php
2799 } else if ($values['R']) {
2800 if ($values['R']['activity'] == '0') {
2801 $action = "ADD";
2804 if ($values['R']['activity'] == '1') {
2805 $action = "REPLACE" ;
2808 if ($values['R']['activity'] == '2') {
2809 $action = "APPEND" ;
2812 <span>
2813 <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> |
2814 <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> |
2815 <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>
2816 </span>
2817 &nbsp;
2818 <?php
2821 echo $title_show;
2822 $number_rows++;
2823 ?><br />
2824 <?php
2825 if ($number_rows==19) { ?>
2826 </div>
2827 <div class="QP_block_outer borderShadow text_clinical" ><?php
2830 if ($number_rows == 38) {
2831 break;
2833 } //end QP section items
2835 <a href="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_list.php?list_id=Eye_QP_<?php echo attr($zone)."_".attr($providerID); ?>" target="RTop"
2836 title="<?php echo xla('Click here to Edit this Doctor\'s Quick Pick list'); ?>"
2837 name="provider_todo" style="color:black;font-weight:600;"><i class="closeButton pull-right fa fa-pencil fa-fw"></i> </a>
2838 <?php
2839 $QP_panel = ob_get_contents();
2840 ob_end_clean();
2841 return $QP_panel;
2846 * This function returns display the draw/sketch diagram for a zone (4 input values)
2848 * If there is already a drawing for this zone in this encounter, it is pulled from
2849 * from its stored location:
2850 * $GLOBALS['web_root']."/sites/".$_SESSION['site_id']."/".$form_folder."/".$pid."/".$encounter."/".$side."_".$zone."_VIEW.png?".rand();
2852 * Otherwise a "BASE" image is pulled from the images directory of the form... Customizable.
2854 * @param string $zone options ALL,EXT,ANTSEG,RETINA,NEURO
2855 * @param string $visit_date Future functionality to limit result set. UTC DATE Formatted
2856 * @param string $pid value = patient id
2857 * @param string OU by default. Future functionality will allow OD and OS values- not implemented yet.
2858 * @return true : when called directly outputs the ZONE specific HTML5 CANVAS widget
2860 function display_draw_section($zone, $encounter, $pid, $side = 'OU', $counter = '')
2862 global $form_folder;
2863 $filepath = $GLOBALS['oer_config']['documents']['repository'] . $pid ."/";
2864 $base_name = $pid."_".$encounter."_".$side."_".$zone."_VIEW";
2865 $file_history = $filepath.$base_name;
2866 $file_store= $file_history.".jpg";
2868 <div id="Draw_<?php echo attr($zone); ?>" name="Draw_<?php echo attr($zone); ?>" style="text-align:center;height: 2.5in;" class="Draw_class canvas">
2869 <span class="fa fa-file-text-o closeButton" id="BUTTON_TEXT_<?php echo attr($zone); ?>" name="BUTTON_TEXT_<?php echo attr($zone); ?>"></span>
2870 <i class="closeButton_2 fa fa-database" id="BUTTON_QP_<?php echo attr($zone); ?>_2" name="BUTTON_QP_<?php echo attr($zone); ?>"></i>
2871 <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>
2873 <?php
2874 /* This will provide a way to scroll back through prior VISIT images, to copy forward to today's visit,
2875 * just like we do in the text fields.
2876 * Will need to do a lot of thinking to create this. Jist is ajax call to server for image retrieval.
2877 * To get this to work we need a way to select an old image to work from, use current or return to baseline.
2878 * This will require a global BACK button like above (BUTTON_BACK_<?php echo attr($zone); ?>).
2879 * The Undo Redo buttons are currently javascript client side.
2880 * The Undo Redo features will only work for changes made since form was loaded locally.
2882 * If we want to look back at a prior VISITs saved final images,
2883 * we will need to create this logic.
2884 * Need to think about how to display this visually so it's intuitive, without cluttering the page...
2885 * At first glance, using the text PRIORS selection method should work... Not yet.
2887 //$output = priors_select($zone,$orig_id,$id_to_show,$pid); echo $output;
2889 <div class="tools" style="text-align:center;width:100%;text-align:left;margin-left:2em;">
2890 <div id="sketch_tooled_<?php echo attr($zone); ?>_8" style="position: relative;
2891 float: left;
2892 background-image: url(../../forms/eye_mag/images/pencil_white.png);
2893 background-size: 40px 80px;
2894 margin-right:50px;">
2895 <input class="jscolor {mode:'HVS',
2896 position:'right',
2897 borderColor:'#FFF #666 #666 #FFF',
2898 insetColor:'#666 #FFF #FFF #666',
2899 backgroundColor:'#CCC',
2900 hash:'true',
2901 styleElement:'sketch_tool_<?php echo attr($zone); ?>_color',
2902 valueElement: 'selColor_<?php echo attr($zone); ?>',
2903 refine:true
2905 id="sketch_tool_<?php echo attr($zone); ?>_color"
2906 type="text" style="width: 38px;
2907 height: 20px;
2908 padding: 11px 0px;
2909 background-color: blue;
2910 margin-top: 26px;
2911 color: white;
2912 background-image: none;" />
2913 </div>
2914 <?php
2915 $sql = "SELECT * from documents where url like ?";
2916 $doc = sqlQuery($sql, array("%". $base_name ."%"));
2917 $base_filetoshow = $GLOBALS['web_root']."/interface/forms/".$form_folder."/images/".$side."_".$zone."_BASE.jpg";
2919 // random to not pull from cache.
2920 if (file_exists($file_store) && ($doc['id'] > '0')) {
2921 $filetoshow = $GLOBALS['web_root']."/controller.php?document&retrieve&patient_id=".attr($pid)."&document_id=".attr($doc['id'])."&as_file=false&blahblah=".rand();
2922 } else {
2923 //base image.
2924 $filetoshow = $base_filetoshow;
2928 <input type="hidden" id="url_<?php echo attr($zone); ?>" name="url_<?php echo attr($zone); ?>" value="<?php echo $filetoshow; ?>" />
2929 <input type="hidden" id="base_url_<?php echo attr($zone); ?>" name="base_url_<?php echo attr($zone); ?>" value="<?php echo $base_filetoshow; ?>" />
2930 <input type="hidden" id="selWidth_<?php echo attr($zone); ?>" value="1">
2931 <input type="hidden" id="selColor_<?php echo attr($zone); ?>" value="#000" />
2935 <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;">
2936 <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;">
2937 <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;">
2938 <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;">
2939 <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;">
2940 <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;">
2941 <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;">
2943 <span style="min-width:1in;">&nbsp;</span>
2944 <!-- now to pencil size -->
2945 <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;">
2946 <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;">
2947 <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;">
2948 <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;">
2949 <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;">
2950 </div>
2952 <div align="center" class="borderShadow">
2953 <canvas id="myCanvas_<?php echo attr($zone); ?>" name="myCanvas_<?php echo attr($zone); ?>" width="450" height="225"></canvas>
2954 </div>
2955 <div style="margin-top: 7px;">
2956 <button onclick="javascript:cUndo('<?php echo attr($zone); ?>');return false;" id="Undo_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("Undo"); ?></button>
2957 <button onclick="javascript:cRedo('<?php echo attr($zone); ?>');return false;" id="Redo_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("Redo"); ?></button>
2958 <button onclick="javascript:drawImage('<?php echo attr($zone); ?>');return false;" id="Revert_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("Revert"); ?></button>
2959 <button onclick="javascript:cReload('<?php echo attr($zone); ?>');return false;" id="Clear_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("New"); ?></button>
2960 <button id="Blank_Canvas_<?php echo attr($zone); ?>"><?php echo xlt("Blank"); ?></button>
2961 </div>
2962 <br />
2963 </div>
2964 <?php
2968 * This function returns a JSON object to replace a requested section with copy_forward values (3 input values)
2969 * It will not replace the drawings with older encounter drawings... Not yet anyway.
2971 * @param string $zone options ALL,EXT,ANTSEG,RETINA,NEURO, EXT_DRAW, ANTSEG_DRAW, RETINA_DRAW, NEURO_DRAW
2972 * @param string $form_id is the form_eye_mag.id where the data to carry forward is located
2973 * @param string $pid value = patient id
2974 * @return true : when called directly outputs the ZONE specific HTML for a prior record + widget for the desired zone
2976 function copy_forward($zone, $copy_from, $copy_to, $pid)
2978 global $form_id;
2979 $query="select form_encounter.date as encounter_date,form_eye_mag.* from form_eye_mag ,forms,form_encounter
2980 where
2981 form_encounter.encounter = forms.encounter and
2982 form_eye_mag.id=forms.form_id and
2983 forms.pid =form_eye_mag.pid and
2984 form_eye_mag.pid=?
2985 and form_eye_mag.id =? ";
2987 $objQuery =sqlQuery($query, array($pid,$copy_from));
2988 if ($zone =="EXT") {
2989 $result['RUL']=$objQuery['RUL'];
2990 $result['LUL']=$objQuery['LUL'];
2991 $result['RLL']=$objQuery['RLL'];
2992 $result['LLL']=$objQuery['LLL'];
2993 $result['RBROW']=$objQuery['RBROW'];
2994 $result['LBROW']=$objQuery['LBROW'];
2995 $result['RMCT']=$objQuery['RMCT'];
2996 $result['LMCT']=$objQuery['LMCT'];
2997 $result['RADNEXA']=$objQuery['RADNEXA'];
2998 $result['LADNEXA']=$objQuery['LADNEXA'];
2999 $result['RMRD']=$objQuery['RMRD'];
3000 $result['LMRD']=$objQuery['LMRD'];
3001 $result['RLF']=$objQuery['RLF'];
3002 $result['LLF']=$objQuery['LLF'];
3003 $result['RVFISSURE']=$objQuery['RVFISSURE'];
3004 $result['LVFISSURE']=$objQuery['LVFISSURE'];
3005 $result['RCAROTID']=$objQuery['RCAROTID'];
3006 $result['LCAROTID']=$objQuery['LCAROTID'];
3007 $result['RTEMPART']=$objQuery['RTEMPART'];
3008 $result['LTEMPART']=$objQuery['LTEMPART'];
3009 $result['RCNV']=$objQuery['RCNV'];
3010 $result['LCNV']=$objQuery['LCNV'];
3011 $result['RCNVII']=$objQuery['RCNVII'];
3012 $result['LCNVII']=$objQuery['LCNVII'];
3013 $result['ODSCHIRMER1']=$objQuery['ODSCHIRMER1'];
3014 $result['OSSCHIRMER1']=$objQuery['OSSCHIRMER1'];
3015 $result['ODSCHIRMER2']=$objQuery['ODSCHIRMER2'];
3016 $result['OSSCHIRMER2']=$objQuery['OSSCHIRMER2'];
3017 $result['ODTBUT']=$objQuery['ODTBUT'];
3018 $result['OSTBUT']=$objQuery['OSTBUT'];
3019 $result['OSHERTEL']=$objQuery['OSHERTEL'];
3020 $result['HERTELBASE']=$objQuery['HERTELBASE'];
3021 $result['ODPIC']=$objQuery['ODPIC'];
3022 $result['OSPIC']=$objQuery['OSPIC'];
3023 $result['EXT_COMMENTS']=$objQuery['EXT_COMMENTS'];
3024 $result["json"] = json_encode($result);
3025 echo json_encode($result);
3026 } elseif ($zone =="ANTSEG") {
3027 $result['OSCONJ']=$objQuery['OSCONJ'];
3028 $result['ODCONJ']=$objQuery['ODCONJ'];
3029 $result['ODCORNEA']=$objQuery['ODCORNEA'];
3030 $result['OSCORNEA']=$objQuery['OSCORNEA'];
3031 $result['ODAC']=$objQuery['ODAC'];
3032 $result['OSAC']=$objQuery['OSAC'];
3033 $result['ODLENS']=$objQuery['ODLENS'];
3034 $result['OSLENS']=$objQuery['OSLENS'];
3035 $result['ODIRIS']=$objQuery['ODIRIS'];
3036 $result['OSIRIS']=$objQuery['OSIRIS'];
3037 $result['ODKTHICKNESS']=$objQuery['ODKTHICKNESS'];
3038 $result['OSKTHICKNESS']=$objQuery['OSKTHICKNESS'];
3039 $result['ODGONIO']=$objQuery['ODGONIO'];
3040 $result['OSGONIO']=$objQuery['OSGONIO'];
3041 $result['ODSHRIMER1']=$objQuery['ODSHIRMER1'];
3042 $result['OSSHRIMER1']=$objQuery['OSSHIRMER1'];
3043 $result['ODSHRIMER2']=$objQuery['ODSHIRMER2'];
3044 $result['OSSHRIMER2']=$objQuery['OSSHIRMER2'];
3045 $result['ODTBUT']=$objQuery['ODTBUT'];
3046 $result['OSTBUT']=$objQuery['OSTBUT'];
3047 $result['ANTSEG_COMMENTS']=$objQuery['ANTSEG_COMMENTS'];
3048 $result["json"] = json_encode($result);
3049 echo json_encode($result);
3050 } elseif ($zone =="RETINA") {
3051 $result['ODDISC']=$objQuery['ODDISC'];
3052 $result['OSDISC']=$objQuery['OSDISC'];
3053 $result['ODCUP']=$objQuery['ODCUP'];
3054 $result['OSCUP']=$objQuery['OSCUP'];
3055 $result['ODMACULA']=$objQuery['ODMACULA'];
3056 $result['OSMACULA']=$objQuery['OSMACULA'];
3057 $result['ODVESSELS']=$objQuery['ODVESSELS'];
3058 $result['OSVESSELS']=$objQuery['OSVESSELS'];
3059 $result['ODPERIPH']=$objQuery['ODPERIPH'];
3060 $result['OSPERIPH']=$objQuery['OSPERIPH'];
3061 $result['ODDRAWING']=$objQuery['ODDRAWING'];
3062 $result['OSDRAWING']=$objQuery['OSDRAWING'];
3063 $result['ODCMT']=$objQuery['ODCMT'];
3064 $result['OSCMT']=$objQuery['OSCMT'];
3065 $result['RETINA_COMMENTS']=$objQuery['RETINA_COMMENTS'];
3066 $result["json"] = json_encode($result);
3067 echo json_encode($result);
3068 } elseif ($zone =="NEURO") {
3069 $result['ACT']=$objQuery['ACT'];
3070 $result['ACT5CCDIST']=$objQuery['ACT5CCDIST'];
3071 $result['ACT1CCDIST']=$objQuery['ACT1CCDIST'];
3072 $result['ACT2CCDIST']=$objQuery['ACT2CCDIST'];
3073 $result['ACT3CCDIST']=$objQuery['ACT3CCDIST'];
3074 $result['ACT4CCDIST']=$objQuery['ACT4CCDIST'];
3075 $result['ACT6CCDIST']=$objQuery['ACT6CCDIST'];
3076 $result['ACT7CCDIST']=$objQuery['ACT7CCDIST'];
3077 $result['ACT8CCDIST']=$objQuery['ACT8CCDIST'];
3078 $result['ACT9CCDIST']=$objQuery['ACT9CCDIST'];
3079 $result['ACT10CCDIST']=$objQuery['ACT10CCDIST'];
3080 $result['ACT11CCDIST']=$objQuery['ACT11CCDIST'];
3081 $result['ACT1SCDIST']=$objQuery['ACT1SCDIST'];
3082 $result['ACT2SCDIST']=$objQuery['ACT2SCDIST'];
3083 $result['ACT3SCDIST']=$objQuery['ACT3SCDIST'];
3084 $result['ACT4SCDIST']=$objQuery['ACT4SCDIST'];
3085 $result['ACT5SCDIST']=$objQuery['ACT5SCDIST'];
3086 $result['ACT6SCDIST']=$objQuery['ACT6SCDIST'];
3087 $result['ACT7SCDIST']=$objQuery['ACT7SCDIST'];
3088 $result['ACT8SCDIST']=$objQuery['ACT8SCDIST'];
3089 $result['ACT9SCDIST']=$objQuery['ACT9SCDIST'];
3090 $result['ACT10SCDIST']=$objQuery['ACT10SCDIST'];
3091 $result['ACT11SCDIST']=$objQuery['ACT11SCDIST'];
3092 $result['ACT1SCNEAR']=$objQuery['ACT1SCNEAR'];
3093 $result['ACT2SCNEAR']=$objQuery['ACT2SCNEAR'];
3094 $result['ACT3SCNEAR']=$objQuery['ACT3SCNEAR'];
3095 $result['ACT4SCNEAR']=$objQuery['ACT4SCNEAR'];
3096 $result['ACT5CCNEAR']=$objQuery['ACT5CCNEAR'];
3097 $result['ACT6CCNEAR']=$objQuery['ACT6CCNEAR'];
3098 $result['ACT7CCNEAR']=$objQuery['ACT7CCNEAR'];
3099 $result['ACT8CCNEAR']=$objQuery['ACT8CCNEAR'];
3100 $result['ACT9CCNEAR']=$objQuery['ACT9CCNEAR'];
3101 $result['ACT10CCNEAR']=$objQuery['ACT10CCNEAR'];
3102 $result['ACT11CCNEAR']=$objQuery['ACT11CCNEAR'];
3103 $result['ACT5SCNEAR']=$objQuery['ACT5SCNEAR'];
3104 $result['ACT6SCNEAR']=$objQuery['ACT6SCNEAR'];
3105 $result['ACT7SCNEAR']=$objQuery['ACT7SCNEAR'];
3106 $result['ACT8SCNEAR']=$objQuery['ACT8SCNEAR'];
3107 $result['ACT9SCNEAR']=$objQuery['ACT9SCNEAR'];
3108 $result['ACT10SCNEAR']=$objQuery['ACT10SCNEAR'];
3109 $result['ACT11SCNEAR']=$objQuery['ACT11SCNEAR'];
3110 $result['ACT1CCNEAR']=$objQuery['ACT1CCNEAR'];
3111 $result['ACT2CCNEAR']=$objQuery['ACT2CCNEAR'];
3112 $result['ACT3CCNEAR']=$objQuery['ACT3CCNEAR'];
3113 $result['ACT4CCNEAR']=$objQuery['ACT4CCNEAR'];
3114 $result['ODVF1']=$objQuery['ODVF1'];
3115 $result['ODVF2']=$objQuery['ODVF2'];
3116 $result['ODVF3']=$objQuery['ODVF3'];
3117 $result['ODVF4']=$objQuery['ODVF4'];
3118 $result['OSVF1']=$objQuery['OSVF1'];
3119 $result['OSVF2']=$objQuery['OSVF2'];
3120 $result['OSVF3']=$objQuery['OSVF3'];
3121 $result['OSVF4']=$objQuery['OSVF4'];
3122 $result['MOTILITY_RS']=$objQuery['MOTILITY_RS'];
3123 $result['MOTILITY_RI']=$objQuery['MOTILITY_RI'];
3124 $result['MOTILITY_RR']=$objQuery['MOTILITY_RR'];
3125 $result['MOTILITY_RL']=$objQuery['MOTILITY_RL'];
3126 $result['MOTILITY_LS']=$objQuery['MOTILITY_LS'];
3127 $result['MOTILITY_LI']=$objQuery['MOTILITY_LI'];
3128 $result['MOTILITY_LR']=$objQuery['MOTILITY_LR'];
3129 $result['MOTILITY_LL']=$objQuery['MOTILITY_LL'];
3130 $result['NEURO_COMMENTS']=$objQuery['NEURO_COMMENTS'];
3131 $result['STEREOPSIS']=$objQuery['STEREOPSIS'];
3132 $result['ODNPA']=$objQuery['ODNPA'];
3133 $result['OSNPA']=$objQuery['OSNPA'];
3134 $result['VERTFUSAMPS']=$objQuery['VERTFUSAMPS'];
3135 $result['DIVERGENCEAMPS']=$objQuery['DIVERGENCEAMPS'];
3136 $result['NPC']=$objQuery['NPC'];
3137 $result['DACCDIST']=$objQuery['DACCDIST'];
3138 $result['DACCNEAR']=$objQuery['DACCNEAR'];
3139 $result['CACCDIST']=$objQuery['CACCDIST'];
3140 $result['CACCNEAR']=$objQuery['CACCNEAR'];
3141 $result['ODCOLOR']=$objQuery['ODCOLOR'];
3142 $result['OSCOLOR']=$objQuery['OSCOLOR'];
3143 $result['ODCOINS']=$objQuery['ODCOINS'];
3144 $result['OSCOINS']=$objQuery['OSCOINS'];
3145 $result['ODREDDESAT']=$objQuery['ODREDDESAT'];
3146 $result['OSREDDESAT']=$objQuery['OSREDDESAT'];
3147 $result['ODPUPILSIZE1']=$objQuery['ODPUPILSIZE1'];
3148 $result['ODPUPILSIZE2']=$objQuery['ODPUPILSIZE2'];
3149 $result['ODPUPILREACTIVITY']=$objQuery['ODPUPILREACTIVITY'];
3150 $result['ODAPD']=$objQuery['ODAPD'];
3151 $result['OSPUPILSIZE1']=$objQuery['OSPUPILSIZE1'];
3152 $result['OSPUPILSIZE2']=$objQuery['OSPUPILSIZE2'];
3153 $result['OSPUPILREACTIVITY']=$objQuery['OSPUPILREACTIVITY'];
3154 $result['OSAPD']=$objQuery['OSAPD'];
3155 $result['DIMODPUPILSIZE1']=$objQuery['DIMODPUPILSIZE1'];
3156 $result['DIMODPUPILSIZE2']=$objQuery['DIMODPUPILSIZE2'];
3157 $result['DIMODPUPILREACTIVITY']=$objQuery['DIMODPUPILREACTIVITY'];
3158 $result['DIMOSPUPILSIZE1']=$objQuery['DIMOSPUPILSIZE1'];
3159 $result['DIMOSPUPILSIZE2']=$objQuery['DIMOSPUPILSIZE2'];
3160 $result['DIMOSPUPILREACTIVITY']=$objQuery['DIMOSPUPILREACTIVITY'];
3161 $result['PUPIL_COMMENTS']=$objQuery['PUPIL_COMMENTS'];
3162 $result['ODVFCONFRONTATION1']=$objQuery['ODVFCONFRONTATION1'];
3163 $result['ODVFCONFRONTATION2']=$objQuery['ODVFCONFRONTATION2'];
3164 $result['ODVFCONFRONTATION3']=$objQuery['ODVFCONFRONTATION3'];
3165 $result['ODVFCONFRONTATION4']=$objQuery['ODVFCONFRONTATION4'];
3166 $result['ODVFCONFRONTATION5']=$objQuery['ODVFCONFRONTATION5'];
3167 $result['OSVFCONFRONTATION1']=$objQuery['OSVFCONFRONTATION1'];
3168 $result['OSVFCONFRONTATION2']=$objQuery['OSVFCONFRONTATION2'];
3169 $result['OSVFCONFRONTATION3']=$objQuery['OSVFCONFRONTATION3'];
3170 $result['OSVFCONFRONTATION4']=$objQuery['OSVFCONFRONTATION4'];
3171 $result['OSVFCONFRONTATION5']=$objQuery['OSVFCONFRONTATION5'];
3172 $result["json"] = json_encode($result);
3173 echo json_encode($result);
3174 } elseif ($zone =="IMPPLAN") {
3175 $result['IMPPLAN'] = build_IMPPLAN_items($pid, $copy_from);
3176 echo json_encode($result);
3177 } elseif ($zone =="ALL") {
3178 $result['RUL']=$objQuery['RUL'];
3179 $result['LUL']=$objQuery['LUL'];
3180 $result['RLL']=$objQuery['RLL'];
3181 $result['LLL']=$objQuery['LLL'];
3182 $result['RBROW']=$objQuery['RBROW'];
3183 $result['LBROW']=$objQuery['LBROW'];
3184 $result['RMCT']=$objQuery['RMCT'];
3185 $result['LMCT']=$objQuery['LMCT'];
3186 $result['RADNEXA']=$objQuery['RADNEXA'];
3187 $result['LADNEXA']=$objQuery['LADNEXA'];
3188 $result['RMRD']=$objQuery['RMRD'];
3189 $result['LMRD']=$objQuery['LMRD'];
3190 $result['RLF']=$objQuery['RLF'];
3191 $result['LLF']=$objQuery['LLF'];
3192 $result['RVFISSURE']=$objQuery['RVFISSURE'];
3193 $result['LVFISSURE']=$objQuery['LVFISSURE'];
3194 $result['ODHERTEL']=$objQuery['ODHERTEL'];
3195 $result['OSHERTEL']=$objQuery['OSHERTEL'];
3196 $result['HERTELBASE']=$objQuery['HERTELBASE'];
3197 $result['ODPIC']=$objQuery['ODPIC'];
3198 $result['OSPIC']=$objQuery['OSPIC'];
3199 $result['EXT_COMMENTS']=$objQuery['EXT_COMMENTS'];
3201 $result['OSCONJ']=$objQuery['OSCONJ'];
3202 $result['ODCONJ']=$objQuery['ODCONJ'];
3203 $result['ODCORNEA']=$objQuery['ODCORNEA'];
3204 $result['OSCORNEA']=$objQuery['OSCORNEA'];
3205 $result['ODAC']=$objQuery['ODAC'];
3206 $result['OSAC']=$objQuery['OSAC'];
3207 $result['ODLENS']=$objQuery['ODLENS'];
3208 $result['OSLENS']=$objQuery['OSLENS'];
3209 $result['ODIRIS']=$objQuery['ODIRIS'];
3210 $result['OSIRIS']=$objQuery['OSIRIS'];
3211 $result['ODKTHICKNESS']=$objQuery['ODKTHICKNESS'];
3212 $result['OSKTHICKNESS']=$objQuery['OSKTHICKNESS'];
3213 $result['ODGONIO']=$objQuery['ODGONIO'];
3214 $result['OSGONIO']=$objQuery['OSGONIO'];
3215 $result['ANTSEG_COMMENTS']=$objQuery['ANTSEG_COMMENTS'];
3217 $result['ODDISC']=$objQuery['ODDISC'];
3218 $result['OSDISC']=$objQuery['OSDISC'];
3219 $result['ODCUP']=$objQuery['ODCUP'];
3220 $result['OSCUP']=$objQuery['OSCUP'];
3221 $result['ODMACULA']=$objQuery['ODMACULA'];
3222 $result['OSMACULA']=$objQuery['OSMACULA'];
3223 $result['ODVESSELS']=$objQuery['ODVESSELS'];
3224 $result['OSVESSELS']=$objQuery['OSVESSELS'];
3225 $result['ODPERIPH']=$objQuery['ODPERIPH'];
3226 $result['OSPERIPH']=$objQuery['OSPERIPH'];
3227 $result['ODDRAWING']=$objQuery['ODDRAWING'];
3228 $result['OSDRAWING']=$objQuery['OSDRAWING'];
3229 $result['ODCMT']=$objQuery['ODCMT'];
3230 $result['OSCMT']=$objQuery['OSCMT'];
3231 $result['RETINA_COMMENTS']=$objQuery['RETINA_COMMENTS'];
3233 $result['ACT']=$objQuery['ACT'];
3234 $result['ACT5CCDIST']=$objQuery['ACT5CCDIST'];
3235 $result['ACT1CCDIST']=$objQuery['ACT1CCDIST'];
3236 $result['ACT2CCDIST']=$objQuery['ACT2CCDIST'];
3237 $result['ACT3CCDIST']=$objQuery['ACT3CCDIST'];
3238 $result['ACT4CCDIST']=$objQuery['ACT4CCDIST'];
3239 $result['ACT6CCDIST']=$objQuery['ACT6CCDIST'];
3240 $result['ACT7CCDIST']=$objQuery['ACT7CCDIST'];
3241 $result['ACT8CCDIST']=$objQuery['ACT8CCDIST'];
3242 $result['ACT9CCDIST']=$objQuery['ACT9CCDIST'];
3243 $result['ACT10CCDIST']=$objQuery['ACT10CCDIST'];
3244 $result['ACT11CCDIST']=$objQuery['ACT11CCDIST'];
3245 $result['ACT1SCDIST']=$objQuery['ACT1SCDIST'];
3246 $result['ACT2SCDIST']=$objQuery['ACT2SCDIST'];
3247 $result['ACT3SCDIST']=$objQuery['ACT3SCDIST'];
3248 $result['ACT4SCDIST']=$objQuery['ACT4SCDIST'];
3249 $result['ACT5SCDIST']=$objQuery['ACT5SCDIST'];
3250 $result['ACT6SCDIST']=$objQuery['ACT6SCDIST'];
3251 $result['ACT7SCDIST']=$objQuery['ACT7SCDIST'];
3252 $result['ACT8SCDIST']=$objQuery['ACT8SCDIST'];
3253 $result['ACT9SCDIST']=$objQuery['ACT9SCDIST'];
3254 $result['ACT10SCDIST']=$objQuery['ACT10SCDIST'];
3255 $result['ACT11SCDIST']=$objQuery['ACT11SCDIST'];
3256 $result['ACT1SCNEAR']=$objQuery['ACT1SCNEAR'];
3257 $result['ACT2SCNEAR']=$objQuery['ACT2SCNEAR'];
3258 $result['ACT3SCNEAR']=$objQuery['ACT3SCNEAR'];
3259 $result['ACT4SCNEAR']=$objQuery['ACT4SCNEAR'];
3260 $result['ACT5CCNEAR']=$objQuery['ACT5CCNEAR'];
3261 $result['ACT6CCNEAR']=$objQuery['ACT6CCNEAR'];
3262 $result['ACT7CCNEAR']=$objQuery['ACT7CCNEAR'];
3263 $result['ACT8CCNEAR']=$objQuery['ACT8CCNEAR'];
3264 $result['ACT9CCNEAR']=$objQuery['ACT9CCNEAR'];
3265 $result['ACT10CCNEAR']=$objQuery['ACT10CCNEAR'];
3266 $result['ACT11CCNEAR']=$objQuery['ACT11CCNEAR'];
3267 $result['ACT5SCNEAR']=$objQuery['ACT5SCNEAR'];
3268 $result['ACT6SCNEAR']=$objQuery['ACT6SCNEAR'];
3269 $result['ACT7SCNEAR']=$objQuery['ACT7SCNEAR'];
3270 $result['ACT8SCNEAR']=$objQuery['ACT8SCNEAR'];
3271 $result['ACT9SCNEAR']=$objQuery['ACT9SCNEAR'];
3272 $result['ACT10SCNEAR']=$objQuery['ACT10SCNEAR'];
3273 $result['ACT11SCNEAR']=$objQuery['ACT11SCNEAR'];
3274 $result['ACT1CCNEAR']=$objQuery['ACT1CCNEAR'];
3275 $result['ACT2CCNEAR']=$objQuery['ACT2CCNEAR'];
3276 $result['ACT3CCNEAR']=$objQuery['ACT3CCNEAR'];
3277 $result['ACT4CCNEAR']=$objQuery['ACT4CCNEAR'];
3278 $result['ODVF1']=$objQuery['ODVF1'];
3279 $result['ODVF2']=$objQuery['ODVF2'];
3280 $result['ODVF3']=$objQuery['ODVF3'];
3281 $result['ODVF4']=$objQuery['ODVF4'];
3282 $result['OSVF1']=$objQuery['OSVF1'];
3283 $result['OSVF2']=$objQuery['OSVF2'];
3284 $result['OSVF3']=$objQuery['OSVF3'];
3285 $result['OSVF4']=$objQuery['OSVF4'];
3286 $result['MOTILITY_RS']=$objQuery['MOTILITY_RS'];
3287 $result['MOTILITY_RI']=$objQuery['MOTILITY_RI'];
3288 $result['MOTILITY_RR']=$objQuery['MOTILITY_RR'];
3289 $result['MOTILITY_RL']=$objQuery['MOTILITY_RL'];
3290 $result['MOTILITY_LS']=$objQuery['MOTILITY_LS'];
3291 $result['MOTILITY_LI']=$objQuery['MOTILITY_LI'];
3292 $result['MOTILITY_LR']=$objQuery['MOTILITY_LR'];
3293 $result['MOTILITY_LL']=$objQuery['MOTILITY_LL'];
3294 $result['NEURO_COMMENTS']=$objQuery['NEURO_COMMENTS'];
3295 $result['STEREOPSIS']=$objQuery['STEREOPSIS'];
3296 $result['ODNPA']=$objQuery['ODNPA'];
3297 $result['OSNPA']=$objQuery['OSNPA'];
3298 $result['VERTFUSAMPS']=$objQuery['VERTFUSAMPS'];
3299 $result['DIVERGENCEAMPS']=$objQuery['DIVERGENCEAMPS'];
3300 $result['NPC']=$objQuery['NPC'];
3301 $result['DACCDIST']=$objQuery['DACCDIST'];
3302 $result['DACCNEAR']=$objQuery['DACCNEAR'];
3303 $result['CACCDIST']=$objQuery['CACCDIST'];
3304 $result['CACCNEAR']=$objQuery['CACCNEAR'];
3305 $result['ODCOLOR']=$objQuery['ODCOLOR'];
3306 $result['OSCOLOR']=$objQuery['OSCOLOR'];
3307 $result['ODCOINS']=$objQuery['ODCOINS'];
3308 $result['OSCOINS']=$objQuery['OSCOINS'];
3309 $result['ODREDDESAT']=$objQuery['ODREDDESAT'];
3310 $result['OSREDDESAT']=$objQuery['OSREDDESAT'];
3311 $result['ODPUPILSIZE1']=$objQuery['ODPUPILSIZE1'];
3312 $result['ODPUPILSIZE2']=$objQuery['ODPUPILSIZE2'];
3313 $result['ODPUPILREACTIVITY']=$objQuery['ODPUPILREACTIVITY'];
3314 $result['ODAPD']=$objQuery['ODAPD'];
3315 $result['OSPUPILSIZE1']=$objQuery['OSPUPILSIZE1'];
3316 $result['OSPUPILSIZE2']=$objQuery['OSPUPILSIZE2'];
3317 $result['OSPUPILREACTIVITY']=$objQuery['OSPUPILREACTIVITY'];
3318 $result['OSAPD']=$objQuery['OSAPD'];
3319 $result['DIMODPUPILSIZE1']=$objQuery['DIMODPUPILSIZE1'];
3320 $result['DIMODPUPILSIZE2']=$objQuery['DIMODPUPILSIZE2'];
3321 $result['DIMODPUPILREACTIVITY']=$objQuery['DIMODPUPILREACTIVITY'];
3322 $result['DIMOSPUPILSIZE1']=$objQuery['DIMOSPUPILSIZE1'];
3323 $result['DIMOSPUPILSIZE2']=$objQuery['DIMOSPUPILSIZE2'];
3324 $result['DIMOSPUPILREACTIVITY']=$objQuery['DIMOSPUPILREACTIVITY'];
3325 $result['PUPIL_COMMENTS']=$objQuery['PUPIL_COMMENTS'];
3326 $result['ODVFCONFRONTATION1']=$objQuery['ODVFCONFRONTATION1'];
3327 $result['ODVFCONFRONTATION2']=$objQuery['ODVFCONFRONTATION2'];
3328 $result['ODVFCONFRONTATION3']=$objQuery['ODVFCONFRONTATION3'];
3329 $result['ODVFCONFRONTATION4']=$objQuery['ODVFCONFRONTATION4'];
3330 $result['ODVFCONFRONTATION5']=$objQuery['ODVFCONFRONTATION5'];
3331 $result['OSVFCONFRONTATION1']=$objQuery['OSVFCONFRONTATION1'];
3332 $result['OSVFCONFRONTATION2']=$objQuery['OSVFCONFRONTATION2'];
3333 $result['OSVFCONFRONTATION3']=$objQuery['OSVFCONFRONTATION3'];
3334 $result['OSVFCONFRONTATION4']=$objQuery['OSVFCONFRONTATION4'];
3335 $result['OSVFCONFRONTATION5']=$objQuery['OSVFCONFRONTATION5'];
3336 $result['IMP']=$objQuery['IMP'];
3337 $result["json"] = json_encode($result);
3338 echo json_encode($result);
3339 } elseif ($zone =="READONLY") {
3340 $result=$objQuery;
3341 $count_rx='0';
3342 $query = "select * from form_eye_mag_wearing where PID=? and ENCOUNTER=? and FORM_ID >'0' ORDER BY RX_NUMBER";
3343 $wear = sqlStatement($query, array($pid,$_SESSION['encounter']));
3344 while ($wearing = sqlFetchArray($wear)) {
3345 ${"display_W_$count_rx"} = '';
3346 ${"ODSPH_$count_rx"} = $wearing['ODSPH'];
3347 ${"ODCYL_$count_rx"} = $wearing['ODCYL'];
3348 ${"ODAXIS_$count_rx"} = $wearing['ODAXIS'];
3349 ${"OSSPH_$count_rx"} = $wearing['OSSPH'];
3350 ${"OSCYL_$count_rx"} = $wearing['OSCYL'];
3351 ${"OSAXIS_$count_rx"} = $wearing['OSAXIS'];
3352 ${"ODMIDADD_$count_rx"} = $wearing['ODMIDADD'];
3353 ${"OSMIDADD_$count_rx"} = $wearing['OSMIDADD'];
3354 ${"ODADD_$count_rx"} = $wearing['ODADD'];
3355 ${"OSADD_$count_rx"} = $wearing['OSADD'];
3356 ${"ODVA_$count_rx"} = $wearing['ODVA'];
3357 ${"OSVA_$count_rx"} = $wearing['OSVA'];
3358 ${"ODNEARVA_$count_rx"} = $wearing['ODNEARVA'];
3359 ${"OSNEARVA_$count_rx"} = $wearing['OSNEARVA'];
3360 ${"ODPRISM_$count_rx"} = $wearing['ODPRISM'];
3361 ${"OSPRISM_$count_rx"} = $wearing['OSPRISM'];
3362 ${"W_$count_rx"} = '1';
3363 ${"RX_TYPE_$count_rx"} = $wearing['RX_TYPE'];
3364 ${"ODHPD_$count_rx"} = $wearing['ODHPD'];
3365 ${"ODHBASE_$count_rx"} = $wearing['ODHBASE'];
3366 ${"ODVPD_$count_rx"} = $wearing['ODVPD'];
3367 ${"ODVBASE_$count_rx"} = $wearing['ODVBASE'];
3368 ${"ODSLABOFF_$count_rx"} = $wearing['ODSLABOFF'];
3369 ${"ODVERTEXDIST_$count_rx"} = $wearing['ODVERTEXDIST'];
3370 ${"OSHPD_$count_rx"} = $wearing['OSHPD'];
3371 ${"OSHBASE_$count_rx"} = $wearing['OSHBASE'];
3372 ${"OSVPD_$count_rx"} = $wearing['OSVPD'];
3373 ${"OSVBASE_$count_rx"} = $wearing['OSVBASE'];
3374 ${"OSSLABOFF_$count_rx"} = $wearing['OSSLABOFF'];
3375 ${"OSVERTEXDIST_$count_rx"} = $wearing['OSVERTEXDIST'];
3376 ${"ODMPDD_$count_rx"} = $wearing['ODMPDD'];
3377 ${"ODMPDN_$count_rx"} = $wearing['ODMPDN'];
3378 ${"OSMPDD_$count_rx"} = $wearing['OSMPDD'];
3379 ${"OSMPDN_$count_rx"} = $wearing['OSMPDN'];
3380 ${"BPDD_$count_rx"} = $wearing['BPDD'];
3381 ${"BPDN_$count_rx"} = $wearing['BPDN'];
3382 ${"LENS_MATERIAL_$count_rx"} = $wearing['LENS_MATERIAL'];
3383 ${"LENS_TREATMENTS_$count_rx"} = $wearing['LENS_TREATMENTS'];
3384 ${"COMMENTS_$count_rx"} = $wearing['COMMENTS'];
3387 $result["json"] = json_encode($result);
3388 echo json_encode($result);
3393 * This builds the IMPPLAN_items variable for a given pid and form_id.
3394 * @param string $pid patient_id
3395 * @param string $form_id field id in table form_eye_mag
3396 * @return object IMPPLAN_items
3398 function build_IMPPLAN_items($pid, $form_id)
3400 global $form_folder;
3401 $query ="select * from form_".$form_folder."_impplan where form_id=? and pid=? ORDER BY IMPPLAN_order";
3402 $newdata = array();
3403 $fres = sqlStatement($query, array($form_id,$pid));
3404 $i=0; //there should only be one if all goes well...
3405 while ($frow = sqlFetchArray($fres)) {
3406 $IMPPLAN_items[$i]['form_id'] = $frow['form_id'];
3407 $IMPPLAN_items[$i]['pid'] = $frow['pid'];
3408 $IMPPLAN_items[$i]['id'] = $frow['id'];
3409 $IMPPLAN_items[$i]['title'] = $frow['title'];
3410 $IMPPLAN_items[$i]['code'] = $frow['code'];
3411 $IMPPLAN_items[$i]['codetype'] = $frow['codetype'];
3412 $IMPPLAN_items[$i]['codedesc'] = $frow['codedesc'];
3413 $IMPPLAN_items[$i]['codetext'] = $frow['codetext'];
3414 $IMPPLAN_items[$i]['plan'] = $frow['plan'];
3415 $IMPPLAN_items[$i]['PMSFH_link'] = $frow['PMSFH_link'];
3416 $IMPPLAN_items[$i]['IMPPLAN_order'] = $frow['IMPPLAN_order'];
3417 $i++;
3420 return $IMPPLAN_items;
3424 * This function builds an array of documents for this patient ($pid).
3425 * We first list all the categories this practice has created by name and by category_id
3426 * for this patient ($pid)
3427 * Each document info from documents table is added to these as arrays
3429 * @param string $pid patient_id
3430 * @return array($documents)
3432 function document_engine($pid)
3434 $sql1 = sqlStatement("Select * from categories");
3435 while ($row1 = sqlFetchArray($sql1)) {
3436 $categories[] = $row1;
3437 $my_name[$row1['id']] = $row1['name'];
3438 $children_names[$row1['parent']][]=$row1['name'];
3439 $parent_name[$row1['name']] = $my_name[$row1['parent']];
3440 if ($row1['value'] >'') {
3441 //if there is a value, tells us what segment of exam ($zone) this belongs in...
3442 $zones[$row1['value']][] = $row1;
3443 } else {
3444 if ($row1['name'] != "Categories") {
3445 $zones['OTHER'][] = $row1;
3450 $query = "Select *
3451 from
3452 categories, documents,categories_to_documents
3453 where documents.foreign_id=? and documents.id=categories_to_documents.document_id and
3454 categories_to_documents.category_id=categories.id ORDER BY categories.name";
3455 $sql2 = sqlStatement($query, array($pid));
3456 while ($row2 = sqlFetchArray($sql2)) {
3457 //the document may not be created on the same day as the encounter, use encounter date first
3458 //get encounter date from encounter id
3459 if ($row2['encounter_id']) {
3460 $visit= getEncounterDateByEncounter($row2['encounter_id']);
3461 $row2['encounter_date'] = oeFormatSDFT(strtotime($visit['date']));
3462 } else {
3463 $row2['encounter_date'] = $row2['docdate'];
3466 $documents[]= $row2;
3467 $docs_in_cat_id[$row2['category_id']][] = $row2;
3468 if ($row2['value'] > '') {
3469 $docs_in_zone[$row2['value']][] = $row2;
3470 } else {
3471 $docs_in_zone['OTHER'][]=$row2;
3474 $docs_in_name[$row2['name']][] = $row2;
3475 $docs_by_date[$row2['encounter_date']][] = $row2;
3478 $documents['categories']=$categories;
3479 $documents['my_name']=$my_name;
3480 $documents['children_names']=$children_names;
3481 $documents['parent_name'] = $parent_name;
3482 $documents['zones'] = $zones;
3483 $documents['docs_in_zone'] = $docs_in_zone;
3484 $documents['docs_in_cat_id'] = $docs_in_cat_id;
3485 $documents['docs_in_name'] = $docs_in_name;
3486 $documents['docs_by_date'] = $docs_by_date;
3487 return array($documents);
3491 * This function returns ICONS with links for a specific clinical subsection of the Document Library.
3493 * @param string $pid value = patient id
3494 * @param string $encounter is the encounter_id
3495 * @param string $category_value options EXT,ANTSEG,POSTSEG,NEURO,OTHER
3496 * These values are taken from the "value" field in the Documents' table "categories".
3497 * They allow us to regroup the categories how we like them.
3498 * @return array($imaging,$episode)
3500 function display($pid, $encounter, $category_value)
3502 global $form_folder;
3503 global $id;
3504 global $documents;
3506 * Each document is stored in a specific category. Think of a category as a Folder.
3507 * Practices can add/alter/delete category names as they wish.
3508 * In the Eye Form we link to these categories, not by name by by what part of the physical exam they belong to.
3509 * We needed a pointer to tell us if a document category is specific to a clinical section.
3510 * For example, a photo of the retina is stored in the category we named "Fundus".
3511 * A photo of the optic nerve is stored in the "Optic Disc" category. Someone else might change the
3512 * name to "Optic Nerve", or even a different language. No matter, these categories include documents
3513 * we would like to directly link to/open from the RETINA section of the link.
3514 * The categories table does have an unused field - "value".
3515 * This is where we link document categories to a clinical zone. We add the clinical section name
3516 * on install but the end user can change or add others as the devices evolve.
3517 * Currently the base install has EXT,ANTSEG,POSTSEG,NEURO
3518 * New names new categories. OCT would not have been a category 5 years ago.
3519 * Who knows what is next? Gene-lab construction?
3520 * So the name is user assigned as is the location.
3521 * Thus we need to build out the Documents section by adding another layer "zones"
3522 * to the associative array.
3524 if (!$documents) {
3525 list($documents) = document_engine($pid);
3528 for ($j=0; $j < count($documents['zones'][$category_value]); $j++) {
3529 $episode .= "<tr>
3530 <td class='right'><b>".text($documents['zones'][$category_value][$j]['name'])."</b>:&nbsp;</td>
3531 <td>
3532 <a href='../../../controller.php?document&upload&patient_id=".attr($pid)."&parent_id=".attr($documents['zones'][$category_value][$j]['id'])."&'>
3533 <img src='../../forms/".$form_folder."/images/upload_file.png' class='little_image'>
3534 </a>
3535 </td>
3536 <td>
3537 <img src='../../forms/".$form_folder."/images/upload_multi.png' class='little_image'>
3538 </td>
3539 <td>";
3540 // Choose how to display: ANythingSlider or OpenEMR Douments file.
3541 //open via anything Slider
3542 if (count($documents['docs_in_cat_id'][$documents['zones'][$category_value][$j]['id']]) > '0') {
3543 $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)).'"
3544 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)).'\')">
3545 <img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" /></a>';
3546 //open via OpenEMR Documents with treemenu
3547 /*if (count($documents['docs_in_cat_id'][$documents['zones'][$category_value][$j]['id']]) > '0') {
3548 $episode .= '<a href="../../../controller.php?document&view&patient_id='.$pid.'&parent_idX='.$documents['zones'][$category_value][$j]['id'].'&"
3549 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\')">
3550 <img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" /></a>';
3554 $episode .= '</td></tr>';
3555 $i++;
3558 return array($documents,$episode);
3562 * This is an application style menu (bootstrap) to start shifting clinical functions into a single page.
3564 * @param string $pid is the patient id
3565 * @param string $encounter is the encounter_id
3566 * @param string $title is the form title
3568 * @return nothing, outputs directly to screen
3570 function menu_overhaul_top($pid, $encounter, $title = "Eye Exam")
3572 global $form_folder;
3573 global $prov_data;
3574 global $encounter;
3575 global $form_id;
3576 global $display;
3577 global $providerID;
3579 $providerNAME = $prov_data['fname']." ".$prov_data['lname'];
3580 if ($prov_data['suffix']) {
3581 $providerNAME.= ", ".$prov_data['suffix'];
3584 if ($_REQUEST['display'] == "fullscreen") {
3585 $fullscreen_disable = 'disabled';
3586 } else {
3587 $frame_disabled ='disabled';
3588 echo "<style>.tabHide{ display:none; }</style>";
3591 <!-- Navigation -->
3592 <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;">
3593 <!-- Brand and toggle get grouped for better mobile display -->
3594 <div class="container-fluid" style="margin-top:0px;padding:2px;">
3595 <div class="navbar-header brand" style="color:black;">
3596 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oer-navbar-collapse-1">
3597 <span class="sr-only"><?php echo xlt("Toggle navigation"); ?></span>
3598 <span class="icon-bar"></span>
3599 <span class="icon-bar"></span>
3600 <span class="icon-bar"></span>
3601 </button>
3602 &nbsp;
3603 <img src="<?php echo $GLOBALS['webroot']; ?>/sites/default/images/login_logo.gif" class="little_image">
3604 <?php echo xlt('Eye Exam'); ?>
3605 </div>
3606 <div class="navbar-collapse collapse" id="oer-navbar-collapse-1">
3607 <ul class="navbar-nav">
3608 <li class="dropdown">
3609 <a class="dropdown-toggle" data-toggle="dropdown" id="menu_dropdown_file" role="button" aria-expanded="true"><?php echo xlt("File"); ?> </a>
3610 <ul class="dropdown-menu" role="menu">
3611 <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">
3612 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3613 <?php echo xlt("Preferences"); ?></a></li>
3614 <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>
3615 <li id="menu_PRINT_narrative_2" name="menu_PRINT_report_2"><a id="BUTTON_PRINT_report_2" target="_new" href="#"
3616 onclick="top.restoreSession(); create_task('<?php echo attr($providerID); ?>','Report','menu'); return false;">
3617 <?php echo xlt("Save Report as PDF"); ?></a></li>
3618 <li class="divider tabHide"></li>
3619 <li id="menu_QUIT" name="menu_QUIT" class="tabHide <?php echo $frame_disable; ?>"><a href="#" onclick='window.close();'><?php echo xlt("Quit"); ?></a></li>
3620 </ul>
3621 </li>
3622 <li class="dropdown">
3623 <a class="dropdown-toggle" data-toggle="dropdown" id="menu_dropdown_edit" role="button" aria-expanded="true"><?php echo xlt("Edit"); ?> </a>
3624 <ul class="dropdown-menu" role="menu">
3625 <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>
3626 <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>
3627 <li class="divider tabHide"></li>
3628 <li id="menu_Defaults" name="menu_Defaults" class="tabHide"> <a id="BUTTON_Defaults_menu"
3629 href="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_list.php?list_id=Eye_defaults_<?php echo attr($providerID); ?>"
3630 target="RTop"
3631 title="<?php echo xla('Click here to Edit this Provider\'s Exam Default values'); ?>"
3632 name="provider_todo">
3633 <i class="fa fa-angle-double-up tabHide" title="<?php echo xla('Opens in Top frame'); ?>"></i> &nbsp;
3634 <?php echo xlt("My Default Values"); ?> &nbsp;
3635 <span class="menu_icon"><i class="fa fa-pencil fa-fw"></i> </span></a></li>
3636 </ul>
3637 </li>
3639 <li class="dropdown">
3640 <a class="dropdown-toggle" data-toggle="dropdown" id="menu_dropdown_view" role="button" aria-expanded="true"><?php echo xlt("View"); ?> </a>
3641 <ul class="dropdown-menu" role="menu">
3642 <li id="menu_TEXT" name="menu_TEXT" class="active"><a><?php echo xlt("Text"); ?><span class="menu_icon">Ctl-T</span></a></li>
3643 <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>
3644 <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>
3645 <li id="menu_PRIORS" name="menu_PRIORS"><a><?php echo xlt("Prior Visits"); ?><span class="menu_icon">Ctl-P</span></a></li>
3646 <li id="menu_KB" name="menu_KB"><a><?php echo xlt("Shorthand"); ?><span class="menu_icon">Ctl-K</span></a></li>
3647 <li class="divider"></li>
3648 <li id="menu_HPI" name="menu_HPI"><a><?php echo xlt("HPI"); ?></a></li>
3649 <li id="menu_PMH" name="menu_PMH"><a><?php echo xlt("PMH{{Past Medical History}}"); ?></a></li>
3650 <li id="menu_EXT" name="menu_EXT" ><a><?php echo xlt("External"); ?></a></li>
3651 <li id="menu_ANTSEG" name="menu_ANTSEG" ><a><?php echo xlt("Anterior Segment"); ?></a></li>
3652 <li id="menu_POSTSEG" name="menu_POSTSEG" ><a><?php echo xlt("Posterior Segment"); ?></a></li>
3653 <li id="menu_NEURO" name="menu_NEURO" ><a><?php echo xlt("Neuro"); ?></a></li>
3654 <li class="divider"></li>
3655 <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>
3657 <?php
3659 // This only shows up in fullscreen currently so hide it.
3660 // If the decision is made to show this is framed openEMR, then display it
3662 if ($display !== "fullscreen") { ?>
3663 <li class="divider"></li>
3664 <li id="menu_fullscreen" name="menu_fullscreen" <?php echo $fullscreen; ?>>
3665 <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>
3666 </li>
3667 <?php
3668 } ?>
3669 </ul>
3670 </li>
3671 <li class="dropdown tabHide">
3672 <a class="dropdown-toggle" class="disabled" role="button" id="menu_dropdown_patients" data-toggle="dropdown"><?php echo xlt("Patients"); ?> </a>
3673 <ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
3674 <li role="presentation"><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/main/finder/dynamic_finder.php">
3675 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3676 <?php echo xlt('Patients'); ?></a></li>
3677 <li role="presentation"><a tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/new/new.php">
3678 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3679 <?php echo xlt("New/Search"); ?></a> </li>
3680 <li role="presentation"><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/summary/demographics.php">
3681 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3682 <?php echo xlt("Summary"); ?></a></li>
3683 <!-- <li role="presentation" class="divider"></li>
3684 <li role="presentation"><a role="menuitem" tabindex="-1" href="#"><?php echo xlt("Create Visit"); ?></a></span></li>
3685 <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>
3686 <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>
3688 <li role="presentation" class="divider"></li>
3689 <li role="presentation"><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/transaction/record_request.php">
3690 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3691 <?php echo xlt("Record Request"); ?></a></li>
3692 <li role="presentation" class="divider"></li>
3693 <li role="presentation"><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/ccr_import.php">
3694 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3695 <?php echo xlt("Upload Item"); ?></a></li>
3696 <li role="presentation" ><a role="menuitem" tabindex="-1" target="RTop" href="<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/ccr_pending_approval.php">
3697 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3698 <?php echo xlt("Pending Approval"); ?></a></li>
3699 </ul>
3700 </li>
3701 <!--
3702 <li class="dropdown">
3703 <a class="dropdown-toggle" role="button" id="menu_dropdown_clinical" data-toggle="dropdown"><?php echo xlt("Encounter"); ?></a>
3704 <?php
3706 * Here we need to incorporate the menu from openEMR too. What Forms are active for this installation?
3707 * openEMR uses Encounter Summary - Administrative - Clinical. Think about the menu as a new entity with
3708 * this + new functionaity. It is OK to keep or consider changing any NAMES when creating the menu. I assume
3709 * a consensus will develop.
3712 <ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
3713 <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#"><?php echo xlt("Eye Exam"); ?></a></li>
3714 <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#"><?php echo xlt("Documents"); ?></a></li>
3715 <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#"><?php echo xlt("Imaging"); ?></a></li>
3716 <li role="presentation" class="divider"></li>
3717 <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#IOP_CHART"><?php echo xlt("IOP Chart"); ?></a></li>
3718 </ul>
3719 </li>
3722 <!-- let's import the original openEMR menu_bar here. Needs to add restoreSession stuff? -->
3723 <?php
3724 $reg = Menu_myGetRegistered();
3725 if (!empty($reg)) {
3726 $StringEcho= '<li class="dropdown tabHide">';
3727 if ($encounterLocked === false || !(isset($encounterLocked))) {
3728 foreach ($reg as $entry) {
3729 $new_category = trim($entry['category']);
3730 $new_nickname = trim($entry['nickname']);
3731 if ($new_category == '') {
3732 $new_category = xlt('Miscellaneous');
3735 if ($new_nickname != '') {
3736 $nickname = $new_nickname;
3737 } else {
3738 $nickname = $entry['name'];
3741 if ($old_category != $new_category) { //new category, new menu section
3742 $new_category_ = $new_category;
3743 $new_category_ = str_replace(' ', '_', $new_category_);
3744 if ($old_category != '') {
3745 $StringEcho.= "
3746 </ul>
3747 </li>
3748 <li class='dropdown'>
3752 $StringEcho.= '
3753 <a class="dropdown-toggle tabHide" data-toggle="dropdown"
3754 id="menu_dropdown_'.xla($new_category_).'" role="button"
3755 aria-expanded="false">'.xlt($new_category).' </a>
3756 <ul class="dropdown-menu" role="menu">
3758 $old_category = $new_category;
3761 $StringEcho.= "<li>
3762 <a role='menuitem' tabindex='-1' href='".$GLOBALS['webroot']."/interface/patient_file/encounter/load_form.php?formname=" .urlencode($entry['directory'])."'>
3763 <i class='fa fa-angle-double-down' title='". xla('Opens in Bottom frame')."'></i>".
3764 xlt($nickname) . "</a></li>";
3768 $StringEcho.= '
3769 </ul>
3770 </li>
3774 echo $StringEcho;
3776 <li class="dropdown">
3777 <a class="dropdown-toggle" data-toggle="dropdown"
3778 id="menu_dropdown_library" role="button"
3779 aria-expanded="true"><?php echo xlt("Library"); ?> </a>
3780 <ul class="dropdown-menu" role="menu">
3781 <li role="presentation" class="tabHide"><a role="menuitem" tabindex="-1" target="RTop"
3782 href="<?php echo $GLOBALS['webroot']; ?>/interface/main/calendar/index.php?module=PostCalendar&viewtype=day&func=view&framewidth=1020">
3783 <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>
3784 <li role="presentation" class="divider tabHide"></li>
3785 <li role="presentation" class="tabHide"><a target="RTop" role="menuitem" tabindex="-1"
3786 href="<?php echo $GLOBALS['webroot']; ?>/controller.php?document&list&patient_id=<?php echo xla($pid); ?>">
3787 <i class="fa fa-angle-double-up" title="<?php echo xla('Opens in Top frame'); ?>"></i>
3788 <?php echo xlt("Documents"); ?></a></li>
3789 <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">
3790 Imaging<span class="menu_icon"><img src="'.$GLOBALS['webroot'].'/interface/forms/'.$form_folder.'/images/jpg.png" class="little_image" />'; ?></span></a></li>
3791 <li role="presentation" class="divider tabHide"></li>
3792 <li id="menu_IOP_graph" name="menu_IOP_graph" ><a><?php echo xlt("IOP Graph"); ?></a></li>
3793 </ul>
3794 </li>
3795 <li class="dropdown">
3796 <a class="dropdown-toggle" data-toggle="dropdown"
3797 id="menu_dropdown_help" role="button"
3798 aria-expanded="true"><?php echo xlt("Help"); ?> </a>
3799 <ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
3800 <li role="presentation">
3801 <a role="menuitem" tabindex="-1" id="tooltips_toggle" name="tooltips_toggle">
3802 <i class="fa fa-help"></i> <?php echo xlt("Tooltips"); ?>
3803 <span id="tooltips_status" name="tooltips_status"></span>
3804 <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>
3805 </li>
3806 <li role="presentation"><a role="menuitem" tabindex="-1" target="_blank" href="<?php echo $GLOBALS['webroot']; ?>/interface/forms/eye_mag/help.php">
3807 <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>
3808 </li>
3809 </ul>
3810 </li>
3811 </ul>
3812 <ul class="nav navbar-nav navbar-right">
3813 <li ><span id="active_flag" name="active_flag" style="margin-right:15px;color:red;"> <?php echo xlt('Active Chart'); ?> </span>
3814 <span name="active_icon" id="active_icon" style="color:black;"><i class='fa fa-toggle-on'></i></span></li>
3816 </ul>
3818 </div><!-- /.navbar-collapse -->
3819 </div>
3820 </nav>
3821 <?php
3822 return;
3825 * This is currently a floating div top with patient demographics and such.
3826 * Used in fullscreen mode at the top and in AnythingSlider at the bottom.
3827 * Moving towards containing info similar to main_title.php.
3829 * @param string $pid patient_id
3830 * @param string $encounter is the current encounter number
3831 * @return nothing, outputs directly to screen
3833 function menu_overhaul_left($pid, $encounter)
3835 global $form_folder;
3836 global $pat_data;
3837 global $visit_date;
3838 global $documents;
3839 global $dated;
3840 global $display;
3841 global $providerNAME;
3844 * find out if the patient has a photo
3846 if (!$documents) {
3847 list($documents) = document_engine($pid);
3850 <div class="borderShadow" style="font-size:1.2em;width:80%;display:inline-block;">
3851 <div id="left_menu" name="left_menu" class="col-md-4">
3852 <div style="padding-left: 18px;">
3853 <table style="text-align:left;">
3854 <?php if ($display == 'fullscreen') { ?>
3855 <tr><td class="right" >
3856 <?php
3857 $age = getPatientAgeDisplay($pat_data['DOB'], $encounter_date);
3858 $DOB = oeFormatShortDate($pat_data['DOB']);
3859 echo "<b>".xlt('Name').":</b> </td><td nowrap> &nbsp;".text($pat_data['fname'])." ".text($pat_data['lname'])." (".text($pid).")</td></tr>
3860 <tr><td class='right'><b>".xlt('DOB').":</b></td><td nowrap> &nbsp;".text($DOB). "&nbsp;&nbsp;(".text($age).")";
3862 <?php
3864 </td>
3865 </tr>
3866 <?php }
3868 echo "<tr><td class='right' nowrap><b>".xlt('Visit Date').":</b></td><td>&nbsp;".$visit_date."</td></tr>";
3870 <tr><td class="right" style="vertical-align:top;" nowrap><b><?php echo xlt("Provider"); ?>:</b>&nbsp;</td>
3871 <td><?php echo text($providerNAME); ?></td>
3872 </tr>
3874 <tr><td class="right" style="vertical-align:top;" nowrap><b><?php echo xlt("Reason/Plan"); ?>:</b>&nbsp;</td>
3875 <td style="vertical-align:top;">
3876 <?php
3877 // Start with Appt reason from calendar
3878 // Consider using last visit's PLAN field?
3879 //think about this space and how to use it...
3880 $query = "select * from openemr_postcalendar_events where pc_pid=? and pc_eventDate=?";
3881 $res = sqlStatement($query, array($pid,$dated));
3882 $reason = sqlFetchArray($res);
3883 ?>&nbsp;<?php echo text($reason['pc_hometext']);
3884 global $priors;
3885 $PLAN_today = preg_replace("/\|/", "<br />", $earlier['PLAN']);
3886 if ($PLAN_today) {
3887 echo "<br />".text($PLAN_today);
3890 </td>
3891 </tr>
3892 </table>
3893 </div>
3894 </div>
3895 <div id="left_menu3" name="left_menu3" class="col-md-3" style="font-size:1.0em;">
3896 <?php //if the patient has a photograph, use it else use generic avitar thing.
3897 if ($documents['docs_in_name']['Patient Photograph'][0]['id']) {
3899 <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"
3900 type="<?php echo attr($documents['docs_in_name']['Patient Photograph'][0]['mimetype']); ?>" allowscriptaccess="always" allowfullscreen="false" height="50"></embed></object>
3901 <?php
3902 } else {
3904 <object><embed src="<?php echo $GLOBALS['web_root']; ?>/interface/forms/<?php echo $form_folder; ?>/images/anon.gif" frameborder="0"
3905 type="image/gif" height="50"></embed></object>
3906 <?php
3909 </div>
3911 <div id="left_menu2" name="left_menu2" class="col-md-4" style="font-size:1.0em;">
3912 <?php
3913 $query = "Select * from users where id =?";
3914 $prov = sqlQuery($query, array($pat_data['ref_providerID']));
3915 $Ref_provider = $prov['fname']." ".$prov['lname'];
3916 $prov = sqlQuery($query, array($pat_data['providerID']));
3917 // $PCP = $prov['fname']." ".$prov['lname'];
3919 $query = "Select * from insurance_companies where id in (select provider from insurance_data where pid =? and type='primary')";
3920 $ins = sqlQuery($query, array($pid));
3921 $ins_co1 = $ins['name'];
3922 $query = "Select * from insurance_companies where id in (select provider from insurance_data where pid =? and type='secondary')";
3923 $ins = sqlQuery($query, array($pid));
3924 $ins_co2 = $ins['name'];
3927 <div style="position:relative;float:left;padding-left:18px;top:0px;">
3928 <table style="border:1pt;font-size:1.0em;">
3929 <tr>
3930 <td class="right"><b><?php echo xlt("PCP"); ?>:</b>&nbsp;</td><td style="font-size:0.8em;">&nbsp;
3931 <?php
3932 $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " .
3933 "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " .
3934 "AND ( authorized = 1 OR ( username = '' AND npi != '' ) ) " .
3935 "ORDER BY lname, fname");
3936 echo "<select name='form_PCP' id='form_PCP' title='".xla('Primary Care Provider')."'>";
3937 echo "<option value=''>" . xlt($empty_title) . "</option>";
3938 $got_selected = false;
3939 while ($urow = sqlFetchArray($ures)) {
3940 $uname = text($urow['lname'] . ' ' . $urow['fname']);
3941 $optionId = attr($urow['id']);
3942 echo "<option value='$optionId'";
3943 if ($urow['id'] == $pat_data['providerID']) {
3944 echo " selected";
3945 $got_selected = true;
3948 echo ">$uname</option>";
3951 if (!$got_selected && $currvalue) {
3952 echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>";
3953 echo "</select>";
3954 echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>";
3955 } else {
3956 echo "</select>";
3959 //need to develop a select list that when changed updates the PCP for this patient
3962 </td>
3963 </tr>
3964 <tr><td class="right" nowrap><b><?php echo xlt("Referred By"); ?>:</b>&nbsp;</td><td style="font-size:0.8em;">&nbsp;
3965 <?php
3966 $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " .
3967 "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " .
3968 "AND ( authorized = 1 OR ( username = '') ) " .
3969 "ORDER BY lname, fname");
3970 echo "<select name='form_rDOC' id='form_rDOC' title='".xla('Every name in the address book appears here, not only physicians.')."'>";
3971 echo "<option value=''>" . xlt($empty_title) . "</option>";
3972 $got_selected = false;
3973 while ($urow = sqlFetchArray($ures)) {
3974 $uname = text($urow['lname'] . ' ' . $urow['fname']);
3975 $optionId = attr($urow['id']);
3976 echo "<option value='$optionId'";
3977 if ($urow['id'] == $pat_data['ref_providerID']) {
3978 echo " selected";
3979 $got_selected = true;
3982 echo ">$uname</option>";
3985 if (!$got_selected && $currvalue) {
3986 echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>";
3987 echo "</select>";
3988 echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>";
3989 } else {
3990 echo "</select>";
3993 //need to develop a select list that when changed updates the PCP for this patient
3996 </td></tr>
3997 <tr><td class="right"><b><?php echo xlt("Insurance"); ?>:</b>&nbsp;</td><td>&nbsp;<?php echo text($ins_co1); ?></td></tr>
3998 <tr><td class="right"><b><?php echo xlt("Secondary"); ?>:</b>&nbsp;</td><td>&nbsp;<?php echo text($ins_co2); ?></td></tr>
3999 </table>
4000 </div>
4001 </div>
4003 </div>
4004 <?php
4007 * This is currently not used. It can easily be a footer with the practice info
4008 * or whatever you like. Maybe a placeholder for user groups or link outs to data repositories
4009 * such as Medfetch.com/PubMed/UpToDate/DynaMed????
4010 * It could provide information as to available data imports from connected machines - yes we have
4011 * data from an autorefractor needed to be imported. The footer can be fixed or floating.
4012 * It could have balance info, notes, or an upside down menu mirroring the header menu, maybe allowing
4013 * the user to decide which is fixed and which is not? Messaging? Oh the possibilities.
4015 * @param string $pid patient_id
4016 * @param string $encounter is the current encounter number
4017 * @return nothing, outputs directly to screen
4020 function menu_overhaul_bottom($pid, $encounter)
4022 ?><div class="navbar-custom" style="width:100%;height:25px;position:relative;border-top:1pt solid black;bottom:0px;z-index:1000000;">&nbsp;</div><?php
4026 * This was taken from new_form.php and is helping to integrate new menu with openEMR
4027 * menu seen on encounter page.
4029 function Menu_myGetRegistered($state = "1", $limit = "unlimited", $offset = "0")
4031 $sql = "SELECT category, nickname, name, state, directory, id, sql_run, " .
4032 "unpackaged, date FROM registry WHERE " .
4033 "state LIKE ? ORDER BY category, priority, name";
4034 if ($limit != "unlimited") {
4035 $sql .= " limit " . escape_limit($limit) . ", " . escape_limit($offset);
4038 $res = sqlStatement($sql, array($state));
4039 if ($res) {
4040 for ($iter=0; $row=sqlFetchArray($res); $iter++) {
4041 $all[$iter] = $row;
4043 } else {
4044 return false;
4047 return $all;
4050 * This prints a header for documents. Keeps the brand uniform...
4051 * @param string $pid patient_id
4052 * @param string $direction, options "web" or anything else. Web provides apache-friendly url links.
4053 * @return outputs directly to screen
4055 function report_header($pid, $direction = 'shell')
4057 global $form_name;
4058 global $encounter;
4059 global $visit_date;
4060 global $facilityService;
4061 /*******************************************************************
4062 $titleres = getPatientData($pid, "fname,lname,providerID");
4063 $sql = "SELECT * FROM facility ORDER BY billing_location DESC LIMIT 1";
4064 *******************************************************************/
4065 //$titleres = getPatientData($pid, "fname,lname,providerID,DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
4066 $titleres = getPatientData($pid, "fname,lname,providerID,DOB");
4067 $facility = null;
4068 if ($_SESSION['pc_facility']) {
4069 $facility = $facilityService->getById($_SESSION['pc_facility']);
4070 } else {
4071 $facility = $facilityService->getPrimaryBillingLocation();
4074 $DOB = oeFormatShortDate($titleres['DOB']);
4075 /******************************************************************/
4076 ob_start();
4077 // Use logo if it exists as 'practice_logo.gif' in the site dir
4078 // old code used the global custom dir which is no longer a valid
4080 <table style="width:100%;">
4081 <tr>
4082 <td style='width:150px;text-align:top;'>
4083 <?php
4084 if ($direction == "web") {
4085 global $OE_SITE_DIR;
4086 $practice_logo = $GLOBALS['webroot']."/sites/default/images/practice_logo.gif";
4087 if (file_exists($OE_SITE_DIR."/images/practice_logo.gif")) {
4088 echo "<img src='$practice_logo' align='left' style='width:150px;margin:0px 10px;'><br />\n";
4090 } else {
4091 global $OE_SITE_DIR;
4092 $practice_logo = "$OE_SITE_DIR/images/practice_logo.gif";
4093 if (file_exists($practice_logo)) {
4094 echo "<img src='$practice_logo' align='left' style='width:100px;margin:0px 10px;'><br />\n";
4098 </td>
4099 <td style='width:40%;'>
4100 <em style="font-weight:bold;font-size:1.4em;"><?php echo text($facility['name']); ?></em><br />
4101 <?php echo text($facility['street']); ?><br />
4102 <?php echo text($facility['city']); ?>, <?php echo text($facility['state']); ?> <?php echo text($facility['postal_code']); ?><br />
4103 <?php echo xlt('Phone').': ' .text($facility['phone']); ?><br />
4104 <?php echo xlt('Fax').': ' .text($facility['fax']); ?><br />
4105 <br clear='all' />
4106 <?php
4107 $visit= getEncounterDateByEncounter($encounter);
4108 $visit_date = $visit['date'];
4110 </td>
4111 <td>
4112 <em style="font-weight:bold;font-size:1.4em;"><?php echo text($titleres['fname']) . " " . text($titleres['lname']); ?></em><br />
4113 <b style="font-weight:bold;"><?php echo xlt('DOB'); ?>:</b> <?php echo text($DOB); ?><br />
4114 <b style="font-weight:bold;"><?php echo xlt('Generated on'); ?>:</b> <?php echo oeFormatShortDate(); ?><br />
4115 <b><?php echo xlt('Visit Date'); ?>:</b> <?php echo oeFormatSDFT(strtotime($visit_date)); ?><br />
4116 <b><?php echo xlt('Provider') . ':</b> ' . text(getProviderName(getProviderIdOfEncounter($encounter))).'<br />'; ?>
4118 </td>
4119 </tr>
4120 </table>
4121 <?php
4122 $output = ob_get_contents();
4123 ob_end_clean();
4124 return $output;
4128 * This function mines the clinical fields for potential diagnostic codes.
4129 * The clinical fields are found in table list_options with list_id = Eye_Coding_Fields_
4130 * The clinical terms to mine for are in table list_options with list_id = Eye_Coding_Terms
4131 * Both can be directly extended by the user the via Administration -> Lists interface.
4132 * The Coding_Eye_Form_Terms list includes the following important fields:
4133 * Title (the term),
4134 * Notes (the form_field to search for the term)
4135 * Code(s) (the optional user-defined code).
4136 * Terms found in a form_field (Notes) with a predefined Code(s), have that code applied.
4137 * Terms found in a form_field (Notes) without a predefined Code(s) are concated with
4138 * the text value for the form_field (Notes) (found in the list Coding_Eye_Form_Fields: Notes)
4139 * and the codebase is searched for a match.
4140 * For example: the term "ptosis" is found in the RUL clinical field, and there is no Code value in the
4141 * Coding_Eye_Form_Terms Code(s) field. Thus openEMR Eye Form searches the active codebases for a match.
4142 * The codebases are determined in Administration->Lists->Code Types and includes those Codesets flagged
4143 * as active and as Diagnostic codes. The terms "ptosis right upper eyelid" are sent to the
4144 * standard openEMR code search engine.
4145 * @param string $FIELDS - all the clinical fields we are going to scour for clinical terms to code.
4146 * @return outputs directly to screen
4148 function start_your_engines($FIELDS)
4150 //pass an assoc array of fields with terms in it and search them
4151 global $pid;
4152 global $codes_found;
4153 global $PMSFH;
4154 if (!$PMFSH) {
4155 $PMSFH = build_PMSFH($pid);
4158 $query = "select * from list_options where list_id ='Eye_Coding_Fields' Order by seq";
4159 $result = sqlStatement($query);
4160 while ($fielding =sqlFetchArray($result)) {//build the list of clinical fields to search through
4161 $fields[$fielding['title']] =$fielding['notes'];
4164 //get the clinical terms to search for (title) and what field/where to look for it (notes)
4165 $query = "SELECT * FROM list_options WHERE list_id = 'Eye_Coding_Terms' order by seq";
4166 $result = sqlStatement($query);
4167 while ($term_sheet =sqlFetchArray($result)) {
4168 if ($term_sheet['title'] > '') {
4169 $newdata = array (
4170 'term' => $term_sheet['title'], //the term =/- possible option_values eg. CSME:DM|IOL|RVO
4171 'location' => $term_sheet['notes'], //the form field to search for the term
4172 'codes' => $term_sheet['codes'] //the specific code for this term/location, may be blank
4174 $clinical_terms[] =$newdata;
4178 if (!$clinical_terms) {
4179 return;
4182 $positives = array();
4183 // Terms are sequenced in the DB (seq) from detailed (more complex descriptions) to a simple (one word) description.
4184 // $clinical_terms[] is built in this sequence also.
4185 // eg. "cicatricial ectropion","spastic ectropion", "ectropion".
4186 // If "cicatricial ectropion" is present in this clinical field (or "spastic ectropion" for that matter),
4187 // then there is no need to report the presence of "ectropion" as a clinical finding to the Imp/Plan Builder.
4188 // needle/haystack lookup $positives[] = $term;
4189 // For terms that overlap other diseases, use term:option|option|option. These are always last to process.
4191 foreach ($clinical_terms as $amihere) {
4192 $option_values="";
4193 $term="";
4194 $code_found = array();
4195 if (stripos($amihere['term'], ":") !== false) { //options are stored here code:option_values
4196 list ($term,$option_values) = explode(":", $amihere['term']);
4197 } else {
4198 $term = $amihere['term'];
4201 if (stripos($FIELDS[$amihere['location']], $term) !==false) {
4202 //the term is in the field
4203 $within_array = 'no';
4204 if (isset($positives[$amihere['location']]) > '') { //true if anything was already found in this field
4205 //do any of the previous hits found in in this location contain this term already?
4206 //if so stop; if not, continue onward to add to Builder.
4207 foreach ($positives[$amihere['location']] as $k => $v) {
4208 if (preg_match("/$term/", $v)) {
4209 $within_array = 'yes';
4210 break;
4215 if ($within_array =="yes") {
4216 continue;
4219 $positives[$amihere['location']][]=$term;
4220 if (preg_match("/^(OD)/", $amihere['location'])) {
4221 $side = "right eye";
4222 $side1 = "OD";
4223 $side2 = "R";
4224 } else {
4225 $side = "left eye";
4226 $side1 = "OS";
4227 $side2 = "L";
4230 if (($amihere['codes'] > '') && ($option_values=="")) { //did the user define a code for this term in list Eye_Coding_Terms?
4231 //If so process - we are primed and don't need the carburetor for the Builder
4232 //eg ICD10:H02.891
4233 if (stripos($amihere['codes'], ":") !== false) {
4234 list($code_type,$code) = explode(":", $amihere['codes']);
4235 } else {
4236 //default to ICD10. Maybe there is a GLOBALS value for this? Maybe there should be?
4237 $code_type="ICD10";
4240 $code_found['code'] = $code_type.":".$code;
4241 $code_found['code_type'] = $code_type;
4242 list($sub_term,$newdata) = coding_engine($term, $code_found, $amihere['location']);
4243 $codes_found[$sub_term][] = $newdata;
4244 $positives[$location][]=$term;
4245 } else { //no code was defined, further processing needed.
4246 if ($option_values) {
4247 // This clinical finding (term) can be found in more than one disease process ('option_values')
4248 // This special group of terms should be processed last, to identify all
4249 // possible results for the Builder.
4250 // 'option_values' contains pertinent DXs separated by '|', eg. CSME has option values='DM|IOL|RVO'
4251 // Need to see if any of these DX apply and builder Codes_found based on the currently installed list of codes
4252 // Currently for most users this is ICD10 but it is built to allow extension to any code sets in openEMR,
4253 // including foreign laguage code sets.
4254 $options = explode("|", $option_values);
4255 $hit_here="0";
4257 foreach ($options as $option) {
4258 // if it has mass, try to execute it.
4259 $term_now="";
4260 if ($option=="DM") {
4261 //This option is run for 3 conditions at present:
4262 //CSME/NVD/NVE per eye. It is the same every time so only do it once, per eye.
4263 //Did we already code this? If so move on.
4264 if ($hit_DM[$side1]=='1') {
4265 continue;
4268 //Are ICD10 etc codes used in other languages? Via Snomed? Via user?
4269 //Assume there is a standard for xlt/xla purposes...
4271 //is the patient diabetic?
4272 //search medical_problem for DM
4273 $within_array="";
4274 foreach ($PMSFH[0]['PMH'] as $k => $v) {
4275 if (stripos($v['codedesc'], "diabetes")) {
4276 $DM_code = $v['codedesc'];
4277 $within_array = 'yes';
4281 if ($within_array =="yes") {
4282 if (stripos($DM_code, "1")) {
4283 $DM_text = "Type 1 diabetes mellitus";
4284 $label = "DM 1";
4285 } else if (stripos($DM_code, "2")) {
4286 $DM_text = "Type 2 diabetes mellitus";
4287 $label = "DM 2";
4288 } else {
4289 $DM_text = "Other specified diabetes";
4290 $label = "DM";
4292 } else { //there is no code that lists diabetes in the PMH
4293 continue;
4296 //is there CSME
4297 if ($side=="right eye") {
4298 $location ="ODMACULA";
4299 $location1 ="ODDISC";
4300 $location2 ="ODVESSELS";
4301 $location3 ="ODPERIPH";
4302 } else if ($side=="left eye") {
4303 $location ="OSMACULA";
4304 $location1 ="OSDISC";
4305 $location2 ="OSVESSELS";
4306 $location3 ="OSPERIPH";
4309 if ((stripos($FIELDS[$location], "flat") ===false) && (stripos($FIELDS[$location], "CSME") !==false)) {
4310 //what if they type "no CSME" or "not flat"?
4311 $MAC_text = "with macular edema";
4312 $hit_CSME = "w/ CSME";
4313 } else {
4314 $MAC_text="without macular edema";
4315 $hit_CSME="w/o CSME";
4318 //is there (NVD or NVE) or BDR?
4319 $NVD = "NVD";
4320 $NVE = "NVE";
4321 $PPDR = "PPDR";
4322 $PDR = "PDR";
4323 $BDR = "BDR";
4324 $IRMA = "IrMA";
4325 if ((stripos($FIELDS[$location1], $NVD) !==false) ||
4326 (stripos($FIELDS[$location2], $NVE) !==false) ||
4327 (stripos($FIELDS[$location3], $NVE) !==false)) {
4328 $DX="with proliferative";
4329 $label = $label. "w/ PDR ".$hit_CSME;
4330 $hit_PDR[$side]='1';
4331 } else if ((stripos($FIELDS[$location2], $PPDR) !==false) ||
4332 (stripos($FIELDS[$location2], $PPDR) !==false) ||
4333 (stripos($FIELDS[$location], $IRMA) !==false) ||
4334 (stripos($FIELDS[$location2], $IRMA) !==false) ||
4335 (stripos($FIELDS[$location3], $IRMA) !==false)) {
4336 $DX="with severe nonproliferative";
4337 $label = $label." w/ PPDR ".$hit_CSME;
4338 $hit_PPDR[$side]='1';
4339 } else if ((stripos($FIELDS[$location], $BDR) !==false) ||
4340 (stripos($FIELDS[$location2], $BDR) !==false)) {
4341 $trace = "tr";
4342 if ((stripos($FIELDS[$location], $trace." ".$BDR) !==false) ||
4343 (stripos($FIELDS[$location2], "+1 ".$BDR) !==false) ||
4344 (stripos($FIELDS[$location], $trace." ".$BDR) !==false) ||
4345 (stripos($FIELDS[$location2], "+1 ".$BDR) !==false)) {
4346 $DX="with mild nonproliferative";
4347 $label = $label." w/ mild BDR ".$hit_CSME;
4348 $hit_BDR[$side]='1';
4349 } else {
4350 $DX="with moderate nonproliferative";
4351 $label = $label." w/ mod BDR ".$hit_CSME;
4352 $hit_BDR[$side] = '1';
4356 $code_found = coding_carburetor($DM_text, $MAC_text);
4357 if (isset($code_found)) { //there are matches, present them to the engine
4358 foreach ($code_found as $found) {
4359 list($sub_term,$newdata) = coding_engine($label, $found, $amihere['location'], $side1);
4360 // The carburetor is a simple machine - it has no boolean options -
4361 // so "with" and "without" match a search for "with"...
4362 // We need to be specific to whittle down the options.
4363 if ((stripos($newdata['codedesc'], $MAC_text)) && (stripos($newdata['codedesc'], $DX))) {
4364 //does this code already exist for the other eye (right eye is always first)?
4365 //if so, change OD to OU and skip adding this code.
4366 if ($side1=="OS") {
4367 $count='0';
4368 for ($i=0; $i < count($codes_found[$sub_term]); $i++) {
4369 $swap="OD";
4370 $codes_found[$sub_term][$i]['title'] = str_replace($swap, "OU", $codes_found[$sub_term][$i]['title']);
4371 break 2;
4372 $count++;
4376 $codes_found[$sub_term][] = $newdata;
4377 $positives["DM".$side1][] = $newdata['code'];
4378 $hit_DM[$side1]='1';
4382 } else if ($option=="RVO") {
4383 //is there a CRVO or BRVO associated?
4384 //check Clinical fields for these terms
4385 if ($side=="right eye") {
4386 $location ="ODVESSELS";
4387 } else {
4388 $location ="OSVESSELS";
4391 if ($hit_RVO[$location] == '1') {
4392 continue;
4395 if (stripos($FIELDS[$location], "CRVO") !==false) {
4396 // this is a CRVO, look up code for location
4397 $terms = "CRVO";
4398 $code_found = coding_carburetor("central retinal vein", $side);
4399 if (isset($code_found)) { //there are matches, present them to the Builder
4400 foreach ($code_found as $found) {
4401 list($sub_term,$newdata) = coding_engine($terms, $found, $location, $side1);
4402 $codes_found[$sub_term][] = $newdata;
4403 $positives[$location][]="CRVO";
4404 $hit_RVO[$location] ="1";
4407 } else if (stripos($FIELDS[$location], "BRVO") !==false) {
4408 // this is a BRVO, look up code for location
4409 $code_found = coding_carburetor("branch retinal vein", $side);
4410 $terms = "BRVO ".$term;
4411 if (isset($code_found)) { //there are matches, present them to the Builder
4412 foreach ($code_found as $found) {
4413 list($sub_term,$newdata) = coding_engine($terms, $found, $location, $side1);
4414 $codes_found[$sub_term][] = $newdata;
4415 $positives[$location][]="BRVO";
4416 $hit_RVO[$location]='1';
4421 if (($term=="CSME") && ($hit_RVO[$location]=='1')) {
4422 //$code = "H35.81";
4423 $code_found = coding_carburetor("retinal", "edema");
4424 $terms = "Vein occlusion and macular edema";
4425 if (isset($code_found)) { //there are matches, present them to the Builder
4426 foreach ($code_found as $found) {
4427 if ($found['code'] == "ICD10:H35.81") {
4428 list($sub_term,$newdata) = coding_engine($terms, $found, $location, $side1);
4429 $codes_found[$sub_term][] = $newdata;
4430 $positives[$location][]="CSME";
4431 $hit_RVO_CSME='1';
4436 } else if ($option=="IOL") {
4437 //are they within 3 months of cataract surgery on this eye? Yag?
4438 //search the same side Lens field for term IOL, ? procedure this eye in last 3 months?
4439 //search surgery_issue_list or even search the billng engine
4440 $query = "select begdate as surg_date from lists where pid=? and type='surgery' and title like '%IOL%' and (title like '%".xlt($side1)."%')";
4441 $surg = sqlQuery($query, array($pid));
4442 if ($surg['surg_date']>'') {
4443 $date1 = date('Y-m-d');
4444 //$date2 = (DateTime($surg['surg_date']));
4445 //echo $term."\n".$date."\n";continue;
4446 $date_diff=strtotime($date1) - strtotime($surg['surg_date']);
4447 $interval = $date_diff/(60 * 60 * 24);
4448 //$interval = 200;
4449 if (($interval < '180') && ($term=="CSME")) {
4450 //then this could be post procedure CSME cystoid macular edema H59.031,2 OD OS
4451 $code_found = coding_carburetor("cystoid macular edema", $side);
4452 if (isset($code_found)) { //there are matches, present them to the Builder
4453 foreach ($code_found as $found) {
4454 $term = "Post-cataract CME";
4455 list($sub_term,$newdata) = coding_engine($term, $found, $amihere['location'], $side1);
4456 $codes_found[$sub_term][] = $newdata;
4457 $positives[$amihere['location']][]= $term;
4458 $hit_IOL='1';
4461 if ($side1=="OS") {
4462 $count='0';
4463 for ($i=0; $i < count($codes_found[$sub_term]); $i++) {
4464 $swap="OD";
4465 $codes_found[$sub_term][$i]['title'] = str_replace($swap, "OU", $codes_found[$sub_term][$i]['title']);
4466 break 2;
4467 $count++;
4470 } else {
4471 //echo "Not here. $term. $interval \n";
4475 } else {
4476 //should we have another big Dx often altering what a finding means to a coder; this is a placeholder.
4477 //include $option in our code search for this term
4478 $term_now = $term ." ".$option;
4479 $code_found = coding_carburetor($term_now, $fields[$amihere['location']]);
4480 if (isset($code_found)) { //there are matches, present them to the Builder
4481 foreach ($code_found as $found) {
4482 list($sub_term,$newdata) = coding_engine($term, $found, $amihere['location'], $side1);
4483 $codes_found[$sub_term][] = $newdata;
4484 $positives[$amihere['location']][]= $term_now;
4489 } else {
4490 //there are no options and no code identified,
4491 //search via carburetor for possible matches to term and description of the form field
4492 $code_found = coding_carburetor($term, $fields[$amihere['location']]);
4493 if ($code_found !== null) { //there are matches, present them to the Builder
4494 foreach ($code_found as $found) {
4495 list($sub_term,$newdata) = coding_engine($term, $found, $amihere['location']);
4496 $codes_found[$sub_term][] = $newdata;
4497 $positives[$amihere['location']][]= $term;
4505 // $codes_found contains the PE/Clinical findings for the Imp/Plan Builder engine.
4506 // It also gets "horsepower" from the POH/POS and PMH findings.
4507 // Together these three form the Imp/Plan Builder's suggestions available to the end user to build the Imp/Plan,
4508 // and by extension one of the data sources for the Coding Engine to populate the fee sheet.
4509 // When entering a Dx in the PMSFH, it pays to assign these codes up front...
4510 // The rest is exhaust fumes for the muffler.
4511 return $codes_found;
4514 * This function checks a single field for a term and, if found, codes it.
4515 * It is not called directly but via the wrapper function start_your_engines().
4517 * @param string $term, text to search for in the coding tables.
4518 * @param string $field, location where to search. In fact any text that refines the search can be contained here.
4519 * @return outputs array of $codes matching the $term & $field
4521 function coding_carburetor($term, $field)
4523 if (!$term||!$field) {
4524 return;
4527 $codes = array();
4528 $code_type = "ICD10"; //only option is PROD (product or drug search) or NOT PROD...
4529 $search_term = $term." ".$field;
4530 $res = main_code_set_search($code_type, $search_term);
4531 while ($row = sqlFetchArray($res)) {
4532 $newdata = array (
4533 'code' => $row['code'],
4534 'code_text' => $row['code_text'],
4535 'code_type' => $row['code_type_name'],
4536 'code_desc' => $row['code_desc']
4538 $codes[] =$newdata;
4541 return $codes;
4544 * This function prepares a code found in a clinical field and returns it in $codes_found format.
4545 * @param $code is in the format code_type:code eg. ICD10:H34.811
4546 * @param $location is the descruiptive name of the clinical field in question
4547 * @param $side is optional. Used as the descriptive text for the finding in the Builder
4548 * and IMP/Plan if selected from the Builder
4549 * @return $subterm,$newdata. $subterm is used to link items in IMP/PLAN back to its orgin.
4550 * $newdata is the array of newly found items to include in the Builder.
4552 * This function is not called directly but via the wrapper function start_your_engines().
4554 function coding_engine($term, $code_found, $location, $side = '')
4556 if (strpos($code_found['code'], ":")) {
4557 list($code_type, $code) = explode(':', $code_found['code']);
4558 } else {
4559 $code = $code_found['code'];
4560 $code_type = "ICD10";//default to ICD10
4561 $code_found['code'] = $code_type.":".$code_found['code'];
4564 $code_desc = lookup_code_descriptions($code_found['code']);
4565 $order = array("\r\n", "\n","\r");
4566 $code_desc = str_replace($order, '', $code_desc);
4568 $code_text = text($code_found['code']). " (" . text($code_desc) . ")";
4569 $replace =" ";
4570 $sub_term = str_replace($replace, "", $term);
4571 //some codes are bilateral, some not, some are per eyelid. Comment this out for now:
4572 //(preg_match("/right/",$code_desc))? $side = xlt('OD{{right eye}}') : $side = xlt('OS{{left eye}}');
4574 $newdata = array (
4575 'title' => ucfirst($term). " ".$side,
4576 'location' => $location,
4577 'diagnosis' => $code,
4578 'code' => $code,
4579 'codetype' => $code_found['code_type'],
4580 'codedesc' => $code_desc,
4581 'codetext' => $code_text,
4582 'PMSFH_link' => "Clinical_".$sub_term
4584 return array($sub_term,$newdata);
4587 * This is a function to sort an array of dates/times etc
4588 * Anything strtotime() can recognize at least.
4590 function cmp($a, $b)
4592 if ($a == $b) {
4593 return 0;
4596 return (strtotime($a) < strtotime($b))? -1 : 1;
4600 * This function returns the TARGET IOP values for a given ($pid) if ever set, otherwise returns the DEFAULT IOP.
4601 * when a value is found for a given field in the Eye Form for a given patient ($pid)
4602 * @param $name is in the name of the field
4604 * @return $ranges. A mysqlArray(max_FIELD,max_date,min_date)
4606 function display_GlaucomaFlowSheet($pid, $bywhat = 'byday')
4608 global $PMSFH;
4609 global $documents;
4610 global $form_folder;
4611 global $priors;
4612 global $providerID;
4613 global $documents;
4614 global $encounter_data;
4615 global $ODIOPTARGET;
4616 global $OSIOPTARGET;
4617 global $dated;
4619 if (!$documents) {
4620 list($documents) = document_engine($pid);
4623 $count_OCT = count($documents['docs_in_name']['OCT']);
4624 if ($count_OCT > 0) {
4625 foreach ($documents['docs_in_name']['OCT'] as $OCT) {
4626 $OCT_date[] = $OCT['docdate'];
4630 $count_VF = count($documents['docs_in_name']['VF']);
4631 if ($count_VF > 0) {
4632 foreach ($documents['docs_in_name']['VF'] as $VF) {
4633 $VF_date[] = $VF['docdate'];
4637 $i=0;
4638 //if there are no priors, this is the first visit, display a generic splash screen.
4639 if ($priors) {
4640 foreach ($priors as $visit) {
4641 //we need to build the lists - dates_OU,times_OU,gonio_OU,OCT_OU,VF_OU,ODIOP,OSIOP,IOPTARGETS
4642 $old_date_timestamp = strtotime($visit['visit_date']);
4643 $visit['exam_date'] = date('Y-m-d', $old_date_timestamp);
4644 $VISITS_date[$i] = $visit['exam_date'];
4646 //$date_OU[$i] = $visit['exam_date'];
4648 $time_here = explode(":", $visit['IOPTIME']);
4649 $time = $time_here[0].":".$time_here[1];
4650 $time_OU[$i] = $time;
4652 if (($visit['ODGONIO'] > '')||($visit['OSGONIO'] > '')) {
4653 $GONIO_date[$i] = $visit["exam_date"];
4654 $GONIO[$i]["list"] = '1';
4655 } else {
4656 $GONIO[$i]["list"] = '';
4659 if ($visit['ODIOPAP']>'') {
4660 $ODIOP[$i]['IOP'] = $visit['ODIOPAP'];
4661 $ODIOP[$i]['method'] = "AP";
4662 } else if ($visit['ODIOPTPN']>'') {
4663 $ODIOP[$i]['IOP'] = $visit['ODIOPTPN'];
4664 $ODIOP[$i]['method'] = "TPN";
4665 } else {
4666 $ODIOP[$i]['IOP'] ="";
4669 if ($visit['OSIOPAP']>'') {
4670 $OSIOP[$i]['IOP'] = $visit['OSIOPAP'];
4671 $OSIOPMETHOD[$i]['method'] = "AP";
4672 } else if ($visit['OSIOPTPN']>'') {
4673 $OSIOP[$i]['IOP'] = $visit['OSIOPTPN'];
4674 $OSIOPMETHOD[$i]['method'] = "TPN";
4675 } else {
4676 $OSIOP[$i]['IOP'] = "null";
4677 //we are ignoring finger tension for graphing purposes but include this should another form of IOP measurement arrive...
4678 //What about the Triggerfish contact lens continuous IOP device for example...
4681 //build the Target line values for each date.
4682 $j = $i - 1;
4683 if ($visit['ODIOPTARGET']>'') {
4684 $ODIOPTARGETS[$i]= $visit['ODIOPTARGET'];
4685 } else if (!$ODIOPTARGETS[$j]) { //get this from the provider's default list_option
4686 $query = "SELECT * FROM `list_options` WHERE `list_id` LIKE 'Eye_defaults_".$providerID."' and (option_id = 'ODIOPTARGET' OR option_id = 'OSIOPTARGET')";
4687 $results = sqlQuery($query);
4688 while ($default_TARGETS = sqlFetchArray($result)) {
4689 if ($default_TARGETS['option_id']=='ODIOPTARGET') {
4690 $ODIOPTARGETS[$i] = $default_TARGETS["title"];
4693 if ($default_TARGETS['option_id']=='OSIOPTARGET') {
4694 $OSIOPTARGETS[$i] = $default_TARGETS["title"];
4697 } else {
4698 $ODIOPTARGETS[$i] = $ODIOPTARGETS[$j];
4701 if ($visit['OSIOPTARGET']>'') {
4702 $OSIOPTARGETS[$i] = $visit['OSIOPTARGET'];
4703 } else if (!$OSIOPTARGETS[$j] > '') {
4704 if (!$OSIOPTARGETS[$i]) {
4705 $query = "SELECT * FROM `list_options` WHERE `list_id` LIKE 'Eye_defaults_".$providerID."' and (option_id = 'ODIOPTARGET' OR option_id = 'OSIOPTARGET')";
4706 $results = sqlQuery($query);
4707 while ($default_TARGETS = sqlFetchArray($result)) {
4708 if ($default_TARGETS['option_id']=='OSIOPTARGET') {
4709 $OSIOPTARGETS[$i] = $default_TARGETS["title"];
4713 } else {
4714 $OSIOPTARGETS[$i] = $OSIOPTARGETS[$j];
4717 $i++;
4719 } else { //there are no priors, get info for this visit
4720 $VISITS_date[0] = $dated;
4721 if ($encounter_data['IOPTIME']) {
4722 $time_here = explode(":", $encounter_data['IOPTIME']);
4723 $time = $time_here[0].":".$time_here[1];
4724 $time_OU[] = $time;
4727 if ($encounter_data['ODGONIO']||$encounter_data['OSGONIO']) {
4728 $GONIO_date[$i] = $dated;
4731 $ODIOP[$i]['time'] = $time;
4732 $OSIOP[$i]['time'] = $time;
4733 //$IOPTARGET['visit_date'] = $encounter_data['exam_date'];
4734 if ($encounter_data['ODIOPAP']>'') {
4735 $ODIOP[$i]['IOP'] = $encounter_data['ODIOPAP'];
4736 $ODIOP[$i]['method'] = "AP";
4737 } else if ($encounter_data['ODIOPTPN']>'') {
4738 $ODIOP[$i]['IOP'] = $encounter_data['ODIOPTPN'];
4739 $ODIOP[$i]['method'] = "TPN";
4742 if ($encounter_data['OSIOPAP']>'') {
4743 $OSIOP[$i]['IOP'] = $encounter_data['OSIOPAP'];
4744 $OSIOP[$i]['method'] = "AP";
4745 } else if ($encounter_data['OSIOPTPN']>'') {
4746 $OSIOP[$i]['IOP'] = $encounter_data['OSIOPTPN'];
4747 $OSIOP[$i]['method'] = "TPN";
4748 } else {
4749 //we are ignoring finger tension for graphing purposes but include this should another form of IOP measurement arrive...
4750 //What about the Triggerfish contact lens continuous IOP device for example...
4753 if ($encounter_data['ODIOPTARGET']>'') {
4754 $ODIOPTARGETS[$i] = $encounter_data['ODIOPTARGET'];
4755 } else {
4756 $query = "SELECT * FROM `list_options` WHERE `list_id` LIKE 'Eye_defaults_".$providerID."' and (option_id = 'ODIOPTARGET' OR option_id = 'OSIOPTARGET')";
4757 $results = sqlQuery($query);
4758 while ($default_TARGETS = sqlFetchArray($result)) {
4759 if ($default_TARGETS['option_id']=='ODIOPTARGET') {
4760 $ODIOPTARGETS[$i] = $default_TARGETS["title"];
4763 if ($default_TARGETS['option_id']=='OSIOPTARGET') {
4764 $OSIOPTARGETS[$i] = $default_TARGETS["title"];
4769 if ($encounter_data['OSIOPTARGET']>'') {
4770 $OSIOPTARGETS[$i] = $encounter_data['ODIOPTARGET'];
4771 } else if (!$OSIOPTARGETS[$i] > '') {
4772 $query = "SELECT * FROM `list_options` WHERE `list_id` LIKE 'Eye_defaults_".$providerID."' and (option_id = 'ODIOPTARGET' OR option_id = 'OSIOPTARGET')";
4773 $results = sqlQuery($query);
4774 while ($default_TARGETS = sqlFetchArray($result)) {
4775 if ($default_TARGETS['option_id']=='OSIOPTARGET') {
4776 $OSIOPTARGETS[$i] = $default_TARGETS["title"];
4782 //There are visits for testing only, no IOP.
4783 //We need to insert these dates into the arrays created above.
4784 //recreate them to include the testing only dates, placing null values for those dates if not done.
4786 //can't merge empty arrays
4787 $list = array();
4788 $arrs[]=$OCT_date;
4789 $arrs[]=$VF_date;
4790 $arrs[]=$GONIO_date;
4791 $arrs[]=$VISITS_date;
4793 foreach ($arrs as $arr) {
4794 if (is_array($arr)) {
4795 $list = array_merge($list, $arr);
4799 $date_OU = array_unique($list);
4800 usort($date_OU, "cmp");
4801 $times_OU=$time_OU;
4802 usort($times_OU, "cmp");
4804 for ($a=0; $a < count($date_OU); $a++) {
4805 foreach ($GONIO_date as $GONIO) {
4806 if ($date_OU[$a] == $GONIO) {
4807 $GONIO_values[$a] = "1";
4808 break;
4812 if (!$GONIO_values[$a]) {
4813 $GONIO_values[$a] = "";
4816 if ($count_OCT > 0) {
4817 foreach ($OCT_date as $OCT) {
4818 if ($date_OU[$a] == $OCT) {
4819 $OCT_values[$a] = "1";
4820 break;
4825 if (!$OCT_values[$a]) {
4826 $OCT_values[$a] = "";
4829 if ($count_VF > 0) {
4830 foreach ($VF_date as $VF) {
4831 if ($date_OU[$a] == $VF) {
4832 $VF_values[$a] = "1";
4833 break;
4838 if (!$VF_values[$a]) {
4839 $VF_values[] ="";
4842 for ($k=0; $k < count($VISITS_date); $k++) {
4843 if ($date_OU[$a] == $VISITS_date[$k]) {
4844 $OD_values[$a] = "'".$ODIOP[$k]['IOP']."'";
4845 $OD_methods[$a] = $ODIOP[$k]['method'];
4846 $OS_values[$a] = $OSIOP[$k]['IOP'];
4847 $OS_methods[$a] = $OSIOP[$k]['method'];
4848 $ODIOPTARGET_values[$a] = $ODIOPTARGETS[$k];
4849 $OSIOPTARGET_values[$a] = $OSIOPTARGETS[$k];
4850 break;
4854 if (!$OD_values[$a]) {
4855 $OD_values[$a] = '';
4858 if (!$OS_values[$a]) {
4859 $OS_values[$a] = '';
4862 if (!$OD_methods[$a]) {
4863 $OD_methods[$a] = "";
4866 if (!$OS_methods[$a]) {
4867 $OS_methods[$a] = "";
4870 if (!$ODIOPTARGET_values[$a]) {
4871 $ODIOPTARGET_values[$a] = "";
4874 if (!$OSIOPTARGET_values[$a]) {
4875 $OSIOPTARGET_values[$a] = "";
4879 for ($a=0; $a < count($times_OU); $a++) {
4880 for ($k=0; $k < count($ODIOP); $k++) {
4881 if ($times_OU[$a] == $time_OU[$k]) {
4882 $OD_time_values[$a] = $ODIOP[$k]['IOP'];
4883 $OS_time_values[$a] = $OSIOP[$k]['IOP'];
4884 break;
4888 if (!$OD_time_values[$a]) {
4889 $OD_time_values[$a] = "";
4892 if (!$OS_time_values[$a]) {
4893 $OS_time_values[$a] = "";
4897 $dates_OU = "'".implode("','", $date_OU)."'";
4898 $OD_values = implode(",", $OD_values);
4899 $OS_values = implode(",", $OS_values);
4900 $OCT_values = "'".implode("','", $OCT_values)."'";
4901 $VF_values = "'".implode("','", $VF_values)."'";
4902 $GONIO_values = "'".implode("','", $GONIO_values)."'";
4903 $IOPTARGET_values = implode(",", $ODIOPTARGET_values);
4904 $times_OU = "'".implode("','", $times_OU)."'";
4905 $OD_time_values = "'".implode("','", $OD_time_values)."'";
4906 $OS_time_values = "'".implode("','", $OS_time_values)."'";
4908 ?> <b> <?php echo xlt('Glaucoma Zone'); ?>:</b>
4909 <br /><br />
4910 <span class="closeButton fa fa-close" id="Close_IOP" name="Close_IOP"></span>
4911 <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%;">
4912 <table class="GFS_table">
4913 <tr >
4914 <td colspan="1" class="GFS_title_1" style="padding-bottom:3px;border:none;" nowrap><?php echo xlt('Current Target'); ?>:
4915 <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>
4916 <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>
4917 </tr>
4918 <tr>
4919 <td colspan="3" class="hideme nodisplay">
4920 TARGET IOP HISTORY
4921 </td>
4922 </tr>
4923 <?php
4924 //what active meds have a subtype eye?
4925 $i=0;
4926 $count_Meds = count($PMSFH[0]['Medication']);
4927 if ($count_Meds > '0') {
4928 foreach ($PMSFH[0]['Medication'] as $drug) {
4929 if (($drug['row_subtype'] =="eye") && ($drug['enddate'] !== "")) {
4930 $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'])."'
4931 onclick=\"alter_issue2('".attr(addslashes($drug['rowid']))."','Medication','$i');\">".text($drug['title'])."</span></td>
4932 <td class='GFS_td'>".oeFormatShortDate($drug['begdate'])."</td></tr>";
4933 } else if (($drug['row_subtype'] =="eye")&&($drug['enddate'] > "")&&(strtotime($drug['enddate']) < strtotime($visit_date))) {//what meds have a subtype eye that are discontinued?
4934 $hideme = "hideme_drugs nodisplay";
4935 $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'])."'
4936 onclick=\"alter_issue2('".attr(addslashes($drug['rowid']))."','Medication','$i');\">".text($drug['title'])."</span></td>
4937 <td class='GFS_td'>".oeFormatShortDate($drug['begdate'])."</td><td class='GFS_td'>".oeFormatShortDate($drug['enddate'])."</td></tr>";
4940 $i++;
4943 if (!$current_drugs) {
4944 $current_drugs = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('None documented')."</td></tr>";
4945 $no_drugs='1';
4948 foreach ($PMSFH[0]['Medication'] as $drug) {
4949 if (($drug['row_subtype'] =="eye")&&($drug['enddate'] > "")) {
4950 $FAILED_drug .= "<li>".text($drug['title'])."</li>";
4955 <tr class="GFS_tr">
4956 <td colspan="2" class="GFS_title"><?php echo xlt('Current Eye Meds'); ?>:</td>
4957 <?php ($no_drugs) ? ($meds_here = '') : $meds_here = xlt('Start'); ?>
4958 <td class="GFS_title" style="text-align:center;"><?php echo $meds_here; ?></td>
4959 <?php
4960 if ($FAILED_drugs) {
4961 echo '<td><span class="right toggleme" id="toggle_drugs"><i class="fa fa-toggle-down"></i></span></td>';
4962 } ?>
4963 </tr>
4964 <?php
4965 echo $current_drugs;
4966 if ($FAILED_drugs) {
4967 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>';
4970 echo $FAILED_drugs;
4972 //start VF section
4973 if ($count_VF > '0') { //need to decide how many to show on open, and hide the rest? For now the first only.
4974 $count=0;
4975 foreach ($documents['docs_in_name']['VF'] as $VF) {
4976 if ($count < 1) {
4977 $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" '.
4978 'onclick="return dopopup(\'../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($VF['parent']).'&encounter='.$encounter.'&category_name=VF">
4979 '.$VF['encounter_date'].'&nbsp;<img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" style="width:15px; height:15px;" /></a></td></tr>';
4980 } else {
4981 $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" '.
4982 'onclick="return dopopup(\'../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($VF['parent']).'&encounter='.$encounter.'&category_name=VF">
4983 '.$VF['encounter_date'].'&nbsp;<img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" style="width:15px; height:15px;" /></a></td></tr>';
4986 $count++;
4988 } else {
4989 $current_VF = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('Not documented')."</td></tr>";
4992 <tr class="GFS_tr">
4993 <td colspan="3" class="GFS_title"><?php echo xlt('Visual Fields'); ?>:
4994 <?php
4995 if ($old_VFs) {
4996 echo '<td><span class="top right" id="toggle_VFs"><i class="fa fa-toggle-down"></i></span></td>';
4999 </tr>
5000 <?php echo $current_VF.$old_VFs;
5001 //end VF section
5003 //start Optic Nerve section
5005 <tr>
5006 <td colspan="3" class="GFS_title"><?php echo xlt('Optic Nerve Analysis'); ?>:&nbsp;
5007 <?php
5008 if ($count_OCT > '0') { //need to decide how many to show on open, and hide the rest? For now show first, hide rest.
5009 $count=0;
5010 foreach ($documents['docs_in_name']['OCT'] as $OCT) {
5011 //get encounter date from encounter id
5012 if ($count < 1) {
5013 $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" '.
5014 'onclick="return dopopup(\'../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($OCT['parent']).'&encounter='.$encounter.'&category_name=OCT">
5015 '.$OCT['encounter_date'].'&nbsp;<img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" style="width:15px; height:15px;" /></a></td></tr>';
5016 } else {
5017 $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" '.
5018 'onclick="return dopopup(\'../../forms/'.$form_folder.'/php/Anything_simple.php?display=i&category_id='.attr($OCT['parent']).'&encounter='.$encounter.'&category_name=OCT">
5019 '.$OCT['encounter_date'].'&nbsp;<img src="../../forms/'.$form_folder.'/images/jpg.png" class="little_image" style="width:15px; height:15px;" /></a></td></tr>';
5022 $count++;
5024 } else {
5025 $current_OCT = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('Not documented')."</td></tr>";
5028 if ($old_OCTs) {
5029 echo '<td><span class="top right " id="toggle_OCTs"><i class="fa fa-toggle-down"></i></span></td>';
5032 echo "</tr>";
5033 echo $current_OCT.$old_OCTs;
5035 $count=0;
5036 $hideme='';
5037 foreach ($priors as $visit) {
5038 if (($visit['ODGONIO'] > " ")||($visit['OSGONIO'] > " ")) { // something is here
5039 if ($count >0) {
5040 $hideme = "hideme_gonios nodisplay";// show the first only, hide the rest for now
5043 $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>";
5044 $GONIO_chart .='"1",';
5045 $count++;
5046 } else {
5047 $GONIO_chart .= ',';
5051 $GONIO = chop($GONIO, ",");
5052 if ($count ==0) {
5053 $gonios = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('Not documented')."</td></tr>";
5056 <tr>
5057 <td class="GFS_title_1" id="GFS_gonios" name="GFS_gonios" style="position:relative;"><?php echo xlt('Gonioscopy'); ?>:</td>
5058 <?php
5059 if ($count > '0') {
5060 echo "<td class='GFS_title center'>".xlt('OD{{right eye}}')."</td><td class='GFS_title center'>".xlt('OS{{left eye}}')."</td>";
5061 } else {
5062 echo "<td class='GFS_title center'></td><td class='GFS_title center'></td>";
5065 if ($hideme) {
5066 echo '<td><span class="top right" id="toggle_gonios"><i class="fa fa-toggle-down"></i></span></td>';
5069 </tr>
5070 <?php echo $gonios;
5072 $count='0';
5073 $hideme='';
5074 foreach ($priors as $visit) {
5075 if (($visit['ODCUP'] > "")||($visit['OSCUP'] > "")) {
5076 if ($count >0) {
5077 $hideme = "hideme_cups nodisplay";
5080 $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>";
5081 $DISCS_chart .='"1",';
5082 $count++;
5083 } else {
5084 $DISCS_chart .= '"",';
5088 $DISCS_chart = chop($DISCS_chart, ",");
5089 if ($count ==0) {
5090 $cups = "<tr><td colspan='3' class='GFS_td_1' style='text-align:center;'>".xlt('Not documented')."</td></tr>";
5093 <tr>
5094 <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'); ?>:
5095 <?php
5096 if ($hideme) {
5097 $plus = '<td><span class="top right" id="toggle_cups"><i class="fa fa-toggle-down"></i></span></td>';
5100 if ($count > '0') {
5101 echo "<td class='GFS_title center'>".xlt('OD{{right eye}}')."</td><td class='GFS_title center'>".xlt('OS{{left eye}}')."</td>".$plus;
5102 } else {
5103 echo "<td class='GFS_title center'></td><td class='GFS_title center'></td>";
5106 </tr>
5107 <?php echo $cups; ?>
5109 </table>
5110 </div>
5111 <script src="<?php echo $GLOBALS['assets_static_relative'] ?>/Chart.js-2-1-3/dist/Chart.bundle.min.js"></script>
5112 <div style="position:relative;float:right; margin: 0px 5px;text-align:center;width:60%;">
5113 <?php
5114 if ($priors) {
5115 if ($bywhat=='byday') { //$bywhat='byday'
5116 $class_1 = "nodisplay";
5117 $class_2 = "";
5118 } else {
5119 $class_2 = "nodisplay";
5120 $class_1 = "";
5125 <canvas id="canvas_byday" class="<?php echo $class_2; ?>"></canvas>
5126 <canvas id="canvas_byhour" class="<?php echo $class_1; ?>"></canvas>
5128 <button id="dailyData" class="<?php echo $class_1; ?>" style="background: #063f80;"><?php echo xlt('Show IOP by Date'); ?></button>
5129 <button id="hourlyData" class="<?php echo $class_2; ?>" style="background: #063f80;"><?php echo xlt('Show IOP by Time'); ?></button>
5130 <script>
5132 * Below is the Chart.js code to render IOP by day and IOP by time
5135 var visit_date = '<?php echo attr($dated); ?>';
5136 var dateFormat = 'YYYY-MM-DD';
5137 var timeFormat = 'HH tt';
5138 var customTooltips = function(tooltip) {
5139 // Tooltip Element
5140 var tooltipEl = $('#chartjs-tooltip');
5141 if (!tooltipEl[0]) {
5142 $('body').append('<div id="chartjs-tooltip"></div>');
5143 tooltipEl = $('#chartjs-tooltip');
5145 // Hide if no tooltip
5146 if (!tooltip.opacity) {
5147 tooltipEl.css({
5148 opacity: 0.3
5150 $('.chartjs-wrap canvas')
5151 .each(function(index, el) {
5152 $(el).css('cursor', 'default');
5154 return;
5156 $(this._chart.canvas).css('cursor', 'pointer');
5157 // Set caret Position
5158 tooltipEl.removeClass('above below no-transform');
5159 if (tooltip.yAlign) {
5160 tooltipEl.addClass(tooltip.yAlign);
5161 } else {
5162 tooltipEl.addClass('no-transform');
5165 // Set Text
5166 if (tooltip.body) {
5167 var innerHtml = [
5168 (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 || [])
5169 .join('\n'), (tooltip.footer || []).join('\n'), (tooltip.afterFooter || []).join('\n')
5171 tooltipEl.html(innerHtml.join('\n'));
5174 // Find Y Location on page
5175 var top = 0;
5176 if (tooltip.yAlign) {
5177 if (tooltip.yAlign == 'above') {
5178 top = tooltip.y - tooltip.caretHeight - tooltip.caretPadding;
5179 } else {
5180 top = tooltip.y + tooltip.caretHeight + tooltip.caretPadding;
5183 var position = $(this._chart.canvas)[0].getBoundingClientRect();
5184 // Display, position, and set styles for font
5185 tooltipEl.css({
5186 opacity: 0.5,
5187 width: tooltip.width ? (tooltip.width + 'px') : 'auto',
5188 left: position.left + tooltip.x + 'px',
5189 top: position.top + top + 'px',
5190 fontFamily: tooltip._fontFamily,
5191 fontSize: tooltip.fontSize,
5192 fontStyle: tooltip._fontStyle,
5193 padding: tooltip.yPadding + 'px ' + tooltip.xPadding + 'px',
5197 var config_byhour = {
5198 type: 'line',
5199 data: {
5200 labels: [<?php echo $times_OU; ?>],
5201 datasets: [{
5202 label: "OD",
5203 data: [<?php echo $OD_time_values; ?>],
5204 fill: false,
5205 borderColor : "#44a3a7",
5206 backgroundColor : "#44a3a7",
5207 pointBorderColor : "#055d2b",
5208 pointBackgroundColor : "#44a3a7",
5209 pointBorderWidth : 3,
5210 lineTension: 0.3,
5211 borderCapStyle: 'butt',
5212 borderDashOffset: 0.0,
5213 borderJoinStyle: 'miter',
5214 pointHoverRadius: 5,
5215 pointHoverBorderWidth: 2,
5216 pointRadius: 1,
5217 pointHitRadius: 3
5218 }, {
5219 label: 'OS',
5220 data: [<?php echo $OS_time_values; ?>],
5221 fill: false,
5222 lineTension: 3,
5223 borderColor : "#000099",
5224 backgroundColor : "#000099",
5225 pointBorderColor : "black",
5226 pointBackgroundColor : "#000099",
5227 pointBorderWidth : 3,
5228 lineTension: 0.3,
5229 borderCapStyle: 'butt',
5230 borderJoinStyle: 'miter',
5231 pointHoverRadius: 5,
5232 pointHoverBorderWidth: 2,
5233 pointRadius: 1,
5234 pointHitRadius: 3,
5237 options: {
5238 responsive: true,
5239 animation: false,
5240 onAnimationComplete: function () {
5241 // prevents the update from triggering an infinite loop
5242 if (!this.clearCycle) {
5243 this.clearCycle = true;
5245 this.datasets.forEach(function (dataset) {
5246 dataset.points.forEach(function (point) {
5247 if (point.value === 0) {
5248 point.display = false;
5249 point.hasValue = function () {
5250 return false;
5255 this.update();
5257 else
5258 delete this.clearCycle;
5260 scaleShowHorizontalLines: true,
5261 title:{
5262 display:true,
5263 text:'<?php echo xla("Intraocular Pressures") . " (" . xla("mmHg") . ") by Hour"; ?>'
5265 tooltips: {
5266 mode: 'label'
5268 hover: {
5269 mode: 'dataset'
5271 scales: {
5272 xAxes: [{
5273 type: "time",
5274 time: {
5275 format: "HH:mm",
5276 unit: 'hour',
5277 unitStepSize: 2,
5278 displayFormats: {
5279 'minute': 'h:mm a',
5280 'hour': 'h:mm a'
5282 tooltipFormat: 'h:mm a'
5284 scaleLabel: {
5285 display: true,
5286 labelString: 'Time'
5288 ticks: {
5289 suggestedMin: 4,
5290 suggestedMax: 24,
5292 } ],
5293 yAxes: [{
5294 type: "linear",
5295 display: true,
5296 position: "left",
5297 //id: "y-axis-2",
5298 gridLines:{
5299 display: false
5301 labels: {
5302 show:true,
5305 scaleLabel: {
5306 display: true,
5307 labelString: 'IOP (mmHg)'
5309 ticks: {
5310 suggestedMin: 0,
5311 suggestedMax: 24,
5318 $('#dailyData').click(function(event) {
5319 event.preventDefault();
5320 $('#canvas_byday').removeClass('nodisplay');
5321 $('#canvas_byhour').addClass('nodisplay');
5323 $('#dailyData').addClass('nodisplay');
5324 $('#hourlyData').removeClass('nodisplay');
5325 $('#showTesting').addClass('nodisplay');
5327 $('#hourlyData').click(function(event) {
5328 event.preventDefault();
5329 $('#canvas_byhour').removeClass('nodisplay');
5330 $('#canvas_byday').addClass('nodisplay');
5331 $('#dailyData').removeClass('nodisplay');
5332 $('#hourlyData').addClass('nodisplay');
5333 $('#showTesting').removeClass('nodisplay');
5335 var config_byday = {
5336 type: 'bar',
5337 data: {
5338 labels: [<?php echo $dates_OU; ?>],
5339 datasets: [
5341 type: 'line',
5342 label: "Target",
5343 data: [<?php echo $IOPTARGET_values; ?>],
5344 fill: false,
5345 borderColor : "#f28282",
5346 backgroundColor : "#f28282",
5347 pointBorderColor : "black",
5348 pointBackgroundColor : "#f28282",
5349 pointBorderWidth : 3,
5350 drugs: ["test1\ntimoptic","test2","test3"],
5351 yAxisID: 'y-axis-1',
5352 lineTension: 0.3,
5353 borderCapStyle: 'round',
5354 borderDash: [1,5],
5355 borderJoinStyle: 'miter',
5356 pointHoverRadius: 5,
5357 pointHoverBorderWidth: 2,
5358 pointRadius: 1,
5359 pointHitRadius: 3
5360 },{ type: 'line',
5361 label: "OD",
5362 data: [<?php echo $OD_values; ?>],
5363 fill: false,
5364 borderColor : "#44a3a7",
5365 backgroundColor : "#44a3a7",
5366 pointBorderColor : "#055d2b",
5367 pointBackgroundColor : "#44a3a7",
5368 pointBorderWidth : 3,
5369 yAxisID: 'y-axis-1',
5370 lineTension: 0.3,
5371 borderCapStyle: 'butt',
5372 borderDashOffset: 0.0,
5373 borderJoinStyle: 'miter',
5374 pointHoverRadius: 5,
5375 pointHoverBorderWidth: 2,
5376 pointRadius: 1,
5377 pointHitRadius: 3
5378 }, {
5379 type: 'line',
5380 label: 'OS',
5381 data: [<?php echo $OS_values; ?>],
5382 fill: false,
5383 lineTension: 3,
5384 borderColor : "#000099",
5385 backgroundColor : "#000099",
5386 pointBorderColor : "black",
5387 pointBackgroundColor : "#000099",
5388 pointBorderWidth : 3,
5389 yAxisID: 'y-axis-1',
5390 lineTension: 0.3,
5391 borderCapStyle: 'butt',
5392 borderJoinStyle: 'miter',
5393 pointHoverRadius: 5,
5394 pointHoverBorderWidth: 2,
5395 pointRadius: 1,
5396 pointHitRadius: 3,
5398 type: 'bar',
5399 label: "VF",
5400 strokeColor: '#5CABFA',
5401 fillColor:"#5CABFA",
5402 data: [<?php echo $VF_values; ?>],
5403 fill: false,
5404 backgroundColor: '#5CABFA',
5405 borderColor: '#000000',
5406 yAxisID: 'y-axis-2'
5408 type: 'bar',
5409 label: "OCT",
5410 data: [<?php echo $OCT_values; ?>],//0/null is not done, 1 if performed.
5411 fill: true,
5412 backgroundColor: '#71B37C',
5413 borderColor: '#000000',
5414 yAxisID: 'y-axis-2'
5416 type: 'bar',
5417 label: "Gonio",
5418 data: [<?php echo $GONIO_values; ?>],
5419 fill: false,
5420 strokeColor: 'rgba(209, 30, 93, 0.3)',
5421 fillColor:'rgba(209, 30, 93, 0.3)',
5422 backgroundColor: 'red',
5423 borderColor: '#000000',
5424 yAxisID: 'y-axis-2'
5427 options: {
5428 responsive: true,
5429 scaleShowHorizontalLines: true,
5430 title:{
5431 display: true,
5432 text:'<?php echo xla("Intraocular Pressures (mmHg) by Date"); ?>'
5434 tooltips: {
5435 enabled: true,
5436 //id: "tooltip-1",
5437 //backgroundColor: '#FCFFC5',
5438 //mode: 'label',
5439 enabled: true,
5440 shared: false,
5442 callbacks: {
5443 label: function(tooltipItem, data) {
5444 if (tooltipItem.yLabel =='0') {
5445 return data.datasets[tooltipItem.datasetIndex].label + " --- "; ;
5446 } else if (tooltipItem.yLabel =='1') {
5447 return data.datasets[tooltipItem.datasetIndex].label + " <?php echo xlt('performed'); ?>";
5448 } else if (tooltipItem.yLabel > '1') {
5449 return data.datasets[tooltipItem.datasetIndex].label + ": "+tooltipItem.yLabel;
5452 afterBody: function(tooltipItems, data) {
5453 //console.log(tooltipItems);
5454 //return data.datasets[2].drugs[tagme];
5458 hover: {
5459 mode: 'label'
5461 scales: {
5462 xAxes: [{
5463 type: "time",
5464 stacked:false,
5465 id: "x-axis-1",
5466 time: {
5467 format: dateFormat,
5468 round: 'day',
5469 tooltipFormat: 'll'
5471 categoryPercentage: 0.5,
5472 barPercentage:1.0,
5473 //categoryPercentage:0.3,
5474 scaleLabel: {
5475 display: true,
5476 labelString: 'Date'
5478 ticks: {
5479 suggestedMin: 3,
5480 suggestedMax: 6
5482 }, ],
5483 yAxes: [{
5484 type: "linear",
5485 display: false,
5486 position: "right",
5487 id: "y-axis-2",
5488 stacked: false,
5489 gridLines:{
5490 display: false
5492 labels: {
5493 show:true,
5495 scaleLabel: {
5496 display: false,
5497 labelString: 'Testing'
5499 ticks: {
5500 suggestedMin: 4,
5501 suggestedMax: 4
5503 }, {
5504 type: "linear",
5505 display: true,
5506 position: "left",
5507 id: "y-axis-1",
5508 gridLines:{
5509 display: true
5511 labels: {
5512 show:true,
5514 scaleLabel: {
5515 display: true,
5516 labelString: 'IOP (mmHg)'
5518 ticks: {
5519 suggestedMin: 4,
5520 suggestedMax: 24,
5527 var ctx1 = document.getElementById("canvas_byday").getContext("2d");
5528 var ctx2 = document.getElementById("canvas_byhour").getContext("2d");
5530 var myLine = new Chart.Bar(ctx1, config_byday);
5531 var myLine2 = new Chart(ctx2, config_byhour);
5532 </script>
5533 <?php
5534 } else {
5535 echo "<div style='text-align:left;padding-left:20px;'><h4>The Glaucoma Flow Sheet graphically displays:
5536 <ul>
5537 <li> IOP measurements</li>
5538 <li> Target IOPs </li>
5539 <li> related tests (OCT/VF/Gonio)</li>
5540 <li> diurnal IOP curve</li>
5541 </ul>
5542 The graphs are not generated on the initial visit...</h4></div>";
5543 } ?>
5544 </div>
5545 </div>
5546 <?php
5549 # gets the provider from the encounter file , or from the logged on user or from the patient file
5550 function findProvider($pid, $encounter)
5552 $find_provider = sqlQuery("SELECT * FROM form_encounter " .
5553 "WHERE pid = ? AND encounter = ? " .
5554 "ORDER BY id DESC LIMIT 1", array($pid,$encounter));
5555 $providerid = $find_provider['provider_id'];
5556 if ($providerid < '1') {
5557 //find the default providerID from the calendar
5558 $visit_date = date('Y-m-d', strtotime($find_provider['date']));
5559 $query = "select * from openemr_postcalendar_events where pc_pid=? and pc_eventDate=?";
5560 $find_provider3 = sqlQuery($query, array($pid,$visit_date));
5561 $new_providerid = $find_provider3['pc_aid'];
5562 if (($new_providerid < '1')||(!$new_providerid)) {
5563 $get_authorized = $_SESSION['userauthorized'];
5564 if ($get_authorized ==1) {
5565 $find_provider2 = sqlQuery("SELECT providerID FROM patient_data WHERE pid = ? ", array($pid));
5566 $new_providerid = $find_provider2['providerID'];
5570 $providerid = $new_providerid;
5571 sqlStatement("UPDATE form_encounter set provider_id =? WHERE pid = ? AND encounter = ?", array($providerid,$pid,$encounter));
5572 sqlStatement("UPDATE patient_data set providerID =? WHERE pid = ?", array($providerid,$pid));
5575 return $providerid;
5578 function generate_lens_treatments($W, $LTs_present)
5580 ob_start();
5581 $query = "SELECT * FROM list_options where list_id =? and activity='1' ORDER BY seq";
5582 $TXs_data = sqlStatement($query, array("Eye_Lens_Treatments"));
5583 $counter=0;
5584 $TXs_arr = explode("|", $LTs_present);
5585 $tabindex=$W."0144";
5586 while ($row = sqlFetchArray($TXs_data)) {
5587 $checked ='';
5588 $ID=$row['option_id'];
5589 if (in_array($ID, $TXs_arr)) {
5590 $checked = "checked='yes'";
5593 echo "<input type='checkbox' id='TXs_".$W."_".$counter."' name='LENS_TREATMENTS_".$W."[]' $checked value='".attr($ID)."' tabindex='$tabindex'> ";
5594 $label = text(substr($row['title'], 0, 30));
5595 echo "<label for='TXs_".$W."_".$counter."' class='input-helper input-helper--checkbox' title='".attr($row['notes'])."'>";
5596 echo $label."</label><br />";
5597 $counter++;
5598 $tabindex++;
5601 $output = ob_get_contents();
5602 ob_end_clean();
5603 return $output;
5607 * Function to display the fields for a currently worn glasses/spectacle Rx.
5608 * @param $W - the Rx number, in order of documentation
5610 function generate_specRx($W)
5612 global $pid,$form_id,$encounter,$display_W_width;
5614 $query = "select * from form_eye_mag_wearing where PID=? and FORM_ID=? and ENCOUNTER=? and RX_NUMBER =?";
5615 $wear = sqlQuery($query, array($pid,$form_id,$encounter,$W));
5616 if ($wear) {
5617 $RX_VALUE='1';
5618 @extract($wear);
5619 } else {
5620 $RX_VALUE='';
5621 $display_W='nodisplay';
5624 ob_start();
5626 <input type="hidden" id="W_<?php echo attr($W); ?>" name="W_<?php echo attr($W); ?>" value="<?php echo attr($RX_VALUE); ?>">
5628 <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; ?>">
5629 <i class="closeButton fa fa-close" id="Close_W_<?php echo attr($W); ?>" name="Close_W_<?php echo attr($W); ?>"
5630 title="<?php echo xla('Close this panel and delete this Rx'); ?>"></i>
5631 <i class="closeButton2 fa fa-arrows-h " id="W_width_display_<?php echo attr($W); ?>" name="W_width_display"
5632 title="<?php echo xla("Rx Details"); ?>" ></i>
5633 <i onclick="top.restoreSession(); doscript('W','<?php echo attr($pid); ?>','<?php echo attr($encounter); ?>','<?php echo attr($W); ?>'); return false;"
5634 title="<?php echo xla("Dispense Rx"); ?>" class="closeButton3 fa fa-print"></i>
5635 <i onclick="top.restoreSession(); dispensed('<?php echo attr($pid); ?>');return false;"
5636 title="<?php echo xla("List of previously dispensed Spectacle and Contact Lens Rxs"); ?>" class="closeButton4 fa fa-list-ul"></i>
5637 <table id="wearing_<?php echo attr($W); ?>" >
5638 <tr>
5639 <th colspan="7"><?php echo xlt('Current Glasses'); ?>: #<?php echo attr($W); ?>
5640 </th>
5641 </tr>
5642 <tr>
5643 <td></td>
5644 <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>
5645 <td><?php echo xlt('Sph{{Sphere}}'); ?></td>
5646 <td><?php echo xlt('Cyl{{Cylinder}}'); ?></td>
5647 <td><?php echo xlt('Axis{{Axis of a glasses prescription}}'); ?></td>
5648 <td><?php echo xlt('Acuity'); ?></td>
5649 <td name="W_wide"></td>
5650 <td name="W_wide" title="<?php echo xla('Horizontal Prism Power'); ?>"><?php echo xlt('HP{{abbreviation for Horizontal Prism Power}}'); ?></td>
5651 <td name="W_wide" title="<?php echo xla('Horizontal Prism Base'); ?>"><?php echo xlt('HB{{abbreviation for Horizontal Prism Base}}'); ?></td>
5652 <td name="W_wide" title="<?php echo xla('Vertical Prism Power'); ?>"><?php echo xlt('VP{{abbreviation for Vertical Prism Power}}'); ?></td>
5653 <td name="W_wide" title="<?php echo xla('Vertical Prism Base'); ?>"><?php echo xlt('VB{{abbreviation for Vertical Prism Base}}'); ?></td>
5654 <td name="W_wide" title="<?php echo xla('Slab Off'); ?>"><?php echo xlt('Slab Off'); ?></td>
5655 <td name="W_wide" title="<?php echo xla('Vertex Distance'); ?>"><?php echo xlt('VD{{abbreviation for Vertex Distance}}'); ?></td>
5656 <td name="W_wide" title="<?php echo xla('Monocular Pupillary Diameter - Distance'); ?>"><?php echo xlt('MPD-D{{abbreviation for Monocular Pupillary Diameter - Distance}}'); ?></td>
5657 <td name="W_wide" title="<?php echo xla('Monocular Pupillary Diameter - Near'); ?>"><?php echo xlt('MPD-N{{abbreviation for Monocular Pupillary Diameter - Near}}'); ?></td>
5659 <td rowspan="6" class="right">
5660 <?php echo xlt('Rx Type{{Type of glasses prescription}}'); ?></span><br />
5661 <label for="Single_<?php echo attr($W); ?>" class="input-helper input-helper--checkbox"><?php echo xlt('Single'); ?></label>
5662 <input type="radio" value="0" id="Single_<?php echo attr($W); ?>" name="RX_TYPE_<?php echo attr($W); ?>" <?php
5663 if ($RX_TYPE == '0') {
5664 echo 'checked="checked"';
5665 } ?> /></span><br /><br />
5666 <label for="Bifocal_<?php echo attr($W); ?>" class="input-helper input-helper--checkbox"><?php echo xlt('Bifocal'); ?></label>
5667 <input type="radio" value="1" id="Bifocal_<?php echo attr($W); ?>" name="RX_TYPE_<?php echo attr($W); ?>" <?php
5668 if ($RX_TYPE == '1') {
5669 echo 'checked="checked"';
5670 } ?> /></span><br /><br />
5671 <label for="Trifocal_<?php echo attr($W); ?>" class="input-helper input-helper--checkbox"><?php echo xlt('Trifocal'); ?></label>
5672 <input type="radio" value="2" id="Trifocal_<?php echo attr($W); ?>" name="RX_TYPE_<?php echo attr($W); ?>" <?php
5673 if ($RX_TYPE == '2') {
5674 echo 'checked="checked"';
5675 } ?> /></span><br /><br />
5676 <label for="Progressive_<?php echo attr($W); ?>" class="input-helper input-helper--checkbox"><?php echo xlt('Prog.{{Progressive lenses}}'); ?></label>
5677 <input type="radio" value="3" id="Progressive_<?php echo attr($W); ?>" name="RX_TYPE_<?php echo attr($W); ?>" <?php
5678 if ($RX_TYPE == '3') {
5679 echo 'checked="checked"';
5680 } ?> /></span><br />
5681 </td>
5682 </tr>
5683 <tr>
5684 <td rowspan="2"><?php echo xlt('Dist{{distance}}'); ?></td>
5685 <td><b><?php echo xlt('OD{{right eye}}'); ?>:</b></td>
5686 <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>
5687 <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>
5688 <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>
5689 <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>
5691 <td name="W_wide"></td>
5692 <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>
5693 <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>
5694 <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>
5695 <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>
5696 <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>
5697 <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>
5698 <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>
5699 <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>
5700 </tr>
5701 <tr>
5702 <td><b><?php echo xlt('OS{{left eye}}'); ?>:</b></td>
5703 <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>
5704 <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>
5705 <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>
5706 <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>
5708 <td name="W_wide"></td>
5709 <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>
5710 <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>
5711 <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>
5712 <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>
5713 <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>
5714 <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>
5715 <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>
5716 <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>
5717 </tr>
5718 <tr class="WNEAR">
5719 <td rowspan=2><?php echo xlt('Mid{{middle Rx strength}}'); ?>/<br /><?php echo xlt('Near'); ?></td>
5720 <td><b><?php echo xlt('OD{{right eye}}'); ?>:</b></td>
5721 <?php echo '<input type="hidden" name="RXStart_'.$W.' id="RXStart_'.$W.'" value="'.attr($RX_TYPE).'">'; ?>
5722 <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>
5723 <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>
5724 <td></td>
5725 <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>
5727 <td name="W_wide"></td>
5729 <td name="W_wide" title="<?php echo xla('Binocular Pupillary Diameter - Distance'); ?>"><?php echo xlt('PD-D{{abbreviation for Binocular Pupillary Diameter - Distance}}'); ?></td>
5730 <td name="W_wide" title="<?php echo xla('Binocular Pupillary Diameter - Near'); ?>"><?php echo xlt('PD-N{{abbreviation for Binocular Pupillary Diameter - Near}}'); ?></td>
5731 <td name="W_wide" title="<?php echo xla('Lens Material'); ?>" colspan="2">
5732 <a href="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_list.php?list_id=Eye_Lens_Material" target="RTop"
5733 title="<?php echo xla('Click here to edit list of available Lens Materials'); ?>"
5734 name="Lens_mat"><span class="underline"><?php echo xlt('Lens Material'); ?></span> <i class="fa fa-pencil fa-fw"></i> </a>
5735 </td>
5736 <td name="W_wide2" colspan="4" rowspan="4">
5737 <a href="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_list.php?list_id=Eye_Lens_Treatments" target="RTop"
5738 title="<?php echo xla('Click here to edit list of available Lens Treatment Options'); ?>"
5739 name="Lens_txs"><span class="underline"><?php echo xlt('Lens Treatments'); ?></span> <i class="fa fa-pencil fa-fw"></i> </a>
5740 <br />
5741 <?php echo generate_lens_treatments($W, $LENS_TREATMENTS); ?>
5742 </td>
5743 </tr>
5744 <tr class="WNEAR">
5745 <td><b><?php echo xlt('OS{{left eye}}'); ?>:</b></td>
5746 <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>
5747 <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>
5748 <td></td>
5749 <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>
5751 <td name="W_wide"></td>
5753 <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>
5754 <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>
5755 <td name="W_wide" title="<?php echo xla('Lens Material Options'); ?>" colspan="2">
5756 <?php echo generate_select_list("LENS_MATERIAL_".$W, "Eye_Lens_Material", "$LENS_MATERIAL", '', ' ', '', 'restoreSession;submit_form();', '', array('style'=>'width:120px','tabindex'=>$W.'0130')); ?>
5757 </td>
5758 </tr>
5759 <tr>
5760 <td colspan="2"><b><?php echo xlt('Comments'); ?>:</b>
5761 </td>
5762 <td colspan="4" class="up"></td>
5763 </tr>
5764 <tr>
5765 <td colspan="6">
5766 <textarea id="COMMENTS_<?php echo attr($W); ?>" name="COMMENTS_W" tabindex="<?php echo attr($W); ?>0110"><?php echo text($COMMENTS); ?></textarea>
5767 </td>
5768 <td colspan="2">
5769 </td>
5770 </tr>
5771 </table>
5772 </div>
5773 <?php
5774 $output = ob_get_contents();
5775 ob_end_clean();
5776 return $output;