FHIR Chat · FHIRPath error in HAPI 3.7 validation · hapi

Stream: hapi

Topic: FHIRPath error in HAPI 3.7 validation


view this post on Zulip Morten Ernebjerg (Feb 18 2019 at 14:42):

In HAPI 3.7, we're seeing an error when validating (STU3) against certain custom profiles. Specifically, we see the following errors when posting a valid Practitioner resource (this is from the returned OperationOutcome):

"Problem evaluating slicing expression for element in profile http://example.org/fhir/StructureDefinition/MyBugpractitioner-de-basis-0.2 path Practitioner.name (fhirPath = true and (use memberOf 'http://hl7.org/fhir/ValueSet/name-use')): null"

First bit of the error stack trace is

java.lang.UnsupportedOperationException
    at org.hl7.fhir.dstu3.hapi.validation.FhirInstanceValidator$WorkerContextWrapper.expandVS(FhirInstanceValidator.java:535)
    at org.hl7.fhir.r4.elementmodel.Element.getAsICoding(Element.java:775)
    at org.hl7.fhir.r4.model.Base.castToCoding(Base.java:486)
    at org.hl7.fhir.r4.utils.FHIRPathEngine.opMemberOf(FHIRPathEngine.java:1735)
    at org.hl7.fhir.r4.utils.FHIRPathEngine.operate(FHIRPathEngine.java:1333)
    at org.hl7.fhir.r4.utils.FHIRPathEngine.execute(FHIRPathEngine.java:1119)
    at org.hl7.fhir.r4.utils.FHIRPathEngine.execute(FHIRPathEngine.java:1100)
    at org.hl7.fhir.r4.utils.FHIRPathEngine.execute(FHIRPathEngine.java:1118)
    at org.hl7.fhir.r4.utils.FHIRPathEngine.evaluate(FHIRPathEngine.java:503)
    at org.hl7.fhir.r4.utils.FHIRPathEngine.evaluateToBoolean(FHIRPathEngine.java:559)
    at org.hl7.fhir.r4.validation.InstanceValidator.evaluateSlicingExpression(InstanceValidator.java:2571)
    at org.hl7.fhir.r4.validation.InstanceValidator.sliceMatches(InstanceValidator.java:2563)
    at org.hl7.fhir.r4.validation.InstanceValidator.matchSlice(InstanceValidator.java:3801)
    at org.hl7.fhir.r4.validation.InstanceValidator.validateElement(InstanceValidator.java:3505)
    at org.hl7.fhir.r4.validation.InstanceValidator.start(InstanceValidator.java:2681)
    at org.hl7.fhir.r4.validation.InstanceValidator.validateResource(InstanceValidator.java:4020)
   (...)

The profile is a re-profiling of the German Base Practitioner profile in which the following changes are introduced:

1. Make the name field required
2. Slice the name with the discriminator on the value of the name.use field
3. Add a required (1..1) slice in which name.use is required and fixed to "official", and name.givenand name.familyare required.

The error seems to be related to the profile in question being a re-profling

Is this a known issue and is there perhaps a workaround?

view this post on Zulip Grahame Grieve (Feb 19 2019 at 01:04):

not sure. I'll have to investigate.

view this post on Zulip Grahame Grieve (Feb 19 2019 at 01:05):

I think that this is before the change to the new hapi core structure?

view this post on Zulip Morten Ernebjerg (Feb 19 2019 at 09:09):

Hm, not sure when the split was - HAPI 3.7 was released on Feb 6th (release is Git commit #207015c3af5022570c36796ce0f4f0067ff9bc3a).

view this post on Zulip Morten Ernebjerg (Mar 05 2019 at 07:55):

@Grahame Grieve Should I make a GF ticket for this for your current sweep through the validator?

view this post on Zulip Grahame Grieve (Mar 05 2019 at 08:51):

can you reproduce this with the validator.jar?

view this post on Zulip Morten Ernebjerg (Mar 05 2019 at 10:08):

Just checked with the latest validator JAR and it worked fine, so I suppose this is actually coming from HAPI.

view this post on Zulip Grahame Grieve (Mar 05 2019 at 10:11):

ok. well, is it because the code is not up to date?

view this post on Zulip Morten Ernebjerg (Mar 05 2019 at 17:14):

Just checked again and I see the above error with the most recent HAPI release (3.7). In my setup, I'm afraid I can't check against anything newer so I cannot tell if it has fixed in GitHub.

view this post on Zulip Grahame Grieve (Mar 05 2019 at 17:46):

@James Agnew is there are way to investigate this?


Last updated: Apr 12 2022 at 19:14 UTC