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

Patient Consultation: Route to Facility 🏥, Admission Date & Time 🕚, Rename variable: verified_by to treating_physician #1678

Merged
merged 13 commits into from
Nov 21, 2023

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Oct 17, 2023

Associated Issue

Proposed Changes

  • Fields added and renamed (refer table below)
  • ⚠️ Custom Migration: reset time to 00:00 of current timezone (IST) to clean dirty time captured so far by front-end's Date only picker. (Front-end now captures both date and time from the user)
  • ⚠️ Custom Migration: Populate route_to_facility based on deprecated consultation_status field value.
  • Updated CSV Export and Discharge Summary to show Route to Facility instead of Consultation Status

Renamed Fields

Old Field New Field Reason
consultation_status route_to_facility Alter field + Align with new choices
verified_by treating_physician Correction (align with field label)

New Fields

Field Type Validation Remarks
transferred_from_location ForeignKey: AssetLocation required* *applicable only for INTRA_FACILITY_TRANSFER
referred_from_facility ForeignKey: Facility required* ** *applicable only for INTER_FACILITY_TRANSFER; **XOR required with referred_from_facility_external
referred_from_facility_external VarChar required* ** *applicable only for INTER_FACILITY_TRANSFER; **XOR required with referred_from_facility
referred_by_external VarChar applicable only for INTER_FACILITY_TRANSFER
icu_admission_date DateTimeField NOT applicable for OUTPATIENT/ER

Migrations

Admission Date reset to 00:00 of timezone - Before Migration

image

Admission Date reset to 00:00 of timezone - After Migration

image

Populate Route to Facility - Before Migration

UNKNOW: 2587                      # mapped to null
BROUGHT_DEAD: 29                  # mapped to 10 (OUTPATIENT)
TRANSFERRED_FROM_WARD: 61         # mapped to 30 (INTRA_FACILITY_TRANSFER)
TRANSFERRED_FROM_ICU: 25          # mapped to 30 (INTRA_FACILITY_TRANSFER)
REFERRED_FROM_OTHER_HOSPITAL: 21  # mapped to 20 (INTER_FACILITY_TRANSFER)
OUT_PATIENT: 397                  # mapped to 10 (OUTPATIENT)
image

Populate Route to Facility - After Migration

OUTPATIENT: 426              # expected 426 (OP 397 + BROUGHT_DEAD 29)
INTER_FACILITY_TRANSFER: 21  # expected 21 (REFERRED_FROM_OTHER_HOSPITAL 21)
INTRA_FACILITY_TRANSFER: 86  # expected 86 (WARD 61 + ICU 25)
image

Architecture changes

  • Remove this section if not used

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

@vigneshhari
Copy link
Member

Tests failing

@nihal467
Copy link
Member

Functionality looks good to me, @vigneshhari can you review it

@vigneshhari
Copy link
Member

This PR is probably causing me to age a bit faster :/

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (7273298) 60.43% compared to head (031e957) 60.53%.

Files Patch % Lines
...e/facility/api/serializers/patient_consultation.py 81.25% 2 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1678      +/-   ##
==========================================
+ Coverage   60.43%   60.53%   +0.09%     
==========================================
  Files         210      210              
  Lines       11473    11505      +32     
  Branches     1630     1636       +6     
==========================================
+ Hits         6934     6964      +30     
  Misses       4307     4307              
- Partials      232      234       +2     

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

@vigneshhari vigneshhari merged commit e9cd2e6 into master Nov 21, 2023
11 checks passed
@vigneshhari vigneshhari deleted the consultation/route-to-facility branch November 21, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants