OZO FHIR implementation guide
0.5.4 - ci-build
OZO FHIR implementation guide - Local Development build (v0.5.4) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
HAPI-1301: Unable to locate package fhir.nl.gf#0.3.0HAPI-1684: Unknown resource name "DeviceUsage" or "DomainResource"Flag)This manual provides step-by-step instructions for installing the OZO FHIR Implementation Guide package in a HAPI FHIR server.
The OZO FHIR Implementation Guide is distributed as a packaged release that can be installed on HAPI FHIR servers to enable validation and support for OZO-specific profiles, extensions, and resources.
There are two primary methods for installing the OZO FHIR package on your HAPI FHIR server:
This method involves configuring the HAPI FHIR server's application.yaml file to automatically download and install the OZO FHIR package on server startup.
Visit the OZO FHIR Implementation Guide releases page:
From the release page, copy the URL of the .tgz package file. For production servers, use the minimal package (smaller, optimized for server deployment):
fhir.ozo-0.5.2-minimal.tgz
The full download URL will be:
https://github.com/ozoverbindzorg/integrale-netwerk-communicatie/releases/download/v0.5.2/fhir.ozo-0.5.2-minimal.tgz
Open your HAPI FHIR server's application.yaml configuration file, typically located at:
src/main/resources/application.yaml
Navigate to the hapi.fhir.implementationguides section and add the OZO package configuration:
hapi:
fhir:
# ... other HAPI configuration ...
# Do NOT enable fetchDependencies or install_transitive_ig_dependencies.
# Transitive dependencies include hl7.fhir.r4.core and hl7.fhir.uv.extensions.r4
# which contain SearchParameter resources referencing R5-only types (e.g. DeviceUsage,
# DomainResource) that crash HAPI R4 during installation.
install_transitive_ig_dependencies: false
# Disable validation during package installation to bypass snapshot generation issues
iginstaller_validationenabled: false
# Flag filters resources during package installation
validate_resource_status_for_package_upload: false
implementationguides:
# Store the R4 extensions package without installing — it contains SearchParameter
# resources that reference R5-only types (DeviceUsage) which crash HAPI R4
r4-extensions:
name: hl7.fhir.uv.extensions.r4
version: 1.0.0
installMode: STORE_ONLY
# Dutch ZIB 2020 profiles (dependency of NL-core)
zib2020:
name: nictiz.fhir.nl.r4.zib2020
version: 0.12.0-beta.4
installMode: STORE_AND_INSTALL
# Dutch NL-core profiles (dependency of NL-GF and OZO)
nl-core:
name: nictiz.fhir.nl.r4.nl-core
version: 0.12.0-beta.4
installMode: STORE_AND_INSTALL
# NL Generic Functions — not on FHIR registry, must use direct URL
nl-gf:
name: fhir.nl.gf
version: 0.3.0
packageUrl: https://build.fhir.org/ig/nuts-foundation/nl-generic-functions-ig/package.tgz
installMode: STORE_AND_INSTALL
# OZO FHIR Implementation Guide
ozo:
name: fhir.ozo
version: 0.5.2
packageUrl: https://github.com/ozoverbindzorg/integrale-netwerk-communicatie/releases/download/v0.5.2/fhir.ozo-0.5.2-minimal.tgz
installMode: STORE_AND_INSTALL
Important: Do not use
fetchDependencies: trueorinstall_transitive_ig_dependencies: true. These settings cause HAPI to pull inhl7.fhir.r4.coreandhl7.fhir.uv.extensions.r4which contain SearchParameter resources referencing R5-only types (DeviceUsage,DomainResource), crashing the server. Instead, list all required dependencies explicitly as shown above.
Important: The
fhir.nl.gfpackage is not published on the FHIR package registry (packages.fhir.org). It must be listed as a separate implementation guide entry with a directpackageUrl. If omitted, the server will crash withResourceNotFoundException: HAPI-1301: Unable to locate package fhir.nl.gf#0.3.0during startup.
| Parameter | Description | Recommended Value |
|---|---|---|
| name | The package identifier (must match the package ID) | fhir.ozo |
| version | The version of the package to install | 0.5.2 |
| packageUrl | Direct URL to the .tgz package file |
Release download URL |
| installMode | How to handle the package installation | STORE_AND_INSTALL |
The OZO package includes custom profiles and extensions. To ensure proper installation, add or verify these settings in your application.yaml:
hapi:
fhir:
# Enable repository validation to validate resources against OZO profiles
enable_repository_validating_interceptor: true
# Disable validation during IG installation to avoid snapshot issues
iginstaller_validationenabled: false
# Allow installation of resources regardless of status
validate_resource_status_for_package_upload: false
After updating the configuration:
application.yaml filemvn clean install
java -jar target/hapi-fhir-jpaserver.jar
Once the server has restarted, verify that the OZO package was installed successfully:
Look for log entries indicating successful package installation:
INFO: Installing package fhir.ozo version 0.5.1
INFO: Successfully installed implementation guide: fhir.ozo
Use the FHIR API to verify the ImplementationGuide was loaded:
curl http://localhost:8080/fhir/ImplementationGuide?_id=fhir.ozo
You should receive a response containing the OZO ImplementationGuide resource.
Verify that OZO profiles are available:
curl http://localhost:8080/fhir/StructureDefinition?url=http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOCareTeam
After installation, you may want to determine which version of the OZO IG is active on the server. There are several approaches depending on your HAPI configuration.
All OZO profiles share the same version field, which matches the installed IG package version. Query them with:
curl "http://localhost:8080/fhir/StructureDefinition?url:below=http://ozoverbindzorg.nl/fhir/StructureDefinition&_elements=url,version,name&_sort=name"
The version field on each returned StructureDefinition reflects the IG package version (e.g., "version": "0.5.1").
If the ImplementationGuide resource type is enabled on your server (see below), you can query it directly:
curl "http://localhost:8080/fhir/ImplementationGuide?name=ozo-implementation-guide"
By default, HAPI's supported_resource_types may not include ImplementationGuide. To enable it, add it to your application.yaml:
hapi:
fhir:
supported_resource_types:
- ImplementationGuide
# ... other resource types
HAPI FHIR does not automatically populate the implementationGuide field in the CapabilityStatement (/fhir/metadata). The StructureDefinition query above is the most reliable method for version discovery.
After installing the OZO package, you can create FHIR resources that conform to OZO profiles. To ensure proper validation, you must set the meta.profile element to the canonical URL of the OZO profile.
The OZO CareTeam profile has the following canonical URL:
http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOCareTeam
Create a JSON file (e.g., careteam-example.json) with the meta.profile element set to the OZO profile URL:
{
"resourceType": "CareTeam",
"meta": {
"profile": [
"http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOCareTeam"
]
},
"status": "active",
"subject": {
"reference": "Patient/example-patient",
"type": "Patient",
"display": "H. de Boer"
},
"participant": [
{
"member": {
"reference": "RelatedPerson/example-relatedperson",
"type": "RelatedPerson",
"display": "Kees Groot"
}
},
{
"member": {
"reference": "Practitioner/example-practitioner",
"type": "Practitioner",
"display": "Manu van Weel"
},
"onBehalfOf": {
"reference": "Organization/example-hospital",
"type": "Organization",
"display": "Ziekenhuis Amsterdam"
}
}
]
}
Use curl to POST the resource to your HAPI FHIR server:
curl -X POST http://localhost:8080/fhir/CareTeam \
-H "Content-Type: application/fhir+json" \
-d @careteam-example.json
The HAPI FHIR server will validate the resource against the OZO CareTeam profile. If the resource does not conform to the profile constraints, you will receive an OperationOutcome with validation errors.
Successful Response:
{
"resourceType": "CareTeam",
"id": "12345",
"meta": {
"versionId": "1",
"lastUpdated": "2024-12-05T10:30:00.000+00:00",
"profile": [
"http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOCareTeam"
]
},
"status": "active",
"subject": {
"reference": "Patient/example-patient",
"type": "Patient",
"display": "H. de Boer"
},
"participant": [...]
}
Validation Error Example:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"diagnostics": "CareTeam.subject: minimum required = 1, but only found 0",
"expression": [
"CareTeam.subject"
]
}
]
}
The following table lists the canonical URLs for common OZO profiles:
| Profile Name | Canonical URL |
|---|---|
| OZOCareTeam | http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOCareTeam |
| OZOAuditEvent | http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOAuditEvent |
| OZOPatient | http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOPatient |
| OZOPractitioner | http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOPractitioner |
| OZORelatedPerson | http://ozoverbindzorg.nl/fhir/StructureDefinition/OZORelatedPerson |
| OZOOrganization | http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOOrganization |
| OZOCommunication | http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOCommunication |
| OZOTask | http://ozoverbindzorg.nl/fhir/StructureDefinition/OZOTask |
Always set meta.profile: The meta.profile element tells the HAPI FHIR server which profile to validate against.
Profile constraints: Each OZO profile has specific constraints (cardinality, required elements, value sets). Review the profile definition in the Artifacts section.
Referenced resources: OZO profiles often reference other OZO profiles (e.g., OZOCareTeam references OZOPatient, OZOPractitioner). Ensure all referenced resources also conform to their respective OZO profiles.
Validation mode: The HAPI server's enable_repository_validating_interceptor setting determines whether validation is enforced. If set to true, invalid resources will be rejected.
This method is useful for development and testing environments where you want to manually install the package without modifying server configuration.
Enable runtime IG upload in your application.yaml:
hapi:
fhir:
ig_runtime_upload_enabled: true
Download the .tgz package from the releases page:
wget https://github.com/ozoverbindzorg/integrale-netwerk-communicatie/releases/download/v0.5.1/fhir.ozo-0.5.1.tgz
Use the $install operation to upload the package:
curl -X POST \
-H "Content-Type: application/gzip" \
--data-binary @fhir.ozo-0.5.1.tgz \
"http://localhost:8080/fhir/ImplementationGuide/\$install"
Follow the same verification steps as in Method 1.
The OZO FHIR Implementation Guide depends on the following packages. All dependencies must be listed explicitly in application.yaml (see Step 2):
| Package | Version | Install Mode | Description |
|---|---|---|---|
| hl7.fhir.uv.extensions.r4 | 1.0.0 | STORE_ONLY |
FHIR R4 extensions (store only — see warning below) |
| nictiz.fhir.nl.r4.zib2020 | 0.12.0-beta.4 | STORE_AND_INSTALL |
Dutch Health and Care Information models (ZIB) |
| nictiz.fhir.nl.r4.nl-core | 0.12.0-beta.4 | STORE_AND_INSTALL |
Dutch national core profiles |
| fhir.nl.gf | 0.3.0 | STORE_AND_INSTALL |
NL Generic Functions (care services directory) |
These dependencies are required for proper validation of Dutch healthcare resources used in the OZO platform.
Important: The
hl7.fhir.uv.extensions.r4package must useSTORE_ONLYinstall mode. This package contains SearchParameter resources that reference FHIR R5-only types (DeviceUsage,DomainResource) which are not valid in R4. UsingSTORE_AND_INSTALLwill crash the server withHAPI-1684: Unknown resource name "DeviceUsage".
Important: The
fhir.nl.gfpackage is not published on the FHIR package registry and cannot be resolved by HAPI automatically. It must be listed with a directpackageUrl. If omitted, the server will crash on startup withHAPI-1301: Unable to locate package fhir.nl.gf#0.3.0.
Solution: Ensure validation is disabled during installation:
hapi:
fhir:
iginstaller_validationenabled: false
Solution: The HAPI FHIR server may have issues generating snapshots for certain profiles. The iginstaller_validationenabled: false setting helps bypass this issue.
HAPI-1301: Unable to locate package fhir.nl.gf#0.3.0Cause: The fhir.nl.gf package is not published on the FHIR package registry.
Solution: Add fhir.nl.gf as a separate implementation guide entry with a direct packageUrl:
implementationguides:
nl-gf:
name: fhir.nl.gf
version: 0.3.0
packageUrl: https://build.fhir.org/ig/nuts-foundation/nl-generic-functions-ig/package.tgz
installMode: STORE_AND_INSTALL
HAPI-1684: Unknown resource name "DeviceUsage" or "DomainResource"Cause: The hl7.fhir.uv.extensions.r4 or hl7.fhir.r4.core packages contain SearchParameter resources that reference FHIR R5-only types. This happens when fetchDependencies: true or install_transitive_ig_dependencies: true causes HAPI to pull in and install these packages.
Solution: Do not use fetchDependencies or install_transitive_ig_dependencies. Instead, list all dependencies explicitly and use STORE_ONLY for the extensions package:
install_transitive_ig_dependencies: false
implementationguides:
r4-extensions:
name: hl7.fhir.uv.extensions.r4
version: 1.0.0
installMode: STORE_ONLY
# ... other dependencies listed explicitly ...
See the complete configuration example for the full setup.
Cause: When upgrading HAPI across major versions (e.g., 7.x to 8.x), the database migration tool may not update all column constraints. Columns like trm_concept_desig.val, trm_concept_map_grp_elm_tgt.target_code, and others may retain stale NOT NULL constraints that conflict with newer HAPI code.
Solution: Run the HAPI migration tool before starting the upgraded server:
./hapi-fhir-cli migrate-database \
-d POSTGRES_9_4 \
-u "jdbc:postgresql://<host>:<port>/<db>" \
-n "<username>" \
-p "<password>"
If errors persist, the cleanest approach for a non-production database is to drop and recreate the schema so HAPI creates it fresh:
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
For PostgreSQL, also check for stale CHECK constraints that block newer enum values:
SELECT conname, conrelid::regclass, pg_get_constraintdef(oid)
FROM pg_constraint
WHERE contype = 'c' AND conrelid::regclass::text LIKE 'trm_%';
Drop any that restrict columns to old value ranges (e.g., trm_concept_property_prop_type_check).
Flag)Cause: The Nictiz NL-core packages include SearchParameter definitions that reference resource types not in your supported_resource_types list. HAPI's background reindexing jobs fail when they encounter these types.
Solution: Add the missing resource types to supported_resource_types. For NL-core compatibility, add at least Flag:
supported_resource_types:
# ... existing types ...
- Flag
Alternatively, remove the supported_resource_types setting entirely to allow all R4 resource types (may increase memory usage).
Solution: Ensure all required packages are listed explicitly in implementationguides. The server needs internet access to download packages from the FHIR package registry.
Solution: Increase the JVM heap size when starting the HAPI server:
java -Xmx4g -jar target/hapi-fhir-jpaserver.jar
Solution: Check the server logs for installation errors. Verify the package URL is accessible and the package file is valid.
To update to a newer version of the OZO FHIR package:
application.yaml:
implementationguides:
ozo:
name: fhir.ozo
version: X.Y.Z # New version
packageUrl: https://github.com/ozoverbindzorg/integrale-netwerk-communicatie/releases/download/vX.Y.Z/fhir.ozo-X.Y.Z.tgz
Restart the HAPI FHIR server
curl http://localhost:8080/fhir/ImplementationGuide?_id=fhir.ozo
The server will detect the version change and reinstall the package with the updated resources.
Below is a complete example of a HAPI FHIR server application.yaml configuration with the OZO package installed:
hapi:
fhir:
fhir_version: R4
server_address: http://localhost:8080/fhir/
# IMPORTANT: Do NOT enable these — transitive dependencies include packages
# with R5-only SearchParameters that crash HAPI R4
install_transitive_ig_dependencies: false
# Enable repository validation
enable_repository_validating_interceptor: true
# Disable validation during IG installation
iginstaller_validationenabled: false
validate_resource_status_for_package_upload: false
# Implementation Guides — all dependencies listed explicitly
implementationguides:
# Store extensions only — contains R5-only SearchParameters (DeviceUsage,
# DomainResource) that crash HAPI R4 if installed
r4-extensions:
name: hl7.fhir.uv.extensions.r4
version: 1.0.0
installMode: STORE_ONLY
# Dutch ZIB 2020 profiles (dependency of NL-core)
zib2020:
name: nictiz.fhir.nl.r4.zib2020
version: 0.12.0-beta.4
installMode: STORE_AND_INSTALL
# Dutch NL-core profiles (dependency of NL-GF and OZO)
nl-core:
name: nictiz.fhir.nl.r4.nl-core
version: 0.12.0-beta.4
installMode: STORE_AND_INSTALL
# NL Generic Functions (not on FHIR registry — must use direct URL)
nl-gf:
name: fhir.nl.gf
version: 0.3.0
packageUrl: https://build.fhir.org/ig/nuts-foundation/nl-generic-functions-ig/package.tgz
installMode: STORE_AND_INSTALL
# OZO FHIR Implementation Guide
ozo:
name: fhir.ozo
version: 0.5.2
packageUrl: https://github.com/ozoverbindzorg/integrale-netwerk-communicatie/releases/download/v0.5.2/fhir.ozo-0.5.2-minimal.tgz
installMode: STORE_AND_INSTALL
# Supported resource types (ensure OZO resources are included)
supported_resource_types:
- AuditEvent
- CareTeam
- Communication
- CommunicationRequest
- Flag # Required by NL-core SearchParameter definitions
- ImplementationGuide # Enables version discovery via /fhir/ImplementationGuide
- Organization
- Patient
- Practitioner
- RelatedPerson
- StructureDefinition # Enables profile queries for version discovery
- Task
# ... other resource types
For issues related to:
Installing the OZO FHIR Implementation Guide on a HAPI FHIR server enables:
By following this guide, you can ensure your HAPI FHIR server is properly configured to support OZO platform integrations.