-
Notifications
You must be signed in to change notification settings - Fork 341
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
Location on SourceNode differs from that on TypedElementToSourceNodeAdapter #2784
Comments
Indeed, "happened" to work ;-) We fixed that bug (#2642) in 5.8.0, since it caused MaskingNode to malfunction. Now it seems this roundtrip feature was dependend on that bug.
I think you mean "TypedElementToSourceNodeAdapter", since we're talking about getting a SourceNode back from a TypedElement, right? So Indeed in that last adapter, on line 50 I see:
This just "happened" to work because the TypedElementOnSourceNode passed it on 1-on-1 until 5.7.0. |
BTW: since in many cases this is a wrapped source node on a wrapped itypedelement that wraps an isourcenode, we can save cycles here by polling the |
…ation #2784 Fix source node location when round tripping via adapters
Describe the bug
If I construct a
SourceNode
directly, or from JSON or XML, the location for choice types includes the type name. E.g.Patient.extension[0].valueDateTime[0]
.When I roundtrip it through
ITypedElement
back toISourceNode
using theTypedElementOnSourceNodeAdapter
, the location of the same element no longer includes the type name.In Firely Server we use the ITypedElement to run FHIRPath and find certain elements to patch. But the patching itself happens on ISourceNode. So somehow we need to know the location of an element in the ISourceNode based on information in the ITypedElement.
Up until SDK 5.7.0 this happened to work because TypedElementOnSourceNode retained its location verbatim from the underlying ISourceNode.
To Reproduce
Steps to reproduce the behavior:
see branch fix/2784-typedelement-sourcenode-location
Expected behavior
When I roundtrip an ISourceNode -> ITypedElement -> ISourceNode, I should get the same locations for all elements.
Likewise, POCO -> ISourceNode and a SourceNode constructed directly should yield the same locations.
Mainly, the type name in choice type elements should be present.
Screenshots
n/a
Version used:
Additional context
n/a
The text was updated successfully, but these errors were encountered: