diff --git a/patientsearch/api.py b/patientsearch/api.py index 30d6cab5..f0b9c2a4 100644 --- a/patientsearch/api.py +++ b/patientsearch/api.py @@ -467,7 +467,8 @@ def external_search(resource_type): """ token = validate_auth() - reinstate_patient = False + active_patient_flag = current_app.config.get("ACTIVE_PATIENT_FLAG") + reactivate_patient = current_app.config.get("REACTIVATE_PATIENT") # Tag any matching results with identifier naming source try: external_search_bundle = add_identifier_to_resource_type( @@ -506,14 +507,14 @@ def external_search(resource_type): patient = resource_from_args(resource_type, request.args) try: internal_bundle = internal_patient_search( - token, patient, not reinstate_patient + token, patient, not reactivate_patient ) except (RuntimeError, ValueError) as error: return jsonify_abort(status_code=400, message=str(error)) local_fhir_patient = None if internal_bundle["total"] > 0: local_fhir_patient = internal_bundle["entry"][0]["resource"] - if reinstate_patient: + if reactivate_patient: local_fhir_patient = restore_patient(token, local_fhir_patient) if internal_bundle["total"] > 1: diff --git a/patientsearch/config.py b/patientsearch/config.py index ce925abf..e37d5f5d 100644 --- a/patientsearch/config.py +++ b/patientsearch/config.py @@ -139,3 +139,6 @@ def load_json_config(potential_json_string): PROJECT_NAME = os.getenv("PROJECT_NAME", "COSRI") REQUIRED_ROLES = json.loads(os.getenv("REQUIRED_ROLES", "[]")) UDS_LAB_TYPES = json.loads(os.getenv("UDS_LAB_TYPES", "[]")) + +ACTIVE_PATIENT_FLAG = os.getenv("ACTIVE_PATIENT_FLAG") +REACTIVATE_PATIENT = os.getenv("REACTIVATE_PATIENT") \ No newline at end of file diff --git a/patientsearch/src/js/context/PatientListContextProvider.js b/patientsearch/src/js/context/PatientListContextProvider.js index 44a25b55..22179318 100644 --- a/patientsearch/src/js/context/PatientListContextProvider.js +++ b/patientsearch/src/js/context/PatientListContextProvider.js @@ -703,7 +703,6 @@ export default function PatientListContextProvider({ children }) { }, ], birthDate: rowData.birth_date, - active: true }); // error message when no result returned const noResultErrorMessage = needExternalAPILookup()