Stream: IG creation
Topic: Slice Criteria Validation failing
Jean Duteau (Jul 09 2021 at 15:37):
I have a slice whose discriminator is the value of an extension:
* careTeam ^slicing.discriminator.type = #value
* careTeam ^slicing.discriminator.path = "extension('http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-careTeamClaimScope').valueBoolean"
* careTeam ^slicing.rules = #open
* careTeam ^slicing.description = "Slice based on whether the care team member belongs to the overall claim or to an individual claim item."
* careTeam contains OverallClaimMember 0..14 and ItemClaimMember 0..10
When I run the publisher, it fails with the following error:
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:458)
at org.hl7.fhir.r5.utils.FHIRPathEngine.evaluateDefinition(FHIRPathEngine.java:5500)
at org.hl7.fhir.validation.instance.InstanceValidator.getCriteriaForDiscriminator(InstanceValidator.java:3058)
at org.hl7.fhir.validation.instance.InstanceValidator.sliceMatches(InstanceValidator.java:3554)
I'm assuming that it is my example with this slice since I just added the slice, but there is no other information since this is a Java error. Is my slice discriminator incorrect in some way?
Lloyd McKenzie (Jul 09 2021 at 17:33):
Does FHIRPath recognize valueBoolean? I thought you had to say ".value as boolean"...
Jean Duteau (Jul 09 2021 at 17:51):
i switched that to .value but it turns out that wasn't the error. it's the fact that the fhirpath engine is always looking for a extension type.
Lloyd McKenzie (Jul 09 2021 at 19:28):
Have you filed a Git issue?
Jean Duteau (Jul 09 2021 at 20:21):
yep
Jean Duteau (Aug 25 2021 at 21:31):
@Grahame Grieve Here is the original issue that caused me to switch from using a FSH version of my profile to a JSON version that I then needed to include a snapshot.
Jean Duteau (Aug 25 2021 at 21:31):
i did not raise a Git issue because I wasn't sure my analysis was correct.
Jean Duteau (Aug 25 2021 at 21:31):
I am checking in the FSH files that cause the above error.
Last updated: Apr 12 2022 at 19:14 UTC