Use the FHIR $validate-code terminology operation to verify that a code is valid within a specific ValueSet

domain: hl7.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

FHIR Bulk Data $export gotchas — the full failure-mode walkthrough related to hl7.org, checked against official docs, with linked verified routes.

Steps

  1. Send GET [base]/ValueSet/$validate-code?url=[valueSet-canonical]&system=[codeSystem]&code=[code] to the terminology server; alternatively POST with a Parameters body for more complex requests
  2. Inspect the returned Parameters resource for the result parameter: a boolean true indicates the code is valid within the ValueSet, false indicates it is not
  3. If result is false, read the message parameter for a human-readable explanation of why the code is invalid or not in the ValueSet
  4. Optionally include display in the request to validate that the display string matches the code; the server returns a display parameter with the canonical display even if the submitted display differs
  5. For FHIR resource validation workflows, call $validate-code for each coded element that must conform to a bound ValueSet before submitting the resource
  6. Handle 400 errors for unknown code systems or ValueSets; check the OperationOutcome for whether the issue is an unknown system URL or an unsupported version

Known gotchas

Related routes

Validate a LOINC code against a FHIR ValueSet using the terminology $validate-code operation
hl7.org/fhir/R4 · 5 steps · unrated
Use FHIR terminology services to expand a ValueSet using the $expand operation against LOINC and validate a code using $validate-code against a SNOMED CT value set
hl7.org/fhir · 5 steps · unrated
Expand a FHIR ValueSet using the $expand operation and validate a code using $validate-code
hl7.org/fhir · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans