document notes
[openemr.git] / interface / forms / eye_mag / report.php
blob3c2956bfa46dc7dac76f91b242f7606806698130
1 <?php
3 /**
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
9 * across time...
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/>.
26 * @package OpenEMR
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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/lists.inc");
52 require_once(dirname(__FILE__) ."/../../../library/forms.inc");
53 require_once(dirname(__FILE__) ."/../../../library/patient.inc");
55 $form_name = "eye_mag";
56 $form_folder = "eye_mag";
58 $facilityService = new \services\FacilityService();
60 require_once("../../forms/".$form_folder."/php/".$form_folder."_functions.php");
62 if ($_REQUEST['CHOICE']) {
63 $choice = $_REQUEST['choice'];
66 if ($_REQUEST['ptid']) {
67 $pid = $_REQUEST['ptid'];
70 if ($_REQUEST['encid']) {
71 $encounter=$_REQUEST['encid'];
74 if ($_REQUEST['formid']) {
75 $form_id = $_REQUEST['formid'];
78 if ($_REQUEST['formname']) {
79 $form_name=$_REQUEST['formname'];
82 if (!$id) {
83 $id=$form_id;
86 // Get users preferences, for this user
87 // (and if not the default where a fresh install begins from, or someone else's)
88 $query = "SELECT * FROM form_eye_mag_prefs where PEZONE='PREFS' AND id=? ORDER BY ZONE_ORDER,ordering";
89 $result = sqlStatement($query, array($_SESSION['authUserID']));
90 while ($prefs= sqlFetchArray($result)) {
91 $LOCATION = $prefs['LOCATION'];
92 $$LOCATION = text($prefs['GOVALUE']);
95 function eye_mag_report($pid, $encounter, $cols, $id, $formname = 'eye_mag')
97 global $form_folder;
98 global $form_name;
99 global $choice;
101 /** openEMR note: eye_mag Index is id,
102 * linked to encounter in form_encounter
103 * whose encounter is linked to id in forms.
106 $query="select form_encounter.date as encounter_date,form_eye_mag.*
107 from form_eye_mag ,forms,form_encounter
108 where
109 form_encounter.encounter =? and
110 form_encounter.encounter = forms.encounter and
111 form_eye_mag.id=forms.form_id and
112 forms.pid =form_eye_mag.pid and
113 form_eye_mag.pid=? ";
114 $objQuery =sqlQuery($query, array($encounter,$pid));
115 @extract($objQuery);
117 $dated = new DateTime($encounter_date);
118 $dated = $dated->format('Y/m/d');
119 global $visit_date;
121 $visit_date = oeFormatShortDate($dated);
124 * Patient/Client -> Visits -> Visit History, on mouse over this is called with variable "choice".
125 * To use this feature, this "choice" variable must be added programmatically to
126 * /interface/patient_file/history/encounters_ajax.php, currently line 20.
127 * The variable $choice will tell us what to display.
128 * If it is not present it will display everything == 'narrative'.
129 * @param string $choice options NULL,TEXT,DRAW,NARRATIVE
130 * @param string $encounter = encounter number
131 * @param string $pid value = patient id
132 * @return string => returns the HTML of the report selected
135 if ($choice == 'DRAW') {
137 $side="OU";
138 $zone = array("HPI","PMH","VISION","NEURO","EXT","ANTSEG","RETINA","IMPPLAN");
139 // for ($i = 0; $i < count($zone); ++$i) {
140 // show only 2 for now in the encounter page
141 ($choice =='drawing') ? ($count = count($zone)) : ($count ='2');
142 for ($i = 0; $i < $count; ++$i) {
143 $file_location = $GLOBALS["OE_SITES_BASE"]."/".$_SESSION['site_id']."/documents/".$pid."/".$form_folder."/".$encounter."/".$side."_".$zone[$i]."_VIEW.png";
144 $sql = "SELECT * from documents where url='file://".$file_location."'";
145 $doc = sqlQuery($sql);
146 if (file_exists($file_location) && ($doc['id'] > '0')) {
147 $filetoshow = $GLOBALS['web_root']."/controller.php?document&retrieve&patient_id=$pid&document_id=$doc[id]&as_file=false";
148 ?><div style='position:relative;float:left;width:100px;height:75px;'>
149 <img src='<?php echo $filetoshow; ?>' width=100 heght=75>
150 </div> <?
151 } else {
152 // $filetoshow = "../../forms/".$form_folder."/images/".$side."_".$zone[$i]."_BASE.png?".rand();
156 <?php
158 } else if ($choice == "drawing") {
161 <div class="borderShadow">
162 <?php display_draw_section("VISION", $encounter, $pid); ?>
163 </div>
164 <div class="borderShadow">
165 <?php display_draw_section("NEURO", $encounter, $pid); ?>
166 </div>
167 <div class="borderShadow">
168 <?php display_draw_section("EXT", $encounter, $pid); ?>
169 </div>
170 <div class="borderShadow">
171 <?php display_draw_section("ANTSEG", $encounter, $pid); ?>
172 </div>
173 <div class="borderShadow">
174 <?php display_draw_section("RETINA", $encounter, $pid); ?>
175 </div>
176 <div class="borderShadow">
177 <?php display_draw_section("IMPPLAN", $encounter, $pid); ?>
178 </div>
179 <?php
180 } else if ($choice == 'TEXT') {
181 //just display HPI and A/P
182 narrative($pid, $encounter, $cols, $id, 'TEXT');
183 } else if ($choice !="narrative") {
184 narrative($pid, $encounter, $cols, $id, 'narrative');
185 //return;
188 function left_overs()
191 * Keep: this could be co-opted to export an XML/HL7 type of document
193 $count = 0;
194 $data = formFetch($table_name, $id);
196 if ($data) {
197 foreach ($data as $key => $value) {
198 $$key=$value;
204 * This is the core report, including Practice logo, patient ID/header.
205 * It relies on the presence of the PMSFH,IMPPLAN arrays.
206 * Rest of fields are pulled from the DB.
208 function narrative($pid, $encounter, $cols, $form_id, $choice = 'full')
210 global $form_folder;
211 global $PDF_OUTPUT;
212 global $OE_SITE_DIR;
213 global $formres;
214 global $dateres;
215 global $printable;
216 global $facilityService;
217 //if $cols == 'Fax', we are here from taskman, making a fax and this a one page short form - leave out PMSFH, prescriptions
218 //and any clinical area that is blank.
219 $query="select form_encounter.date as encounter_date,form_eye_mag.id as form_id,form_encounter.*, form_eye_mag.*
220 from form_eye_mag ,forms,form_encounter
221 where
222 form_encounter.encounter =? and
223 form_encounter.encounter = forms.encounter and
224 form_eye_mag.id=forms.form_id and
225 forms.deleted != '1' and
226 form_eye_mag.pid=? ";
228 $encounter_data =sqlQuery($query, array($encounter,$pid));
229 @extract($encounter_data);
230 $providerID = getProviderIdOfEncounter($encounter);
231 $providerNAME = getProviderName($providerID);
232 $dated = new DateTime($encounter_date);
233 $dated = $dated->format('Y/m/d');
234 $visit_date = oeFormatShortDate($dated);
237 <link rel="stylesheet" href="<?php echo attr($css_header);?>" type="text/css">
238 <link rel="stylesheet" href="../../forms/<?php echo attr($form_folder); ?>/css/report.css" type="text/css">
239 <style>
241 <?php if ($PDF_OUTPUT) { ?>
242 .mot {
243 text-align: center;
244 width:3mm;
245 height:3mm;
247 <?php } else { ?>
248 .mot {
249 text-align: center;
250 width:5mm;
251 height:5mm;
254 <?php } ?>
255 </style>
256 <div>
257 <?php
258 if (($cols =='Fax')||($cols=='Report')) {
259 echo report_header($pid, 'PDF');
262 if ($PDF_OUTPUT) {
263 $titleres = getPatientData($pid, "fname,lname,providerID,DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
264 $facility = null;
265 if ($_SESSION['pc_facility']) {
266 $facility = $facilityService->getById($_SESSION['pc_facility']);
267 } else {
268 $facility = $facilityService->getPrimaryBillingLocation();
272 if ($choice !== 'TEXT') { ?>
274 <?php
275 } ?>
276 <table class="report_exam_group">
277 <tr>
278 <td style="text-align:left;padding:1px;vertical-align:top;max-width:720px;">
279 <table style="padding:5px;width:700px;">
280 <tr>
281 <td colspan="1" style="text-align: justify;text-justify: inter-word;width:100%;">
282 <b><?php echo xlt('Chief Complaint'); ?>:</b> &nbsp;<?php echo text($CC1); ?>
283 <br /><br />
284 <b><?php echo xlt('HPI'); ?>:</b>
285 &nbsp;<?php echo $HPI1; ?>
286 <br />
287 <div style="padding-left:20px;">
288 <?php
289 if ($TIMING1) {
290 echo "<i>".xlt('Timing'); ?>:</i> &nbsp;<?php echo text($TIMING1)."<br />";
293 if ($CONTEXT1) {
294 echo "<i>".xlt('Context'); ?>:</i> &nbsp;<?php echo text($CONTEXT1)."<br />";
297 if ($SEVERITY1) {
298 echo "<i>".xlt('Severity'); ?>:</i> &nbsp;<?php echo text($SEVERITY1)."<br />";
301 if ($MODIFY1) {
302 echo "<i>".xlt('Modifying'); ?>:</i> &nbsp;<?php echo text($MODIFY1)."<br />";
305 if ($ASSOCIATED1) {
306 echo "<i>".xlt('Associated'); ?>:</i> &nbsp;<?php echo text($ASSOCIATED1)."<br />";
309 if ($LOCATION1) {
310 echo "<i>".xlt('Location'); ?>:</i> &nbsp;<?php echo text($LOCATION1)."<br />";
313 if ($QUALITY1) {
314 echo "<i>".xlt('Quality'); ?>:</i> &nbsp;<?php echo text($QUALITY1)."<br />";
317 if ($DURATION1) {
318 echo "<i>".xlt('Duration'); ?>:</i> &nbsp;<?php echo text($DURATION1)."<br />";
322 <?php
323 if ($CC2) {
324 echo "
326 echo "<b>".xlt('Chief Complaint 2'); ?>:</b> &nbsp;<?php echo text($CC2); ?>
327 <br />
328 <b><?php echo xlt('HPI'); ?>:</b>
329 &nbsp;<?php echo text($HPI2); ?>
330 <br />
332 <div style="padding-left:10px;">
333 <?php
334 if ($TIMING2) {
335 echo "<i>".xlt('Timing'); ?>:</i> &nbsp;<?php echo text($TIMING2)."<br />";
338 if ($CONTEXT2) {
339 echo "<i>".xlt('Context'); ?>:</i> &nbsp;<?php echo text($CONTEXT2)."<br />";
342 if ($SEVERITY2) {
343 echo "<i>".xlt('Severity'); ?>:</i> &nbsp;<?php echo text($SEVERITY2)."<br />";
346 if ($MODIFY2) {
347 echo "<i>".xlt('Modifying'); ?>:</i> &nbsp;<?php echo text($MODIFY2)."<br />";
350 if ($ASSOCIATED2) {
351 echo "<i>".xlt('Associated'); ?>:</i> &nbsp;<?php echo text($ASSOCIATED2)."<br />";
354 if ($LOCATION2) {
355 echo "<i>".xlt('Location'); ?>:</i> &nbsp;<?php echo text($LOCATION2)."<br />";
358 if ($QUALITY2) {
359 echo "<i>".xlt('Quality'); ?>:</i> &nbsp;<?php echo text($QUALITY2)."<br />";
362 if ($DURATION2) {
363 echo "<i>".xlt('Duration'); ?>:</i> &nbsp;<?php echo text($DURATION2)."<br />";
366 </div>
367 <?php
370 if ($CC3) {
374 <?php echo "<b>".xlt('Chief Complaint 3'); ?>:</b> &nbsp;<?php echo text($CC3); ?>
375 <br />
376 <?php echo xlt('HPI'); ?>&nbsp; <?php echo text($HPI3); ?>
377 <br />
378 <div style="padding-left:10px;">
379 <?php
380 if ($TIMING3) {
381 echo "<i>".xlt('Timing'); ?>:</i> &nbsp;<?php echo text($TIMING3)."<br />";
384 if ($CONTEXT3) {
385 echo "<i>".xlt('Context'); ?>:</i> &nbsp;<?php echo text($CONTEXT3)."<br />";
388 if ($SEVERITY3) {
389 echo "<i>".xlt('Severity'); ?>:</i> &nbsp;<?php echo text($SEVERITY3)."<br />";
392 if ($MODIFY3) {
393 echo "<i>".xlt('Modifying'); ?>:</i> &nbsp;<?php echo text($MODIFY3)."<br />";
396 if ($ASSOCIATED3) {
397 echo "<i>".xlt('Associated'); ?>:</i> &nbsp;<?php echo text($ASSOCIATED3)."<br />";
400 if ($LOCATION3) {
401 echo "<i>".xlt('Location'); ?>:</i> &nbsp;<?php echo text($LOCATION3)."<br />";
404 if ($QUALITY3) {
405 echo "<i>".xlt('Quality'); ?>:</i> &nbsp;<?php echo text($QUALITY3)."<br />";
408 if ($DURATION3) {
409 echo "<i>".xlt('Duration'); ?>:</i> &nbsp;<?php echo text($DURATION3)."<br />";
412 </div>
414 <?php
418 <?php
419 if (($CHRONIC1)&&($cols != 'Fax')) { ?>
420 <b><?php echo xlt('Chronic or Inactive Problems'); ?>:</b> <br />
421 &nbsp;<?php echo text($CHRONIC1)."<br />";
422 if ($CHRONIC2) {
423 echo "&nbsp;".$CHRONIC2."<br />";
426 if ($CHRONIC3) {
427 echo "&nbsp;".$CHRONIC3."<br />";
429 } ?>
430 </div>
431 </td>
432 </tr>
433 </table>
434 </td>
435 <td style="width:220px;padding:1px;vertical-align:top;">
436 <?php
437 //get patient photo
438 //no idea if this works for couchDB people
439 $sql = "SELECT * FROM documents,categories,categories_to_documents WHERE
440 documents.id=categories_to_documents.document_id and
441 categories.id=categories_to_documents.category_id and
442 categories.name='Patient Photograph' and
443 documents.foreign_id=?";
444 $doc = sqlQuery($sql, array($pid));
445 $document_id =$doc['document_id'];
446 if (is_numeric($document_id)) {
447 $d = new Document($document_id);
448 $fname = basename($d->get_url());
449 $couch_docid = $d->get_couch_docid();
450 $couch_revid = $d->get_couch_revid();
451 $url_file = $d->get_url_filepath();
452 if ($couch_docid && $couch_revid) {
453 $url_file = $d->get_couch_url($pid, $encounter);
456 // Collect filename and path
457 $from_all = explode("/", $url_file);
458 $from_filename = array_pop($from_all);
459 $from_pathname_array = array();
460 for ($i=0; $i<$d->get_path_depth(); $i++) {
461 $from_pathname_array[] = array_pop($from_all);
464 $from_pathname_array = array_reverse($from_pathname_array);
465 $from_pathname = implode("/", $from_pathname_array);
466 if ($couch_docid && $couch_revid) {
467 $from_file = $GLOBALS['OE_SITE_DIR'] . '/documents/temp/' . $from_filename;
468 } else {
469 $from_file = $GLOBALS["fileroot"] . "/sites/" . $_SESSION['site_id'] .
470 '/documents/' . $from_pathname . '/' . $from_filename;
473 if ($PDF_OUTPUT) {
474 echo "<img src='". $from_file."' style='width:220px;'>";
475 } else {
476 $filetoshow = $GLOBALS['webroot']."/controller.php?document&retrieve&patient_id=$pid&document_id=".$doc['document_id']."&as_file=false&blahblah=".rand();
477 echo "<img src='".$filetoshow."' style='width:220px;'>";
481 </td>
482 </tr>
483 </table>
484 <?php
485 if ($choice !== 'TEXT') {
486 //exclude all of this from displaying on the summary mouseover by default
488 <hr style="width:50%;text-align:center;" />
489 <table style="margin:1 auto;" class="report_exam_group">
490 <tr>
491 <td style="width:680px;text-align:center;margin:1 auto;">
492 <?php
493 $PMSFH = build_PMSFH($pid);
494 if ($cols !='Fax') {
495 show_PMSFH_report($PMSFH);
498 $count_rx = '0';
500 $query = "select * from form_eye_mag_wearing where PID=? and FORM_ID=? and ENCOUNTER=? ORDER BY RX_NUMBER";
501 $wear = sqlStatement($query, array($pid,$form_id,$encounter));
502 while ($wearing = sqlFetchArray($wear)) {
503 $count_rx++;
504 ${"display_W_$count_rx"} = '';
505 ${"ODSPH_$count_rx"} = $wearing['ODSPH'];
506 ${"ODCYL_$count_rx"} = $wearing['ODCYL'];
507 ${"ODAXIS_$count_rx"} = $wearing['ODAXIS'];
508 ${"OSSPH_$count_rx"} = $wearing['OSSPH'];
509 ${"OSCYL_$count_rx"} = $wearing['OSCYL'];
510 ${"OSAXIS_$count_rx"} = $wearing['OSAXIS'];
511 ${"ODMIDADD_$count_rx"} = $wearing['ODMIDADD'];
512 ${"OSMIDADD_$count_rx"} = $wearing['OSMIDADD'];
513 ${"ODADD_$count_rx"} = $wearing['ODADD'];
514 ${"OSADD_$count_rx"} = $wearing['OSADD'];
515 ${"ODVA_$count_rx"} = $wearing['ODVA'];
516 ${"OSVA_$count_rx"} = $wearing['OSVA'];
517 ${"ODNEARVA_$count_rx"} = $wearing['ODNEARVA'];
518 ${"OSNEARVA_$count_rx"} = $wearing['OSNEARVA'];
519 ${"ODPRISM_$count_rx"} = $wearing['ODPRISM'];
520 ${"OSPRISM_$count_rx"} = $wearing['OSPRISM'];
521 ${"COMMENTS_$count_rx"} = $wearing['COMMENTS'];
522 ${"W_$count_rx"} = '1';
523 ${"RX_TYPE_$count_rx"} = $wearing['RX_TYPE'];
527 </td>
528 </tr>
529 </table>
530 <table class="borderShadow" >
531 <tr style="font-size:10px;">
532 <!-- Start of the Vision box -->
533 <td class="report_vitals">
534 <b class="underline"><?php echo xlt('Visual Acuities'); ?></b>
535 <table id="Additional_VA" cellspacing="2" style="text-align:center;font-size:1.0em;">
536 <tr style="font-weight:bold;">
537 <td style="text-align:center;"></td>
538 <td style="width:50px;text-align:center;text-decoration:underline;"><?php echo xlt('OD'); ?></td>
539 <td style="width:50px;text-align:center;text-decoration:underline;"><?php echo xlt('OS'); ?></td>
540 </tr>
541 <?php if ($SCODVA||$SCOSVA) { ?>
542 <tr>
543 <td><?php echo xlt('sc{{without correction}}'); ?></td>
544 <td><?php echo text($SCODVA); ?></td>
545 <td><?php echo text($SCOSVA); ?></td>
546 </tr>
547 <?php } if ($ODVA_1||$OSVA_1) { ?>
548 <tr>
549 <td><?php echo xlt('cc{{with correction}}'); ?></td>
550 <td><?php echo text($ODVA_1); ?></td>
551 <td><?php echo text($OSVA_1); ?></td>
552 </tr>
553 <?php } if ($ARODVA||$AROSVA) { ?>
554 <tr>
555 <td><?php echo xlt('AR{{autorefraction}}'); ?></td>
556 <td><?php echo text($ARODVA); ?></td>
557 <td><?php echo text($AROSVA); ?></td>
558 </tr>
559 <?php } if ($MRODVA||$MROSVA) { ?>
560 <tr>
561 <td><?php echo xlt('MR{{Manifest Refraction}}'); ?></td>
562 <td><?php echo text($MRODVA); ?></td>
563 <td><?php echo text($MROSVA); ?></td>
564 </tr>
565 <?php } if ($CRODVA||$CROSVA) { ?>
566 <tr>
567 <td><?php echo xlt('CR{{Cycloplegic Refraction}}'); ?></td>
568 <td><?php echo text($CRODVA); ?></td>
569 <td><?php echo text($CROSVA); ?></td>
570 </tr>
571 <?php } if ($PHODVA||$PHOSVA) { ?>
572 <tr>
573 <td><?php echo xlt('PH{{Pinhole Vision}}'); ?></td>
574 <td><?php echo text($PHODVA); ?></td>
575 <td><?php echo text($PHOSVA); ?></td>
576 </tr>
577 <?php } if ($CTLODVA||$CTLOSVA) { ?>
578 <tr>
579 <td><?php echo xlt('CTL{{Contact Lens Vision}}'); ?></td>
580 <td><?php echo text($CTLODVA); ?></td>
581 <td><?php echo text($CTLOSVA); ?></td>
582 </tr>
583 <?php } if ($SCNEARODVA||$SCNEAROSVA) { ?>
584 <tr>
585 <td><?php echo xlt('scNear{{without correction near}}'); ?></td>
586 <td><?php echo text($SCNEARODVA); ?></td>
587 <td><?php echo text($SCNEAROSVA); ?></td>
588 </tr>
589 <?php } if ($ODNEARVA_1||$WNEAROSVA_1) { ?>
590 <tr>
591 <td><?php echo xlt('ccNear{{with correction at near}}'); ?></td>
592 <td><?php echo text($ODNEARVA_1); ?></td>
593 <td><?php echo text($OSNEARVA_1); ?></td>
594 </tr>
595 <?php } if ($ARNEARODVA||$ARNEAROSVA) { ?>
596 <tr>
597 <td><?php echo xlt('ARNear{{Auto-refraction near acuity}}'); ?></td>
598 <td><?php echo text($ARNEARODVA); ?></td>
599 <td><?php echo text($ARNEAROSVA); ?></td>
600 </tr>
601 <?php } if ($MRNEARODVA||$MRNEAROSVA) { ?>
602 <tr>
603 <td><?php echo xlt('MRNear{{Manifest Near Acuity}}'); ?></td>
604 <td><?php echo text($MRNEARODVA); ?></td>
605 <td><?php echo text($MRNEAROSVA); ?></td>
606 </tr>
607 <?php } if ($PAMODVA||$PAMOSVA) { ?>
608 <tr>
609 <td><?php echo xlt('PAM{{Potential Acuity Meter}}'); ?></td>
610 <td><?php echo text($PAMODVA); ?></td>
611 <td><?php echo text($PAMOSVA); ?></td>
612 </tr>
613 <?php } if ($GLAREODVA||$GLAREOSVA) { ?>
614 <tr>
615 <td><?php echo xlt('Glare{{Acuity under Glare conditions}}'); ?></td>
616 <td><?php echo text($GLAREODVA); ?></td>
617 <td><?php echo text($GLAREOSVA); ?></td>
618 </tr>
619 <?php } if ($CONTRASTODVA||$CONTRASTOSVA) { ?>
620 <tr>
621 <td><?php echo xlt('Contrast{{Constrast Visual Acuity}}'); ?></td>
622 <td><?php echo text($CONTRASTODVA); ?></td>
623 <td><?php echo text($CONTRASTOSVA); ?></td>
624 </tr>
625 <?php } ?>
626 </table>
627 </td>
628 <!-- START OF THE PRESSURE BOX -->
629 <td class="report_vitals">
630 <b class="underline"><?php echo xlt('Intraocular Pressures'); ?></b>
631 <table cellspacing="2" style="margin:2;text-align:center;font-size:1.0em;">
632 <tr style="font-weight:bold;">
633 <td style="text-align:center;"></td>
634 <td style="text-align:center;text-decoration:underline;"><?php echo xlt('OD'); ?></td>
635 <td style="text-align:center;text-decoration:underline;"><?php echo xlt('OS'); ?></td>
636 </tr>
637 <?php
638 if ($ODIOPAP||$OSIOPAP) {
639 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>";
642 if ($ODIOPTPN||$OSIOPTPN) {
643 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>";
646 if ($ODIOPFTN||$OSIOPFTN) {
647 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>";
650 <tr>
651 <td colspan="3" style="text-align:center;">
652 @ <?php echo text($IOPTIME); ?>
653 </td>
654 </tr>
655 </table>
656 </td>
657 <!-- START OF THE FIELDS BOX -->
658 <?php
659 // if the VF zone is checked, display it
660 // if ODVF1 = 1 (true boolean) the value="0" checked="true"
661 for ($z=1; $z <5; $z++) {
662 $ODzone = "ODVF".$z;
663 if ($$ODzone =='1') {
664 $ODVF[$z] = '<i class="fa fa-square fa-5">X</i>';
665 if ($PDF_OUTPUT) {
666 $ODVF[$z] = 'X';
669 $bad++;
670 } else {
671 $ODVF[$z] = '<i class="fa fa-square-o fa-5"></i>';
672 if ($PDF_OUTPUT) {
673 $ODVF[$z] = 'O';
677 $OSzone = "OSVF".$z;
678 if ($$OSzone =="1") {
679 $OSVF[$z] = '<i class="fa fa-square fa-5">X</i>';
680 if ($PDF_OUTPUT) {
681 $OSVF[$z] = 'X';
684 $bad++;
685 } else {
686 $OSVF[$z] = '<i class="fa fa-square-o fa-5"></i>';
687 if ($PDF_OUTPUT) {
688 $OSVF[$z] = 'O';
693 <?php
694 if ($bad < '1') { ?>
695 <td class="report_vitals">
696 <b class="underline"><?php echo xlt('Fields{{visual fields}}'); ?></b>
697 <?php
698 echo "<br /><br />&nbsp;Full to CF OU&nbsp;<br /><br /><br />";
699 } else {
701 <td class="report_vitals">
702 <b class="underline"><?php echo xlt('Fields{{visual fields}}'); ?></b>
703 <table style="font-size:1.0em;text-align:center;">
704 <tr style="font-weight:bold;">
705 <td style="width:0.5in;text-align:center;text-decoration:underline;" colspan="2"><b><?php echo xlt('OD'); ?></b>
706 <br />
707 <br />
708 </td>
709 <td style="width:0.1in;"> </td>
710 <td style="width:0.5in;text-align:center;text-decoration:underline;" colspan="2"><b><?php echo xlt('OS'); ?></b>
711 <br />
712 <br />
713 </td>
714 </tr>
715 <tr>
716 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:center;">
717 <?php echo $ODVF['1']; ?>
718 </td>
719 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:center;">
720 <?php echo $ODVF['2']; ?>
721 </td>
722 <td></td>
723 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:center;">
724 <?php echo $OSVF['1']; ?>
725 </td>
726 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:center;">
727 <?php echo $OSVF['2']; ?>
728 </td>
729 </tr>
730 <tr>
731 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:center;">
732 <?php echo $ODVF['3']; ?>
733 </td>
734 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:center;">
735 <?php echo $ODVF['4']; ?>
736 </td>
737 <td></td>
738 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:center;">
739 <?php echo $OSVF['3']; ?>
740 </td>
741 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:center;">
742 <?php echo $OSVF['4']; ?>
743 </td>
744 </tr>
745 </table>
746 <?php
747 } ?>
748 </td>
750 <!-- START OF THE MOTILITY BOX -->
751 <td class="report_vitals">
752 <b class="underline"><?php echo xlt('Motility'); ?></b>
753 <?php
754 if ($MOTILITYNORMAL =='on') {
755 echo "<br /><br />&nbsp;".xlt('D&V Full OU{{Ductions and Versions full both eyes}}') ."&nbsp;<br /><br />";
756 } else {
757 if ($PDF_OUTPUT) {
758 $background = "url(".$GLOBALS["fileroot"] . "/interface/forms/".$form_folder."/images/eom.jpg)";
759 } else {
760 $background = "url(../../forms/".$form_folder."/images/eom.bmp)";
763 $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");
764 for ($i = 0; $i < count($zone); ++$i) {
765 ($$zone[$i] >= '1') ? ($$zone[$i] = "-".$$zone[$i]) : ($$zone[$i] = '');
768 <table style="font-size:1.0em;">
769 <tr style="font-weight:bold;">
770 <td style="text-align:center;text-decoration:underline;"><?php echo xlt('OD'); ?></td>
771 <td style="text-align:center;text-decoration:underline;"><?php echo xlt('OS'); ?></td>
772 </tr>
773 <tr>
774 <td style="font-weight:600;">
775 <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;">
776 <tr>
777 <td class="mot"><?php echo $MOTILITY_RRSO; ?></td>
778 <td class="mot"><?php echo $MOTILITY_RS; ?></td>
779 <td class="mot"><?php echo $MOTILITY_RLSO; ?></td>
780 </tr>
781 <tr>
782 <td class="mot"><?php echo $MOTILITY_RR; ?></td>
783 <td class="mot"><?php echo $MOTILITY_R0; ?></td>
784 <td class="mot"><?php echo $MOTILITY_RL; ?></td>
785 </tr>
786 <tr>
787 <td class="mot"><?php echo $MOTILITY_RRIO; ?></td>
788 <td class="mot"><?php echo $MOTILITY_RI; ?></td>
789 <td class="mot"><?php echo $MOTILITY_RLIO; ?></td>
790 </tr>
791 </table>
792 </td>
793 <td style="text-align:center;font-weight:600;padding-left:20px;">
794 <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;">
795 <tr>
796 <td class="mot"><?php echo $MOTILITY_LRSO; ?></td>
797 <td class="mot"><?php echo $MOTILITY_LS; ?></td>
798 <td class="mot"><?php echo $MOTILITY_LLSO; ?></td>
799 </tr>
800 <tr>
801 <td class="mot"><?php echo $MOTILITY_LR; ?></td>
802 <td class="mot"><?php echo $MOTILITY_L0; ?></td>
803 <td class="mot"><?php echo $MOTILITY_LL; ?></td>
804 </tr>
805 <tr>
806 <td class="mot"><?php echo $MOTILITY_LLIO; ?></td>
807 <td class="mot"><?php echo $MOTILITY_LI; ?></td>
808 <td class="mot"><?php echo $MOTILITY_LLIO; ?></td>
809 </tr>
810 </table>
811 </td>
812 </tr>
813 </table>
814 <?php
815 } ?>
816 </td>
818 <?php
819 if (($PUPIL_NORMAL =='1')|| $ODPUPILSIZE1||$OSPUPILSIZE1) {
821 <td class="report_vitals" style="border-right:0px;">
822 <?php
823 if (($PUPIL_NORMAL =='1')&&(!$ODPUPILSIZE1||!$OSPUPILSIZE1)) { ?>
824 <b class="underline"><?php echo xlt('Pupils'); ?></b>&nbsp;&nbsp;
825 <?php echo xlt('Round and Reactive')."<br />";
828 if ($ODPUPILSIZE1||$OSPUPILSIZE1) { ?>
829 <table cellspacing="0" style="margin:1px;text-align:center;font-size:9px;">
830 <tr>
831 <!-- start of the Pupils box -->
832 <td>
833 <b class="underline"><?php echo xlt('Pupils'); ?></b>
834 <table style="font-size: 8px;text-align:middle;">
835 <tr>
836 <th> &nbsp;
837 </th>
838 <th style="padding: 2px 5px;"><?php echo xlt('size'); ?> (<?php echo xlt('mm{{millimeters}}'); ?>)
839 </th>
840 <th style="padding: 2px;"><?php echo xlt('react{{reactivity}}'); ?>
841 </th>
842 <th style="padding: 2px;"><?php echo xlt('APD{{afferent pupillary defect}}'); ?>
843 </th>
844 </tr>
845 <tr>
846 <td><b><?php echo xlt('OD'); ?></b>
847 </td>
848 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:center;">
849 <?php echo text($ODPUPILSIZE1); ?>
850 --&gt;
851 <?php echo text($ODPUPILSIZE2); ?>
852 </td>
853 <td style="text-align:center;border-left:1pt solid black;border-right:1pt solid black;border-bottom:1pt solid black;">
854 <?php echo text($ODPUPILREACTIVITY); ?>
855 </td>
856 <td style="text-align:center;border-bottom:1pt solid black;">
857 <?php echo text($ODAPD); ?>
858 </td>
859 </tr>
860 <tr>
861 <td><b><?php echo xlt('OS'); ?></b>
862 </td>
863 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:center;">
864 <?php echo text($OSPUPILSIZE1); ?>
865 --&gt;
866 <?php echo text($OSPUPILSIZE2); ?>
867 </td>
868 <td style="text-align:center;border-left:1pt solid black;border-right:1pt solid black;border-top:1pt solid black;">
869 <?php echo text($OSPUPILREACTIVITY); ?>
870 </td>
871 <td style="text-align:center;border-top:1pt solid black;">
872 <?php echo text($OSAPD); ?>
873 </td>
874 </tr>
875 </table>
876 </td>
877 </tr>
878 </table>
879 </td>
880 <?php
882 } ?>
883 </tr>
884 </table>
885 <?php
887 if ($DIMODPUPILSIZE1||$DIMOSPUPILSIZE1||$PUPIL_COMMENTS||$AMSLEROD||$AMSLEROS) { ?>
888 <!-- start of slide down pupils_panel -->
889 <br />
890 <table class='borderShadow' style="margin:1px;text-align:center;font-size:9px;">
891 <tr>
892 <td>
893 <b class="underline"><?php echo xlt('Pupils') ?>: <?php echo xlt('Dim'); ?></b>
894 <table style="report_vitals" style="font-size: 8px;text-align:middle;">
895 <tr >
896 <th></th>
897 <th style="padding: 2px;text-align:center;" ><?php echo xlt('size'); ?> (<?php echo xlt('mm{{millimeters}}'); ?>)
898 </th>
899 </tr>
900 <tr>
901 <td><b><?php echo xlt('OD'); ?></b>
902 </td>
903 <td style="text-align:bottom;border-bottom:1pt solid black;padding-left:0.1in;">
904 <?php echo text($DIMODPUPILSIZE1); ?>
905 --&gt;
906 <?php echo text($DIMODPUPILSIZE2); ?>
907 </td>
909 </tr>
910 <tr>
911 <td ><b><?php echo xlt('OS'); ?></b>
912 </td>
913 <td style="border-top:1pt solid black;padding-left:0.1in;">
914 <?php echo text($DIMOSPUPILSIZE1); ?>
915 --&gt;
916 <?php echo text($DIMOSPUPILSIZE2); ?>
917 </td>
918 </tr>
919 <tr><td colspan="2" style="padding-left:2px;text-align:bottom;">
921 <?php echo text($PUPIL_COMMENTS); ?>
922 </td>
923 </tr>
924 </table>
925 </td>
926 <!-- end of slide down pupils_panel -->
927 <!-- START OF THE AMSLER BOX -->
928 <?php if ($AMSLEROD||$AMSLEROS) { ?>
929 <td class="report_vitals" style="border-right:0px;border-left:1pt solid black;">
930 <b class="underline"><?php echo xlt('Amsler'); ?></b>
931 <?php
932 if (!$AMSLEROD) {
933 $AMSLEROD= "0";
936 if (!$AMSLEROS) {
937 $AMSLEROS= "0";
940 <table style="font-size:1.0em;">
941 <tr style="font-weight:bold;">
942 <td style="text-align:center;text-decoration:underline;"><?php echo xlt('OD'); ?></td>
943 <td></td>
944 <td style="text-align:center;text-decoration:underline;"><?php echo xlt('OS'); ?></td>
945 </tr>
947 <tr>
948 <td style="text-align:center;">
949 <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;" />
950 <br />
951 <small><?php echo text($AMSLEROD); ?>/5</small>
952 </td>
953 <td></td>
954 <td style="text-align:center;">
955 <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;" />
956 <br /><small><?php echo text($AMSLEROS); ?>/5</small>
957 </td>
958 </tr>
959 </table>
960 </td>
961 <?php } ?>
962 </tr>
963 </table>
965 <?php
968 if ($cols !='Fax') {
969 if ($ODVA||$OSVA||$ARODSPH||$AROSSPH||$MRODSPH||$MROSSPH||$CRODSPH||$CROSSPH||$CTLODSPH||$CTLOSSPH) { ?>
970 <!-- start of the refraction boxes -->
971 <br />
972 <table class="refraction_tables">
973 <tr>
974 <td colspan="9" style="text-align:left;text-decoration:underline;font-weight:bold;"><?php echo xlt('Refractive States'); ?>
975 </td>
976 </tr>
977 <tr style="text-align:center;padding:5px;text-decoration:underline;">
978 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('Type').$count_rx; ?></td>
979 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('Eye'); ?></td>
980 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('Sph{{Sphere}}'); ?></td>
981 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('Cyl{{Cylinder}}'); ?></td>
982 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('Axis{{Axis of a glasses prescription}}'); ?></td>
983 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('Prism'); ?></td>
984 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('Acuity'); ?></td>
985 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('Mid{{Middle Distance Add}}'); ?></td>
986 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('ADD{{Near Add}}'); ?></td>
987 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('Acuity'); ?></td>
988 </tr>
989 <?php
990 //$count_rx++;
991 for ($i=1; $i <= $count_rx; $i++) {
992 if (${"RX_TYPE_$i"} =="0") {
993 $RX_TYPE = '';
994 } else if (${"RX_TYPE_$i"} =="1") {
995 $RX_TYPE = xlt('Bifocals');
996 } else if (${"RX_TYPE_$i"} =="2") {
997 $RX_TYPE = xlt('Trifocals');
998 } else if (${"RX_TYPE_$i"} =="3") {
999 $RX_TYPE = xlt('Progressive');
1003 Note html2pdf does not like the last field of a table to be blank.
1004 If it is it will squish the lines together.
1005 Work around: if the field is blank, then replace it with a "-" else echo it.
1006 aka echo (text($field))?:"-");
1009 <tr>
1010 <td style="font-weight:600;font-size:0.7em;text-align:right;"><?php echo xlt('Current RX')." #".$i.": "; ?></td>
1011 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('OD{{right eye}}'); ?></td>
1012 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"ODSPH_$i"})?:"-"); ?></td>
1013 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"ODCYL_$i"})?:"-"); ?></td>
1014 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"ODAXIS_$i"})?:"-"); ?></td>
1015 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"ODPRISM_$i"})?:"-"); ?></td>
1016 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"ODVA_$i"})?:"-"); ?></td>
1017 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"ODMIDADD_$i"})?:"-"); ?></td>
1018 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"ODADD_$i"})?:"-"); ?></td>
1019 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"ODNEARVA_$i"})?:"-"); ?></td>
1020 </tr>
1021 <tr>
1022 <td style="font-weight:600;font-size:0.7em;text-align:right;"><?php echo $RX_TYPE; ?></td>
1023 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('OS{{left eye}}'); ?></td>
1024 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"OSSPH_$i"})?:"-"); ?></td>
1025 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"OSCYL_$i"})?:"-"); ?></td>
1026 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"OSAXIS_$i"})?:"-"); ?></td>
1027 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"OSPRISM_$i"})?:"-"); ?></td>
1028 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"OSVA_$i"})?:"-"); ?></td>
1029 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"OSMIDADD_$i"})?:"-"); ?></td>
1030 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"OSADD_$i"})?:"-"); ?></td>
1031 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text(${"OSNEARVA_$i"})?:"-"); ?></td>
1032 </tr>
1033 <?php
1034 if (${"COMMENTS_$i"}) {
1036 <tr>
1037 <td></td>
1038 <td colspan="2"><?php echo xlt('Comments'); ?>:</td>
1039 <td colspan="7"><?php echo text(${"COMMENTS_$i"}); ?></td>
1040 </tr>
1041 <?php
1045 if ($ARODSPH||$AROSSPH) { ?>
1046 <tr style="border-bottom:1pt solid black;">
1047 <td style="font-weight:600;font-size:0.7em;text-align:right;"><?php echo xlt('Auto Refraction'); ?></td>
1048 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('OD{{right eye}}'); ?></td>
1049 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($ARODSPH)?:"-"); ?></td>
1050 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($ARODCYL)?:"-"); ?></td>
1051 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($ARODAXIS)?:"-"); ?></td>
1052 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($ARODPRISM)?:"-"); ?></td>
1053 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($ARODVA)?:"-"); ?></td>
1054 <td style="font-weight:400;font-size:1.0em;text-align:center;">-</td>
1055 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($ARODADD)?:"-"); ?></td>
1056 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($ARNEARODVA)?:"-"); ?></td>
1057 </tr>
1058 <tr>
1059 <td>&nbsp;</td>
1060 <td style="font-weight:400;font-size:1.0em;text-align:right;"><?php echo xlt('OS{{left eye}}'); ?></td>
1061 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($AROSSPH)?:"-"); ?></td>
1062 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($AROSCYL)?:"-"); ?></td>
1063 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($AROSAXIS)?:"-"); ?></td>
1064 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($AROSPRISM)?:"-"); ?></td>
1065 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($AROSVA)?:"-"); ?></td>
1066 <td style="font-weight:400;font-size:1.0em;text-align:center;">-</td>
1067 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($AROSADD)?:"-"); ?></td>
1068 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($ARNEAROSVA)?:"-"); ?></td>
1069 </tr>
1070 <?php
1071 if (${"COMMENTS_$i"}) {
1073 <tr>
1074 <td></td><td></td>
1075 <td>Comments:</td>
1076 <td colspan="7"><?php echo text(${"COMMENTS_$i"}); ?></td>
1077 </tr>
1078 <?php
1082 if ($MRODSPH||$MROSSPH) { ?>
1083 <tr>
1084 <td style="font-weight:600;font-size:0.7em;text-align:right;"><?php echo xlt('Manifest (Dry) Refraction'); ?></td>
1085 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('OD{{right eye}}'); ?></td>
1086 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MRODSPH)?:"-"); ?></td>
1087 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MRODCYL)?:"-"); ?></td>
1088 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MRODAXIS)?:"-"); ?></td>
1089 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MRODPRISM)?:"-"); ?></td>
1090 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MRODVA)?:"-"); ?></td>
1091 <td style="font-weight:400;font-size:1.0em;text-align:center;">-</td>
1092 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MRODADD)?:"-"); ?></td>
1093 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MRNEARODVA)?:"-"); ?></td>
1094 </tr>
1095 <tr></tr>
1096 <tr>
1097 <td></td>
1098 <td style="font-weight:400;font-size:1.0em;text-align:right;"><?php echo xlt('OS{{left eye}}'); ?></td>
1099 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MROSSPH)?:"-"); ?></td>
1100 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MROSCYL)?:"-"); ?></td>
1101 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MROSAXIS)?:"-"); ?></td>
1102 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MROSPRISM)?:"-"); ?></td>
1103 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MROSVA)?:"-"); ?></td>
1104 <td style="font-weight:400;font-size:1.0em;text-align:center;">-</td>
1105 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MROSADD)?:"-"); ?></td>
1106 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($MRNEAROSVA)?:"-"); ?></td>
1107 </tr>
1108 <?php
1111 if ($CRODSPH||$CROSSPH) { ?>
1112 <tr>
1113 <td style="font-weight:600;font-size:0.8em;text-align:right;"><?php echo xlt('Cycloplegic (Wet) Refraction'); ?></td>
1114 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('OD{{right eye}}'); ?></td>
1115 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CRODSPH)?:"-"); ?></td>
1116 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CRODCYL)?:"-"); ?></td>
1117 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CRODAXIS)?:"-"); ?></td>
1118 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CRODPRISM)?:"-"); ?></td>
1119 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CRODVA)?:"-"); ?></td>
1120 <td style="font-weight:400;font-size:1.0em;text-align:center;">-</td>
1121 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CRODADD)?:"-"); ?></td>
1122 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CRNEARODVA)?:"-"); ?></td>
1123 </tr>
1124 <tr>
1125 <td></td>
1126 <td style="font-weight:400;font-size:1.0em;text-align:right;"><?php echo xlt('OS{{left eye}}'); ?></td>
1127 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CROSSPH)?:"-"); ?></td>
1128 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CROSCYL)?:"-"); ?></td>
1129 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CROSAXIS)?:"-"); ?></td>
1130 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CROSPRISM)?:"-"); ?>&nbsp;</td>
1131 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CROSVA)?:"-"); ?></td>
1132 <td style="font-weight:400;font-size:1.0em;text-align:center;">-</td>
1133 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CROSADD)?:"-"); ?></td>
1134 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CRNEAROSVA)?:"-"); ?></td>
1135 </tr>
1136 <?php
1139 if ($CTLODSPH||$CTLOSSPH) { ?>
1140 <tr style="text-align:center;padding:5px;text-decoration:underline;">
1141 <td></td>
1142 <td><?php echo xlt('Eye'); ?></td>
1143 <td><?php echo xlt('Sph{{Sphere}}'); ?></td>
1144 <td><?php echo xlt('Cyl{{Cylinder}}'); ?></td>
1145 <td><?php echo xlt('Axis{{Axis of a glasses prescription}}'); ?></td>
1146 <td><?php echo xlt('BC{{Base Curve}}'); ?></td>
1147 <td><?php echo xlt('Diam{{Diameter}}'); ?></td>
1148 <td><?php echo xlt('ADD'); ?></td>
1149 <td><?php echo xlt('Acuity'); ?></td>
1150 </tr>
1151 <tr>
1152 <td style="font-weight:600;font-size:0.8em;text-align:right;"><?php echo xlt('Contact Lens'); ?></td>
1153 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('OD{{right eye}}'); ?></td>
1154 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLODSPH)?:"-"); ?></td>
1155 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLODCYL)?:"-"); ?></td>
1156 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLODAXIS)?:"-"); ?></td>
1157 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLODBC)?:"-"); ?></td>
1158 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLODDIAM)?:"-"); ?></td>
1159 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLODADD)?:"-"); ?></td>
1160 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLODVA)?:"-"); ?></td>
1161 </tr>
1162 <tr style="font-size:0.6em;">
1163 <td></td>
1164 <td></td>
1165 <td colspan="3" style="font-weight:400;font-size:1.0em;text-align:left;"><?php echo xlt('Brand'); ?>:<?php echo (text($CTLBRANDOD)?:"-"); ?></td>
1166 <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>
1167 <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>
1169 </tr>
1170 <tr>
1171 <td></td>
1172 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo xlt('OS{{left eye}}'); ?></td>
1173 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLOSSPH)?:"-"); ?></td>
1174 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLOSCYL)?:"-"); ?></td>
1175 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLOSAXIS)?:"-"); ?></td>
1176 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLOSBC)?:"-"); ?></td>
1177 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLOSDIAM)?:"-"); ?></td>
1178 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo (text($CTLOSADD)?:"-"); ?></td>
1179 <td style="font-weight:400;font-size:1.0em;text-align:center;"><?php echo ($CTLOSVA?:"-"); ?></td>
1180 </tr>
1181 <tr style="font-size:0.6em;">
1182 <td></td>
1183 <td></td>
1184 <td colspan="3" style="font-weight:400;font-size:1.0em;text-align:left;"><?php echo xlt('Brand'); ?>: <?php echo (text($CTLBRANDOS)?:"-"); ?></td>
1185 <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>
1186 <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>
1187 </tr>
1189 <?php
1192 </table>
1193 <?php
1194 } ?>
1195 <br />
1197 <?php
1198 if ($GLAREODVA||$CONTRASTODVA||$ODK1||$ODK2||$LIODVA||$PAMODBA) { ?>
1199 <table>
1200 <tr>
1201 <td id="LayerVision_ADDITIONAL" class="refraction <?php echo $display_Add; ?>" style="padding:10px;font-size:0.9em;">
1202 <table id="Additional" style="padding:5;font-size:1.0em;">
1203 <tr><td colspan="9" style="text-align:left;text-decoration:underline;font-weight:bold;"><?php echo xlt('Additional Data Points'); ?></td></tr>
1204 <tr><td></td>
1205 <td><?php echo xlt('PH{{Pinhole}}'); ?></td>
1206 <td><?php echo xlt('PAM{{Potential Acuity Meter}}'); ?></td>
1207 <td><?php echo xlt('LI{{Laser Interferometry}}'); ?></td>
1208 <td><?php echo xlt('BAT{{Brightness Acuity Testing}}'); ?></td>
1209 <td><?php echo xlt('K1{{Keratometry 1}}'); ?></td>
1210 <td><?php echo xlt('K2{{Keratometry 2}}'); ?></td>
1211 <td><?php echo xlt('Axis{{Axis of a glasses prescription}}'); ?></td>
1212 </tr>
1213 <tr><td><b><?php echo xlt('OD{{right eye}}'); ?>:</b></td>
1214 <td><?php echo text($PHODVA); ?></td>
1215 <td><?php echo text($PAMODVA); ?></td>
1216 <td><?php echo text($LIODVA); ?></td>
1217 <td><?php echo text($GLAREODVA); ?></td>
1218 <td><?php echo text($ODK1); ?></td>
1219 <td><?php echo text($ODK2); ?></td>
1220 <td><?php echo text($ODK2AXIS); ?></td>
1221 </tr>
1222 <tr>
1223 <td><b><?php echo xlt('OS{{left eye}}'); ?>:</b></td>
1224 <td><?php echo text($PHOSVA); ?></td>
1225 <td><?php echo text($PAMOSVA); ?></td>
1226 <td><?php echo text($LIOSVA); ?></td>
1227 <td><?php echo text($GLAREOSVA); ?></td>
1228 <td><?php echo text($OSK1); ?></td>
1229 <td><?php echo text($OSK2); ?></td>
1230 <td><?php echo text($OSK2AXIS); ?></td>
1231 </tr>
1232 <tr><td>&nbsp;</td></tr>
1233 <tr>
1234 <td></td>
1235 <td><?php echo xlt('AxLength{{axial Length}}'); ?></td>
1236 <td><?php echo xlt('ACD{{anterior chamber depth}}'); ?></td>
1237 <td><?php echo xlt('PD{{pupillary distance}}'); ?></td>
1238 <td><?php echo xlt('LT{{lens thickness}}'); ?></td>
1239 <td><?php echo xlt('W2W{{white-to-white}}'); ?></td>
1240 <td><?php echo xlt('ECL{{equivalent contact lens power at the corneal level}}'); ?></td>
1241 <!-- <td><?php echo xlt('pend'); ?></td> -->
1242 </tr>
1243 <tr><td><b><?php echo xlt('OD{{right eye}}'); ?>:</b></td>
1244 <td><?php echo text($ODAXIALLENGTH); ?></td>
1245 <td><?php echo text($ODACD); ?></td>
1246 <td><?php echo text($ODPDMeasured); ?></td>
1247 <td><?php echo text($ODLT); ?></td>
1248 <td><?php echo text($ODW2W); ?></td>
1249 <td><?php echo text($ODECL); ?></td>
1250 <!-- <td><input type=text id="pend" name="pend" value="<?php echo text($pend); ?>"></td> -->
1251 </tr>
1252 <tr>
1253 <td><b><?php echo xlt('OS{{left eye}}'); ?>:</b></td>
1254 <td><?php echo text($OSAXIALLENGTH); ?></td>
1255 <td><?php echo text($OSACD); ?></td>
1256 <td><?php echo text($OSPDMeasured); ?></td>
1257 <td><?php echo text($OSLT); ?></td>
1258 <td><?php echo text($OSW2W); ?></td>
1259 <td><?php echo text($OSECL); ?></td>
1260 <!-- <td><input type=text id="pend" name="pend" value="<?php echo text($pend); ?>"></td> -->
1261 </tr>
1262 </table>
1263 </td>
1264 </tr>
1265 </table>
1266 <?php
1271 <!-- end of the refraction boxes -->
1273 <!-- start of external exam -->
1274 <div class="report_exam_group">
1275 <table>
1276 <tr>
1277 <td style="text-align:left;vertical-align:top;">
1278 <b class="underline"><?php echo xlt('External Exam'); ?>:</b>
1279 <table class="report_section">
1280 <tr>
1281 <td class="bold" style="text-align:right;padding-right:10px;text-decoration:underline;max-width:150px;"><?php echo xlt('Right'); ?></td>
1282 <td style="width:100px;"></td>
1283 <td class="bold" style="text-align:left;padding-left:10px;text-decoration:underline;max-width:150px;"><?php echo xlt('Left'); ?></td>
1284 </tr>
1285 <tr>
1286 <td class="report_text right"><?php echo text($RBROW); ?></td>
1287 <td class="middle"><?php echo xlt('Brow'); ?></td>
1288 <td class="report_text left"><?php echo text($LBROW); ?></td>
1289 </tr>
1290 <tr>
1291 <td class="report_text right ">
1292 <?php echo text($RUL); ?>
1293 </td>
1294 <td class="middle"><?php echo xlt('Upper Lids'); ?></td>
1295 <td class="report_text left"><?php echo text($LUL); ?></td>
1296 </tr>
1297 <tr>
1298 <td class="report_text right "><?php echo text($RLL); ?></td>
1299 <td class="middle"><?php echo xlt('Lower Lids'); ?></td>
1300 <td class="report_text left"><?php echo text($LLL); ?></td>
1301 </tr>
1302 <tr>
1303 <td class="report_text right "><?php echo text($RMCT); ?></td>
1304 <td class="middle"><?php echo xlt('Medial Canthi'); ?></td>
1305 <td class="report_text left"><?php echo text($LMCT); ?></td>
1306 </tr>
1307 <?php
1308 if ($RADNEXA || $LADNEXA) {
1310 <tr>
1311 <td class="report_text right"><?php echo text($RADNEXA); ?></td>
1312 <td class="middle"><?php echo xlt('Adnexa'); ?></td>
1313 <td class="report_text left"><?php echo text($LADNEXA); ?></td>
1314 </tr>
1315 <?php
1318 if ($EXT_COMMENTS) { ?>
1319 <tr>
1320 <td colspan="3">
1322 <b><?php echo xlt('Comments'); ?>:</b>
1323 <span style="height:3.0em;">
1324 <?php echo text($EXT_COMMENTS); ?>
1325 </span>
1326 </td>
1327 </tr>
1328 <?php
1329 } ?>
1330 </table>
1331 </td>
1332 <td style="text-align:center;padding:1px;vertical-align:middle;">
1333 <?php
1334 display_draw_image("EXT", $encounter, $pid);
1336 </td>
1337 </tr>
1338 </table>
1339 </div>
1340 <!-- end of external exam -->
1341 <div class="report_exam_group">
1342 <?php
1343 if ($OSCONJ||$ODCONJ||$ODCORNEA||$OSCORNEA||$ODAC||$OSAC||$ODLENS||$OSLENS||$ODIRIS||$OSIRIS) {
1345 <!-- start of Anterior Segment exam -->
1346 <table>
1347 <tr>
1348 <td style="text-align:left;padding:1px;vertical-align:top;">
1349 <b class="underline"><?php echo xlt('Anterior Segment'); ?>:</b>
1350 <table class="report_section">
1351 <tr>
1352 <td class="bold" style="text-align:right;padding-right:10px;text-decoration:underline;max-width:200px;"><?php echo xlt('Right'); ?></td>
1353 <td style="width:100px;"></td>
1354 <td class="bold" style="text-align:left;padding-left:10px;text-decoration:underline;max-width:200px;"><?php echo xlt('Left'); ?></td>
1355 </tr>
1356 <tr>
1357 <td class="report_text right"><?php echo text($ODCONJ); ?></td>
1358 <td class="middle"><?php echo xlt('Conj{{Conjunctiva}}'); ?></td>
1359 <td class="report_text left"><?php echo text($OSCONJ); ?></td>
1360 </tr>
1361 <tr>
1362 <td class="report_text right "><?php echo text($ODCORNEA); ?></td>
1363 <td class="middle"><?php echo xlt('Cornea'); ?></td>
1364 <td class="report_text left"><?php echo text($OSCORNEA); ?></td>
1365 </tr>
1366 <tr>
1367 <td class="report_text right "><?php echo text($ODAC); ?></td>
1368 <td class="middle"><?php echo xlt('A/C{{anterior chamber}}'); ?></td>
1369 <td class="report_text left"><?php echo text($OSAC); ?></td>
1370 </tr>
1371 <tr>
1372 <td class="report_text right "><?php echo text($ODLENS); ?></td>
1373 <td class="middle"><?php echo xlt('Lens'); ?></td>
1374 <td class="report_text left"><?php echo text($OSLENS); ?></td>
1375 </tr>
1376 <tr>
1377 <td class="report_text right"><?php echo text($ODIRIS); ?></td>
1378 <td class="middle"><?php echo xlt('Iris'); ?></td>
1379 <td class="report_text left"><?php echo text($OSIRIS); ?></td>
1380 </tr>
1381 <?php if ($ODGONIO||$OSDGONIO) { ?>
1382 <tr>
1383 <td class="report_text right" style="width:100px;"><?php echo text($ODGONIO); ?></td>
1384 <td class="middle"><?php echo xlt('Gonioscopy'); ?></td>
1385 <td class="report_text left" style="width:100px;"><?php echo text($OSGONIO); ?></td>
1386 </tr>
1387 <?php } if ($ODKTHICKNESS||$OSKTHICKNESS) { ?>
1388 <tr>
1389 <td class="report_text right"><?php echo text($ODKTHICKNESS); ?></td>
1390 <td class="middle" title="<?php echo xla('Pachymetry'); ?>"><?php echo xlt('Pachymetry'); ?></td>
1391 <td class="report_text left"><?php echo text($OSKTHICKNESS); ?></td>
1392 </tr>
1393 <?php } if ($ODSCHIRMER1||$OSSCHIRMER1) { ?>
1394 <tr>
1395 <td class="report_text right"><?php echo text($ODSCHIRMER1); ?></td>
1396 <td class="middle" title="<?php echo xla('Schirmers I (w/o anesthesia)'); ?>"><?php echo xlt('Schirmers I'); ?></td>
1397 <td class="report_text left"><?php echo text($OSSCHIRMER1); ?></td>
1398 </tr>
1399 <?php } if ($ODSCHIRMER2||$OSSCHIRMER2) { ?>
1400 <tr>
1401 <td class="report_text right"><?php echo text($ODSCHIRMER2); ?></td>
1402 <td class="middle" title="<?php echo xla('Schirmers II (w/ anesthesia)'); ?>"><?php echo xlt('Schirmers II'); ?></td>
1403 <td class="report_text left"><?php echo text($OSSCHIRMER2); ?></td>
1404 </tr>
1405 <?php } if ($ODTBUT||$OSTBUT) { ?>
1406 <tr>
1407 <td class="report_text right"><?php echo text($ODTBUT); ?></td>
1408 <td class="middle" title="<?php echo xla('Tear Break Up Time'); ?>"><?php echo xlt('TBUT'); ?></td>
1409 <td class="report_text left"><?php echo text($OSTBUT); ?></td>
1410 </tr>
1411 <?php }
1413 if ($ANTSEG_COMMENTS) { ?>
1414 <tr>
1415 <td colspan="2">
1416 <b><?php echo xlt('Comments'); ?>:</b>
1417 <span style="height:3.0em;">
1418 <?php echo text($ANTSEG_COMMENTS); ?>
1419 </span>
1420 </td>
1421 </tr>
1422 <?php } ?>
1423 </table>
1424 </td>
1425 <td style="text-align:center;padding:1px;vertical-align:middle;">
1426 <?php
1427 display_draw_image("ANTSEG", $encounter, $pid);
1429 </td>
1430 </tr>
1431 </table>
1432 <!-- end of Anterior Segment exam -->
1434 <?php
1437 </div>
1438 <div class="report_exam_group">
1440 <!-- start of Other exam -->
1441 <?php
1442 if ($RLF || $LLF || $RMRD || $LMRD || $RVFISSURE || $LVFISSURE ||
1443 $RCAROTID || $LCAROTID || $RTEMPART || $LTEMPART || $RCNV || $LCNV ||
1444 $RCNVII || $LCNVII || $HERTELBASE || $ODCOLOR || $OSCOLOR || $ODREDDESAT ||
1445 $OSREDDESAT ||$ODCOINS || $OSCOINS || $ODNPA || $OSNPA || $NPA || $NPC || $STEREOPSIS ||
1446 $DACCDIST || $DACCNEAR || $CACCDIST || $CACCNEAR || $VERTFUSAMPS) {
1448 <table>
1449 <tr>
1450 <td style="text-align:left;vertical-align:top;padding:1px;">
1451 <b><u><?php echo xlt('Additional Findings'); ?>:</u></b>
1452 <?php if ($ACT =='on' and $MOTILITYNORMAL == 'on') { ?>
1453 <span id="ACTNORMAL_CHECK" name="ACTNORMAL_CHECK">
1454 <?php echo xlt('Orthophoric'); ?>
1455 </span>
1456 <?php } ?>
1457 <table class="report_section">
1458 <tr>
1459 <td class="bold" style="text-align:right;padding-right:10px;text-decoration:underline;max-width:200px;"><?php echo xlt('Right'); ?></td>
1460 <td style="width:100px;"></td>
1461 <td class="bold" style="text-align:left;padding-left:10px;text-decoration:underline;max-width:200px;"><?php echo xlt('Left'); ?></td>
1462 </tr>
1463 <?php
1464 if ($RLF || $LLF) { ?>
1465 <tr>
1466 <td class="report_text right" style=""><?php echo text($RLF); ?></td>
1467 <td class="middle" style="width:100px;"><?php echo xlt('Levator Function'); ?></td>
1468 <td class="report_text left" style=""><?php echo text($LLF); ?></td>
1469 </tr>
1470 <?php
1473 if ($RMRD || $LMRD) { ?>
1474 <tr>
1475 <td class="report_text right"><?php echo text($RMRD); ?></td>
1476 <td class="middle" title="<?php echo xla('Marginal Reflex Distance'); ?>"><?php echo xlt('MRD{{marginal reflex distance}}'); ?></td>
1477 <td class="report_text left"><?php echo text($LMRD); ?></td>
1478 </tr>
1479 <?php
1482 if ($RVFISSURE || $LVFISSURE) { ?>
1483 <tr>
1484 <td class="report_text right"><?php echo text($RVFISSURE); ?></td>
1485 <td class="middle" title="<?php echo xla('Vertical Fissure: central height between lid margins'); ?>"><?php echo xlt('Vert Fissure{{vertical fissure}}'); ?></td>
1486 <td class="report_text left"><?php echo text($LVFISSURE); ?></td>
1487 </tr>
1488 <?php
1491 if ($RCAROTID || $LCAROTID) { ?>
1492 <tr>
1493 <td class="report_text right"><?php echo text($RCAROTID); ?></td>
1494 <td class="middle" title="<?php echo xla('Any carotid bruits appreciated?'); ?>"><?php echo xlt('Carotid{{carotid arteries}}'); ?></td>
1495 <td class="report_text left"><?php echo text($LCAROTID); ?></td>
1496 </tr>
1497 <?php
1500 if ($RTEMPART || $LTEMPART) { ?>
1501 <tr>
1502 <td class="report_text right"><?php echo text($RTEMPART); ?></td>
1503 <td class="middle" title="<?php echo xla('Temporal Arteries'); ?>"><?php echo xlt('Temp. Art.{{temporal arteries}}'); ?></td>
1504 <td class="report_text left"><?php echo text($LTEMPART); ?></td>
1505 </tr>
1506 <?php
1509 if ($RCNV || $LCNV) { ?>
1510 <tr>
1511 <td class="report_text right"><?php echo text($RCNV); ?></td>
1512 <td class="middle" title="<?php echo xla('Cranial Nerve 5: Trigeminal Nerve'); ?>"><?php echo xlt('CN V{{cranial nerve five}}'); ?></td>
1513 <td class="report_text left"><?php echo text($LCNV); ?></td>
1514 </tr>
1515 <?php
1518 if ($RCNVII || $LCNVII) { ?>
1519 <tr>
1520 <td class="report_text right"><?php echo text($RCNVII); ?></td>
1521 <td class="middle" title="<?php echo xla('Cranial Nerve 7: Facial Nerve'); ?>"><?php echo xlt('CN VII{{cranial nerve seven}}'); ?></td>
1522 <td class="report_text left"><?php echo text($LCNVII); ?></td>
1523 </tr>
1524 <?php
1527 if ($HERTELBASE) { ?>
1528 <tr>
1529 <td colspan="3" style="text-align:center;padding-top:15px;">
1530 <b style="font-weight:bold;padding-bottom:5px;">
1531 <?php echo xlt('Hertel Exophthalmometry'); ?>
1532 </b>
1533 <br />
1534 <?php
1535 if ($HERTELBASE) { ?>
1537 <b style="border:1pt solid black;width:30px;text-align:center;padding:0 5;">
1538 <?php echo text($ODHERTEL); ?>
1539 </b>
1540 <b class="fa fa-minus">--</b>
1541 <b style="border:1pt solid black;width:40px;text-align:center;padding:0 5;">
1542 <?php echo text($HERTELBASE); ?>
1543 </b>
1544 <b class="fa fa-minus">--</b>
1545 <b style="border:1pt solid black;width:30px;text-align:center;padding:0 5;">
1546 <?php echo text($OSHERTEL); ?>
1547 </b>
1548 <?php
1549 } ?>
1550 </td>
1551 </tr>
1552 <?php
1555 if ($ODCOLOR || $OSCOLOR || $ODREDDESAT ||
1556 $OSREDDESAT ||$ODCOINS || $OSCOINS ||
1557 $ODNPA || $OSNPA || $NPA || $NPC || $STEREOPSIS) { ?>
1558 <!-- start of NEURO exam -->
1559 <?php
1560 if ($ODCOLOR or $OSCOLOR) { ?>
1561 <tr>
1562 <td class="report_text right"><?php echo text($ODCOLOR); ?></td>
1563 <td class="middle"><?php echo xlt('Color Vision'); ?></td>
1564 <td class="report_text left"><?php echo text($OSCOLOR); ?></td>
1565 </tr>
1566 <?php
1569 if ($ODREDDESAT or $OSREDDESAT) { ?>
1570 <tr>
1571 <td class="report_text right"><?php echo text($ODREDDESAT); ?></td>
1572 <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>
1573 <td class="report_text left"><?php echo text($OSREDDESAT); ?></td>
1574 </tr>
1575 <?php
1578 if ($ODCOINS or $OSCOINS) { ?>
1579 <tr>
1580 <td class="report_text right"><?php echo text($ODCOINS); ?></td>
1581 <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>
1582 <td class="report_text left"><?php echo text($OSCOINS); ?></td>
1583 </tr>
1584 <?php
1587 if ($ODNPA or $OSNPA) { ?>
1588 <tr>
1589 <td class="report_text right"><?php echo text($ODNPA); ?></td>
1590 <td class="middle"><span title="<?php echo xla('Near Point of Accomodation'); ?>"><?php echo xlt('NPA{{near point of accomodation}}'); ?></span></td>
1591 <td class="report_text left"><?php echo text($OSNPA); ?></td>
1592 </tr>
1593 <?php
1596 if ($ODNPC or $OSNPC) { ?>
1597 <tr>
1598 <td class="right" style="font-weight:600;"><?php echo xlt('NPC{{near point of convergence}}'); ?>:&nbsp;</td>
1599 <td class="center" colspan="2" ><?php echo text($NPC); ?></td>
1600 </tr>
1601 <?php
1604 if ($DACCDIST or $DACCNEAR or $CACCDIST or $CACCNEAR or $VERTFUSAMPS) { ?>
1605 <tr style="text-decoration:underline;">
1606 <td></td>
1607 <td class="middle"><?php echo xlt('Distance'); ?> </td>
1608 <td class="middle"> <?php echo xlt('Near'); ?></td>
1609 </tr>
1610 <?php
1613 if ($DACCDIST or $DACCNEAR) { ?>
1614 <tr>
1615 <td class="right" style="font-weight:600;"><?php echo xlt('Divergence Amps'); ?>: </td>
1616 <td class="center"><?php echo text($DACCDIST); ?></td>
1617 <td class="center"><?php echo text($DACCNEAR); ?></td>
1618 </tr>
1619 <?php
1622 if ($CACCDIST or $CACCNEAR) { ?>
1623 <tr>
1624 <td class="right" style="font-weight:600;"><?php echo xlt('Convergence Amps'); ?>: </td>
1625 <td class="center"><?php echo text($CACCDIST); ?></td>
1626 <td class="center"><?php echo text($CACCNEAR); ?></td>
1627 </tr>
1628 <?php
1631 if ($VERTFUSAMPS) { ?>
1632 <tr>
1633 <td class="right" style="font-weight:600;">
1634 <?php echo xlt('Vert Fusional Amps'); ?>:
1635 </td>
1636 <td colspan="2" class="center">
1637 <?php echo text($VERTFUSAMPS); ?>
1638 <br />
1639 </td>
1640 </tr>
1641 <?php
1644 if ($STEREOPSIS) { ?>
1645 <tr>
1646 <td class="right" style="font-weight:600;"><?php echo xlt('Stereopsis'); ?>:&nbsp;</td>
1647 <td class="center" colspan="2"><?php echo text($STEREOPSIS); ?></td>
1648 </tr>
1649 <?php
1651 } ?>
1652 </table>
1653 </td>
1654 <td style="text-align:center;padding:1px;vertical-align:middle;">
1655 <?php
1656 display_draw_image("NEURO", $encounter, $pid);
1658 </td>
1659 </tr>
1660 </table>
1661 <?php
1662 } ?>
1663 <!-- end of Other exam -->
1664 </div>
1665 <div class="report_exam_group">
1667 <!-- start of the Retina exam -->
1668 <?php
1669 if ($ODDISC||$OSDISC||$ODCUP||$ODMACULA||$ODVESSELS||$ODPERIPH) {
1671 <table>
1672 <tr>
1673 <td style="text-align:left;padding:1px;vertical-align:top;">
1674 <b><u><?php echo xlt('Retina'); ?>:</u></b>
1675 <table class="report_section">
1676 <tr>
1677 <td class="bold" style="text-align:right;text-decoration:underline;max-width:150px;"><?php echo xlt('Right'); ?></td>
1678 <td style="width:100px;"></td>
1679 <td class="bold" style="text-align:left;text-decoration:underline;max-width:150px;"><?php echo xlt('Left'); ?></td>
1680 </tr>
1681 <tr>
1682 <td class="report_text right"><?php echo text($ODDISC); ?></td>
1683 <td class="middle"><?php echo xlt('Disc'); ?></td>
1684 <td class="report_text left"><?php echo text($OSDISC); ?></td>
1685 </tr>
1686 <tr>
1687 <td class="report_text right"><?php echo text($ODCUP); ?></td>
1688 <td class="middle"><?php echo xlt('Cup'); ?></td>
1689 <td class="report_text left"><?php echo text($OSCUP); ?></td>
1690 </tr>
1691 <tr>
1692 <td class="report_text right"><?php echo text($ODMACULA); ?></td>
1693 <td class="middle"><?php echo xlt('Macula'); ?></td>
1694 <td class="report_text left"><?php echo text($OSMACULA); ?></td>
1695 </tr>
1696 <tr>
1697 <td class="report_text right"><?php echo text($ODVESSELS); ?></td>
1698 <td class="middle"><?php echo xlt('Vessels'); ?></td>
1699 <td class="report_text left"><?php echo text($OSVESSELS); ?></td>
1700 </tr>
1701 <?php if ($ODPERIPH||$OSPERIPH) { ?>
1702 <tr>
1703 <td class="report_text right"><?php echo text($ODPERIPH); ?></td>
1704 <td class="middle"><?php echo xlt('Periph{{periphery}}'); ?></td>
1705 <td class="report_text left"><?php echo text($OSPERIPH); ?></td>
1706 </tr>
1707 <?php } if ($ODCMT||$OSCMT) { ?>
1708 <tr>
1709 <td class="report_text right">&nbsp;<?php echo text($ODCMT); ?></td>
1710 <td class="middle"><?php echo xlt('Central Macular Thickness'); ?> </td>
1711 <td class="report_text left" >&nbsp;<?php echo text($OSCMT); ?></td>
1712 </tr>
1713 <?php } ?>
1714 <?php if ($RETINA_COMMENTS) { ?>
1715 <tr>
1716 <td colspan="2" class="report_text left">
1718 <b><?php echo xlt('Comments'); ?>:</b>
1719 <span style="height:3.0em;">
1720 <?php echo text($RETINA_COMMENTS); ?>
1721 </span>
1723 </td>
1724 </tr>
1725 <?php } ?>
1726 </table>
1727 </td>
1728 <td style="text-align:center;padding:1px;vertical-align:middle;">
1729 <?php
1730 display_draw_image("RETINA", $encounter, $pid);
1732 </td>
1733 </tr>
1734 </table>
1736 <?php
1737 } ?>
1738 <!-- end of Retina exam -->
1739 </div>
1740 <?php
1741 if ($ACT !='on') { ?>
1742 <table style="text-align:center;font-size:0.7em;">
1743 <tr>
1744 <td colspan=3 style="">
1745 <table>
1746 <tr style="text-align:left;height:16px;vertical-align:middle;width:880px;">
1747 <td>
1748 <span id="ACTTRIGGER" name="ACTTRIGGER" style="text-decoration:underline;padding-left:2px;">
1749 <?php echo xlt('Alternate Cover Test'); ?>:
1750 </span>
1751 </td>
1752 </tr>
1753 <tr>
1754 <?php
1755 if ($ACT5SCDIST) { ?>
1756 <td style="text-align:center;"> <!-- scDIST -->
1757 <table cellpadding="0"
1758 style="position:relative;text-align:center;font-size:1.2em;margin: 7 5 10 5;">
1759 <tr>
1760 <td id="ACT_tab_SCDIST" name="ACT_tab_SCDIST" class="ACT_deselected"> <?php echo xlt('sc Distance{{without correction distance}}'); ?> </td>
1761 </tr>
1762 <tr>
1763 <td colspan="4" style="text-align:center;font-size:0.9em;">
1764 <table>
1765 <tr>
1766 <td style="text-align:center;"><?php echo xlt('R{{right}}'); ?></td>
1767 <td class="ACT"><?php echo report_ACT($ACT1SCDIST); ?></td>
1768 <td class="ACT"><?php echo report_ACT($ACT2SCDIST); ?></td>
1769 <td class="ACT"><?php echo report_ACT($ACT3SCDIST); ?></td>
1770 <td style="text-align:center;"><?php echo xlt('L{{left}}'); ?></td>
1771 </tr>
1772 <tr>
1773 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
1774 <td class="ACT"><?php echo report_ACT($ACT4SCDIST); ?></td>
1775 <td class="ACT"><?php echo report_ACT($ACT5SCDIST); ?></td>
1776 <td class="ACT"><?php echo report_ACT($ACT6SCDIST); ?></td>
1777 <td><i class="fa fa-share rotate-right"></i></td>
1778 </tr>
1779 <tr>
1780 <td class="ACT"><?php echo report_ACT($ACT10SCDIST); ?></td>
1781 <td class="ACT"><?php echo report_ACT($ACT7SCDIST); ?></td>
1782 <td class="ACT"><?php echo report_ACT($ACT8SCDIST); ?></td>
1783 <td class="ACT"><?php echo report_ACT($ACT9SCDIST); ?></td>
1784 <td class="ACT"><?php echo report_ACT($ACT11SCDIST); ?></td>
1785 </tr>
1786 </table>
1787 </td>
1788 </tr>
1789 </table>
1790 </td>
1791 <?php
1794 if ($ACT5CCDIST) {
1796 <td style="text-align:center;"> <!-- ccDIST -->
1797 <table cellpadding="0" style="position:relative;text-align:center;font-size:1.5em;margin: 7 5 10 5;border-collapse: separate;">
1798 <tr>
1799 <td class="ACT_deselected"> <?php echo xlt('cc Distance{{with correction at distance}}'); ?> </td>
1800 </tr>
1801 <tr>
1802 <td colspan="4" style="text-align:center;font-size:0.8em;">
1803 <table>
1804 <tr>
1805 <td style="text-align:center;"><?php echo xlt('R{{right}}'); ?></td>
1806 <td class="ACT"><?php echo report_ACT($ACT1CCDIST); ?></td>
1807 <td class="ACT"><?php echo report_ACT($ACT2CCDIST); ?></td>
1808 <td class="ACT"><?php echo report_ACT($ACT3CCDIST); ?></td>
1809 <td style="text-align:center;"><?php echo xlt('L{{left}}'); ?></td>
1810 </tr>
1811 <tr>
1812 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
1813 <td class="ACT"><?php echo report_ACT($ACT4CCDIST); ?></td>
1814 <td class="ACT"><?php echo report_ACT($ACT5CCDIST); ?></td>
1815 <td class="ACT"><?php echo report_ACT($ACT6CCDIST); ?></td>
1816 <td><i class="fa fa-share rotate-right"></i></td>
1817 </tr>
1818 <tr>
1819 <td class="ACT"><?php echo report_ACT($ACT10CCDIST); ?></td>
1820 <td class="ACT"><?php echo report_ACT($ACT7CCDIST); ?></td>
1821 <td class="ACT"><?php echo report_ACT($ACT8CCDIST); ?></td>
1822 <td class="ACT"><?php echo report_ACT($ACT9CCDIST); ?></td>
1823 <td class="ACT"><?php echo report_ACT($ACT11CCDIST); ?>
1824 </td>
1825 </tr>
1826 </table>
1827 </td>
1828 </tr>
1829 </table>
1830 </td>
1831 </tr>
1832 <tr>
1833 <?php
1836 if ($ACT5SCNEAR) {
1839 <td style="text-align:center;"> <!-- scNEAR -->
1840 <table cellpadding="0" style="position:relative;text-align:center;font-size:1.5em;margin: 7 5 10 5;border-collapse: separate;">
1841 <tr>
1842 <td class="ACT_deselected"> <?php echo xlt('sc Near{{without correction near}}'); ?> </td>
1843 </tr>
1844 <tr>
1845 <td colspan="4" style="text-align:center;font-size:0.8em;">
1846 <table>
1847 <tr>
1848 <td style="text-align:center;"><?php echo xlt('R{{right}}'); ?></td>
1849 <td class="ACT"><?php echo report_ACT($ACT1SCNEAR); ?></td>
1850 <td class="ACT"><?php echo report_ACT($ACT2SCNEAR); ?></td>
1851 <td class="ACT"><?php echo report_ACT($ACT3SCNEAR); ?></td>
1852 <td style="text-align:center;"><?php echo xlt('L{{left}}'); ?></td>
1853 </tr>
1854 <tr>
1855 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
1856 <td class="ACT"><?php echo report_ACT($ACT4SCNEAR); ?></td>
1857 <td class="ACT"><?php echo report_ACT($ACT5SCNEAR); ?></td>
1858 <td class="ACT"><?php echo report_ACT($ACT6SCNEAR); ?></td>
1859 <td><i class="fa fa-share rotate-right"></i></td>
1860 </tr>
1861 <tr>
1862 <td class="ACT"><?php echo report_ACT($ACT10SCNEAR); ?></td>
1863 <td class="ACT"><?php echo report_ACT($ACT7SCNEAR); ?></td>
1864 <td class="ACT"><?php echo report_ACT($ACT8SCNEAR); ?></td>
1865 <td class="ACT"><?php echo report_ACT($ACT9SCNEAR); ?></td>
1866 <td class="ACT"><?php echo report_ACT($ACT11SCNEAR); ?>
1867 </td>
1868 </tr>
1869 </table>
1870 </td>
1871 </tr>
1872 </table>
1873 </td>
1874 <?php
1877 if ($ACT5CCNEAR) {
1880 <td style="text-align:center;"> <!-- ccNEAR -->
1881 <table cellpadding="0" style="position:relative;text-align:center;font-size:1.5em;margin: 7 5 10 5;border-collapse: separate;">
1882 <tr>
1883 <td class="ACT_deselected"> <?php echo xlt('cc Near{{with correction at Near}}'); ?> </td>
1884 </tr>
1885 <tr>
1886 <td colspan="4" style="text-align:center;font-size:1.0em;">
1887 <table>
1888 <tr>
1889 <td style="text-align:center;"><?php echo xlt('R{{right}}'); ?></td>
1890 <td class="ACT"><?php echo report_ACT($ACT1CCNEAR); ?></td>
1891 <td class="ACT"><?php echo report_ACT($ACT2CCNEAR); ?></td>
1892 <td class="ACT"><?php echo report_ACT($ACT3CCNEAR); ?></td>
1893 <td style="text-align:center;"><?php echo xlt('L{{left}}'); ?></td>
1894 </tr>
1895 <tr>
1896 <td style="text-align:right;"><i class="fa fa-reply rotate-left"></i></td>
1897 <td class="ACT"><?php echo report_ACT($ACT4CCNEAR); ?></td>
1898 <td class="ACT"><?php echo report_ACT($ACT5CCNEAR); ?></td>
1899 <td class="ACT"><?php echo report_ACT($ACT6CCNEAR); ?></td>
1900 <td><i class="fa fa-share rotate-right"></i></td>
1901 </tr>
1902 <tr>
1903 <td class="ACT"><?php echo report_ACT($ACT10CCNEAR); ?></td>
1904 <td class="ACT"><?php echo report_ACT($ACT7CCNEAR); ?></td>
1905 <td class="ACT"><?php echo report_ACT($ACT8CCNEAR); ?></td>
1906 <td class="ACT"><?php echo report_ACT($ACT9CCNEAR); ?></td>
1907 <td class="ACT"><?php echo report_ACT($ACT11CCNEAR); ?></td>
1908 </tr>
1909 </table>
1910 </td>
1911 </tr>
1912 </table>
1914 </td>
1915 <?php
1916 } ?>
1917 </tr>
1918 </table>
1919 <?php if ($NEURO_COMMENTS) { ?>
1920 <table>
1921 <tr>
1922 <td colspan="2">
1923 <b><?php echo xlt('Comments'); ?>:</b><br />
1924 <span style="height:3.0em;">
1925 <?php echo report_ACT($NEURO_COMMENTS); ?>
1926 </span>
1927 <br /><br />
1928 </td>
1929 </tr>
1930 </table>
1931 <?php } ?>
1932 </td>
1933 </tr>
1934 </table>
1935 <?php
1939 //end choice !== 'TEXT' -- include this in summary mouseover report.
1941 <!-- start of IMPPLAN exam -->
1942 <table class="report_exam_group">
1943 <tr>
1944 <td style="text-align:left;padding:1px;vertical-align:top;width:480px;">
1945 <b><u><?php echo xlt('Impression/Plan'); ?>:</u></b>
1946 <table style="">
1947 <tr>
1948 <td style="padding:5px;text-align: left;text-align:justify;width:475px;">
1949 <?php
1951 * Retrieve and Display the IMPPLAN_items for the Impression/Plan zone.
1953 $query = "select * from form_".$form_folder."_impplan where form_id=? and pid=? order by IMPPLAN_order ASC";
1954 $result = sqlStatement($query, array($form_id,$pid));
1955 $i='0';
1956 $order = array("\r\n", "\n", "\r","\v","\f","\x85","\u2028","\u2029");
1957 $replace = "<br />";
1958 // echo '<ol>';
1959 while ($ip_list = sqlFetchArray($result)) {
1960 $newdata = array (
1961 'form_id' => $ip_list['form_id'],
1962 'pid' => $ip_list['pid'],
1963 'title' => $ip_list['title'],
1964 'code' => $ip_list['code'],
1965 'codetype' => $ip_list['codetype'],
1966 'codetext' => $ip_list['codetext'],
1967 'plan' => str_replace($order, $replace, $ip_list['plan']),
1968 'IMPPLAN_order' => $ip_list['IMPPLAN_order']
1970 $IMPPLAN_items[$i] =$newdata;
1971 $i++;
1974 //for ($i=0; $i < count($IMPPLAN_item); $i++) {
1975 foreach ($IMPPLAN_items as $item) {
1976 echo ($item['IMPPLAN_order'] +1).'. <b>'.text($item['title']).'</b><br />';
1977 echo '<div style="padding-left:15px;">';
1978 $pattern = '/Code/';
1979 if (preg_match($pattern, $item['code'])) {
1980 $item['code'] = '';
1983 if ($item['codetext'] > '') {
1984 echo $item['codetext']."<br />";
1985 } else {
1986 if ($item['code'] > '') {
1987 if ($item['codetype'] > '') {
1988 $item['code'] = $item['codetype'].": ".$item['code'];
1991 echo $item['code']."<br />";
1995 echo $item['plan']."</div><br />";
1998 if ($PLAN && $PLAN != '0') { ?>
1999 <b><?php echo xlt('Orders')."/".xlt('Next Visit'); ?>:</b>
2000 <br />
2001 <div style="padding-left:15px;padding-bottom:10px;width:400px;">
2002 <?php
2003 $PLAN_items = explode('|', $PLAN);
2004 foreach ($PLAN_items as $item) {
2005 echo $item."<br />";
2008 if ($PLAN2) {
2009 echo $PLAN2."<br />";
2012 </div>
2013 <?php
2016 </td>
2017 </tr>
2018 </table>
2019 </td>
2020 <td style="text-align:center;vertical-align:bottom;padding:1px;">
2021 <?php
2022 display_draw_image("IMPPLAN", $encounter, $pid);
2024 if ($PDF_OUTPUT) {
2025 //display a stored optional electronic sig for this providerID, ie the patient's Doc not the tech
2026 $from_file = $GLOBALS["webserver_root"] ."/interface/forms/".$form_folder."/images/sign_".$providerID.".jpg";
2027 if (file_exists($from_file)) {
2028 echo "<img style='width:50mm;' src='$from_file'><hr style='width:40mm;' />".
2029 text($providerNAME)."<br />
2030 <i style='font-size:9px;'>".xlt('electronically signed on')." ".oeFormatShortDate()."</i>";
2033 <br />
2034 <span style="border-top:1pt solid black;padding-left:50px;"><?php echo text($providerNAME); ?></span>
2035 <?php
2036 } else {
2037 $signature = $GLOBALS["webserver_root"]."/interface/forms/".$form_folder."/images/sign_".$providerID.".jpg";
2038 if (file_exists($signature)) {
2039 echo "<img src='".$GLOBALS['web_root']."/interface/forms/".$form_folder."/images/sign_".$providerID.".jpg' style='width:30mm; height:6mm;bottom:1px;' height='10' />";
2045 </td>
2046 </tr>
2047 </table>
2048 </div>
2049 <?php
2050 return;
2053 function display_draw_image($zone, $encounter, $pid)
2055 global $form_folder;
2056 global $web_root;
2057 global $PDF_OUTPUT;
2058 $side = "OU";
2059 $base_name = $pid."_".$encounter."_".$side."_".$zone."_VIEW";
2060 $filename = $base_name.".jpg";
2061 $sql = "SELECT * from documents where documents.url like '%".$filename."'";
2062 $doc = sqlQuery($sql);
2063 $document_id =$doc['id'];
2065 if (($document_id > '1')&&(is_numeric($document_id))) {
2066 $d = new Document($document_id);
2067 $fname = basename($d->get_url());
2069 $couch_docid = $d->get_couch_docid();
2070 $couch_revid = $d->get_couch_revid();
2071 $extension = substr($fname, strrpos($fname, "."));
2072 $notes = $d->get_notes();
2073 if (!empty($notes)) {
2074 echo "<table>";
2077 foreach ($notes as $note) {
2078 echo '<tr>';
2079 echo '<td>' . xlt('Note') . ' #' . $note->get_id() . '</td>';
2080 echo '</tr>';
2081 echo '<tr>';
2082 echo '<td>' . xlt('Date') . ': ' . oeFormatShortDate($note->get_date()) . '</td>';
2083 echo '</tr>';
2084 echo '<tr>';
2085 echo '<td>'.$note->get_note().'<br /><br /></td>';
2086 echo '</tr>';
2089 if (!empty($notes)) {
2090 echo "</table>";
2093 $url_file = $d->get_url_filepath();
2094 if ($couch_docid && $couch_revid) {
2095 $url_file = $d->get_couch_url($pid, $encounter);
2098 // Collect filename and path
2099 $from_all = explode("/", $url_file);
2100 $from_filename = array_pop($from_all);
2101 $from_pathname_array = array();
2102 for ($i=0; $i<$d->get_path_depth(); $i++) {
2103 $from_pathname_array[] = array_pop($from_all);
2106 $from_pathname_array = array_reverse($from_pathname_array);
2107 $from_pathname = implode("/", $from_pathname_array);
2109 if ($couch_docid && $couch_revid) {
2110 $from_file = $GLOBALS['OE_SITE_DIR'] . '/documents/temp/' . $from_filename;
2111 $to_file = substr($from_file, 0, strrpos($from_file, '.')) . '_converted.jpg';
2112 } else {
2113 $from_file = $GLOBALS["fileroot"] . "/sites/" . $_SESSION['site_id'] .
2114 '/documents/' . $from_pathname . '/' . $from_filename;
2115 $to_file = substr($from_file, 0, strrpos($from_file, '.')) . '_converted.jpg';
2118 // if ($extension == ".png" || $extension == ".jpg" || $extension == ".jpeg" || $extension == ".gif") {
2119 if ($PDF_OUTPUT) {
2120 echo "<img src='". $from_file."' style='width:220px;height:120px;'>";
2121 } else {
2122 $filetoshow = $GLOBALS['webroot']."/controller.php?document&retrieve&patient_id=$pid&document_id=".$doc['id']."&as_file=false&blahblah=".rand();
2123 echo "<img src='".$filetoshow."' style='width:220px;height:120px;'>";
2125 } //else show base_image
2126 else {
2127 $filetoshow = "../../forms/".$form_folder."/images/".$side."_".$zone."_BASE.jpg";
2128 if ($PDF_OUTPUT) {
2129 $filetoshow = $GLOBALS["webroot"] ."/interface/forms/".$form_folder."/images/".$side."_".$zone."_BASE.jpg";
2132 // uncomment to show base image, no touch up by user.
2133 // echo "<img src='". $filetoshow."' style='width:220px;height:120px;'>";
2136 return;
2139 function report_ACT($term)
2141 $term = nl2br(htmlspecialchars($term, ENT_NOQUOTES));
2142 return $term."&nbsp;";