Nedap’s VSCode extension generates OPT2 JSON that has some extra properties (they doesn’t bother me) but uses different names for boolean properties (I have renamed them in my test files):
mandatory (instead of is_mandatory)
specialized (instead of is_specialized)
is_generated does use is_ prefix
build_uid is missing
description.details.language.uri is missing (it is marked as optional in the latest BASE release but not in the openehr_base_110.bmm)
Conclussions:
I believe AWB and Nedap’s VSCode extension are using the latest releases for AOM2 (and BASE). Can you confirm @thomas.beale@pieterbos ?
I don’t know how much time it takes to prepare AOM2 BMM for the “latest” release but if @thomas.beale is willing to do it I’ll test it for all the little inconsistencies like I did with 2.3.0 (most are found by the linter while it analyses the generated code)
Since I generate everything from the BMMs (no manual editing of the source code) I can test many different AOM releases in parallel without extra work. I would be happy to test OPT2 JSON for AOM 2.3.0 if somebody can send them to me (or any other AOM release since 2.0.6).
Same goes for Task Planner if I can get OPT2 JSON files for that.
VS code tool uses ADL 2.1.0, perhaps with some 2.2 features already.
Archie master branch on GitHub is 2.2.0, should contain nearly all 2.3.0 features. Note that 2.3.0 has not been released yet, 2.2.0 nearly (?). I will update ADL version numbers in the Archie output later…
Those Json inconsistencies, the missing is_ plus a bit more, need to be addressed. Probably configurable to ease upgrading. Now that we have a 2.3.0 BMM, I can run the test that compares it with an implementation and see if I missed more. I hope to have a bit more time to address them and release the next major Archie version soon.
Terminology extracts being mandatory, not sure if that should be the case. The Archie opt-creator never fills them in its current version.
I will check build Id and language URI later, could very well be that they should not be mandatory.
I was expecting that “data” will be part of the “definition” property. It is instead inside its “C_COMPLEX_OBJECT” attributes. This is different as other models above.
We know that “definition” has “OBSERVATION” from its “rm_type_name” : “OBSERVATION” property.
I was expecting to use the following code to read “definition” property as “OBSERVATION” from JSON (the same concept as for e.g. “ARCHETYPE_TERMINOLOGY”, “Terminology_code” above):
Edit: “@type” is not needed after all since the “ARCHETYPE.definition” is of type “C_COMPLEX_OBJECT”. The following two lines may be skipped:
Edit2: “@type” is needed for the “attributes.children” properties.
This also means that the “@type” property in Nedap’s JSON is needed.
AWB’s JSON doesn’t have “@type” property to indicate what descendant “C_OBJECT” type is an element of “attributes.children”.
I’ll have to read “OBSERVATION” from the “C_COMPLEX_OBJECT” attributes and not as a first class object with its own properties.
I’ll search for the explanation in the specifications why “OBSERVATION” is stored differently compared to e.g. “ARCHETYPE_TERMINOLOGY”.
Edit:
I checked my generator for the “OBSERVATIONAL_TEMPLATE.definition” property. It skips the “C_COMPLEX_OBJECT.fromJson()” and goes directly to the runtime type specified by the “rm_type_name”.
I have to first read “C_COMPLEX_OBJECT.fromJson()” which will then call “OBSERVATION.fromJson()” based on the “rm_type_name”.
But I’ll probably need “OBSERVATION.fromCComplexObjectAttributes()” since the “OBSERVATION” data is inside “C_COMPLEX_OBJECT.attributes” and not in the direct JSON form specified by “OBSERVATION”.
Well the AOM includes the base bmm directly anyway, so that wouldn’t be right. But I see that the inclusions of base and expressions were around the wrong way - it should have been Expression including Base, not the other way round. This is now fixed, and should validate in Archie & @borut.jures 's framework as well.
Yep - I have not finalised 2.3.0 in fact…
What you are doing here manually is what the ADL Workbench does internally with a bit more code. This is generally necessary, since in a graph of inclusions from some high-level model, things like base inevitably get included by more than one node in the graph. The only way to really do this properly is to process the separate BMMs into memory and handle duplicates there; trying to process the serial form into a equivalent single serial
without going via the in-memory processing is pretty well impossible - you can’t avoid doing the logic of the in-memory processing. I probably should re-engineer that piece of code from ADL Workbench into Java some day…
It validates expressions separately as well, which does not validate because of missing includes. It then tries to include a schema that did not pass validation, which is a separate error in itself, so AOM will fail to validate as well in Archie, unless the include is added of course.
That is actually correct - the Expressions uses the related version of base (1.0.4). You can no doubt get away with allowing it to be base 1.1.0, but formally that is not correct - by BASE Release 1.1.0, that Expressions model is gone.
Fixed.
It is actually in TRANSLATION_DETAILS; but was missing from the BMMs. Fixed.
It is in RESOURCE_DESCRIPTION class; the BMM had an erroneous duplicate in RESOURCE_DESCRIPTION_ITEM, now removed.
It was not in the Base 1.1.0 BMM; fixed.
The error here was that the AOM2.0.6 and the BASE 1.1.0 BMMs had it as mandatory instead of optional; fixed.
Yes - the BMMs are correct here. The UML is not quite correct on this.