I agree with @heath.frankel’s comment. Many attempts were made to “simplify” OPTs and “protect” developers from learning openEHR AM/RM. None made them happy.
My opinion is that if developers don’t want to familiarise themselves with the openEHR approach to data modeling, they shouldn’t keep asking the community for yet another “simplification” that would enable them to work with openEHR. Just count the number of different simplifications that are useful to their authors but are still not appealing to developers who demand such simplifications. Everything is too complicated for them. I’m afraid that any solution will be too complicated with that way of thinking.
I hope there will always be developers that are willing to spend some time learning before they start building openEHR solutions.
I attempt to skip all the intermediary XML/JSON/paths… and work directly with the model. The prerequisite to this approach is to have the AM/RM available in the frontend app. Then you can write code like:
ehrGate.CreateComposition("Lipids")
…and it will use the models built on the base of OPT to serialize the data for the COMPOSITION that can be sent to the CDR.
Here is an example toJson()
method for COMPOSITION that calls toJson()
for its attributes (which do the same for their attributes,… turtles all the way down):