From 81b2f41066daf34350b5fd5467e1198d0400f096 Mon Sep 17 00:00:00 2001 From: Stephen Nielson Date: Mon, 11 Apr 2022 12:11:19 -0400 Subject: [PATCH] Fixes #5130 code type selector. (#5131) Set the allowed_code_types to be populated if no default code type is passed in as a query parameter. --- interface/patient_file/encounter/find_code_popup.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/patient_file/encounter/find_code_popup.php b/interface/patient_file/encounter/find_code_popup.php index c389fdff2..01b8f61b0 100644 --- a/interface/patient_file/encounter/find_code_popup.php +++ b/interface/patient_file/encounter/find_code_popup.php @@ -30,6 +30,8 @@ $info_msg = ""; $codetype = $_REQUEST['codetype'] ?? ''; if (!empty($codetype)) { $allowed_codes = split_csv_line($codetype); +} else { + $allowed_codes = array_keys($code_types); } $form_code_type = $_POST['form_code_type'] ?? ''; @@ -38,6 +40,8 @@ $form_code_type = $_POST['form_code_type'] ?? ''; $default = ''; if (!empty($form_code_type)) { $default = $form_code_type; + // if they've submitted a code type we only want to use those. + $allowed_codes = [$default]; } elseif (!empty($allowed_codes) && count($allowed_codes) == 1) { $default = $allowed_codes[0]; } elseif (!empty($_REQUEST['default'])) { -- 2.11.4.GIT