4 * forms/eye_mag/report.php
6 * Central report form for the eye_mag form. Here is where all new data for display
7 * is created. New reports are created via new.php and then this script is displayed.
8 * Edit are performed in view.php. Nothing is editable here, but it is scrollable
11 * Copyright (C) 2016 Raymond Magauran <magauran@MedFetch.com>
13 * LICENSE: This program is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU Affero General Public License as
15 * published by the Free Software Foundation, either version 3 of the
16 * License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Affero General Public License for more details.
23 * You should have received a copy of the GNU Affero General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
27 * @author Ray Magauran <magauran@MedFetch.com>
28 * @link http://www.open-emr.org
30 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
31 * The HTML5 Sketch plugin stuff:
32 * Copyright (C) 2011 by Michael Bleigh and Intridea, Inc.
34 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
35 * and associated documentation files (the "Software"), to deal in the Software without restriction,
36 * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
37 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
38 * subject to the following conditions:
40 * The above copyright notice and this permission notice shall be included in all copies or substantial
41 * portions of the Software.
42 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
45 $fake_register_globals=false;
46 $sanitize_all_escapes=true;
48 require_once("../../globals.php");
49 require_once(dirname(__FILE__
) ."/../../../library/acl.inc");
50 require_once(dirname(__FILE__
) ."/../../../library/api.inc");
51 require_once(dirname(__FILE__
) ."/../../../library/formatting.inc.php");
52 require_once(dirname(__FILE__
) ."/../../../library/lists.inc");
53 require_once(dirname(__FILE__
) ."/../../../library/forms.inc");
54 require_once(dirname(__FILE__
) ."/../../../library/patient.inc");
56 $form_name = "eye_mag";
57 $form_folder = "eye_mag";
59 require_once("../../forms/".$form_folder."/php/".$form_folder."_functions.php");
61 if ($_REQUEST['CHOICE']) $choice = $_REQUEST['choice'];
63 if ($_REQUEST['ptid']) $pid = $_REQUEST['ptid'];
64 if ($_REQUEST['encid']) $encounter=$_REQUEST['encid'];
65 if ($_REQUEST['formid']) $form_id = $_REQUEST['formid'];
66 if ($_REQUEST['formname']) $form_name=$_REQUEST['formname'];
67 if (!$id) $id=$form_id;
68 // Get users preferences, for this user
69 // (and if not the default where a fresh install begins from, or someone else's)
70 $query = "SELECT * FROM form_eye_mag_prefs where PEZONE='PREFS' AND id=? ORDER BY ZONE_ORDER,ordering";
71 $result = sqlStatement($query,array($_SESSION['authUserID']));
72 while ($prefs= sqlFetchArray($result)) {
73 $LOCATION = $prefs['LOCATION'];
74 $
$LOCATION = text($prefs['GOVALUE']);
77 function eye_mag_report($pid, $encounter, $cols, $id, $formname='eye_mag') {
82 /** openEMR note: eye_mag Index is id,
83 * linked to encounter in form_encounter
84 * whose encounter is linked to id in forms.
87 $query="select form_encounter.date as encounter_date,form_eye_mag.*
88 from form_eye_mag ,forms,form_encounter
90 form_encounter.encounter =? and
91 form_encounter.encounter = forms.encounter and
92 form_eye_mag.id=forms.form_id and
93 forms.pid =form_eye_mag.pid and
95 $objQuery =sqlQuery($query,array($encounter,$pid));
98 $dated = new DateTime($encounter_date);
99 $dated = $dated->format('Y/m/d');
102 $visit_date = oeFormatShortDate($dated);
105 * Patient/Client -> Visits -> Visit History, on mouse over this is called with variable "choice".
106 * To use this feature, this "choice" variable must be added programmatically to
107 * /interface/patient_file/history/encounters_ajax.php, currently line 20.
108 * The variable $choice will tell us what to display.
109 * If it is not present it will display everything == 'narrative'.
110 * @param string $choice options NULL,TEXT,DRAW,NARRATIVE
111 * @param string $encounter = encounter number
112 * @param string $pid value = patient id
113 * @return string => returns the HTML of the report selected
116 if ($choice == 'DRAW') {
119 $zone = array("HPI","PMH","VISION","NEURO","EXT","ANTSEG","RETINA","IMPPLAN");
120 // for ($i = 0; $i < count($zone); ++$i) {
121 // show only 2 for now in the encounter page
122 ($choice =='drawing') ? ($count = count($zone)) : ($count ='2');
123 for ($i = 0; $i < $count; ++$i) {
124 $file_location = $GLOBALS["OE_SITES_BASE"]."/".$_SESSION['site_id']."/documents/".$pid."/".$form_folder."/".$encounter."/".$side."_".$zone[$i]."_VIEW.png";
125 $sql = "SELECT * from documents where url='file://".$file_location."'";
126 $doc = sqlQuery($sql);
127 if (file_exists($file_location) && ($doc['id'] > '0')) {
128 $filetoshow = $GLOBALS['web_root']."/controller.php?document&retrieve&patient_id=$pid&document_id=$doc[id]&as_file=false";
129 ?><div style='position:relative;float:left;width:100px;height:75px;'>
130 <img src='<?php echo $filetoshow; ?>' width=100 heght=75>
133 // $filetoshow = "../../forms/".$form_folder."/images/".$side."_".$zone[$i]."_BASE.png?".rand();
139 } else if ($choice == "drawing") {
142 <div
class="borderShadow">
143 <?php
display_draw_section ("VISION",$encounter,$pid); ?
>
145 <div
class="borderShadow">
146 <?php
display_draw_section ("NEURO",$encounter,$pid); ?
>
148 <div
class="borderShadow">
149 <?php
display_draw_section ("EXT",$encounter,$pid); ?
>
151 <div
class="borderShadow">
152 <?php
display_draw_section ("ANTSEG",$encounter,$pid); ?
>
154 <div
class="borderShadow">
155 <?php
display_draw_section ("RETINA",$encounter,$pid); ?
>
157 <div
class="borderShadow">
158 <?php
display_draw_section ("IMPPLAN",$encounter,$pid); ?
>
161 } else if ($choice == 'TEXT') {
162 //just display HPI and A/P
163 narrative($pid, $encounter, $cols, $id,'TEXT');
165 } else if ($choice !="narrative") {
166 narrative($pid, $encounter, $cols, $id,'narrative');
170 function left_overs() {
172 * Keep: this could be co-opted to export an XML/HL7 type of document
175 $data = formFetch($table_name, $id);
178 foreach($data as $key => $value) {
185 * This is the core report, including Practice logo, patient ID/header.
186 * It relies on the presence of the PMSFH,IMPPLAN arrays.
187 * Rest of fields are pulled from the DB.
189 function narrative($pid, $encounter, $cols, $form_id,$choice='full') {
196 //if $cols == 'Fax', we are here from taskman, making a fax and this a one page short form - leave out PMSFH, prescriptions
197 //and any clinical area that is blank.
198 $query="select form_encounter.date as encounter_date,form_eye_mag.id as form_id,form_encounter.*, form_eye_mag.*
199 from form_eye_mag ,forms,form_encounter
201 form_encounter.encounter =? and
202 form_encounter.encounter = forms.encounter and
203 form_eye_mag.id=forms.form_id and
204 forms.deleted != '1' and
205 form_eye_mag.pid=? ";
207 $encounter_data =sqlQuery($query,array($encounter,$pid));
208 @extract
($encounter_data);
209 $providerID = getProviderIdOfEncounter($encounter);
210 $providerNAME = getProviderName($providerID);
211 $dated = new DateTime($encounter_date);
212 $dated = $dated->format('Y/m/d');
213 $visit_date = oeFormatShortDate($dated);
216 <link rel
="stylesheet" href
="<?php echo attr($css_header);?>" type
="text/css">
217 <link rel
="stylesheet" href
="../../forms/<?php echo attr($form_folder); ?>/css/report.css" type
="text/css">
220 <?php
if ($PDF_OUTPUT) { ?
>
237 if (($cols =='Fax')||
($cols=='Report')) echo report_header($pid,'PDF');
239 $titleres = getPatientData($pid, "fname,lname,providerID,DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
240 if ($_SESSION['pc_facility']) {
241 $sql = "select * from facility where id=" . $_SESSION['pc_facility'];
243 $sql = "SELECT * FROM facility ORDER BY billing_location DESC LIMIT 1";
245 $facility = sqlQuery($sql);
248 if ($choice !== 'TEXT') { ?
>
252 <table
class="report_exam_group">
254 <td style
="text-align:left;padding:1px;vertical-align:top;max-width:720px;">
255 <table style
="padding:5px;width:700px;">
257 <td colspan
="1" style
="text-align: justify;text-justify: inter-word;width:100%;">
258 <b
><?php
echo xlt('Chief Complaint'); ?
>:</b
>  
;<?php
echo text($CC1); ?
>
260 <b
><?php
echo xlt('HPI'); ?
>:</b
>
261  
;<?php
echo $HPI1; ?
>
263 <div style
="padding-left:20px;">
266 echo "<i>".xlt('Timing'); ?
>:</i
>  
;<?php
echo text($TIMING1)."<br />";
269 echo "<i>".xlt('Context'); ?
>:</i
>  
;<?php
echo text($CONTEXT1)."<br />";
272 echo "<i>".xlt('Severity'); ?
>:</i
>  
;<?php
echo text($SEVERITY1)."<br />";
275 echo "<i>".xlt('Modifying'); ?
>:</i
>  
;<?php
echo text($MODIFY1)."<br />";
278 echo "<i>".xlt('Associated'); ?
>:</i
>  
;<?php
echo text($ASSOCIATED1)."<br />";
281 echo "<i>".xlt('Location'); ?
>:</i
>  
;<?php
echo text($LOCATION1)."<br />";
284 echo "<i>".xlt('Quality'); ?
>:</i
>  
;<?php
echo text($QUALITY1)."<br />";
287 echo "<i>".xlt('Duration'); ?
>:</i
>  
;<?php
echo text($DURATION1)."<br />";
295 echo "<b>".xlt('Chief Complaint 2'); ?
>:</b
>  
;<?php
echo text($CC2); ?
>
297 <b
><?php
echo xlt('HPI'); ?
>:</b
>
298  
;<?php
echo text($HPI2); ?
>
301 <div style
="padding-left:10px;">
304 echo "<i>".xlt('Timing'); ?
>:</i
>  
;<?php
echo text($TIMING2)."<br />";
307 echo "<i>".xlt('Context'); ?
>:</i
>  
;<?php
echo text($CONTEXT2)."<br />";
310 echo "<i>".xlt('Severity'); ?
>:</i
>  
;<?php
echo text($SEVERITY2)."<br />";
313 echo "<i>".xlt('Modifying'); ?
>:</i
>  
;<?php
echo text($MODIFY2)."<br />";
316 echo "<i>".xlt('Associated'); ?
>:</i
>  
;<?php
echo text($ASSOCIATED2)."<br />";
319 echo "<i>".xlt('Location'); ?
>:</i
>  
;<?php
echo text($LOCATION2)."<br />";
322 echo "<i>".xlt('Quality'); ?
>:</i
>  
;<?php
echo text($QUALITY2)."<br />";
325 echo "<i>".xlt('Duration'); ?
>:</i
>  
;<?php
echo text($DURATION2)."<br />";
335 <?php
echo "<b>".xlt('Chief Complaint 3'); ?
>:</b
>  
;<?php
echo text($CC3); ?
>
337 <?php
echo xlt('HPI'); ?
> 
; <?php
echo text($HPI3); ?
>
339 <div style
="padding-left:10px;">
342 echo "<i>".xlt('Timing'); ?
>:</i
>  
;<?php
echo text($TIMING3)."<br />";
345 echo "<i>".xlt('Context'); ?
>:</i
>  
;<?php
echo text($CONTEXT3)."<br />";
348 echo "<i>".xlt('Severity'); ?
>:</i
>  
;<?php
echo text($SEVERITY3)."<br />";
351 echo "<i>".xlt('Modifying'); ?
>:</i
>  
;<?php
echo text($MODIFY3)."<br />";
354 echo "<i>".xlt('Associated'); ?
>:</i
>  
;<?php
echo text($ASSOCIATED3)."<br />";
357 echo "<i>".xlt('Location'); ?
>:</i
>  
;<?php
echo text($LOCATION3)."<br />";
360 echo "<i>".xlt('Quality'); ?
>:</i
>  
;<?php
echo text($QUALITY3)."<br />";
363 echo "<i>".xlt('Duration'); ?
>:</i
>  
;<?php
echo text($DURATION3)."<br />";
373 if (($CHRONIC1)&&($cols != 'Fax')) { ?
>
374 <b
><?php
echo xlt('Chronic or Inactive Problems'); ?
>:</b
> <br
/>
375  
;<?php
echo text($CHRONIC1)."<br />";
376 if ($CHRONIC2) echo " ".$CHRONIC2."<br />";
377 if ($CHRONIC3) echo " ".$CHRONIC3."<br />";
384 <td style
="width:220px;padding:1px;vertical-align:top;">
387 //no idea if this works for couchDB people
388 $sql = "SELECT * FROM documents,categories,categories_to_documents WHERE
389 documents.id=categories_to_documents.document_id and
390 categories.id=categories_to_documents.category_id and
391 categories.name='Patient Photograph' and
392 documents.foreign_id=?";
393 $doc = sqlQuery($sql,array($pid));
394 $document_id =$doc['document_id'];
395 if (is_numeric($document_id)) {
397 $d = new Document($document_id);
398 $fname = basename($d->get_url());
399 $couch_docid = $d->get_couch_docid();
400 $couch_revid = $d->get_couch_revid();
401 $url_file = $d->get_url_filepath();
402 if($couch_docid && $couch_revid){
403 $url_file = $d->get_couch_url($pid,$encounter);
405 // Collect filename and path
406 $from_all = explode("/",$url_file);
407 $from_filename = array_pop($from_all);
408 $from_pathname_array = array();
409 for ($i=0;$i<$d->get_path_depth();$i++
) {
410 $from_pathname_array[] = array_pop($from_all);
412 $from_pathname_array = array_reverse($from_pathname_array);
413 $from_pathname = implode("/",$from_pathname_array);
414 if($couch_docid && $couch_revid) {
415 $from_file = $GLOBALS['OE_SITE_DIR'] . '/documents/temp/' . $from_filename;
418 $from_file = $GLOBALS["fileroot"] . "/sites/" . $_SESSION['site_id'] .
419 '/documents/' . $from_pathname . '/' . $from_filename;
422 echo "<img src='". $from_file."' style='width:220px;'>";
424 $filetoshow = $GLOBALS['webroot']."/controller.php?document&retrieve&patient_id=$pid&document_id=".$doc['document_id']."&as_file=false&blahblah=".rand();
425 echo "<img src='".$filetoshow."' style='width:220px;'>";
433 if ($choice !== 'TEXT') {
434 //exclude all of this from displaying on the summary mouseover by default
436 <hr style
="width:50%;text-align:center;" />
437 <table style
="margin:1 auto;" class="report_exam_group">
439 <td style
="width:680px;text-align:center;margin:1 auto;">
441 $PMSFH = build_PMSFH($pid);
442 if ($cols !='Fax') show_PMSFH_report($PMSFH);
445 $query = "select * from form_eye_mag_wearing where PID=? and FORM_ID=? and ENCOUNTER=? ORDER BY RX_NUMBER";
446 $wear = sqlStatement($query,array($pid,$form_id,$encounter));
447 while ($wearing = sqlFetchArray($wear)) {
449 $
{"display_W_$count_rx"} = '';
450 $
{"ODSPH_$count_rx"} = $wearing['ODSPH'];
451 $
{"ODCYL_$count_rx"} = $wearing['ODCYL'];
452 $
{"ODAXIS_$count_rx"} = $wearing['ODAXIS'];
453 $
{"OSSPH_$count_rx"} = $wearing['OSSPH'];
454 $
{"OSCYL_$count_rx"} = $wearing['OSCYL'];
455 $
{"OSAXIS_$count_rx"} = $wearing['OSAXIS'];
456 $
{"ODMIDADD_$count_rx"} = $wearing['ODMIDADD'];
457 $
{"OSMIDADD_$count_rx"} = $wearing['OSMIDADD'];
458 $
{"ODADD_$count_rx"} = $wearing['ODADD'];
459 $
{"OSADD_$count_rx"} = $wearing['OSADD'];
460 $
{"ODVA_$count_rx"} = $wearing['ODVA'];
461 $
{"OSVA_$count_rx"} = $wearing['OSVA'];
462 $
{"ODNEARVA_$count_rx"} = $wearing['ODNEARVA'];
463 $
{"OSNEARVA_$count_rx"} = $wearing['OSNEARVA'];
464 $
{"ODPRISM_$count_rx"} = $wearing['ODPRISM'];
465 $
{"OSPRISM_$count_rx"} = $wearing['OSPRISM'];
466 $
{"COMMENTS_$count_rx"} = $wearing['COMMENTS'];
467 $
{"W_$count_rx"} = '1';
468 $
{"RX_TYPE_$count_rx"} = $wearing['RX_TYPE'];
475 <table
class="borderShadow" >
476 <tr style
="font-size:10px;">
477 <!-- Start of the Vision box
-->
478 <td
class="report_vitals">
479 <b
class="underline"><?php
echo xlt('Visual Acuities'); ?
></b
>
480 <table id
="Additional_VA" cellspacing
="2" style
="text-align:center;font-size:1.0em;">
481 <tr style
="font-weight:bold;">
482 <td style
="text-align:center;"></td
>
483 <td style
="width:50px;text-align:center;text-decoration:underline;"><?php
echo xlt('OD'); ?
></td
>
484 <td style
="width:50px;text-align:center;text-decoration:underline;"><?php
echo xlt('OS'); ?
></td
>
486 <?php
if ($SCODVA||
$SCOSVA) { ?
>
488 <td
><?php
echo xlt('sc{{without correction}}'); ?
></td
>
489 <td
><?php
echo text($SCODVA); ?
></td
>
490 <td
><?php
echo text($SCOSVA); ?
></td
>
492 <?php
} if ($ODVA_1||
$OSVA_1) { ?
>
494 <td
><?php
echo xlt('cc{{with correction}}'); ?
></td
>
495 <td
><?php
echo text($ODVA_1); ?
></td
>
496 <td
><?php
echo text($OSVA_1); ?
></td
>
498 <?php
} if ($ARODVA||
$AROSVA) { ?
>
500 <td
><?php
echo xlt('AR{{autorefraction}}'); ?
></td
>
501 <td
><?php
echo text($ARODVA); ?
></td
>
502 <td
><?php
echo text($AROSVA); ?
></td
>
504 <?php
} if ($MRODVA||
$MROSVA) { ?
>
506 <td
><?php
echo xlt('MR{{Manifest Refraction}}'); ?
></td
>
507 <td
><?php
echo text($MRODVA); ?
></td
>
508 <td
><?php
echo text($MROSVA); ?
></td
>
510 <?php
} if ($CRODVA||
$CROSVA) { ?
>
512 <td
><?php
echo xlt('CR{{Cycloplegic Refraction}}'); ?
></td
>
513 <td
><?php
echo text($CRODVA); ?
></td
>
514 <td
><?php
echo text($CROSVA); ?
></td
>
516 <?php
} if ($PHODVA||
$PHOSVA) { ?
>
518 <td
><?php
echo xlt('PH{{Pinhole Vision}}'); ?
></td
>
519 <td
><?php
echo text($PHODVA); ?
></td
>
520 <td
><?php
echo text($PHOSVA); ?
></td
>
522 <?php
} if ($CTLODVA||
$CTLOSVA) { ?
>
524 <td
><?php
echo xlt('CTL{{Contact Lens Vision}}'); ?
></td
>
525 <td
><?php
echo text($CTLODVA); ?
></td
>
526 <td
><?php
echo text($CTLOSVA); ?
></td
>
528 <?php
} if ($SCNEARODVA||
$SCNEAROSVA) { ?
>
530 <td
><?php
echo xlt('scNear{{without correction near}}'); ?
></td
>
531 <td
><?php
echo text($SCNEARODVA); ?
></td
>
532 <td
><?php
echo text($SCNEAROSVA); ?
></td
>
534 <?php
} if ($ODNEARVA_1||
$WNEAROSVA_1) { ?
>
536 <td
><?php
echo xlt('ccNear{{with correction at near}}'); ?
></td
>
537 <td
><?php
echo text($ODNEARVA_1); ?
></td
>
538 <td
><?php
echo text($OSNEARVA_1); ?
></td
>
540 <?php
} if ($ARNEARODVA||
$ARNEAROSVA) { ?
>
542 <td
><?php
echo xlt('ARNear{{Auto-refraction near acuity}}'); ?
></td
>
543 <td
><?php
echo text($ARNEARODVA); ?
></td
>
544 <td
><?php
echo text($ARNEAROSVA); ?
></td
>
546 <?php
} if ($MRNEARODVA||
$MRNEAROSVA) { ?
>
548 <td
><?php
echo xlt('MRNear{{Manifest Near Acuity}}'); ?
></td
>
549 <td
><?php
echo text($MRNEARODVA); ?
></td
>
550 <td
><?php
echo text($MRNEAROSVA); ?
></td
>
552 <?php
} if ($PAMODVA||
$PAMOSVA) { ?
>
554 <td
><?php
echo xlt('PAM{{Potential Acuity Meter}}'); ?
></td
>
555 <td
><?php
echo text($PAMODVA); ?
></td
>
556 <td
><?php
echo text($PAMOSVA); ?
></td
>
558 <?php
} if ($GLAREODVA||
$GLAREOSVA) { ?
>
560 <td
><?php
echo xlt('Glare{{Acuity under Glare conditions}}'); ?
></td
>
561 <td
><?php
echo text($GLAREODVA); ?
></td
>
562 <td
><?php
echo text($GLAREOSVA); ?
></td
>
564 <?php
} if ($CONTRASTODVA||
$CONTRASTOSVA) { ?
>
566 <td
><?php
echo xlt('Contrast{{Constrast Visual Acuity}}'); ?
></td
>
567 <td
><?php
echo text($CONTRASTODVA); ?
></td
>
568 <td
><?php
echo text($CONTRASTOSVA); ?
></td
>
573 <!-- START OF THE PRESSURE BOX
-->
574 <td
class="report_vitals">
575 <b
class="underline"><?php
echo xlt('Intraocular Pressures'); ?
></b
>
576 <table cellspacing
="2" style
="margin:2;text-align:center;font-size:1.0em;">
577 <tr style
="font-weight:bold;">
578 <td style
="text-align:center;"></td
>
579 <td style
="text-align:center;text-decoration:underline;"><?php
echo xlt('OD'); ?
></td
>
580 <td style
="text-align:center;text-decoration:underline;"><?php
echo xlt('OS'); ?
></td
>
583 if ($ODIOPAP||
$OSIOPAP) echo "<tr><td style='text-align:right;padding-right:10px;'>".xlt('App{{Applanation abbreviation}}').":</td><td style='text-align:center;'>".text($ODIOPAP)."</td><td style='width:75px;text-align:center;'>".text($OSIOPAP)."</td></tr>";
584 if ($ODIOPTPN||
$OSIOPTPN) echo "<tr><td style='text-align:right;padding-right:10px;'>".xlt('Tpn{{Tonopen abbreviation}}').":</td><td style='text-align:center;'>".text($ODIOPTPN)."</td><td style='width:75px;text-align:center;'>".text($OSIOPTPN)."</td></tr>";
585 if ($ODIOPFTN||
$OSIOPFTN) echo "<tr><td style='text-align:right;padding-right:10px;'>".xlt('FTN{{Finger Tension abbreviation}}').":</td><td style='text-align:center;'>".text($ODIOPFTN)."</td><td style='width:75px;text-align:center;'>".text($OSIOPFTN)."</td></tr>";
588 <td colspan
="3" style
="text-align:center;">
589 @ <?php
echo text($IOPTIME); ?
>
594 <!-- START OF THE FIELDS BOX
-->
596 // if the VF zone is checked, display it
597 // if ODVF1 = 1 (true boolean) the value="0" checked="true"
598 for ($z=1; $z <5; $z++
) {
600 if ($
$ODzone =='1') {
601 $ODVF[$z] = '<i class="fa fa-square fa-5">X</i>';
602 if ($PDF_OUTPUT) $ODVF[$z] = 'X';
605 $ODVF[$z] = '<i class="fa fa-square-o fa-5"></i>';
606 if ($PDF_OUTPUT) $ODVF[$z] = 'O';
610 if ($
$OSzone =="1") {
611 $OSVF[$z] = '<i class="fa fa-square fa-5">X</i>';
612 if ($PDF_OUTPUT) $OSVF[$z] = 'X';
615 $OSVF[$z] = '<i class="fa fa-square-o fa-5"></i>';
616 if ($PDF_OUTPUT) $OSVF[$z] = 'O';
622 if ($bad < '1' ) { ?
>
623 <td
class="report_vitals">
624 <b
class="underline"><?php
echo xlt('Fields{{visual fields}}'); ?
></b
>
626 echo "<br /><br /> Full to CF OU <br /><br /><br />";
629 <td
class="report_vitals">
630 <b
class="underline"><?php
echo xlt('Fields{{visual fields}}'); ?
></b
>
631 <table style
="font-size:1.0em;text-align:center;">
632 <tr style
="font-weight:bold;">
633 <td style
="width:0.5in;text-align:center;text-decoration:underline;" colspan
="2"><b
><?php
echo xlt('OD'); ?
></b
>
637 <td style
="width:0.1in;"> </td
>
638 <td style
="width:0.5in;text-align:center;text-decoration:underline;" colspan
="2"><b
><?php
echo xlt('OS'); ?
></b
>
644 <td style
="border-right:1pt solid black;border-bottom:1pt solid black;text-align:center;">
645 <?php
echo $ODVF['1']; ?
>
647 <td style
="border-left:1pt solid black;border-bottom:1pt solid black;text-align:center;">
648 <?php
echo $ODVF['2']; ?
>
651 <td style
="border-right:1pt solid black;border-bottom:1pt solid black;text-align:center;">
652 <?php
echo $OSVF['1']; ?
>
654 <td style
="border-left:1pt solid black;border-bottom:1pt solid black;text-align:center;">
655 <?php
echo $OSVF['2']; ?
>
659 <td style
="border-right:1pt solid black;border-top:1pt solid black;text-align:center;">
660 <?php
echo $ODVF['3']; ?
>
662 <td style
="border-left:1pt solid black;border-top:1pt solid black;text-align:center;">
663 <?php
echo $ODVF['4']; ?
>
666 <td style
="border-right:1pt solid black;border-top:1pt solid black;text-align:center;">
667 <?php
echo $OSVF['3']; ?
>
669 <td style
="border-left:1pt solid black;border-top:1pt solid black;text-align:center;">
670 <?php
echo $OSVF['4']; ?
>
678 <!-- START OF THE MOTILITY BOX
-->
679 <td
class="report_vitals">
680 <b
class="underline"><?php
echo xlt('Motility'); ?
></b
>
682 if ($MOTILITYNORMAL =='on') {
683 echo "<br /><br /> ".xlt('D&V Full OU{{Ductions and Versions full both eyes}}') ." <br /><br />";
686 $background = "url(".$GLOBALS["fileroot"] . "/interface/forms/".$form_folder."/images/eom.jpg)";
688 $background = "url(../../forms/".$form_folder."/images/eom.bmp)";
690 $zone = array("MOTILITY_RRSO","MOTILITY_RS","MOTILITY_RLSO","MOTILITY_RR","MOTILITY_R0","MOTILITY_RL","MOTILITY_RRIO","MOTILITY_RI","MOTILITY_RLIO","MOTILITY_LRSO","MOTILITY_LS","MOTILITY_LLSO","MOTILITY_LR","MOTILITY_L0","MOTILITY_LL","MOTILITY_LRIO","MOTILITY_LI","MOTILITY_LLIO");
691 for ($i = 0; $i < count($zone); ++
$i) {
692 ($
$zone[$i] >= '1') ?
($
$zone[$i] = "-".$
$zone[$i]) : ($
$zone[$i] = '');
695 <table style
="font-size:1.0em;">
696 <tr style
="font-weight:bold;">
697 <td style
="text-align:center;text-decoration:underline;"><?php
echo xlt('OD'); ?
></td
>
698 <td style
="text-align:center;text-decoration:underline;"><?php
echo xlt('OS'); ?
></td
>
701 <td style
="font-weight:600;">
702 <table style
="background: <?php echo $background; ?> no-repeat center center;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50); -moz-opacity: 0.5; -webkit-opacity: 0.5; opacity:1.0;padding-bottom:5px;">
704 <td
class="mot"><?php
echo $MOTILITY_RRSO; ?
></td
>
705 <td
class="mot"><?php
echo $MOTILITY_RS; ?
></td
>
706 <td
class="mot"><?php
echo $MOTILITY_RLSO; ?
></td
>
709 <td
class="mot"><?php
echo $MOTILITY_RR; ?
></td
>
710 <td
class="mot"><?php
echo $MOTILITY_R0; ?
></td
>
711 <td
class="mot"><?php
echo $MOTILITY_RL; ?
></td
>
714 <td
class="mot"><?php
echo $MOTILITY_RRIO; ?
></td
>
715 <td
class="mot"><?php
echo $MOTILITY_RI; ?
></td
>
716 <td
class="mot"><?php
echo $MOTILITY_RLIO; ?
></td
>
720 <td style
="text-align:center;font-weight:600;padding-left:20px;">
721 <table style
="background: <?php echo $background; ?> no-repeat center center;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50) -moz-opacity: 0.5; -webkit-opacity: 1.0; opacity:0.5; padding:1px;">
723 <td
class="mot"><?php
echo $MOTILITY_LRSO; ?
></td
>
724 <td
class="mot"><?php
echo $MOTILITY_LS; ?
></td
>
725 <td
class="mot"><?php
echo $MOTILITY_LLSO; ?
></td
>
728 <td
class="mot"><?php
echo $MOTILITY_LR; ?
></td
>
729 <td
class="mot"><?php
echo $MOTILITY_L0; ?
></td
>
730 <td
class="mot"><?php
echo $MOTILITY_LL; ?
></td
>
733 <td
class="mot"><?php
echo $MOTILITY_LLIO; ?
></td
>
734 <td
class="mot"><?php
echo $MOTILITY_LI; ?
></td
>
735 <td
class="mot"><?php
echo $MOTILITY_LLIO; ?
></td
>
746 if (($PUPIL_NORMAL =='1')||
$ODPUPILSIZE1||
$OSPUPILSIZE1) {
748 <td
class="report_vitals" style
="border-right:0px;">
750 if (($PUPIL_NORMAL =='1')&&(!$ODPUPILSIZE1||
!$OSPUPILSIZE1)) { ?
>
751 <b
class="underline"><?php
echo xlt('Pupils'); ?
></b
> 
; 
;
752 <?php
echo xlt('Round and Reactive')."<br />";
754 if ($ODPUPILSIZE1||
$OSPUPILSIZE1) { ?
>
755 <table cellspacing
="0" style
="margin:1px;text-align:center;font-size:9px;">
757 <!-- start of the Pupils box
-->
759 <b
class="underline"><?php
echo xlt('Pupils'); ?
></b
>
760 <table style
="font-size: 8px;text-align:middle;">
764 <th style
="padding: 2px 5px;"><?php
echo xlt('size'); ?
> (<?php
echo xlt('mm{{millimeters}}'); ?
>)
766 <th style
="padding: 2px;"><?php
echo xlt('react{{reactivity}}'); ?
>
768 <th style
="padding: 2px;"><?php
echo xlt('APD{{afferent pupillary defect}}'); ?
>
772 <td
><b
><?php
echo xlt('OD'); ?
></b
>
774 <td style
="border-right:1pt solid black;border-bottom:1pt solid black;text-align:center;">
775 <?php
echo text($ODPUPILSIZE1); ?
>
777 <?php
echo text($ODPUPILSIZE2); ?
>
779 <td style
="text-align:center;border-left:1pt solid black;border-right:1pt solid black;border-bottom:1pt solid black;">
780 <?php
echo text($ODPUPILREACTIVITY); ?
>
782 <td style
="text-align:center;border-bottom:1pt solid black;">
783 <?php
echo text($ODAPD); ?
>
787 <td
><b
><?php
echo xlt('OS'); ?
></b
>
789 <td style
="border-right:1pt solid black;border-top:1pt solid black;text-align:center;">
790 <?php
echo text($OSPUPILSIZE1); ?
>
792 <?php
echo text($OSPUPILSIZE2); ?
>
794 <td style
="text-align:center;border-left:1pt solid black;border-right:1pt solid black;border-top:1pt solid black;">
795 <?php
echo text($OSPUPILREACTIVITY); ?
>
797 <td style
="text-align:center;border-top:1pt solid black;">
798 <?php
echo text($OSAPD); ?
>
813 if ($DIMODPUPILSIZE1||
$DIMOSPUPILSIZE1||
$PUPIL_COMMENTS||
$AMSLEROD||
$AMSLEROS) { ?
>
814 <!-- start of slide down pupils_panel
-->
816 <table
class='borderShadow' style
="margin:1px;text-align:center;font-size:9px;">
819 <b
class="underline"><?php
echo xlt('Pupils') ?
>: <?php
echo xlt('Dim'); ?
></b
>
820 <table style
="report_vitals" style
="font-size: 8px;text-align:middle;">
823 <th style
="padding: 2px;text-align:center;" ><?php
echo xlt('size'); ?
> (<?php
echo xlt('mm{{millimeters}}'); ?
>)
827 <td
><b
><?php
echo xlt('OD'); ?
></b
>
829 <td style
="text-align:bottom;border-bottom:1pt solid black;padding-left:0.1in;">
830 <?php
echo text($DIMODPUPILSIZE1); ?
>
832 <?php
echo text($DIMODPUPILSIZE2); ?
>
837 <td
><b
><?php
echo xlt('OS'); ?
></b
>
839 <td style
="border-top:1pt solid black;padding-left:0.1in;">
840 <?php
echo text($DIMOSPUPILSIZE1); ?
>
842 <?php
echo text($DIMOSPUPILSIZE2); ?
>
845 <tr
><td colspan
="2" style
="padding-left:2px;text-align:bottom;">
847 <?php
echo text($PUPIL_COMMENTS); ?
>
852 <!-- end of slide down pupils_panel
-->
853 <!-- START OF THE AMSLER BOX
-->
854 <?php
if ($AMSLEROD||
$AMSLEROS) { ?
>
855 <td
class="report_vitals" style
="border-right:0px;border-left:1pt solid black;">
856 <b
class="underline"><?php
echo xlt('Amsler'); ?
></b
>
858 if (!$AMSLEROD) $AMSLEROD= "0";
859 if (!$AMSLEROS) $AMSLEROS= "0";
861 <table style
="font-size:1.0em;">
862 <tr style
="font-weight:bold;">
863 <td style
="text-align:center;text-decoration:underline;"><?php
echo xlt('OD'); ?
></td
>
865 <td style
="text-align:center;text-decoration:underline;"><?php
echo xlt('OS'); ?
></td
>
869 <td style
="text-align:center;">
870 <img src
="../../forms/<?php echo $form_folder; ?>/images/Amsler_<?php echo attr($AMSLEROD); ?>.jpg" id
="AmslerOD" style
="margin:0.05in;height:0.5in;width:0.6in;" />
872 <small
><?php
echo text($AMSLEROD); ?
>/5</small
>
875 <td style
="text-align:center;">
876 <img src
="../../forms/<?php echo $form_folder; ?>/images/Amsler_<?php echo attr($AMSLEROS); ?>.jpg" id
="AmslerOS" style
="margin:0.05in;height:0.5in;width:0.6in;" />
877 <br
/><small
><?php
echo text($AMSLEROS); ?
>/5</small
>
890 if ($ODVA||
$OSVA||
$ARODSPH||
$AROSSPH||
$MRODSPH||
$MROSSPH||
$CRODSPH||
$CROSSPH||
$CTLODSPH||
$CTLOSSPH) { ?
>
891 <!-- start of the refraction boxes
-->
893 <table
class="refraction_tables">
895 <td colspan
="9" style
="text-align:left;text-decoration:underline;font-weight:bold;"><?php
echo xlt('Refractive States'); ?
>
898 <tr style
="text-align:center;padding:5px;text-decoration:underline;">
899 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('Type').$count_rx; ?
></td
>
900 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('Eye'); ?
></td
>
901 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('Sph{{Sphere}}'); ?
></td
>
902 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('Cyl{{Cylinder}}'); ?
></td
>
903 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('Axis{{Axis of a glasses prescription}}'); ?
></td
>
904 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('Prism'); ?
></td
>
905 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('Acuity'); ?
></td
>
906 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('Mid{{Middle Distance Add}}'); ?
></td
>
907 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('ADD{{Near Add}}'); ?
></td
>
908 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('Acuity'); ?
></td
>
912 for ($i=1; $i <= $count_rx; $i++
) {
913 if ($
{"RX_TYPE_$i"} =="0") {
915 } else if ($
{"RX_TYPE_$i"} =="1") {
916 $RX_TYPE = xlt('Bifocals');
917 } else if ($
{"RX_TYPE_$i"} =="2") {
918 $RX_TYPE = xlt('Trifocals');
919 } else if ($
{"RX_TYPE_$i"} =="3") {
920 $RX_TYPE = xlt('Progressive');
923 Note html2pdf does not like the last field of a table to be blank.
924 If it is it will squish the lines together.
925 Work around: if the field is blank, then replace it with a "-" else echo it.
926 aka echo (text($field))?:"-");
930 <td style
="font-weight:600;font-size:0.7em;text-align:right;"><?php
echo xlt('Current RX')." #".$i.": "; ?
></td
>
931 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('OD{{right eye}}'); ?
></td
>
932 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"ODSPH_$i"})?
:"-"); ?
></td
>
933 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"ODCYL_$i"})?
:"-"); ?
></td
>
934 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"ODAXIS_$i"})?
:"-"); ?
></td
>
935 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"ODPRISM_$i"})?
:"-"); ?
></td
>
936 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"ODVA_$i"})?
:"-"); ?
></td
>
937 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"ODMIDADD_$i"})?
:"-"); ?
></td
>
938 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"ODADD_$i"})?
:"-"); ?
></td
>
939 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"ODNEARVA_$i"})?
:"-"); ?
></td
>
942 <td style
="font-weight:600;font-size:0.7em;text-align:right;"><?php
echo $RX_TYPE; ?
></td
>
943 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('OS{{left eye}}'); ?
></td
>
944 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"OSSPH_$i"})?
:"-"); ?
></td
>
945 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"OSCYL_$i"})?
:"-"); ?
></td
>
946 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"OSAXIS_$i"})?
:"-"); ?
></td
>
947 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"OSPRISM_$i"})?
:"-"); ?
></td
>
948 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"OSVA_$i"})?
:"-"); ?
></td
>
949 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"OSMIDADD_$i"})?
:"-"); ?
></td
>
950 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"OSADD_$i"})?
:"-"); ?
></td
>
951 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($
{"OSNEARVA_$i"})?
:"-"); ?
></td
>
954 if ($
{"COMMENTS_$i"}) {
958 <td colspan
="2"><?php
echo xlt('Comments'); ?
>:</td
>
959 <td colspan
="7"><?php
echo text($
{"COMMENTS_$i"}); ?
></td
>
965 if ($ARODSPH||
$AROSSPH) { ?
>
966 <tr style
="border-bottom:1pt solid black;">
967 <td style
="font-weight:600;font-size:0.7em;text-align:right;"><?php
echo xlt('Auto Refraction'); ?
></td
>
968 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('OD{{right eye}}'); ?
></td
>
969 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($ARODSPH)?
:"-"); ?
></td
>
970 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($ARODCYL)?
:"-"); ?
></td
>
971 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($ARODAXIS)?
:"-"); ?
></td
>
972 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($ARODPRISM)?
:"-"); ?
></td
>
973 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($ARODVA)?
:"-"); ?
></td
>
974 <td style
="font-weight:400;font-size:1.0em;text-align:center;">-</td
>
975 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($ARODADD)?
:"-"); ?
></td
>
976 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($ARNEARODVA)?
:"-"); ?
></td
>
980 <td style
="font-weight:400;font-size:1.0em;text-align:right;"><?php
echo xlt('OS{{left eye}}'); ?
></td
>
981 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($AROSSPH)?
:"-"); ?
></td
>
982 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($AROSCYL)?
:"-"); ?
></td
>
983 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($AROSAXIS)?
:"-"); ?
></td
>
984 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($AROSPRISM)?
:"-"); ?
></td
>
985 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($AROSVA)?
:"-"); ?
></td
>
986 <td style
="font-weight:400;font-size:1.0em;text-align:center;">-</td
>
987 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($AROSADD)?
:"-"); ?
></td
>
988 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($ARNEAROSVA)?
:"-"); ?
></td
>
991 if ($
{"COMMENTS_$i"}) {
996 <td colspan
="7"><?php
echo text($
{"COMMENTS_$i"}); ?
></td
>
1001 if ($MRODSPH||
$MROSSPH) { ?
>
1003 <td style
="font-weight:600;font-size:0.7em;text-align:right;"><?php
echo xlt('Manifest (Dry) Refraction'); ?
></td
>
1004 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('OD{{right eye}}'); ?
></td
>
1005 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MRODSPH)?
:"-"); ?
></td
>
1006 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MRODCYL)?
:"-"); ?
></td
>
1007 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MRODAXIS)?
:"-"); ?
></td
>
1008 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MRODPRISM)?
:"-"); ?
></td
>
1009 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MRODVA)?
:"-"); ?
></td
>
1010 <td style
="font-weight:400;font-size:1.0em;text-align:center;">-</td
>
1011 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MRODADD)?
:"-"); ?
></td
>
1012 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MRNEARODVA)?
:"-"); ?
></td
>
1017 <td style
="font-weight:400;font-size:1.0em;text-align:right;"><?php
echo xlt('OS{{left eye}}'); ?
></td
>
1018 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MROSSPH)?
:"-"); ?
></td
>
1019 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MROSCYL)?
:"-"); ?
></td
>
1020 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MROSAXIS)?
:"-"); ?
></td
>
1021 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MROSPRISM)?
:"-"); ?
></td
>
1022 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MROSVA)?
:"-"); ?
></td
>
1023 <td style
="font-weight:400;font-size:1.0em;text-align:center;">-</td
>
1024 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MROSADD)?
:"-"); ?
></td
>
1025 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($MRNEAROSVA)?
:"-"); ?
></td
>
1029 if ($CRODSPH||
$CROSSPH) { ?
>
1031 <td style
="font-weight:600;font-size:0.8em;text-align:right;"><?php
echo xlt('Cycloplegic (Wet) Refraction'); ?
></td
>
1032 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('OD{{right eye}}'); ?
></td
>
1033 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CRODSPH)?
:"-"); ?
></td
>
1034 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CRODCYL)?
:"-"); ?
></td
>
1035 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CRODAXIS)?
:"-"); ?
></td
>
1036 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CRODPRISM)?
:"-"); ?
></td
>
1037 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CRODVA)?
:"-"); ?
></td
>
1038 <td style
="font-weight:400;font-size:1.0em;text-align:center;">-</td
>
1039 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CRODADD)?
:"-"); ?
></td
>
1040 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CRNEARODVA)?
:"-"); ?
></td
>
1044 <td style
="font-weight:400;font-size:1.0em;text-align:right;"><?php
echo xlt('OS{{left eye}}'); ?
></td
>
1045 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CROSSPH)?
:"-"); ?
></td
>
1046 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CROSCYL)?
:"-"); ?
></td
>
1047 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CROSAXIS)?
:"-"); ?
></td
>
1048 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CROSPRISM)?
:"-"); ?
> 
;</td
>
1049 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CROSVA)?
:"-"); ?
></td
>
1050 <td style
="font-weight:400;font-size:1.0em;text-align:center;">-</td
>
1051 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CROSADD)?
:"-"); ?
></td
>
1052 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CRNEAROSVA)?
:"-"); ?
></td
>
1056 if ($CTLODSPH||
$CTLOSSPH) { ?
>
1057 <tr style
="text-align:center;padding:5px;text-decoration:underline;">
1059 <td
><?php
echo xlt('Eye'); ?
></td
>
1060 <td
><?php
echo xlt('Sph{{Sphere}}'); ?
></td
>
1061 <td
><?php
echo xlt('Cyl{{Cylinder}}'); ?
></td
>
1062 <td
><?php
echo xlt('Axis{{Axis of a glasses prescription}}'); ?
></td
>
1063 <td
><?php
echo xlt('BC{{Base Curve}}'); ?
></td
>
1064 <td
><?php
echo xlt('Diam{{Diameter}}'); ?
></td
>
1065 <td
><?php
echo xlt('ADD'); ?
></td
>
1066 <td
><?php
echo xlt('Acuity'); ?
></td
>
1069 <td style
="font-weight:600;font-size:0.8em;text-align:right;"><?php
echo xlt('Contact Lens'); ?
></td
>
1070 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('OD{{right eye}}'); ?
></td
>
1071 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLODSPH)?
:"-"); ?
></td
>
1072 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLODCYL)?
:"-"); ?
></td
>
1073 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLODAXIS)?
:"-"); ?
></td
>
1074 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLODBC)?
:"-"); ?
></td
>
1075 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLODDIAM)?
:"-"); ?
></td
>
1076 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLODADD)?
:"-"); ?
></td
>
1077 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLODVA)?
:"-"); ?
></td
>
1079 <tr style
="font-size:0.6em;">
1082 <td colspan
="3" style
="font-weight:400;font-size:1.0em;text-align:left;"><?php
echo xlt('Brand'); ?
>:<?php
echo (text($CTLBRANDOD)?
:"-"); ?
></td
>
1083 <td colspan
="3" style
="font-weight:400;font-size:1.0em;text-align:left;"><?php
echo xlt('by{{made by/manufacturer}}'); ?
> <?php
echo (text($CTLMANUFACTUREROD)?
:"-"); ?
></td
>
1084 <td colspan
="3" style
="font-weight:400;font-size:1.0em;text-align:left;"><?php
echo xlt('via{{shipped by/supplier}}'); ?
> <?php
echo (text($CTLSUPPLIEROD)?
:"-"); ?
></td
>
1089 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo xlt('OS{{left eye}}'); ?
></td
>
1090 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLOSSPH)?
:"-"); ?
></td
>
1091 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLOSCYL)?
:"-"); ?
></td
>
1092 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLOSAXIS)?
:"-"); ?
></td
>
1093 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLOSBC)?
:"-"); ?
></td
>
1094 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLOSDIAM)?
:"-"); ?
></td
>
1095 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo (text($CTLOSADD)?
:"-"); ?
></td
>
1096 <td style
="font-weight:400;font-size:1.0em;text-align:center;"><?php
echo ($CTLOSVA?
:"-"); ?
></td
>
1098 <tr style
="font-size:0.6em;">
1101 <td colspan
="3" style
="font-weight:400;font-size:1.0em;text-align:left;"><?php
echo xlt('Brand'); ?
>: <?php
echo (text($CTLBRANDOS)?
:"-"); ?
></td
>
1102 <td colspan
="3" style
="font-weight:400;font-size:1.0em;text-align:left;"><?php
echo xlt('by{{made by/manufacturer}}'); ?
> <?php
echo (text($CTLMANUFACTUREROS)?
:"-"); ?
></td
>
1103 <td colspan
="3" style
="font-weight:400;font-size:1.0em;text-align:left;"><?php
echo xlt('via{{shipped by/supplier}}'); ?
> <?php
echo (text($CTLSUPPLIEROS)?
:"-"); ?
></td
>
1115 if ($GLAREODVA||
$CONTRASTODVA||
$ODK1||
$ODK2||
$LIODVA||
$PAMODBA) { ?
>
1118 <td id
="LayerVision_ADDITIONAL" class="refraction <?php echo $display_Add; ?>" style
="padding:10px;font-size:0.9em;">
1119 <table id
="Additional" style
="padding:5;font-size:1.0em;">
1120 <tr
><td colspan
="9" style
="text-align:left;text-decoration:underline;font-weight:bold;"><?php
echo xlt('Additional Data Points'); ?
></td
></tr
>
1122 <td
><?php
echo xlt('PH{{Pinhole}}'); ?
></td
>
1123 <td
><?php
echo xlt('PAM{{Potential Acuity Meter}}'); ?
></td
>
1124 <td
><?php
echo xlt('LI{{Laser Interferometry}}'); ?
></td
>
1125 <td
><?php
echo xlt('BAT{{Brightness Acuity Testing}}'); ?
></td
>
1126 <td
><?php
echo xlt('K1{{Keratometry 1}}'); ?
></td
>
1127 <td
><?php
echo xlt('K2{{Keratometry 2}}'); ?
></td
>
1128 <td
><?php
echo xlt('Axis{{Axis of a glasses prescription}}'); ?
></td
>
1130 <tr
><td
><b
><?php
echo xlt('OD{{right eye}}'); ?
>:</b
></td
>
1131 <td
><?php
echo text($PHODVA); ?
></td
>
1132 <td
><?php
echo text($PAMODVA); ?
></td
>
1133 <td
><?php
echo text($LIODVA); ?
></td
>
1134 <td
><?php
echo text($GLAREODVA); ?
></td
>
1135 <td
><?php
echo text($ODK1); ?
></td
>
1136 <td
><?php
echo text($ODK2); ?
></td
>
1137 <td
><?php
echo text($ODK2AXIS); ?
></td
>
1140 <td
><b
><?php
echo xlt('OS{{left eye}}'); ?
>:</b
></td
>
1141 <td
><?php
echo text($PHOSVA); ?
></td
>
1142 <td
><?php
echo text($PAMOSVA); ?
></td
>
1143 <td
><?php
echo text($LIOSVA); ?
></td
>
1144 <td
><?php
echo text($GLAREOSVA); ?
></td
>
1145 <td
><?php
echo text($OSK1); ?
></td
>
1146 <td
><?php
echo text($OSK2); ?
></td
>
1147 <td
><?php
echo text($OSK2AXIS); ?
></td
>
1149 <tr
><td
> 
;</td
></tr
>
1152 <td
><?php
echo xlt('AxLength{{axial Length}}'); ?
></td
>
1153 <td
><?php
echo xlt('ACD{{anterior chamber depth}}'); ?
></td
>
1154 <td
><?php
echo xlt('PD{{pupillary distance}}'); ?
></td
>
1155 <td
><?php
echo xlt('LT{{lens thickness}}'); ?
></td
>
1156 <td
><?php
echo xlt('W2W{{white-to-white}}'); ?
></td
>
1157 <td
><?php
echo xlt('ECL{{equivalent contact lens power at the corneal level}}'); ?
></td
>
1158 <!-- <td
><?php
echo xlt('pend'); ?
></td
> -->
1160 <tr
><td
><b
><?php
echo xlt('OD{{right eye}}'); ?
>:</b
></td
>
1161 <td
><?php
echo text($ODAXIALLENGTH); ?
></td
>
1162 <td
><?php
echo text($ODACD); ?
></td
>
1163 <td
><?php
echo text($ODPDMeasured); ?
></td
>
1164 <td
><?php
echo text($ODLT); ?
></td
>
1165 <td
><?php
echo text($ODW2W); ?
></td
>
1166 <td
><?php
echo text($ODECL); ?
></td
>
1167 <!-- <td
><input type
=text id
="pend" name
="pend" value
="<?php echo text($pend); ?>"></td
> -->
1170 <td
><b
><?php
echo xlt('OS{{left eye}}'); ?
>:</b
></td
>
1171 <td
><?php
echo text($OSAXIALLENGTH); ?
></td
>
1172 <td
><?php
echo text($OSACD); ?
></td
>
1173 <td
><?php
echo text($OSPDMeasured); ?
></td
>
1174 <td
><?php
echo text($OSLT); ?
></td
>
1175 <td
><?php
echo text($OSW2W); ?
></td
>
1176 <td
><?php
echo text($OSECL); ?
></td
>
1177 <!-- <td
><input type
=text id
="pend" name
="pend" value
="<?php echo text($pend); ?>"></td
> -->
1188 <!-- end of the refraction boxes
-->
1190 <!-- start of external exam
-->
1191 <div
class="report_exam_group">
1194 <td style
="text-align:left;vertical-align:top;">
1195 <b
class="underline"><?php
echo xlt('External Exam'); ?
>:</b
>
1196 <table
class="report_section">
1198 <td
class="bold" style
="text-align:right;padding-right:10px;text-decoration:underline;max-width:150px;"><?php
echo xlt('Right'); ?
></td
>
1199 <td style
="width:100px;"></td
>
1200 <td
class="bold" style
="text-align:left;padding-left:10px;text-decoration:underline;max-width:150px;"><?php
echo xlt('Left'); ?
></td
>
1203 <td
class="report_text right"><?php
echo text($RBROW); ?
></td
>
1204 <td
class="middle"><?php
echo xlt('Brow'); ?
></td
>
1205 <td
class="report_text left"><?php
echo text($LBROW); ?
></td
>
1208 <td
class="report_text right ">
1209 <?php
echo text($RUL); ?
>
1211 <td
class="middle"><?php
echo xlt('Upper Lids'); ?
></td
>
1212 <td
class="report_text left"><?php
echo text($LUL); ?
></td
>
1215 <td
class="report_text right "><?php
echo text($RLL); ?
></td
>
1216 <td
class="middle"><?php
echo xlt('Lower Lids'); ?
></td
>
1217 <td
class="report_text left"><?php
echo text($LLL); ?
></td
>
1220 <td
class="report_text right "><?php
echo text($RMCT); ?
></td
>
1221 <td
class="middle"><?php
echo xlt('Medial Canthi'); ?
></td
>
1222 <td
class="report_text left"><?php
echo text($LMCT); ?
></td
>
1225 if ($RADNEXA ||
$LADNEXA) {
1228 <td
class="report_text right"><?php
echo text($RADNEXA); ?
></td
>
1229 <td
class="middle"><?php
echo xlt('Adnexa'); ?
></td
>
1230 <td
class="report_text left"><?php
echo text($LADNEXA); ?
></td
>
1234 if ($EXT_COMMENTS) { ?
>
1238 <b
><?php
echo xlt('Comments'); ?
>:</b
>
1239 <span style
="height:3.0em;">
1240 <?php
echo text($EXT_COMMENTS); ?
>
1247 <td style
="text-align:center;padding:1px;vertical-align:middle;">
1249 display_draw_image ("EXT",$encounter,$pid);
1255 <!-- end of external exam
-->
1256 <div
class="report_exam_group">
1258 if ($OSCONJ||
$ODCONJ||
$ODCORNEA||
$OSCORNEA||
$ODAC||
$OSAC||
$ODLENS||
$OSLENS||
$ODIRIS||
$OSIRIS) {
1260 <!-- start of Anterior Segment exam
-->
1263 <td style
="text-align:left;padding:1px;vertical-align:top;">
1264 <b
class="underline"><?php
echo xlt('Anterior Segment'); ?
>:</b
>
1265 <table
class="report_section">
1267 <td
class="bold" style
="text-align:right;padding-right:10px;text-decoration:underline;max-width:200px;"><?php
echo xlt('Right'); ?
></td
>
1268 <td style
="width:100px;"></td
>
1269 <td
class="bold" style
="text-align:left;padding-left:10px;text-decoration:underline;max-width:200px;"><?php
echo xlt('Left'); ?
></td
>
1272 <td
class="report_text right"><?php
echo text($ODCONJ); ?
></td
>
1273 <td
class="middle"><?php
echo xlt('Conj{{Conjunctiva}}'); ?
></td
>
1274 <td
class="report_text left"><?php
echo text($OSCONJ); ?
></td
>
1277 <td
class="report_text right "><?php
echo text($ODCORNEA); ?
></td
>
1278 <td
class="middle"><?php
echo xlt('Cornea'); ?
></td
>
1279 <td
class="report_text left"><?php
echo text($OSCORNEA); ?
></td
>
1282 <td
class="report_text right "><?php
echo text($ODAC); ?
></td
>
1283 <td
class="middle"><?php
echo xlt('A/C{{anterior chamber}}'); ?
></td
>
1284 <td
class="report_text left"><?php
echo text($OSAC); ?
></td
>
1287 <td
class="report_text right "><?php
echo text($ODLENS); ?
></td
>
1288 <td
class="middle"><?php
echo xlt('Lens'); ?
></td
>
1289 <td
class="report_text left"><?php
echo text($OSLENS); ?
></td
>
1292 <td
class="report_text right"><?php
echo text($ODIRIS); ?
></td
>
1293 <td
class="middle"><?php
echo xlt('Iris'); ?
></td
>
1294 <td
class="report_text left"><?php
echo text($OSIRIS); ?
></td
>
1296 <?php
if ($ODGONIO||
$OSDGONIO) { ?
>
1298 <td
class="report_text right" style
="width:100px;"><?php
echo text($ODGONIO); ?
></td
>
1299 <td
class="middle"><?php
echo xlt('Gonioscopy'); ?
></td
>
1300 <td
class="report_text left" style
="width:100px;"><?php
echo text($OSGONIO); ?
></td
>
1302 <?php
} if ($ODKTHICKNESS||
$OSKTHICKNESS) { ?
>
1304 <td
class="report_text right"><?php
echo text($ODKTHICKNESS); ?
></td
>
1305 <td
class="middle" title
="<?php echo xla('Pachymetry'); ?>"><?php
echo xlt('Pachymetry'); ?
></td
>
1306 <td
class="report_text left"><?php
echo text($OSKTHICKNESS); ?
></td
>
1308 <?php
} if ($ODSCHIRMER1||
$OSSCHIRMER1) { ?
>
1310 <td
class="report_text right"><?php
echo text($ODSCHIRMER1); ?
></td
>
1311 <td
class="middle" title
="<?php echo xla('Schirmers I (w/o anesthesia)'); ?>"><?php
echo xlt('Schirmers I'); ?
></td
>
1312 <td
class="report_text left"><?php
echo text($OSSCHIRMER1); ?
></td
>
1314 <?php
} if ($ODSCHIRMER2||
$OSSCHIRMER2) { ?
>
1316 <td
class="report_text right"><?php
echo text($ODSCHIRMER2); ?
></td
>
1317 <td
class="middle" title
="<?php echo xla('Schirmers II (w/ anesthesia)'); ?>"><?php
echo xlt('Schirmers II'); ?
></td
>
1318 <td
class="report_text left"><?php
echo text($OSSCHIRMER2); ?
></td
>
1320 <?php
} if ($ODTBUT||
$OSTBUT) { ?
>
1322 <td
class="report_text right"><?php
echo text($ODTBUT); ?
></td
>
1323 <td
class="middle" title
="<?php echo xla('Tear Break Up Time'); ?>"><?php
echo xlt('TBUT'); ?
></td
>
1324 <td
class="report_text left"><?php
echo text($OSTBUT); ?
></td
>
1327 if ($ANTSEG_COMMENTS) { ?
>
1330 <b
><?php
echo xlt('Comments'); ?
>:</b
>
1331 <span style
="height:3.0em;">
1332 <?php
echo text($ANTSEG_COMMENTS); ?
>
1339 <td style
="text-align:center;padding:1px;vertical-align:middle;">
1341 display_draw_image ("ANTSEG",$encounter,$pid);
1346 <!-- end of Anterior Segment exam
-->
1352 <div
class="report_exam_group">
1354 <!-- start of Other exam
-->
1356 if ($RLF ||
$LLF ||
$RMRD ||
$LMRD ||
$RVFISSURE ||
$LVFISSURE ||
1357 $RCAROTID ||
$LCAROTID ||
$RTEMPART ||
$LTEMPART ||
$RCNV ||
$LCNV ||
1358 $RCNVII ||
$LCNVII ||
$HERTELBASE ||
$ODCOLOR ||
$OSCOLOR ||
$ODREDDESAT ||
1359 $OSREDDESAT ||
$ODCOINS ||
$OSCOINS ||
$ODNPA ||
$OSNPA ||
$NPA ||
$NPC ||
$STEREOPSIS ||
1360 $DACCDIST ||
$DACCNEAR ||
$CACCDIST ||
$CACCNEAR ||
$VERTFUSAMPS) {
1364 <td style
="text-align:left;vertical-align:top;padding:1px;">
1365 <b
><u
><?php
echo xlt('Additional Findings'); ?
>:</u
></b
>
1366 <?php
if ($ACT =='on' and $MOTILITYNORMAL == 'on') { ?
>
1367 <span id
="ACTNORMAL_CHECK" name
="ACTNORMAL_CHECK">
1368 <?php
echo xlt('Orthophoric'); ?
>
1371 <table
class="report_section">
1373 <td
class="bold" style
="text-align:right;padding-right:10px;text-decoration:underline;max-width:200px;"><?php
echo xlt('Right'); ?
></td
>
1374 <td style
="width:100px;"></td
>
1375 <td
class="bold" style
="text-align:left;padding-left:10px;text-decoration:underline;max-width:200px;"><?php
echo xlt('Left'); ?
></td
>
1378 if ($RLF ||
$LLF) { ?
>
1380 <td
class="report_text right" style
=""><?php
echo text($RLF); ?
></td
>
1381 <td
class="middle" style
="width:100px;"><?php
echo xlt('Levator Function'); ?
></td
>
1382 <td
class="report_text left" style
=""><?php
echo text($LLF); ?
></td
>
1386 if ($RMRD ||
$LMRD) { ?
>
1388 <td
class="report_text right"><?php
echo text($RMRD); ?
></td
>
1389 <td
class="middle" title
="<?php echo xla('Marginal Reflex Distance'); ?>"><?php
echo xlt('MRD{{marginal reflex distance}}'); ?
></td
>
1390 <td
class="report_text left"><?php
echo text($LMRD); ?
></td
>
1394 if ($RVFISSURE ||
$LVFISSURE) { ?
>
1396 <td
class="report_text right"><?php
echo text($RVFISSURE); ?
></td
>
1397 <td
class="middle" title
="<?php echo xla('Vertical Fissure: central height between lid margins'); ?>"><?php
echo xlt('Vert Fissure{{vertical fissure}}'); ?
></td
>
1398 <td
class="report_text left"><?php
echo text($LVFISSURE); ?
></td
>
1402 if ($RCAROTID ||
$LCAROTID) { ?
>
1404 <td
class="report_text right"><?php
echo text($RCAROTID); ?
></td
>
1405 <td
class="middle" title
="<?php echo xla('Any carotid bruits appreciated?'); ?>"><?php
echo xlt('Carotid{{carotid arteries}}'); ?
></td
>
1406 <td
class="report_text left"><?php
echo text($LCAROTID); ?
></td
>
1410 if ($RTEMPART ||
$LTEMPART) { ?
>
1412 <td
class="report_text right"><?php
echo text($RTEMPART); ?
></td
>
1413 <td
class="middle" title
="<?php echo xla('Temporal Arteries'); ?>"><?php
echo xlt('Temp. Art.{{temporal arteries}}'); ?
></td
>
1414 <td
class="report_text left"><?php
echo text($LTEMPART); ?
></td
>
1418 if ($RCNV ||
$LCNV) { ?
>
1420 <td
class="report_text right"><?php
echo text($RCNV); ?
></td
>
1421 <td
class="middle" title
="<?php echo xla('Cranial Nerve 5: Trigeminal Nerve'); ?>"><?php
echo xlt('CN V{{cranial nerve five}}'); ?
></td
>
1422 <td
class="report_text left"><?php
echo text($LCNV); ?
></td
>
1426 if ($RCNVII ||
$LCNVII) { ?
>
1428 <td
class="report_text right"><?php
echo text($RCNVII); ?
></td
>
1429 <td
class="middle" title
="<?php echo xla('Cranial Nerve 7: Facial Nerve'); ?>"><?php
echo xlt('CN VII{{cranial nerve seven}}'); ?
></td
>
1430 <td
class="report_text left"><?php
echo text($LCNVII); ?
></td
>
1434 if ($HERTELBASE) { ?
>
1436 <td colspan
="3" style
="text-align:center;padding-top:15px;">
1437 <b style
="font-weight:bold;padding-bottom:5px;">
1438 <?php
echo xlt('Hertel Exophthalmometry'); ?
>
1442 if ($HERTELBASE) { ?
>
1444 <b style
="border:1pt solid black;width:30px;text-align:center;padding:0 5;">
1445 <?php
echo text($ODHERTEL); ?
>
1447 <b
class="fa fa-minus">--</b
>
1448 <b style
="border:1pt solid black;width:40px;text-align:center;padding:0 5;">
1449 <?php
echo text($HERTELBASE); ?
>
1451 <b
class="fa fa-minus">--</b
>
1452 <b style
="border:1pt solid black;width:30px;text-align:center;padding:0 5;">
1453 <?php
echo text($OSHERTEL); ?
>
1462 if ($ODCOLOR ||
$OSCOLOR ||
$ODREDDESAT ||
1463 $OSREDDESAT ||
$ODCOINS ||
$OSCOINS ||
1464 $ODNPA ||
$OSNPA ||
$NPA ||
$NPC ||
$STEREOPSIS) { ?
>
1465 <!-- start of NEURO exam
-->
1467 if ($ODCOLOR or $OSCOLOR) { ?
>
1469 <td
class="report_text right"><?php
echo text($ODCOLOR); ?
></td
>
1470 <td
class="middle"><?php
echo xlt('Color Vision'); ?
></td
>
1471 <td
class="report_text left"><?php
echo text($OSCOLOR); ?
></td
>
1475 if ($ODREDDESAT or $OSREDDESAT) { ?
>
1477 <td
class="report_text right"><?php
echo text($ODREDDESAT); ?
></td
>
1478 <td
class="middle"><span title
="<?php xla('Variation in red color discrimination between the eyes (eg. OD=100, OS=75)'); ?>"><?php
echo xlt('Red Desaturation'); ?
></span
></td
>
1479 <td
class="report_text left"><?php
echo text($OSREDDESAT); ?
></td
>
1482 if ($ODCOINS or $OSCOINS) { ?
>
1484 <td
class="report_text right"><?php
echo text($ODCOINS); ?
></td
>
1485 <td
class="middle"><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
></td
>
1486 <td
class="report_text left"><?php
echo text($OSCOINS); ?
></td
>
1490 if ($ODNPA or $OSNPA) { ?
>
1492 <td
class="report_text right"><?php
echo text($ODNPA); ?
></td
>
1493 <td
class="middle"><span title
="<?php echo xla('Near Point of Accomodation'); ?>"><?php
echo xlt('NPA{{near point of accomodation}}'); ?
></span
></td
>
1494 <td
class="report_text left"><?php
echo text($OSNPA); ?
></td
>
1497 if ($ODNPC or $OSNPC) { ?
>
1499 <td
class="right" style
="font-weight:600;"><?php
echo xlt('NPC{{near point of convergence}}'); ?
>: 
;</td
>
1500 <td
class="center" colspan
="2" ><?php
echo text($NPC); ?
></td
>
1503 if ($DACCDIST or $DACCNEAR or $CACCDIST or $CACCNEAR or $VERTFUSAMPS) { ?
>
1504 <tr style
="text-decoration:underline;">
1506 <td
class="middle"><?php
echo xlt('Distance'); ?
> </td
>
1507 <td
class="middle"> <?php
echo xlt('Near'); ?
></td
>
1510 if ($DACCDIST or $DACCNEAR) { ?
>
1512 <td
class="right" style
="font-weight:600;"><?php
echo xlt('Divergence Amps'); ?
>: </td
>
1513 <td
class="center"><?php
echo text($DACCDIST); ?
></td
>
1514 <td
class="center"><?php
echo text($DACCNEAR); ?
></td
>
1517 if ($CACCDIST or $CACCNEAR) { ?
>
1519 <td
class="right" style
="font-weight:600;"><?php
echo xlt('Convergence Amps'); ?
>: </td
>
1520 <td
class="center"><?php
echo text($CACCDIST); ?
></td
>
1521 <td
class="center"><?php
echo text($CACCNEAR); ?
></td
>
1524 if ($VERTFUSAMPS) { ?
>
1526 <td
class="right" style
="font-weight:600;">
1527 <?php
echo xlt('Vert Fusional Amps'); ?
>:
1529 <td colspan
="2" class="center">
1530 <?php
echo text($VERTFUSAMPS); ?
>
1535 if ($STEREOPSIS) { ?
>
1537 <td
class="right" style
="font-weight:600;"><?php
echo xlt('Stereopsis'); ?
>: 
;</td
>
1538 <td
class="center" colspan
="2"><?php
echo text($STEREOPSIS); ?
></td
>
1544 <td style
="text-align:center;padding:1px;vertical-align:middle;">
1546 display_draw_image ("NEURO",$encounter,$pid);
1553 <!-- end of Other exam
-->
1555 <div
class="report_exam_group">
1557 <!-- start of the Retina exam
-->
1559 if ($ODDISC||
$OSDISC||
$ODCUP||
$ODMACULA||
$ODVESSELS||
$ODPERIPH) {
1563 <td style
="text-align:left;padding:1px;vertical-align:top;">
1564 <b
><u
><?php
echo xlt('Retina'); ?
>:</u
></b
>
1565 <table
class="report_section">
1567 <td
class="bold" style
="text-align:right;text-decoration:underline;max-width:150px;"><?php
echo xlt('Right'); ?
></td
>
1568 <td style
="width:100px;"></td
>
1569 <td
class="bold" style
="text-align:left;text-decoration:underline;max-width:150px;"><?php
echo xlt('Left'); ?
></td
>
1572 <td
class="report_text right"><?php
echo text($ODDISC); ?
></td
>
1573 <td
class="middle"><?php
echo xlt('Disc'); ?
></td
>
1574 <td
class="report_text left"><?php
echo text($OSDISC); ?
></td
>
1577 <td
class="report_text right"><?php
echo text($ODCUP); ?
></td
>
1578 <td
class="middle"><?php
echo xlt('Cup'); ?
></td
>
1579 <td
class="report_text left"><?php
echo text($OSCUP); ?
></td
>
1582 <td
class="report_text right"><?php
echo text($ODMACULA); ?
></td
>
1583 <td
class="middle"><?php
echo xlt('Macula'); ?
></td
>
1584 <td
class="report_text left"><?php
echo text($OSMACULA); ?
></td
>
1587 <td
class="report_text right"><?php
echo text($ODVESSELS); ?
></td
>
1588 <td
class="middle"><?php
echo xlt('Vessels'); ?
></td
>
1589 <td
class="report_text left"><?php
echo text($OSVESSELS); ?
></td
>
1591 <?php
if ($ODPERIPH||
$OSPERIPH) { ?
>
1593 <td
class="report_text right"><?php
echo text($ODPERIPH); ?
></td
>
1594 <td
class="middle"><?php
echo xlt('Periph{{periphery}}'); ?
></td
>
1595 <td
class="report_text left"><?php
echo text($OSPERIPH); ?
></td
>
1597 <?php
} if ($ODCMT||
$OSCMT) { ?
>
1599 <td
class="report_text right"> 
;<?php
echo text($ODCMT); ?
></td
>
1600 <td
class="middle"><?php
echo xlt('Central Macular Thickness'); ?
> </td
>
1601 <td
class="report_text left" > 
;<?php
echo text($OSCMT); ?
></td
>
1604 <?php
if ($RETINA_COMMENTS) { ?
>
1606 <td colspan
="2" class="report_text left">
1608 <b
><?php
echo xlt('Comments'); ?
>:</b
>
1609 <span style
="height:3.0em;">
1610 <?php
echo text($RETINA_COMMENTS); ?
>
1618 <td style
="text-align:center;padding:1px;vertical-align:middle;">
1620 display_draw_image ("RETINA",$encounter,$pid);
1628 <!-- end of Retina exam
-->
1631 if ($ACT !='on') { ?
>
1632 <table style
="text-align:center;font-size:0.7em;">
1634 <td colspan
=3 style
="">
1636 <tr style
="text-align:left;height:16px;vertical-align:middle;width:880px;">
1638 <span id
="ACTTRIGGER" name
="ACTTRIGGER" style
="text-decoration:underline;padding-left:2px;">
1639 <?php
echo xlt('Alternate Cover Test'); ?
>:
1645 if ($ACT5SCDIST) { ?
>
1646 <td style
="text-align:center;"> <!-- scDIST
-->
1647 <table cellpadding
="0"
1648 style
="position:relative;text-align:center;font-size:1.2em;margin: 7 5 10 5;">
1650 <td id
="ACT_tab_SCDIST" name
="ACT_tab_SCDIST" class="ACT_deselected"> <?php
echo xlt('sc Distance{{without correction distance}}'); ?
> </td
>
1653 <td colspan
="4" style
="text-align:center;font-size:0.9em;">
1656 <td style
="text-align:center;"><?php
echo xlt('R{{right}}'); ?
></td
>
1657 <td
class="ACT"><?php
echo report_ACT($ACT1SCDIST); ?
></td
>
1658 <td
class="ACT"><?php
echo report_ACT($ACT2SCDIST); ?
></td
>
1659 <td
class="ACT"><?php
echo report_ACT($ACT3SCDIST); ?
></td
>
1660 <td style
="text-align:center;"><?php
echo xlt('L{{left}}'); ?
></td
>
1663 <td style
="text-align:right;"><i
class="fa fa-reply rotate-left"></i
></td
>
1664 <td
class="ACT"><?php
echo report_ACT($ACT4SCDIST); ?
></td
>
1665 <td
class="ACT"><?php
echo report_ACT($ACT5SCDIST); ?
></td
>
1666 <td
class="ACT"><?php
echo report_ACT($ACT6SCDIST); ?
></td
>
1667 <td
><i
class="fa fa-share rotate-right"></i
></td
>
1670 <td
class="ACT"><?php
echo report_ACT($ACT10SCDIST); ?
></td
>
1671 <td
class="ACT"><?php
echo report_ACT($ACT7SCDIST); ?
></td
>
1672 <td
class="ACT"><?php
echo report_ACT($ACT8SCDIST); ?
></td
>
1673 <td
class="ACT"><?php
echo report_ACT($ACT9SCDIST); ?
></td
>
1674 <td
class="ACT"><?php
echo report_ACT($ACT11SCDIST); ?
></td
>
1685 <td style
="text-align:center;"> <!-- ccDIST
-->
1686 <table cellpadding
="0" style
="position:relative;text-align:center;font-size:1.5em;margin: 7 5 10 5;border-collapse: separate;">
1688 <td
class="ACT_deselected"> <?php
echo xlt('cc Distance{{with correction at distance}}'); ?
> </td
>
1691 <td colspan
="4" style
="text-align:center;font-size:0.8em;">
1694 <td style
="text-align:center;"><?php
echo xlt('R{{right}}'); ?
></td
>
1695 <td
class="ACT"><?php
echo report_ACT($ACT1CCDIST); ?
></td
>
1696 <td
class="ACT"><?php
echo report_ACT($ACT2CCDIST); ?
></td
>
1697 <td
class="ACT"><?php
echo report_ACT($ACT3CCDIST); ?
></td
>
1698 <td style
="text-align:center;"><?php
echo xlt('L{{left}}'); ?
></td
>
1701 <td style
="text-align:right;"><i
class="fa fa-reply rotate-left"></i
></td
>
1702 <td
class="ACT"><?php
echo report_ACT($ACT4CCDIST); ?
></td
>
1703 <td
class="ACT"><?php
echo report_ACT($ACT5CCDIST); ?
></td
>
1704 <td
class="ACT"><?php
echo report_ACT($ACT6CCDIST); ?
></td
>
1705 <td
><i
class="fa fa-share rotate-right"></i
></td
>
1708 <td
class="ACT"><?php
echo report_ACT($ACT10CCDIST); ?
></td
>
1709 <td
class="ACT"><?php
echo report_ACT($ACT7CCDIST); ?
></td
>
1710 <td
class="ACT"><?php
echo report_ACT($ACT8CCDIST); ?
></td
>
1711 <td
class="ACT"><?php
echo report_ACT($ACT9CCDIST); ?
></td
>
1712 <td
class="ACT"><?php
echo report_ACT($ACT11CCDIST); ?
>
1727 <td style
="text-align:center;"> <!-- scNEAR
-->
1728 <table cellpadding
="0" style
="position:relative;text-align:center;font-size:1.5em;margin: 7 5 10 5;border-collapse: separate;">
1730 <td
class="ACT_deselected"> <?php
echo xlt('sc Near{{without correction near}}'); ?
> </td
>
1733 <td colspan
="4" style
="text-align:center;font-size:0.8em;">
1736 <td style
="text-align:center;"><?php
echo xlt('R{{right}}'); ?
></td
>
1737 <td
class="ACT"><?php
echo report_ACT($ACT1SCNEAR); ?
></td
>
1738 <td
class="ACT"><?php
echo report_ACT($ACT2SCNEAR); ?
></td
>
1739 <td
class="ACT"><?php
echo report_ACT($ACT3SCNEAR); ?
></td
>
1740 <td style
="text-align:center;"><?php
echo xlt('L{{left}}'); ?
></td
>
1743 <td style
="text-align:right;"><i
class="fa fa-reply rotate-left"></i
></td
>
1744 <td
class="ACT"><?php
echo report_ACT($ACT4SCNEAR); ?
></td
>
1745 <td
class="ACT"><?php
echo report_ACT($ACT5SCNEAR); ?
></td
>
1746 <td
class="ACT"><?php
echo report_ACT($ACT6SCNEAR); ?
></td
>
1747 <td
><i
class="fa fa-share rotate-right"></i
></td
>
1750 <td
class="ACT"><?php
echo report_ACT($ACT10SCNEAR); ?
></td
>
1751 <td
class="ACT"><?php
echo report_ACT($ACT7SCNEAR); ?
></td
>
1752 <td
class="ACT"><?php
echo report_ACT($ACT8SCNEAR); ?
></td
>
1753 <td
class="ACT"><?php
echo report_ACT($ACT9SCNEAR); ?
></td
>
1754 <td
class="ACT"><?php
echo report_ACT($ACT11SCNEAR); ?
>
1767 <td style
="text-align:center;"> <!-- ccNEAR
-->
1768 <table cellpadding
="0" style
="position:relative;text-align:center;font-size:1.5em;margin: 7 5 10 5;border-collapse: separate;">
1770 <td
class="ACT_deselected"> <?php
echo xlt('cc Near{{with correction at Near}}'); ?
> </td
>
1773 <td colspan
="4" style
="text-align:center;font-size:1.0em;">
1776 <td style
="text-align:center;"><?php
echo xlt('R{{right}}'); ?
></td
>
1777 <td
class="ACT"><?php
echo report_ACT($ACT1CCNEAR); ?
></td
>
1778 <td
class="ACT"><?php
echo report_ACT($ACT2CCNEAR); ?
></td
>
1779 <td
class="ACT"><?php
echo report_ACT($ACT3CCNEAR); ?
></td
>
1780 <td style
="text-align:center;"><?php
echo xlt('L{{left}}'); ?
></td
>
1783 <td style
="text-align:right;"><i
class="fa fa-reply rotate-left"></i
></td
>
1784 <td
class="ACT"><?php
echo report_ACT($ACT4CCNEAR); ?
></td
>
1785 <td
class="ACT"><?php
echo report_ACT($ACT5CCNEAR); ?
></td
>
1786 <td
class="ACT"><?php
echo report_ACT($ACT6CCNEAR); ?
></td
>
1787 <td
><i
class="fa fa-share rotate-right"></i
></td
>
1790 <td
class="ACT"><?php
echo report_ACT($ACT10CCNEAR); ?
></td
>
1791 <td
class="ACT"><?php
echo report_ACT($ACT7CCNEAR); ?
></td
>
1792 <td
class="ACT"><?php
echo report_ACT($ACT8CCNEAR); ?
></td
>
1793 <td
class="ACT"><?php
echo report_ACT($ACT9CCNEAR); ?
></td
>
1794 <td
class="ACT"><?php
echo report_ACT($ACT11CCNEAR); ?
></td
>
1805 <?php
if ($NEURO_COMMENTS) { ?
>
1809 <b
><?php
echo xlt('Comments'); ?
>:</b
><br
/>
1810 <span style
="height:3.0em;">
1811 <?php
echo report_ACT($NEURO_COMMENTS); ?
>
1824 //end choice !== 'TEXT' -- include this in summary mouseover report.
1826 <!-- start of IMPPLAN exam
-->
1827 <table
class="report_exam_group">
1829 <td style
="text-align:left;padding:1px;vertical-align:top;width:480px;">
1830 <b
><u
><?php
echo xlt('Impression/Plan'); ?
>:</u
></b
>
1833 <td style
="padding:5px;text-align: left;text-align:justify;width:475px;">
1836 * Retrieve and Display the IMPPLAN_items for the Impression/Plan zone.
1838 $query = "select * from form_".$form_folder."_impplan where form_id=? and pid=? order by IMPPLAN_order ASC";
1839 $result = sqlStatement($query,array($form_id,$pid));
1841 $order = array("\r\n", "\n", "\r","\v","\f","\x85","\u2028","\u2029");
1842 $replace = "<br />";
1844 while ($ip_list = sqlFetchArray($result)) {
1846 'form_id' => $ip_list['form_id'],
1847 'pid' => $ip_list['pid'],
1848 'title' => $ip_list['title'],
1849 'code' => $ip_list['code'],
1850 'codetype' => $ip_list['codetype'],
1851 'codetext' => $ip_list['codetext'],
1852 'plan' => str_replace($order, $replace, $ip_list['plan']),
1853 'IMPPLAN_order' => $ip_list['IMPPLAN_order']
1855 $IMPPLAN_items[$i] =$newdata;
1858 //for ($i=0; $i < count($IMPPLAN_item); $i++) {
1859 foreach ($IMPPLAN_items as $item) {
1860 echo ($item['IMPPLAN_order'] +
1).'. <b>'.text($item['title']).'</b><br />';
1861 echo '<div style="padding-left:15px;">';
1862 $pattern = '/Code/';
1863 if (preg_match($pattern,$item['code'])) $item['code'] = '';
1864 if ($item['codetext'] > '') {
1865 echo $item['codetext']."<br />";
1867 if ($item['code'] > '') {
1868 if ($item['codetype'] > '') {
1869 $item['code'] = $item['codetype'].": ".$item['code'];
1871 echo $item['code']."<br />";
1874 echo $item['plan']."</div><br />";
1876 if ($PLAN && $PLAN != '0') { ?
>
1877 <b
><?php
echo xlt('Orders')."/".xlt('Next Visit'); ?
>:</b
>
1879 <div style
="padding-left:15px;padding-bottom:10px;width:400px;">
1881 $PLAN_items = explode('|',$PLAN);
1882 foreach ($PLAN_items as $item) {
1883 echo $item."<br />";
1886 echo $PLAN2."<br />";
1897 <td style
="text-align:center;vertical-align:bottom;padding:1px;">
1899 display_draw_image ("IMPPLAN",$encounter,$pid);
1902 //display a stored optional electronic sig for this providerID, ie the patient's Doc not the tech
1903 $from_file = $GLOBALS["webserver_root"] ."/interface/forms/".$form_folder."/images/sign_".$providerID.".jpg";
1904 if (file_exists($from_file)) {
1905 echo "<img style='width:50mm;' src='$from_file'><hr style='width:40mm;' />".
1906 text($providerNAME)."<br />
1907 <i style='font-size:9px;'>".xlt('electronically signed on')." ".oeFormatShortDate()."</i>";
1911 <span style
="border-top:1pt solid black;padding-left:50px;"><?php
echo text($providerNAME); ?
></span
>
1914 $signature = $GLOBALS["webserver_root"]."/interface/forms/".$form_folder."/images/sign_".$providerID.".jpg";
1915 if (file_exists($signature)) {
1916 echo "<img src='".$GLOBALS['web_root']."/interface/forms/".$form_folder."/images/sign_".$providerID.".jpg' style='width:30mm; height:6mm;bottom:1px;' height='10' />";
1930 function display_draw_image($zone,$encounter,$pid){
1931 global $form_folder;
1935 $base_name = $pid."_".$encounter."_".$side."_".$zone."_VIEW";
1936 $filename = $base_name.".jpg";
1937 $sql = "SELECT * from documents where documents.url like '%".$filename."'";
1938 $doc = sqlQuery($sql);
1939 $document_id =$doc['id'];
1941 if (($document_id > '1')&&(is_numeric($document_id))) {
1942 $d = new Document($document_id);
1943 $fname = basename($d->get_url());
1945 $couch_docid = $d->get_couch_docid();
1946 $couch_revid = $d->get_couch_revid();
1947 $extension = substr($fname, strrpos($fname,"."));
1948 $notes = Note
::notes_factory($d->get_id());
1949 if (!empty($notes)) echo "<table>";
1950 foreach ($notes as $note) {
1952 echo '<td>' . xlt('Note') . ' #' . $note->get_id() . '</td>';
1955 echo '<td>' . xlt('Date') . ': ' . oeFormatShortDate($note->get_date()) . '</td>';
1958 echo '<td>'.$note->get_note().'<br /><br /></td>';
1961 if (!empty($notes)) echo "</table>";
1963 $url_file = $d->get_url_filepath();
1964 if($couch_docid && $couch_revid){
1965 $url_file = $d->get_couch_url($pid,$encounter);
1967 // Collect filename and path
1968 $from_all = explode("/",$url_file);
1969 $from_filename = array_pop($from_all);
1970 $from_pathname_array = array();
1971 for ($i=0;$i<$d->get_path_depth();$i++
) {
1972 $from_pathname_array[] = array_pop($from_all);
1974 $from_pathname_array = array_reverse($from_pathname_array);
1975 $from_pathname = implode("/",$from_pathname_array);
1977 if($couch_docid && $couch_revid) {
1978 $from_file = $GLOBALS['OE_SITE_DIR'] . '/documents/temp/' . $from_filename;
1979 $to_file = substr($from_file, 0, strrpos($from_file, '.')) . '_converted.jpg';
1982 $from_file = $GLOBALS["fileroot"] . "/sites/" . $_SESSION['site_id'] .
1983 '/documents/' . $from_pathname . '/' . $from_filename;
1984 $to_file = substr($from_file, 0, strrpos($from_file, '.')) . '_converted.jpg';
1987 // if ($extension == ".png" || $extension == ".jpg" || $extension == ".jpeg" || $extension == ".gif") {
1989 echo "<img src='". $from_file."' style='width:220px;height:120px;'>";
1991 $filetoshow = $GLOBALS['webroot']."/controller.php?document&retrieve&patient_id=$pid&document_id=".$doc['id']."&as_file=false&blahblah=".rand();
1992 echo "<img src='".$filetoshow."' style='width:220px;height:120px;'>";
1995 //else show base_image
1998 $filetoshow = "../../forms/".$form_folder."/images/".$side."_".$zone."_BASE.jpg";
1999 if ($PDF_OUTPUT) $filetoshow = $GLOBALS["webroot"] ."/interface/forms/".$form_folder."/images/".$side."_".$zone."_BASE.jpg";
2000 // uncomment to show base image, no touch up by user.
2001 // echo "<img src='". $filetoshow."' style='width:220px;height:120px;'>";
2008 function report_ACT($term) {
2009 $term = nl2br(htmlspecialchars($term,ENT_NOQUOTES
));
2010 return $term." ";