Show estimated HbA1c in mmol/mol (IFCC) alongside the % value

Dutch lab results conventionally report HbA1c in mmol/mol rather than
DCCT/NGSP %. Adds gmi_mmol_per_mol() using the standard IFCC conversion
(Hoelzel et al. 2004) and shows it next to the existing % value on the
Samenvatting page and in the PDF summary.

Closes gitea #25.
This commit is contained in:
2026-08-01 23:12:43 +02:00
parent 374ead70e5
commit b8e01fa8c9
4 changed files with 28 additions and 2 deletions
+7 -1
View File
@@ -4,6 +4,7 @@ import streamlit as st
from auth import require_auth
from nightscout_client import NightscoutConfigError
from reporting import (
gmi_mmol_per_mol,
gmi_percent,
percent_cv,
sensor_active_percent,
@@ -43,6 +44,7 @@ active_pct = sensor_active_percent(glucose, start, end)
mean_mmol = glucose["mmol"].mean()
gmi = gmi_percent(mean_mmol)
gmi_mmol_mol = gmi_mmol_per_mol(gmi)
cv = percent_cv(glucose)
tir = tir_breakdown_5band(glucose)
@@ -50,7 +52,11 @@ st.subheader("Kerncijfers")
col1, col2, col3, col4 = st.columns(4)
col1.metric("Sensordekking", f"{active_pct:.0f}%", help="Streefwaarde: ≥70%")
col2.metric("Gemiddelde glucose", f"{mean_mmol:.1f} mmol/L")
col3.metric("Geschat HbA1c (GMI)", f"{gmi:.1f}%", help="Bergenstal et al. 2018 — geen labwaarde")
col3.metric(
"Geschat HbA1c (GMI)",
f"{gmi:.1f}% ({gmi_mmol_mol:.0f} mmol/mol)",
help="Bergenstal et al. 2018 — geen labwaarde",
)
col4.metric("Variabiliteit (%CV)", f"{cv:.0f}%", help="Streefwaarde: ≤36%")
st.subheader("Tijd in bereik (5 klinische banden)")