You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I wrote some code to extract all the resource ids from a bundle via fhirpath, but it took me longer than it should have to figure out how to get the primitive value out of the FHIRPathNode:
Eventually I found the correct answer: node.asSystemValue().asStringValue().string()
What tripped me up is that we have a FHIRPathNode.getValue() which I thought would work, but it turns out that actually returns the FHIRPathNode's value (child) when it holds one, not the primitive value of current FHIRPathNode when you already have a FHIRPathSystemValue.
Having this method on instances of FHIRPathSystemValue doesn't make much sense, because FHIRPathSystemValue itself is a terminal node and the getValue() just gets in the way of the actual accessors which don't use get at all.
Describe the solution you'd like
override the getValue() javadoc for FHIRPathSystemValue to indicate that it will always return null.
in the concrete subtypes for FHIRPathSystemValue, add a @see link to the actually getters for the given primitive type
Describe alternatives you've considered
Acceptance Criteria
Additional context
The text was updated successfully, but these errors were encountered:
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>
Is your feature request related to a problem? Please describe.
I wrote some code to extract all the resource ids from a bundle via fhirpath, but it took me longer than it should have to figure out how to get the primitive value out of the FHIRPathNode:
Eventually I found the correct answer:
node.asSystemValue().asStringValue().string()
What tripped me up is that we have a
FHIRPathNode.getValue()
which I thought would work, but it turns out that actually returns the FHIRPathNode's value (child) when it holds one, not the primitive value of current FHIRPathNode when you already have a FHIRPathSystemValue.Having this method on instances of FHIRPathSystemValue doesn't make much sense, because FHIRPathSystemValue itself is a terminal node and the
getValue()
just gets in the way of the actual accessors which don't useget
at all.Describe the solution you'd like
getValue()
javadoc for FHIRPathSystemValue to indicate that it will always return null.@see
link to the actually getters for the given primitive typeDescribe alternatives you've considered
Acceptance Criteria
Additional context
The text was updated successfully, but these errors were encountered: