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

issue #3619 - populate 'path' field for SystemValueNodes in context tree #3620

Merged
merged 3 commits into from
May 9, 2022

Conversation

lmsurpre
Copy link
Member

@lmsurpre lmsurpre commented May 5, 2022

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

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>
Copy link
Collaborator

@JohnTimm JohnTimm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lmsurpre lmsurpre merged commit 2f0fac9 into main May 9, 2022
@lmsurpre lmsurpre deleted the issue-3619 branch May 9, 2022 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants