hi Technically, it's not empty, it just has a default unit of unity (i.e. a unitless amount). At least this is how it is in HL7. I would've thought the same arrangement is appropriate for openEHR
Grahame Sam Heard wrote: > Hi All > > > > We do have some strange history to deal with here that includes reals in HL7 > with no units PQ. So we need the ability to have a blank unit. This is a > reality and I don?t think the solution is to make that impossible unless > there is a clear way forward to deal with labs that do not have units. > > > > Cheers, Sam > > > > From: openehr-technical-bounces at openehr.org > [mailto:openehr-technical-bounces at openehr.org] On Behalf Of Thomas Beale > Sent: Tuesday, 10 February 2009 1:43 AM > To: For openEHR technical discussions > Subject: Re: CQuantityItem.units not empty > > > > > Hi Tony, > > I just tested this in the latest ADL workbench, and it passes there as well, > because we erroneously don't check the length of the string, even though we > do have the invariant set correctly (but of course it isn't being executed > in production copies of the system) - see > http://www.openehr.org/svn/ref_impl_eiffel/BRANCHES/specialisation/libraries > /openehr/src/am/openehr_profile/data_types/quantity/c_quantity_item.e > > I will correct this in the parser. Which archetype did you find this on? > > - thomas beale > > Tony Fran?a wrote: > > Hi all. > > > > I?m working in the archetype validation alghoritm of the zilics models (more > on this thread --> > http://www.openehr.org/mailarchives/ref_impl_java/msg00975.html). > > I ran into a little problem, and I?d like to hear your thoughts. > > > > The specification for the C_QUANTITY_ITEM class states that the "units" > field is valid when: > > units_valid: units /= Void and not units.is_empty, in other (java) words: > units != null && units.size() > 0 > > > > Ocean?s Archetype editor lets you create a Quantity Item as a Qualified > real, without any units. > > The ADL it generates for such an item is like: > > > > ELEMENT[at0005] occurrences matches {0..1} matches { -- INR > > value matches { > > C_DV_QUANTITY < > > property = <[openehr::380]> > > list = < > > ["1"] = < > > units = <""> > > magnitude = <|>=0.0|> > > precision = <|0|> > > > > > > > > > > > } > > } > > > > For such an archetype, validation fails because the parsed Archetype object > will have a CQuantityItem > > object having units = [empty list] > > > > > > > > So, > > which one is wrong? The archetype or the validation alghorithm? > > Should > > I just avoid creating archetypes with Quantity items with no units? > > If > > so, should Archetype editor prevent the user from creating such an item? > > > > > > > > Cheers! > > Tony > > L?mpada > > > > > > _____ > > > > > _______________________________________________ > openEHR-technical mailing list > openEHR-technical at openehr.org > http://lists.chime.ucl.ac.uk/mailman/listinfo/openehr-technical > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > openEHR-technical mailing list > openEHR-technical at openehr.org > http://lists.chime.ucl.ac.uk/mailman/listinfo/openehr-technical