Preprocessing C-CDA 2.1 Documents
InterSystems healthcare products support import transformations from C-CDA 2.1 to SDA via XSLT 1.0. C-CDA 2.1 to SDA transformations via XSLT 2.0 are not supported.
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
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:
Working with the administrator of your organization's domain names, obtain a subdomain name to be used for code extensions.
Choose a prefix and a name for a custom mode for preprocessing.
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.
Copy the XSL preprocessor to ../CDA-Support-Files/Import/.
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:apply-templates select="/hl7:ClinicalDocument" mode="<custom_mode_prefix>:<mode>"/>
<xsl:variable name="input" select="exsl:node-set($inputRTF)/hl7:ClinicalDocument"></xsl:variable>
In your production, find the business service that takes file input for C-CDA > SDA transformations.
Set the value of the service’s InputXSL additional setting to the filename of your custom top-level transform.
Import your C-CDA file as you normally do.