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

feat: Add patient and bed count to Facility serializers #1223

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Mar 20, 2023

Required for: coronasafe/care_fe#4885
Frontend PR: coronasafe/care_fe#5131

This commit adds two new fields, patient_count and bed_count, to the FacilityBasicInfoSerializer and FacilitySerializer classes in care/facility/api/serializers/facility.py. These fields are calculated using the Bed and PatientRegistration models and return the total number of beds and active patients associated with each facility, respectively.

This information is useful for displaying occupancy rates and other related data in the frontend application.

@coronasafe/code-reviewers

@Ashesh3
Copy link
Member Author

Ashesh3 commented Apr 14, 2023

@vigneshhari any updates on this?

@vigneshhari
Copy link
Member

This might add a bit more stress on the database, create a ticket to summarise both counts at the facility level with signals. I will merge this in to keep you folks unblocked.

@sonarcloud
Copy link

sonarcloud bot commented Apr 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.1% 0.1% Duplication

@Ashesh3
Copy link
Member Author

Ashesh3 commented Apr 17, 2023

This might add a bit more stress on the database, create a ticket to summarise both counts at the facility level with signals. I will merge this in to keep you folks unblocked.

Made an issue for that here: #1259

@gigincg gigincg merged commit ff15993 into coronasafe:master Apr 27, 2023
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

3 participants