"""Canonical allowlist for verified Dashboard-v5 laboratory observations."""
from __future__ import annotations

import re

EXACT_LAB_NUMBER = re.compile(r"^[+-]?[0-9]+(?:[.,][0-9]+)?$")

# Raw database slugs -> canonical public parameter and unit.
LAB_ALLOWLIST = {
    ("c_reaktives_protein_crp", "mg_l"): ("CRP", "mg/L"),
    ("crp", "mg_l"): ("CRP", "mg/L"),
    ("d_dimer", "ug_l"): ("D-Dimer", "µg/L"),
    ("fibrinogen", "g_l"): ("Fibrinogen", "g/L"),
    ("faktor_viii", "percent"): ("Faktor VIII", "%"),
    ("thrombozyten", "tsd_ul"): ("Thrombozyten", "Tsd/µL"),
    ("leukozyten", "tsd_ul"): ("Leukozyten", "Tsd/µL"),
    ("ferritin", "ng_ml"): ("Ferritin", "ng/mL"),
}

PUBLIC_LAB_PAIRS = frozenset(LAB_ALLOWLIST.values())
