GlucoseIQ
API Reference@glucoseiq/core

Cohort

Metric distributions across multiple subjects.

aggregateCohort

Import: @glucoseiq/core

aggregateCohort(patients: GlucoseReading[][]): CohortResult

Aggregates per-patient glucose metrics across a cohort.

Returns: Distributions of TIR, GMI, CV, and mean glucose across the cohort

import { aggregateCohort, type GlucoseReading } from '@glucoseiq/core'

const patientA: GlucoseReading[] = [
  { value: 110, unit: 'mg/dL', timestamp: '2024-01-01T08:00:00Z' },
]
const patientB: GlucoseReading[] = [
  { value: 7.2, unit: 'mmol/L', timestamp: '2024-01-01T08:00:00Z' },
]
const cohort = aggregateCohort([patientA, patientB])
cohort.tir.median // 100; both example readings are in range
ParameterDescription
patientsOne reading array per patient

On this page