openEHR / java-libs

Standard Java libraries for Java implementations of openEHR
Other
48 stars 60 forks source link

regarding ResourceItem #27

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi,

A short notification for there is a small but disturbing problem in Java-lib code, which I was studying for some project purpose.

In the code in java-libs is in conflict with the specifications (the specifications are right, also conform the many examples on CKM). It is not a big thing, but can be confusing for someone new in OpenEHR.

I did not find a Jira-project to post it, so I do it here.

Thx Bert

The explanation, for if some wants to repair it.

It is about these documents/source files: 1) https://github.com/openEHR/java-libs/blob/master/openehr-aom/src/main/java/org/openehr/am/archetype/Archetype.java 2) https://github.com/openEHR/java-libs/blob/master/openehr-rm-core/src/main/java/org/openehr/rm/common/resource/ResourceDescription.java 3) https://github.com/openEHR/java-libs/blob/master/openehr-rm-core/src/main/java/org/openehr/rm/common/resource/AuthoredResource.java

and this: 4) http://www.openehr.org/releases/AM/latest/docs/ADL1.4/ADL1.4.html#_description_section 5) http://www.openehr.org/releases/AM/Release-2.0.6/docs/AOM1.4/AOM1.4.html#_resource_description_class

In 5 is details of kind Hash<String, ResourceDescription>, which is also in analogy with 4, where there is an example. But this conflicts with 1, where there is the code of the Archetype-class which inherits from 3 (where the ResourceDescription is found, which is indeed the ResourceDescription class from 2)

There error also occurs in https://github.com/openEHR/reference-models/blob/master/models/openEHR/Release-1.0.2/XSD/Resource.xsd

ghost commented 7 years ago

I discovered it is more complicated, the parser has the same error, and to repair the grammar requires ancient knowledge of JavaCC. There are not many people on this planet with that knowledge. I think (from the here reading people) best Rong Chen can do that, because he initially created the parser. Or the parser should be replaced by a antlr-parser.

icorbal commented 7 years ago

Hi Bert, Would this be fixed by changing the details parameter of ResourceDescription from List<ResourceDescriptionItem> to Map<String, ResourceDescriptionItem> or am I missing something? Yes, some change would be needed in the adl.jj, but it is minor.

ghost commented 7 years ago

That would be all, yes, Thanks, (don't know your name) icorbal.

(By the way, I tried fixing the grammar but I had trouble with the UTF processing in the grammar-compiler, which opened a new range of problems, but maybe you now how to handle it, maybe it was just a setting I don't know about.)

icorbal commented 7 years ago

I've made an update that contains a fix for this issue and several other things we've been working on.

ghost commented 7 years ago

Thanks, very much.

Best regards Bert Verhees