From 4e40df9608bd1dd7f673c495dd2bb1ccdd9ba925 Mon Sep 17 00:00:00 2001 From: Daniil <94884910+Filienko@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:44:48 -0800 Subject: [PATCH] Removed flag change --- patientsearch/api.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/patientsearch/api.py b/patientsearch/api.py index cb127c94..285961af 100644 --- a/patientsearch/api.py +++ b/patientsearch/api.py @@ -538,9 +538,6 @@ def external_search(resource_type): # Only consider active external patients params["active"] = "true" - if active_patient_flag: - # Add default behavior for when the active consideration is disabled - reactivate_patient = True # Tag any matching results with identifier naming source try: external_search_bundle = add_identifier_to_resource_type( @@ -588,7 +585,8 @@ def external_search(resource_type): local_fhir_patient = None if internal_bundle["total"] > 0: local_fhir_patient = internal_bundle["entry"][0]["resource"] - if active_patient_flag and reactivate_patient: + active = local_fhir_patient.get("active", True) + if reactivate_patient and not active: local_fhir_patient = restore_patient(token, local_fhir_patient) if internal_bundle["total"] > 1: