Closed ppazos closed 5 years ago
We solved this issue for the validator (avoid to retrieve an attr and not knowing if it was an object or not) by adding a method existsNodeByTemplateDataPath to OPT and using that instead of getNode.
Check the changes on openEHR-OPT https://github.com/ppazos/openEHR-OPT/blob/b6c11a5cdea9d5b680e5960997c11e0ce96f1891/src/com/cabolabs/openehr/opt/model/OperationalTemplate.groovy#L33-L41
Our change was here https://github.com/ppazos/cabolabs-ehrserver/commit/c3ceb99c50316a2087e4ecd42732986914360057#diff-9bd2d21217a8123e0c240e20fbd8aa6aR373
But we are still using getNode here:
I think in those usages, the returned class will always be ObjectNode, we can test on the Query Builder.
Updated the lib to the latest version and tested ordinal, coded text and quantity from the query builder, all work OK.
Check commit for https://github.com/ppazos/openEHR-OPT/issues/48
Now OPT getNode can retrieve AttributeNode, this will need refactorings on many areas. Should consider all paths to attributes (without a node_id) will retrieve AttributeNode instead of ObjectNode as before.