Linking Narrative and Coded Entries

From IHE Wiki
Jump to: navigation, search

Linking Narrative and Coded Entries

This section defines a linking mechanism that allows entries or portions thereof to be connected to the text of the clinical document.

Standards
RIM HL7 Version 3 Reference Information Model
CDAR2 HL7 Clinical Document Architecture Release 2.0
Constraints for CDA

Elements within the narrative <text> will use the ID attribute to provide a destination for links. Elements within an <entry> will be linked to the text via a URI reference using this attribute as the fragment identifier. This links the coded entry to the specific narrative text it is related to within the CDA instance, and can be traversed in either direction. This serves three purposes:

  1. It supports diagnostics during software development and testing.
  2. It provides a mechanism to enrich the markup that can be supported in the viewing application.
  3. It eliminates the need to duplicate content in two places, which prevents a common source of error, and eliminates steps needed to validate that content that should be identical in fact is.

Each narrative content element within CDA may have an ID attribute. This attribute is of type xs:ID. This means that each ID in the document must be unique within that document. Within an XML document, an attribute of type xs:ID must start with a letter, and may be followed one or more letters, digits, hyphens or underscores . Three different examples showing the use of the ID attribute, and references to it appear below:

Example Uses of ID
Use of ID References to ID
<tr ID='foo'>
<td ID='bar'>Table Cell 1</td>
<td>Table Cell 2</td>

</tr>

<code>
<originalText>​<reference value='#foo'>​</originalText>

</code>
<code>

<originalText>​<reference value='#bar'>​</originalText>

</code>

<list>
<item ID='baz'>List item 1</item>

</list>

<code>
<originalText>​<reference value='#baz'>​</originalText>

</code>

<paragraph ID='p-1'>A paragraph
<content ID='c-1'>with content</content>

</paragraph>

<code>
<originalText>​<reference value='#p-1'>​</originalText>

</code>
<code>

<originalText>​<reference value='#c-1'>​</originalText>

</code>

This allows the text to be located with a special type of URI reference, which simply contains a fragment identifier. This URI is local to the document and so just begins with a hash mark (#), and is followed by the value of the ID being referenced. Given one of these URIs stored in a variable named theURI, the necessary text value can be found via the following XPath expression:

string(//*[@ID=substring-after('#',$theURI)])

The table below shows the result of this expression using the examples above:

URI Dereference Result
$theURI Returned Value
"#bar" "Table Cell 1"
"#foo" "Table Cell 1Table Cell 2" (note the spacing issue between 1 and T)
"#p-1" "A paragraph with content"
"#c-1" "with content"

If your XSLT processor is schema aware, even more efficient mechanisms exist to locate the element than the above expression.

Having identified the critical text in the narrative, any elements using the HL7 CD datatype (e.g., <code>) can then contain a <reference> to the <originalText> found in the narrative. That is why, although CDA allows <value> to be of any type in <entry> elements, this profile restricts them to always be of xsi:type='CD'.

Now, given an item with an ID stored in a variable named theID all <reference> elements referring to it can be found via the following XPath expression:

//cda:reference[@URI=concat('#',$theID)]
Constraints for HL7 Version 3 Messages

Unlike CDA entries, structured statements in HL7 Version 3 Messages do not have a related narrative text section. Therefore full text representations should be included in the <text> element care statement acts.