Skip to content

Commit

Permalink
Adding enviroment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Filienko committed Dec 15, 2023
1 parent 6ee537a commit 9cd1e4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions patientsearch/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check failure on line 470 in patientsearch/api.py

View workflow job for this annotation

GitHub Actions / Flake8

patientsearch/api.py#L470

Local variable 'active_patient_flag' is assigned to but never used (F841)
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(
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions patientsearch/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check failure on line 143 in patientsearch/config.py

View workflow job for this annotation

GitHub Actions / Flake8

patientsearch/config.py#L143

Trailing whitespace (W291)
REACTIVATE_PATIENT = os.getenv("REACTIVATE_PATIENT")

Check failure on line 144 in patientsearch/config.py

View workflow job for this annotation

GitHub Actions / Flake8

patientsearch/config.py#L144

No newline at end of file (W292)
1 change: 0 additions & 1 deletion patientsearch/src/js/context/PatientListContextProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ export default function PatientListContextProvider({ children }) {
},
],
birthDate: rowData.birth_date,
active: true
});
// error message when no result returned
const noResultErrorMessage = needExternalAPILookup()
Expand Down

0 comments on commit 9cd1e4f

Please sign in to comment.