Use of HL7 templates in CP
Use of Templates in Care Provision
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.1138188.8.131.52.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.
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.
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.
Template canonical form
The templates defined in this domain will follow the new HL7 canonical form that is defined in the Templates Working Group.