This wiki has undergone a migration to Confluence found Here
<meta name="googlebot" content="noindex">

Difference between revisions of "Use of HL7 templates in CP"

From HL7Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
Line 49: Line 49:
 
* Possible fixed values
 
* Possible fixed values
 
* Additional properties such as units (measurements), ranges, fraction digits
 
* Additional properties such as units (measurements), ranges, fraction digits
of a class attribute. In general this means to determine the properties of an XML element or an XML attribute.
+
of a class attribute. In general this means to determine the properties of an XML element or an XML attribute. In addition, containment relationship and co-occurances of items may also be determined.
Examples of class attributes in table format, with different attribute names, data types (DT), cardinalitiy (Card), conformance (Conf) and description.
 
 
 
{| class="wikitable"
 
|+Table: Class Attributes with data type, cardinality, conformance and a description
 
|-
 
!Attribute!!DT!!Card!!Conf!!Description
 
|-
 
|repeatNumber
 
|INT
 
|0..1
 
|O
 
|Number of repetitions
 
|-
 
|value
 
|PQ
 
|1..1
 
|R
 
|The measurement as a physical quantity
 
|-
 
|code
 
|CE CNE
 
|1..1
 
|M
 
|The code of the observation
 
|}
 
 
 
=== Data Type Constraints ===
 
The data type of a class attribute is simply determined by specifying a data type name or a data type flavor name. Note that the constraint shall be equal to or a valid demotion of the corresponding data type of the underlying model (if present).
 
 
 
{{BeginBlueBox|Examples}}
 
{| class="wikitable"
 
|-
 
!Attribute
 
!Description
 
!Data type (flavor)
 
|-
 
|classCode
 
|Class code of the act
 
|CS
 
|-
 
|id
 
|Instance identifier
 
|II
 
|-
 
|effectiveTime
 
|A time stamp
 
|TS
 
|-
 
|value
 
|A measurement of a physical quantity
 
|PQ
 
|-
 
|lotNumber
 
|The lot number
 
|ST
 
|-
 
|repeatNumber
 
|a non-negative integer
 
|INT.NONNEG
 
|-
 
|date
 
|A timestamp that may be valued up to a day
 
|TS.DATE
 
|}
 
{{EndBlueBox}}
 
 
 
Note: Although not present in HL7 Data Types Release 1 or 1.1, data type flavors may be used in templates to constraint data types of class attributes.
 
 
 
=== Allowed Data Absent Reasons (Null Flavors) ===
 
In cases where data may be absent, i.e. non-mandatory attributes, indicated with a ''@nullFlavor'' in an instance, the list of possible codes for the reason of absent data may be restricted.
 
 
 
{{BeginBlueBox|Example}}
 
The list of valid codes for a (required) coded observation (value) is drawn from ValueSet ''SomeValueSet''. There is only one exceptional situation allowed to be expressed in an instance, i.e. that the value of the observation is not known.
 
 
 
In this case the list of valid ''@nullFlavor'' codes is restricted to be <tt>"UNK"</tt> only, i.e. the coded observation (value) shall be a code drawn from ''SomeValueSet'' or ''@nullFlavor = UNK''.
 
{{EndBlueBox}}
 
 
 
=== Fixed Values ===
 
 
 
=== Default Values ===
 
In practice so far no use case is known for specifying default values in a template.
 
 
 
=== List of Allowed Values ===
 
 
 
=== Quantity Ranges ===
 
 
 
=== Units ===
 
 
 
=== Textual Restrictions ===
 
 
 
==== regularExpression ====
 
A Regular Expression pattern defining the range of possible values for a string.
 
In practice so far no use case is known for specifying regular expressions as a textual restriction in a template.
 
 
 
==== codingScheme ====
 
The intended coding scheme to be used for conforming instances for the textual data.
 
In practice so far no use case is known for specifying coding schemes as a textual restriction in a template.
 
 
 
=== Cardinality ===
 
The cardinality indicator specifies the allowable occurrences within a message instance. The cardinality indicators are interpreted with the following format “m…n” where m represents the least and n the most:
 
* 0..1 zero or one
 
* 1..1 exactly one
 
* 1..* at least one
 
* 0..* zero or more
 
* 1..n at least one and not more than n
 
 
 
=== Conformance ===
 
In some implementation guides conformance verbs as SHALL, SHOULD, MAY etc. are used. This is not handled consistently across several organizations (e.g., HL7, IHE, see also [Consolidating CDA Templates]). Once, conformance indicators are unified the can be incorporated in this document as well.
 
 
 
In this guide conformance verbs are used for vocabulary constraints (see following section) but not for templates as a whole or for template elements.
 
 
 
HL7 conformance indications are used instead. The following table gives an overview of mandatory items, the cardinality, conformance and whether data may be absent (nullFlavor).
 
 
 
{| class="wikitable"
 
|-
 
!Mandatory
 
!Conformance
 
!Minimum Cardinality
 
!Null ok?
 
!Comment
 
|-
 
|M
 
|R
 
|1
 
|No
 
|Shall be present and valued in a message
 
|-
 
|(not mandatory)
 
|R
 
|0
 
|Yes
 
|If no information is available, just don't send it
 
|-
 
|(not mandatory)
 
|R
 
|1
 
|Yes
 
|
 
|-
 
|(not mandatory)
 
|NP
 
|n/a
 
|No
 
|
 
|-
 
|(not mandatory)
 
|(unspecified)
 
|0
 
|Yes
 
|
 
|-
 
|+Table: Overview of Conformance and Cardinality
 
|}
 
 
 
==== Mandatory====
 
The attribute is mandatory, i.e. a valid value shall be provided and no null value is allowed. The minimum cardinality is at least 1. This also includes that if the sender has no valid value for such an attribute, the message cannot be sent.
 
It is indicated as “M” in the conformance column of the attribute table, a shorthand for “mandatory” with required conformance.
 
 
 
{{BeginBlueBox|Example}}
 
Class attribute code is 1..1 mandatory
 
 
 
{| class="wikitable"
 
|-
 
!Attribute
 
!DT
 
!Card
 
!Conf
 
!Description/Fixed value
 
|-
 
|code
 
|CE CNE
 
|1..1
 
|M
 
|The description of the code
 
|-
 
|+Table: Class Attribute with data type, cardinality, conformance and a description
 
|}
 
{{EndBlueBox}}
 
 
 
==== Required====
 
The attribute is required, i.e. a valid value should be provided or if missing a null value is allowed if its minimum cardinality is 1, or may be omitted if its minimum cardinality is zero.
 
 
 
In messages, the element must be communicated if its minimum cardinality is one. In the case where the element is not mandatory, it may be communicated with a null value. Note that any element declared to be "Mandatory" must also be "Required" and have a minimum cardinality of one. If the minimum cardinality is zero, and the element is "Required", conforming applications need not send the element if data does not exist. For required elements, conforming applications must demonstrate their ability to provide and communicate not null values. Receiving applications must demonstrate their ability to receive and process (eg. Store, display to users) not null values for required elements.
 
 
 
It is indicated as “R” in the conformance column of the class attribute table.
 
 
 
==== Optional====
 
The attribute is truly optional, i.e. a valid value may be provided or if missing may be omitted.
 
 
 
It is indicated as “O” in the class attribute table, a shorthand for an unspecified conformance with a minimum cardinality of zero.
 
 
 
==== Conditional====
 
This usage has an associated condition predicate. It is denoted in the following format:
 
{| class="wikitable"
 
|-
 
!Card
 
!Conf
 
!Predicate
 
|-
 
|a<sub>1</sub>..b<sub>1</sub>
 
|conf<sub>1</sub>
 
|If condition<sub>1</sub>
 
|-
 
|a<sub>2</sub>..b<sub>2</sub>
 
|conf<sub>2</sub>
 
|If condition<sub>2</sub>
 
|-
 
|...
 
|...
 
|...
 
|-
 
|a<sub>n</sub>..b<sub>n</sub>
 
|conf<sub>n</sub>
 
|otherwise
 
|-
 
|+Table: Condition Predicate Table
 
|}
 
where a..b is the cardinality, conf denotes the conformance and condition is the condition, in human language or formalized in some constraint language. Please note that all predicates shall be mutually exclusive.
 
 
 
{{BeginBlueBox|Example}}
 
The cardinality (of a class attribute) is 1..1 if number of gravidities is greater than zero or 0..1 otherwise
 
 
 
{| class="wikitable"
 
|-
 
!Card
 
!Conf
 
!Predicate
 
|-
 
|1..1
 
|M
 
|If number of gravidities > 0
 
|-
 
|0..1
 
|O
 
|otherwise
 
|-
 
|+Table: Example Condition Predicate Table
 
|}
 
{{EndBlueBox}}
 
 
 
If the predicate is satisfied then
 
* a conformant sending application must always send the element
 
* a conformant receiving application must process or ignore data in the element; it may raise an error if the element is not present.
 
If the predicate is not satisfied then
 
* a conformant sending application must not send the element.
 
* a conformant receiving application must not raise an error if the condition predicate is false and the element is not present, though it may raise an error if the element is present.
 
 
 
A conditional attribute is indicated as “C” in the class attribute table, followed immediately by the condition predicate table.
 
 
 
==== Fixed====
 
This indicates that an attribute has a fixed value. It fixed value shall appear in an XML instance.
 
 
 
It is indicated as “F” in the class attribute table, a shorthand for a mandatory element with required conformance with a fixed value. The cardinality should be 1..1.
 
 
 
==== Not used====
 
This indicates that an attribute is not used. In principle, it is not part of an XML instance but is not rejected by validation mechanisms if present and a receiver should not raise an error when he received the element.
 
 
 
It is indicated as “X” in the class attribute table.
 
 
 
==== Not present====
 
The attribute is not permitted, not part of an XML instance, rejected by validation mechanisms if found and should be rejected by receiver (raising an error).
 
 
 
It is indicated as “NP” in the class attribute table. There is no cardinality specified.
 
 
 
=== Vocabulary Conformance ===
 
The templates in this document use terms from several code systems.  These vocabularies are defined in various supporting specifications and may be maintained by other bodies, as is the case for the LOINC® and SNOMED CT® vocabularies.
 
 
 
Note that value-set identifiers, e.g., ValueSet 2.16.840.1.113883.1.11.78 ''HL7ObservationInterpretation'' DYNAMIC, do not appear in messages/documents; they tie the conformance requirements of an implementation guide to the appropriate code system for validation.
 
 
 
==== Dynamic vs static binding====
 
Value-set bindings adhere to HL7 Vocabulary Working Group best practices, and include both a conformance indicator and an indication of DYNAMIC vs. STATIC binding.
 
* Value-set constraints can be STATIC, meaning that they are bound to a specified version (date) of a value set,
 
* or DYNAMIC, meaning that they are bound to the most current version of the value set.
 
 
 
{{BeginBlueBox|Example: binding to a single code}}
 
A simplified constraint, used when the binding is to a single code, includes the meaning of the code, as follows.
 
 
 
Following a table with explicit XML attribute (data type CE) and binding to fixed code, codeSystem, etc.:
 
 
 
{| class="wikitable"
 
|-
 
!Attribute
 
!DT
 
!Card
 
!Conf
 
!Description/Fixed value
 
|-
 
|code
 
|CE CNE
 
|1..1
 
|M
 
|
 
|-
 
|&nbsp;&nbsp;@code
 
|st
 
|1..1
 
|F
 
|11450-4
 
|-
 
|&nbsp;&nbsp;@codeSystem
 
|oid
 
|1..1
 
|F
 
|2.16.840.1.113883.6.1
 
|-
 
|&nbsp;&nbsp;@displayName
 
|st
 
|0..1
 
|F
 
|Problem List
 
|-
 
|&nbsp;&nbsp;@codeSystemName
 
|st
 
|0..1
 
|F
 
|LOINC
 
|-
 
|+Table: Example Class Attribute Table for a code
 
|}
 
 
 
Verbatim
 
 
 
#SHALL contain exactly one [1..1] code/@code="11450-4" Problem List (CodeSystem: LOINC 2.16.840.1.113883.6.1)
 
 
 
etc.
 
 
 
