On 18/03/2011 11:10, Moretti Leonardo wrote:
> When we define a C_DATE_TIME element like this
> ELEMENT[at0061] occurrences matches {0..1} matches { -- Date/Time element
> value matches {
> DV_DATE_TIME matches {*}
> }
> }
> we said that element at0061 can contains a Date/time value, a date
> only or a time only (indeed Archetype Editor show the label "Allow all").
not quite right - it can only contain a DV_DATE_TIME. Valid
DV_DATE_TIMEs include instances with no time, e.g. '2011-03-18T11'.
According to ISO 8601:2004, date/times with 'reduced accuracy' must
contain a complete date, and at least the hour part of the time. So you
can't have just a date, nor just a time.
>
> From the point of view of RM instances, this means we can have
> <value xsi:type="DV_DATE_TIME">
> <value>2011-03-18T11:01:28</value>
> </value>
>
> but also
>
> <value xsi:type="DV_DATE_TIME">
> <value>2011-03-18</value>
> </value>
this is illegal in ISO 8601 (and therefore openEHR)
>
> and
>
> <value xsi:type="DV_DATE_TIME">
> <value>11:01:28</value>
> </value>
also illegal.
>
> Or for the latter we need to use DV_DATE and DV_TIME rescpectively
> (remember we have defined a C_DATE_TIME constraint in archetype)?
you can technically do the following:
ELEMENT[at0061] occurrences matches {0..1} matches { -- Date/Time element
value matches {
DV_DATE_TIME matches {*}
DV_DATE matches {*}
DV_TIME matches {*}
}
}
but I would suggest that allowing DV_TIME only would be very unusual if
not an error.
- thomas beale*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.openehr.org/mailman/private/openehr-technical_lists.openehr.org/attachments/20110318/c28250bf/attachment.html>