Brian Weiss

About Brian Weiss

CDA PRO Founder

TTT error: “validateST invariant is violated”

When validating a C-CDA document using the official US government TTT validator that is used in Meaningful Use Stage Two certification, one of the error messages that can appear take this form (click to enlarge the image): TTTError

The cryptic message “validateST invariant is violated” actually means that there is an empty string in an element that requires that some text be present.

The XML Schema for CDA defines a basic “data type” named ST. This data type has a validation rule that requires that it either have a nullFlavor attribute (refer to The nullFlavor attribute, for additional information), or that it contain a non-empty string (at least one character).

This error is commonly encountered in the context of the XML elements that are used for Name Parts and Address parts (refer to The name element and The addr element, for additional information about Name Parts and Address Parts) – as the data types of those elements are derived from the ST base data type.

Other elements that either are assigned the ST data type or a data type that derives from it, include: derivationExpr, lotNumberText, manufacturerModelName, softwareName, and title.

Other CDA PRO Know Articles Referenced In This Article

Jun 30, 2014|MU2 C-CDA Certification, Overall XML Syntax|

The Discharge Medications entry template

Entry Templates
The article What is a CDA Template?, introduces the template concept in CDA. C-CDA entry templates, in particular, define the rules for clinical act statements (or particular sub-parts of a clinical act statement) in C-CDA documents. In this article we’ll look at the Discharge Medications entry template in C-CDA.

Use of the Discharge Medications Entry Template
In C-CDA, the Discharge Medications entry template is used (exclusively) within a Hospital Discharge Medications section template, which in turn is used (exclusively) within a Discharge Summary document template.

In MU2, the Hospital Discharge Medications section template (which contains the Discharge Medications entry template), is one of the allowed/recommended sections for meeting the MU2 requirements for conveying medication information for documents generated in inpatient settings. From an MU2 perspective, medications have to be in one or more of the following section templates: Hospital Discharge Medications, Hospital Admission Medications, Medications Administered, and/or Medications.

Discharge Medications Entry Template Applied to act Element
From an XML syntax standpoint, the Discharge Medications entry template is applied to the act element which is located under ClinicalDocument/component/structuredBody/component/section/entry. Refer to The act element, for additional information about this element.

The discharge medications themselves are represented using the Medication Activity entry template – which is applied to substanceAdministration elements that are connected to the act element of the Discharge Medications entry template via an intermediate entryRelationship element.

Refer to The entryRelationship element, for additional information about how the entryRelationship element is used to connect related clinical act statement components to a parent clinical act statement. Refer to The substanceAdministration element, for an overview of this clinical act statement element for representing medications, immunizations, and similar administered substances.

Why Do We Need This Template and its act Element?
It’s not necessarily intuitive why the act element (and the associated Discharge Medications entry template) is required. Why not just place the substanceAdministration clinical act statements (in accordance with the Medication Activity entry template) directly under entry elements in the Hospital Discharge Medications section template? Why do we need this XML structure of entry/act/entryRelationship/substanceAdministration for discharge medications?

The reason for this construct is that in CDA, a clinical act statement has to stand on its own merit, it can’t be interpreted based on the section that it is in. So, if we would place substanceAdministration clinical act statements (in accordance with the Medication Activity entry template) directly under entry elements – those would be interpreted as stand-alone clinical act statements about “medication acts” (as is correctly the case in a Medications section).

To make these substanceAdministration elements “discharge medications”, they need to be contained within an act element that is the clinical act statement of “organizing/declaring discharge medications”. This is done using the entryRelationship act relationship element.

The XML Attributes of the Discharge Medications Entry Template
Given this understanding of the role of the Discharge Medications entry template – that it applies to an act […]

Jun 12, 2014|C-CDA Templates, Clinical Act Statements|

CDA PRO Lookup is Live!

The Wait is Over!
CDA PRO Lookup is something we have have been working on for a long time.

CDA PRO Lookup is a practical interactive reference tool that we believe will be of use to everyone working with CDA and C-CDA documents. It will be especially useful for those working on C-CDA documents in the context of Meaningful Use Stage Two. And we believe it will be most useful for those still learning the “ins and outs” of working with C-CDA documents…

CDA PRO Lookup allows you to search any C-CDA template, as well as any CDA/C-CDA XML element or attribute – and it then shows it to you in context, along with a lot of additional information to help you create TTT-validating XML in your documents (CDA PRO Lookup is built on the same MDHT model that the TTT Validator uses).

You can browse the full hierarchy of C-CDA templates – including the templates required for all of the MU2 document types – and see which templates use other templates (and which are used by other templates). Then just click to open a new “XML Hierarchy Tab” and browse the full XML syntax of any template you choose.

