From cfee523162ca35cf27d13afc52656c85cb756080 Mon Sep 17 00:00:00 2001 From: Rod Roark Date: Sat, 22 Jan 2011 23:00:12 -0800 Subject: [PATCH] Add access to chartable LBF forms from the demographics summary page, and remove that for Vitals if not registered. --- interface/forms/LBF/new.php | 31 +++---- interface/patient_file/summary/demographics.php | 103 +++++++++++++++++++----- interface/patient_file/summary/lbf_fragment.php | 66 +++++++++++++++ 3 files changed, 168 insertions(+), 32 deletions(-) create mode 100644 interface/patient_file/summary/lbf_fragment.php diff --git a/interface/forms/LBF/new.php b/interface/forms/LBF/new.php index 14517e74c..687976dbb 100644 --- a/interface/forms/LBF/new.php +++ b/interface/forms/LBF/new.php @@ -17,9 +17,9 @@ $CPR = 4; // cells per row $pprow = array(); -if (! $encounter) { // comes from globals.php - die("Internal error: we do not seem to be in an encounter!"); -} +// if (! $encounter) { // comes from globals.php +// die("Internal error: we do not seem to be in an encounter!"); +// } function end_cell() { global $item_count, $cell_count, $historical_ids; @@ -126,12 +126,6 @@ if ($_POST['bn_save']) { $fname = $GLOBALS['OE_SITE_DIR'] . "/LBF/$formname.plugin.php"; if (file_exists($fname)) include_once($fname); - -$enrow = sqlQuery("SELECT p.fname, p.mname, p.lname, fe.date FROM " . - "form_encounter AS fe, forms AS f, patient_data AS p WHERE " . - "p.pid = '$pid' AND f.pid = '$pid' AND f.encounter = '$encounter' AND " . - "f.formdir = 'newpatient' AND f.deleted = 0 AND " . - "fe.id = f.form_id LIMIT 1"); ?> @@ -206,13 +200,20 @@ function sel_related() {
-

\n"; + echo "$formtitle " . xl('for') . ' '; + echo $enrow['fname'] . ' ' . $enrow['mname'] . ' ' . $enrow['lname']; + echo ' ' . htmlspecialchars(xl('on')) . ' ' . substr($enrow['date'], 0, 10); + echo "

\n"; + } ?> -

@@ -381,10 +382,12 @@ function sel_related() { ?>

+ ' />   ' onclick="top.restoreSession();location=''" />   + ' onclick="top.restoreSession();location='../../patient_file/encounter/trend_form.php?formname='" />   diff --git a/interface/patient_file/summary/demographics.php b/interface/patient_file/summary/demographics.php index af897312e..e5c19ff4f 100644 --- a/interface/patient_file/summary/demographics.php +++ b/interface/patient_file/summary/demographics.php @@ -105,6 +105,10 @@ function image_widget($doc_id,$doc_catg) echo $to_url; } +// Determine if the Vitals form is in use for this site. +$tmp = sqlQuery("SELECT count(*) AS count FROM registry WHERE " . + "directory = 'vitals' AND state = 1"); +$vitals_is_registered = $tmp['count']; ?> @@ -233,39 +237,54 @@ $(document).ready(function(){ }); $("#pnotes_ps_expand").load("pnotes_fragment.php"); $("#disclosures_ps_expand").load("disc_fragment.php"); + + + // Initialize the Vitals form if it is registered. $("#vitals_ps_expand").load("vitals_fragment.php"); - + + + 0 ORDER BY seq, title"); + while($gfrow = sqlFetchArray($gfres)) { +?> + $("#_ps_expand").load("lbf_fragment.php?formname="); + + // fancy box enable_modals(); tabbify(); // modal for dialog boxes - $(".large_modal").fancybox( { - 'overlayOpacity' : 0.0, - 'showCloseButton' : true, - 'frameHeight' : 600, - 'frameWidth' : 1000, - 'centerOnScroll' : false - }); + $(".large_modal").fancybox( { + 'overlayOpacity' : 0.0, + 'showCloseButton' : true, + 'frameHeight' : 600, + 'frameWidth' : 1000, + 'centerOnScroll' : false + }); // modal for image viewer - $(".image_modal").fancybox( { - 'overlayOpacity' : 0.0, - 'showCloseButton' : true, - 'centerOnScroll' : false, - 'autoscale' : true - }); + $(".image_modal").fancybox( { + 'overlayOpacity' : 0.0, + 'showCloseButton' : true, + 'centerOnScroll' : false, + 'autoscale' : true + }); }); @@ -675,6 +694,9 @@ expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, + + + + + + 0 ORDER BY seq, title"); + while($gfrow = sqlFetchArray($gfres)) { +?> + + + +
+

+ +
+
+ + + + + + + diff --git a/interface/patient_file/summary/lbf_fragment.php b/interface/patient_file/summary/lbf_fragment.php new file mode 100644 index 000000000..3e0a25af4 --- /dev/null +++ b/interface/patient_file/summary/lbf_fragment.php @@ -0,0 +1,66 @@ + * + * Copyright 2011 Rod Roark * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ********************************************************************************/ + +//SANITIZE ALL ESCAPES +$sanitize_all_escapes = true; + +//STOP FAKE REGISTER GLOBALS +$fake_register_globals = false; + +require_once("../../globals.php"); + +$lbf_form_id = $_GET['formname']; +?> +
+
+ + + + + + + +
+
+ + +
+ + + +
+ +
+
+
-- 2.11.4.GIT