Validation
Ignixa provides a three-tier validation system that balances performance with conformance checking.
Validation Features
The server provides validation via the $validate operation endpoint. Validation checks FHIR resource structure and conformance rules.
Validation Checks
Ignixa performs the following validation checks:
- JSON structure validity
- Required field presence
- Basic type checking
- Value domain validation
- Reference format checking
- CodeableConcept structure
- Cardinality constraints
- StructureDefinition constraints (if profiles are loaded)
- Extension validation
- Invariant (FHIRPath) evaluation
Note: Detailed configuration of validation levels is managed through installed FHIR packages and StructureDefinitions. For custom validation behavior, use invariants in StructureDefinitions.
Validation Flow
Resource Input
│
▼
┌─────────────┐
│ Fast │ Structure, required fields
└──────┬──────┘
│
▼
┌─────────────┐
│ Spec │ FHIR specification rules
└──────┬──────┘
│
▼
┌─────────────┐
│ Profile │ Custom profiles, invariants
└──────┬──────┘
│
▼
OperationOutcome
Using $validate
Validate resources without storing:
Basic Validation (Tenant-Explicit)
POST /tenant/{tenantId}/Patient/$validate
Content-Type: application/fhir+json
{
"resourceType": "Patient",
"name": [{ "family": "Smith" }]
}
Or single-tenant mode:
POST /Patient/$validate
Content-Type: application/fhir+json
{
"resourceType": "Patient",
"name": [{ "family": "Smith" }]
}
Validate Against a Specific Profile
Use a Parameters resource with the profile parameter:
POST /tenant/{tenantId}/Patient/$validate
Content-Type: application/fhir+json
{
"resourceType": "Parameters",
"parameter": [
{
"name": "profile",
"valueUri": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
},
{
"name": "resource",
"resource": {
"resourceType": "Patient",
"name": [{ "family": "Smith" }]
}
}
]
}
Validation Modes
Specify validation mode (create, update, delete) in the Parameters resource:
{
"resourceType": "Parameters",
"parameter": [
{
"name": "mode",
"valueCode": "create"
},
{
"name": "resource",
"resource": { ... }
}
]
}
Supported modes:
create- Validate as if creating a new resourceupdate- Validate as if updating an existing resourcedelete- Validate deletion constraints
OperationOutcome
Validation results are returned as OperationOutcome:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "required",
"diagnostics": "Patient.name: minimum required = 1, but only found 0",
"location": ["Patient.name"]
},
{
"severity": "warning",
"code": "business-rule",
"diagnostics": "Patient.gender: value is missing",
"location": ["Patient.gender"]
}
]
}
Severity Levels
| Severity | Description | Result |
|---|---|---|
fatal | Processing cannot continue | Rejected |
error | Violates FHIR rules | Rejected |
warning | Doesn't conform to best practice | Accepted |
information | Informational message | Accepted |
Validation Configuration
The server validates resources during create and update operations. Validation behavior is controlled by installed FHIR packages and their StructureDefinitions.
To control which profiles validate resources:
- Install FHIR packages using the package management endpoints
- Configure StructureDefinitions with validation rules and invariants
- Resources will automatically be validated against installed profiles
Custom Validation Rules
Add custom validation via invariants in StructureDefinitions:
{
"resourceType": "StructureDefinition",
"constraint": [{
"key": "us-core-8",
"severity": "error",
"human": "Patient.name.family or Patient.name.given SHALL be present",
"expression": "family.exists() or given.exists()"
}]
}
Terminology Validation
Terminology validation checks coded values against ValueSets defined in installed FHIR packages. The server uses the Ignixa Terminology Service to expand and validate value sets.
To enable terminology validation:
- Install FHIR packages that contain ValueSet definitions
- Configure StructureDefinitions with binding constraints
- The server will validate coded elements against their bound ValueSets during validation
See Operations for $expand, $translate, and $subsumes operations.
Best Practices
- Use
$validateendpoint before creating resources - Test conformance without storing invalid data - Profile validation via StructureDefinitions - Install the appropriate FHIR packages for your domain (e.g., US Core, AU Base)
- Custom invariants - Add FHIRPath expressions in StructureDefinitions for business rule validation
- Error handling - Check OperationOutcome severity levels to determine whether validation failures should be treated as fatal