care
care copied to clipboard
Dropped `age` column from patient registration and annotated age in patient viewset
Proposed Changes
- Dropped DB field
age
from Patient Registration - Adds field
death_datetime
in Patient Registration - Custom Migration to copy last_consultation's death_datetime to patient registration if present
- Updated consultation save method to update patient registration's death_datetime too if consultation has death_datetime.
- Annotated patient viewset with age to calculate age based on data of birth/year of birth up to date of death or now.
Associated Issue
- https://github.com/coronasafe/care_fe/issues/7383
- FE: https://github.com/coronasafe/care_fe/pull/7411
[!NOTE]
Custom Migrations
- Populates
PatientRegistration.death_datetime
withinstance.last_consultation.death_datetime
if present.
Screenshots
POST /api/v1/patient/
- Patient Create's request body:
GET /api/v1/patient/
- Patient List's updated filters and response body:
Merge Checklist
- [ ] Tests added/fixed
- [ ] Update docs in
/docs
- [ ] Linting Complete
- [ ] Any other necessary step
Only PR's with test cases included and passing lint and test pipelines will be reviewed
@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins