Changes between Initial Version and Version 1 of Support Information Model 3 Assumed Types


Ignore:
Timestamp:
Aug 27, 2008, 8:27:21 PM (16 years ago)
Author:
KOBAYASHI, Shinji
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Support Information Model 3 Assumed Types

    v1 v1  
     1== Assumed Types == #LinkTarget_16093
     2=== 3.1 Overview === #LinkTarget_16095
     3This section describes types assumed by all openEHR models. The set of types chosen here is based on a common set from various published sources, including:
     4
     5 * ISO 11404 (2003 revision) general purpose data types;
     6 * ISO 8601 (2004) date/time specification;
     7 * Well-known interoperability formalisms, including OMG IDL, W3C XML-schema;
     8 * Well-known object-oriented programming languages, including Java, C#, C++ and Eiffel.
     9
     10The intention in openEHR is twofold. Firstly, to ensure that openEHR software based on the models integrates as easily as possible with existing implementation technologies, and secondly, to make the minimum possible assumptions about types found in implementation formalisms, while making sufficient assumptions to both enable openEHR models to be conveniently specified. The ISO 11404 (2003) standard contains basic semantics of “general purpose data types” (GPDs) for information technology, and is used here as a normative basis for describing assumptions about types. The operations and properties described here are compatible with those used in ISO 11404, but not always the same, as 11404 does not use object-oriented functions. For example, the notional function has(!x:T) (test for presence of a value in a set) defined on the type Set<T> below is not defined on the ISO 11404 Set type; instead, the function !IsIn(x: T; s: Set<T>) is defined. However, in object-oriented formalisms, the function !IsIn defined on a Set type would usually mean ‘subset of’. In the interests of clarity for developers, an object-oriented style of functions and properties has been used here.
     11
     12!ISO8601:2004 is used as the definitional basis for assumed date/time types, since it is commonly used [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_16711 around the world, and is also the basis for the date/time types in W3C XML-schema. See section 3.4] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_16711 on page 22]  below for details of dates and times.
     13
     14Two groups of assumed types are identified: primitive types, which are those built in to a formalism’s type system, and library types, which are assumed to be available in a (class) library defined in the formalism. Thus, the type Boolean is always assumed to exist in a formalism, while the type Array<T> is assumed to be available in a library. For practical purposes, these two categories do not matter that much - whether String is really a library class (the usual case) or an inbuilt type doesn’t make much difference to the programmer. They are shown separately here mainly as an explanatory convenience.
     15
     16The assumptions that openEHR makes about existing types are documented below in terms of interface definitions. Each of these definitions contains only the assumptions required for the given type to be used in the openEHR Reference Model -it is not by any means a complete interface definition. The name and semantics of any function used here for an assumed type might not be identical to those found in some implementation technologies. Any mapping required should be stated in the relevant implementation technology specification (ITS). To give a concrete example, where the assumed Set<T> type defined below has an operation has(item: T): Boolean which is used throughout the openEHR specifications, Java has the method contains() on its Set<T> class. In a Java implementation, the contains() method should then be used throughout the openEHR classes as expressed in Java, in place of the has() method.
     17
     18[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 13 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     19
     20  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     21
     22Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     23
     24=== 3.2 Inbuilt Primitive Types === #LinkTarget_16135
     25The following types consititute the minimum set of primitive types assumed by openEHR of an implementation formalism.
     26
     27||Type name in openEHR||Description||ISO 11404 Type||
     28||Octet||represents a type whose value is an 8-bit value.||Octet||
     29||Character||represents a type whose value is a member of an 8-bit character-set (ISO: “repertoire”).||Character||
     30||Boolean||represents logical True/False values; usually physically represented as an integer, but need not be||Boolean||
     31||||||||
     32||Integer||represents 32-bit integers||Integer||
     33||Real||represents 32-bit real numbers in any interoperable representation, including single-width IEEE floating point||Real||
     34||Double||type which represents 64-bit real numbers, in any interoperable representation including double-precision IEEE floating point.||Real||
     35
     36[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_16193 FIGURE 2]  illustrates the built-in primitive types. Simple inheritance relationships are shown which facilitate the type descriptions below. A class “Any” is used to stand for the usual top-level class in all object-oriented type systems, typically called something like “Any” or “Object”. Inheritance from or subsitutability for an Any class is not assumed in openEHR (hence the dotted lines in the UML). It is used here to enable basic operations like ‘=’ to be described once for the type Any, rather than in every subtype. The type Ordered_numeric is on the other hand assumed for purposes of specification in the openEHR data_types.quantity package, and is intended to be mapped to an equivalent type in a real type system (e.g. in Java, java.lang.Number). Here it is assumed that the operations defined on Ordered_numericare available on the types Integer, Realand Double in implementation type systems, where relevant. Data-oriented implementation type systems such as XML-schema do not have such operations.
     37
     38''Any ''
     39
     40==== Octet ====
     41Character
     42
     43Boolean
     44
     45''Ordered ''
     46
     47''Numeric ''
     48
     49''Ordered_numeric ''
     50
     51FIGURE 2  Primitive Types Assumed by openEHR
     52
     53Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 14 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     54
     55[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     56
     57[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Assumed Types Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     58
     593.2.1 Any Type
     60
     61||INTERFACE||Any (abstract)||
     62||Description||Abstract supertype. Usually maps to a type like “Any” or “Object” in an object system. Defined here to provide the value and reference equality semantics.||
     63||Abstract||Signature||Meaning||
     64||||is_equal (other: Any): Boolean||Value equality||
     65||Functions||Signature||Meaning||
     66||||infix ‘=’ (other: Any): Boolean||Reference equality||
     67||||instance_of (a_type: String)||Dynamic type of object as a String. Used for type name matching.||
     68||Invariants||||
     69
     703.2.2 Ordered Type
     71
     72||INTERFACE||Ordered (abstract)||
     73||Purpose||Abstract notional parent class of ordered, types i.e. types on which the ‘<‘ operator is defined.||
     74||Abstract||Signature||Meaning||
     75||||infix ‘<’ (other: like Current): Boolean||Arithmetic comparison. In conjunction with ‘=’, enables the definition of the operators ‘>’, ‘>=’, ‘<=’, ‘<>’. In real type systems, this operator might be defined on another class for comparability.||
     76||Invariants||||
     77
     783.2.3 Numeric Type
     79
     80||INTERFACE||Numeric (abstract)||
     81||Purpose||Abstract notional parent class of numeric types, which are types which have various arithmetic and comparison operators defined.||
     82||Abstract||Signature||Meaning||
     83
     84[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 15 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     85
     86  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     87
     88Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     89
     90||INTERFACE||Numeric (abstract)||
     91||||infix "*" (other: like Current): like Current require other_exists: other /= void ensure result_exists: Result /= void||Product by `other'. Actual type of result depends on arithmetic balancing rules.||
     92||||infix "+" (other: like Current): like Current require other_exists: other /= void ensure result_exists: Result /= void commutative: equal (Result, other + Current)||Sum with `other' (commutative). Actual type of result depends on arithmetic balancing rules.||
     93||||infix "-" (other: like Current): like Current require other_exists: other /= void ensure result_exists: Result /= void||Result of subtracting `other'. Actual type of result depends on arithmetic balancing rules.||
     94||Invariants||||
     95
     963.2.4 Ordered_numeric Type
     97
     98||INTERFACE||Ordered_numeric (abstract)||
     99||Purpose||Abstract notional parent class of ordered, numeric types, which are types with ‘<‘ and arithmetic operators defined.||
     100||Inherit||ORDERED, NUMERIC||
     101||Function||Signature||Meaning||
     102||Invariants||||
     103
     1043.2.5 Boolean Type
     105
     106||INTERFACE||Boolean||||
     107||Purpose||Boolean type used for two-valued mathematical logic.||||
     108||Function||Signature||||Meaning||
     109
     110Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 16 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     111
     112[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     113
     114[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Assumed Types Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     115
     116  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     117
     118||INTERFACE||Boolean||
     119||||infix "and" (other: Boolean): Boolean require other_exists: other /= void ensure de_morgan: Result = not (not Current or not other) commutative: Result = (other and Current)||Logical conjunction||
     120||||infix "and then" (other: Boolean): Boolean require other_exists: other /= void ensure de_morgan: Result = not (not Current or else not other)||Boolean semi-strict conjunction with other||
     121||||infix "or" (other: Boolean): Boolean require other_exists: other /= void ensure de_morgan: Result = not (not Current and not other) commutative: Result = (other or Current) consistent_with_semi_strict: Result implies (Current or else other)||Boolean disjunction with other||
     122||||infix "or else" (other: Boolean): Boolean require other_exists: other /= void ensure de_morgan: Result = not (not Current and then not other)||Boolean semi-strict disjunction with `other'||
     123||||infix "xor" (other: Boolean): Boolean require other_exists: other /= void ensure definition: Result = ((Current or other) and not (Current and other))||Boolean exclusive or with `other'||
     124
     125[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 17 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     126
     127Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     128
     129||INTERFACE||Boolean||
     130||||infix "implies" (other: Boolean): Boolean require other_exists: other /= void ensure definition: Result = (not Current or else other)||Boolean implication of `other' (semi-strict)||
     131||Invariants||involutive_negation: is_equal (not (not Current)) non_contradiction: not (Current and (not Current)) completeness: Current or else (not Current)||
     132
     1333.2.6 Real Type
     134
     135||INTERFACE||Real||
     136||Purpose||Type used to represent decimal numbers. Typically corresponds to a single-precision floating point value in most languages.||
     137||Function||Signature||Meaning||
     138||||floor: Integer||Return the greatest integer no greater than the value of this object.||
     139||Invariants||||
     140
     141=== 3.3 Assumed Library Types === #LinkTarget_16425
     142The types described in this section are also assumed to be fairly standard in implementation technologies by openEHR, but usually come from type libraries rather than being built into the type system of implementation formalisms.
     143
     144||Type name in openEHR||Description||ISO 11404: 2003 Type||
     145||String||represents unicode-enabled strings||Character-String/Sequence||
     146||Array<T>||physical container of items indexed by number||Array||
     147||List<T>||container of items, implied order, non-unique membership||Sequence||
     148||Set<T>||container of items, no order, unique membership||Set||
     149||Hash<T,!U:Comparable>||a table of values of any type T, keyed by values of any basic comparable type U, typically String or Integer, but may be more complex types, e.g. a coded term type.||Table||
     150||Interval<T>||Intervals with open or closed upper and lower bounds.||-||
     151
     152Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 18 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     153
     154[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     155
     156[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Assumed Types Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     157
     158[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_16487 FIGURE 3 illustrates the assumed library types. As with the assumed primitive types, inheritance and] abstract classes are used for convenience of the definitions below, but are not formally assumed in openEHR.
     159
     160''Any ''
     161
     162T
     163
     164T->Ordered
     165
     166''Aggregate''
     167
     168==== String ====
     169Interval
     170
     171FIGURE 3  Library Types Assumed by openEHR
     172
     1733.3.1 String Type
     174
     175||INTERFACE||String||
     176||Description||Strings of characters, as used to represent textual data in any natural or formal language.||
     177||Functions||Signature||Meaning||
     178||||infix ‘+’ (other: String): String||Concatenation operator - causes ‘other’ to be appended to this string||
     179||||is_empty: Boolean||True if string is empty, i.e. equal to “”.||
     180||||is_integer: Boolean||True if string can be parsed as an integer.||
     181||||as_integer: Integer require is_integer||Return the integer corresponding to the integer value represented in this string.||
     182||Invariants||||
     183
     184==== 3.3.1.1 UNICODE ==== #LinkTarget_16522
     185It is assumed in the openEHR specifications that Unicode is supported by the type String. Unicode is needed for all Asian, Arabic and other script languages, for both data values (particularly plain text and coded text) and for many predefined string attributes of the classes in the openEHR Reference Model. It encompasses all existing character sets. In openEHR, UTF-8 encoding is assumed.
     186
     187=== 3.3.2 Aggregate Type === #LinkTarget_16525
     188Abstract parent of of the aggregate types List<T>, Set<T>, Array<T> and Hash<T,K>.
     189
     190[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 19 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     191
     192  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     193
     194Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     195
     196||INTERFACE||Aggregate <T> (abstract)||
     197||Functions||Signature||Meaning||
     198||||has (v: T): Boolean||Test for membership of a value||
     199||||count: Integer||Number of items in container||
     200||||is_empty: Boolean||True if container is empty.||
     201||Invariants||||
     202
     2033.3.3 List Type
     204
     205||INTERFACE||List <T> (abstract)||
     206||Description||Ordered container that may contain duplicates.||
     207||Functions||Signature||Meaning||
     208||||first: T||Return first element.||
     209||||last: T||Return last element.||
     210||Invariants||First_validity: not is_empty implies first /= Void Last_validity: not is_empty implies last /= Void||
     211
     2123.3.4 Set Type
     213
     214||INTERFACE||Set <T> (abstract)||
     215||Description||Unordered container that may not contain duplicates.||
     216||Functions||Signature||Meaning||
     217||Invariants||||
     218
     2193.3.5 Array Type
     220
     221||INTERFACE||Array <T> (abstract)||
     222||Description||Container whose storage is assumed to be contiguous.||
     223||Functions||Signature||Meaning||
     224||Invariants||||
     225
     226Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 20 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     227
     228[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     229
     230[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Assumed Types Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     231
     2323.3.6 Hash Type
     233
     234||INTERFACE||Hash <T, U: Comparable>||
     235||Description||Type representing a keyed table of values. T is the value type, and U the type of the keys.||
     236||Functions||Signature||Meaning||
     237||||has_key (a_key: U): Boolean||Test for membership of a key||
     238||||item (a_key: U): T||Return item for key ‘a_key’. Equivalent to ISO 11404 fetch operation.||
     239||Invariants||||
     240
     2413.3.7 Interval Type
     242
     243||INTERFACE||Interval <!T:Ordered>||
     244||Purpose||Interval of ordered items.||
     245||Attributes||Signature||Meaning||
     246||||lower: T||lower bound||
     247||||upper: T||upper bound||
     248||||lower_unbounded: Boolean||lower boundary open (i.e. = -infinity)||
     249||||upper_unbounded: Boolean||upper boundary open (i.e. = +infinity)||
     250||||lower_included: Boolean||lower boundary value included in range if not lower_unbounded||
     251||||upper_included: Boolean||upper boundary value included in range if not upper_unbounded||
     252||Functions||Signature||Meaning||
     253||||has(e:T): Boolean||True if (lower_unbounded or ((lower_included and v >= lower) or v > lower)) and (upper_unbounded or ((upper_included and v <= upper or v < upper)))||
     254
     255[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 21 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     256
     257  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     258
     259Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     260
     261Lower_included_valid: lower_unbounded implies not lower_included Upper_included_valid: upper_unbounded implies not upper_included Limits_consistent: (not upper_unbounded and not lower_unbounded) implies lower <= upper Limits_comparable: (not upper_unbounded and not lower_unbounded) implies lower.strictly_comparable_to(upper)
     262
     263=== 3.4 Date/Time Types === #LinkTarget_16711
     264Although the ISO 11404 (2003) standard defines a date-and-time type generator (section 8.1.6), and a timeinterval type (section 10.1.6), a more widely used specification of date/times is given by ISO !8601:2004, which is used as the normative basis for both string literal representation and properties used within openEHR. The types are shown in [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_16718 FIGURE 4.]
     265
     266''Any ''
     267
     268''Ordered ''
     269
     270TIME_DEFINITIONS
     271
     272ISO 8601 semantics not used in openEHR include:
     273
     274 * “expanded” dates, which have year numbers of greater than 4 digits, and may be negative; in openEHR, only 4-digit year numbers are assumed;
     275 * the YYYY-WW-DD method of expressing dates (since this is imprecise and difficult to compute with due to variable week starting dates, and not required in health);
     276 * partial date/times with fractional minutes or hours, e.g. hh,hhh or mm,mm; in openEHR, only fractional seconds are supported;
     277 * the interval syntax. Intervals of date/times are supported in openEHR, but their syntax form is defined by ADL, and is standardised across all comparable types, not just dates and times.
     278
     279==== Deviations from the published standard include the following: ====
     280 * durations are supposed to take the form of PnnW or PnnYnnMnnDTnnHnnMnnS, but in openEHR, the W (week) designator can be used in combination with the other designators, since it is very common to state durations of pregnancy as some combination of weeks and days.
     281 * partial variants of ISO8601_DATE_TIME can include missing hours, days and months, whereas ISO !8601:2004 (section 4.3.3 c) only allows missing seconds and minutes. The reasons for this deviation are:
     282
     283Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 22 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     284
     285[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     286
     287[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Assumed Types Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     288
     289-the same deviation is used in HL7v2 and HL7v3 TS (timestamp) type, i.e. there are data in existing clinical systems matching this specification;
     290
     291-in a typed object model, this deviation is more sensible anyway; the ISO 8601 rule is most likely a limitation of the purely syntactic means of expression. In real systems where a timestamp/date-time is specified in a screen form, it makes sense to allow it to be as partial as possible, rather than artifically restricted to only missing seconds and minutes.
     292
     293•         the time !24:00:00 (or 240000) is not allowed anywhere, whereas in !ISO8601:2004 it appears to be legal at least for times. This deviation is also appears to be used in HL7v2 and HL7v3 (where midnight is defined as the time !00:00:00), and is preferable to the documented standard, since a date/time with time of !24:00:00 is really the next day, i.e. the date part is then incorrect.
     294
     295The following class definitions provide an object-oriented expression of the semantics of the subset of ISO !8601:2004 used by openEHR.
     296
     297See [http://www.cl.cam.ac.uk/%7Emgk25/iso-time.html http://www.cl.cam.ac.uk/~mgk25/iso-time.html]  and the official ISO standard for ISO 8601 details. Note that in the date, time and date_time formats shown below, ‘Z’ and ‘T’ are literals. In the duration class shown below, ‘P’, ‘Y’, ‘M’, ‘W’, ‘D’, ‘H’, ‘S’ and ‘T’ are literals.
     298
     2993.4.1 TIME_DEFINITIONS Class
     300
     301  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     302
     303||INTERFACE||TIME_DEFINITIONS||
     304||Purpose||Definitions for date/time classes. Note that the timezone limits are set by where the international dateline is. Thus, time in New Zealand is quoted using !+12:00, not !-12:00.||
     305||Constants||Signature||Meaning||
     306||1..1||Seconds_in_minute: Integer = 60||||
     307||1..1||Minutes_in_hour: Integer = 60||||
     308||1..1||Hours_in_day: Integer = 24||||
     309||1..1||Nominal_days_in_month: Real = 30.42||Used for conversions of durations containing months to days and / or seconds.||
     310||1..1||Max_days_in_month: Integer = 31||Used for validity checking.||
     311||1..1||Days_in_year: Integer = 365||||
     312||1..1||Days_in_leap_year: Integer = 366||||
     313||1..1||Max_days_in_year: Integer = Days_in_leap_year||Used for validity checking.||
     314
     315[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 23 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     316
     317Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     318
     319[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     320
     321||INTERFACE||TIME_DEFINITIONS||
     322||1..1||Nominal_days_in_year: Real = 365.24||Used for conversions of durations containing years to days and / or seconds.||
     323||1..1||Days_in_week: Integer = 7||||
     324||1..1||Months_in_year: Integer = 12||||
     325||1..1||Min_timezone_hour: Integer ensure Result = 12||Minimum hour value of a timezone (note that the -ve sign is supplied in the ISO8601_TIMEZONE class).||
     326||1..1||Max_timezone_hour: Integer ensure Result = 13||Maximum hour value of a timezone.||
     327||Functions||Signature||Meaning||
     328||||valid_year (y: Integer): Boolean ensure Result = y >= 0||True if y >= 0||
     329||||valid_month (m: Integer): Boolean ensure Result = m >= 1 and m <= Months_in_year||True if m >= 1 and m <= Months_in_year||
     330||||valid_day (y, m, d: Integer): Boolean ensure Result = d >= 1 and d <= days_in_month(m, y)||True if d >= 1 and d <= days_in_month(m, y)||
     331||||valid_hour (h, m, s: Integer): Boolean ensure Result = (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0)||True if (h >= 0 and h < Hours_in_day) or (h = Hours_in_day and m = 0 and s = 0)||
     332||||valid_minute (m: Integer): Boolean ensure Result = m >= 0 and m < Minutes_in_hour||True if m >= 0 and m < Minutes_in_hour||
     333
     334Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 24 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     335
     336[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Assumed Types Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     337
     338||INTERFACE||TIME_DEFINITIONS||
     339||||valid_second (s: Integer): Boolean ensure Result = s >= 0 and s < Seconds_in_minute||True if s >= 0 and s < Seconds_in_minute||
     340||||valid_fractional_second (fs: Double): Boolean ensure Result = fs >= 0.0 and fs < 1.0||True if fs >= 0.0 and fs < 1.0||
     341||Invariants||||
     342
     3433.4.2 ISO8601_DATE Class
     344
     345  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     346
     347||INTERFACE||ISO8601_DATE||
     348||Purpose||Represents an absolute point in time, as measured on the Gregorian calendar, and specified only to the day.||
     349||Inherit||ORDERED, TIME_DEFINITIONS||
     350||Function||Signature||Meaning||
     351||||as_string: String||ISO8601 string for date, in format YYYYMMDD or YYYY-MM-DD, or a partial invariant. See valid_iso8601_date for validity.||
     352||||year: Integer||Year.||
     353||||month: Integer require not month_unknown||Month in year.||
     354||||day: Integerrequire not day_unknown||Day in month.||
     355||||month_unknown: Boolean||Indicates whether month in year is unknown. If so, the date is of the form “YYYY”.||
     356||||day_unknown: Boolean||Indicates whether day in month is unknown. If so, and month is known, the date is of the form “YYYY-MM” or “YYYYMM”.||
     357||||is_partial: Boolean||True if this date is partial, i.e. if day or more is missing.||
     358
     359[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 25 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     360
     361Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     362
     363||INTERFACE||ISO8601_DATE||
     364||||is_extended: Boolean||True if this date uses ‘-’ separators.||
     365||||infix ‘<’ (other: like Current): Boolean||Arithmetic comparison with other date. True if this date is closer to the origin than other.||
     366||||valid_iso8601_date||String is a valid ISO 8601 date, i.e. takes the||
     367||||(s: String): Boolean||complete form: • YYYYMMDD or the extended form: • YYYY-MM-DD or one of the partial forms: • YYYYMM • YYYY or the equivalent extended form: • YYYY-MM Where: • YYYY is the string form of any positive number in the range “0000” - “9999” (zero-filled to four digits) • MM is “01” “12” (zero-filled to two digits) • DD is “01” - “31” (zero-filled to two digits) The combinations of YYYY, MM, DD numbers must be correct with respect to the Gregorian calendar.||
     368||Invariants||Year_valid: valid_year(year) Month_valid: not month_unknown implies valid_month(month) Day_valid: not day_unknown implies valid_day(year, month, day) Partial_validity: month_unknown implies day_unknown||
     369
     3703.4.3 ISO8601_TIME Class
     371
     372||INTERFACE||ISO8601_TIME||
     373||Purpose||Represents an absolute point in time from an origin usually interpreted as meaning the start of the current day, specified to the second. A small deviation to the ISO !8601:2004 standard in this class is that the time !24:00:00 is not allowed, for consistency with ISO8601_DATE_TIME.||
     374||Inherit||ORDERED, TIME_DEFINITIONS||
     375||Function||Signature||Meaning||
     376
     377Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 26 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     378
     379[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     380
     381[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Assumed Types Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     382
     383||INTERFACE||||ISO8601_TIME||
     384||||as_string: String||||ISO8601 string for time, i.e. in form: hhmmss[,sss][Z|±hh[mm]] or the extended form: hh:mm:ss[,sss][Z|±hh[mm]], or a partial invariant. See valid_iso8601_time for validity.||
     385||||hour: Integer||||Hour in day, in 24-hour time.||
     386||||minute: Integer require not minute_unknown||||Minute in hour.||
     387||||second: Integer require not second_unknown||||Second in minute.||
     388||||fractional_second: Double require not second_unknown||||Fractional seconds.||
     389||||has_fractional_second: Boolean||||True if the fractional_second part is signficant (i.e. even if = 0.0).||
     390||||timezone: ISO8601_TIMEZONE minute_unknown: Boolean||||Time zone; may be Void. Indicates whether minute is unknown. If so, the time is of the form “hh”.||
     391||||
     392||||second_unknown: Boolean||||Indicates whether second is unknown. If so and month is known, the time is of the form “!hh:mm” or “hhmm”.||
     393||||is_partial: Boolean||||True if this time is partial, i.e. if seconds or more is missing.||
     394||||is_extended: Boolean||||True if this time uses ‘:’ separators.||
     395||||is_decimal_sign_comma: Boolean||||True if this time has a decimal part indicated by ‘,’ (comma) rather than ‘.’ (period).||
     396||||infix ‘<’ (other: like Current): Boolean||||Arithmetic comparison with other time. True if this date is closer to previous midnight than other.||
     397
     398[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 27 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     399
     400  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     401
     402Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     403
     404||INTERFACE||ISO8601_TIME||
     405||||valid_iso8601_time||String is a valid ISO 8601 date, i.e. takes the||
     406||||(s: String): Boolean||form: • hhmmss[,sss][Z | ±hh[mm]] or the extended form: • !hh:mm:ss[,sss][Z | ±hh[mm]] or one of the partial forms: • hhmm or hh or the extended form: • !hh:mm with an additional optional timezone indicator of: • Z or ±hh[mm] Where: • hh is “00” - “23” (0-filled to two digits) • mm is “00” - “59” (0-filled to two digits) • ss is “00” - “60” (0-filled to two digits) • sss is any numeric string, representing an optional fractional second • Z is a literal meaning UTC (modern replacement for GMT), i.e. timezone +0000 • ±hh[mm], i.e. +hhmm, +hh, -hhmm, -hh indicating the timezone.||
     407||Invariants||Hour_valid: valid_hour(hour, minute, second) Minute_valid: not minute_unknown implies valid_minute(minute) Second_valid: not second_unknown implies valid_second(second) Fractional_second_valid: has_fractional_second implies (not second_unknown and valid_fractional_second(fractional_second)) Partial_validity: minute_unknown implies second_unknown||
     408
     4093.4.4 ISO8601_DATE_TIME Class
     410
     411||INTERFACE||ISO8601_DATE_TIME||
     412||Purpose||Represents an absolute point in time, specified to the second. Note that this class includes 2 deviations from ISO !8601:2004: • for partial date/times, any part of the date/time up to the month may be missing, not just seconds and minutes as in the standard; • the time !24:00:00 is not allowed, since it would mean the date was really on the next day.||
     413||Inherit||ORDERED, TIME_DEFINITIONS||
     414||Function||Signature||Meaning||
     415
     416Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 28 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     417
     418[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     419
     420[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Assumed Types Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     421
     422  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     423
     424||INTERFACE||ISO8601_DATE_TIME||
     425||||as_string: String ensure valid_iso8601_date_time(Result)||ISO8601 string for date/time, in format YYYYMMDDThhmmss[,sss][Z | ±hh[mm]] or in extended format !YYYY-MM-DDThh:mm:ss[,sss][Z | ±hh[mm]] or a partial variant; see valid_iso8601_date_time() below.||
     426||||year: Integer||year||
     427||||month: Integerrequire not month_unknown||month in year||
     428||||day: Integerrequire not day_unknown||day in month||
     429||||hour: Integerrequire not hour_unknown||hour in day||
     430||||minute: Integer require not minute_unknown||minute in hour||
     431||||second: Integerrequire not second_unknown||second in minute||
     432||||fractional_second: Double require has_fractional_second||fractional seconds||
     433||||has_fractional_second: Boolean||True if the fractional_second part is signficant (i.e. even if = 0.0).||
     434||||timezone: ISO8601_TIMEZONE||Timezone; may be Void.||
     435||||month_unknown: Boolean||Indicates whether month in year is unknown.||
     436||||day_unknown: Boolean||Indicates whether day in month is unknown.||
     437||||hour_unknown: Boolean||Indicates whether hour in day is known.||
     438||||minute_unknown: Boolean||Indicates whether minute in hour is known.||
     439||||second_unknown: Boolean||Indicates whether minute in hour is known.||
     440||||is_partial: Boolean||True if this date is partial, i.e. if seconds or more is missing.||
     441
     442[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 29 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     443
     444Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     445
     446||INTERFACE||ISO8601_DATE_TIME||
     447||||is_decimal_sign_comma: Boolean||True if this time has a decimal part indicated by ‘,’ (comma) rather than ‘.’ (period).||
     448||||infix ‘<’ (other: like Current): Boolean||Arithmetic comparison with other date/time. True if this date/time is closer to origin than other.||
     449||||is_extended: Boolean||True if this date/time uses ‘-’, ‘:’ separators.||
     450||||valid_iso8601_date_time||String is a valid ISO 8601 date-time, i.e.||
     451||||(s: String): Boolean||takes the form: • YYYYMMDDThhmmss[,sss] [Z | ±hh[mm]] or the extended form: • !YYYY-MM-DDThh:mm:ss[,sss] [Z | ±hh[mm]] or one of the partial forms: • YYYYMMDDThhmm • YYYYMMDDThh or the equivalent extended forms: • !YYYY-MM-DDThh:mm • YYYY-MM-DDThh (meanings as in DV_DATE, DV_TIME) and the values in each field are valid.||
     452||Invariants||Year_valid: valid_year(year) Month_valid: valid_month(month) Day_valid: valid_day(year, month, day) Hour_valid: valid_hour(hour, minute, second) Minute_valid: not minute_unknown implies valid_minute(minute) Second_valid: not second_unknown implies valid_second(second) Fractional_second_valid: has_fractional_second implies (not second_unknown and valid_fractional_second(fractional_second)) Partial_validity_year: not month_unknown Partial_validity_month: not month_unknown Partial_validity_day: not day_unknown Partial_validity_hour: not hour_unknown Partial_validity_minute: minute_unknown implies second_unknown||
     453
     4543.4.5 ISO8601_TIMEZONE Class
     455
     456Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 30 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     457
     458[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     459
     460[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Assumed Types Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     461
     462||INTERFACE||ISO8601_TIMEZONE||
     463||Inherit||TIME_DEFINITIONS||
     464||Function||Signature||Meaning||
     465||||as_string: String||ISO8601 timezone string, in format • Z | ±hh[mm] where: • hh is “00” - “23” (0-filled to two digits) • mm is “00” - “59” (0-filled to two digits) • Z is a literal meaning UTC (modern replacement for GMT), i.e. timezone +0000||
     466||||hour: Integer||Hour part of timezone - in the range 00 - 13||
     467||||minute: Integer require not minute_unknown||Minute part of timezone. Generally 00 or 30.||
     468||||sign: Integer||Direction of timezone expresssed as +1 or -1.||
     469||||is_gmt: Boolean||True if timezone is UTC, i.e. +0000||
     470||||minute_unknown: Boolean||Indicates whether minute part known.||
     471||Invariants||Min_hour_valid: sign = -1 implies hour > 0 and hour <= Min_timezone_hour Max_hour_valid: sign = 1 implies hour > 0 and hour <= Max_timezone_hour Minute_valid: not minute_unknown implies valid_minute(minute) Sign_valid: sign = 1 or sign = -1||
     472
     4733.4.6 ISO8601_DURATION Class
     474
     475||INTERFACE||ISO8601_DURATION||
     476||Purpose||Represents a period of time corresponding to a difference between two time-points.||
     477||Inherit||ORDERED, TIME_DEFINITIONS||
     478||Function||Signature||Meaning||
     479||||as_string: String||ISO8601 string for duration, in format • P[nnY][nnM][nnW][nnD][T[nnH][nnM][nnS]]||
     480||||years: Integer||number of years of nominal 365-day length||
     481||||months: Integer||number of months of nominal 30 day length||
     482||||weeks: Integer||number of 7 day weeks||
     483
     484[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 31 of 67] Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007]
     485
     486  © 2003-2006 The openEHR Foundation    email: info@openEHR.org web: !http://www.openEHR.org
     487
     488Assumed Types [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]
     489
     490||INTERFACE||ISO8601_DURATION||
     491||||days: Integer||number of 24 hour days||
     492||||hours: Integer||number of 60 minute hours||
     493||||minutes: Integer||number of 60 second minutes||
     494||||seconds: Integer||number of seconds||
     495||||fractional_second: Double||fractional seconds||
     496||||infix ‘<’ (other: like Current): Boolean||Arithmetic comparison with other duration. True if this duration is smaller than other.||
     497||||valid_iso8601_duration (s: String): Boolean||String is a valid ISO 8601 duration, i.e. takes the form: • P[nnY][nnM][nnW][nnD][T[nnH][nnM][nnS]] Where each nn represents a number of years, months, etc. nnW represents a number of 7day weeks. Note: allowing the W designator in the same expression as other designators is an exception to the published standard, but necessary in clinical information (typically for representing pregnancy duration).||
     498||||is_decimal_sign_comma: Boolean||True if this time has a decimal part indicated by ‘,’ (comma) rather than ‘.’ (period).||
     499||||to_seconds: Double||Total number of seconds equivalent (including fractional) of entire duration.||
     500||Invariants||years_valid: years >= 0 months_valid: months >= 0 weeks_valid: weeks >= 0 days_valid: days >= 0 hours_valid: hours >= 0 minutes_valid: minutes >= 0 seconds_valid: seconds >= 0 fractional_second_valid: fractional_second >= 0.0 and fractional_second < 1.0||
     501
     502Date of Issue:[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15448 08 Apr 2007] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_19440 Page 32 of 67] [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 Editors:{T Beale, S Heard}, {D Kalra, D Lloyd}]
     503
     504[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15429 © 2003-2006 The openEHR Foundation]  email: info@openEHR.org web: !http://www.openEHR.org
     505
     506[file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15311 Support Information Model] Identification Package Rev [file:///home/skoba/src/openehr-jp/adl/trunk/pdf2html/rm/support_im/support_im.htm#LinkTarget_15315 1.6.0]