Stream: conformance
Topic: Validator String index out of bounds exception -15
Alexander Henket (Dec 11 2019 at 09:45):
For all composition profiles we get the same error in the Java validator. I ran through one them, disabling parts until I found the 'offending' part.
It turns out that if you are two sections deep and starting talking about a section.code.coding, without marking section.code first, the validator looses track, so for example in eOverdracht-overdrachtsbericht-kinderen-1-18-jaar you cannot just say in the differential:
<element id="Composition.section:carePlan.section:patientsNeedsAndPreferences.code.coding"> <path value="Composition.section.section.code.coding" /> <min value="1" /> <max value="1" /> </element>
You need to add:
<element id="Composition.section:carePlan.section:patientsNeedsAndPreferences.code"> <path value="Composition.section.section.code" /> </element> <element id="Composition.section:carePlan.section:patientsNeedsAndPreferences.code.coding"> <path value="Composition.section.section.code.coding" /> <min value="1" /> <max value="1" /> </element>
This seems like a validator bug to me. Is that soomething you can verify @Grahame Grieve? It's the same dev set you have been working on before.
Unable to generate snapshot for eOverdracht-overdrachtsbericht-kinderen-1-18-jaar from Composition because String index out of range: -15 java.lang.StringIndexOutOfBoundsException: String index out of range: -15 at java.lang.String.substring(String.java:1931) at org.hl7.fhir.r5.conformance.ProfileUtilities.fixedPathSource(ProfileUtilities.java:1498) at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:643) at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:685) at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:787) at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:970) at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:970) at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:666) at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:472) at org.hl7.fhir.r5.context.SimpleWorkerContext.generateSnapshot(SimpleWorkerContext.java:616) at org.hl7.fhir.r5.context.SimpleWorkerContext.allStructures(SimpleWorkerContext.java:479) at org.hl7.fhir.r5.utils.FHIRPathEngine.<init>(FHIRPathEngine.java:254) at org.hl7.fhir.r5.validation.ValidationEngine.messagesToOutcome(ValidationEngine.java:1199) at org.hl7.fhir.r5.validation.ValidationEngine.validate(ValidationEngine.java:1124) at org.hl7.fhir.r5.validation.ValidationEngine.validate(ValidationEngine.java:1037) at org.hl7.fhir.r5.validation.Validator.main(Validator.java:653)
Grahame Grieve (Dec 11 2019 at 09:53):
this is still on my todo list. I kind of hope that one day I won't spend all day down in the guts of the snapshot generator....
Alexander Henket (Dec 11 2019 at 10:03):
Got it. For now I've added the missing thing manually for all Composition profiles so the error is now gone. However: first Save in Forge will delete that part again as it contains no changes compared to the base, so we'll have to be extra careful there.
Grahame Grieve (Dec 11 2019 at 10:08):
anyway, thanks for finding it, it will save me plenty of time
Last updated: Apr 12 2022 at 19:14 UTC