JSON / YAML files for input in the AGGREGATE.py function should follow the following structure:

AN EXAMPLE

{
    "blood_sodium": {
        "type": "dynamic",
        "table": "timeseries_labs",
        "variable": "Sodium [Moles/volume] in Blood",
        "value_dtype": "float",
        "cutoff": {
            "value": {
                "lo": 80,
                "hi": 190
            },
            "time": {
                "lo": 0
            }
        },
        "keep": false
    },
    "first_hypernatremia_recordtime": {
        "type": "static",
        "requires": [
            "blood_sodium"
        ],
        "variable": "Time Relative to Admission (seconds)",
        "aggregation": "min",
        "filter": "pl.col('blood_sodium') > 145"
    },
    "blood_sodium_record_count": {
        "type": "static",
        "requires": [
            "blood_sodium"
        ],
        "variable": "blood_sodium",
        "aggregation": "count"
    }
}

… and results in the following exemplary DataFrame:

│ Global ICU Stay ID ┆ blood_sodium_record_count ┆ first_hypernatremia_recordtime │
│ ---                ┆ ---                       ┆ ---                            │
│ str                ┆ u32                       ┆ f64                            │
╞════════════════════╪═══════════════════════════╪════════════════════════════════╡
│ eicu-1000020       ┆ 3                         ┆ 35100.0                        │
│ eicu-1000050       ┆ null                      ┆ null                           │
│ eicu-1000071       ┆ null                      ┆ null                           │
│ eicu-1000105       ┆ 3                         ┆ 113040.0                       │
│ eicu-1000106       ┆ null                      ┆ null                           │