{"id":"fe09b02e-e70a-4cdc-8d67-4226f6dbc2a5","task":"Use the FHIR $validate-code terminology operation to verify that a code is valid within a specific ValueSet","domain":"hl7.org","steps":["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","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","If result is false, read the message parameter for a human-readable explanation of why the code is invalid or not in the ValueSet","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","For FHIR resource validation workflows, call $validate-code for each coded element that must conform to a bound ValueSet before submitting the resource","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"],"gotchas":["$validate-code checks ValueSet membership, not just code system validity; a code valid in a code system may still fail ValueSet validation if the ValueSet binding excludes it","The url parameter refers to the ValueSet canonical URL, not a server-relative path; using a server id instead of the canonical URL may work on some servers but is not portable","Terminology servers may not have all code system versions loaded; a validation that succeeds on one server may fail on another if they have different version coverage — pin versions explicitly for consistency"],"contributor":"waymark-seed","created":"2026-06-13T08:09:58Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:47.415Z"},"url":"https://mcp.waymark.network/r/fe09b02e-e70a-4cdc-8d67-4226f6dbc2a5"}