The notation conveys the actual code (fixed 11450-4) in the required @code attribute, the optional code’s display name (“Problem List” if present), the required OID of the code system from which the code is drawn (fixed 2.16.840.1.113883.6.1), and the optional code system name (LOINC).
 
{{EndBlueBox}}
 
 
 
XML attributes are denoted by a preceding @ and have cardinalities 0..1 (optional) or 1..1 (required) only. If an attribute is prohibited (may not be present), its conformance is set to NP.
 
 
 
HL7 Data Types Release 1 requires the @codeSystem attribute unless the underlying data type is “Coded Simple” or “CS”, in which case it is prohibited. The @displayName and the @codeSystemName are optional, but recommended, in all cases.
 
 
 
{{BeginBlueBox|XML example}}
 
The above example would be properly expressed as follows.
 
 
 
<code>
 
<code code="11450-4" codeSystem="2.16.840.1.113883.6.1"/>
 
</code>
 
 
 
or
 
 
 
<code>
 
<code code="11450-4" codeSystem="2.16.840.1.113883.6.1" displayName="Problem List" codeSystemName="LOINC"/>
 
</code>
 
{{EndBlueBox}}
 
 
 
{{BeginBlueBox|Examples: code with STATIC or DYNAMIC binding to a particular ValueSet}}
 
In the following example, class attributes are bound to ValueSets, STATIC and DYNAMIC.
 
{| class="wikitable"
 
|-
 
!Attribute
 
!DT
 
!Card
 
!Conf
 
!Description/Fixed value
 
|-
 
|confidentialityCode
 
|CE CWE
 
|1..1
 
|M
 
|ValueSet ''HL7BasicConfidentialityKind'' 2.16.840.1.113883.1.11.16926 STATIC 2010-04-21
 
|-
 
|languageCode
 
|CE CWE
 
|1..1
 
|R
 
|ValueSet ''Language 2.16.840.1.113883.1.11.11526'' DYNAMIC
 
|-
 
|+Table: Example Attribute Table
 
|}
 
 
 
Verbatim:
 
#SHALL contain exactly one [1..1] confidentialityCode which SHALL be selected from ValueSet ''HL7BasicConfidentialityKind'' 2.16.840.1.113883.1.11.16926 STATIC 2010-04-21.
 
#SHOULD contain exactly one [1..1] languageCode which SHALL be selected from ValueSet ''Language'' 2.16.840.1.113883.1.11.11526 DYNAMIC
 
 
 
The first notation binds mandatory confidentialityCode to value set ''HL7BasicConfidentialityKind'' (as of 2010-04-21), the second notation binds required languageCode to value set Language 2.16.840.1.113883.1.11.11526 (most recent version).
 
{{EndBlueBox}}
 
  
 
===Containment Relationship===
 
===Containment Relationship===
Line 435: Line 57:
  
 
{{BeginBlueBox|Example}}
 
{{BeginBlueBox|Example}}
A report about the first prenatal visit of a pregnant woman with historical findings recorded by an obstetrician or a midwife should contain an observation about the number of pregnancies so far (including the actual pregnancy), also known as “gravidity”.
+
A report about the first prenatal visit of a pregnant woman with historical findings recorded by an obstetrician or a midwife should contain an observation about the number of pregnancies so far (including the actual pregnancy), also known as “gravidity” (in this example with id 2.16.840.1.113883.2.4.6.10.90.1053).
  
Assume that the underlying model allows for clinical statements like an observation via a component relationship.
+
Assume that the underlying model allows for clinical statements like an observation via a component relationship. Then a conformant instance
{| class="wikitable"
 
|-
 
!Attribute
 
!DT
 
!Card
 
!Conf
 
!Description/Fixed value
 
|-
 
|component
 
|
 
|1..1
 
|R
 
|Contains ''GravidityObservation'' template id 2.16.840.1.113883.2.4.6.10.90.1053
 
|-
 
|&nbsp;&nbsp;@typeCode
 
|CS
 
|1..1
 
|F
 
|COMP
 
|-
 
|+Table: Example Attribute Table
 
|}
 
 
 
Verbatim:
 
 
<ol>
 
<ol>
 
<li>SHALL contain exactly one [1..1] component such that it
 
<li>SHALL contain exactly one [1..1] component such that it
Line 483: Line 81:
  
 
===Co-Occurance===
 
===Co-Occurance===
 +
 +
Co-occurance means the presence of some data depending on the presence or value of some other data. There are intra-instantial co-occurances where a condition applies to one single instance, and extra-instantial co-occurances where the presence of data in an instance is influenced by external factors (outside the very same instance).
 +
 +
In this domain, only intra-instantial co-occurances are handled: depending on some conditions in an instance, other data in the same instance needs to be present or valued.
  
 
{{BeginBlueBox|Example: Amnionicity and Chorionicity}}
 
{{BeginBlueBox|Example: Amnionicity and Chorionicity}}
 
Assume, that if the number of fetuses of a pregnant woman is more than 1 (multiple gestation), than an Amnionicity observation – number of fluid filled / (amniotic) sacs – and a Chorionicity observation– type of placentation – need to be reported.
 
Assume, that if the number of fetuses of a pregnant woman is more than 1 (multiple gestation), than an Amnionicity observation – number of fluid filled / (amniotic) sacs – and a Chorionicity observation– type of placentation – need to be reported.
  
{| class="wikitable"
+
Co-occurance: If number of fetuses > 1 an ''AmnionicityObservation'' and a ''ChorionicityObservation'' is required, otherwise not present.
!Attribute
 
!DT
 
!Card
 
!Conf
 
!Description/Fixed value
 
|-
 
|component
 
|
 
|
 
|C
 
|Conditionally contains ''AmnionicityObservation'' template id 2.16.840.1.113883.2.4.6.10.90.1054
 
|
 
|-
 
|
 
|
 
| bgcolor="eee" |Card
 
| bgcolor="eee" |Conf
 
| bgcolor="eee" |Predicate
 
|-
 
|
 
|
 
|1..1
 
|M
 
|If number of fetuses > 1
 
|-
 
|
 
|
 
|
 
|NP
 
|otherwise
 
|-
 
|&nbsp;&nbsp;@typeCode
 
|CS
 
|1..1
 
|F
 
|COMP
 
|-
 
|component
 
|
 
|
 
|C
 
|Conditionally contains ''ChorionicityObservation'' template id 2.16.840.1.113883.2.4.6.10.90.1055
 
|-
 
|-
 
|
 
|
 
| bgcolor="eee" |Card
 
| bgcolor="eee" |Conf
 
| bgcolor="eee" |Predicate
 
|-
 
|
 
|
 
|1..1
 
|M
 
|If number of fetuses > 1
 
|-
 
|
 
|
 
|
 
|NP
 
|otherwise
 
|-
 
|&nbsp;&nbsp;@typeCode
 
|CS
 
|1..1
 
|F
 
|COMP
 
|-
 
|}
 
 
{{EndBlueBox}}
 
{{EndBlueBox}}
  
Line 564: Line 97:
 
Assume that a business rule says that in this case an Immunization Refusal Reason shall be stated.
 
Assume that a business rule says that in this case an Immunization Refusal Reason shall be stated.
  
Table:  
+
Co-occurance: if substanceAdministration.negationInd = true then ''ImmunizationRefusalReason'' is required, otherwise optional.
 
 
{| class="wikitable"
 
|-
 
!Attribute
 
!DT
 
!Card
 
!Conf
 
!Description/Fixed value
 
|-
 
|substanceAdministration
 
|
 
|
 
|
 
|
 
|-
 
|&nbsp;&nbsp;@classCode
 
|CS
 
|1..1
 
|F
 
|SBADM
 
|-
 
|&nbsp;&nbsp;@moodCode
 
|CS
 
|1..1
 
|F
 
|EVN
 
|-
 
|&nbsp;&nbsp;@negationInd
 
|BL
 
|0..1
 
|O
 
|Refusal yes/no
 
|-
 
|&nbsp;&nbsp;...
 
|
 
|
 
|
 
|
 
|-
 
|&nbsp;&nbsp;entryRelationship
 
|
 
|
 
|C
 
|Contains ''ImmunizationRefusalReason'' template id 2.16.840.1.113883.2.4.6.10.90.1054
 
|-
 
|
 
|
 
| bgcolor="eee" |Card
 
| bgcolor="eee" |Conf
 
| bgcolor="eee" |Predicate
 
|-
 
|
 
|
 
|1..1
 
|M
 
|If @negationInd = true
 
|-
 
|
 
|
 
|0..1
 
|O
 
|otherwise
 
|-
 
|&nbsp;&nbsp;&nbsp;&nbsp;@typeCode
 
|
 
|1..1
 
|M
 
|RSON
 
|-
 
|}
 
