Cumuluz Translate Implementation Guide
0.1.0 - ci-build

Cumuluz Translate Implementation Guide - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Validate

Use POST /fhir/r4/$validate to validate an existing R4 resource against a requested R4 profile. This independent operation definition is different from transform-time validation, which also validates the source and logical stages and applies route governance. The system-level and type-level endpoints are available.

Request and call

The preferred request is FHIR Parameters:

Parameter Cardinality Meaning
resource 1..1 R4 resource to validate
profile 0..1 target profile canonical; defaults to resource.meta.profile
mode 0..1 create or update; delete is unsupported

The endpoint also accepts a direct R4 resource body when meta.profile identifies the profile. The complete synthetic request is published as Patient validation request.

curl -sS \
  -H 'Accept: application/fhir+json' \
  -H 'Content-Type: application/fhir+json' \
  --data @ig/input/examples/patient-validate-request.json \
  'http://localhost:8080/fhir/r4/$validate'

Type-level forms such as POST /fhir/r4/Patient/$validate are also available. They reject a resource with a different resourceType. Use the CapabilityStatement for the complete current type list rather than copying a static inventory into client code.

Interpret the response

Every processed validation request returns an R4 OperationOutcome. HTTP status tells whether the request was processed; issue severity tells whether the resource passed validation.

Situation HTTP status Client decision
validation ran with no error or fatal 200 resource passed; warnings may remain
validation ran with error or fatal 200 resource failed validation
request could not be processed 400 correct the envelope, mode, profile or resource type

See passing validation response and failing validation response. The negative request in the repository's fhir/examples/validation/patient-validate-request-fail.json uses valueInteger on the standard birthPlace extension, whose value must be an Address. Execute it with the same curl call using that file. It is a processed validation failure with HTTP 200; the response carries an error issue. The invalid input remains a negative fixture outside the Publisher's conformant example inventory. The passing response concerns the target Patient alone and does not establish that the source/logical stages of its original transform passed.

A client must evaluate OperationOutcome.issue[*].severity. It may use these count extensions for automation:

Extension suffix Meaning
validation-issue-count-error error plus fatal issues after service filtering
validation-issue-count-warning warning issues
validation-issue-count-information informational issues
validation-relaxed-issue-count narrow logged HAPI slice-compatibility exceptions

The relaxed count is not permission to ignore other errors. Store the outcome with the validated resource when auditability is required.

The published outcome examples omit the same two HAPI implementation metadata fields described in Getting Started. The current runtime can emit integer operationoutcome-issue-col values where the installed extension definition requires string, plus an unpublished java-core-messageId coding. This known wire-metadata compatibility issue does not change the issue severity or validation verdict. The examples retain all diagnostic and stage evidence; do not mistake the abridged examples for byte-for-byte runtime captures.

Transform-time validation

validationMode on $transform controls the full source-to-target pipeline:

Mode Result
enforce blocks on unrelaxed error/fatal issues and blocked governance decisions; the only conforming mode
report returns output and diagnostics; always non-conformant
none skips validation when operator-enabled; always non-conformant

QuestionnaireResponse extraction uses its separate validate boolean.

Validation can expose defects in a pinned upstream profile as well as invalid instance data. These remain diagnostics and enforce-mode gates; see pinned contracts and blocking boundaries. The four narrow version-specific nationality/proficiency slice exceptions are logged and counted separately; they do not suppress terminology, cardinality, unknown-profile or unrelated slicing errors.

Discovery

  • CapabilityStatement: GET /fhir/r4/metadata
  • OperationDefinition: GET /fhir/r4/OperationDefinition/r4-validate
  • Supported target profiles: the transform indexes and generated Translation Matrix