Skip to content

Commit

Permalink
WIP: changing active from bool to str
Browse files Browse the repository at this point in the history
  • Loading branch information
Filienko committed Dec 11, 2023
1 parent 8f9be71 commit e51523a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion isacc_messaging/api/isacc_record_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def generate_incoming_message(self, message, time: datetime = None, patient: Pat
if priority is None:
priority = "routine"

if patient is None or not patient.active:
if patient is None or patient.active != "true":
return "Need active patient"

care_plan = self.get_careplan(patient)
Expand Down
6 changes: 3 additions & 3 deletions isacc_messaging/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def update_patient_params():
all_patients = Patient.all_patients()
for json_patient in next_in_bundle(all_patients):
patient = Patient(json_patient)
patient.active = True
patient.active = "true"
audit_entry(
f"Patient ID{patient.id}",
level='info'
Expand All @@ -229,8 +229,8 @@ def deactivate_patient(patient_id):
active_patients = Patient.all_patients()
for json_patient in next_in_bundle(active_patients):
patient = Patient(json_patient)
if patient.id == "52":
patient.active = False
if patient.id == str(patient_id):
patient.active = "false"
patient.persist()
audit_entry(
f"Deactivated a patient {patient_id}",
Expand Down
2 changes: 1 addition & 1 deletion isacc_messaging/models/isacc_patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def active_patients():
NB, returns only patients with active set to true
"""
response = HAPI_request('GET', 'Patient', params={
"active": True
"active": "true"
})
return response

Expand Down
1 change: 0 additions & 1 deletion tests/test_models/practitioner_57.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"lastUpdated": "2023-05-18T23:51:27.443+00:00",
"source": "#P7hLhUI3piOun2Ii"
},
"active": true,
"name": [ {
"family": "McRainodes",
"given": [ "J.R." ],
Expand Down

0 comments on commit e51523a

Please sign in to comment.