That is indeed an issue. The ADL 2 grammar does allow for exponent notation, but not in that format. From the ADL2 grammar:
INTEGER : DIGIT+ E_SUFFIX? ;
REAL : DIGIT+ '.' DIGIT+ E_SUFFIX? ;
fragment E_SUFFIX : [eE][+-]? DIGIT+ ;
This is the same form as is supported in json, and that should be 1.0e+6
or 1000000.0
.
So the order of the fraction and the exponent segments appear to be reversed. The serialiation Archie uses is the Double::toString method in java. That has a clear specification, as in java 8:Double (Java Platform SE 8 ) or in java 17
Double (Java SE 17 & JDK 17)
That conforms exactly to the correct format. I would also not expect this to ever generate a 10E6, only a 10E7 and greater. So, either I am missing something, or this is a bug in the JVM used, or Archie is not used for this conversion.
I checked the CKM, and that converts this correctly:
DV_QUANTITY[id9002] matches {
property matches {[at9000]} -- Mass
[magnitude, units] matches {
[{|0.0..1000.0|}, {"kg"}],
[{|0.0..2000.0|}, {"[lb_av]"}],
[{|0.0..1000000.0|}, {"g"}]
}
}
From Observation Archetype: Body weight [openEHR Clinical Knowledge Manager] , select adl 2 with the radio button at the bottom. The generated id code, id29, also suggests that Archie was not used in conversion, or that it was converted using very strange custom settings. Because id29 is likely to conflict with future codes in ADL 1.4, and id9002 is not.
So @thomas.beale , how did you obtain this archetype? Could it be that this was converted using either the ADL workbench or the Better archetype designer? Those do not use Archie for conversion.