google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
493 stars 294 forks source link

FHIR model class types not resolved during runtime when using the cached R4 context #2007

Open ndegwamartin opened 1 year ago

ndegwamartin commented 1 year ago

Describe the bug There's as a strange issue that occurs when using the workflow library to generate reports using CQL The classes org.hl7.fhir.r4.model.BundleType and SearchParameter$SearchComparator classes are not resolved by the FHIR Model Resolver because they are not present in the data structure here at run time.

An exception is thrown in the line here ../model/FhirModelResolver.java#L295

Component Workflow library

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior All HAPI FHIR structure models should be loaded in the FhirModelResolver class and should not throw a missing class exception at runtime

Screenshots

Stacktrace

org.opencds.cqf.cql.engine.fhir.exception.UnknownType: Could not resolve type BundleType. Primary package(s) for this resolver are org.hl7.fhir.r4.model
                                                                                            at org.opencds.cqf.cql.engine.fhir.model.FhirModelResolver.resolveType(FhirModelResolver.java:295)
                                                                                            at org.opencds.cqf.cql.engine.fhir.model.R4FhirModelResolver.resolveType(R4FhirModelResolver.java:189)
                                                                                            at org.opencds.cqf.cql.evaluator.engine.model.CachingModelResolverDecorator.resolveType(CachingModelResolverDecorator.java:64)
                                                                                            at org.opencds.cqf.cql.engine.data.CompositeDataProvider.resolveType(CompositeDataProvider.java:54)
                                                                                            at org.opencds.cqf.cql.engine.execution.Context.resolveType(Context.java:457)
                                                                                            at org.opencds.cqf.cql.engine.execution.Context.resolveType(Context.java:462)
                                                                                            at org.opencds.cqf.cql.engine.execution.Context.resolveOperandType(Context.java:510)
                                                                                            at org.opencds.cqf.cql.engine.execution.Context.resolveFunctionRef(Context.java:564)
                                                                                            at org.opencds.cqf.cql.engine.execution.Context.resolveFunctionRef(Context.java:596)
                                                                                            at org.opencds.cqf.cql.engine.elm.execution.FunctionRefEvaluator.internalEvaluate(FunctionRefEvaluator.java:23)
                                                                                            at org.opencds.cqf.cql.engine.elm.execution.Executable.evaluate(Executable.java:14)
                                                                                            at org.opencds.cqf.cql.engine.elm.execution.FunctionRefEvaluator.internalEvaluate(FunctionRefEvaluator.java:17)
                                                                                            at org.opencds.cqf.cql.engine.elm.execution.Executable.evaluate(Executable.java:14)
                                                                                            at org.opencds.cqf.cql.engine.elm.execution.ExpressionDefEvaluator.internalEvaluate(ExpressionDefEvaluator.java:23)
                                                                                            at org.opencds.cqf.cql.engine.elm.execution.Executable.evaluate(Executable.java:14)

Smartphone (please complete the following information):

Additional context

Would you like to work on the issue? Please state if this issue should be assigned to you or who you think could help to solve this issue.

ndegwamartin commented 1 year ago

Created the issue to track this cc @dubdabasoduba @f-odhiambo @roy @maimoonak @jingtang10 @khyativyasargus

aditya-07 commented 1 year ago

@ktarasenko @vitorpamplona FYI.