Getting Started
OK, enough advertising… how do you use the tool right now?

There are two choices: you can click here and dive right in… or you can click here to read/view the tutorial articles and/or 5-minute video presentation.

Special Thanks
The person who developed CDA PRO Lookup is a technical wizard named Assaf Levi. Assaf is my partner on CDA PRO and other endeavors – and I look forward to many more years of partnership with Assaf on Healthcare IT products and tools.

Assaf and I could never have created CDA PRO Lookup without the assistance of Sean Muir. Sean is a veteran Healthcare IT consultant and developer, and one of the leading experts globally on MDHT. Assaf and I both look forward to working with Sean on future CDA PRO projects.

What’s Next?
CDA PRO Lookup still needs some improvements and refinements – and as more users work with the tool, we’ll benefit from additional suggestions and defect reports. Please use the Feedback tab in the upper-left of every CDA PRO page to let us know how we can fix and/or improve CDA PRO Lookup.

Our next planned tool is an integrated MU2 C-CDA viewer/validator tool we will call CDA PRO Viewer. It will leverage all the capabilities of CDA PRO Lookup and will make MU2 certification a lot easier. We also believe it has the potential to become the de-facto industry standard for how CDA and C-CDA samples are published. That will become the basis for CDA PRO Sample.

So, lots more still to come… we’ve still only delivered a small fraction of our vision for CDA PRO…

Jun 13, 2014 (Jun 12, 2014)|Annnouncements|

The substanceAdministration element

Clinical Statements
The article Clinical act statements, provides an overview of the clinical statements that form the “core” of a CDA document. Clinical statements are contained within entry elements, which in turn are contained within section elements, which in turn comprise the structured CDA Body, located in the XML path: ClinicalDocument/component/structuredBody.

Clinical statements begin with an XML element of: act, encounter, procedure, observation, substanceAdministration, supply, or organizer.

The article What goes inside a clinical statement XML entry?, overviews some of the sub-elements and attributes that all clinical act statements have in common.

“Substance Administration” Clinical Statements
In the underlying HL7 v3 model on which CDA is based, a “substance administration” is defined as: A type of procedure that involves a performer introducing or otherwise applying a material into or to the subject. Typically, this is either a medication or an immunization – although, formally, the “substance administration” may not be related to treatment (i.e. it could be something harmful the patient ingested). The XML element used with a substance administration clinical act statement is named substanceAdministration.

substanceAdministration is an Extension of procedure
As implied by the definition above (“A type of procedure…”), a substance administration is a specific kind of procedure. Thus, the substanceAdministration element shares many of the attributes and sub-elements of procedure (which, like all clinical act statements, shares many of the common attributes and sub-elements of the act element). Refer to The procedure element, for additional information.

classCode and moodCode Attributes of substanceAdministration
The classCode attribute of the substanceAdministration element is a fixed/default value of “SBADM”. As its value is a fixed default, the classCode attribute is not explicitly included in the XML syntax for the substanceAdministration element.

The moodCode attribute of the substanceAdministration element is usually either set to “EVN”, if the substance was already administered, or “INT”, if the substance is intended to be administered in the future. Three variations of “INT” (“PRMS”, “PRP”, and “RQO”) are also supported. Refer to The moodCode attribute, for additional information.

Common Sub-Elements of substanceAdministration
Like the procedure clinical statement element, the substanceAdministration element supports the sub-elements of the act clinical statement element. This includes the three common sub-elements used throughout CDA (realmCode, typeId, and templateId).

It also includes the common clinical act sub-elements: id, code, text, statusCode, effetiveTime, and priorityCode.

It further includes three sub-elements (entryRelationship, reference, and precondition) used to express entry relationships (refer to Act relationship elements), and five sub-elements (specimen, informant, author, participant, and performer) used to express participations (refer to Participation elements).

Special Sub-Elements of substanceAdministration
There are also sub-elements that are unique to substanceAdministration:

  • repeatNumber: A numeric interval representing the number of times to repeat the substance administration.
  • routeCode: A coded element […]
Jun 12, 2014|Clinical Act Statements, Elements, Entities & Roles|

The consumable element

consumable is a Participation Element Under substanceAdministration
The consumable XML element in CDA documents, is one of several “participation” elements that connect roles/entities to clinical act statements. The following articles overview the relevant concepts for such elements:

  • The article “Entity” XML elements and “role” XML elements introduces the concept of an “entity” (person, place or thing and its permanent characteristics) and “role” (temporary context-sensitive characteristics of an entity, such as “role of a person entity being a patient”), in CDA. It also outlines the XML syntax used in CDA to represent entities in roles.
  • The article Clinical act statements, presents an overview of the clinical act statement that is the core of the CDA document structured body.
  • The article Participation elements focuses on the participation elements that connect a “role/entity combination” to a clinical act statement.

The consumable element is only used as a sub-element of the substanceAdministration clinical act statement. Refer to The substanceAdministration element, for additional information.

The Attributes of the consumable Element
The consumable element has a typeCode attribute that has a fixed and default value of “CSM”. When there is a fixed, default value for an attribute, that attribute is left out of the XML syntax for the element.

The consumable element can optionally take the nullFlavor attribute – refer to the article The nullFlavor attribute, for additional information.

The manufacturedProduct Sub-Element of the consumable Element
The primary sub-element of the consumable element is the sub-element named manufacturedProduct. This is the role element that the consumable element links to the substanceAdministration clinical act statement that is its parent element.

Nested within the manufacturedProduct sub-element of the consumable element, is the XML element representing the entity in that role – either a manufacturedLabeledDrug sub-element or a manufacturedMaterial sub-element – as well as an optional organization entity named manufacturerOrganization.

Refer to The manufacturedProduct element, The manufacturedLabeledDrug element, The manufacturedMaterial element, and The manufacturerOrganization element – for additional information.

Example
Here is an example of the use of the consumable element, highlighting the full use of its manufacturedProduct sub-element, with a corresponding entity (in the manufacturedMaterial sub-element) and organization entity (in the manufacturerOrganization sub-element):

<substanceAdministration classCode="SBADM" moodCode="EVN" negationInd="false">
...
<consumable>
<manufacturedProduct classCode="MANU">
...
<manufacturedMaterial>
<code code="33" codeSystem="2.16.840.1.113883.12.292"
displayName="pneumococcal polysaccharide vaccine, 23 valent"
codeSystemName="CVX">
<originalText>
[...]

Jun 12, 2014|Clinical Act Statements, Elements, Entities & Roles|

The manufacturedProduct element

manufacturedProduct is the Role Element Under consumable
The article The substanceAdministration element, describes the substanceAdministration clinical act statement that is used in CDA documents – as well as its XML syntax. The substanceAdministration clinical act statement represents a medication or immunization (or other substance) that is administered.

The article The consumable element, describes the sub-element of substanceAdministration named consumable, which is a participation element that connects the substanceAdministration clinical act statement to the role and entity elements that represent the substance being administered.

This article describes the manufacturedProduct which is the role element for the administered substance. The manufacturedProduct element connects either the manufacturedLabeledDrug or the manufacturedMaterial entity element to the consumable element, which is the parent element of manufacturedProduct.

manufacturedProduct is also the Role Element Under product
In addition to serving as the role element under substanceAdministration/consumable, the manufacturedProduct element also serves the same function as the role element under supply/product. In that case, manufacturedProduct is the role element for the supplied product and it connects either the manufacturedLabeledDrug or the manufacturedMaterial entity element to the product element, which is the parent element of manufacturedProduct.

The Attributes of manufacturedProduct
The manufacturedProduct element has a classCode attribute that has a fixed and default value of “MANU”. When there is a fixed, default value for an attribute, that attribute is left out of the XML syntax for the element.

The manufacturedProduct element can optionally take the nullFlavor attribute – refer to the article The nullFlavor attribute, for additional information.

The manufacturedLabeledDrug or manufacturedMaterial Sub-Element of the manufacturedProduct Element
The primary sub-element of the manufacturedProduct element is the entity element for the manufactured material. There are two possible elements that can be used for this entity – either the manufacturedLabeledDrug sub-element or the manufacturedMaterial sub-element. Refer to The manufacturedLabeledDrug element and The manufacturedMaterial element, for additional information.

The manufacturerOrganization Sub-Element of the manufacturedProduct Element
The manufacturerOrganization sub-element can be used to represent the organization that manufactured the material. It follows the standard XML syntax pattern for organizations in CDA.

Example
Here is an example of the use of the consumable element, highlighting the full use of its manufacturedProduct sub-element, with a corresponding entity (in the manufacturedMaterial sub-element) and organization (in the manufacturerOrganization sub-element):

<substanceAdministration classCode="SBADM" moodCode="EVN" negationInd="false">
...
<consumable>
<manufacturedProduct classCode="MANU">
...
<manufacturedMaterial>
<code code="33" codeSystem="2.16.840.1.113883.12.292"
displayName="pneumococcal polysaccharide vaccine, 23 valent"
[...]

Jun 12, 2014|Clinical Act Statements, Elements, Entities & Roles|

