issue/1806: Add fhirServerUrl support to enable FHIRPath resolve() function#1808
Open
not-in-stock wants to merge 1 commit intoaehrc:mainfrom
Open
issue/1806: Add fhirServerUrl support to enable FHIRPath resolve() function#1808not-in-stock wants to merge 1 commit intoaehrc:mainfrom
not-in-stock wants to merge 1 commit intoaehrc:mainfrom
Conversation
…lve() function Thread `fetchResourceRequestConfig` through fhirpath.evaluate() calls to pass the `fhirServerUrl` option, which enables the FHIRPath `resolve()` function to fetch referenced resources from the FHIR server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for the FHIRPath
resolve()function in the@aehrc/sdc-populatepackage by passing thefhirServerUrloption tofhirpath.evaluate()calls.Changes
resolve()was implemented)@testing-library/jest-domfor testsfetchResourceRequestConfigthrough functions that callfhirpath.evaluate():evaluateFhirPathVariables()evaluateFhirPathEmbeddings()generateExpressionValues()evaluateItemPopulationContexts()Motivation
The
resolve()function is a standard FHIRPath function that allows questionnaires to populate fields from referenced resources without requiring the calling application to pre-resolve all references manually.Previously, expressions like
%order.requester.resolve().name.first().familywould fail silently and return empty values becausefhirpath.evaluate()wasn't configured with a FHIR server URL.Example
After this change, questionnaires can use expressions like:
{ "linkId": "ordering-physician-name", "type": "string", "extension": [{ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression", "valueExpression": { "language": "text/fhirpath", "expression": "%order.requester.resolve().name.first().given.first() & ' ' & %order.requester.resolve().name.first().family" } }] }Backwards Compatibility
This change is fully backwards compatible:
fetchResourceRequestConfig.sourceServerUrlis not provided,resolve()simply won't work (same as current behavior)Test Plan
resolve()expressions in a SMART on FHIR app