Secondary Use FHIR Server Implementation Guide
0.1.0 - ci-build

Publish Box goes here

Cohort Criteria

Cohort Criteria

Resolution Model

The adapter treats cohort resolution as a patient-set problem.

It first runs backend FHIR searches to identify matching patients. Then it fetches requested output resources for those patients.

Within one filter family, values are ORed. Across filter families, patient sets are intersected.

Examples:

Criteria Meaning
condition-code=34000006,64766004 Crohn disease OR ulcerative colitis
condition-code=34000006&medication-code=386872004 Crohn disease AND infliximab
gender=female&birthdate-ge=1980-01-01 female patients born on or after 1980-01-01
observation-code=38445-3&date-ge=2024-02-01 patients with matching observation code and clinical activity on or after the date

Backend Searches

The adapter translates cohort criteria to ordinary backend searches:

Front criterion Backend search
condition-code Condition?code=...
medication-code MedicationStatement?code=... and MedicationRequest?code=...
procedure-code Procedure?code=...
observation-code Observation?code=...
gender and birthdate* Patient?gender=...&birthdate...
date* date search across clinical resource endpoints
no cohort criteria Patient search

The adapter extracts subject.reference or patient.reference values that point to Patient/{id}. Those patient IDs become the cohort.

Resource Fetching

After resolving the cohort, the adapter fetches output resources.

For each requested resource type:

  • Patient is fetched by direct read: Patient/{id}
  • Condition, MedicationRequest, MedicationStatement, Observation, and Procedure are fetched with subject=Patient/{id}
  • AllergyIntolerance is fetched with patient=Patient/{id}
  • Provenance is fetched globally, then trimmed to matching patient targets

If a resource-specific code filter is present, it is applied again while fetching that output resource. This keeps Condition.ndjson limited to the requested condition codes when a condition-code cohort was used.

Date Semantics

The source mock implements simple exact and range date matching.

The primary date per resource type is:

Resource Date field
Patient birthDate
Condition onsetDateTime or recordedDate
Observation effectiveDateTime or issued
MedicationStatement effectiveDateTime or dateAsserted
MedicationRequest authoredOn
Procedure performedDateTime
AllergyIntolerance onsetDateTime
Provenance recorded
Encounter period.start

The implementation compares the leading YYYY-MM-DD string. It is suitable for local prototype selection, not a complete FHIR date search implementation.