The templateId XML element is an optional sub-element of virtually every other CDA XML element. For an overview of why this is the case, refer to the article Three common sub-elements (and one attribute) throughout CDA.

The role of the templateId XML element is to assert conformance of its parent element to one or more CDA templates. Templates are the key mechanism for senders and receivers of CDA documents to agree to a set of rules about the syntax and semantics of part (or all) of the CDA documents they are exchanging. C-CDA for example, is primarily a collection of defined CDA templates, each with its own template identifier.

templateId Syntax
The templateId element follows the syntax for other identifiers in CDA (refer to the article Identifiers in CDA, for more information). It takes only the root attribute, which is assigned the template identifier. Template identifiers are OIDs.

It’s permissible to declare conformance to multiple CDA templates by having multiple templateId elements, in sequence. For example, a C-CDA CCD document will generally have the following directly under the XML root element (ClincialDocument):

<ClinicalDocument ...>
   ...
   <templateId root="2.16.840.1.113883.10.20.22.1.1"/>
   <templateId root="2.16.840.1.113883.10.20.22.1.2"/>
   ...

The first template identifier (2.16.840.1.113883.10.20.22.1.1) asserts conformance to the US Realm Header template that is shared by all C-CDA documents. The second identifier (2.16.840.1.113883.10.20.22.1.2) asserts conformance to the C-CDA CCD document template.

Other CDA PRO Know Articles Referenced In This Article