Case study: Cohort-to-files workflow

Below is a practical, end-to-end example of how a researcher might retrieve a cohort and associated file links using sequential queries. Exact parameters may vary depending on server capabilities, but the steps illustrate a common approach.

Goal

• Find participants in a specific study (ex: Kids First) • Identify participants with a disease/phenotype signal (Condition/Observation). • List their specimens. • Collect file references (DocumentReference) for downstream analysis.

Step 1 - Confirm the study context

Start by finding the study record (or confirm the study tag you plan to use). • Example: /ResearchStudy?_count=25 • If you use tags: /ResearchStudy?_tag=<STUDY_TAG>&_count=25 Tip - What you should expect • A Bundle of ResearchStudy resources. • Study identifiers and titles; sometimes tags/labels used downstream.

Step 2 - Get participants enrolled in the study

Use ResearchSubject to list enrolled participants for the study. • /ResearchSubject?_tag=<STUDY_TAG>&_count=25

Tip - What you should expect • ResearchSubject resources with references to Patient (individual) and ResearchStudy (study). • A patient reference (e.g., Patient/PT_XXXX) that you can use in follow-up queries.

Step 3 - Pull phenotypes / conditions for those patients

Use Condition and/or Observation to find disease/phenotype signals. You can run these queries per-patient, or if supported, with the same study tag. • Per patient: /Condition?subject=Patient/<PATIENT_ID>&_count=25 • Per patient: /Observation?subject=Patient/<PATIENT_ID>&_count=25 • Study-tagged (server-dependent): /Condition?_tag=<STUDY_TAG>&_count=25 Tip - What you should expect • Condition resources with coded diagnosis fields (often CodeableConcept.coding). • Observation resources with code + value fields, possibly HPO-coded phenotypes.

Step 4 - Retrieve specimens for selected patients

Once you have a shortlist of Patient IDs, retrieve their specimens. • /Specimen?subject=Patient/<PATIENT_ID>&_count=25 Tip - What you should expect • Specimen resources that reference the Patient and may include specimen type, collection, and identifiers. • Specimen IDs that can link to file metadata or lab reports depending on the dataset.

Step 5 - Retrieve file metadata via DocumentReference

Finally, retrieve file references for selected patients (or study tag, if supported). • Per patient: /DocumentReference?subject=Patient/<PATIENT_ID>&_count=25 • Study-tagged (server-dependent): /DocumentReference?_tag=<STUDY_TAG>&_count=25 Tip - What you should expect • DocumentReference resources with attachment metadata. • Links/URIs to files (often via DRS URLs or external URLs), plus contentType and identifiers.

How to export and make sense of this workflow

A practical export strategy is to export each step (ResearchSubject, Condition/Observation, Specimen, DocumentReference) into the same Project folder. This creates a traceable set of files that can be joined using IDs and references. • Export TSV for each resource type to support quick joins and filtering. • Export JSON for DocumentReference if you need nested attachment details and URIs.