justin13601 / ACES

ACES: Automatic Cohort Extraction System for Event-Streams
https://eventstreamaces.readthedocs.io/en/latest/
MIT License
25 stars 1 forks source link

Error when using `expr` predicate in `has` clause #103

Closed prockenschaub closed 3 months ago

prockenschaub commented 3 months ago

The following semantically identical change to the in-hospital mortality example leads to an error.

# Task: 24-hour In-hospital Mortality Prediction
predicates:
  admission:
    code: event_type//ADMISSION
  discharge:
    code: event_type//DISCHARGE
  death:
    code: event_type//DEATH
  discharge_or_death:
    expr: or(discharge, death)

trigger: admission

windows:
  input:
    start: NULL
    end: trigger + 24h
    start_inclusive: True
    end_inclusive: True
    has:
      discharge_or_death: (None, 0)
      _ANY_EVENT: (5, None)
    index_timestamp: end
  gap:
    start: trigger
    end: start + 48h
    start_inclusive: False
    end_inclusive: True
    has:
      admission: (None, 0)
      # discharge: (None, 0)        # <- remove
      # death: (None, 0)
      discharge_or_death: (None, 0) # <- add
  target:
    start: gap.end
    end: start -> discharge_or_death
    start_inclusive: False
    end_inclusive: True
    label: death

I came across this while trying to create the MEDS-DEV in-ICU mortality task for AUMCdb, which uses the shortcut above.

This is not high priority but good to fix because it took me a while to figure out where in the config the error originated from.

mmcdermott commented 3 months ago

This is tracked in #105 and I'm fixing it currently. Closing as a duplicate.