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

[SCHEMA] Migrate Discharge Reason to Integer Format #1749

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Dec 7, 2023

Frontend PR: coronasafe/care_fe#6807

Proposed Changes

This PR introduces a fundamental change in the representation of the discharge reason field, transitioning from a string-based approach to an enum-based integer format. This modification impacts multiple files including serializers and models, ensuring consistency and improved data handling across the system. Key changes include the introduction of the DiseaseReasonEnum class and updates to the discharge_reason field in various models to reflect the new enum-based approach. This refactor not only streamlines data processing but also aligns with best practices in data representation, thereby enhancing the system's overall efficiency and maintainability.

Associated Issue

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e09e4c1) 61.36% compared to head (cfcdff2) 61.38%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1749      +/-   ##
==========================================
+ Coverage   61.36%   61.38%   +0.02%     
==========================================
  Files         211      211              
  Lines       11587    11595       +8     
  Branches     1659     1660       +1     
==========================================
+ Hits         7110     7118       +8     
  Misses       4205     4205              
  Partials      272      272              

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

care/facility/models/patient_base.py Outdated Show resolved Hide resolved
care/facility/models/patient_consultation.py Outdated Show resolved Hide resolved
@Ashesh3 Ashesh3 requested a review from sainak December 7, 2023 11:07
@rithviknishad rithviknishad added question Further information is requested and removed question Further information is requested labels Dec 7, 2023
@Ashesh3 Ashesh3 changed the title Refactor Discharge Reason to Integer Format [SCHEMA] Migrate Discharge Reason to Integer Format Dec 11, 2023
@Ashesh3
Copy link
Member Author

Ashesh3 commented Dec 11, 2023

As per discussion, this change will be done in 3 steps:

  • Schema Changes
  • Migrating Data
  • Moving the temp field back to the original field and deprecate the temp field.

I've converted this PR to just the schema change.

@vigneshhari vigneshhari merged commit fc2b161 into master Dec 11, 2023
12 checks passed
@vigneshhari vigneshhari deleted the discharge-reason-integer branch December 11, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants