zreptil / nightscout-reporter

a web app to create PDF documents from nightscout data
https://nightscout-reporter.zreptil.de/
BSD 3-Clause "New" or "Revised" License
59 stars 47 forks source link

Avg. Insulin per day on Analysis page incorrect #65

Closed codydunne closed 6 months ago

codydunne commented 2 years ago

The Analysis page of https://nightscout-reporter.zreptil.de/ seems to list Avg. Insulin per day incorrectly.

In our case, the Analysis page of the generated PDF says:

Avg. Insulin per day: 28.7 U
Avg. Bolus per day:  28.7 bolus (59.0 %) 
Avg. Basal per day: 20.0 basal (41.0 %)

However, if we look at the Nightscout Reporting day to day view the TDD average is correct:

TDD average: 48.9U  
Bolus average: 59%  
Basal average: 41%  (Base basal average: 32%)  

The percentages are all the same. It seems like there is a problem only with the Avg. Insulin per day field on the Nightscout Reporter Analysis page.

Aside: We really appreciate having this service available! Thank you for all you have done to build and maintain it!

zreptil commented 2 years ago

Thanks for the hint. I will look into this and see if there is an error in the calculation.

zreptil commented 2 years ago

I found the error. This will be fixed in the next version, but it takes some time, until i can release this. In the meantime you can use the beta-version for the correct value: https://nightscout-reporter.zreptil.de/beta. Currently i am working on a new feature that has to be tested so the beta will be up to date with my current efforts and bugfixes (and maybe new bugs ^^)

codydunne commented 2 years ago

Excellent! The beta site works for me. There's a slight discrepancy (the beta site says 48.7U while Nightscout reporting says 48.9U) but that could be down to rounding somewhere.