{{EndBlueBox}}
 
 
 
{{BeginBlueBox|Example APGAR panel}}
 
* An APGAR score (assessment scale) is a simple and repeatable method to quickly and summarily assess the health of newborn children immediately after birth
 
* The APGAR the sum comprises of five axes (Appearance, Pulse, Grimace, Activity, Respiration) each of it reported as 0, 1 or 2, resulting in valid sum scores values between 0 and 10. Normally the particular axes are not reported.
 
* An APGAR panel contains exactly one APGAR sum score and contains all five sub scores as component observations.
 
* Assume that a business rules says that iIf APGAR sum score < 4 (which is considered to be critical) then the whole panel its required to be included, otherwise sum score only is considered to be sufficient.
 
{{EndBlueBox}}
 
 
 
=== Originator Responsibilities: General Case ===
 
An originator can apply a templateId if there is a desire to assert conformance with a particular template.
 
 
 
In the most general forms of CDA exchange, an originator need not apply a templateId for every template that an object in an instance document conforms to. The implementation guide (IG) shall assert whenever templateIds are required for conformance.
 
 
 
=== Recipient Responsibilities: General Case ===
 
A recipient may reject an instance that does not contain a particular templateId (e.g., a recipient looking to receive only Procedure Note documents can reject an instance without the appropriate templateId).
 
 
 
A recipient may process objects in an instance document that do not contain a templateId (e.g., a recipient can process entries that contain Observation acts within a Problems section, even if the entries do not have templateIds).
 
 
 
=== Examples ===
 
 
 
{{BeginBlueBox|Simple Observation Template: Gravida}}
 
This is an example of a template defined in DECOR* (Data Elements, Codes, OIDs and Rules). The example is about the number of gravidities of a woman including a possible actual one, e.g. a woman is gravida 2, i.e. she has been or is pregnant two times so far. The observation code is bound to 11996-6 from LOINC. The number of gravidities is (observation value) is demoted to be a count (INT) and restricted to be valued zero up to 75 (no reports seen so far about a number of pregnancies larger than 75). The template comes with a valid example.
 
 
 
<template id="2.999.999.997.10.1002" name="Gravidity" displayName="Gravidity" effectiveDate="2011-06-22T00:00:00" statusCode="active">
 
    <element name="hl7:observation">
 
        <example>
 
            <observation classCode="OBS" moodCode="EVN">
 
                <!-- Gravidity -->
 
                <code code="11996-6" codeSystem="2.16.840.1.113883.6.1"/>
 
                <value xsi:type="INT" value="2"/>
 
            </observation>
 
        </example>
 
        <attribute classCode="OBS" moodCode="EVN"/>
 
        <element name="hl7:code" minimumMultiplicity="1" maximumMultiplicity="1" isMandatory="true" datatype="CE">
 
            <vocabulary code="11996-6" codeSystem="2.16.840.1.113883.6.1"/>
 
        </element>
 
        <element name="hl7:value" minimumMultiplicity="1" maximumMultiplicity="1" id="2.999.999.997.77.5.701" datatype="INT">
 
            <property minInclude="0" maxInclude="75"/>
 
        </element>
 
    </element>
 
</template>
 
 
 
<nowiki>*</nowiki>''DECOR allows a consistent collection of information from a clinical view (functional specification), codes (i.e. value set definitions), identifiers (OIDs), and rules (templates to constrain XML instances). As for the "rules" part the DECOR canonical format is transformed into a package of schematron rules (including references to all used value sets and data types) which is called the "runtime" environment. In addition, a documentation of the template definitions (among others in HTML format that can be made directly accessible thru schematron error, warning and information messages).''
 
