-
Notifications
You must be signed in to change notification settings - Fork 345
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
Remove the need for adapters to use validation and fhirpath #2893
Comments
I don't want this change to make it so that things like the XmlNode or JsonNode which are the random content parsed able to be used with the fhirpath engine (without a known class model), and potentially the validator (I don't do this at the moment - but would for the randon logical models - which don't use reflection). But I expect the plan is to use the overflow area right? |
That's exactly it. We should be able to turn any random ITypedElement or even ISourceNode into a |
Currently, we need PocoElementNode + ScopedNode to get the full functionality needed for validation, resolution and fhirpath. The main reason is that elements cannot refer back to their parents, so things like resolving resources and looking into the context of an element are impossible. Also, it is hard to figure out a location, without knowing your parent.
This has been solved by stateful wrappers like ScopedNode, but these have a few disadvantages:
To remove the need for adapters, we will have to add the notion of a parent (and maybe some additional data like index in a list) to the pocos. There are three ways to do this:
This last bullet's disadvantages can be alleviated by making this navigation explicit and requiring a caset to
IScopedNode
.Second, we need a replacement for ITypedElement, or adapt ITypedElement to expose the Parent. One could argue we should adapt ITypedElement, but the kind of changes we want to make are deeply breaking:
PS: We've for now chosen to stick to IScopedNode, a subclass of ITypedElement that exposes a Parent property. Once we got that change into our codebase, we can think about introducing lists (basically moving from the XML world with repeated elements to the Json world with lists as first class citizens). We have already seen that
Definition
is hardly necessary anymore (at least for our goals), so the POCO's will not implement that part of ITypedElement. If you need that, use the old stack.The text was updated successfully, but these errors were encountered: