Skip to content

ValueSet/$validate-code: HTTP 500 "this.seeSourceProvider is not a function" validating against ValueSet/@all with inferSystem #242

@jmandel

Description

@jmandel

Summary

Validating a system-less code against the special http://hl7.org/fhir/ValueSet/@all value set with inferSystem=true crashes with HTTP 500 (uncaught TypeError) instead of returning a result.

Repro (live)

curl -sS -X POST 'https://tx.fhir.org/r5/ValueSet/$validate-code' \
  -H 'Content-Type: application/fhir+json' -w '\nHTTP %{http_code}\n' -d '{
  "resourceType":"Parameters","parameter":[
    {"name":"valueSet","resource":{"resourceType":"ValueSet","url":"http://hl7.org/fhir/ValueSet/@all","status":"active"}},
    {"name":"code","valueCode":"10000-8"},
    {"name":"inferSystem","valueBoolean":true}]}'

Observed

HTTP 500
{"resourceType":"OperationOutcome","issue":[{"severity":"error","code":"exception","details":{"text":"this.seeSourceProvider is not a function"},"diagnostics":"this.seeSourceProvider is not a function"}]}

Likely cause

In the @all branch of ValueSetChecker.check() (tx/workers/validate.js ~:470) the code calls this.seeSourceProvider(...) / this.canonical, but those live on the worker, not on ValueSetChecker — so the branch throws on entry. (Reached only when system is absent and inferSystem is true; a code with a system returns the NO_INFER warning earlier and doesn't crash.)

Expected

HTTP 200 Parameters with a result (per the $validate-code op def), not an uncaught TypeError.


Confirmed live against https://tx.fhir.org on 2026-06-06 (software FHIRsmith 0.9.6). Source line refs are from the published main branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions