I am utilizing the validation.jar (org.hl7.fhir.validator.jar) in an attempt to validate against a differential custom structurdefinition... via the following
java -jar org.hl7.fhir.validator.jar patient-example.xml -defn validation-min.xml.zip -profile MyPatient.structuredefinition.xml
And I wind up with an IndexOutOfBoundException: Index:0 Size:0, at InstanceValidator.java:2186)
The custom StructureDefinition looks like:
<?xml version="1.0" encoding="utf-8"?>
<lastUpdated value="2017-01-23T14:15:06.425-05:00" />
<name value="MyPatient" />
<status value="draft" />
<date value="2017-01-23T14:12:46.7975804-05:00" />
<kind value="resource" />
<constrainedType value="Patient" />
<abstract value="false" />
<base value="http://hl7.org/fhir/StructureDefinition/Patient" />
<path value="Patient" />
<path value="Patient.gender" />
<min value="1" />
If I run the program against he default values, it properly runs:
java -jar org.hl7.fhir.validator.jar patient-example.xml -defn validation-min.xml.zip -profile http://hl7.org/fhir/StructureDefinition/daf-patient
If I save a version of my structural definition including a snapshop, and differential and pass that in, the validation works, but only against the snapshot, it completely ignores the differential definition that is in the file... So I can modify the snapshop and get the validation I want, but I don't get it from the differential.
I don't understand why the differential only structuredefinition is not working... and throws the error.. I assume it is some sort of parsing error, but have no idea what... and I am further confused why when I pass in a full structuredefinition with snapshot and differential, that the differential is completely ignored.
Can someone offer some help? I really would like to utilize differentials, but unless I can figure this out the only option I have is to take snapshots of the base and tweak them to validate what I want to validate which is very bad form to say the least.