This document should detail the schema(s) such that the overall design is logical for someone new to OpenEHR and will allow incremental updates and improvements
For example you might have
- A common structures.xsd which contain strucures used through out the rest of the schemas
- An ontology.xsd
- An archetype.xsd
The design should be reasonably modular and logical and Schemas should try and only contain those structures pertinent to them.
Comments (1)
12-Dec-2008
Heath Frankel says:
I have identifed a problem with the DV_QUANTITY/precision elements ability to re...I have identifed a problem with the DV_QUANTITY/precision elements ability to represent the default value. It is currently represented as:
<xs:complexType name="DV_QUANTITY">
<xs:complexContent>
<xs:extension base="DV_AMOUNT">
<xs:sequence>
<xs:element name="magnitude" type="xs:double"/>
<xs:element name="units" type="xs:string"/>
<xs:element name="precision" type="xs:int" default="-1" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Although the default is defined, because elements have a tri-state representation where the element must exist but be nil to indicate use of the default whereas the element not exists means null value and xs:int does not allow an empty element without an xsi:nil="true" attribute.
To allow the use of xsi:nil="true" the schema would need the precision element to have xs:nillable="true". For example:
<xs:element name="precision" type="xs:int" default="-1" minOccurs="0" xs:nillable="true"/>
The alternate approach would be to make precision an attribute of DV_QUNATITY as attributes only have a bi-state representation, if the attribute does not exist it assumes the default. This would also make sense from a "meta-data as attributes schema representation approach" as precision is data about the magnitude. This would result in the following:
<xs:complexType name="DV_QUANTITY">
<xs:complexContent>
<xs:extension base="DV_AMOUNT">
<xs:sequence>
<xs:element name="magnitude" type="xs:double"/>
<xs:element name="units" type="xs:string"/>
</xs:sequence>
<xs:attribute name="precision" type="xs:int" default="-1" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
However this may not be the exact semantics of the RM as precision is 0..1, it needs to be clarified if this optionality intends to assume the default value when the value doesn't exist.