2 /*******************************************************************************\
3 * Copyright (C) 2014 Joe Slam (joe@produnis.de) *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License *
7 * as published by the Free Software Foundation; either version 2 *
8 * of the License, or (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, *
17 * see <http://opensource.org/licenses/gpl-license.php> *
18 ********************************************************************************
20 * @author Joe Slam <joe@produnis.de>
21 * @link http://www.open-emr.org
26 require_once("../../globals.php");
29 <div id
='labdata' style
='margin-top: 3px; margin-left: 10px; margin-right: 10px'><!--outer div
-->
32 //retrieve most recent set of labdata.
33 $spell = "SELECT procedure_report.date_collected AS thedate, " .
34 "procedure_order_code.procedure_name AS theprocedure, " .
35 "procedure_order.encounter_id AS theencounter " .
36 "FROM procedure_report " .
37 "JOIN procedure_order ON procedure_report.procedure_order_id = procedure_order.procedure_order_id " .
38 "JOIN procedure_order_code ON procedure_order.procedure_order_id = procedure_order_code.procedure_order_id " .
39 "WHERE procedure_order.patient_id = ? " .
40 "ORDER BY procedure_report.date_collected DESC ";
41 $result=sqlQuery($spell, array($pid));
43 if (!$result) { //If there are no lab data recorded
45 <span
class='text'> <?php
echo htmlspecialchars(xl("No lab data documented."), ENT_NOQUOTES
);
51 <span
class='text'><b
>
52 <?php
echo htmlspecialchars(xl('Most recent lab data:'), ENT_NOQUOTES
); ?
>
56 echo xlt('Procedure') . ": " . text($result['theprocedure']) . " (" . text($result['thedate']) . ")<br>";
57 echo xlt('Encounter') . ": <a href='../../patient_file/encounter/encounter_top.php?set_encounter=" . attr($result['theencounter']) . "' target='RBot'>" . text($result['theencounter']) . "</a>";
60 </span
><span
class='text'>
62 <a href
='../summary/labdata.php' onclick
='top.restoreSession()'><?php
echo htmlspecialchars(xl('Click here to view and graph all labdata.'), ENT_NOQUOTES
);?
></a
>