Skip to main content
Previous sectionNext section

Preprocessing C-CDA 2.1 Documents

InterSystems healthcare products support import transformations from C-CDA 2.1 to SDA.

Among the enhancements to import functionality added in connection with C-CDA 2.1 support is the ability to preprocess your C-CDA input files prior to the transformation done for import. Preprocessing support can greatly simplify and reduce total processing time for transformations.

Some possible use cases are:

  • Missing or malformed elements

  • Datestamp translation

A detailed explanation of preprocessing C-CDA to remove punctuation and to add required child nodes to certain elements, as well as sample code for a preprocessor transform, a modified top-level transform, and an input file, can be found in the article Preprocessing Support for C-CDA 2.1 Import Transformations on the InterSystems Developer Community.

In general, the steps are as follows:

  1. Working with the administrator of your organization's domain names, obtain a subdomain name to be used for code extensions. 

  2. Choose a prefix and a name for a custom mode for preprocessing. 

  3. Create your XSL preprocessor.

    • The stylesheet element should be of the form

      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:hl7="urn:hl7-org:v3" xmlns:custom_mode_prefix="<subdomain>" exclude-result-prefixes="hl7 <custom_mode_prefix>"></xsl:stylesheet>

      Note the inclusion of the custom mode prefix.

    • Include templates that replicate the top-level element and copy all attributes, elements, and text nodes. Both templates must use your custom mode.

    • Create a template for each distinct modification you want to make to the C-CDA. These templates must also use your custom mode.

  4. Copy the XSL preprocessor to ../CDA-Support-Files/Import/.

  5. Create a custom top-level transform by cloning and modifying CCDAv21-to-SDA.xsl or CCDAv21-nonXML-to-SDA.xsl as follows:

    • The stylesheet element should include your custom namespace.

    • Add an include statement that gives the pathname for the XSL preprocessor.

    • Replace the line

      <xsl:variable name="input" select="/hl7:ClinicalDocument"/>

      with the block

      <xsl:variable name="inputRTF">

      <xsl:apply-templates select="/hl7:ClinicalDocument" mode="<custom_mode_prefix>:<mode>"/>

      </xsl:variable>

      <xsl:variable name="input" select="exsl:node-set($inputRTF)/hl7:ClinicalDocument"></xsl:variable>

  6. In your production, find the business service that takes file input for C-CDA > SDA transformations.

  7. Set the value of the service’s InputXSL additional setting to the filename of your custom top-level transform.

  8. Import your C-CDA file as you normally do.