Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropped age column from patient registration and annotated age in patient viewset #1966

Merged
merged 24 commits into from
Apr 2, 2024

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Mar 12, 2024

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

Note

Custom Migrations

  • Populates PatientRegistration.death_datetime with instance.last_consultation.death_datetime if present.

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

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 73.07692% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 62.58%. Comparing base (fa46f2f) to head (5bd404a).

Files Patch % Lines
care/facility/models/patient_icmr.py 44.44% 5 Missing ⚠️
care/facility/api/serializers/patient.py 66.66% 1 Missing ⚠️
care/facility/models/patient.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1966      +/-   ##
===========================================
+ Coverage    62.54%   62.58%   +0.04%     
===========================================
  Files          223      223              
  Lines        12270    12271       +1     
  Branches      1752     1750       -2     
===========================================
+ Hits          7674     7680       +6     
+ Misses        4274     4269       -5     
  Partials       322      322              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rithviknishad rithviknishad changed the title Dropped age column from patient registration and moved it to serializer field to calc. age based on demand Dropped age column from patient registration and moved it to serializer field to calc. age on demand Mar 12, 2024
@rithviknishad rithviknishad changed the title Dropped age column from patient registration and moved it to serializer field to calc. age on demand Dropped age column from patient registration and annotated age in patient viewset Mar 13, 2024
care/facility/api/serializers/patient.py Outdated Show resolved Hide resolved
care/facility/models/patient_icmr.py Outdated Show resolved Hide resolved
care/facility/models/patient_icmr.py Show resolved Hide resolved
care/facility/models/patient_icmr.py Outdated Show resolved Hide resolved
care/facility/models/patient_icmr.py Outdated Show resolved Hide resolved
@rithviknishad rithviknishad marked this pull request as ready for review March 18, 2024 12:57
@nihal467
Copy link
Member

LGTM

@vigneshhari vigneshhari merged commit 1115a8f into develop Apr 2, 2024
11 checks passed
@vigneshhari vigneshhari deleted the fix-patient-age branch April 2, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants