The Model Underlying CDA
The CDA standard is part of a family of standards from HL7 called HL7 v3. All HL7 v3 standards derive from an underlying conceptual object model called the HL7 v3 RIM, which defines the “classes” and “properties” used to represent all of the clinical and clinically-relevant administrative data that the HL7 v3 standards deal with.

The Common “Base Class” for CDA Elements
All of the HL7 v3 RIM classes share a common “base class”, which defines four basic “properties” that all objects in the HL7 v3 model share.

In CDA terms, these four “properties” are represented as three XML sub-elements and one XML attribute that are shared by all of the main CDA top-level XML elements (for example: clinical act statement elements, act relationship elements, entity and role elements, and participation elements).

All four are optional.

The Three Common Sub-Elements and One Common Attribute
The three common XML sub-elements just noted are: realmCode, typeId, and templateId. Each has a dedicated CDA PRO Know article: The realmCode element, The typeId element, and The templateId element.

These three sub-elements (in the order: realmCode, typeId, and templateId) are always the first three sub-elements, when they are supported by a given CDA element. Refer to the article Does the order of XML elements matter in CDA?, for additional information.

The common XML attribute is nullFlavor. Refer to the article The nullFlavor attribute, for additional information. Attribute order does not matter in XML, but note that generally the nullFlavor attribute is the only attribute when it is used.

Practical Usage
As explained in the respective articles for each of them, the realmCode and typeId elements generally are used only one time each in a CDA document – directly under the ClinicalDocument root element.

As also explained in those articles, in C-CDA, both ClinicalDocument/realmCode and ClinicalDocument/typeId are required, and have specific values that must be used.

The templateId element is used whenever assertion of conformance to a CDA template is made. Every C-CDA template requires the presence of a templateId sub-element of the top-level element to which the template is applied (ClinicalDocument for document templates, section for section templates, the XML element for a clinical act statement or other relevant XML element for entry templates, etc.).

The nullFlavor attribute is used as relevant – refer to the article Use of nullFlavor in C-CDA templates and MU2 documents for additional information.

Other CDA PRO Know Articles Referenced In This Article