# opereffa ArchetypeWrapper and unit types **Category:** [Technical (archive)](https://discourse.openehr.org/c/technical-archive/156) **Created:** 2011-01-11 17:16 UTC **Views:** 3 **Replies:** 2 **URL:** https://discourse.openehr.org/t/opereffa-archetypewrapper-and-unit-types/15034 --- ## Post #1 by @Paria_Kashfi Hello, As far as I understand, in opereffa, **unit** of an item is not retreived from the ADL file and should be set manually like : pArchetypeWrapper.getElementAtNode(path).setUnitOfQuantity(....); Am I missing something here, or is it the way it works? I think since the unit and type of each item is already stored in the ADL file, while parsing the ADL file to the ArchetypeWrapper, these types of information should be set automatically in ElementWrappers in that ArchetypeWrapper. Best Regards Pariya MSc; PhD Candidate Department of Computing Science and Engineering Chalmers University of Technology [http://www.ait.gu.se/kontaktaoss/personal/hajar-kashfi/](http://www.ait.gu.se/kontaktaoss/personal/hajar-kashfi/) --- ## Post #2 by @Seref Hi Pariya, An archetype may introduce a constraint so that during the recording of data, you may use a quantity and one of the allowed units. Just think about the difference between Fahrenheit and Celsius degrees (Thomas Beale's example). Wrappers do have access to ADL, but in these kind of situations, ADL provides more than one option, so the wrapper can't know which unit it is going to use. If there is only one option, the wrapper should automatically use that. I don't think I've added that convenience, so that is probably what got you confused. Kind regards Seref --- ## Post #3 by @Paria_Kashfi Hi Seref, Thank you for the explanation. I actually had forgotten than it may be more than one unit for an item in an archetype. What you mentioned here does make sense to me now. As I understood, for the moment, nothing is retrieved from the ADL. What is the suggested run time approach? Should the unit be set in the application layer then? for instance as an attribute of the input in the view layer or so. Best Regards Pariya MSc; PhD Candidate Department of Computing Science and Engineering Chalmers University of Technology [http://www.ait.gu.se/kontaktaoss/personal/hajar-kashfi/](http://www.ait.gu.se/kontaktaoss/personal/hajar-kashfi/) --- **Canonical:** https://discourse.openehr.org/t/opereffa-archetypewrapper-and-unit-types/15034 **Original content:** https://discourse.openehr.org/t/opereffa-archetypewrapper-and-unit-types/15034