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:
HAPI FHIR validator configuration class:
HAPI FHIR Validator configuration
HL7 FHIR validator configuration class:
HL7 validation engine dependency (included in HAPI FHIR dependency):
ca.uhn.hapi.fhir:org.hl7.fhir.validation:6.5.18