issue #3619 - populate 'path' field for SystemValueNodes in context tree#3620
Merged
Conversation
I also updated the javadoc (relates to #2153) because the user was confused about the FHIRPathNode API and I thought it could use further clarification. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
The previous commit set the path for Resource.id, Element.id, and Extension.url primitive values. This commit extends that to include *all* SystemValue nodes. Additionally Resource.id, Element.id, and Extension.url value nodes are now added to the context tree. Primitive value nodes named "value" are still kept out of the tree and are still only accessible through their parent's `getValue()` accessor. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
The FHIRPathPatch API is implemented via utilities in FHIRPathUtil. Both the FHIRPatchPatch API and the unerlying utility methods were designed to operate on FHIR nodes (FHIRPathResourceNode and FHIRPathElementNode). However, the delete API in particular is not strictly bound to paths that select FHIR nodes. Previously, calling delete on a path that selects one of these nodes would result in a NullPointerException. With the previous commit, it would instead become a no-op. With this commit, we will now attempt to remove the primitive value node and rebuild the parent accordingly. This allows users to remove fields like Resource.id and Element.id via FHIRPath and it even allows you to remove the value of primitive FHIR elements (e.g. Patient.active.value) in cases where those primitives already have an extension (otherwise they need to have a value). Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
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.
Previously we had "interesting" behavior for fields like Element.id that
are of type System.String (rather than FHIR.String). Now these nodes
will become children in the EvaluationContext tree.
This allows users to remove fields like Resource.id and Element.id via
FHIRPath and it even allows you to remove the value of primitive FHIR
elements (e.g. Patient.active.value) in cases where those primitives
already have an extension (otherwise they need to have a value).
I also updated the javadoc (relates to #2153) because the user was
confused about the FHIRPathNode API and I thought it could use further
clarification.
Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com