From 6ece90164d65bcb9702eca47f278849f9f7cf300 Mon Sep 17 00:00:00 2001 From: stephen waite Date: Mon, 24 Apr 2023 06:59:21 -0400 Subject: [PATCH] fix: fixes #6399, checks for dashboard context when creating new vitals form (#6400) --- interface/forms/vitals/C_FormVitals.class.php | 6 ++++-- interface/patient_file/summary/demographics.php | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/interface/forms/vitals/C_FormVitals.class.php b/interface/forms/vitals/C_FormVitals.class.php index 53bdec1f0..4b7e94f3d 100644 --- a/interface/forms/vitals/C_FormVitals.class.php +++ b/interface/forms/vitals/C_FormVitals.class.php @@ -34,6 +34,7 @@ class C_FormVitals var $form_id; var $units_of_measurement; var $template_mod; + var $context; const OMIT_CIRCUMFERENCES_NO = 0; const OMIT_CIRCUMFERENCES_YES = 1; @@ -43,12 +44,13 @@ class C_FormVitals */ private $interpretationsList = []; - public function __construct($template_mod = "general") + public function __construct($template_mod = "general", $context = '') { $this->units_of_measurement = $GLOBALS['units_of_measurement']; $this->interpretationsList = $this->get_interpretation_list_options(); $this->template_mod = $template_mod; $this->template_dir = __DIR__ . "/templates/vitals/"; + $this->context = $context; } public function setFormId($form_id) @@ -95,7 +97,7 @@ class C_FormVitals } // For the demographics page and $form_id === 0 - if ($form_id === 0) { + if ($form_id === 0 && $this->context == 'dashboard') { $vitals_history_count = count($results); $vitals = $results[$vitals_history_count]; if (isset($vitals->uuid)) { diff --git a/interface/patient_file/summary/demographics.php b/interface/patient_file/summary/demographics.php index bf305151e..062432d11 100644 --- a/interface/patient_file/summary/demographics.php +++ b/interface/patient_file/summary/demographics.php @@ -1352,7 +1352,7 @@ $oemr_ui = new OemrUI($arrOeUiSettings); 'id' => $id, 'initiallyCollapsed' => (getUserSetting($id) == 0) ? false : true, 'btnLabel' => 'Trend', - 'btnLink' => "../encounter/trend_form.php?formname=vitals", + 'btnLink' => "../encounter/trend_form.php?formname=vitals&context=dashboard", 'linkMethod' => 'html', 'bodyClass' => 'collapse show', 'auth' => $widgetAuth, @@ -1396,7 +1396,7 @@ $oemr_ui = new OemrUI($arrOeUiSettings); 'id' => $vitals_form_id, 'initiallyCollapsed' => getUserSetting($vitals_form_id) == true ? true : false, 'btnLabel' => 'Trend', - 'btnLink' => "../encounter/trend_form.php?formname=vitals", + 'btnLink' => "../encounter/trend_form.php?formname=vitals&context=dashboard", 'linkMethod' => 'html', 'bodyClass' => 'notab collapse show', 'auth' => $widgetAuth, -- 2.11.4.GIT