File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,10 @@ def get_active_ods_code_for_gp(self) -> str:
154154 gp_end_date = period .end
155155 if not gp_end_date or gp_end_date >= date .today ():
156156 return entry .identifier .value
157+
158+ death_notification_status = self .get_death_notification_status ()
159+ if not is_deceased (death_notification_status ) and self .is_unrestricted ():
160+ return "SUSP"
157161 return ""
158162
159163 def get_is_active_status (self ) -> bool :
Original file line number Diff line number Diff line change @@ -95,20 +95,20 @@ def test_get_patient_details_for_deceased_patient():
9595
9696
9797@freeze_time ("2024-12-31" )
98- def test_gp_ods_empty_when_gp_end_date_indicates_inactive ():
98+ def test_gp_ods_susp_when_gp_end_date_indicates_inactive ():
9999 patient = create_patient (PDS_PATIENT_WITH_GP_END_DATE )
100100
101101 response = patient .get_minimum_patient_details (patient .id )
102102
103- assert response .general_practice_ods == ""
103+ assert response .general_practice_ods == "SUSP "
104104
105105
106106def test_not_raise_error_when_no_gp_in_response ():
107107 patient = create_patient (PDS_PATIENT_WITHOUT_ACTIVE_GP )
108108
109109 response = patient .get_minimum_patient_details (patient .id )
110110
111- assert response .general_practice_ods == ""
111+ assert response .general_practice_ods == "SUSP "
112112
113113
114114@freeze_time ("2021-12-31" )
You can’t perform that action at this time.
0 commit comments