Portal credential enhancements
[openemr.git] / interface / patient_file / summary / labdata_fragment.php
blob66851b5945bf267e416ac6a0cbc480e907178152
1 <?php
2 /**
3 * labdata_fragment.php
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Joe Slam <joe@produnis.de>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2014 Joe Slam <joe@produnis.de>
10 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../../globals.php");
17 use OpenEMR\Common\Csrf\CsrfUtils;
19 if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) {
20 CsrfUtils::csrfNotVerified();
24 <div id='labdata' style='margin-top: 3px; margin-left: 10px; margin-right: 10px'><!--outer div-->
25 <br>
26 <?php
27 //retrieve most recent set of labdata.
28 $spell = "SELECT procedure_report.date_collected AS thedate, " .
29 "procedure_order_code.procedure_name AS theprocedure, " .
30 "procedure_order.encounter_id AS theencounter " .
31 "FROM procedure_report " .
32 "JOIN procedure_order ON procedure_report.procedure_order_id = procedure_order.procedure_order_id " .
33 "JOIN procedure_order_code ON procedure_order.procedure_order_id = procedure_order_code.procedure_order_id " .
34 "WHERE procedure_order.patient_id = ? " .
35 "ORDER BY procedure_report.date_collected DESC ";
36 $result=sqlQuery($spell, array($pid));
38 if (!$result) { //If there are no lab data recorded
40 <span class='text'> <?php echo xlt("No lab data documented.");
42 </span>
43 <?php
44 } else {
46 <span class='text'><b>
47 <?php echo xlt('Most recent lab data:'); ?>
48 </b>
49 <br />
50 <?php
51 echo xlt('Procedure') . ": " . text($result['theprocedure']) . " (" . text($result['thedate']) . ")<br>";
52 echo xlt('Encounter') . ": <a href='../../patient_file/encounter/encounter_top.php?set_encounter=" . attr_url($result['theencounter']) . "' target='RBot'>" . text($result['theencounter']) . "</a>";
54 <br />
55 </span><span class='text'>
56 <br />
57 <a href='../summary/labdata.php' onclick='top.restoreSession()'><?php echo xlt('Click here to view and graph all labdata.');?></a>
58 </span><?php
59 } ?>
60 <br />
61 <br />
62 </div>