{{EndBlueBox}}
 
 
 
{{BeginBlueBox|Simple Observation Template: Body Height}}
 
This is an example template in DECOR format defining a person's body height. A short description is given in three languages. The observation is a physical quantity (PQ) and has either a unit "m" (meters) with a valid range of 0..3 with two fraction digits required, or a unit "cm" (centimeters) with a value ranged 0..300 (tallest human ever documented was 272 cm so far). This template can act as a parent template that further restricts the use of the value to be e.g. "cm" only, ranged from 120..245 etc.
 
 
 
<template id="2.999.999.997.10.1000" name="BodyHeight" displayName="Body height" effectiveDate="2011-07-14T00:00:00" statusCode="active">
 
    <desc language="nl-NL">Lichaamslengte van een persoon</desc>
 
    <desc language="de-DE">Körperlänge einer Person</desc>
 
    <desc language="en-US">Body height of a person</desc>
 
    <element name="hl7:observation">
 
        <example>
 
            <observation classCode="OBS" moodCode="EVN">
 
                <code code="3137-7" codeSystem="2.16.840.1.113883.6.1"/>
 
                <value xsi:type="PQ" value="173" unit="cm"/>
 
            </observation>
 
        </example>
 
        <attribute classCode="OBS" moodCode="EVN"/>
 
        <element name="hl7:code" minimumMultiplicity="1" maximumMultiplicity="1" isMandatory="true" datatype="CE">
 
            <vocabulary code="3137-7" codeSystem="2.16.840.1.113883.6.1"/>
 
        </element>
 
        <element name="hl7:value" minimumMultiplicity="1" maximumMultiplicity="1" id="2.999.999.997.77.5.760" datatype="PQ">
 
            <property unit="m" minInclude="0" maxInclude="3" fractionDigits="2!"/>
 
            <property unit="cm" minInclude="0" maxInclude="300" fractionDigits="0!"/>
 
        </element>
 
    </element>
 
</template>
 
 
{{EndBlueBox}}
 
{{EndBlueBox}}
  
==== Model and template hierarchy example ====
+
===Template canonical form===
==== Clinical Statement Pattern (unconstraint model) ====
+
The templates defined in this domain will follow the new HL7 canonical form that is defined in the Templates Working Group.
==== Assessment Scale (constraint model on Clinical Statement) ====
 
==== APGAR score (constraint model on Assessment Scale) ====
 

Latest revision as of 07:50, 5 March 2012

Patient Care | Patient Care Normative Ballot Content

Use of Templates in Care Provision

HL7 Templates

An HL7 template is a constraint on models based on the HL7 Reference Information Model (RIM). It expresses the data content needed in a specific clinical or administrative context.

In healthcare there are prescribed patterns by which, for example, multiple observations may be combined to describe selected, gross observations. Some observations may be simple, such as the single lab result (e.g. potassium in blood is 4.4 mEq/L) or the blood pressure concept, which involves a set of expected observations (i.e., systolic, diastolic, patient position, method, etc.). Other more elaborate diagnostic procedures may involve hundreds of related pieces of information, including anatomy, orientation, sequences of measurements, etc.

In HL7, more or less generic models exist; the Patient Care model, especially the Care Statements = Clinical Statement Pattern (CSP) is one of it. Templates provide a method of describing rules for combining and constraining HL7 v3 XML instances like a Patient Care message. Templates can be used for three purposes:

  • To have a guideline to create (a fragment of) a Patient Care message instance
  • To validate an instance whether it conforms to the specified template rules
  • To have a guidance while processing a Patient Care message instance.

The last point should be considered carefully, because an instance must convey fully semantics even without knowing the underlying template.

Based on user need and preference, the template ideally is a structure that can be used as a building block and, once defined, can be re-used whenever appropriate.

Kinds of Patient Care templates

The Patient Care standard describes conformance requirements in terms of two general levels:

  • Message root level templates: they define / refine the overall structure of a message starting from the Care Provision class, which templates are contained in the message and whether they are optional or required.
  • Substructure level templates (patient, provider etc.)
  • Clinical Statement level templates: impose the Clinical Statement Pattern of a Patient Care message; they define the constraints on the classes, class attributes, data types and class relationships.