The manufacturedMaterial element

manufacturedMaterial is the Entity Element Under manufacturedProduct
The article The substanceAdministration element, describes the substanceAdministration clinical act statement that is used in CDA documents – as well as its XML syntax. The substanceAdministration clinical act statement represents a medication or immunization (or other substance) that is administered.

The article The consumable element, describes the sub-element of substanceAdministration named consumable, which is a participation element that connects the substanceAdministration clinical act statement to the role and entity elements that represent the substance being administered.

The article The manufacturedProduct element describes the role element for the administered substance.

The manufacturedProduct element connects one of two entity elements to the consumable element, which is the parent element of manufacturedProduct.

This article overviews one of those two possible entity elements, which is named manufacturedMaterial.

manufacturedProduct is also the Role Element Under product
In addition to serving as the role element under substanceAdministration/consumable, the manufacturedProduct element also serves the same function as the role element under supply/product. In that case, manufacturedProduct is the role element for the supplied product and it connects either the manufacturedLabeledDrug or the manufacturedMaterial entity element to the product element, which is the parent element of manufacturedProduct.

The XML syntax of manufacturedMaterial in CDA is the same, whether it is used under a manufacturedProduct element that is a sub-element of either supply/product or substanceAdministration/consumable.

The Attributes of manufacturedMaterial
The manufacturedMaterial element has a classCode attribute that has a fixed and default value of “MMAT”. When there is a fixed, default value for an attribute, that attribute is left out of the XML syntax for the element.

Like many entity elements, manufacturedMaterial has a determinerCode attribute. In the case of manufacturedMaterial entity element, the determinerCode attribute has a fixed (and default) value of “KIND”. Refer to The determinerCode attribute, for additional information.

Like the classCode attribute, the determinerCode attribute is generally left out of the XML syntax for manufacturedMaterial – as it has a fixed, default value.

The manufacturedMaterial element can optionally take the nullFlavor attribute – refer to the article The nullFlavor attribute, for additional information.

The Sub-Elements of manufacturedMaterial
The manufacturedMaterial element supports the three common sub-elements used throughout CDA (realmCode, typeId, and templateId).

The primary sub-element of the manufacturedMaterial element is named code. It contains the code for the actual medication, immunization, or other administered substance. code is thus one of the most important sub-elements within the entire XML syntax hierarchy of a substanceAdministration or supply clinical act statement.

