From 1f9ddcd86ab19e8f8376daf716b94d0c1f7cd8a8 Mon Sep 17 00:00:00 2001 From: Rod Roark Date: Sun, 23 Jan 2011 18:16:07 -0800 Subject: [PATCH] Some further cleanup for chartable LBF forms. --- interface/forms/LBF/new.php | 33 ++++++++++++++++--------- interface/patient_file/summary/demographics.php | 4 --- interface/super/edit_layout.php | 5 +++- library/options.inc.php | 3 ++- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/interface/forms/LBF/new.php b/interface/forms/LBF/new.php index 687976dbb..b5ff970f3 100644 --- a/interface/forms/LBF/new.php +++ b/interface/forms/LBF/new.php @@ -17,9 +17,11 @@ $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!"); -// } +// $is_lbf is defined in trend_form.php and indicates that we are being +// invoked from there; in that case the current encounter is irrelevant. +if (empty($is_lbf) && !$encounter) { + die("Internal error: we do not seem to be in an encounter!"); +} function end_cell() { global $item_count, $cell_count, $historical_ids; @@ -201,7 +203,7 @@ function sel_related() { onsubmit="return top.restoreSession()"> 0) { echo " "; - echo "" . htmlspecialchars(xl('Current')) . "\n"; + echo ""; + if (empty($is_lbf)) echo htmlspecialchars(xl('Current')); + echo "\n"; $hres = sqlStatement("SELECT date, form_id FROM forms WHERE " . "pid = '$pid' AND formdir = '$formname' AND " . "form_id != '$formid' AND deleted = 0 " . "ORDER BY date DESC LIMIT $formhistory"); while ($hrow = sqlFetchArray($hres)) { $historical_ids[$hrow['form_id']] = ''; - echo " " . $hrow['date'] . "\n"; + echo " " . $hrow['date'] . "\n"; // TBD: Format date per globals. } echo " "; @@ -363,10 +367,13 @@ function sel_related() { ++$item_count; - if ($frow['edit_options'] == 'H') - echo generate_display_field($frow, $currvalue); - else - generate_form_field($frow, $currvalue); + // Skip current-value fields for the display-only case. + if (empty($is_lbf)) { + if ($frow['edit_options'] == 'H') + echo generate_display_field($frow, $currvalue); + else + generate_form_field($frow, $currvalue); + } // Append to historical data of other dates for this item. foreach ($historical_ids as $key => $dummy) { @@ -382,16 +389,18 @@ function sel_related() { ?>

- + ' />   ' onclick="top.restoreSession();location=''" />   - ' onclick="top.restoreSession();location='../../patient_file/encounter/trend_form.php?formname='" />   + +' onclick='window.back();' /> +

diff --git a/interface/patient_file/summary/demographics.php b/interface/patient_file/summary/demographics.php index e5c19ff4f..b86e2a6dd 100644 --- a/interface/patient_file/summary/demographics.php +++ b/interface/patient_file/summary/demographics.php @@ -694,8 +694,6 @@ expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, - - @@ -768,8 +766,6 @@ expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, } // end while ?> - - diff --git a/interface/super/edit_layout.php b/interface/super/edit_layout.php index 9aa62f38b..652e9cd6f 100644 --- a/interface/super/edit_layout.php +++ b/interface/super/edit_layout.php @@ -441,7 +441,10 @@ function writeFieldLine($linedata) { htmlspecialchars($linedata['datacols'], ENT_QUOTES) . "' size='3' maxlength='10' class='optin' />"; echo "\n"; - echo " "; + echo " "; echo ""; echo "\n"; diff --git a/library/options.inc.php b/library/options.inc.php index ed51c20f3..1af811014 100644 --- a/library/options.inc.php +++ b/library/options.inc.php @@ -20,13 +20,14 @@ // // C = Capitalize first letter of each word (text fields) // D = Check for duplicates in New Patient form +// G = Graphable (for numeric fields in forms supporting historical data) // H = Read-only field copied from static history // L = Lab Order ("ord_lab") types only (address book) // N = Show in New Patient form // O = Procedure Order ("ord_*") types only (address book) +// R = Distributor types only (address book) // U = Capitalize all letters (text fields) // V = Vendor types only (address book) -// R = Distributor types only (address book) // 1 = Write Once (not editable when not empty) (text fields) require_once("formdata.inc.php"); -- 2.11.4.GIT