To capture the complex metadata of laboratory measurements while still keeping the structure of the reprodICU dataset simple, metadata is encoded in a so called struct.

structs can be thought of as dictionaries with key:value combinations, allowing us to keep the measurement values and its metadata within one singular column.

the reprodICU labs struct

Relevant functions

Examples

# to access e.g. only the numerical values of "Base excess"
base_excess_values = (
    pl.scan_parquet("timeseries_labs.parquet")
    .select("Base excess")
    .struct.field("value")
)
# to access e.g. only the numerical values of "Sodium [Moles/volume]"
# measured in arterial blood
sodium_arterial_values = (
    pl.scan_parquet("timeseries_labs.parquet")
    .select("Sodium")
    .unnest("Sodium")
    .filter(pl.col("system") == "Blood arterial")
)