Although code is an optional sub-element in the CDA XML schema, as a practical matter it should always be included. In C-CDA, in the template definitions for Medication Information and Immunization Medication Information (the two C-CDA templates […]

Jun 12, 2014|Clinical Act Statements, Elements, Entities & Roles|

The manufacturedLabeledDrug element

manufacturedLabeledDrug vs. manufacturedMaterial
In CDA, the manufacturedLabeledDrug XML element is almost identical in syntax and substance to the manufacturedMaterial element.

Conceptually, the manufacturedMaterial is intended to be more generic and cover all kinds of manufactured materials (medications, immunizations, etc.), while the manufacturedLabeledDrug is specifically intended for use with drugs.

However, as a practical matter, the manufacturedMaterial is more flexible (for example, it includes the lotNumberText sub-element that can also be relevant for labeled drugs). Thus, it is generally the case that manufacturedLabeledDrug is not used, and only manufacturedMaterial is used.

In fact, in C-CDA, the Medication Information template requires the use of manufacturedMaterial, not manufacturedLabeledDrug.

Thus, the remainder of this article is presented only for completeness, and is not really of practical interest to most CDA implementers.

Refer to The manufacturedMaterial element, for additional information about the use of manufacturedMaterial.

manufacturedLabeledDrug is an Entity Element Under manufacturedProduct
The article The substanceAdministration element, describes the substanceAdministration clinical act statement that is used in CDA documents – as well as its XML syntax. The substanceAdministration clinical act statement represents a medication or immunization (or other substance) that is administered.

The article The consumable element, describes the sub-element of substanceAdministration named consumable, which is a participation element that connects the substanceAdministration clinical act statement to the role and entity elements that represent the substance being administered.

The article The manufacturedProduct element describes the role element for the administered substance.

The manufacturedProduct element connects one of two entity elements to the consumable element, which is the parent element of manufacturedProduct.

This article overviews one of those two possible entity elements, the one named manufacturedLabeledDrug.

manufacturedProduct is also the Role Element Under product
In addition to serving as the role element under substanceAdministration/consumable, the manufacturedProduct element also serves the same function as the role element under supply/product. In that case, manufacturedProduct is the role element for the supplied product and it connects either the manufacturedLabeledDrug or the manufacturedMaterial entity element to the product element, which is the parent element of manufacturedProduct.

The XML syntax of manufacturedLabeledDrug in CDA is the same, whether it is used under a manufacturedProduct element that is a sub-element of either supply/product or substanceAdministration/consumable.

The Attributes and Sub-Elements of manufacturedLabeledDrug
The XML syntax for the attributes and sub-elements manufacturedLabeledDrug, as well as their meaning and use, are almost identical to those for manufacturedMaterial. Refer to The manufacturedMaterial element, for additional information.

The only significant difference is that the manufacturedLabeledDrug element does not support the lotTextNumber sub-element.

Other CDA PRO Know Articles Referenced In This Article

The manufacturerOrganization element

manufacturerOrganization is an Organization Element Under manufacturedProduct
The article The substanceAdministration element, describes the substanceAdministration clinical act statement that is used in CDA documents – as well as its XML syntax. The substanceAdministration clinical act statement represents a medication or immunization (or other substance) that is administered.

The article The consumable element, describes the sub-element of substanceAdministration named consumable, which is a participation element that connects the substanceAdministration clinical act statement to the role and entity elements that represent the substance being administered.

The article The manufacturedProduct element describes the role element for the administered substance.

The manufacturedProduct element connects one of two entity elements (either manufacturedMaterial or manufacturedLabeledDrug) to the consumable element, which is the parent element of manufacturedProduct.

The manufacturerOrganization sub-element of manufacturedProduct is the subject of this article. It is used to represent the organization that manufactured the material.

manufacturedProduct is also the Role Element Under product
In addition to serving as the role element under substanceAdministration/consumable, the manufacturedProduct element also serves the same function as the role element under supply/product. In that case, manufacturedProduct is the role element for the supplied product and it connects either the manufacturedLabeledDrug or the manufacturedMaterial entity element to the product element, which is the parent element of manufacturedProduct.

The XML syntax of manufacturerOrganization in CDA is the same, whether it is used under a manufacturedProduct element that is a sub-element of either supply/product or substanceAdministration/consumable.

manufacturerOrganization XML Syntax
The XML syntax and semantics of manufacturerOrganization are the same as for all organizations in CDA – refer to Organization in CDA, for details.

Example
Here is an example of the use of the manufacturerOrganization sub-element, in the context of a manufacturedProduct element, which in turn is a sub-element of a consumable element:

<substanceAdministration classCode="SBADM" moodCode="EVN" negationInd="false">
...
<consumable>
<manufacturedProduct classCode="MANU">
...
<manufacturedMaterial>
<code code="33" codeSystem="2.16.840.1.113883.12.292"
displayName="pneumococcal polysaccharide vaccine, 23 valent"
codeSystemName="CVX">
<originalText>
Pnuemococcal polysaccharide vaccine, 23 valent (Pnuemovax)
</originalText>
</code>
</manufacturedMaterial>
<manufacturerOrganization>
[...]

Jun 12, 2014|Clinical Act Statements, Elements, Entities & Roles|

The maxDoseQuantity element

maxDoseQuantity is a Sub-Element of substanceAdministration
The article The substanceAdministration element, describes the substanceAdministration clinical act statement that is used in CDA documents – as well as its XML syntax. The substanceAdministration clinical act statement represents a medication or immunization (or other substance) that is administered.

maxDoseQuantity is one of the sub-elements of substanceAdministration. It is used to indicate the maximum dosage of a substance (e.g. a medication) that may be administered over a period of time.

The maxDoseQuantity element is used when the regimen for the substance is “take as needed”, or when the doseQuantity sub-element of substanceAdministration represents a dosage range, and the medication schedule is periodic.

So, for example, if a prescription calls for one or two 100mg tablets to be taken every 4 hours, the maxDoseQuantity element can be used to indicate that no more than 800mg (8 tablets, in this case) can be taken in a 24 hour period.

maxDoseQuantity XML Syntax
The XML syntax for maxDoseQuantity is unique in CDA, as it is expressed as a ratio of two physical quantities. The two physical quantities are contained in XML sub-elements of maxDoseQuantity that are named numerator and denominator.

The numerator represents a quantity of the substance and the denominator represents a period of time. For example:

<substanceAdministration classCode="SBADM" moodCode="EVN">
   ...
   <maxDoseQuantity>
      <numerator value="800" unit="mg"/>
      <denominator value="24" unit="h"/>
   </maxDoseQuantity>
   ...
</substanceAdministration>

Other CDA PRO Know Articles Referenced In This Article

Jun 11, 2014|Clinical Act Statements, Elements, Quantities|