Template Identifiers in instances

Template identifiers (templateId) are assigned at the Message root level and Clinical Statement level. When valued in an instance, the template identifier signals the imposition of a set of template-defined constraints. The value of this attribute, e.g.

<templateId root="2.16.840.1.113883.10.1.2.3" />

provides a unique identifier for the template in question.

If a template is a specialization of another template, its first constraint indicates the more general template. The general template is not always required. In all cases where a more specific template conforms to a more general template, asserting the more specific template also implies conformance to the more general template.

Open and Closed Templates

In open templates, all of the features of the Patient Care based specification are allowed except as constrained by the templates. By contrast, a closed template specifies everything that is allowed and nothing further may be included.

Open templates allow HL7 implementers to develop additional content not constrained within the template. HL7 encourages implementers to bring their use cases forward as candidate requirements to be formalized in a subsequent version of the standard to maximize the use of shared semantics.

In general, Patient Care defines open templates only.

Expressing Constraints in Templates

Constraints expressed in templates may determine

  • The data type or a data type flavor
  • The cardinality
  • The conformance, e.g. if data may be absent (nullFlavor)
  • Vocabulary bindings and coding strengths
  • Possible fixed values
  • Additional properties such as units (measurements), ranges, fraction digits

of a class attribute. In general this means to determine the properties of an XML element or an XML attribute. In addition, containment relationship and co-occurances of items may also be determined.

Containment Relationship

The containment relationship constraints between a specific structure (context) in an XML instance and sub-structures in that context (child elements).

They may be indirect, meaning that where a structure asserts containment of a substructure, that substructure can either be a direct child or a further descendent of that structure, or be direct, meaning that the contained substructure shall be a direct child of the structure.

Example

A report about the first prenatal visit of a pregnant woman with historical findings recorded by an obstetrician or a midwife should contain an observation about the number of pregnancies so far (including the actual pregnancy), also known as “gravidity” (in this example with id 2.16.840.1.113883.2.4.6.10.90.1053).

Assume that the underlying model allows for clinical statements like an observation via a component relationship. Then a conformant instance

  1. SHALL contain exactly one [1..1] component such that it
    1. SHALL contain exactly one [1..1] @typeCode="COMP" (CodeSystem: HL7ActRelationshipType 2.16.840.1.113883.5.1002)
    2. SHALL contain exactly one [1..1] GravidityObservation (template id 2.16.840.1.113883.2.4.6.10.90.1053)

Assume that the referenced template is an observation with a LOINC code 11996-6 (number of pregnancies, reported), then the above example could be properly expressed as follows.

<component typeCode="COMP">
   <observation classCode="OBS" moodCode="EVN">
       <templateId root="2.16.840.1.113883.2.4.6.10.90.1053"/>
       
       <value xsi:type="INT" value="2"/>
   </observation>
</component>

Co-Occurance

Co-occurance means the presence of some data depending on the presence or value of some other data. There are intra-instantial co-occurances where a condition applies to one single instance, and extra-instantial co-occurances where the presence of data in an instance is influenced by external factors (outside the very same instance).

In this domain, only intra-instantial co-occurances are handled: depending on some conditions in an instance, other data in the same instance needs to be present or valued.

Example: Amnionicity and Chorionicity

Assume, that if the number of fetuses of a pregnant woman is more than 1 (multiple gestation), than an Amnionicity observation – number of fluid filled / (amniotic) sacs – and a Chorionicity observation– type of placentation – need to be reported.

Co-occurance: If number of fetuses > 1 an AmnionicityObservation and a ChorionicityObservation is required, otherwise not present.

Example: Immunization activity

An Immunization Activity can also include that a certain vaccination was not given (expressed as a negationInd/actNegationInd of the associated substance administration is valued “true”).

Assume that a business rule says that in this case an Immunization Refusal Reason shall be stated.

Co-occurance: if substanceAdministration.negationInd = true then ImmunizationRefusalReason is required, otherwise optional.

Template canonical form

The templates defined in this domain will follow the new HL7 canonical form that is defined in the Templates Working Group.