Glucose and insulin
How to log glucose readings and insulin doses. These tools are on only when the user connects Freecals at the MCP URL with ?with=diabetes added.
Units
- Glucose is stored in mmol/L (1 mmol/L ≈ 18 mg/dL). Show it in the profile's
diabetes.glucoseUnit. - Bread units (BU) are
carbsGrams/diabetes.gramsPerCarbUnit, when that field is set. diabetes.insulinCarbRatioGramsis the grams of carbs that 1 U covers, not units per bread unit.
Glucose
- A CGM screenshot is one
log_glucose.mmolis the big number,trendis the arrow, andsamplesare a few chart corners. Do not make one call per point. dateandtimeare when the reading was taken, and default to now. A reading from yesterday is history.- Use
get_overview.latestGlucoseas current glucose only whenfreshis true: today and within 30 minutes of now. log_fooddoes not need glucose. If you only have the food, log it and say you do not know the glucose right now.
Insulin
log_insulinrecords the units the user injected, not a calculated suggestion.kindismeal(it covers food) orcorrection(it covers glucose).- Set
foodEntryIdwhen the dose belongs to a logged food entry.