REST surface (/api, /fhir)
Alongside the CQF operations, Mercury exposes a broader REST surface under /api (Mercury-native operations) and /fhir (standards-facing routes). This page covers the parts included in the free Community Edition.
Health & readiness
Section titled “Health & readiness”Liveness and readiness checks for probes, healthchecks, and load balancers.
curl -fsS http://127.0.0.1:8080/api/healthcurl -fsS http://127.0.0.1:8080/api/readyExample health response:
{ "status": "UP", "version": "<your version>", "edition": "community", "packs": ["core"]}The exact version value reflects the build you are running.
OpenAPI
Section titled “OpenAPI”Fetch the machine-readable API description to generate clients or explore endpoints.
curl http://127.0.0.1:8080/api/openapiExecute
Section titled “Execute”Run an evaluation through the Mercury-native operation path (an alternative to the CQF $evaluate operation).
POST /api/executeContent-Type: application/jsonRequest:
curl -X POST http://127.0.0.1:8080/api/execute \ -H "Content-Type: application/json" \ -d '{ "cql": "library Tiny version '\''1.0.0'\''\ncontext Patient\ndefine Answer: true\n", "expression": "Answer", "subject": "Patient/example" }'Response:
{ "resourceType": "Parameters", "parameter": [ { "name": "execute", "part": [ { "name": "Answer", "valueBoolean": true } ] } ]}The OpenAPI spec served by your running instance remains the source of truth for your build.
Translate
Section titled “Translate”Translate CQL to ELM without executing it — useful for validating that a library compiles.
POST /api/translateContent-Type: application/cqlRun queries over the loaded resource corpus.
POST /api/queryContent-Type: application/jsonLibrary & value-set management
Section titled “Library & value-set management”Manage libraries and value sets through the /api surface (in addition to the FHIR Library CRUD under /cqf). Value sets supply the codes your measures test against.
# Shapes are defined in the OpenAPI spec for your buildGET /api/librariesGET /api/valuesetsStandards-facing FHIR routes
Section titled “Standards-facing FHIR routes”The /fhir base path hosts standards-oriented endpoints, including the capability statement:
curl http://127.0.0.1:8080/fhir/metadataNext steps
Section titled “Next steps”- CQF API (/cqf) — the measure-evaluation operations.
- CLI reference —
serve,run,lang-tests.