Skip to content

Commit e23c2e8

Browse files
authored
RMP-751 add SUSP to PDS model (#410)
1 parent 455a373 commit e23c2e8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lambdas/models/pds_models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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:

lambdas/tests/unit/models/test_pds_models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

106106
def 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")

0 commit comments

Comments
 (0)