flag_from_long_table
Create a per-person 0/1 flag from multi-row files: set 1 if any row in selected columns matches a regex, otherwise 0; people with no rows are missing.
Instructions
Add a per-person 0/1 indicator from a file with several rows per participant (e.g. RXQ_RX
prescriptions, DR1IFF foods). Flag = 1 if ANY row's value in ANY of columns matches the regex
pattern (case-insensitive), e.g. table='RXQ_RX', columns=['RXDRSC1','RXDRSC2','RXDRSC3'],
pattern='^G40' for ICD-10 epilepsy as the reason for use. People absent from the file are missing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| table | Yes | ||
| columns | Yes | ||
| pattern | Yes | ||
| dataset_id | Yes |