Add access to chartable LBF forms from the demographics summary page, and remove...
[openemr.git] / interface / patient_file / summary / lbf_fragment.php
blob3e0a25af44ac37ded570c9a8d88c3087bdacf2cb
1 <?php
2 /*******************************************************************************\
3 * Copyright 2010 Brady Miller <brady@sparmy.com> *
4 * Copyright 2011 Rod Roark <rod@sunsetsystems.com> *
5 * *
6 * This program is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU General Public License *
8 * as published by the Free Software Foundation; either version 2 *
9 * of the License, or (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ********************************************************************************/
21 //SANITIZE ALL ESCAPES
22 $sanitize_all_escapes = true;
24 //STOP FAKE REGISTER GLOBALS
25 $fake_register_globals = false;
27 require_once("../../globals.php");
29 $lbf_form_id = $_GET['formname'];
31 <div id='<?php echo $lbf_form_id; ?>' style='margin-top: 3px; margin-left: 10px; margin-right: 10px'>
32 <br />
33 <?php
34 // Retrieve most recent instance of this form for this patient.
35 $result = sqlQuery("SELECT date, form_id, form_name FROM forms WHERE pid = ? " .
36 "AND formdir = ? AND deleted = 0 ORDER BY date DESC LIMIT 1",
37 array($pid, $lbf_form_id));
39 if (!$result) { //If there are none
41 <span class='text'> <?php echo htmlspecialchars(xl("None have been documented"), ENT_NOQUOTES); ?>
42 </span>
43 <?php } else { ?>
44 <span class='text'><b>
45 <?php
46 echo htmlspecialchars(xl('Most recent from') . ": " .
47 substr($result['date'], 0, 10), ENT_NOQUOTES);
49 </b></span>
50 <br />
51 <br />
52 <?php
53 include_once($GLOBALS['incdir'] . "/forms/LBF/report.php");
54 call_user_func("lbf_report", '', '', 2, $result['form_id'], $lbf_form_id);
56 <span class='text'>
57 <br />
58 <a href='../encounter/trend_form.php?formname=<?php echo $lbf_form_id; ?>'
59 onclick='top.restoreSession()'>
60 <?php echo htmlspecialchars(xl('Click here to view and graph'),ENT_NOQUOTES);?>
61 </a>
62 </span>
63 <?php } ?>
64 <br />
65 <br />
66 </div>