Skip to main content
Challenge

Develop a Generative AI Clinical Trial Protocol Matching Agent with LangChain and FHIR

Matching cancer patients to active clinical trial eligibility criteria requires complex evaluation of structured health records and unstructured trial protocols. Build an intelligent patient-trial matching agent using LangChain and HL7 FHIR APIs to extract inclusion criteria and evaluate patient eligibility with 92% fidelity.

Data ScienceHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Clinical trial eligibility matching engine built with LangChain framework and FHIR patient data connectors.

Delivery guide

How work is evaluated

Evaluation

Evaluates patient-trial eligibility matching accuracy and rationale correctness.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

eligibility_match_check

Verifies correct eligibility classification.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

matching_fidelity

Accuracy of eligibility match decisions across trial portfolio. • target: 0.92 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Parse FHIR `Patient`, `Condition`, and `Observation` JSON records using LangChain tools.

  • Extract structured inclusion/exclusion rules from unstructured ClinicalTrials.gov summaries.

  • Compute patient eligibility match scores with step-by-step clinical rationale.

Resources and assets

Reference links and supporting material

Dataset notes

Dataset of 40 FHIR patient profiles paired with 20 active oncology trial inclusion protocols.

Challenge setup

Evaluates patient-trial eligibility matching accuracy and rationale correctness.

Challenge input

JSON containing fhir_patient_profile and trial_protocol_text

LangChain

Framework specified for building prompt chains and tools.

FHIR

HL7 clinical data format representation.

Evaluated output

JSON object with is_eligible boolean, matched_criteria array, and exclusion_reasons array

Evaluation checks
  • Verifies correct eligibility classification.
  • Accuracy of eligibility match decisions across trial portfolio. • target: 0.92 • range: 0-1
Configured evaluation evidence
  • Benchmark: TrialMatch-Bench
  • Matching Fidelity target: 0.92
  • 1 public reference case
Configured runtime
  • Python execution harness
  • Python sandbox (unavailable on Versalist)

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Action Space
  • LangChain · Required
  • Langchain · Optional
  • Stainless · Optional
Orchestration
  • LangChain · Required
  • Langchain · Optional

Evaluation contract

  • eligibility_match_check · Weight 1
  • matching_fidelity · Weight 1

Metrics

  • matching_fidelity · Target 0.92

Benchmarks

  • TrialMatch-Bench
  • biotech

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON containing fhir_patient_profile and trial_protocol_text

    Output: JSON object with is_eligible boolean, matched_criteria array, and exclusion_reasons array

    Execution harness: Python

Evaluation tools

  • LangChain · agent_framework
  • FHIR · data_standard

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Develop a Generative AI Clinical Trial Protocol Matching Agent with LangChain and FHIR