ppazos / cabolabs-ehrserver

Open platform to manage and share standardized clinical data, designed by @ppazos at CaboLabs Health Informatics.
https://cabolabs.com
Apache License 2.0
179 stars 110 forks source link

Integrate updates for openEHR-OPT #1000

Closed ppazos closed 5 years ago

ppazos commented 5 years ago

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.

ppazos commented 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:

https://github.com/ppazos/cabolabs-ehrserver/blob/448bdfe973e595d71abe50dcb80b53ae98b2c405/grails-app/domain/com/cabolabs/ehrserver/query/datatypes/DataCriteriaDV_QUANTITY.groovy#L91

https://github.com/ppazos/cabolabs-ehrserver/blob/c3ceb99c50316a2087e4ecd42732986914360057/grails-app/domain/com/cabolabs/ehrserver/query/datatypes/DataCriteriaDV_CODED_TEXT.groovy#L121

https://github.com/ppazos/cabolabs-ehrserver/blob/3bbbc898de7b41db7ce78429dd9f7921b1dcb234/grails-app/domain/com/cabolabs/ehrserver/query/datatypes/DataCriteriaDV_ORDINAL.groovy#L118

I think in those usages, the returned class will always be ObjectNode, we can test on the Query Builder.

ppazos commented 5 years ago

Updated the lib to the latest version and tested ordinal, coded text and quantity from the query builder, all work OK.