Constants
Exported thresholds, goals, conversion factors, and capabilities.
A1C_TO_EAG_CONSTANT
const A1C_TO_EAG_CONSTANT: 46.7Import: @glucoseiq/core
Constant for converting A1C to estimated average glucose (eAG).
See: https://www.cdc.gov/diabetes/diabetes-testing/prediabetes-a1c-test.html
A1C_TO_EAG_MULTIPLIER
const A1C_TO_EAG_MULTIPLIER: 28.7Import: @glucoseiq/core
Multiplier for converting A1C to estimated average glucose (eAG).
See: https://www.cdc.gov/diabetes/diabetes-testing/prediabetes-a1c-test.html
AllowedGlucoseUnits
const AllowedGlucoseUnits: GlucoseUnit[]Import: @glucoseiq/core
List of glucose units accepted by validation and conversion APIs.
See: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2021/DataFiles/BIOPRO_L.htm
DEXCOM_CAPABILITIES
const DEXCOM_CAPABILITIES: ConnectorCapabilitiesImport: @glucoseiq/core/connectors
Dexcom Share / G7-G8 feeds.
GLUCOSE_COLOR_ELEVATED
const GLUCOSE_COLOR_ELEVATED: '#FBC02D'Import: @glucoseiq/core
GLUCOSE_COLOR_HIGH
const GLUCOSE_COLOR_HIGH: '#F57C00'Import: @glucoseiq/core
GLUCOSE_COLOR_LOW
const GLUCOSE_COLOR_LOW: '#D32F2F'Import: @glucoseiq/core
Color codes for glucose zones.
See: https://www.diabetes.co.uk/diabetes_care/blood-sugar-level-ranges.html
GLUCOSE_COLOR_NORMAL
const GLUCOSE_COLOR_NORMAL: '#388E3C'Import: @glucoseiq/core
GLUCOSE_COLOR_NORMAL_DOWN
const GLUCOSE_COLOR_NORMAL_DOWN: '#2E7D32'Import: @glucoseiq/core
GLUCOSE_COLOR_NORMAL_UP
const GLUCOSE_COLOR_NORMAL_UP: '#4CAF50'Import: @glucoseiq/core
GLUCOSE_ZONE_COLORS
const GLUCOSE_ZONE_COLORS: { readonly ELEVATED: '#FBC02D'; readonly HIGH: '#F57C00'; readonly LOW: '#D32F2F'; readonly NORMAL: '#388E3C'; readonly NORMAL_DOWN: '#2E7D32'; readonly NORMAL_UP: '#4CAF50' }Import: @glucoseiq/core
Glucose zone color mapping for different statuses and trends.
See: https://www.diabetes.co.uk/diabetes_care/blood-sugar-level-ranges.html
GMI_COEFFICIENTS
const GMI_COEFFICIENTS: { readonly A1C_INTERCEPT: 3.31; readonly A1C_SLOPE: 0.02392; readonly MG_DL_INTERCEPT: 3.31; readonly MG_DL_SLOPE: 0.02392; readonly MMOL_L_INTERCEPT: 3.31; readonly MMOL_L_SLOPE: 0.430995344 }Import: @glucoseiq/core
GMI (Glucose Management Indicator) calculation coefficients.
A1C_SLOPE and A1C_INTERCEPT are deprecated names retained as aliases
for the mg/dL coefficients. They do not define an A1C-to-GMI conversion.
See: https://doi.org/10.2337/dc18-1581
HOMA_IR_CUTOFFS
const HOMA_IR_CUTOFFS: { readonly EARLY_RESISTANCE: 2.9; readonly NORMAL: 2; readonly VERY_SENSITIVE: 1 }Import: @glucoseiq/core
Interpretation cutoffs for HOMA-IR (insulin resistance assessment). These are general categories, not diagnostic.
HOMA_IR_DENOMINATOR
const HOMA_IR_DENOMINATOR: 405Import: @glucoseiq/core
Denominator constant for HOMA-IR calculation. HOMA-IR = (glucose [mg/dL] × insulin [µIU/mL]) / HOMA_IR_DENOMINATOR
See: https://www.ncbi.nlm.nih.gov/books/NBK279396/
HYPER_THRESHOLD_MGDL
const HYPER_THRESHOLD_MGDL: 180Import: @glucoseiq/core
Hyperglycemia threshold (mg/dL).
See: https://www.diabetes.co.uk/diabetes_care/blood-sugar-level-ranges.html
HYPER_THRESHOLD_MMOLL
const HYPER_THRESHOLD_MMOLL: 10Import: @glucoseiq/core
Hyperglycemia threshold (mmol/L).
See: https://www.diabetes.co.uk/diabetes_care/blood-sugar-level-ranges.html
HYPO_THRESHOLD_MGDL
const HYPO_THRESHOLD_MGDL: 70Import: @glucoseiq/core
Hypoglycemia threshold (mg/dL).
See: https://www.diabetes.co.uk/diabetes_care/blood-sugar-level-ranges.html
HYPO_THRESHOLD_MMOLL
const HYPO_THRESHOLD_MMOLL: 3.9Import: @glucoseiq/core
Hypoglycemia threshold (mmol/L).
See: https://www.diabetes.co.uk/diabetes_care/blood-sugar-level-ranges.html
LIBRE_CAPABILITIES
const LIBRE_CAPABILITIES: ConnectorCapabilitiesImport: @glucoseiq/core/connectors
Libre LinkUp feeds.
MGDL_MMOLL_CONVERSION
const MGDL_MMOLL_CONVERSION: 18.0182Import: @glucoseiq/core
Conversion factor between mg/dL and mmol/L.
See: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2021/DataFiles/BIOPRO_L.htm
MG_DL
const MG_DL: 'mg/dL'Import: @glucoseiq/core
String literal for mg/dL glucose unit.
See: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2021/DataFiles/BIOPRO_L.htm
MMOL_L
const MMOL_L: 'mmol/L'Import: @glucoseiq/core
String literal for mmol/L unit.
See: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2021/DataFiles/BIOPRO_L.htm
NIGHTSCOUT_CAPABILITIES
const NIGHTSCOUT_CAPABILITIES: ConnectorCapabilitiesImport: @glucoseiq/core/connectors
Nightscout community relays.
PREGNANCY_TARGET_HIGH_MGDL
const PREGNANCY_TARGET_HIGH_MGDL: 140Import: @glucoseiq/core
Upper bound of target glucose range during pregnancy (mg/dL). Applies to Type 1, Type 2, and gestational diabetes.
See: ADA Standards of Care (2024)
PREGNANCY_TARGET_HIGH_MMOLL
const PREGNANCY_TARGET_HIGH_MMOLL: 7.8Import: @glucoseiq/core
Upper bound of target glucose range during pregnancy (mmol/L). Applies to Type 1, Type 2, and gestational diabetes.
See: ADA Standards of Care (2024)
PREGNANCY_TARGET_LOW_MGDL
const PREGNANCY_TARGET_LOW_MGDL: 63Import: @glucoseiq/core
Lower bound of target glucose range during pregnancy (mg/dL). Applies to Type 1, Type 2, and gestational diabetes.
See: ADA Standards of Care (2024)
PREGNANCY_TARGET_LOW_MMOLL
const PREGNANCY_TARGET_LOW_MMOLL: 3.5Import: @glucoseiq/core
Lower bound of target glucose range during pregnancy (mmol/L). Applies to Type 1, Type 2, and gestational diabetes.
See: ADA Standards of Care (2024)
TAR_LEVEL1_GOAL
const TAR_LEVEL1_GOAL: 25Import: @glucoseiq/core
Maximum acceptable cumulative percentage above 180 mg/dL. Published goal: <25% of readings above range, including Level 2.
See: International Consensus on Time in Range (2019)
TAR_LEVEL1_GOAL_OLDER_ADULTS
const TAR_LEVEL1_GOAL_OLDER_ADULTS: 50Import: @glucoseiq/core
Maximum acceptable cumulative percentage above 180 mg/dL for older/high-risk adults. Current ADA goal: <50% of readings above range, including Level 2.
See: ADA Standards of Care (2026)
TAR_LEVEL2_GOAL
const TAR_LEVEL2_GOAL: 5Import: @glucoseiq/core
Maximum acceptable percentage for Level 2 hyperglycemia (>250 mg/dL). Clinical goal: <5% of readings in this range.
See: International Consensus on Time in Range (2019)
TAR_LEVEL2_GOAL_OLDER_ADULTS
const TAR_LEVEL2_GOAL_OLDER_ADULTS: 10Import: @glucoseiq/core
Maximum acceptable percentage above 250 mg/dL for older/high-risk adults. Published goal: <10% of readings in this range.
See: International Consensus on Time in Range (2019)
TBR_LEVEL1_GOAL
const TBR_LEVEL1_GOAL: 4Import: @glucoseiq/core
Maximum acceptable cumulative percentage below 70 mg/dL. Published goal: <4% of readings below range, including Level 2.
See: International Consensus on Time in Range (2019)
TBR_LEVEL1_GOAL_OLDER_ADULTS
const TBR_LEVEL1_GOAL_OLDER_ADULTS: 1Import: @glucoseiq/core
Maximum acceptable cumulative percentage below 70 mg/dL for older/high-risk adults. More stringent goal: <1% of readings below range, including Level 2.
See: International Consensus on Time in Range (2019)
TBR_LEVEL2_GOAL
const TBR_LEVEL2_GOAL: 1Import: @glucoseiq/core
Maximum acceptable percentage for Level 2 hypoglycemia (<54 mg/dL). Clinical goal: <1% of readings in this range.
See: International Consensus on Time in Range (2019)
TBR_LEVEL2_GOAL_OLDER_ADULTS
const TBR_LEVEL2_GOAL_OLDER_ADULTS: 1Import: @glucoseiq/core
Maximum acceptable percentage below 54 mg/dL for older/high-risk adults. Current ADA goal: <1% of readings in this range.
See: ADA Standards of Care (2026)
TIR_GOAL_OLDER_ADULTS
const TIR_GOAL_OLDER_ADULTS: 50Import: @glucoseiq/core
Target percentage for time-in-range for older/high-risk adults. More lenient goal: >50% of readings in target range.
See: International Consensus on Time in Range (2019)
TIR_GOAL_STANDARD
const TIR_GOAL_STANDARD: 70Import: @glucoseiq/core
Target percentage for time-in-range (70-180 mg/dL). Published goal: >70% of readings in target range.
See: International Consensus on Time in Range (2019)
TIR_HIGH_THRESHOLD_MGDL
const TIR_HIGH_THRESHOLD_MGDL: 180Import: @glucoseiq/core
Level 1 hyperglycemia threshold (mg/dL). Target range ends at this value.
See: International Consensus on Time in Range (2019)
TIR_HIGH_THRESHOLD_MMOLL
const TIR_HIGH_THRESHOLD_MMOLL: 10Import: @glucoseiq/core
Level 1 hyperglycemia threshold (mmol/L). Target range ends at this value.
See: International Consensus on Time in Range (2019)
TIR_LOW_THRESHOLD_MGDL
const TIR_LOW_THRESHOLD_MGDL: 70Import: @glucoseiq/core
Level 1 hypoglycemia threshold (mg/dL). Target range begins at this value.
See: International Consensus on Time in Range (2019)
TIR_LOW_THRESHOLD_MMOLL
const TIR_LOW_THRESHOLD_MMOLL: 3.9Import: @glucoseiq/core
Level 1 hypoglycemia threshold (mmol/L). Target range begins at this value.
See: International Consensus on Time in Range (2019)
TIR_VERY_HIGH_THRESHOLD_MGDL
const TIR_VERY_HIGH_THRESHOLD_MGDL: 250Import: @glucoseiq/core
Level 2 hyperglycemia threshold (mg/dL). Readings above this value indicate significant hyperglycemia.
See: International Consensus on Time in Range (2019)
TIR_VERY_HIGH_THRESHOLD_MMOLL
const TIR_VERY_HIGH_THRESHOLD_MMOLL: 13.9Import: @glucoseiq/core
Level 2 hyperglycemia threshold (mmol/L). Readings above this value indicate significant hyperglycemia.
See: International Consensus on Time in Range (2019)
TIR_VERY_LOW_THRESHOLD_MGDL
const TIR_VERY_LOW_THRESHOLD_MGDL: 54Import: @glucoseiq/core
Level 2 hypoglycemia threshold (mg/dL). Readings below this value indicate significant hypoglycemia.
See: International Consensus on Time in Range (2019)
TIR_VERY_LOW_THRESHOLD_MMOLL
const TIR_VERY_LOW_THRESHOLD_MMOLL: 3Import: @glucoseiq/core
Level 2 hypoglycemia threshold (mmol/L). Readings below this value indicate significant hypoglycemia.
See: International Consensus on Time in Range (2019)
TREND_ARROWS
const TREND_ARROWS: { readonly FALLING: '↘'; readonly RAPIDFALL: '↓'; readonly RAPIDRISE: '↑'; readonly RISING: '↗'; readonly STEADY: '→' }Import: @glucoseiq/core
Unicode arrows for glucose trend indication.
See: https://www.diabetes.co.uk/diabetes_care/blood-sugar-level-ranges.html