> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haau3.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate a code against a value set

> FHIR `ValueSet/$validate-code`. A code that is not in the set is a successful `200` with `result: false`, not an error. On POST, a `coding` or `codeableConcept` parameter may stand in for `system` + `code`; a codeableConcept validates if any of its codings is in the set — useful when an element carries a vendor-local coding alongside a standard one.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/fhir/r4/ValueSet/$validate-code
openapi: 3.1.0
info:
  title: haau3 Platform API
  version: 1.0.0
  description: >-
    The haau3 platform API (non-PHI). Endpoints require a free API key — send it
    as `Authorization: Bearer <key>`. Requests without a valid key return 401.
    Create a key in the dashboard at https://platform.haau3.com.
servers:
  - url: https://api.haau3.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Scheduling
    description: Provider availability (SMART Scheduling Links) — slots and publishers.
  - name: Terminology
    description: FHIR terminology operations — CodeSystem lookups against LOINC.
  - name: Provider directory
    description: >-
      FHIR Practitioner and PractitionerRole, resolved from the national
      provider directory. Resolution, not discovery: bring an NPI and get what
      the directory publishes for it.
paths:
  /v1/fhir/r4/ValueSet/$validate-code:
    get:
      tags:
        - Terminology
      summary: Validate a code against a value set
      description: >-
        FHIR `ValueSet/$validate-code`. A code that is not in the set is a
        successful `200` with `result: false`, not an error. On POST, a `coding`
        or `codeableConcept` parameter may stand in for `system` + `code`; a
        codeableConcept validates if any of its codings is in the set — useful
        when an element carries a vendor-local coding alongside a standard one.
      operationId: valueSetValidateCode
      parameters:
        - name: url
          in: query
          required: false
          description: >-
            Canonical URL of the value set to validate against. Defaults to the
            implicit all-LOINC value set (`http://loinc.org/vs`).
          schema:
            default: http://loinc.org/vs
            type: string
            minLength: 1
        - name: code
          in: query
          required: true
          description: The code to validate.
          schema:
            type: string
            minLength: 1
        - name: system
          in: query
          required: false
          description: Code system URI of the code. Defaults to LOINC (`http://loinc.org`).
          schema:
            default: http://loinc.org
            type: string
            minLength: 1
        - name: display
          in: query
          required: false
          description: >-
            Optional display to check against the code's own display. A mismatch
            returns `result: false` with the expected display alongside — which
            means the code is valid and only the label differs. Do not read that
            as an invalid code.
          schema:
            type: string
            minLength: 1
        - name: displayLanguage
          in: query
          required: false
          description: Language to use when checking the display.
          schema:
            type: string
            minLength: 1
        - name: date
          in: query
          required: false
          description: The date for which the validation should be valid.
          schema:
            type: string
            minLength: 1
      responses:
        '200':
          description: A FHIR `Parameters` resource carrying `result`.
          content:
            application/fhir+json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: Invalid request. Returns a FHIR `OperationOutcome`.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '404':
          description: >-
            The code system is not served here, or the code was not found. The
            `OperationOutcome` says which, and why — an unrecognised system, a
            system we are not licensed to serve, and a genuinely missing code
            are different answers.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '406':
          description: >-
            A FHIR release this endpoint does not serve was requested via the
            `fhirVersion` media-type parameter.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '502':
          description: The upstream terminology server could not be reached.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '503':
          description: >-
            No source is configured for this code system on this deployment. The
            service returns no answer rather than guessing one.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '504':
          description: The upstream terminology server did not respond in time.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
components:
  schemas:
    OperationOutcome:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - OperationOutcome
        issue:
          type: array
          items:
            type: object
            properties:
              severity:
                type: string
                enum:
                  - fatal
                  - error
                  - warning
                  - information
              code:
                type: string
              details:
                type: object
                properties:
                  text:
                    type: string
                additionalProperties: true
              diagnostics:
                type: string
              expression:
                type: array
                items:
                  type: string
            required:
              - severity
              - code
            additionalProperties: true
      required:
        - resourceType
        - issue
    AuthError:
      type: object
      properties:
        error:
          type: string
          examples:
            - API key required
        message:
          type: string
      required:
        - error
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your platform API key (`haau3_sk_…`), sent as `Authorization: Bearer
        <key>`.

````