Skip to content

How to modify nodes selected by FHIRPath "Select" function #1817

Answered by ewoutkramer
BoyaWu10 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, that is the approach I would take as well. Navigating a ScopedNode using FhirPath will generally just call Children() on the ScopedNode, which will do this:

        public IEnumerable<ITypedElement> Children(string? name = null) =>
            Current.Children(name).Select(c => new ScopedNode(this, ParentResource, c, _fullUrl));

This fragment shows that while navigating down the tree using FhirPath, new ScopedNodes are created using a private constructor, which just wraps the ElementNode children (c) of the current ElementNode, and they will be exposed through Current in the child nodes.

So this should work!

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@BoyaWu10
Comment options

@ewoutkramer
Comment options

@BoyaWu10
Comment options

Answer selected by BoyaWu10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants