nightscout / Trio

MIT License
45 stars 125 forks source link

Support different insulin strengths #264

Open LiroyvH opened 1 month ago

LiroyvH commented 1 month ago

Copied to new issue as per @Sjoerd-Bo3's request:

Working with U-200 I started wondering if it'd be worthwile to implement different insulin strengths. You keep the same settings/profiles in Trio and you bolus and log the same amounts of insulin and carbs, but the system will take care of the different insulin strength in the background.

Is your feature request related to a problem? Please describe.

Currently, Trio does not support different insulin strengths (U-200, U-400), which means users need to manually adjust their profiles and settings when switching from U-100 insulin. This can lead to confusion, inaccuracies in insulin delivery, and inconsistent data in Nightscout and other reports. Moreover, when using dynamic features it may take a while to catch-up.

The problem stems from the fact that pumps only "speak" U-100 and bases its "units" off of that assumption. However, 1 unit of insulin is a universal standard that is not tied to the insulin potency per ml. 1 unit in U-400 is still 1 unit, not 0.25U; you just get 75% less juice out of the pen as its more potent per ml. But as we cannot get the pump to speak U-200 or U-400: we need another way around this. Currently U-200/U-400 users compensate for this problem by "lying" to their pump and reducing their "units" being delivered by for example 50%. This also finds its way to Nightscout reports and Apple Health, giving a skewed view of how many units the user is actually consuming .

Describe the solution you'd like

Implement support for different insulin strengths (U-200, U-400) in the Trio app. The system should automatically adjust insulin delivery based on the selected insulin strength while keeping user settings and profiles consistent. Specifically:

So what you see as the user is when you want X amount of units: you always get that exact same amount of units regardless of the insulin strength; also in reports, Apple Health and Nightscout. 1U is always 1U - we're using the unit as the standard for measurement (how it should be and what is being done in medicine) rather than the different potency per ml and compensating for it in the profiles/delivery. As such, we just ensure the amount of milliliters required to deliver that amount of units are reduced in the background to account for the pump only 'speaking' U-100. On the pump itself, if it has a display, this will confusingly look like reducing "units", but we're just compensating for its dumbness. (Eg; if we want 2U on U-200 mode: we tell the U-200 filled pump, which always thinks it has U-100 in it, to inject "1U" to compensate for the higher insulin strength. And 2U/hr of basal will be set to 1U/hr on the pump. (But we know the truth and log it properly as 2U in this example).)

Describe alternatives you've considered

Additional context

This feature ensures consistency and accuracy in insulin delivery and reporting across different insulin strengths. It aligns with how Eli Lilly pens manage higher potency insulin, ensuring user settings remain the same while adjusting the insulin delivery in the background. Key benefits include:

The reasoning behind it is that this leads to:

Possible negative effects:

Possible negative effects I couldn't directly find any, especially as Eli Lily chose the exact same strategy with their pens. (Reduce output in millilitres, rather than making the user reduce their number of units - they chose to use the unit as the standard rather than the units per ml as well.) The current negatives are you have to maually change profile and manually remember it and the nightscout, AT and AS data get's "tainted" when you switch insulins. If it's as easy as switching in-app from U-100 to U-200 when you switch insulin type: that's easier and probably safer. However, there are some potential caveats that may require a solution/warnings:

Technical Details

This feature involves adjusting the Trio app’s insulin delivery calculations and display settings based on the selected insulin strength. It also requires clear documentation and in-app warnings to inform users about the adjusted delivery rates on the pump.

User Impact

Medium – This feature will improve the ease of use and accuracy of insulin delivery for users switching between different insulin strengths.

Sjoerd-Bo3 commented 1 month ago

@misterizzz, Here the revamped PR with a little more information from @LiroyvH

Sjoerd-Bo3 commented 1 day ago

hey 👋 - no triage is done for 30 days 🤐 ... anybody? triage is required!