Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support bundle-local reference resolution from the FHIRPath resolve function #3216

Closed
abedultamimi opened this issue Jan 20, 2022 · 5 comments
Assignees
Labels
P3 Priority 3 - Nice To Have

Comments

@abedultamimi
Copy link

entry.first().resource.eventCoding.code='medication-dispense' implies entry.first().resource.focus.all( $this.resolve() is MedicationDispense)

i'm trying this constraint but without any luck, any idea how resolve works in ibm fhir. i also tried:
entry.first().resource.eventCoding.code='medication-dispense' implies entry.first().resource.focus.all( resolve() is MedicationDispense)

@lmsurpre
Copy link
Member

lmsurpre commented Jan 20, 2022

Hi @abedultamimi, can you give a little more info about what you're trying to do and where? What does the reference in question look like that you're trying to resolve?

Our FHIRPath implementation has a built-in function registry. The default resolve function doesn't actually retrieve any resources but instead returns a placeholder so that most expressions can be evaluated without making network connections under the covers.
However, its possible to override that default implementation and in fact our server implementation does just that: https://github.com/IBM/FHIR/blob/main/fhir-server/src/main/java/com/ibm/fhir/server/listener/FHIRServletContextListener.java#L230-L234

Ensure your fhirServer/core/serverResolveFunctionEnabled property is set to true in fhir-server-config to enable that feature.
Also note that, in neither case, will we make a network connection to an external server to dereference an absolute reference.

@abedultamimi
Copy link
Author

Hi @lmsurpre ,

Thanks for taking time to review this, my intention is to have this validated resolving other bundle entry.

Assuem that i have a bundle of 2 entries like the below:

  1. MedicationRequest
  2. Patient ( fullurl is http://xyz.com/Patient/123)

And im having a MedicationRequest.subject as "Patient/123"

Xyz.com is an arbitrary value not equal to fhir server base url.
My question is can resolve work against bundle entries or it needs to be server resources.

Thanks Again

@lmsurpre
Copy link
Member

lmsurpre commented Feb 11, 2022

Hi @abedultamimi sorry for the delay. I think the answer is that our current ResolveFunction implementation does not support the "Resolving references in Bundles" algorithm outlined at https://www.hl7.org/fhir/bundle.html#references

I'm debating between:
A. turning this issue into a feature request for that feature; or
B. labeling this one as a question, closing it, and opening a separate feature request for that feature

Let me know if you have a preference. I will do A if we don't hear back soon.

@lmsurpre lmsurpre changed the title FhirPath resolve function Support bundle-local reference resolution from the FHIRPath resolve function Feb 11, 2022
lmsurpre added a commit that referenced this issue Feb 11, 2022
This commit also adds support for the `resource:` scheme in our Bundle
validation. This scheme is used in the SMART health cards spec and so I
think it makes sense to explicitly allow it.

This PR does *not* add support for reference rewriting for this
`resource:` scheme at present, but I think that is a logical follow-on
for issue #2512.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Feb 11, 2022
This commit also adds support for the `resource:` scheme in our Bundle
validation. This scheme is used in the SMART health cards spec and so I
think it makes sense to explicitly allow it.

This PR does *not* add support for reference rewriting for this
`resource:` scheme at present, but I think that is a logical follow-on
for issue #2512.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Feb 11, 2022
This commit also adds support for the `resource:` scheme in our Bundle
validation. This scheme is used in the SMART health cards spec and so I
think it makes sense to explicitly allow it.

This PR does *not* add support for reference rewriting for this
`resource:` scheme at present, but I think that is a logical follow-on
for issue #2512.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Feb 11, 2022
In addition, this commit adds support for the `resource:` scheme in our
Reference type checking / reference value validation. This scheme is
used in the SMART health cards spec and so I think it makes sense to
explicitly allow it.

I thought that I would need to do additional logic for supporting
reference rewriting for this scheme but, based on the test I added to
FHIRRestHelperTest, apparently not...we just needed to let it past our
parser.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@lmsurpre lmsurpre self-assigned this Feb 15, 2022
@lmsurpre lmsurpre added the P3 Priority 3 - Nice To Have label Feb 15, 2022
lmsurpre added a commit that referenced this issue Feb 15, 2022
issues #3216 and #2512 - support for alternative reference schemes and bundle ref resolution from FHIRPath ResolveFunction
@lmsurpre
Copy link
Member

@abedultamimi I believe this limitation is now addressed in our main branch. are you able to try it out and confirm this is working for you?

@lmsurpre
Copy link
Member

lmsurpre commented Apr 4, 2022

Closing due to lack of response. We believe this is covered sufficiently in the updated ResolveFunction implementation to be shipped with 4.11.

@lmsurpre lmsurpre closed this as completed Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Priority 3 - Nice To Have
Projects
None yet
Development

No branches or pull requests

2 participants