CQF API (/cqf)
Mercury implements the FHIR CQF operation surface under the /cqf base path, so it slots into a measure-calculation pipeline in place of the reference evaluator. This page covers the endpoints you’ll use most.
Capability statement
Section titled “Capability statement”curl http://127.0.0.1:8080/cqf/metadataReturns the FHIR CapabilityStatement describing the supported resources and operations.
Load a FHIR bundle into the server’s patient corpus, so evaluations can reference subjects by id.
POST /cqf/data/bundleContent-Type: application/fhir+jsoncurl -X POST http://127.0.0.1:8080/cqf/data/bundle \ -H "Content-Type: application/fhir+json" \ --data @patients.bundle.jsonSee Loading data: preload vs inline for when to preload vs. supply data inline.
Library
Section titled “Library”Create, read, update, and delete FHIR Library resources. Mercury accepts CQL directly and also ELM XML as an alternative input.
# Create (returns 201)curl -X POST http://127.0.0.1:8080/cqf/Library \ -H "Content-Type: application/fhir+json" \ --data @Test.Library.json
# Readcurl http://127.0.0.1:8080/cqf/Library/TestMeasure
Section titled “Measure”Measure resources support the same CRUD operations as Library.
curl -X POST http://127.0.0.1:8080/cqf/Measure \ -H "Content-Type: application/fhir+json" \ --data @Test.Measure.json$evaluate
Section titled “$evaluate”Evaluate a library expression (or a whole measure) for a subject. Returns 200 with a FHIR Parameters resource.
GET /cqf/Library/{id}/$evaluate?subject=Patient/{id}&expression={name}curl "http://127.0.0.1:8080/cqf/Library/Test/\$evaluate?subject=Patient/123&expression=InDenominator"Result — a Parameters resource whose evaluate part lists each expression and its value, e.g. InDenominator → "true".
Harness-compatibility stubs
Section titled “Harness-compatibility stubs”For compatibility with existing tooling, Mercury exposes $data-requirements and $package as stubs. They respond so harnesses that call them don’t break; they aren’t full implementations.
GET /cqf/Library/{id}/$data-requirementsPOST /cqf/Library/{id}/$packageNext steps
Section titled “Next steps”- REST surface (/api, /fhir) — health, translate, query, OpenAPI.
- CLI reference — drive these operations from the command line.
- Troubleshooting & FAQ — common
$evaluateerrors.