Skip to content

Populate "path" property in FHIRPathNode implementations representing system values #3619

@jarrettranderson

Description

@jarrettranderson

Is your feature request related to a problem? Please describe.
We have a requirement to remove the "id" property from certain elements of a resource. Consistent with other planned operations, we would find the targets using a FHIRPath expression and then remove them using FHIRPathUtil.delete(). FHIRPathUtil.delete() requires the path to the target, but the path() method returns null for FHIRPathStringValue objects returned from the FHIRPath evaluation.

Describe the solution you'd like
The path() method in FHIRPathStringValue objects and probably other FHIRPathSystemValue implementations should return the path to the node like it does for other implementations of FHIRPathNode.

Describe alternatives you've considered
For this particular scenario, we could use FHIRPath to find all the Element type objects in the tree and check each of them to see if the "id" value is populated. We would then update the parent object in a different manner.

Acceptance Criteria
1.
GIVEN [a FHIRPath expression that targets "id" or another system value field, such as "descendants().select(id)"]
AND [EvaluationContext evaluationContext = new EvaluationContext(some-resource)]
WHEN [FHIRPathEvaluator.evaluator().evaluate(evaluationContext, fhir-path-expression]
THEN [for each object returned, path() is non-null]

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions