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

Logic to capture reservoir changes with replaceComponent PumpEventType #89

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Copy link
Contributor

@nhamming nhamming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as this is just a function naming change. I do wonder about potential confusion that may come by equating rewind and reservoir change and the same thing. They are very similar, but not exactly the same. Obviously this is very pump specific, and the underlying event is putting new insulin in the pump, however that happens. Since the naming is being updated, should it be updated to something that would work for any potential pump (personally I like the idea of moving away from something happening to the reservoir and towards putting new insulin in the pump).

Comment on lines -57 to +61
return dataForRewind(for: userId, hostIdentifier: hostIdentifier, hostVersion: hostVersion)
return dataForReservoirChange(for: userId, hostIdentifier: hostIdentifier, hostVersion: hostVersion)
case .suspend:
return dataForSuspend(for: userId, hostIdentifier: hostIdentifier, hostVersion: hostVersion)
case .replaceComponent(componentType: .reservoir):
return dataForReservoirChange(for: userId, hostIdentifier: hostIdentifier, hostVersion: hostVersion)
Copy link
Contributor

@nhamming nhamming Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] semantically, rewind and reservoir change are not the same. Should the naming be updated to remove any confusion (maybe something like dataForReservoir or dataForInsulinReplacement... I'm not good at naming things)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually, we want the backend to absorb all of the replaceComponent pump event types (reservoir, pump, and infusionSet) added:
https://github.com/tidepool-org/LoopKit/pull/536/files

Currently we only have the TReservoirChangeDeviceEventDatum utilized by the .rewind case (not sure if this is accurate or a manipulation of the backend datum to accommodate a Medtronic rewind event) to capture a reservoir change event. We now have a new case replaceComponent(componentType: .reservoir) that needs to be accommodated but would essentially be the same function as rewind. I like your naming dataForReservoir as it tracks with the TReservoirChangeDeviceEventDatum type being used, should we go with this naming?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name is good as is, I believe; it should match the name of the model that it's creating on the back-end. We are mapping multiple pump event types to a single model on the backend, because Loop's model is a little more fine-grained.

Copy link
Contributor

@ps2 ps2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants