RESEARCH & SECONDARY USE CONNECTORS
Cohort Definitions, Querying & MQL Integration
4 of 6Enable governed secondary use of health data for research, real-world evidence and analytics with privacy, provenance and controlled outputs.
CohortsInclusion / ExclusionTemporal LogicFHIROMOPMQL (future)Reproducibility
Flexible Cohort Definitions
Combine clinical, demographic and temporal criteria.
Healthcare-Native Query Language
Use planned MQL for intuitive healthcare query composition.
Governed by Design
Run queries only within authorized scopes and output controls.
Reproducible Results
Save/version cohort definitions for reproducibility.
Cohort Building Blocks
Diagnoses
ICD/SNOMED concepts and value sets.
Medications
ATC/RxNorm/clinical medication criteria.
Laboratory Values
LOINC observations, ranges and units.
Procedures
Procedure concepts and timing.
Demographics
Authorized age/sex/location or other variables.
Encounters
Care setting, class and frequency.
Temporal Logic
Before, after, within and observation windows.
Other Criteria
Devices, registries and approved contextual data.
Inclusion / Exclusion Criteria
Example Inclusion
Age ≥ 18
Type 2 diabetes concept set
Latest HbA1c > 7%
At least one encounter in last 12 months
Example Exclusion
Type 1 diabetes concept set
Gestational diabetes
Age < 18
No HbA1c in approved observation window
MQL Querying
mqlCopy
# Illustrative FUTURE MQL concept
FIND Patient
HAS Condition MAP TO SNOMED "Type 2 diabetes"
AND LATEST Observation MAP TO LOINC "HbA1c" > 7 %
WITHIN 12 months
EXCLUDE Condition MAP TO SNOMED "Type 1 diabetes"MQL is planned/future. This syntax is conceptual and not a currently committed production language contract. It must remain governed, auditable and healthcare-scoped rather than becoming unrestricted SQL access.
FHIR & OMOP Examples
| Criterion | FHIR representation | OMOP representation |
|---|---|---|
| Diagnosis | Condition + coded concept | condition_occurrence |
| HbA1c | Observation + LOINC | measurement |
| Medication | MedicationRequest/Statement | drug_exposure |
| Encounter | Encounter | visit_occurrence |
Validation & Preview
Validate all value sets and terminology mappings
Estimate cohort counts only when privacy threshold allows
Show missing-data impact
Expose source/data-model coverage
Flag unsupported or ambiguous criteria
Save exact query/cohort version used for resulting dataset
Best Practices
Use concept sets instead of single codes where clinically appropriate
Define explicit observation windows
Avoid hidden assumptions around missing data
Version inclusion/exclusion criteria
Peer review clinically meaningful cohorts
Keep SQL/database implementation hidden behind governed query services
Developer Integration Surface
| Surface | Operation / resource | Use | Status |
|---|---|---|---|
| Cohort API | create / validate / preview / version | Research cohort lifecycle | Planned/versioned |
| MQL Query API | compile/execute governed MQL | Healthcare-native query | Future/planned |
| FHIR/OMOP adapters | query supported data models | Execution backend | Internal/governed |
| Events | cohort.ready / validation.failed | Async jobs | Planned/evolving |
Next Steps
Define cohort criteria
Map concepts through MSIS/value sets
Validate against FHIR/OMOP sources
Preview under privacy controls
Save/version approved cohort
Use in authorized pipeline