CDA support
| Early access Please note that the following documentation and the underlying code for CDA support is early access and might be subject to change. |
Support for CDA processing in IPF is provided by several IPF components. This is summarized in the following table.
| Component | Description | Documentation |
|---|---|---|
| modules-cda | Provides functionality for creating, parsing, rendering, and validation CDA documents | Generic CDA Support |
| platform-camel-cda | Provides HL7 extensions to the Camel DSL. | DSL Extensions |
Clinical Document Architecture - a brief overview
The HL7 Clinical Document Architecture (CDA) is an XML-based markup standard intended to specify the encoding, structure and semantics of clinical documents for exchange. CDA is part of the HL7 version 3 standard.
By the use of XML, the HL7 v3 standard and coded vocabularies, CDA allows for the exchange of documents that are both machine and human-readable enabling electronic processing for decision support etc whilst being easily retrieved and used by the people who need them.
Support for 'vanilla' CDA
IPF provides support for
- creating CDA document objects from scratch
- rendering a CDA document object into its XML representation
- parsing of existing CDA documents
- extracting individual pieces of information from CDA documents
As in IPF's HL7 module, support really means more than just providing some sort of CDA API for its model and services. CDA documents can be created and analyzed by means of a domain-specific language (DSL) that hides away most of the technical details you usually encounter when dealing with complex XML documents.
| CDA specification Even though some technical details are hidden, the domain-specific details are not (at least for the generic CDA support). Be sure to read the CDA specification and have a printed copy of the CDA R-MIM at hands while working with CDA documents. |
Support for CDA content profiles
In a technical sense, a CDA content profile defines a set of constraints on CDA that define how to use the CDA to communicate clinical documents bound to a certain use case, e.g. clinical summaries. CDA content profiles are also often referred to as CDA Implementation Guides.
The first content profile to be supported is the Continuity of Care Document (CCD) profile, as it serves as a baseline for many other profiles published by standard bodies like HL7, IHE, or HITSP.
Generic CDA support
CDA support is assembled from a variety of sources.
- The underlying CDA object model, parser, and renderer is provided by Open Health Tools (OHT)'s IHE Profiles project. The OHT libraries are redistributed as part of IPF's CDA support.
- Tooling to create and validate CDA documents are provided natively by IPF.
- CDA Parser, Renderer and Validator are adapted to implement the Module Adapters of IPF. This ensures, that they can be used as processors in Camel-based integration routes.
| Use of IPF CDA without Apache Camel IPF's generic CDA support has no dependencies on Apache Camel and can therefore as well be used independently of integration solutions based on Apache Camel. |
The CDA builder used to create CDA documents is strongly based on Groovy's Builders and defines its own kind of domain specific language. Compared to "traditional" APIs, the natural hierarchical syntax makes it very easy to assemble parts of a CDA document or a whole CDA document, while at the same time enforces a significant amount of restrictions defined by the specification.
| Background info: MetaBuilder CDA builder uses and is derived from MetaBuilder, a more sophisticated builder implementation, which allows for a declarative builder implementation. In fact, the CDA Builder itself is defined using MetaBuilder and Groovy meta class programming. |
Configuration
For setting up Maven follow the instructions on the IPF development page. If you want to use the CDA Features standalone in your Groovy projects then you only need to include
<dependency> <groupId>org.openehealth.ipf.modules</groupId> <artifactId>modules-cda</artifactId> <version>${ipf-version}</version> </dependency>
For using the CDA support inside Camel routes you need to include the following dependency:
<dependency> <groupId>org.openehealth.ipf.platform-camel</groupId> <artifactId>platform-camel-cda</artifactId> <version>${ipf-version}</version> </dependency>
where ${ipf-version} must be replaced with the IPF version you want to use.
Like the HL7 DSL, IPF adds a couple of Groovy metaclass extensions on top of the underlying CDA Object model to facilitate accessing CDA documents. You can register these extensions manually:
import org.openehealth.ipf.modules.cda.builder.CDAR2ModelExtension ... ExpandoMetaClass.enableGlobally() new CDAR2ModelExtension().extensions.call()
Usually you would use a Spring ApplicationContext to register the extensions, especially in conjunction with Camel routes:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <camel:camelContext id="camelContext"> <camel:routeBuilder ref="routeBuilder"/> </<camel:camelContext> ... <bean id="cdaModelExtension" class="org.openehealth.ipf.modules.cda.builder.CDAR2ModelExtension"> </bean> <bean id="routeModelExtender" class="org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender"> <property name="routeModelExtensions"> <list> ... <ref bean="cdaModelExtension" /> </list> </property> </bean>
Creating generic CDA documents
The basic pattern of how to create a CDA document is
import org.openehealth.modules.cda.builder.CDAR2Builder .... def builder = new CDAR2Builder() def document = builder.build { clinicalDocument { // add Header information // add Body information }
Header and Body information is defined by a sequence of nested elements, which are described in more detail below.
Note that the CDA builder does not assemble the XML document directly. Instead it builds up an internal model of the CDA document; rendering to XML is a seperate step (see section on Parsing and Rendering). This comes with a number of advantages:
- the order of the elements built within an hierarchy level does not matter
- you don't have to care about the type of an element - the builder knows that e.g. a code attribute inside a ClinicalDocument is of HL7 RIM type CE.
- unknown elements or attributes are detected as well as wrong cardinalities etc.
- the builder itself comes with further rules that are covered by neither the CDA XML schema nor the underlying object model, e.g. that codes of type CE must either have a nullFlavor set or at least a code attribute.
- there are shortcut notations for a less verbose syntax, in particular with respect to simple types and enumerated values, e.g. a HL7 RIM PQ type can be instantiated by string consisting of value and unit. Thus, pq(value:86.0, unit:'kg') and pq('86 kg') are equivalent.
Groovy builders
Builders are based on the builder pattern from the GOF design pattern book. It provides a way to build your own DSL and represents a powerful concept in Groovy.
To put it short, Groovy builders allow to build up a hierarchical structure of nodes, while each node may have attributes (i.e. a set of key/value pairs) and content. Obviously, this matches very well with XML documents, thus also for CDA.
IPF's CDA support uses MetaBuilder, that adds an extra layer on top of plain Groovy builders.
| Instantiate CDAR2Builder once! Instantiating org.openehealth.modules.cda.builder.CDAR2Builder instances is very expensive. It can take several seconds of ramp-up time to initialize all builder rules defined for generating CDA documents. |
The general syntax for creating a CDA element is defined recursively. The [brackets] contain optional syntax.
top-element = schema-name([ value ], [ attributes ]) [ nested-elements ]
elements = element [ elements ]
element = name([value], [ attributes ]) [ nested-elements ]
nested-elements = '{' elements '}'
attributes = attribute [, attributes ]
attribute = key-name : value
The syntax elements (printed in italics) is listed below;
| syntax element | description | examples |
|---|---|---|
| schema-name | The schema (class) of the outermost CDA element that is created in the builder statement. schema-name often corresponds closely with the HL7v3 RIM type of the corresponding XML element name. | clinicalDocument, section, ii |
| name | Name of a CDA element. name often corresponds closely with the the corresponding XML element name. | author, id, code |
| key-name | Name of a nested CDA element or attribute. Used when the element or attribute is provided in the value instead of being recursively built | root, code |
| value | A valid Groovy expression that returns a object reference. Can also be a primitive value | 57, '1976', object |
Let's start with how the header information of a CDA document is assembled.
CDA Header
Building the CDA header also explains the different kinds of elements and attributes and how they a created using the CDA builder.
def document = builder.build {
clinicalDocument {
// templateId(root:'2.16.840.1.113883.3.27.1776') // 1
id(root:'2.16.840.1.113883.19.4', extension:'c266') // 2
code( // 3
code:'11488-4',
codeSystem:'2.16.840.1.113883.6.1',
codeSystemName:'LOINC',
displayName:'Consultation note'
)
effectiveTime('20000407') // 4
title('Good Health Clinic Consultation Note') // 5
versionNumber(2) // 6
...
}
}
clinicalDocument is the schema-name, containing a closure to nest other elements. id is the name for the first element - the CDA Builder knows the internal structure of a CDA document and creates an object of the HL7v3 RIM type II. root and extension are the key-name for the corresponding attributes of a II element, and they are assigned the value '2.16.840.1.113883.19.4' and 'c266', respectively.
Let's examine this piece of code line by line
- In general, infrastructure attributes (templateId, classCode, moodCode, typeCode) with static defaults are not required to be set. Generic CDA documents always carry the same templateId, so you can omit this element.
- This adds an id element with a root and extension attribute. Under the hood, the builder checks that the root attribute is present, otherwise an Exception is thrown. Also note that id is mandatory, so omitting would throw an Exception, too.
- Adding a code just works like adding the id. Remember, you never have to care about the class of the corresponding CDA model object.
- Looking at the CDA specification, effectiveTime and title appear in inverted order. As we are not building the XML document directly, we don't have to care, as the rendering process restores the correct ordering of elements. effectiveTime requires a date value (HL7 TS datatype), but the builder allows to use its simple string representation (YYYYMMDD).
- The title is of HL7 ST datatype. Again, you can just pass a string and conversion is done for you.
- The versionNumber is of HL7 INT datatype. Here you can pass an integer value.
The next part of the CDA header definition introduces a couple of other 'shortcuts' available.
...
confidentialityCode('N') // 1
// code:'N',
// codeSystem:'2.16.840.1.113883.5.25')
recordTarget { // 2
patientRole {
id('12345@2.16.840.1.113883.19.5') // 3
// extension='12345'
// root='2.16.840.1.113883.19.5'
patient {
name {
given('Henry')
family('Levin')
suffix('the 7th')
}
administrativeGenderCode('M') // 4
// code='M'
// codeSystem='2.16.840.1.113883.5.1'
birthTime('19320924')
}
providerOrganization {
id('2.16.840.1.113883.19.5') // 5
}
}
}
...
- Codes with more or less fixed code systems have their OID and, if applicable, code system name predefined. In this case, you can specify the code as content and skip the codeSystem and codeSystemName attributes. The rendered CDA XML will nevertheless contain all attributes.
- In this block, we traverse the RIM model from the document act over a Participation (recordTarget) and a Role (patientRole) to the Entity (patient).
- id elements can be created by specifying a 'extension@root' content rather than the attribute map as shown above. Both notations are equivalent.
- This is another example for a predefined code system.
- id elements may contain only a root attribute, but no extension. In this case, you can provide the root attribute as content.
For reference purposes, here's the remainder of a rather complete CDA header definition. Note that most of the elements are optional - check the CDA specification or RMIM diagram. If any mandatory elements are skipped, the CDA Builder will complain with an Exception before you get the clinical document as result.
...
author {
time('2000040714')
assignedAuthor {
id(extension:'KP00017',root:'2.16.840.1.113883.19.5')
assignedPerson {
name {
given('Robert')
family('Dolin')
suffix('MD')
}
}
representedOrganization {
id(root:'2.16.840.1.113883.19.5')
}
}
}
custodian {
assignedCustodian {
representedCustodianOrganization {
id('2.16.840.1.113883.19.5')
name('Good Health Clinic')
}
}
}
legalAuthenticator {
time('20000408')
signatureCode('S')
assignedEntity {
id(extension:'KP00017', root:'2.16.840.1.113883.19.5')
assignedPerson {
name {
given('Robert')
family('Dolin')
suffix('MD')
}
}
representedOrganization {
id('2.16.840.1.113883.19.5')
}
}
}
relatedDocument(typeCode:'APND') { // 1
parentDocument {
id(extension:'a123', root:'2.16.840.1.113883.19.4')
setId(extension:'BB35', root:'2.16.840.1.113883.19.7')
versionNumber(1)
}
}
componentOf {
encompassingEncounter {
id(extension:'KPENC1332', root:'2.16.840.1.113883.19.6')
effectiveTime {
low('20000407')
}
encounterParticipant(typeCode:'CON') {
time('20000407')
assignedEntity {
id(extension:'KP00017',root:'2.16.840.1.113883.19.5')
assignedPerson {
name {
given('Robert')
family('Dolin')
suffix('MD')
}
}
representedOrganization {
id(root:'2.16.840.1.113883.19.5')
}
}
}
location {
healthCareFacility {
code(
code:'GIM',
codeSystem:'2.16.840.1.113883.5.10588',
displayName:'General internal medicine clinic'
)
}
}
}
}
}
}
CDA body
The body of a CDA document is created correspondingly like the header part.
The CDA body can be either an unstructured blob, or can be comprised of structured markup. Every CDA document has one body at most - associated with the ClinicalDocument class through the component relationship -, which can be either non-structured or structured.
nonXMLBody() represents a document body that is in some format other than XML, e.g. a image of PDF document. nonXMLBody.text is used to reference data that is stored externally to the CDA document or to encode the data directly inline.
...
component {
nonXMLBody {
text(
mediaType: 'application/pdf',
representation: 'B64',
'JVBERi0xLjMKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdG...'
)
}
}
...
structuredBody() represents an XML document body that is comprised of one or more document sections. Document sections can nest, can override context propagated from the header, and can contain narrative and CDA entries.
...
component {
structuredBody {
component { // Section 1
section {
...
}
}
component { // Section 2
section {
...
}
}
... // ...
}
}
...
Narrative Block
section.text is used to store a narrative text and is therefore referred to as the CDA Narrative Block.
For structured bodies, it is the document originator's responsibility to properly populate the Narrative Block, regardless of whether information is also conveyed in CDA entries. Vice versa, it is the recipient's responsibility to properly render the narrative block in human readable manner, e.g. using a XSL transformation.
The CDA DSL for the Narrative Block follows exactly chapter 4.3.5 of the CDA specification. See the examples below.
...
section {
title('Some title'}
text('A simple narrative content')
...
}
...
...
section {
title('Some title'}
text {
list {
item('Theodur 200mg BID')
item('Proventil inhaler 2puffs QID PRN')
item('Prednisone 20mg qd')
item('HCTZ 25mg qd')
}
}
...
}
...
...
section {
title('Some title'}
text {
paragraph('Payer information')
table(border: '1', width: '100%') {
thead {
tr {
th('Payer name')
th('Policy type')
th('Covered Party ID')
th('Authorizations')
}
}
tbody {
tr {
td('Good Health Insurance')
td('Extended healthcare / Self')
td('14d4a520-7aae-11db-9fe1-0800200c9a66')
td {
linkHtml(href: 'Colonoscopy.pdf', 'Colonoscopy')
}
}
}
}
}
...
}
...
Structured part
Sections can define participants like author, informant, and subject (i.e. the primary target of the recorded entries). Sections can also have relationships to entries, which contain structured computer-processable components. Each section can contain zero to many entries. There is a number of entry classes:
- act
- encounter
- observation
- observationMedia
- organizer
- procedure
- regionOfInterest
- substanceAdministration
- supply
Entries in return can have participants and relationships to other entries. For details on these entry classes, please refer to the CDA R2 specification.
With CDA Builder you create the structured part following the same patterns as with the CDA Header of Narrative Block. The following example creates a substanceAdministration entry.
...
structuredBody {
component {
section {
title('My title')
text('My narrative text')
code(....)
entry {
substanceAdministration(classCode:'PROC', moodCode:'EVN') {
consumable{
manufacturedProduct {
manufacturedLabeledDrug {
code(
code:'10312003',
codeSystem:'2.16.840.1.113883.6.96' ,
codeSystemName:'SNOMED CT',
displayName:'Prednisone preparation')
}
}
}
}
}
...
}
}
...
}
Sections and their contained participants and entries can get arbitrarily complex. Furthermore, the structure is very generic, i.e. it's possible to express a certain clinical concept in a variety of ways. Unconstrained CDA is therefore not very helpful when it comes to real semantic interoperability. To be useful in the real world, CDA has to be constrained, which can happen on at least two levels:
- using section-level templates
- using entry level templates
The RIM's InfrastructureRoot class contains an attribute, templateId, which is available for use in CDA. Thus, CDA provides a mechanism to reference a template or implementation guide that has been assigned a unique template identifier.
CDA templates are usually collected in CDA content profiles, one of which is the CCD (Continuity of Care Document).
CDA builder tips
Including complete parts
With CDA Builder it's possible to construct a complete document in a single builder statement. As CDA documents are built from several very well separated parts, it might as well make sense to create such a part for itself and include it into the final document in a separate step. This way, a document part can also be reused for several CDA documents.
CDA builder supports this strategy out of the box. The cardinality of such a part within its containing element plays an important role.
Single cardinality
In this example, we create a element of type CE and include it into a code element inside a Supply clinical statement. Alternatively, we can also build the code inline:
...
def myCode = builder.build {
ce(code:'30549001',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Suture removal')
}
// Assign code as attribute
def myEntry = builder.build {
entry {
supply(classCode:'SPLY', moodCode:'EVN', code:myCode) {
statusCode(code:'completed')
effectiveTime(value:'200004071430')
}
}
}
// Alternative: build myCode inline
myEntry = builder.build {
entry {
supply(classCode:'SPLY', moodCode:'EVN') {
code(code:'30549001',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Suture removal')
statusCode(code:'completed')
effectiveTime(value:'200004071430')
}
}
}
...
The difference is that myCode is assigned as an attribute like classCode or moodCode is, while when being built inline it is nested under the supply element. Also note that for pre-constructing myCode you need to know the schema name of its HL7v3 type (ce in this case), while when being built inline the CDA Builder knows to instantiate a CE object for a Supply code.
Multiple cardinality
In this case, the complete part must be added to its container collection instead of just being assigned to it. Unfortunately, this is currently not possible within a CDA builder statement.
...
def mySection = builder.build {
section {
title('My section')
}
}
mySection.entry.add(myEntry)
...
Variable-typed values
In some cases, the CDA specification defines attributes to be of either any type or any subtype of a certain type. Most importantly, the value of an observation clinical statement is variable-typed. As another example, the effectiveTime of a substanceAdministration is of type GTS, which can be a range of different timing sub-types.
In these cases, obviously, the CDA builder can not infer the exact type from a attribute name, just because it's variable. Therefore, you have to give a hint, as shown in the following fictive example:
def myObservationEntry = builder.build {
entry {
observation {
id('9d3d416d-45ab-4da1-912f-4583e0632000')
....
value(
make {
snomedCode(code:'40275004', displayName:'Contact dermatitis') {
translation(
code: '692.9',
codeSystem: '2.16.840.1.113883.6.2',
codeSystemName: 'ICD9CM',
displayName: 'Contact Dermatitis, NOS')
}
}
)
value(
make { _int(10) } // int is a reserved Groovy keyword,
// so we have to use _int
)
...
}
}
}
This observation has two values: a (SNOMED) code and an integer. You simply wrap the type into a make element. In fact, make is more or less an abbreviation of builder.build, i.e. you create an object of the desired type and assign it to the variable-typed attribute.
Using regular Groovy code inside CDA builder
As with the HL7 DSL of IPF, the Groovy Builder is an internal DSL, i.e. it is expressed by means of the Groovy programming language and can be executed without an additional parser. Therefore, it is also possible to mix and match CDA builder code with regular Groovy code.
The following example shows how to derive a Medication section from a tabular data structure, using loops, conditiional statements, and debugging output.
...
// Some medication data, stored in a list of maps
def data = [
[medication:'Albuterol inhalant',
instructions:'2 puffs QID',
startDate:null,
period:'6 h',
routeCode:'IPINHL',
dose:'2',
administrationUnitCode:'415215001',
medicationCode:'307782',
id:'cdbd33f0-6cde-11db-9fe1-0800200c9a66'],
[medication:'Prednisone',
instructions:'20mg PO daily',
startDate:'20000328',
period:'24 h',
routeCode:'PO',
dose:'1',
medicationCode:'312615',
id:'cdbd5b03-6cde-11db-9fe1-0800200c9a66']
]
...
POCDMT000040Section section = builder.build {
section {
templateId('2.16.840.1.113883.10.20.1.8')
code('10160-0@2.16.840.1.113883.6.1')
title('Medications')
text {
table(border:'1',width:'100%') {
thead {
tr {
th('Medication')
th('Instructions')
th('Start date')
}
}
tbody {
// Iterate over all medications. Must assign a iteration variable!
data.each { m ->
tr {
td(m.medication)
td(m.instructions)
td(m.startDate ?: '') // Avoid 'null' output
}
}
}
}
}
// Iterate over all medications. Must assign a iteration variable!
data.each { m ->
// Insert diagnostic output...
println "Creating medication " + m.medication
entry {
substanceAdministration(classCode:'SBADM', moodCode:'EVN'){
id(m.id)
// Conditional element. Skip if not available
if (m.startDate) {
effectiveTime(make {
pivlts { period(m.period) }
})
}
routeCode(code:m.routeCode, codeSystem:'2.16.840.1.113883.5.112')
doseQuantity(m.dose)
consumable {
manufacturedProduct {
manufacturedLabeledDrug {
code(code:m.medicationCode,
codeSystem:'2.16.840.1.113883.6.96') {
originalText(m.medication)
}
}
}
}
}
}
}
}
}
Assert.assertNotNull(section)
// We have two sections ...
Assert.assertEquals 2, section.entry.size()
// with individual IDs ...
Assert.assertEquals 'cdbd33f0-6cde-11db-9fe1-0800200c9a66',
section.entry[0].substanceAdministration.id[0].root
Assert.assertEquals 'cdbd5b03-6cde-11db-9fe1-0800200c9a66',
section.entry[1].substanceAdministration.id[0].root
// ... the first medication has no start date
Assert.assertEquals 0, section.entry[0].substanceAdministration.effectiveTime.size()
Assert.assertEquals 1, section.entry[1].substanceAdministration.effectiveTime.size()
Parsing and Rendering of CDA documents
Parsing
You have two options for parsing CDA documents
- Use an instance of org.openehealth.ipf.modules.cda.CDAR2Parser to parse a document into its internal CDA object model
- As CDA documents are plain XML, use a native Groovy XML parser (e.g. XMLSlurper) to parse it into a hierarchy of generic Node objects.
| Aspect | CDAR2Parser | XMLSlurper |
|---|---|---|
| processing speed | slow | fast |
| direct access using Groovy GPath syntax | yes | yes |
| usage of CDA model 'shortcuts' | yes | no |
| depthfirst/breadtfirst traversal in element tree | no | yes |
This is an example on how to parse a CDA document from the file system using the CDAR2Parser
import org.openehealth.ipf.modules.cda.CDAR2Parser InputStream is = getClass().getResourceAsStream("/SampleCDADocument.xml") def clinicalDocument = new CDAR2Parser().parse(is)
Parsing using Groovy's XMLSlurper is equivalent:
InputStream is = getClass().getResourceAsStream("/SampleCDADocument.xml") def clinicalDocument = new XMLSlurper().parse(is)
The next section explains for both cases, how you can access and extract data from the parsed document.
Extracting information from CDA documents
Extracting data from the parsed document differs a bit depending on whether CDAR2Parser or Groovy's XMLSlurper has been used for parsing. In the latter case, please also take a look at the corresponding Groovy documentation.
Whether to use CDAR2Parser or XMLSlurper
|
Depending on the parsing strategy, there are subtle differences on how to access the data:
| Aspect | CDAR2Parser | XMLSlurper |
|---|---|---|
| usage of CDA model 'shortcuts' | yes | no |
| depthfirst/breadtfirst traversal in element tree | no | yes |
| accessing attributes | element.attribute | element.@attribute |
| accessing attribute/element content | depends on data type | xxx.text() |
The following code snippets shows how to select and extract data from the sample CDA document contained in the CDA specification.
Parsed with CDAR2Parser
InputStream is = getClass().getResourceAsStream(
"/SampleCDADocument.xml");
def clinicalDocument = new CDAR2Parser().parse(is);
assertNotNull(clinicalDocument);
def components = clinicalDocument.component.structuredBody.component
// Simple navigation
assertEquals('en-US', clinicalDocument.languageCode.code)
assertEquals('KP00017', clinicalDocument.author[0].assignedAuthor.id[0].extension)
// Avoid NullPointerException by with safe dereferencing using the ?. operator
assertEquals('KP00017', clinicalDocument?.author[0].assignedAuthor.id[0].extension)
def clinicalDocument2 = null
assertNull(clinicalDocument2?.languageCode?.code)
// Use any(Closure) to check if the predicate is true at least once
assertTrue(components.any { it.section.code.code == '10164-2' })
// Use every(Closure) to check if the predicate is always true
assertTrue(components.every { it.section.code.codeSystem == '2.16.840.1.113883.6.1' })
// Use find(Closure) to return the first value matching the closure condition
assertEquals('History of Present Illness',
components.find { it.section.code.code == '10164-2' }.section.title.text)
// Use findAll to return all values matching the closure condition
assertEquals(1, components.findAll { it.section.code.code == '10164-2' }.size())
// Use findIndexOf to return the index of the first item that matches the
// condition specified in the closure.
assertEquals(1, components.findIndexOf { it.section.code.code == '10153-2' })
// Use collect to iterate through an object transforming each value into a
// new value using the closure as a transformer, returning a list of transformed values.
assertEquals([
'History of Present Illness',
'Past Medical History',
'Medications',
'Allergies and Adverse Reactions',
'Family history',
'Social History',
'Physical Examination',
'Labs',
'In-office Procedures',
'Assessment',
'Plan'],
components.collect { it.section.title.text })
// The spread operator parent*.action is equivalent to
// parent.collect{ child -> child?.action }
assertEquals([
'History of Present Illness',
'Past Medical History',
'Medications',
'Allergies and Adverse Reactions',
'Family history',
'Social History',
'Physical Examination',
'Labs',
'In-office Procedures',
'Assessment',
'Plan'],
components.section.title.text)
}
Parsed with XMLSlurper
InputStream is = getClass().getResourceAsStream(
"/SampleCDADocument.xml");
def clinicalDocument = new XmlSlurper().parse(is)
def components = clinicalDocument.component.structuredBody.component
// Simple navigation
assertEquals('en-US', clinicalDocument.languageCode.@code.text())
assertEquals('KP00017', clinicalDocument.author[0].assignedAuthor.id[0].@extension.text())
// Avoid NullPointerException by with safe dereferencing using the ?. operator
assertEquals('KP00017', clinicalDocument?.author[0].assignedAuthor.id[0].@extension.text())
def clinicalDocument2 = null
assertNull(clinicalDocument2?.languageCode?.@code?.text())
// Use any(Closure) to check if the predicate is true at least once
assertTrue(components.any { it.section.code.@code == '10164-2' })
// Use every(Closure) to check if the predicate is always true
assertTrue(components.every { it.section.code.@codeSystem == '2.16.840.1.113883.6.1' })
// Use find(Closure) to return the first value matching the closure condition
assertEquals('History of Present Illness',
components.find { it.section.code.@code == '10164-2' }.section.title.text())
// Use findAll to return all values matching the closure condition
assertEquals(1, components.findAll { it.section.code.@code == '10164-2' }.size())
// Use findIndexOf to return the index of the first item that matches
// the condition specified in the closure.
assertEquals(1, components.findIndexOf { it.section.code.@code == '10153-2' })
// Use collect to iterate through an object transforming each value into a
// new value using the closure as a transformer, returning a list of transformed values.
assertEquals([
'History of Present Illness',
'Past Medical History',
'Medications',
'Allergies and Adverse Reactions',
'Family history',
'Social History',
'Physical Examination',
'Labs',
'In-office Procedures',
'Assessment',
'Plan'],
components.collect { it.section.title.text() })
// The spread operator parent*.action is equivalent to
// parent.collect{ child -> child?.action }
assertEquals([
'History of Present Illness',
'Past Medical History',
'Medications',
'Allergies and Adverse Reactions',
'Family history',
'Social History',
'Physical Examination',
'Labs',
'In-office Procedures',
'Assessment',
'Plan'],
components.section.title*.text())
// Use depthFirst (or '**') to search for elements anywhere in
// the structure
def drugCodes = clinicalDocument.depthFirst().findAll
{ it.name() == "manufacturedLabeledDrug" }.code*.@code
assertEquals([
'66493003',
'91143003',
'10312003',
'376209006',
'10312003',
'331646005' ],
drugCodes*.text())
// Use of helper functions to encapsulate commonly used GPath expressions
def drugCodes2 = findAllElements(clinicalDocument, "manufacturedLabeledDrug").code*.@code
assertEquals(drugCodes, drugCodes2)
}
private Collection findAllElements(GPathResult result, String name) {
return result.depthFirst().findAll { it.name() == name }
}
Rendering
CDA documents created by either parsing or building their internal object representation can be easily rendered by using an instance of org.openehealth.ipf.modules.cda.CDAR2Renderer.
import org.openehealth.ipf.modules.cda.CDAR2Renderer def document = builder.build { clinicalDocument { ... } } def renderer = new CDAR2Renderer() def opts = [XMLResource.OPTION_DECLARE_XML : true, // include XML declaration XMLResource.OPTION_ENCODING : 'utf-8'] // encode as utf-8 println(renderer.render(document, opts))
The output looks like this:
<?xml version="1.0" encoding="utf-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"> <id extension="c266" root="2.16.840.1.113883.19.4"/> <code code="11488-4" codeSystem="2.16.840.1.113883.5.1" codeSystemName="LOINC" displayName="Consultation note"/> <title>Good Health Clinic Consultation Note</title> <effectiveTime value="20000407"/> ... </ClinicalDocument>
Note that the renderer cared about adding proper namespaces to the XML document.
Validating CDA documents
CDA document instances in their XML representation can be validated using the W3C XML Schema and Schematron validators. The class org.openehealth.ipf.modules.cda.CDAR2Constants provides constants for the location of schema and schematron resources, e.g.
import org.openehealth.ipf.modules.cda.CDAR2Constants import org.openehealth.ipf.commons.xml.XsdValidator ... def validator = new XsdValidator() validator.validate(xmldoc, CDAR2Constants.CDAR2_SCHEMA) ...
CDA Validation is nicely included into IPF's DSL extensions mechanism. For details refer to CDA DSL Extensions
Note that currently only XML-encoded CDA documents can be validated.
However, when creating a CDA document from scratch, the CDA Builder restricts this process by applying rules very close alongside the CDA MIF definition and the derived XML schema, even though you are working on an object structure rather than an XML document. So, there's a good chance that CDA documents created with the CDA Builder also pass the validators.
DSL extensions
This section describes DSL extensions provided by the platform-camel-cda component. The extensions allow to seemlessly integrate CDA parser, renderer, and validator into Camel/IPF integration routes.
CDA DSL extensions are defined in the org.openehealth.ipf.platform.camel.cda.extend.CDAModelExtension.groovy class. Their main purpose is to make CDA processing features available in Camel routes. Extensions provided by this class may well be combined with other extensions that comply with the DSL extension mechanism.
Configuration
For using the CDA DSL extensions you need to include the following dependency:
<dependency> <groupId>org.openehealth.ipf.platform-camel</groupId> <artifactId>platform-camel-cda</artifactId> <version>${ipf-version}</version> </dependency>
This transitively includes the platform-camel-core and modules-cda libraries as well.
CDA (un)marshalling
The cdar2() DSL extension allows you to convert between CDA document strings (or streams) and org.openhealthtools.ihe.common.cdar2.POCDMT000040ClinicalDocument objects. For example, to unmarshal a CDA document from a string (or stream) use
// ...
from('...')
.unmarshal().cdar2()
.to('...')
// ...
in your Groovy route definitions. As mentioned in the Parsing sections, CDA documents are plain XML, and if you do not require a semantic CDA model, you can also use Groovy's XMLSlurper, which reads the document into a hierarchy of Node objects. Please refer to DSL extensions for Groovy XML processing for more detail.
// ...
from('...')
.unmarshal().gpath()
.transmogrify { gpathResult ->
// process XML ...
}
.to('...')
// ...
To marshal a CDA document to an output stream use
// ...
from('...')
.marshal().cdar2()
.to('...')
// ...
(Un)marshaling options
Unlike HL7 message adapter unmarshalling and marshalling, CDA has no marshalling/unmarshalling options.
CDA document validation
Marshaled CDA documents can be validated in routes with the validate().cdar2() extension. This basically validates whether the document is compliant with the CDA XML schema. Note that you currently can not validate the internal representation of a CDA document
// ...
from('...')
.onException(ValidationException.class)
// handle the validation exception
.end()
.marshal().cdar2()
.validate().xsd().cdar2()
.to('...')
// ...
You can also validate during parsing with XMLSlurper:
...
import static org.openehealth.ipf.modules.cda.CDAR2Constants.CDAR2_SCHEMA
// ...
from('...')
.onException(Exception.class)
// handle the Camel Runtime exception
.end()
.unmarshal().gpath(CDAR2_SCHEMA, true)
...
.to('...')
// ...
CDA Builder Syntax Reference
General Builder Syntax
top-element = schema-name([ value ], [ attributes ]) [ nested-elements ]
elements = element [ elements ]
element = name([value], [ attributes ]) [ nested-elements ]
nested-elements = '{' elements '}'
attributes = attribute [, attributes ]
attribute = key-name : value
The syntax elements (printed in italics) is listed below;
| syntax element | description | examples |
|---|---|---|
| schema-name | The schema (class) of the outermost CDA element that is created in the builder statement. schema-name often corresponds closely with the HL7v3 RIM type of the corresponding XML element name. | clinicalDocument, section, ii |
| name | Name of a CDA element. name often corresponds closely with the the corresponding XML element name. | author, id, code |
| key-name | Name of a nested CDA element or attribute. Used when the element or attribute is provided in the value instead of being recursively built | root, code |
| value | A valid Groovy expression that returns a object reference. Can also be a primitive value | 57, '1976', object |
CDA Schema Names
When creating a CDA document using a single builder statement, you only need to know the top-level element (clinicalDocument for plain CDA, continuityOfCareDocument for CCD). The CDA builder automatically instantiates an object of the correct type for each of the elements below. However, there are situations where you need to know the schema-name for a specific type:
- when you create otherwise nested CDA elements of their own in order to assemble a complete CDA document from them in a later step
- when you need to indicate the type of a variable-typed element (ANY).
For referencing a schema-name and the definition of attributes and nested elements of corresponding schema, for now please look at the respective declaration files in the IPF source repository. We'll provide a more readable reference once the schemas have stabilized.
- Data Types: http://gforge.openehealth.org/svn/ipf/trunk/ipf/modules/cda/src/main/resources/builders/DataTypeBuilder.groovy
- RIM Entities: http://gforge.openehealth.org/svn/ipf/trunk/ipf/modules/cda/src/main/resources/builders/EntityBuilder.groovy
- RIM Roles: http://gforge.openehealth.org/svn/ipf/trunk/ipf/modules/cda/src/main/resources/builders/RoleBuilder.groovy
- RIM Participations: http://gforge.openehealth.org/svn/ipf/trunk/ipf/modules/cda/src/main/resources/builders/ParticipationBuilder.groovy
- RIM Acts: http://gforge.openehealth.org/svn/ipf/trunk/ipf/modules/cda/src/main/resources/builders/ActBuilder.groovy
- RIM ActRelationships: http://gforge.openehealth.org/svn/ipf/trunk/ipf/modules/cda/src/main/resources/builders/ActRelationshipBuilder.groovy
Abstract types are:
- Any: http://gforge.openehealth.org/svn/ipf/trunk/ipf/modules/cda/src/main/resources/builders/AnyBuilder.groovy
- InfrastructureRoot: http://gforge.openehealth.org/svn/ipf/trunk/ipf/modules/cda/src/main/resources/builders/InfrastructureBuilder.groovy
CDA profile support
CDA content profiles define clinical semantics for generic CDA documents. A profile usually constrains the CDA model in one or more of the following areas:
- defining templateIds to uniquely identify the semantics of a CDA element
- defining codes and code systems
- defining CDA body sections
The aim of IPF's CDA profile support is to abstract from the generic CDA representation of a certain profile towards a syntax that reflects the structure and vocabulary of the profile specification. In particular, all CDA "boilerplate" code shall be hidden, e.g. with respect to templateIds, codes and titles. This helps to achieve profile-compliant CDA documents, although there's no guarantee for it as for some restrictions it is not possible to automatically enforce them.
CDA profile support also adds Schematron validation against rules that are often released as informative addendum to the profile specification.
The CDA profile support is not only limited to creating profile-compliant documents, but also for extracting information from existing documents, and for validating existing documents.
CCD
The CCD specification is a constraint on the HL7 Clinical Document Architecture (CDA) standard. CCD was developed as a collaborative effort between ASTM and HL7, combining the benefits of ASTMs Continuity of Care Record (CCR) and the HL7 Clinical Document Architecture (CDA) specifications. It is intended as an alternate implementation to the one specified in ASTM ADJE2369 for those institutions or organizations committed to implementation of the HL7 Clinical Document Architecture.
The CCD specification contains U.S. specific requirements; its use is therefore limited to the U.S. The U.S. Healthcare Information Technology Standards Panel (HITSP) has selected the CCD as one of its standards.
Configuration
Building a CCD document does not require any additional dependencies in the Maven setup. It requires, however even more Groovy metaclass extensions on top of the underlying CDA Object model to facilitate accessing CCD documents. Note that the CCDModelExtensions contain the CDAR2ModelExtensions.
You can register the extensions manually:
import org.openehealth.ipf.modules.ccd.builder.CCDModelExtension ... ExpandoMetaClass.enableGlobally() new CCDModelExtension().extensions.call()
Usually you would use a Spring ApplicationContext to register the extensions, especially in conjunction with Camel routes:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <camel:camelContext id="camelContext"/> ... <bean id="ccdModelExtension" class="org.openehealth.ipf.modules.ccd.builder.CCDModelExtension"> </bean> <bean id="routeModelExtender" class="org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender"> <property name="routeModelExtensions"> <list> ... <ref bean="coreModelExtension" /> <ref bean="ccdModelExtension" /> </list> </property> </bean>
Usage
The CCDBuilder is a subclass of the org.openehealth.ipf.modules.cda.builder.CDAR2Builder class. The top-level element is now continuityOfCareDocument instead of clinicalDocument:
import org.openehealth.ipf.modules.cda.builder.content.document.CCDBuilder ... def builder = new CCDBuilder() def ccd = builder.build { continuityOfCareDocument { ... } }
Take care to instantiate CCDBuilder only once and reuse the instance! Note that you use the standard CDAR2Renderer to ender a CCD document to XML.
CCD support also conatins a DSL extension that checks a CCD document in its XML representation against the specified constraints by using a Schematron validator.
import org.openehealth.ipf.commons.xml.SchematronProfile; ... from('direct:input1') .... // get XML CCD into message body .validate().ccd() // equivalent with: // .validate().schematron().staticProfile(new SchematronProfile(CDAR2Constants.CCD_SCHEMATRON_RULES)) ...
You can use the CCDBuilder just like the CDAR2Builder. You can also use it to construct non-CCD documents as its provided functrionality is actually a superset.
However, it offers many additional CCD-specific builder elements and cardinality checks that closely correspond with subchapters of the CCD specification. These special elements facilitate the creation of correct CCD documents by automatically setting static elements and attributes and enforcing the CCD-specific constraints as good as possible.
Below you find a detailed list of how the CCD sections have been mapped into builder elements.
- Purpose section
- Payers section
- Advance Directives section
- Support section
- Functional Status section
- Problems section
- Familiy History section
- Social History section
- Alerts section
- Medications section
- Medical Equipment section
- Immunizations section
- Vital Signs section
- Results section
- Procedures section
- Encounters section
- Plan of Care section
Purpose section
Represents the specific reason for which the summarization was generated, such as in response to a request. The general use case does not require a purpose. Purpose should be utilized when the CCD has a specific purpose such as a transfer, referral, or patient request.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| purpose | Section | 0..1 | Purpose section |
| purposeActivity | EntryRelationship | 0(1)..* | Reason for creating the document. The target act may be an Observation, Procedure, or some other kind of act, and it may represent an order, an event, etc. |
Example
... // CCD Purpose (Chapter 2.8) purpose { text('Transfer of Care!') purposeActivity { // Example of an Purpose Activity Act act { code(code:'308292007', codeSystem:'2.16.840.1.113883.6.96', displayName:'Transfer of care') statusCode('completed') } } } ...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.13"/>
<code code="48764-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Summary purpose"/>
<title>Summary purpose</title>
<text>Transfer of Care!</text>
<entry contextConductionInd="true" typeCode="DRIV">
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.30"/>
<code code="23745001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Documentation procedure"/>
<statusCode code="completed"/>
<entryRelationship contextConductionInd="true" typeCode="RSON">
<act>
<code code="308292007" codeSystem="2.16.840.1.113883.6.96" displayName="Transfer of care"/>
<statusCode code="completed"/>
</act>
</entryRelationship>
</act>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Payers section
Payers contains data on the patient's payers, whether a 'third party' insurance, self-pay, other payer or guarantor, or some combination of payers, and is used to define which entity is the responsible fiduciary for the financial aspects of a patient's care.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| payers | Section | 0(1) | Payers section |
| coverageActivity | Act | 0(1)..* | serves to order the payment sources |
| policyActivity | Act | 1..* | the policy or program providing the coverage |
| payer | AssignedEntity | 1 | performer of the policy activity |
| coveredParty | ParticipantRole | 1 | The person for whom payment is being provided |
| subscriber | ParticipantRole | 0..1 | participant that is the holder the coverage |
| authorizationActivity | Act | 0..* | authorizations or pre-authorizations currently active for the patient for the particular payer |
| promise | EntryRelationsship | 0..* |
Example
...
// CCD Payers (Chapter 3.1)
payers {
text {
...
}
coverageActivity {
id('1fe2cdd0-7aad-11db-9fe1-0800200c9a66')
policyActivity {
id('3e676a50-7aac-11db-9fe1-0800200c9a66')
code('EHCPOL')
payer {
id('329fcdf0-7ab3-11db-9fe1-0800200c9a66')
representedOrganization {
name('Good Health Insurance')
}
}
coveredParty {
id('14d4a520-7aae-11db-9fe1-0800200c9a66')
code('SELF')
}
authorizationActivity {
id('f4dce790-8328-11db-9fe1-0800200c9a66')
code(nullFlavor:'NA')
promise {
procedure(moodCode:'PRMS') {
code(code:'73761001',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Colonoscopy')
}
}
}
}
}
}
...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.9"/>
<code code="48768-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Payment sources"/>
<title>Payers</title>
<text>...</text>
<entry>
<act classCode="ACT" moodCode="DEF">
<templateId root="2.16.840.1.113883.10.20.1.20"/>
<id root="1fe2cdd0-7aad-11db-9fe1-0800200c9a66"/>
<code xsi:type="CE" code="48768-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Payment sources"/>
<statusCode code="completed"/>
<entryRelationship contextConductionInd="true" typeCode="COMP">
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.26"/>
<id root="3e676a50-7aac-11db-9fe1-0800200c9a66"/>
<code xsi:type="CE" code="EHCPOL" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<performer typeCode="PRF">
<assignedEntity>
<id root="329fcdf0-7ab3-11db-9fe1-0800200c9a66"/>
<representedOrganization>
<name>Good Health Insurance</name>
</representedOrganization>
</assignedEntity>
</performer>
<participant typeCode="COV">
<participantRole>
<id root="14d4a520-7aae-11db-9fe1-0800200c9a66"/>
<code code="SELF" codeSystem="2.16.840.1.113883.5.111"/>
</participantRole>
</participant>
<entryRelationship typeCode="REFR">
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.19"/>
<id root="f4dce790-8328-11db-9fe1-0800200c9a66"/>
<code nullFlavor="NA"/>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<procedure classCode="PROC" moodCode="PRMS">
<code code="73761001" codeSystem="2.16.840.1.113883.6.96" displayName="Colonoscopy"/>
</procedure>
</entryRelationship>
</act>
</entryRelationship>
</act>
</entryRelationship>
</act>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Advance Directives section
This section contains data defining the patient's advance directives and any reference to supporting documentation. The most recent and up-to-date directives are required, if known, and should be listed in as much detail as possible. This section contains data such as the existence of living wills, healthcare proxies, and CPR and resuscitation status. If referenced documents are available, they can be included in the CCD exchange package.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| advanceDirectives | Section | 0(1) | Advance Directives section |
| advanceDirectiveObservation | Observation | 0(1)..* | Advance Directives observation |
| advanceDirectiveStatus | Observation | 1 | Advance Directive observation status |
| verifier | Participant | 0..* | A verification of an advance directive observation |
| advanceDirectiveReference | ExternalDocument | 0..1 | Referenced advance directive document |
Example
... // CCD Advance Directives (Chapter 3.2) advanceDirectives{ text{ table(border:'1', width:'100%'){ thead{ tr{ th('Directive') th('Description') th('Verification') th('Supporting Document(s)') } } tbody{ tr{ td('Resuscitation status') td('Do not resuscitate') td('Dr. Robert Dolin, Nov 07, 1999') td{ linkHtml(href:'AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf','Advance directive') } } } } }//text advanceDirectiveObservation{ id(root:'9b54c3c9-1673-49c7-aef9-b037ed72ed27') code(code:'304251008', codeSystem:'2.16.840.1.113883.6.96', displayName:'Resuscitation') value(make{ cd(code:'304253006', codeSystem:'2.16.840.1.113883.6.96', displayName:'Do not resuscitate'){ originalText{ reference(value:'#AD1') } } }) verifier{ time(value:'19991107') participantRole{ id(root:'20cf14fb-b65c-4c8c-a54d-b0cca834c18c') } } advanceDirectiveStatus{ value(code:'15240007', codeSystem:'2.16.840.1.113883.6.96', displayName:'Current and verified') }//advance directive observation status advanceDirectiveReference{ id(root:'b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3') code(code:'371538006', codeSystem:'2.16.840.1.113883.6.96', displayName:'Advance directive') text(mediaType:'application/pdf'){ reference(value:'AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf') } } } } ...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.1"/>
<code code="42348-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Advance directives"/>
<title>Advance Directives</title>
<text><table border="1" width="100%">
<thead>
<tr>
<th colspan="1" rowspan="1">Directive</th>
<th colspan="1" rowspan="1">Description</th>
<th colspan="1" rowspan="1">Verification</th>
<th colspan="1" rowspan="1">Supporting Document(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="1" rowspan="1">Resuscitation status</td>
<td colspan="1" rowspan="1">Do not resuscitate</td>
<td colspan="1" rowspan="1">Dr. Robert Dolin, Nov 07, 1999</td>
<td colspan="1" rowspan="1"><linkHtml href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance directive</linkHtml></td>
</tr>
</tbody>
</table></text>
<entry contextConductionInd="true" typeCode="DRIV">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<id root="9b54c3c9-1673-49c7-aef9-b037ed72ed27"/>
<code xsi:type="CE" code="304251008" codeSystem="2.16.840.1.113883.6.96" displayName="Resuscitation"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="304253006" codeSystem="2.16.840.1.113883.6.96" displayName="Do not resuscitate">
<originalText><reference value="#AD1"/></originalText>
</value>
<participant typeCode="VRF">
<templateId root="2.16.840.1.113883.10.20.1.58"/>
<time value="19991107"/>
<participantRole>
<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
</participantRole>
</participant>
<entryRelationship contextConductionInd="true" typeCode="REFR">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.37"/>
<code xsi:type="CE" code="33999-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Status"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="15240007" codeSystem="2.16.840.1.113883.6.96" displayName="Current and verified"/>
</observation>
</entryRelationship>
<reference typeCode="REFR">
<externalDocument classCode="DOC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.36"/>
<id root="b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3"/>
<code code="371538006" codeSystem="2.16.840.1.113883.6.96" displayName="Advance directive"/>
<text mediaType="application/pdf"><reference value="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf"/></text>
</externalDocument>
</reference>
</observation>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Support section
This section represents the patient's sources of support such as immediate family, relatives, and guardian at the time the summarization is generated. Support information also includes next of kin, caregivers, and support organizations. At a minimum, key support contacts relative to healthcare decisions, including next of kin, should be included.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| gardian | Patient/Guardian | 0(1) | Guardian entry |
| nextOfKin | Participant/associatedEntity | 0..* | Next of kin participant entry |
| emergencyContact | Participant/associatedEntity | 0..* | Emergency contact participant entry |
| caregiver | Participant/associatedEntity | 0..* | Caregiver participant entry |
Example
continuityOfCareDocument {
...
nextOfKin{
id(root:'4ac71514-6a10-4164-9715-f8d96af48e6d')
code(code:'65656005', codeSystem:'2.16.840.1.113883.6.96', displayName:'Biiological mother')
telecom(value:'tel:(999)555-1212')
associatedPerson{
name{
given('Henrietta')
family('Levin')
}
}
}//next of kin
emergencyContact{
id(root:'4ac71514-6a10-4164-9715-f8d96af48e6f')
associatedPerson{
name{
given('Baba')
family('John')
}
}
}//emergency contact
caregiver{
scopingOrganization{
name('Very Good Health Clinic')
}
}//patient caregiver
...
}
.... <participant typeCode="IND"> <associatedEntity classCode="NOK"> <id root="4ac71514-6a10-4164-9715-f8d96af48e6d"/> <code code="65656005" codeSystem="2.16.840.1.113883.6.96" displayName="Biiological mother"/> <telecom value="tel:(999)555-1212"/> <associatedPerson> <name><given>Henrietta</given><family>Levin</family></name> </associatedPerson> </associatedEntity> </participant> <participant typeCode="IND"> <associatedEntity classCode="ECON"> <id root="4ac71514-6a10-4164-9715-f8d96af48e6f"/> <associatedPerson> <name><given>Baba</given><family>John</family></name> </associatedPerson> </associatedEntity> </participant> <participant typeCode="IND"> <associatedEntity classCode="CAREGIVER"> <scopingOrganization> <name>Very Good Health Clinic</name> </scopingOrganization> </associatedEntity> </participant> ...
Functional Status section
Functional Status describes the patient's status of normal functioning at the time the Care Record was created.
Functional Status
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| funcationalStatus | Section | 0(1) | Functional Status section |
| problemAct | Act | 0(1)..* | see Problems section |
| functionalStatusStaus | Act | 0..1 | Problem observation may contain a status observation of functional status |
Example
...
// CCD Funtional Stats (Chapter 3.4)
functionalStatus{
text{
...
}
problemAct{
id(root:'6z2fa88d-4174-4909-aece-db44b60a3abb')
code(nullFlavor:'NA')
problemObservation{
id(root:'fd07111a-b15b-4dce-8518-1274d07f142a')
code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4')
effectiveTime{low(value:'1998')}
value( make{
cd(code:'105504002',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Dependence on cane')
}
)
functionalStatusStatus{
value(code:'55561003',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Active')
}
}
}
problemAct{
id(root:'64606e86-c080-11db-8314-0800200c9a66')
problemObservation{
id(root:'64606e86-c080-11db-8314-0800200c9a66')
code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4')
value( make{
cd(code:'386807006',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Memory impairment')
}
)
functionalStatusStatus{
value(code:'55561003',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Active')
}
}
}
}
...
....
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.5"/>
<code code="47420-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Functional status assessment"/>
<title>Functional Status</title>
<text>...</text>
<entry contextConductionInd="true" typeCode="DRIV">
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<id root="6z2fa88d-4174-4909-aece-db44b60a3abb"/>
<code nullFlavor="NA"/>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.28"/>
<id root="fd07111a-b15b-4dce-8518-1274d07f142a"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<effectiveTime>
<low value="1998"/>
</effectiveTime>
<value xsi:type="CD" code="105504002" codeSystem="2.16.840.1.113883.6.96" displayName="Dependence on cane"/>
<entryRelationship contextConductionInd="true" typeCode="REFR">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.44"/>
<code xsi:type="CE" code="33999-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Status"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="55561003" codeSystem="2.16.840.1.113883.6.96" displayName="Active"/>
</observation>
</entryRelationship>
</observation>
</entryRelationship>
</act>
</entry>
<entry contextConductionInd="true" typeCode="DRIV">
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<id root="64606e86-c080-11db-8314-0800200c9a66"/>
<code nullFlavor="NA"/>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.28"/>
<id root="64606e86-c080-11db-8314-0800200c9a66"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="386807006" codeSystem="2.16.840.1.113883.6.96" displayName="Memory impairment"/>
<entryRelationship contextConductionInd="true" typeCode="REFR">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.44"/>
<code xsi:type="CE" code="33999-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Status"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="55561003" codeSystem="2.16.840.1.113883.6.96" displayName="Active"/>
</observation>
</entryRelationship>
</observation>
</entryRelationship>
</act>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Problems section
This section lists and describes all relevant clinical problems at the time the summary is generated. At a minimum, all pertinent current and historical problems should be listed. CDA R2 represents problems as Observations.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| problems | Section | 0(1) | Problems section |
| problemAct | Act | 0(1)..* | Problem clinical statement |
| problemObservation | Observation | 1..* | Related problem observations |
| problemStatus | Observation | 0..1 | The status of a given problem observation |
| problemHealthstatus | Observation | 0..1 | Describes overall patient health status as a result of a particular problem |
| episodeObservation | Observation | 0..1 | May be used to indicate that a problem act represents a new episode, distinct from other episodes of a similar concern |
| patientAwareness | Observation | 0..1 | Patient awareness of a problem act or problem observation |
Example
... // CCD Problems (Chapter 3.5) component { structuredBody { problems{ text('Patient Problems Acts') problemAct{ id(root:'d11275e9-67ae-11db-bd13-0800200c9a66') problemObservation{ id(root:'9d3d416d-45ab-4da1-912f-4583e0632000') code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4') value(make{ cd(code:'233604007',codeSystem:'2.16.840.1.113883.6.96',displayName:'Pneumonia') } ) problemStatus{ value(code:'413322009', codeSystem:'2.16.840.1.113883.6.96', displayName:'Resolved') } problemHealthstatus{ value(code:'162467007', codeSystem:'2.16.840.1.113883.6.96', displayName:'Symptom Free') } } episodeObservation{ code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4') value(make{ cd(code:'404684003', codeSystem:'2.16.840.1.113883.6.96', displayName:'Clinical finding') } ) entryRelationship(typeCode:'SAS'){ act(classCode:'ACT', moodCode:'EVN'){ id(root:'ec8a6ff8-ed4b-4f7e-82c3-e98e58b45de7') code(nullFlavor:'NA') }//act } } patientAwareness{ awarenessCode(code:'TEST', codeSystem:'2.16.840.1.113883.5.4') participantRole{ id(root:'c8a6ff8-ed4b-4f7e-82c3-e98e58b45de8') } } } } } } } ...
....
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.11"/>
<code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem list"/>
<title>Problems</title>
<text>Patient Problems Acts</text>
<entry contextConductionInd="true" typeCode="DRIV">
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<id root="d11275e9-67ae-11db-bd13-0800200c9a66"/>
<code nullFlavor="NA"/>
<participant typeCode="SBJ">
<templateId root="2.16.840.1.113883.10.20.1.48"/>
<awarenessCode code="TEST" codeSystem="2.16.840.1.113883.5.4"/>
<participantRole>
<id root="c8a6ff8-ed4b-4f7e-82c3-e98e58b45de8"/>
</participantRole>
</participant>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.28"/>
<id root="9d3d416d-45ab-4da1-912f-4583e0632000"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="233604007" codeSystem="2.16.840.1.113883.6.96" displayName="Pneumonia"/>
<entryRelationship contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.50"/>
<code xsi:type="CE" code="33999-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Status"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="413322009" codeSystem="2.16.840.1.113883.6.96" displayName="Resolved"/>
</observation>
</entryRelationship>
<entryRelationship contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.51"/>
<code xsi:type="CE" code="11323-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Health status"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="162467007" codeSystem="2.16.840.1.113883.6.96" displayName="Symptom Free"/>
</observation>
</entryRelationship>
</observation>
</entryRelationship>
<entryRelationship contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.41"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="404684003" codeSystem="2.16.840.1.113883.6.96" displayName="Clinical finding"/>
<entryRelationship contextConductionInd="true" typeCode="SAS">
<act classCode="ACT" moodCode="EVN">
<id root="ec8a6ff8-ed4b-4f7e-82c3-e98e58b45de7"/>
<code nullFlavor="NA"/>
</act>
</entryRelationship>
</observation>
</entryRelationship>
</act>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Familiy History section
This section contains data defining the patient's genetic relatives in terms of possible or relevant health risk factors that have a potential impact on the patient's healthcare risk profile.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| familyHistory | Section | 0(1) | Family history section |
| familyHistoryObservation | Observation | 0(1)..* | Family history observation |
| problemStatus | Observation | 0..1 | The status of a given family history observation (see Problem Observation) |
| causeOfDeath | Observation | 0(1)..* | A special family history observation describing the cause of death |
| cause | Observation | 1 | Family history observation of death |
| familyMember | Organizer | 0(1)..* | Family history organizer in order to group the family history observations related to a family member |
| familyPerson | RelatedSubject | 1 | Subject participant, representing the family member who is the subject of the family history observations |
| age | Observation | 1 | Representation of age |
Example
...
// CCD Family History (Chapter 3.6)
familyHistory {
text('skipped')
familyMember {
familyPerson {
code(code:'9947008', codeSystem:'2.16.840.1.113883.6.96', displayName:'Biological father')
subject {
administrativeGenderCode('M')
birthTime(value:'1912')
}
}
causeOfDeath {
id('d42ebf70-5c89-11db-b0de-0800200c9a66')
code('ASSERTION')
value(make {
ce(code:'22298006',codeSystem:'2.16.840.1.113883.6.96',displayName:'MI')
})
cause {
id('6898fae0-5c8a-11db-b0de-0800200c9a66')
code('ASSERTION', codeSystem:'2.16.840.1.113883.5.4')
statusCode('completed')
value(make {
ce(code:'419099009',codeSystem:'2.16.840.1.113883.6.96',displayName:'Dead')
})
}
age {
value(make { _int(57) })
}
}
familyHistoryObservation{
id('5bfe3ec0-5c8b-11db-b0de-0800200c9a66')
code('ASSERTION', codeSystem:'2.16.840.1.113883.5.4')
value(make {
ce(code:'59621000',codeSystem:'2.16.840.1.113883.6.96',displayName:'HTN')
})
age {
value(make { _int(40) })
}
problemStatus{
value(code:'413322009', displayName:'Resolved')
}
}
}
familyMember {
familyPerson {
code(code:'65656005', codeSystem:'2.16.840.1.113883.6.96', displayName:'Biological mother')
subject {
administrativeGenderCode('F')
birthTime(value:'1912')
}
}
familyHistoryObservation{
id('a13c6160-5c8b-11db-b0de-0800200c9a66')
code('ASSERTION', codeSystem:'2.16.840.1.113883.5.4')
value(make {
ce(code:'195967001',codeSystem:'2.16.840.1.113883.6.96',displayName:'Asthma')
})
age {
value(make { _int(30) })
}
}
}
}
...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.4"/>
<code code="10157-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of family member diseases"/>
<title>Family History</title>
<text>skipped</text>
<entry contextConductionInd="true" typeCode="DRIV">
<organizer classCode="CLUSTER" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.23"/>
<statusCode code="completed"/>
<subject>
<relatedSubject classCode="PRS">
<code xsi:type="CE" code="9947008" codeSystem="2.16.840.1.113883.6.96" displayName="Biological father"/>
<subject>
<administrativeGenderCode code="M" codeSystem="2.16.840.1.113883.5.1"/>
<birthTime value="1912"/>
</subject>
</relatedSubject>
</subject>
<component contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.42"/>
<id root="d42ebf70-5c89-11db-b0de-0800200c9a66"/>
<code xsi:type="CE" code="ASSERTION"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="22298006" codeSystem="2.16.840.1.113883.6.96" displayName="MI"/>
<entryRelationship contextConductionInd="true" typeCode="CAUS">
<observation classCode="OBS" moodCode="INT">
<id root="6898fae0-5c8a-11db-b0de-0800200c9a66"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="419099009" codeSystem="2.16.840.1.113883.6.96" displayName="Dead"/>
</observation>
</entryRelationship>
<entryRelationship contextConductionInd="true" inversionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.1.38"/>
<code xsi:type="CE" code="397659008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Age"/>
<statusCode code="completed"/>
<value xsi:type="INT" value="57"/>
</observation>
</entryRelationship>
</observation>
</component>
<component contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<id root="5bfe3ec0-5c8b-11db-b0de-0800200c9a66"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="59621000" codeSystem="2.16.840.1.113883.6.96" displayName="HTN"/>
<entryRelationship contextConductionInd="true" inversionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.1.38"/>
<code xsi:type="CE" code="397659008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Age"/>
<statusCode code="completed"/>
<value xsi:type="INT" value="40"/>
</observation>
</entryRelationship>
</observation>
</component>
</organizer>
</entry>
<entry contextConductionInd="true" typeCode="DRIV">
<organizer classCode="CLUSTER" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.23"/>
<statusCode code="completed"/>
<subject>
<relatedSubject classCode="PRS">
<code xsi:type="CE" code="65656005" codeSystem="2.16.840.1.113883.6.96" displayName="Biological mother"/>
<subject>
<administrativeGenderCode code="F" codeSystem="2.16.840.1.113883.5.1"/>
<birthTime value="1912"/>
</subject>
</relatedSubject>
</subject>
<component contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<id root="a13c6160-5c8b-11db-b0de-0800200c9a66"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="195967001" codeSystem="2.16.840.1.113883.6.96" displayName="Asthma"/>
<entryRelationship contextConductionInd="true" inversionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.1.38"/>
<code xsi:type="CE" code="397659008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Age"/>
<statusCode code="completed"/>
<value xsi:type="INT" value="30"/>
</observation>
</entryRelationship>
</observation>
</component>
</organizer>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Social History section
This section contains data defining the patient's occupational, personal (e.g. lifestyle), social, and environmental history and health risk factors, as well as administrative data such as marital status, race, ethnicity and religious affiliation. Social history can have significant influence on a patient's physical, psychological and emotional health and wellbeing so should be considered in the development of a complete record.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| socialHistory | Section | 0(1) | Social History section |
| socialHistoryObservation | Observation | 0(1)..* | Social history observation (see also Episode Observation) |
| socialHistoryStatus | Observation | 0..1 | Social history observation status |
Example
...
// CCD Social History (Chapter 3.7)
socialHistory{
text{
....
}
socialHistoryObservation{
id(root:'9b56c25d-9104-45ee-9fa4-e0f3afaa01c1')
code(code:'230056004', codeSystem:'2.16.840.1.113883.6.96', displayName:'Cigarette smoking')
effectiveTime{
low(value:'1947')
high(value:'1972')
}
value(make{
st('1 pack per day')
})
}
socialHistoryObservation{
id(root:'45efb604-7049-4a2e-ad33-d38556c9636c')
code( code:'230056004', codeSystem:'2.16.840.1.113883.6.96', displayName:'Cigarette smoking')
effectiveTime{
low(value:'1973')
}
value(make{
st('None')
})
episodeObservation{
code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4')
entryRelationship(typeCode:'SAS'){
observation(classCode:'OBS', moodCode:'EVN'){
id(root:'9b56c25d-9104-45ee-9fa4-e0f3afaa01c1')
code(code:'230056004',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Cigarette smoking')
}
}
}
}
}
...
....
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.15"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
<title>Social History</title>
<text>...</text>
<entry contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.33"/>
<id root="9b56c25d-9104-45ee-9fa4-e0f3afaa01c1"/>
<code xsi:type="CE" code="230056004" codeSystem="2.16.840.1.113883.6.96" displayName="Cigarette smoking"/>
<statusCode code="completed"/>
<effectiveTime>
<low value="1947"/>
<high value="1972"/>
</effectiveTime>
<value xsi:type="ST">1 pack per day</value>
</observation>
</entry>
<entry contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.33"/>
<id root="45efb604-7049-4a2e-ad33-d38556c9636c"/>
<code xsi:type="CE" code="230056004" codeSystem="2.16.840.1.113883.6.96" displayName="Cigarette smoking"/>
<statusCode code="completed"/>
<effectiveTime>
<low value="1973"/>
</effectiveTime>
<value xsi:type="ST">None</value>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.41"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="404684003" codeSystem="2.16.840.1.113883.6.96" displayName="Clinical finding">
<qualifier>
<name code="246456000" displayName="Episodicity"/>
<value code="288527008" displayName="New episode"/>
</qualifier>
</value>
<entryRelationship contextConductionInd="true" typeCode="SAS">
<observation classCode="OBS" moodCode="EVN">
<id root="9b56c25d-9104-45ee-9fa4-e0f3afaa01c1"/>
<code xsi:type="CE" code="230056004" codeSystem="2.16.840.1.113883.6.96" displayName="Cigarette smoking"/>
</observation>
</entryRelationship>
</observation>
</entryRelationship>
</observation>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Alerts section
This section is used to list and describe any allergies, adverse reactions, and alerts that are pertinent to the patient's current or past medical history. At a minimum, currently active and any relevant historical allergies and adverse reactions should be listed.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| alerts | Section | 0(1) | Problems section |
| problemAct | Act | 0(1)..* | Problem clinical statement |
| alertObservation | Observation | 1..* | Related alert observations |
| alertStatus | Observation | 0..1 | The status of a given alert observation |
| participantAgent | Observation | 1..* | The agent responsible for an allergy or adverse reaction |
| reactionObservation | Observation | 0(1)..* | Reaction representation to an administered or exposed substance |
| reactionIntervention | EntryRelationship | 0(1)..* | Reaction observation may contain reaction interventions. Reaction Intervention may be represented by any clinical statement | medicationActivity | procedureActivityAct | procedureActivityObservation | procedureActivityProcedure |
| severityObservation | Observation | 0..1 | Reaction severity to a given reactions observation |
Example
...
// CCD Alerts (Chapter 3.8)
alerts{
text('Patient Alerts')
problemAct{
id(root:'d11275e9-67ae-11db-bd13-0800200c9a66')
alertObservation{
id(root:'9d3d416d-45ab-4da1-912f-4583e0632000')
code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4')
effectiveTime('20000328')
alertStatus{
value(code:'55561003',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Active')
}
participantAgent{
playingEntity{
code(code:'70618',
codeSystem:'2.16.840.1.113883.6.88',
displayName:'Penicillin')
}
}
reactionObservation{
code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4')
value(make{
cd(code:'247472004',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Hives')
})
severityObservation{
value(make{
cd(code:'247472004',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Hives')
})
}
}
}
}
}
...
....
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.2"/>
<code code="48765-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Allergies, adverse reactions, alerts"/>
<title>Allergies and adverse reactions, alerts</title>
<text>Patient Alerts</text>
<entry contextConductionInd="true" typeCode="DRIV">
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.27"/>
<id root="d11275e9-67ae-11db-bd13-0800200c9a66"/>
<code nullFlavor="NA"/>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.18"/>
<id root="9d3d416d-45ab-4da1-912f-4583e0632000"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<effectiveTime value="20000328"/>
<participant typeCode="CSM">
<participantRole classCode="MANU">
<playingEntity classCode="MMAT">
<code code="70618" codeSystem="2.16.840.1.113883.6.88" displayName="Penicillin"/>
</playingEntity>
</participantRole>
</participant>
<entryRelationship contextConductionInd="true" typeCode="REFR">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.39"/>
<code xsi:type="CE" code="33999-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Status"/>
<statusCode code="completed"/>
<value xsi:type="CE" code="55561003" codeSystem="2.16.840.1.113883.6.96" displayName="Active"/>
</observation>
</entryRelationship>
<entryRelationship contextConductionInd="true" typeCode="MFST">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.54"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="247472004" codeSystem="2.16.840.1.113883.6.96" displayName="Hives"/>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.55"/>
<code xsi:type="CE" code="SEV" codeSystem="2.16.840.1.113883.5.4" displayName="Severity observation"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="247472004" codeSystem="2.16.840.1.113883.6.96" displayName="Hives"/>
</observation>
</entryRelationship>
</observation>
</entryRelationship>
</observation>
</entryRelationship>
</act>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Medications section
The Medications section defines a patient's current medications and pertinent medication history. At a minimum, the currently active medications should be listed, with an entire medication history as an option, particularly when the summary document is used for comprehensive data export. The section may also include a patient's prescription history, and enables the determination of the source of a medication list (e.g. from a pharmacy system vs. from the patient).
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| medications | Section | 0(1) | Social History section |
| medicationActivity | SubstanceAdministration | 0(1)..* | Medication activity describes what is administered |
| consumable | Consumable | 1 | Targets a product template |
| seriesNumber | Observation | 0..1 | Medication activity series number observation. As of per definition the structure is strictly defined, seriesNumber accepts only int parameter seriesNumber(Integer) (see the example) |
| indication | EntryRelationship | 0(1)..* | Shows the relation to problem observation or problem act (see Problems) |
| patientInstruction | Act | 0(1)..* | Additional information provided to a patient related to one of their medications |
| supplyActivity | Supply | 0(1)..* | Supply activity describes what has been dispensed |
| fulfillmentInstruction | Act | 0(1)..* | Additional information provided to the dispensing party |
| supplyLocation | Participant | 0(1)..* | Indicates the supply location |
| product | Product | 0..1 | Supply activity product |
| medicationStatus | Observation | 0..1 | Medication status observation can be applied to medication or supply activity |
| productInstance | Act | 0(1)..* | Identify a particular product instance for medication and supply activities (see Procedures) |
| reactionObservation | Observation | 0(1)..* | Reaction representation to an administered or exposed substance (see Alerts ) |
Example
... // CCD Medications (Chapter 3.9) medications{ text { .... } informant { assignedEntity { id('996-756-495@2.16.840.1.113883.19.5') representedOrganization { id('2.16.840.1.113883.19.5') name('Good Health Clinic') } } } medicationActivity { id('cdbd33f0-6cde-11db-9fe1-0800200c9a66') effectiveTime(make { pivlts { period('6 h') } }) routeCode(code:'IPINHL', displayName:"Inhalation, oral") doseQuantity(value:2.0) administrationUnitCode(code:"415215001", codeSystem:"2.16.840.1.113883.6.96", displayName:"Puff") consumable { manufacturedProduct { manufacturedMaterial { code(code:"307782", codeSystem:"2.16.840.1.113883.6.88", displayName:"Albuterol 0.09 MG/ACTUAT inhalant solution") { originalText('Albuterol inhalant') } } } } patientInstruction{ id('cdbd5b08-6cde-11db-9fe1-0800200b8a66') code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4') effectiveTime{ low('20000338') } text('Read the instructions carefully') } seriesNumber(1) precondition { criterion { code(code:"ASSERTION",codeSystem:"2.16.840.1.113883.5.4") value(make { ce(code:'56018004', codeSystem:'2.16.840.1.113883.6.96', displayName:'Wheezing') }) } } reactionObservation{ code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4') value(make{ cd(code:'247472004', codeSystem:'2.16.840.1.113883.6.96', displayName:'Hives') } ) severityObservation{ value(make{ cd(code:'247472004', codeSystem:'2.16.840.1.113883.6.96', displayName:'Hives') }) } }//reaction observation } medicationActivity { id('cdbd5b07-6cde-11db-9fe1-0800200c9a66') effectiveTime(make { ivlts { low('20000328') high('20000404') } }) effectiveTime(make { pivlts(operator:'A') { period('6 h') } }) routeCode(code:'PO') doseQuantity(value:1.0) consumable { manufacturedProduct { manufacturedMaterial { code(code:"197454", codeSystem:"2.16.840.1.113883.6.88", displayName:"Cephalexin 500 MG oral tablet") { originalText('Cephalexin') } } } } indication { problemObservation(classCode:'COND') { id('cdbd5b08-6cde-11db-9fe1-0800200c9a66') code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4') effectiveTime { low('20000328') } value(make { ce(code:'32398004', codeSystem:'2.16.840.1.113883.6.96', displayName:'Bronchitis') }) } } } } ...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.8"/>
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
<title>Medication</title>
<text>...</text>
<informant>
<assignedEntity>
<id extension="996-756-495" root="2.16.840.1.113883.19.5"/>
<representedOrganization>
<id root="2.16.840.1.113883.19.5"/>
<name>Good Health Clinic</name>
</representedOrganization>
</assignedEntity>
</informant>
<entry contextConductionInd="true">
<substanceAdministration classCode="SBADM" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<id root="cdbd33f0-6cde-11db-9fe1-0800200c9a66"/>
<statusCode code="active"/>
<effectiveTime/>
<routeCode code="IPINHL" codeSystem="2.16.840.1.113883.5.112" codeSystemName="RouteOfAdministration" displayName="Inhalation, oral"/>
<doseQuantity unit="1" value="2.0"/>
<administrationUnitCode code="415215001" codeSystem="2.16.840.1.113883.6.96" displayName="Puff"/>
<consumable>
<manufacturedProduct>
<templateId root="2.16.840.1.113883.10.20.1.53"/>
<manufacturedMaterial>
<code code="307782" codeSystem="2.16.840.1.113883.6.88" displayName="Albuterol 0.09 MG/ACTUAT inhalant solution">
<originalText>Albuterol inhalant</originalText>
</code>
</manufacturedMaterial>
</manufacturedProduct>
</consumable>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<act moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.1.49"/>
<id root="cdbd5b08-6cde-11db-9fe1-0800200b8a66"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<text>Read the instructions carefully</text>
<effectiveTime>
<low value="20000338"/>
</effectiveTime>
</act>
</entryRelationship>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.46"/>
<code xsi:type="CE" code="30973-2" codeSystem="2.16.840.1.113883.6.1" displayName="Dose number"/>
<statusCode code="completed"/>
<value xsi:type="INT" value="1"/>
</observation>
</entryRelationship>
<entryRelationship contextConductionInd="true" typeCode="CAUS">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.54"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="247472004" codeSystem="2.16.840.1.113883.6.96" displayName="Hives"/>
<entryRelationship contextConductionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.55"/>
<code xsi:type="CE" code="SEV" codeSystem="2.16.840.1.113883.5.4" displayName="Severity observation"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="247472004" codeSystem="2.16.840.1.113883.6.96" displayName="Hives"/>
</observation>
</entryRelationship>
</observation>
</entryRelationship>
<precondition>
<criterion>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<value xsi:type="CE" code="56018004" codeSystem="2.16.840.1.113883.6.96" displayName="Wheezing"/>
</criterion>
</precondition>
</substanceAdministration>
</entry>
<entry contextConductionInd="true">
<substanceAdministration classCode="SBADM" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<id root="cdbd5b07-6cde-11db-9fe1-0800200c9a66"/>
<statusCode code="active"/>
<effectiveTime/>
<effectiveTime/>
<routeCode code="PO" codeSystem="2.16.840.1.113883.5.112" codeSystemName="RouteOfAdministration"/>
<doseQuantity unit="1" value="1.0"/>
<consumable>
<manufacturedProduct>
<templateId root="2.16.840.1.113883.10.20.1.53"/>
<manufacturedMaterial>
<code code="197454" codeSystem="2.16.840.1.113883.6.88" displayName="Cephalexin 500 MG oral tablet">
<originalText>Cephalexin</originalText>
</code>
</manufacturedMaterial>
</manufacturedProduct>
</consumable>
<entryRelationship contextConductionInd="true" typeCode="RSON">
<observation classCode="COND" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.28"/>
<id root="cdbd5b08-6cde-11db-9fe1-0800200c9a66"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<effectiveTime>
<low value="20000328"/>
</effectiveTime>
<value xsi:type="CE" code="32398004" codeSystem="2.16.840.1.113883.6.96" displayName="Bronchitis"/>
</observation>
</entryRelationship>
</substanceAdministration>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Medical Equipment section
The Medical Equipment section defines a patient's implanted and external medical devices and equipment that their health status depends on, as well as any pertinent equipment or device history. Medical equipment uses the same data objects and constraints as Medications.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| medicalEquipment | Section | 0(1) | Medical equipment section (see Medications) |
Example
...
medicalEquipment{
text{...}
supplyActivity{
id(root:'2413773c-2372-4299-bbe6-5b0f60664446')
effectiveTime(make{
ivlts{
center(value:'199911')
}
})
productInstance{
playingDevice{
code(code:'72506001',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Automatic implantable cardioverter/defibrillator')
}
}
}
supplyActivity{
id(root:'230b0ab7-206d-42d8-a947-ab4f63aad795')
effectiveTime(make{
ivlts{
center(value:'1998')
}
})
productInstance{
id(root:'03ca01b0-7be1-11db-9fe1-0800200c9a66')
playingDevice{
code(code:'304120007',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Total hip replacement prosthesis')
}
scopingEntity{
id(root:'0abea950-5b40-4b7e-b8d9-2a5ea3ac5500')
desc('Good Health Prostheses Company')
}
}
}
supplyActivity{
id(root:'c4ffe98e-3cd3-4c54-b5bd-08ecb80379e0')
effectiveTime(make{
ivlts{
center(value:'1999')
}
})
productInstance{
playingDevice{
code(code:'58938008',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'Wheelchair')
}
}
}
}
...
....
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.7"/>
<code code="46264-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medical device use"/>
<title>Equipment</title>
<text>...</text>
<entry>
<supply classCode="SPLY">
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<id root="2413773c-2372-4299-bbe6-5b0f60664446"/>
<statusCode code="active"/>
<effectiveTime/>
<participant typeCode="DEV">
<participantRole classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.1.52"/>
<playingDevice>
<code code="72506001" codeSystem="2.16.840.1.113883.6.96" displayName="Automatic implantable cardioverter/defibrillator"/>
</playingDevice>
</participantRole>
</participant>
</supply>
</entry>
<entry>
<supply classCode="SPLY">
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<id root="230b0ab7-206d-42d8-a947-ab4f63aad795"/>
<statusCode code="active"/>
<effectiveTime/>
<participant typeCode="DEV">
<participantRole classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.1.52"/>
<id root="03ca01b0-7be1-11db-9fe1-0800200c9a66"/>
<playingDevice>
<code code="304120007" codeSystem="2.16.840.1.113883.6.96" displayName="Total hip replacement prosthesis"/>
</playingDevice>
<scopingEntity>
<id root="0abea950-5b40-4b7e-b8d9-2a5ea3ac5500"/>
<desc>Good Health Prostheses Company</desc>
</scopingEntity>
</participantRole>
</participant>
</supply>
</entry>
<entry>
<supply classCode="SPLY">
<templateId root="2.16.840.1.113883.10.20.1.34"/>
<id root="c4ffe98e-3cd3-4c54-b5bd-08ecb80379e0"/>
<statusCode code="active"/>
<effectiveTime/>
<participant typeCode="DEV">
<participantRole classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.1.52"/>
<playingDevice>
<code code="58938008" codeSystem="2.16.840.1.113883.6.96" displayName="Wheelchair"/>
</playingDevice>
</participantRole>
</participant>
</supply>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Immunizations section
The Immunizations section defines a patient's current immunization status and pertinent immunization history. Immunizations section uses the same data objects and constraints as Medications.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| immunizations | Section | 0(1) | Immunizations section (see Medications) |
Example
... // CCD Immunizations (Chapter 3.11) immunizations{ text{...} medicationActivity{ id(root:'e6f1ba43-c0ed-4b9b-9f12-f435d8ad8f92') effectiveTime(make{ ivlts{ center(value:'199911') } }) routeCode(code:'IM', displayName:"Intramuscular injection") consumable { manufacturedProduct { manufacturedMaterial { code(code:'88', codeSystem:'2.16.840.1.113883.6.59', displayName:'Influenza virus vaccine') { originalText('Influenza virus vaccine') } } } } } medicationActivity{ id(root:'115f0f70-1343-4938-b62f-631de9749a0a') effectiveTime(make{ ivlts{ center(value:'199812') } }) routeCode(code:'IM', displayName:"Intramuscular injection") consumable { manufacturedProduct { manufacturedMaterial { code(code:'88', codeSystem:'2.16.840.1.113883.6.59', displayName:'Influenza virus vaccine') { originalText('Influenza virus vaccine') } } } } } medicationActivity{ id(root:'78598407-9f16-42d5-8ffd-09281a60fe33') effectiveTime(make{ ivlts{ center(value:'199812') } }) routeCode(code:'IM', displayName:"Intramuscular injection") consumable { manufacturedProduct { manufacturedMaterial { code(code:'33', codeSystem:'2.16.840.1.113883.6.59', displayName:'Pneumococcal polysaccharide vaccine') { originalText('Pneumococcal polysaccharide vaccine') } } } } } medicationActivity{ id(root:'261e94a0-95fb-4975-b5a5-c8e12c01c1bc') effectiveTime(make{ ivlts{ center(value:'1997') } }) routeCode(code:'IM', displayName:"Intramuscular injection") consumable { manufacturedProduct { manufacturedMaterial { code(code:'09', codeSystem:'2.16.840.1.113883.6.59', displayName:'Tetanus and diphtheria toxoids') { originalText('Tetanus and diphtheria toxoids') } } } } } } ...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.6"/>
<code code="11369-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of immunizations"/>
<title>Immunization</title>
<text></text>
<entry contextConductionInd="true">
<substanceAdministration classCode="SBADM" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<id root="e6f1ba43-c0ed-4b9b-9f12-f435d8ad8f92"/>
<statusCode code="active"/>
<effectiveTime/>
<routeCode code="IM" codeSystem="2.16.840.1.113883.5.112" codeSystemName="RouteOfAdministration" displayName="Intramuscular injection"/>
<consumable>
<manufacturedProduct>
<templateId root="2.16.840.1.113883.10.20.1.53"/>
<manufacturedMaterial>
<code code="88" codeSystem="2.16.840.1.113883.6.59" displayName="Influenza virus vaccine">
<originalText>Influenza virus vaccine</originalText>
</code>
</manufacturedMaterial>
</manufacturedProduct>
</consumable>
</substanceAdministration>
</entry>
<entry contextConductionInd="true">
<substanceAdministration classCode="SBADM" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<id root="115f0f70-1343-4938-b62f-631de9749a0a"/>
<statusCode code="active"/>
<effectiveTime/>
<routeCode code="IM" codeSystem="2.16.840.1.113883.5.112" codeSystemName="RouteOfAdministration" displayName="Intramuscular injection"/>
<consumable>
<manufacturedProduct>
<templateId root="2.16.840.1.113883.10.20.1.53"/>
<manufacturedMaterial>
<code code="88" codeSystem="2.16.840.1.113883.6.59" displayName="Influenza virus vaccine">
<originalText>Influenza virus vaccine</originalText>
</code>
</manufacturedMaterial>
</manufacturedProduct>
</consumable>
</substanceAdministration>
</entry>
<entry contextConductionInd="true">
<substanceAdministration classCode="SBADM" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<id root="78598407-9f16-42d5-8ffd-09281a60fe33"/>
<statusCode code="active"/>
<effectiveTime/>
<routeCode code="IM" codeSystem="2.16.840.1.113883.5.112" codeSystemName="RouteOfAdministration" displayName="Intramuscular injection"/>
<consumable>
<manufacturedProduct>
<templateId root="2.16.840.1.113883.10.20.1.53"/>
<manufacturedMaterial>
<code code="33" codeSystem="2.16.840.1.113883.6.59" displayName="Pneumococcal polysaccharide vaccine">
<originalText>Pneumococcal polysaccharide vaccine</originalText>
</code>
</manufacturedMaterial>
</manufacturedProduct>
</consumable>
</substanceAdministration>
</entry>
<entry contextConductionInd="true">
<substanceAdministration classCode="SBADM" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<id root="261e94a0-95fb-4975-b5a5-c8e12c01c1bc"/>
<statusCode code="active"/>
<effectiveTime/>
<routeCode code="IM" codeSystem="2.16.840.1.113883.5.112" codeSystemName="RouteOfAdministration" displayName="Intramuscular injection"/>
<consumable>
<manufacturedProduct>
<templateId root="2.16.840.1.113883.10.20.1.53"/>
<manufacturedMaterial>
<code code="09" codeSystem="2.16.840.1.113883.6.59" displayName="Tetanus and diphtheria toxoids">
<originalText>Tetanus and diphtheria toxoids</originalText>
</code>
</manufacturedMaterial>
</manufacturedProduct>
</consumable>
</substanceAdministration>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Vital Signs section
This section contains current and historically relevant vital signs, such as blood pressure, heart rate, respiratory rate, height, weight, body mass index, head circumference, crown-to-rump length, and pulse oximetry. The section may contain all vital signs for the period of time being summarized, but at a minimum should include notable vital signs such as the most recent, maximum and/or minimum, or both, baseline, or relevant trends.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| vitalSigns | Section | 0(1) | Vital Signs section |
| vitalSignsOrganizer | Organizer | 0(1)..* | Container for observations |
| resultObservation | Observation | 1..* | Related vital signs observation result |
Example
...
// Chapter 3.12 Vital Signs
vitalSigns{
text('Patient Vital Signs')
vitalSignsOrganizer(classCode:'CLUSTER'){
id(root:'c6f88320-67ad-11db-bd13-0800200c9a66')
code(code:'46680005', codeSystem:'2.16.840.1.113883.6.96', displayName:'Vital signs')
statusCode(code:'completed')
resultObservation{
id(root:'c6f88321-67ad-11db-bd13-0800200c9a66')
code(code:'50373000', codeSystem:'2.16.840.1.113883.6.96', displayName:'Body height')
statusCode(code:'completed')
value( make {
pq(value:177.0, unit:'cm')
})
}
resultObservation{
id(root:'c6f88322-67ad-11db-bd13-0800200c9a66')
code(code:'27113001', codeSystem:'2.16.840.1.113883.6.96', displayName:'Body weight')
statusCode(code:'completed')
effectiveTime(value:'19991114')
value( make {
pq('86 kg')
})
}
resultObservation{
id(root:'c6f88323-67ad-11db-bd13-0800200c9a66')
code(code:'271649006', codeSystem:'2.16.840.1.113883.6.96', displayName:'Systolic BP')
statusCode(code:'completed')
effectiveTime(value:'19991114')
value( make{
pq(value:132.0, unit:'mm[Hg]')
})
}
resultObservation{
id(root:'c6f88324-67ad-11db-bd13-0800200c9a66')
code(code:'271650006', codeSystem:'2.16.840.1.113883.6.96', displayName:'Diastolic BP')
statusCode(code:'completed')
effectiveTime(value:'19991114')
value( make{
pq(value:86.0, unit:'mm[Hg]')
})
}
}
}
...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.16"/>
<code code="8716-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Vital signs"/>
<title>Vital signs</title>
<text>Patient Vital Signs</text>
<entry contextConductionInd="true" typeCode="DRIV">
<organizer classCode="CLUSTER" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.35"/>
<id root="c6f88320-67ad-11db-bd13-0800200c9a66"/>
<code code="46680005" codeSystem="2.16.840.1.113883.6.96" displayName="Vital signs"/>
<statusCode code="completed"/>
<component contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<id root="c6f88321-67ad-11db-bd13-0800200c9a66"/>
<code xsi:type="CE" code="50373000" codeSystem="2.16.840.1.113883.6.96" displayName="Body height"/>
<statusCode code="completed"/>
<value xsi:type="PQ" unit="cm" value="177.0"/>
</observation>
</component>
<component contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<id root="c6f88322-67ad-11db-bd13-0800200c9a66"/>
<code xsi:type="CE" code="27113001" codeSystem="2.16.840.1.113883.6.96" displayName="Body weight"/>
<statusCode code="completed"/>
<effectiveTime value="19991114"/>
<value xsi:type="PQ" unit="kg" value="86.0"/>
</observation>
</component>
<component contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<id root="c6f88323-67ad-11db-bd13-0800200c9a66"/>
<code xsi:type="CE" code="271649006" codeSystem="2.16.840.1.113883.6.96" displayName="Systolic BP"/>
<statusCode code="completed"/>
<effectiveTime value="19991114"/>
<value xsi:type="PQ" unit="mm[Hg]" value="132.0"/>
</observation>
</component>
<component contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<id root="c6f88324-67ad-11db-bd13-0800200c9a66"/>
<code xsi:type="CE" code="271650006" codeSystem="2.16.840.1.113883.6.96" displayName="Diastolic BP"/>
<statusCode code="completed"/>
<effectiveTime value="19991114"/>
<value xsi:type="PQ" unit="mm[Hg]" value="86.0"/>
</observation>
</component>
</organizer>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Results section
This section contains the results of observations generated by laboratories, imaging procedures, and other procedures. The scope includes hematology, chemistry, serology, virology, toxicology, microbiology, plain x-ray, ultrasound, CT, MRI, angiography, cardiac echo, nuclear medicine, pathology, and procedure observations. The section may contain all results for the period of time being summarized, but should include notable results such as abnormal values or relevant trends.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| results | Section | 0(1) | Results section |
| resultOrganizer | Organizer | 0(1)..* | Container for result observations |
| resultObservation | Observation | 1..* | Related observation result |
Example
...
// CCD Results (Chapter 3.13)
results{
text('Patient Observation Results')
title('Other results')
resultOrganizer(classCode:'BATTERY'){
id(root:'7d5a02b0-67a4-11db-bd13-0800200c9a66')
code(code:'43789009',
codeSystem:'2.16.840.1.113883.6.96',
displayName:'CBC WO DIFFERENTIAL')
statusCode(code:'completed')
effectiveTime(value:'200003231430')
resultObservation{
id(root:'107c2dc0-67a5-11db-bd13-0800200c9a66')
code(code:'30313-1', codeSystem:'2.16.840.1.113883.6.1', displayName:'HGB')
statusCode(code:'completed')
effectiveTime(value:'200003231430')
value(make {
pq(value:13.2, unit:'g/dl')
})
interpretationCode(code:'N', codeSystem:'2.16.840.1.113883.5.83')
referenceRange{
observationRange{
text('M 13-18 g/dl; F 12-16 g/dl')
}
}
}
resultObservation{
id(root:'8b3fa370-67a5-11db-bd13-0800200c9a66')
code(code:'33765-9', codeSystem:'2.16.840.1.113883.6.1', displayName:'WBC')
statusCode(code:'completed')
value(make{
pq(value:6.7, unit:'10+3/ul')
})
interpretationCode(code:'N', codeSystem:'2.16.840.1.113883.5.83')
referenceRange{
observationRange{
value( make {
ivlpq{
low(value:4.3, unit:'10+3/ul')
high(value:10.8, unit:'10+3/ul')
}
})
}
}
}
}
}
...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.14"/>
<code code="30954-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Relevant diagnostic tests and/or laboratory data"/>
<title>Other results</title>
<text>Patient Observation Results</text>
<entry contextConductionInd="true" typeCode="DRIV">
<organizer classCode="BATTERY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.32"/>
<id root="7d5a02b0-67a4-11db-bd13-0800200c9a66"/>
<code code="43789009" codeSystem="2.16.840.1.113883.6.96" displayName="CBC WO DIFFERENTIAL"/>
<statusCode code="completed"/>
<effectiveTime value="200003231430"/>
<component contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<id root="107c2dc0-67a5-11db-bd13-0800200c9a66"/>
<code xsi:type="CE" code="30313-1" codeSystem="2.16.840.1.113883.6.1" displayName="HGB"/>
<statusCode code="completed"/>
<effectiveTime value="200003231430"/>
<value xsi:type="PQ" unit="g/dl" value="13.2"/>
<interpretationCode code="N" codeSystem="2.16.840.1.113883.5.83"/>
<referenceRange>
<observationRange>
<text>M 13-18 g/dl; F 12-16 g/dl</text>
</observationRange>
</referenceRange>
</observation>
</component>
<component contextConductionInd="true">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<id root="8b3fa370-67a5-11db-bd13-0800200c9a66"/>
<code xsi:type="CE" code="33765-9" codeSystem="2.16.840.1.113883.6.1" displayName="WBC"/>
<statusCode code="completed"/>
<value xsi:type="PQ" unit="10+3/ul" value="6.7"/>
<interpretationCode code="N" codeSystem="2.16.840.1.113883.5.83"/>
<referenceRange>
<observationRange>
<value xsi:type="IVL_PQ" unit="1">
<low unit="10+3/ul" value="4.3" inclusive="true"/>
<high unit="10+3/ul" value="10.8" inclusive="true"/>
</value>
</observationRange>
</referenceRange>
</observation>
</component>
</organizer>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Procedures section
This section defines all interventional, surgical, diagnostic, or therapeutic procedures or treatments pertinent to the patient historically at the time the document is generated.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| procedures | Section | 0(1) | Procedures section |
| procedureActivity | entry | 1..* | Procedures entry: procedureActivityAct | procedureActivityProcedure | procedureActivityObservation |
| procedureActivityAct | procedureActivityObservation | procedureActivityProcedure | Act | Observation | Procedure | 0(1)..* | Procedure activity instance may contain: Problem activities(see problemActReason), Problem observations(see ProblemObservationReason), Medication acticities, Age observation, result observations, patient instructions, product representations, encounter location. Refer to the CCD specification for details. |
| problemActReason | Act | 0(1)..* | Indication or reason for the procedure targeting problem act |
| problemObservationReason | Observation | 0(1)..* | Indication or reason for the procedure targeting problem observation |
Example
... // CCD Procedures (Chapter 3.14) procedures{ text('Patient Procedures') templateId(root:'2.16.840.1.113883.10.20.1.12') templateId(root:'1.3.6.1.4.1.19376.1.5.3.1.3.11', assigningAuthorityName:'IHE PCC') text{...} procedureActivity{ procedureActivityProcedure{ id(root:'e401f340-7be2-11db-9fe1-0800200c9a66') code(code:'52734007', codeSystem:'2.16.840.1.113883.6.96', displayName:'Total hip replacement'){ originalText{ reference(value:'#Proc1') } qualifier{ name(code:'272741003', displayName:'Laterality') value(code:'7771000', displayName:'Left') } } text('IHE Requires reference to go here instead of originalText of code.<reference') statusCode('completed') effectiveTime('1998') performer{ assignedEntity{ assignedPerson{ name('Procedure Performers Name') }//assignedPerson } } age { value(make { _int(57) } ) } encounterLocation{ id(root:'2.16.840.1.113883.19.5') playingEntity{ name('Very Good Health Clinic') }//playingEntity } problemObservationReason{ id(root:'9d3d416d-45ab-4da1-912f-4583e0632000') code(code:'ASSERTION', codeSystem:'2.16.840.1.113883.5.4') value(make{ cd(code:'233604007', codeSystem:'2.16.840.1.113883.6.96', displayName:'Pneumonia') }) patientAwareness{ awarenessCode(code:'TEST', codeSystem:'2.16.840.1.113883.5.4') participantRole{ id('996-756-495@2.16.840.1.113883.19.5') } } }//problem observation productInstance{ id(root:'03ca01b0-7be1-11db-9fe1-0800200c9a66') playingDevice{ code(code:'304120007', codeSystem:'2.16.840.1.113883.6.96', displayName:'Total hip replacement prosthesis') } scopingEntity{ id(root:'0abea950-5b40-4b7e-b8d9-2a5ea3ac5500') desc('Good Health Prostheses Company') } } entryRelationship(typeCode:'REFR'){ act(classCode:'ACT', moodCode:'EVN'){ templateId(root:'1.3.6.1.4.1.19376.1.5.3.1.4.4', assigningAuthorityName:'IHE PCC') code(nullFlavor:'NA') text{ reference(value:'PtrToSectionText') }//text reference(typeCode:'REFR'){ externalDocument(classCode:'DOC', moodCode:'EVN'){ text('Location of Documentation - URL or other') } } } } informationSource{ value(make{ st('Unknown') }) } } } } ...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.12"/>
<templateId assigningAuthorityName="IHE PCC" root="1.3.6.1.4.1.19376.1.5.3.1.3.11"/>
<code code="47519-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of procedures"/>
<title>Procedures</title>
<text><table border="1" width="100%">
<thead>
<tr>
<th colspan="1" rowspan="1">Procedure</th>
<th colspan="1" rowspan="1">Date</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="1" rowspan="1"><content ID="Proc1">Total hip replacement, left</content></td>
<td colspan="1" rowspan="1"><content>1998</content></td>
</tr>
</tbody>
</table></text>
<entry contextConductionInd="true" typeCode="DRIV">
<procedure classCode="PROC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.29"/>
<id root="e401f340-7be2-11db-9fe1-0800200c9a66"/>
<code code="52734007" codeSystem="2.16.840.1.113883.6.96" displayName="Total hip replacement">
<originalText><reference value="#Proc1"/></originalText>
<qualifier>
<name code="272741003" displayName="Laterality"/>
<value code="7771000" displayName="Left"/>
</qualifier>
</code>
<text>IHE Requires reference to go here instead of originalText of code.<reference</text>
<statusCode code="completed"/>
<effectiveTime value="1998"/>
<performer>
<assignedEntity>
<assignedPerson>
<name>Procedure Performers Name</name>
</assignedPerson>
</assignedEntity>
</performer>
<participant typeCode="LOC">
<templateId root="2.16.840.1.113883.10.20.1.45"/>
<participantRole classCode="SDLOC">
<id root="2.16.840.1.113883.19.5"/>
<playingEntity classCode="PLC">
<name>Very Good Health Clinic</name>
</playingEntity>
</participantRole>
</participant>
<participant typeCode="DEV">
<participantRole classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.1.52"/>
<id root="03ca01b0-7be1-11db-9fe1-0800200c9a66"/>
<playingDevice>
<code code="304120007" codeSystem="2.16.840.1.113883.6.96" displayName="Total hip replacement prosthesis"/>
</playingDevice>
<scopingEntity>
<id root="0abea950-5b40-4b7e-b8d9-2a5ea3ac5500"/>
<desc>Good Health Prostheses Company</desc>
</scopingEntity>
</participantRole>
</participant>
<entryRelationship contextConductionInd="true" inversionInd="true" typeCode="SUBJ">
<observation classCode="OBS" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.1.38"/>
<code xsi:type="CE" code="397659008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Age"/>
<statusCode code="completed"/>
<value xsi:type="INT" value="57"/>
</observation>
</entryRelationship>
<entryRelationship contextConductionInd="true" typeCode="RSON">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.28"/>
<id root="9d3d416d-45ab-4da1-912f-4583e0632000"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="233604007" codeSystem="2.16.840.1.113883.6.96" displayName="Pneumonia"/>
<participant typeCode="SBJ">
<templateId root="2.16.840.1.113883.10.20.1.48"/>
<awarenessCode code="TEST" codeSystem="2.16.840.1.113883.5.4"/>
<participantRole>
<id extension="996-756-495" root="2.16.840.1.113883.19.5"/>
</participantRole>
</participant>
</observation>
</entryRelationship>
<entryRelationship contextConductionInd="true" typeCode="REFR">
<act classCode="ACT" moodCode="EVN">
<templateId assigningAuthorityName="IHE PCC" root="1.3.6.1.4.1.19376.1.5.3.1.4.4"/>
<code nullFlavor="NA"/>
<text><reference value="PtrToSectionText"/></text>
<reference typeCode="REFR">
<externalDocument classCode="DOC" moodCode="EVN">
<text>Location of Documentation - URL or other</text>
</externalDocument>
</reference>
</act>
</entryRelationship>
<entryRelationship contextConductionInd="true" typeCode="REFR">
<observation classCode="OBS" moodCode="EVN">
<code xsi:type="CE" code="48766-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Information source"/>
<statusCode code="completed"/>
<value xsi:type="ST">Unknown</value>
</observation>
</entryRelationship>
</procedure>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Encounters section
This section is used to list and describe any healthcare encounters pertinent to the patient's current health status or historical health history.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| encounters | Section | 0(1) | Encounters section |
| encounterActivity | Encounter | 1..* | Encounter activity |
| encounterLocation | ParticipantRole | 0(1)..* | Location participation |
Example
... //CCD Encounters (Chpater 3.15) encounters { text('Encounter Location: Very Good Health Clinic') title('Encounters') encounterActivity{ id(root:'2a620155-9d11-439e-92b3-5d9815ff4de8') code(code:'GENRL', codeSystem:'2.16.840.1.113883.5.4', displayName:'General'){ originalText('Checkup Examination') }//code encounterLocation{ id(root:'2.16.840.1.113883.19.5') playingEntity{ name('Very Good Health Clinic') }//playingEntity } }//encounter } ...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.3"/>
<code code="46240-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of encounters"/>
<title>Encounters</title>
<text>Encounter Location: Very Good Health Clinic</text>
<entry contextConductionInd="true" typeCode="DRIV">
<encounter classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.21"/>
<id root="2a620155-9d11-439e-92b3-5d9815ff4de8"/>
<code xsi:type="CE" code="GENRL" codeSystem="2.16.840.1.113883.5.4" displayName="General">
<originalText>Checkup Examination</originalText>
</code>
<participant typeCode="LOC">
<templateId root="2.16.840.1.113883.10.20.1.45"/>
<participantRole classCode="SDLOC">
<id root="2.16.840.1.113883.19.5"/>
<playingEntity classCode="PLC">
<name>Very Good Health Clinic</name>
</playingEntity>
</participantRole>
</participant>
</encounter>
</entry>
</section>
</component>
</structuredBody>
</component>
...
Plan of Care section
This section is used to list and describe any healthcare encounters pertinent to the patient's current health status or historical health history.
Builder Elements
| Element | CDA Type | Cardinality | Description |
|---|---|---|---|
| planOfCare | Section | 0(1) | Plan of Care section |
| planOfCareActivity | Entry | 1..* | Container for pending clinical events: Act, Encounter, Observation, Procedure, SubstanceAdministration, or Supply. |
Example
... // CCD Plan Of Care (Chapter 3.16) planOfCare { text('Plan') text{ ... } planOfCareActivity { observation(moodCode:'RQO') { id('9a6d1bac-17d3-4195-89a4-1121bc809b4a') code(code:'23426006', codeSystem:'2.16.840.1.113883.6.96', displayName:'Pulmonary function test') statusCode('new') effectiveTime { center('20000421') } } } } ...
...
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.10"/>
<code code="18776-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Treatment Plan"/>
<title>Plan</title>
<text>...</text>
<entry typeCode="DRIV">
<observation classCode="OBS" moodCode="RQO">
<templateId root="2.16.840.1.113883.10.20.1.25"/>
<id root="9a6d1bac-17d3-4195-89a4-1121bc809b4a"/>
<code xsi:type="CE" code="23426006" codeSystem="2.16.840.1.113883.6.96" displayName="Pulmonary function test"/>
<statusCode code="new"/>
<effectiveTime>
<center value="20000421"/>
</effectiveTime>
</observation>
</entry>
</section>
</component>
</structuredBody>
</component>
...