Inconsistent Validation Results: HAPI FHIR validator vs HL7 ValidatorEngine

20 views
Skip to first unread message

Rico Aarntzen

unread,
Sep 19, 2025, 8:59:01 AM (8 days ago) Sep 19
to HAPI FHIR

Hi HAPI FHIR team,

We've run into an issue where validation behaves differently between HAPI FHIR instance validator and the HL7 ValidatorEngine. We're using snapshot-based Implementation Guides  and seeing that validation between HL7 Validator and HAPI FHIR Validator gives different behaviour.

We are encountering a slice error in the HAPI FHIR Validator that does not occur in the HL7 Validator.

HAPI FHIR validator produces this error:

ERROR,1527,1,Bundle,"Slice 'Bundle.entry:medicationAgreement': a matching slice is required, but not found (from http://nictiz.nl/fhir/StructureDefinition/mp-MedicationPrescription-Bundle|2.0.0-rc.1). Note that other slices are allowed in addition to this required slice",Validation_VAL_Profile_Minimum_SLICE,null

It seems that something might not be fully correct in the HAPI FHIR configuration, as we’re seeing a slice validation error in the HAPI FhirInstanceValidator that does not occur when using the HL7 Validator (ValidationEngine).

The issue is difficult to trace, as I'm loading exactly the same IG packages in both validators. 

At this point, we are not sure where else to look or who might be best to help with this. Could you assist in identifying what might be causing this discrepancy?

In the appendix is the XML of the bundle we use to find this discepancy, you can use it to reproduce if needed. In the appendix there is also a screenshot of the output of the HL7 Validator, using that XML.

Extra information:

We are using HAPI FHIR version 8.2.0 (Also for validation and other HAPI FHIR dependencies).

Snapshot Packages we are using:

  • hl7.fhir.r4.core-4.0.1-snapshots.tgz
  • nictiz.fhir.nl.r4.medicationprocess9-2.0.0-rc.1-snapshots.tgz
  • nictiz.fhir.nl.r4.nl-core-0.11.0-beta.1-snapshots.tgz
  • nictiz.fhir.nl.r4.zib2020-0.11.0-beta.1-snapshots.tgz

HAPI FHIR validator configuration class:

HAPI FHIR Validator configuration

HL7 FHIR validator configuration class:

HL7 Validator configuration

HL7 validation engine dependency (included in HAPI FHIR dependency):

ca.uhn.hapi.fhir:org.hl7.fhir.validation:6.5.18

hl7 validation engine output.png
mv-mp-vo-tst-4-2-a-nierfunctie-NHG-v30.xml
Reply all
Reply to author
Forward
0 new messages