From e153ce289fa77980e2e0d02c00fd09cdf0f747c2 Mon Sep 17 00:00:00 2001 From: Jerry Padgett Date: Sat, 18 May 2024 11:12:42 -0400 Subject: [PATCH] Previous names in New/Search doesn't save. (#7438) - Added an alert disabling the capability in create patint. --- .../patient_file/summary/demographics.php | 5 + library/specialty_forms.php | 195 ++++++++++-------- 2 files changed, 110 insertions(+), 90 deletions(-) diff --git a/interface/patient_file/summary/demographics.php b/interface/patient_file/summary/demographics.php index d3ea72620a8..979bd6342da 100644 --- a/interface/patient_file/summary/demographics.php +++ b/interface/patient_file/summary/demographics.php @@ -26,6 +26,7 @@ */ require_once("../../globals.php"); + require_once("$srcdir/lists.inc.php"); require_once("$srcdir/patient.inc.php"); require_once("$srcdir/options.inc.php"); @@ -61,6 +62,10 @@ use OpenEMR\Services\PatientService; use Symfony\Component\EventDispatcher\EventDispatcher; +// Reset the previous name flag to allow normal operation. +// This is set in new.php so we can prevent new previous name from being added i.e no pid available. +OpenEMR\Common\Session\SessionUtil::setSession('disablePreviousNameAdds', 0); + $twig = new TwigContainer(null, $GLOBALS['kernel']); // Set session for pid (via setpid). Also set session for encounter (if applicable) diff --git a/library/specialty_forms.php b/library/specialty_forms.php index e7619ce0d5e..4201202ebc1 100644 --- a/library/specialty_forms.php +++ b/library/specialty_forms.php @@ -8,7 +8,7 @@ * @package OpenEMR * @link https://www.open-emr.org * @author Jerry Padgett - * @copyright Copyright (c) 2021 Jerry Padgett + * @copyright Copyright (c) 2021-2024 Jerry Padgett * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ @@ -21,106 +21,121 @@ CsrfUtils::csrfNotVerified(); } +$disablePreviousNameAdds = (int)$_SESSION['disablePreviousNameAdds'] ?? 0; + $form = trim($_GET['form_handler']); echo ""; ?> -<?php echo xlt("Specialty Form"); ?> - - - + - -
-
- - - -
-

-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - + " . xlt('Sorry! Add New not allowed here') . "

" . + xlt("Since we are creating a new patient and an associated patient id has not been created yet, we are unable to establish a relationship between patient and the new name to save.") . + "
" . xlt("You can add Previous Names after saving the new patient.") . "

"; + ?> +
+
+ + + +
-
-
-
- - + +
+ + + + +
+

+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+ + +
+
+
-
- -
- +