Repository navigation
Add vitals fields to registration - #183
Merged
Merged
Conversation
noahseethorcodes
force-pushed
the
AddTemperatureToRegistration
branch
from
December 10, 2025 00:29
0b56e46 to
25e325b
Compare
Contributor
|
added child fields (e.g. pallor, scoliosis) as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Feature: Integrate Initial Vitals (Temperature) via Transactional Workflow
Description
This pull request refactors the patient creation process into a robust, atomic transaction to ensure data integrity across multiple models.
The primary goal is to successfully capture the initial Temperature reading provided during registration. This is achieved by creating a three-step chained workflow: Patient$\rightarrow$ Visit $\rightarrow$ Vitals.
This PR also made creating vitals more efficient by doing it in the backend, instead of the previous method of sending another API to the frontend, then another api to the backend to create vitals when a patient was created.
Key Changes and Implementation Details
@transaction.atomicon the newcreate_patient_with_temperatureservice function (likely inapi/services/patient_service.pyor similar) to guarantee that either the Patient, Visit, and Vitals records are all created successfully, or none are.Patientrecord is created.Visitrecord is immediately created for the new patient with a status of 'started'.temperaturefield exists in the form data, a newVitalsrecord is created using the dedicatedVitalsSerializerand is correctly linked to the newly created Visit.PatientView.postmethod is updated to utilize this new transactional function.How to Test
Patiententry.Visitentry (linked to the Patient).Vitalsentry (linked to the Visit, containing the correct Temperature).Related Issue: [Link to JIRA/Trello ticket, if applicable]