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
POST /fhir/r4/$validate
This endpoint validates an R4 resource against a requested target profile and returns a FHIR OperationOutcome.
The service validates on the R4 side only. It does not expose source-side STU3 validation as part of the public contract.
That separation keeps the public contract simple: translation produces the target resource, and validation checks that resource against the requested target family and terminology set.
The validation surface accepts either:
Parameters request with resource and profilemeta.profileThe Parameters form is the clearest and is the preferred form for clients.
If clients want to validate before they translate, they can do that explicitly as a separate step. The translator itself does not silently switch into source validation mode.
{
"resourceType": "Parameters",
"parameter": [
{
"name": "resource",
"resource": {
"resourceType": "Patient",
"id": "patient-validate-request",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Anja de Vries</div>"
},
"meta": {
"profile": [
"http://nictiz.nl/fhir/StructureDefinition/nl-core-Patient"
]
},
"active": true,
"identifier": [
{
"system": "http://fhir.nl/fhir/NamingSystem/bsn",
"value": "999998779"
},
{
"system": "http://example.org/mrn",
"value": "MRN-12345"
}
],
"name": [
{
"use": "usual",
"family": "de Vries",
"given": [
"Anja"
]
}
],
"gender": "female",
"birthDate": "1964-05-12",
"address": [
{
"line": [
"Laan van Europa 10"
],
"city": "Amsterdam",
"postalCode": "1000AA",
"country": "NL"
}
],
"generalPractitioner": [
{
"reference": "Practitioner/gp-1"
}
]
}
},
{
"name": "profile",
"valueCanonical": "http://nictiz.nl/fhir/StructureDefinition/nl-core-Patient"
}
]
}
That request validates the Patient against nl-core-Patient.
The service also exposes type-level validation routes for currently supported R4 resource types:
POST /fhir/r4/Patient/$validatePOST /fhir/r4/Condition/$validatePOST /fhir/r4/Procedure/$validatePOST /fhir/r4/Observation/$validatePOST /fhir/r4/AllergyIntolerance/$validatePOST /fhir/r4/Encounter/$validatePOST /fhir/r4/CareTeam/$validatePOST /fhir/r4/Appointment/$validatePOST /fhir/r4/MedicationRequest/$validatePOST /fhir/r4/MedicationStatement/$validatePOST /fhir/r4/MedicationDispense/$validatePOST /fhir/r4/Provenance/$validatePOST /fhir/r4/Consent/$validatePOST /fhir/r4/RelatedPerson/$validatePOST /fhir/r4/Practitioner/$validatePOST /fhir/r4/PractitionerRole/$validatePOST /fhir/r4/CommunicationRequest/$validatePOST /fhir/r4/Device/$validatePOST /fhir/r4/DeviceUseStatement/$validatePOST /fhir/r4/Goal/$validateThese routes reject mismatched resource types.
For example, POST /fhir/r4/Procedure/$validate rejects a Patient body with an OperationOutcome.
PZP target resources can be validated through the generic POST /fhir/r4/$validate endpoint or through the matching type-level endpoint with the requested PZP 2020 profile.
R4 QuestionnaireResponses for https://api.iknl.nl/docs/pzp/r4/Questionnaire/ACP-zib2020 can also be validated through the generic endpoint. Extraction from supported QuestionnaireResponses is a separate operation described in QuestionnaireResponse.
The validation response is always a FHIR OperationOutcome.
Current HTTP behavior is:
200 when the outcome contains only information or warning400 when the outcome contains error or fatalThat means clients should inspect both:
OperationOutcomeWhen validation succeeds, the service returns HTTP 200 with an OperationOutcome that may contain informational notes.
{
"resourceType": "OperationOutcome",
"id": "patient-validate-response",
"extension": [
{
"url": "http://cumuluz/fhir/StructureDefinition/validation-issue-count-error",
"valueInteger": 0
},
{
"url": "http://cumuluz/fhir/StructureDefinition/validation-issue-count-warning",
"valueInteger": 0
},
{
"url": "http://cumuluz/fhir/StructureDefinition/validation-issue-count-information",
"valueInteger": 1
},
{
"url": "http://cumuluz/fhir/StructureDefinition/validation-relaxed-issue-count",
"valueInteger": 0
}
],
"issue": [
{
"severity": "information",
"code": "informational",
"diagnostics": "No issues detected during validation"
}
]
}
When validation fails, the service returns HTTP 400 with an OperationOutcome containing at least one error or fatal issue.
{
"resourceType": "OperationOutcome",
"id": "patient-validate-response-fail",
"extension": [
{
"url": "http://cumuluz/fhir/StructureDefinition/validation-issue-count-error",
"valueInteger": 1
},
{
"url": "http://cumuluz/fhir/StructureDefinition/validation-issue-count-warning",
"valueInteger": 0
},
{
"url": "http://cumuluz/fhir/StructureDefinition/validation-issue-count-information",
"valueInteger": 0
},
{
"url": "http://cumuluz/fhir/StructureDefinition/validation-relaxed-issue-count",
"valueInteger": 0
}
],
"issue": [
{
"severity": "error",
"code": "invalid",
"diagnostics": "Resource does not conform to http://nictiz.nl/fhir/StructureDefinition/nl-core-Patient"
}
]
}
The validator is intentionally useful for target-side quality checks, but not every warning means the translation failed.
Current known behavior includes:
In practice, a warning may point to package availability, slice matching, or terminology resolution rather than to a bad translation.
ig/input/examples/patient-validate-request.jsonig/input/examples/patient-validate-response.jsonig/input/examples/patient-validate-response-fail.jsonClients that need a strict go/no-go decision should treat error and fatal as blocking and review warnings according to their own policy.
Validation follows the same target families as translation.
nl-core 2020 when the translated output is meant to fit the Dutch profile familyeu-base when the translated output is meant to fit the European profile familyFor background on the target families themselves, see Target Profiles.
GET /fhir/r4/metadata returns a FHIR CapabilityStatement describing the R4-facing validation surface and the supported target profiles per resource type.