Interim autoloaded library/classes via composer classmap, take 4. (#422)
[openemr.git] / interface / forms / eye_mag / report.php
blob355c6da67549d3881c424cf26821570cd43aa053
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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') {
78 global $form_folder;
79 global $form_name;
80 global $choice;
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
89 where
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
94 form_eye_mag.pid=? ";
95 $objQuery =sqlQuery($query,array($encounter,$pid));
96 @extract($objQuery);
98 $dated = new DateTime($encounter_date);
99 $dated = $dated->format('Y/m/d');
100 global $visit_date;
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') {
118 $side="OU";
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>
131 </div> <?
132 } else {
133 // $filetoshow = "../../forms/".$form_folder."/images/".$side."_".$zone[$i]."_BASE.png?".rand();
137 <?php
139 } else if ($choice == "drawing") {
142 <div class="borderShadow">
143 <?php display_draw_section ("VISION",$encounter,$pid); ?>
144 </div>
145 <div class="borderShadow">
146 <?php display_draw_section ("NEURO",$encounter,$pid); ?>
147 </div>
148 <div class="borderShadow">
149 <?php display_draw_section ("EXT",$encounter,$pid); ?>
150 </div>
151 <div class="borderShadow">
152 <?php display_draw_section ("ANTSEG",$encounter,$pid); ?>
153 </div>
154 <div class="borderShadow">
155 <?php display_draw_section ("RETINA",$encounter,$pid); ?>
156 </div>
157 <div class="borderShadow">
158 <?php display_draw_section ("IMPPLAN",$encounter,$pid); ?>
159 </div>
160 <?php
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');
167 //return;
170 function left_overs() {
172 * Keep: this could be co-opted to export an XML/HL7 type of document
174 $count = 0;
175 $data = formFetch($table_name, $id);
177 if ($data) {
178 foreach($data as $key => $value) {
179 $$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') {
190 global $form_folder;
191 global $PDF_OUTPUT;
192 global $OE_SITE_DIR;
193 global $formres;
194 global $dateres;
195 global $printable;
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
200 where
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">
218 <style>
220 <?php if ($PDF_OUTPUT) { ?>
221 .mot {
222 text-align: center;
223 width:3mm;
224 height:3mm;
226 <?php } else { ?>
227 .mot {
228 text-align: center;
229 width:5mm;
230 height:5mm;
233 <?php } ?>
234 </style>
235 <div>
236 <?php
237 if (($cols =='Fax')||($cols=='Report')) echo report_header($pid,'PDF');
238 if ($PDF_OUTPUT) {
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'];
242 } else {
243 $sql = "SELECT * FROM facility ORDER BY billing_location DESC LIMIT 1";
245 $facility = sqlQuery($sql);
248 if ($choice !== 'TEXT') { ?>
250 <?php
251 } ?>
252 <table class="report_exam_group">
253 <tr>
254 <td style="text-align:left;padding:1px;vertical-align:top;max-width:720px;">
255 <table style="padding:5px;width:700px;">
256 <tr>
257 <td colspan="1" style="text-align: justify;text-justify: inter-word;width:100%;">
258 <b><?php echo xlt('Chief Complaint'); ?>:</b> &nbsp;<?php echo text($CC1); ?>
259 <br /><br />
260 <b><?php echo xlt('HPI'); ?>:</b>
261 &nbsp;<?php echo $HPI1; ?>
262 <br />
263 <div style="padding-left:20px;">
264 <?php
265 if ($TIMING1) {
266 echo "<i>".xlt('Timing'); ?>:</i> &nbsp;<?php echo text($TIMING1)."<br />";
268 if ($CONTEXT1) {
269 echo "<i>".xlt('Context'); ?>:</i> &nbsp;<?php echo text($CONTEXT1)."<br />";
271 if ($SEVERITY1) {
272 echo "<i>".xlt('Severity'); ?>:</i> &nbsp;<?php echo text($SEVERITY1)."<br />";
274 if ($MODIFY1) {
275 echo "<i>".xlt('Modifying'); ?>:</i> &nbsp;<?php echo text($MODIFY1)."<br />";
277 if ($ASSOCIATED1) {
278 echo "<i>".xlt('Associated'); ?>:</i> &nbsp;<?php echo text($ASSOCIATED1)."<br />";
280 if ($LOCATION1) {
281 echo "<i>".xlt('Location'); ?>:</i> &nbsp;<?php echo text($LOCATION1)."<br />";
283 if ($QUALITY1) {
284 echo "<i>".xlt('Quality'); ?>:</i> &nbsp;<?php echo text($QUALITY1)."<br />";
286 if ($DURATION1) {
287 echo "<i>".xlt('Duration'); ?>:</i> &nbsp;<?php echo text($DURATION1)."<br />";
291 <?php
292 if ($CC2) {
293 echo "
295 echo "<b>".xlt('Chief Complaint 2'); ?>:</b> &nbsp;<?php echo text($CC2); ?>
296 <br />
297 <b><?php echo xlt('HPI'); ?>:</b>
298 &nbsp;<?php echo text($HPI2); ?>
299 <br />
301 <div style="padding-left:10px;">
302 <?php
303 if ($TIMING2) {
304 echo "<i>".xlt('Timing'); ?>:</i> &nbsp;<?php echo text($TIMING2)."<br />";
306 if ($CONTEXT2) {
307 echo "<i>".xlt('Context'); ?>:</i> &nbsp;<?php echo text($CONTEXT2)."<br />";
309 if ($SEVERITY2) {
310 echo "<i>".xlt('Severity'); ?>:</i> &nbsp;<?php echo text($SEVERITY2)."<br />";
312 if ($MODIFY2) {
313 echo "<i>".xlt('Modifying'); ?>:</i> &nbsp;<?php echo text($MODIFY2)."<br />";
315 if ($ASSOCIATED2) {
316 echo "<i>".xlt('Associated'); ?>:</i> &nbsp;<?php echo text($ASSOCIATED2)."<br />";
318 if ($LOCATION2) {
319 echo "<i>".xlt('Location'); ?>:</i> &nbsp;<?php echo text($LOCATION2)."<br />";
321 if ($QUALITY2) {
322 echo "<i>".xlt('Quality'); ?>:</i> &nbsp;<?php echo text($QUALITY2)."<br />";
324 if ($DURATION2) {
325 echo "<i>".xlt('Duration'); ?>:</i> &nbsp;<?php echo text($DURATION2)."<br />";
328 </div>
329 <?php
331 if ($CC3) {
335 <?php echo "<b>".xlt('Chief Complaint 3'); ?>:</b> &nbsp;<?php echo text($CC3); ?>
336 <br />
337 <?php echo xlt('HPI'); ?>&nbsp; <?php echo text($HPI3); ?>
338 <br />
339 <div style="padding-left:10px;">
340 <?php
341 if ($TIMING3) {
342 echo "<i>".xlt('Timing'); ?>:</i> &nbsp;<?php echo text($TIMING3)."<br />";
344 if ($CONTEXT3) {
345 echo "<i>".xlt('Context'); ?>:</i> &nbsp;<?php echo text($CONTEXT3)."<br />";
347 if ($SEVERITY3) {
348 echo "<i>".xlt('Severity'); ?>:</i> &nbsp;<?php echo text($SEVERITY3)."<br />";
350 if ($MODIFY3) {
351 echo "<i>".xlt('Modifying'); ?>:</i> &nbsp;<?php echo text($MODIFY3)."<br />";
353 if ($ASSOCIATED3) {
354 echo "<i>".xlt('Associated'); ?>:</i> &nbsp;<?php echo text($ASSOCIATED3)."<br />";
356 if ($LOCATION3) {
357 echo "<i>".xlt('Location'); ?>:</i> &nbsp;<?php echo text($LOCATION3)."<br />";
359 if ($QUALITY3) {
360 echo "<i>".xlt('Quality'); ?>:</i> &nbsp;<?php echo text($QUALITY3)."<br />";
362 if ($DURATION3) {
363 echo "<i>".xlt('Duration'); ?>:</i> &nbsp;<?php echo text($DURATION3)."<br />";
366 </div>
368 <?php
372 <?php
373 if (($CHRONIC1)&&($cols != 'Fax')) { ?>
374 <b><?php echo xlt('Chronic or Inactive Problems'); ?>:</b> <br />
375 &nbsp;<?php echo text($CHRONIC1)."<br />";
376 if ($CHRONIC2) echo "&nbsp;".$CHRONIC2."<br />";
377 if ($CHRONIC3) echo "&nbsp;".$CHRONIC3."<br />";
378 } ?>
379 </div>
380 </td>
381 </tr>
382 </table>
383 </td>
384 <td style="width:220px;padding:1px;vertical-align:top;">
385 <?php
386 //get patient photo
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;
417 else {
418 $from_file = $GLOBALS["fileroot"] . "/sites/" . $_SESSION['site_id'] .
419 '/documents/' . $from_pathname . '/' . $from_filename;
421 if ($PDF_OUTPUT) {
422 echo "<img src='". $from_file."' style='width:220px;'>";
423 } else {
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;'>";
429 </td>
430 </tr>
431 </table>
432 <?php
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">
438 <tr>
439 <td style="width:680px;text-align:center;margin:1 auto;">
440 <?php
441 $PMSFH = build_PMSFH($pid);
442 if ($cols !='Fax') show_PMSFH_report($PMSFH);
443 $count_rx = '0';
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)) {
448 $count_rx++;
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'];
472 </td>
473 </tr>
474 </table>
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>
485 </tr>
486 <?php if ($SCODVA||$SCOSVA) { ?>
487 <tr>
488 <td><?php echo xlt('sc{{without correction}}'); ?></td>
489 <td><?php echo text($SCODVA); ?></td>
490 <td><?php echo text($SCOSVA); ?></td>
491 </tr>
492 <?php } if ($ODVA_1||$OSVA_1) { ?>
493 <tr>
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>
497 </tr>
498 <?php } if ($ARODVA||$AROSVA) { ?>
499 <tr>
500 <td><?php echo xlt('AR{{autorefraction}}'); ?></td>
501 <td><?php echo text($ARODVA); ?></td>
502 <td><?php echo text($AROSVA); ?></td>
503 </tr>
504 <?php } if ($MRODVA||$MROSVA) { ?>
505 <tr>
506 <td><?php echo xlt('MR{{Manifest Refraction}}'); ?></td>
507 <td><?php echo text($MRODVA); ?></td>
508 <td><?php echo text($MROSVA); ?></td>
509 </tr>
510 <?php } if ($CRODVA||$CROSVA) { ?>
511 <tr>
512 <td><?php echo xlt('CR{{Cycloplegic Refraction}}'); ?></td>
513 <td><?php echo text($CRODVA); ?></td>
514 <td><?php echo text($CROSVA); ?></td>
515 </tr>
516 <?php } if ($PHODVA||$PHOSVA) { ?>
517 <tr>
518 <td><?php echo xlt('PH{{Pinhole Vision}}'); ?></td>
519 <td><?php echo text($PHODVA); ?></td>
520 <td><?php echo text($PHOSVA); ?></td>
521 </tr>
522 <?php } if ($CTLODVA||$CTLOSVA) { ?>
523 <tr>
524 <td><?php echo xlt('CTL{{Contact Lens Vision}}'); ?></td>
525 <td><?php echo text($CTLODVA); ?></td>
526 <td><?php echo text($CTLOSVA); ?></td>
527 </tr>
528 <?php } if ($SCNEARODVA||$SCNEAROSVA) { ?>
529 <tr>
530 <td><?php echo xlt('scNear{{without correction near}}'); ?></td>
531 <td><?php echo text($SCNEARODVA); ?></td>
532 <td><?php echo text($SCNEAROSVA); ?></td>
533 </tr>
534 <?php } if ($ODNEARVA_1||$WNEAROSVA_1) { ?>
535 <tr>
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>
539 </tr>
540 <?php } if ($ARNEARODVA||$ARNEAROSVA) { ?>
541 <tr>
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>
545 </tr>
546 <?php } if ($MRNEARODVA||$MRNEAROSVA) { ?>
547 <tr>
548 <td><?php echo xlt('MRNear{{Manifest Near Acuity}}'); ?></td>
549 <td><?php echo text($MRNEARODVA); ?></td>
550 <td><?php echo text($MRNEAROSVA); ?></td>
551 </tr>
552 <?php } if ($PAMODVA||$PAMOSVA) { ?>
553 <tr>
554 <td><?php echo xlt('PAM{{Potential Acuity Meter}}'); ?></td>
555 <td><?php echo text($PAMODVA); ?></td>
556 <td><?php echo text($PAMOSVA); ?></td>
557 </tr>
558 <?php } if ($GLAREODVA||$GLAREOSVA) { ?>
559 <tr>
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>
563 </tr>
564 <?php } if ($CONTRASTODVA||$CONTRASTOSVA) { ?>
565 <tr>
566 <td><?php echo xlt('Contrast{{Constrast Visual Acuity}}'); ?></td>
567 <td><?php echo text($CONTRASTODVA); ?></td>
568 <td><?php echo text($CONTRASTOSVA); ?></td>
569 </tr>
570 <?php } ?>
571 </table>
572 </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>
581 </tr>
582 <?php
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>";
587 <tr>
588 <td colspan="3" style="text-align:center;">
589 @ <?php echo text($IOPTIME); ?>
590 </td>
591 </tr>
592 </table>
593 </td>
594 <!-- START OF THE FIELDS BOX -->
595 <?php
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++) {
599 $ODzone = "ODVF".$z;
600 if ($$ODzone =='1') {
601 $ODVF[$z] = '<i class="fa fa-square fa-5">X</i>';
602 if ($PDF_OUTPUT) $ODVF[$z] = 'X';
603 $bad++;
604 } else {
605 $ODVF[$z] = '<i class="fa fa-square-o fa-5"></i>';
606 if ($PDF_OUTPUT) $ODVF[$z] = 'O';
609 $OSzone = "OSVF".$z;
610 if ($$OSzone =="1") {
611 $OSVF[$z] = '<i class="fa fa-square fa-5">X</i>';
612 if ($PDF_OUTPUT) $OSVF[$z] = 'X';
613 $bad++;
614 } else {
615 $OSVF[$z] = '<i class="fa fa-square-o fa-5"></i>';
616 if ($PDF_OUTPUT) $OSVF[$z] = 'O';
621 <?php
622 if ($bad < '1' ) { ?>
623 <td class="report_vitals">
624 <b class="underline"><?php echo xlt('Fields{{visual fields}}'); ?></b>
625 <?php
626 echo "<br /><br />&nbsp;Full to CF OU&nbsp;<br /><br /><br />";
627 } else {
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>
634 <br />
635 <br />
636 </td>
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>
639 <br />
640 <br />
641 </td>
642 </tr>
643 <tr>
644 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:center;">
645 <?php echo $ODVF['1']; ?>
646 </td>
647 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:center;">
648 <?php echo $ODVF['2']; ?>
649 </td>
650 <td></td>
651 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:center;">
652 <?php echo $OSVF['1']; ?>
653 </td>
654 <td style="border-left:1pt solid black;border-bottom:1pt solid black;text-align:center;">
655 <?php echo $OSVF['2']; ?>
656 </td>
657 </tr>
658 <tr>
659 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:center;">
660 <?php echo $ODVF['3']; ?>
661 </td>
662 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:center;">
663 <?php echo $ODVF['4']; ?>
664 </td>
665 <td></td>
666 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:center;">
667 <?php echo $OSVF['3']; ?>
668 </td>
669 <td style="border-left:1pt solid black;border-top:1pt solid black;text-align:center;">
670 <?php echo $OSVF['4']; ?>
671 </td>
672 </tr>
673 </table>
674 <?php
675 } ?>
676 </td>
678 <!-- START OF THE MOTILITY BOX -->
679 <td class="report_vitals">
680 <b class="underline"><?php echo xlt('Motility'); ?></b>
681 <?php
682 if ($MOTILITYNORMAL =='on') {
683 echo "<br /><br />&nbsp;".xlt('D&V Full OU{{Ductions and Versions full both eyes}}') ."&nbsp;<br /><br />";
684 } else {
685 if ($PDF_OUTPUT) {
686 $background = "url(".$GLOBALS["fileroot"] . "/interface/forms/".$form_folder."/images/eom.jpg)";
687 } else {
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>
699 </tr>
700 <tr>
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;">
703 <tr>
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>
707 </tr>
708 <tr>
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>
712 </tr>
713 <tr>
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>
717 </tr>
718 </table>
719 </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;">
722 <tr>
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>
726 </tr>
727 <tr>
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>
731 </tr>
732 <tr>
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>
736 </tr>
737 </table>
738 </td>
739 </tr>
740 </table>
741 <?php
742 } ?>
743 </td>
745 <?php
746 if (($PUPIL_NORMAL =='1')|| $ODPUPILSIZE1||$OSPUPILSIZE1) {
748 <td class="report_vitals" style="border-right:0px;">
749 <?php
750 if (($PUPIL_NORMAL =='1')&&(!$ODPUPILSIZE1||!$OSPUPILSIZE1)) { ?>
751 <b class="underline"><?php echo xlt('Pupils'); ?></b>&nbsp;&nbsp;
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;">
756 <tr>
757 <!-- start of the Pupils box -->
758 <td>
759 <b class="underline"><?php echo xlt('Pupils'); ?></b>
760 <table style="font-size: 8px;text-align:middle;">
761 <tr>
762 <th> &nbsp;
763 </th>
764 <th style="padding: 2px 5px;"><?php echo xlt('size'); ?> (<?php echo xlt('mm{{millimeters}}'); ?>)
765 </th>
766 <th style="padding: 2px;"><?php echo xlt('react{{reactivity}}'); ?>
767 </th>
768 <th style="padding: 2px;"><?php echo xlt('APD{{afferent pupillary defect}}'); ?>
769 </th>
770 </tr>
771 <tr>
772 <td><b><?php echo xlt('OD'); ?></b>
773 </td>
774 <td style="border-right:1pt solid black;border-bottom:1pt solid black;text-align:center;">
775 <?php echo text($ODPUPILSIZE1); ?>
776 --&gt;
777 <?php echo text($ODPUPILSIZE2); ?>
778 </td>
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); ?>
781 </td>
782 <td style="text-align:center;border-bottom:1pt solid black;">
783 <?php echo text($ODAPD); ?>
784 </td>
785 </tr>
786 <tr>
787 <td><b><?php echo xlt('OS'); ?></b>
788 </td>
789 <td style="border-right:1pt solid black;border-top:1pt solid black;text-align:center;">
790 <?php echo text($OSPUPILSIZE1); ?>
791 --&gt;
792 <?php echo text($OSPUPILSIZE2); ?>
793 </td>
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); ?>
796 </td>
797 <td style="text-align:center;border-top:1pt solid black;">
798 <?php echo text($OSAPD); ?>
799 </td>
800 </tr>
801 </table>
802 </td>
803 </tr>
804 </table>
805 </td>
806 <?php
808 } ?>
809 </tr>
810 </table>
811 <?php
813 if ($DIMODPUPILSIZE1||$DIMOSPUPILSIZE1||$PUPIL_COMMENTS||$AMSLEROD||$AMSLEROS) { ?>
814 <!-- start of slide down pupils_panel -->
815 <br />
816 <table class='borderShadow' style="margin:1px;text-align:center;font-size:9px;">
817 <tr>
818 <td>
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;">
821 <tr >
822 <th></th>
823 <th style="padding: 2px;text-align:center;" ><?php echo xlt('size'); ?> (<?php echo xlt('mm{{millimeters}}'); ?>)
824 </th>
825 </tr>
826 <tr>
827 <td><b><?php echo xlt('OD'); ?></b>
828 </td>
829 <td style="text-align:bottom;border-bottom:1pt solid black;padding-left:0.1in;">
830 <?php echo text($DIMODPUPILSIZE1); ?>
831 --&gt;
832 <?php echo text($DIMODPUPILSIZE2); ?>
833 </td>
835 </tr>
836 <tr>
837 <td ><b><?php echo xlt('OS'); ?></b>
838 </td>
839 <td style="border-top:1pt solid black;padding-left:0.1in;">
840 <?php echo text($DIMOSPUPILSIZE1); ?>
841 --&gt;
842 <?php echo text($DIMOSPUPILSIZE2); ?>
843 </td>
844 </tr>
845 <tr><td colspan="2" style="padding-left:2px;text-align:bottom;">
847 <?php echo text($PUPIL_COMMENTS); ?>
848 </td>
849 </tr>
850 </table>
851 </td>
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>
857 <?php
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>
864 <td></td>
865 <td style="text-align:center;text-decoration:underline;"><?php echo xlt('OS'); ?></td>
866 </tr>
868 <tr>
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;" />
871 <br />
872 <small><?php echo text($AMSLEROD); ?>/5</small>
873 </td>
874 <td></td>
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>
878 </td>
879 </tr>
880 </table>
881 </td>
882 <?php } ?>
883 </tr>
884 </table>
886 <?php
889 if ($cols !='Fax') {
890 if ($ODVA||$OSVA||$ARODSPH||$AROSSPH||$MRODSPH||$MROSSPH||$CRODSPH||$CROSSPH||$CTLODSPH||$CTLOSSPH) { ?>
891 <!-- start of the refraction boxes -->
892 <br />
893 <table class="refraction_tables">
894 <tr>
895 <td colspan="9" style="text-align:left;text-decoration:underline;font-weight:bold;"><?php echo xlt('Refractive States'); ?>
896 </td>
897 </tr>
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>
909 </tr>
910 <?php
911 //$count_rx++;
912 for ($i=1; $i <= $count_rx; $i++) {
913 if (${"RX_TYPE_$i"} =="0") {
914 $RX_TYPE = '';
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))?:"-");
929 <tr>
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>
940 </tr>
941 <tr>
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>
952 </tr>
953 <?php
954 if (${"COMMENTS_$i"}) {
956 <tr>
957 <td></td>
958 <td colspan="2"><?php echo xlt('Comments'); ?>:</td>
959 <td colspan="7"><?php echo text(${"COMMENTS_$i"}); ?></td>
960 </tr>
961 <?php
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>
977 </tr>
978 <tr>
979 <td>&nbsp;</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>
989 </tr>
990 <?php
991 if (${"COMMENTS_$i"}) {
993 <tr>
994 <td></td><td></td>
995 <td>Comments:</td>
996 <td colspan="7"><?php echo text(${"COMMENTS_$i"}); ?></td>
997 </tr>
998 <?php
1001 if ($MRODSPH||$MROSSPH) { ?>
1002 <tr>
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>
1013 </tr>
1014 <tr></tr>
1015 <tr>
1016 <td></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>
1026 </tr>
1027 <?php
1029 if ($CRODSPH||$CROSSPH) { ?>
1030 <tr>
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>
1041 </tr>
1042 <tr>
1043 <td></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)?:"-"); ?>&nbsp;</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>
1053 </tr>
1054 <?php
1056 if ($CTLODSPH||$CTLOSSPH) { ?>
1057 <tr style="text-align:center;padding:5px;text-decoration:underline;">
1058 <td></td>
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>
1067 </tr>
1068 <tr>
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>
1078 </tr>
1079 <tr style="font-size:0.6em;">
1080 <td></td>
1081 <td></td>
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>
1086 </tr>
1087 <tr>
1088 <td></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>
1097 </tr>
1098 <tr style="font-size:0.6em;">
1099 <td></td>
1100 <td></td>
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>
1104 </tr>
1106 <?php
1109 </table>
1110 <?php
1111 } ?>
1112 <br />
1114 <?php
1115 if ($GLAREODVA||$CONTRASTODVA||$ODK1||$ODK2||$LIODVA||$PAMODBA) { ?>
1116 <table>
1117 <tr>
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>
1121 <tr><td></td>
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>
1129 </tr>
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>
1138 </tr>
1139 <tr>
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>
1148 </tr>
1149 <tr><td>&nbsp;</td></tr>
1150 <tr>
1151 <td></td>
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> -->
1159 </tr>
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> -->
1168 </tr>
1169 <tr>
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> -->
1178 </tr>
1179 </table>
1180 </td>
1181 </tr>
1182 </table>
1183 <?php
1188 <!-- end of the refraction boxes -->
1190 <!-- start of external exam -->
1191 <div class="report_exam_group">
1192 <table>
1193 <tr>
1194 <td style="text-align:left;vertical-align:top;">
1195 <b class="underline"><?php echo xlt('External Exam'); ?>:</b>
1196 <table class="report_section">
1197 <tr>
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>
1201 </tr>
1202 <tr>
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>
1206 </tr>
1207 <tr>
1208 <td class="report_text right ">
1209 <?php echo text($RUL); ?>
1210 </td>
1211 <td class="middle"><?php echo xlt('Upper Lids'); ?></td>
1212 <td class="report_text left"><?php echo text($LUL); ?></td>
1213 </tr>
1214 <tr>
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>
1218 </tr>
1219 <tr>
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>
1223 </tr>
1224 <?php
1225 if ($RADNEXA || $LADNEXA) {
1227 <tr>
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>
1231 </tr>
1232 <?php
1234 if ($EXT_COMMENTS) { ?>
1235 <tr>
1236 <td colspan="3">
1238 <b><?php echo xlt('Comments'); ?>:</b>
1239 <span style="height:3.0em;">
1240 <?php echo text($EXT_COMMENTS); ?>
1241 </span>
1242 </td>
1243 </tr>
1244 <?php } ?>
1245 </table>
1246 </td>
1247 <td style="text-align:center;padding:1px;vertical-align:middle;">
1248 <?php
1249 display_draw_image ("EXT",$encounter,$pid);
1251 </td>
1252 </tr>
1253 </table>
1254 </div>
1255 <!-- end of external exam -->
1256 <div class="report_exam_group">
1257 <?php
1258 if ($OSCONJ||$ODCONJ||$ODCORNEA||$OSCORNEA||$ODAC||$OSAC||$ODLENS||$OSLENS||$ODIRIS||$OSIRIS) {
1260 <!-- start of Anterior Segment exam -->
1261 <table>
1262 <tr>
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">
1266 <tr>
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>
1270 </tr>
1271 <tr>
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>
1275 </tr>
1276 <tr>
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>
1280 </tr>
1281 <tr>
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>
1285 </tr>
1286 <tr>
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>
1290 </tr>
1291 <tr>
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>
1295 </tr>
1296 <?php if ($ODGONIO||$OSDGONIO) { ?>
1297 <tr>
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>
1301 </tr>
1302 <?php } if ($ODKTHICKNESS||$OSKTHICKNESS) { ?>
1303 <tr>
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>
1307 </tr>
1308 <?php } if ($ODSCHIRMER1||$OSSCHIRMER1) { ?>
1309 <tr>
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>
1313 </tr>
1314 <?php } if ($ODSCHIRMER2||$OSSCHIRMER2) { ?>
1315 <tr>
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>
1319 </tr>
1320 <?php } if ($ODTBUT||$OSTBUT) { ?>
1321 <tr>
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>
1325 </tr>
1326 <?php }
1327 if ($ANTSEG_COMMENTS) { ?>
1328 <tr>
1329 <td colspan="2">
1330 <b><?php echo xlt('Comments'); ?>:</b>
1331 <span style="height:3.0em;">
1332 <?php echo text($ANTSEG_COMMENTS); ?>
1333 </span>
1334 </td>
1335 </tr>
1336 <?php } ?>
1337 </table>
1338 </td>
1339 <td style="text-align:center;padding:1px;vertical-align:middle;">
1340 <?php
1341 display_draw_image ("ANTSEG",$encounter,$pid);
1343 </td>
1344 </tr>
1345 </table>
1346 <!-- end of Anterior Segment exam -->
1348 <?php
1351 </div>
1352 <div class="report_exam_group">
1354 <!-- start of Other exam -->
1355 <?php
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) {
1362 <table>
1363 <tr>
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'); ?>
1369 </span>
1370 <?php } ?>
1371 <table class="report_section">
1372 <tr>
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>
1376 </tr>
1377 <?php
1378 if ($RLF || $LLF) { ?>
1379 <tr>
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>
1383 </tr>
1384 <?php
1386 if ($RMRD || $LMRD) { ?>
1387 <tr>
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>
1391 </tr>
1392 <?php
1394 if ($RVFISSURE || $LVFISSURE) { ?>
1395 <tr>
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>
1399 </tr>
1400 <?php
1402 if ($RCAROTID || $LCAROTID) { ?>
1403 <tr>
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>
1407 </tr>
1408 <?php
1410 if ($RTEMPART || $LTEMPART) { ?>
1411 <tr>
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>
1415 </tr>
1416 <?php
1418 if ($RCNV || $LCNV) { ?>
1419 <tr>
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>
1423 </tr>
1424 <?php
1426 if ($RCNVII || $LCNVII) { ?>
1427 <tr>
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>
1431 </tr>
1432 <?php
1434 if ($HERTELBASE) { ?>
1435 <tr>
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'); ?>
1439 </b>
1440 <br />
1441 <?php
1442 if ($HERTELBASE) { ?>
1444 <b style="border:1pt solid black;width:30px;text-align:center;padding:0 5;">
1445 <?php echo text($ODHERTEL); ?>
1446 </b>
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); ?>
1450 </b>
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); ?>
1454 </b>
1455 <?php
1456 } ?>
1457 </td>
1458 </tr>
1459 <?php
1462 if ($ODCOLOR || $OSCOLOR || $ODREDDESAT ||
1463 $OSREDDESAT ||$ODCOINS || $OSCOINS ||
1464 $ODNPA || $OSNPA || $NPA || $NPC || $STEREOPSIS) { ?>
1465 <!-- start of NEURO exam -->
1466 <?php
1467 if ($ODCOLOR or $OSCOLOR) { ?>
1468 <tr>
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>
1472 </tr>
1473 <?php
1475 if ($ODREDDESAT or $OSREDDESAT) { ?>
1476 <tr>
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>
1480 </tr><?php
1482 if ($ODCOINS or $OSCOINS) { ?>
1483 <tr>
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>
1487 </tr>
1488 <?php
1490 if ($ODNPA or $OSNPA) { ?>
1491 <tr>
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>
1495 </tr>
1496 <?php }
1497 if ($ODNPC or $OSNPC) { ?>
1498 <tr>
1499 <td class="right" style="font-weight:600;"><?php echo xlt('NPC{{near point of convergence}}'); ?>:&nbsp;</td>
1500 <td class="center" colspan="2" ><?php echo text($NPC); ?></td>
1501 </tr>
1502 <?php }
1503 if ($DACCDIST or $DACCNEAR or $CACCDIST or $CACCNEAR or $VERTFUSAMPS) { ?>
1504 <tr style="text-decoration:underline;">
1505 <td></td>
1506 <td class="middle"><?php echo xlt('Distance'); ?> </td>
1507 <td class="middle"> <?php echo xlt('Near'); ?></td>
1508 </tr>
1509 <?php }
1510 if ($DACCDIST or $DACCNEAR) { ?>
1511 <tr>
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>
1515 </tr>
1516 <?php }
1517 if ($CACCDIST or $CACCNEAR) { ?>
1518 <tr>
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>
1522 </tr>
1523 <?php }
1524 if ($VERTFUSAMPS) { ?>
1525 <tr>
1526 <td class="right" style="font-weight:600;">
1527 <?php echo xlt('Vert Fusional Amps'); ?>:
1528 </td>
1529 <td colspan="2" class="center">
1530 <?php echo text($VERTFUSAMPS); ?>
1531 <br />
1532 </td>
1533 </tr>
1534 <?php }
1535 if ($STEREOPSIS) { ?>
1536 <tr>
1537 <td class="right" style="font-weight:600;"><?php echo xlt('Stereopsis'); ?>:&nbsp;</td>
1538 <td class="center" colspan="2"><?php echo text($STEREOPSIS); ?></td>
1539 </tr>
1540 <?php }
1541 } ?>
1542 </table>
1543 </td>
1544 <td style="text-align:center;padding:1px;vertical-align:middle;">
1545 <?php
1546 display_draw_image ("NEURO",$encounter,$pid);
1548 </td>
1549 </tr>
1550 </table>
1551 <?php
1552 } ?>
1553 <!-- end of Other exam -->
1554 </div>
1555 <div class="report_exam_group">
1557 <!-- start of the Retina exam -->
1558 <?php
1559 if ($ODDISC||$OSDISC||$ODCUP||$ODMACULA||$ODVESSELS||$ODPERIPH) {
1561 <table>
1562 <tr>
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">
1566 <tr>
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>
1570 </tr>
1571 <tr>
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>
1575 </tr>
1576 <tr>
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>
1580 </tr>
1581 <tr>
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>
1585 </tr>
1586 <tr>
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>
1590 </tr>
1591 <?php if ($ODPERIPH||$OSPERIPH) { ?>
1592 <tr>
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>
1596 </tr>
1597 <?php } if ($ODCMT||$OSCMT) { ?>
1598 <tr>
1599 <td class="report_text right">&nbsp;<?php echo text($ODCMT); ?></td>
1600 <td class="middle"><?php echo xlt('Central Macular Thickness'); ?> </td>
1601 <td class="report_text left" >&nbsp;<?php echo text($OSCMT); ?></td>
1602 </tr>
1603 <?php } ?>
1604 <?php if ($RETINA_COMMENTS) { ?>
1605 <tr>
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); ?>
1611 </span>
1613 </td>
1614 </tr>
1615 <?php } ?>
1616 </table>
1617 </td>
1618 <td style="text-align:center;padding:1px;vertical-align:middle;">
1619 <?php
1620 display_draw_image ("RETINA",$encounter,$pid);
1622 </td>
1623 </tr>
1624 </table>
1626 <?php
1627 } ?>
1628 <!-- end of Retina exam -->
1629 </div>
1630 <?php
1631 if ($ACT !='on') { ?>
1632 <table style="text-align:center;font-size:0.7em;">
1633 <tr>
1634 <td colspan=3 style="">
1635 <table>
1636 <tr style="text-align:left;height:16px;vertical-align:middle;width:880px;">
1637 <td>
1638 <span id="ACTTRIGGER" name="ACTTRIGGER" style="text-decoration:underline;padding-left:2px;">
1639 <?php echo xlt('Alternate Cover Test'); ?>:
1640 </span>
1641 </td>
1642 </tr>
1643 <tr>
1644 <?php
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;">
1649 <tr>
1650 <td id="ACT_tab_SCDIST" name="ACT_tab_SCDIST" class="ACT_deselected"> <?php echo xlt('sc Distance{{without correction distance}}'); ?> </td>
1651 </tr>
1652 <tr>
1653 <td colspan="4" style="text-align:center;font-size:0.9em;">
1654 <table>
1655 <tr>
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>
1661 </tr>
1662 <tr>
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>
1668 </tr>
1669 <tr>
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>
1675 </tr>
1676 </table>
1677 </td>
1678 </tr>
1679 </table>
1680 </td>
1681 <?php
1683 if ($ACT5CCDIST) {
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;">
1687 <tr>
1688 <td class="ACT_deselected"> <?php echo xlt('cc Distance{{with correction at distance}}'); ?> </td>
1689 </tr>
1690 <tr>
1691 <td colspan="4" style="text-align:center;font-size:0.8em;">
1692 <table>
1693 <tr>
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>
1699 </tr>
1700 <tr>
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>
1706 </tr>
1707 <tr>
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); ?>
1713 </td>
1714 </tr>
1715 </table>
1716 </td>
1717 </tr>
1718 </table>
1719 </td>
1720 </tr>
1721 <tr>
1722 <?php
1724 if ($ACT5SCNEAR) {
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;">
1729 <tr>
1730 <td class="ACT_deselected"> <?php echo xlt('sc Near{{without correction near}}'); ?> </td>
1731 </tr>
1732 <tr>
1733 <td colspan="4" style="text-align:center;font-size:0.8em;">
1734 <table>
1735 <tr>
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>
1741 </tr>
1742 <tr>
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>
1748 </tr>
1749 <tr>
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); ?>
1755 </td>
1756 </tr>
1757 </table>
1758 </td>
1759 </tr>
1760 </table>
1761 </td>
1762 <?php
1764 if ($ACT5CCNEAR) {
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;">
1769 <tr>
1770 <td class="ACT_deselected"> <?php echo xlt('cc Near{{with correction at Near}}'); ?> </td>
1771 </tr>
1772 <tr>
1773 <td colspan="4" style="text-align:center;font-size:1.0em;">
1774 <table>
1775 <tr>
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>
1781 </tr>
1782 <tr>
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>
1788 </tr>
1789 <tr>
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>
1795 </tr>
1796 </table>
1797 </td>
1798 </tr>
1799 </table>
1801 </td>
1802 <?php } ?>
1803 </tr>
1804 </table>
1805 <?php if ($NEURO_COMMENTS) { ?>
1806 <table>
1807 <tr>
1808 <td colspan="2">
1809 <b><?php echo xlt('Comments'); ?>:</b><br />
1810 <span style="height:3.0em;">
1811 <?php echo report_ACT($NEURO_COMMENTS); ?>
1812 </span>
1813 <br /><br />
1814 </td>
1815 </tr>
1816 </table>
1817 <?php } ?>
1818 </td>
1819 </tr>
1820 </table>
1821 <?php
1824 //end choice !== 'TEXT' -- include this in summary mouseover report.
1826 <!-- start of IMPPLAN exam -->
1827 <table class="report_exam_group">
1828 <tr>
1829 <td style="text-align:left;padding:1px;vertical-align:top;width:480px;">
1830 <b><u><?php echo xlt('Impression/Plan'); ?>:</u></b>
1831 <table style="">
1832 <tr>
1833 <td style="padding:5px;text-align: left;text-align:justify;width:475px;">
1834 <?php
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));
1840 $i='0';
1841 $order = array("\r\n", "\n", "\r","\v","\f","\x85","\u2028","\u2029");
1842 $replace = "<br />";
1843 // echo '<ol>';
1844 while ($ip_list = sqlFetchArray($result)) {
1845 $newdata = array (
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;
1856 $i++;
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 />";
1866 } else {
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>
1878 <br />
1879 <div style="padding-left:15px;padding-bottom:10px;width:400px;">
1880 <?php
1881 $PLAN_items = explode('|',$PLAN);
1882 foreach ($PLAN_items as $item) {
1883 echo $item."<br />";
1885 if ($PLAN2) {
1886 echo $PLAN2."<br />";
1889 </div>
1890 <?php
1893 </td>
1894 </tr>
1895 </table>
1896 </td>
1897 <td style="text-align:center;vertical-align:bottom;padding:1px;">
1898 <?php
1899 display_draw_image ("IMPPLAN",$encounter,$pid);
1901 if ($PDF_OUTPUT) {
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>";
1910 <br />
1911 <span style="border-top:1pt solid black;padding-left:50px;"><?php echo text($providerNAME); ?></span>
1912 <?php
1913 } else {
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' />";
1922 </td>
1923 </tr>
1924 </table>
1925 </div>
1926 <?php
1927 return;
1930 function display_draw_image($zone,$encounter,$pid){
1931 global $form_folder;
1932 global $web_root;
1933 global $PDF_OUTPUT;
1934 $side = "OU";
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) {
1951 echo '<tr>';
1952 echo '<td>' . xlt('Note') . ' #' . $note->get_id() . '</td>';
1953 echo '</tr>';
1954 echo '<tr>';
1955 echo '<td>' . xlt('Date') . ': ' . oeFormatShortDate($note->get_date()) . '</td>';
1956 echo '</tr>';
1957 echo '<tr>';
1958 echo '<td>'.$note->get_note().'<br /><br /></td>';
1959 echo '</tr>';
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';
1981 else {
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") {
1988 if ($PDF_OUTPUT) {
1989 echo "<img src='". $from_file."' style='width:220px;height:120px;'>";
1990 } else {
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
1996 else {
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;'>";
2004 return;
2008 function report_ACT($term) {
2009 $term = nl2br(htmlspecialchars($term,ENT_NOQUOTES));
2010 return $term."&nbsp;";