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

Fix for Incorrect Discharge Reasons in Patient Transfers and Readmissions #1712

Merged
merged 8 commits into from
Nov 16, 2023

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Nov 14, 2023

Fixes ohcnetwork/care_fe#6597
Fixes ohcnetwork/care_fe#6593

Overview

This pull request addresses two critical issues in the patient management system regarding the handling of discharge reasons during patient transfers and readmissions. The changes ensure accurate tracking of patient movements and statuses within the healthcare facilities.

Changes Made

  1. Resolving 'Unknown' Discharge Reason in Patient Transfers (Issue #6593):

    • Modified PatientTransferSerializer to correctly set the discharge reason as "Referred" when a patient is transferred from one facility to another.
    • Updated patient.py to reflect these changes, ensuring that the discharge reason is accurately updated in the system.
  2. Correcting Discharge Reason for Telemedicine Patients upon Readmission (Issue #6597):

    • Enhanced patient.py to handle cases where telemedicine patients are readmitted as regular patients. Previously, the discharge reason was incorrectly shown as "Unknown".
    • Added checks in viewsets/patient.py to prevent transferring a patient to the same facility if there is already an active consultation for the patient. This change addresses the issue where the system incorrectly allowed such transfers, leading to data inconsistencies.

Impact

These updates bring significant improvements to the system's accuracy in handling patient transfers and readmissions. They ensure that healthcare providers have access to correct and timely information regarding patient movements, which is crucial for effective patient care and administrative processes.

Testing

The changes have been thoroughly tested to ensure they address the issues without introducing any new bugs or regressions. The system now correctly reflects the "Referred" discharge reason for transferred patients and handles telemedicine patient readmissions appropriately, aligning with expected behaviors.

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

and handle patient transfer validation
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

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

Comparison is base (7273298) 60.43% compared to head (b85f75a) 60.62%.

Files Patch % Lines
care/facility/api/serializers/patient.py 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1712      +/-   ##
==========================================
+ Coverage   60.43%   60.62%   +0.18%     
==========================================
  Files         210      210              
  Lines       11473    11484      +11     
  Branches     1630     1633       +3     
==========================================
+ Hits         6934     6962      +28     
+ Misses       4307     4284      -23     
- Partials      232      238       +6     

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

@rithviknishad rithviknishad added the P1 High priority; urgent label Nov 14, 2023
@nihal467
Copy link
Member

LGTM

care/facility/migrations/0394_auto_20231114_2219.py Outdated Show resolved Hide resolved
care/facility/api/serializers/patient.py Outdated Show resolved Hide resolved
care/facility/api/serializers/patient.py Outdated Show resolved Hide resolved
@ohcnetwork ohcnetwork deleted a comment from sainak Nov 14, 2023
@Ashesh3 Ashesh3 requested a review from sainak November 14, 2023 18:15
care/facility/api/serializers/patient.py Outdated Show resolved Hide resolved
care/facility/api/viewsets/patient.py Show resolved Hide resolved
@Ashesh3 Ashesh3 requested a review from vigneshhari November 15, 2023 13:09
@vigneshhari vigneshhari merged commit fa5ba42 into master Nov 16, 2023
11 checks passed
@vigneshhari vigneshhari deleted the patient-transfer-fix branch November 16, 2023 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority; urgent
Projects
None yet
6 participants