Identify the ValueSet canonical URL referenced in the CQL valueset declaration or the Measure.relatedArtifact list
GET /ValueSet/$expand?url={canonical}&_format=json from a terminology server (e.g., tx.fhir.org or a local terminology service)
Inspect the ValueSet.expansion.contains list to confirm all expected codes and systems (SNOMED CT, ICD-10-CM, LOINC, RxNorm) are present and not inadvertently excluded by filters
Cross-reference the expanded code list against representative patient Condition or Observation resources to ensure at least some patients will qualify for the initial population
If the expansion is incomplete (ValueSet.expansion.total > count of contains entries), paginate using offset and count parameters or call $expand with count=1000
Known gotchas
ValueSet expansion is version-sensitive; a ValueSet that expanded correctly against SNOMED CT 2024-09 may produce different results against a newer release if concepts were retired or added
Some quality measure value sets include post-coordination or hierarchical SNOMED CT expressions that require a terminology server with SNOMED CT reasoner support; flat code-list servers will return incomplete expansions
The $expand operation on a large intensionally-defined ValueSet (e.g., all descendants of a SNOMED concept) can time out; use includeDesignations=false and activeOnly=true to reduce response size
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp