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.
In this PR:
Flow:
An hourly cron job automates daily rounds by fetching all monitor assets. If a monitor has no associated patient, it is skipped; otherwise, it retrieves vitals from observations. If the configuration to save vital stats is enabled, it gets the monitor preset from the care system, moves the camera to the preset position, captures an image, and saves it locally. This image is analyzed by GPT to extract vital data, which is then compared with the observation-based vitals to calculate accuracy. The data, including accuracy, GPT model, and API version, is stored in the database, and a daily round is created using the observation-based vitals. If saving vital stats is disabled, a daily round is created using only the observation-based vitals. If observation data is unavailable, the system uses image-based vitals to create the daily round but does not save this data.
Additionally, a second cron job, triggered at midnight if the S3 dump vitals stat environment variable is enabled, dumps all stored vital stats and images to S3 and deletes the local and database-stored data if the delete vital stat on dump configuration is enabled.