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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"dataset_id": "<dataset_id>",
"table": "<table>",
"columns": "<columns>",
"pattern": "<pattern>",
"name": "<name>"
},
"name": "flag_from_long_table"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| table | Yes | ||
| columns | Yes | ||
| pattern | Yes | ||
| dataset_id | Yes |