Syntegra Structured Queries form the building blocks of concepts and cohort definitions.

Concepts

A concept is a list consisting of one or many Syntegra Structured Queries separated by "and" and "or" clauses, and possibly further separated by brackets.

For example a concept created to capture patients who experience various forms of a nut butter allergic reaction may query both the allergy table and the conditions table:

[
  [
    {"table": "allergy", 
     "operator": "=", 
     "column": "description", 
     "value": "'peanut butter'"
    }, 
    "or", 
    {"table": "allergy", 
     "operator": "=", 
     "column": "description", 
     "value": "'nut butter'"
    }], 
    "and", 
    {"table": "conditions", 
     "operator": "=", 
     "column": "description", 
     "value": "'allergic reaction'"
    }
]

Another concept can be created to capture visits between the start of 2018 and the start of 2020:

[
  {"table": "visit_occurrence", 
   "operator": "gt", 
   "column": "visit_datetime", 
   "value": "01-01-2018"
  }, 
  "or", 
  {"table": "visit_occurrence", 
   "operator": "lt", 
   "column": "visit_datetime", 
   "value": "01-01-2020"}
]

These concepts can then be used in combination with any others in the same schema to create different cohort definitions. Concepts are the re-usable chunks by which we can create cohort definitions.

Cohort Definitions

A cohort definition is a single or group of concept sets separated by "and" and "or" clauses, and possibly further separated by brackets.

Concepts are referenced by their specific id, which are returned when they are created and can be found through the concepts/list endpoint.

For example if the above two example concepts have an id of 10 and 11 respectively, a cohort definition to query for patients who had a nut butter allergic reaction during a visit in 2018 or 2019 would be defined as:

[10, "and", 11]

Exporting a Cohort

So far we've built concepts and cohort definitions specific to a schema but what we really want is a cohort of a specific dataset.

To accomplish this we just apply a cohort definition to a dataset of the same schema through the dataset's Get Data endpoint.

🚧

Note:

Each dataset has a maximum number of patients that can be exported. Broad cohort definitions may hit this limit and we may only return a segment of the total cohort. The maximum number for each dataset is readily retrievable from the API.