CaboLabs / openEHR-SDK

Java/Groovy Support of openEHR Operational Templates, Reference Model, Data Generators and other tools for www.CaboLabs.com projects
Apache License 2.0
11 stars 16 forks source link

OPT.nodes: stores unrelated nodes for the same path #176

Open ppazos opened 1 year ago

ppazos commented 1 year ago

The problem of OperationalTemplate.nodes is the key is an archetype path.

Then if we want to get nodes by path, two nodes from different archetypes could have the same path and will be returned. Check the OPT below, for the path "/content[archetype_id=openEHR-EHR-OBSERVATION.saturacion_de_oxigeno.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value" gets ObjectNodes with internal nodes for blood pressure and oxymetry:

https://github.com/ppazos/openehr-basic/blob/master/opts/monitoreo_de_signos_vitales.opt

The other strange thing is that if opt.getNodes() is called using the template path, it returns results, event if the paths used as keys are archetype paths.

Need to debug and check if there is an issue somewhere.

ppazos commented 10 months ago

Retest to check if this commit doesn't fix the issue: https://github.com/ppazos/openEHR-OPT/commit/2692f9d8080b122c651e4b7b314e32043670bdfc

Also create a test for this.