-
-
Notifications
You must be signed in to change notification settings - Fork 4
[BACK-3250] [WEB-3766] Aligns pump settings with in-range insulin data #72
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
base: master
Are you sure you want to change the base?
Conversation
Improves pump settings selection for date-bounded reports by aligning to the latest in-range insulin upload Ensures corresponding upload records are fetched when missing to keep device context accurate Extracts alignment logic into a testable helper and adds unit coverage for boundary cases Relates to BACK-3250
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves pump settings selection for date-bounded reports by aligning them with the latest in-range insulin data rather than simply fetching the most recent pump settings. The refactoring extracts the alignment logic into a static, testable helper method and adds comprehensive unit tests for boundary cases.
Key changes:
- Introduces
getLatestInsulinAndPumpSettingsParamsstatic method to identify the latest in-range insulin datum (basal/bolus) and generate appropriate pump settings fetch parameters - Implements a fallback strategy: first attempts to fetch pump settings aligned with insulin data, then falls back to the latest pump settings within the date range if no aligned data exists
- Adds unit tests covering successful alignment and the null case when no in-range insulin data exists
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/report.mjs | Adds static helper method for insulin-aligned pump settings selection and refactors generate() method to use the new alignment strategy with fallback logic; includes minor style fixes (trailing comma, semicolon, import ordering) |
| test/report.test.js | Adds two test cases for the new static method covering successful pump settings param generation and null return when no in-range insulin data is found |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Aligns pump settings lookup to the latest in-range pump data for continuous datasets and to upload time for non-continuous datasets to better match visualisation behavior. Passes through only supported metadata needed for downstream settings alignment and corrects a minor comment typo. Extends tests to cover new bounding rules and validate behavior across dataset types.
|
/deploy qa2 |
|
krystophv updated values.yaml file in qa2 |
|
krystophv updated flux policies file in qa2 |
|
krystophv deployed export BACK-3250-pump-settings branch to qa2 namespace |
Restructures how pump settings parameters are constructed and passed to improve accuracy for continuous vs non-continuous datasets. Adds conditional logic to set endDate only for continuous data and includes debug logging for better traceability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
clintonium-119
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
Again, nice work. Always a challenge to work through these sort of data-specific requirements.
|
/deploy qa1 |
|
krystophv updated values.yaml file in qa1 |
|
krystophv updated flux policies file in qa1 |
|
krystophv deployed export BACK-3250-pump-settings branch to qa1 namespace |
Improves pump settings selection for date-bounded reports by aligning to the latest in-range insulin upload Ensures corresponding upload records are fetched when missing to keep device context accurate Extracts alignment logic into a testable helper and adds unit coverage for boundary cases
Partnered with
vizPR tidepool-org/viz#559 for WEB-3916Relates to BACK-3250, WEB-3766