Processors: CDA Exchange+ module
CDA Exchange+ processors require that the CDA Exchange+ (CDA_EXCHANGE_PLUS
) module is running. These processors execute each step of the CDA Exchange+ bidirectional transformation CDA Exchange+.
These processors integrate the existing CDA Exchange+ Import functionality with Apache Camel.
CDA Import processors are used for converting CDA documents to FHIR resources. Each processor has the specifications below:
String
, or an CdaToFhirConversionResultJsonExecutes the logic found in the pre-import script method (onPreImportCDA
) that is configured in the CDA Exchange+ module.
The resulting changes are set in the modifiableDocument
property on the CdaToFhirConversionResultJson.
Invokes the pointcut CDA_PRE_IMPORT
, executing any interceptor code that is configured in the CDA Exchange+ module.
The resulting changes are set in the modifiableDocument
property on the CdaToFhirConversionResultJson.
Translates an incoming CDA Exchange document into a FHIR transaction Bundle using the CDA Exchange+ engine. This Bundle is placed in the bundle
field of the outputted CdaToFhirConversionResultJson.
Executes the logic found in the post-import script method (onPostImportCDA
) that is configured in the CDA Exchange+ module.
The resulting changes to the bundle are set in the bundle
property on the CdaToFhirConversionResultJson.
Invokes the pointcut CDA_POST_IMPORT
, executing any interceptor code that is configured in the CDA Exchange+ module.
The resulting changes to the bundle are set in the bundle
property on the CdaToFhirConversionResultJson.
<route>
<from uri="kafka:in-topic?brokers=localhost:9092"/>
<setProperty name="originalCcd">
<spel>#{body}</spel>
</setProperty>
<to uri="smile:camel/txLogStart"/>
<to uri="smile:camel/wrapInDocumentReferenceProcessor?status=current&contentType=application/xml&docStatus=final&typeCode=34133-9&formatCode=urn:hl7-org:sdwg:ccda-structuredBody:2.1" />
<to uri="smile:persistence/singleResourceProcessor?method=CREATE" />
<setBody>
<spel>#{exchange.getProperty('originalCcd')}</spel>
</setBody>
<to uri="smile:cda_exchange_plus/cdaToFhirPreConvertScriptProcessor"/>
<to uri="smile:cda_exchange_plus/cdaToFhirPreConvertInterceptorProcessor"/>
<to uri="smile:cda_exchange_plus/cdaToFhirProcessor"/>
<to uri="smile:cda_exchange_plus/cdaToFhirPostConvertScriptProcessor"/>
<to uri="smile:cda_exchange_plus/cdaToFhirPostConvertInterceptorProcessor"/>
<choice>
<when>
<spel>#{body.isDoProcess()}</spel>
<setBody>
<spel>#{body.bundle}</spel>
</setBody>
<to uri="smile:persistence/bundleProcessor"/>
</when>
</choice>
</route>
These processors integrate the existing CDA Exchange+ Export functionality with Apache Camel.
scriptName
(required) - The name of the script template to be invokedThis processor uses the Parameters
resource in the message body, and the scriptName
parameter to create a Composition
resource which is added to the FhirToCdaConversionResultJson.composition
output.
Note: A Script Template must be created before this processor can be used. The scriptName
parameter corresponds with a Script Template ID. See the Creating a CDA Template section for more details.
This processor uses a Composition
resource to create a Bundle
resource which is added to the FhirToCdaConversionResultJson.bundle
output.
A Composition
resource, or FhirToCdaConversionResultJson
with the composition
property set, may be provided as input.
This processor uses a Bundle
resource to create a String
CDA document which is added to the FhirToCdaConversionResultJson.modifiableDocument
output.
A Bundle
resource, or FhirToCdaConversionResultJson
with the bundle
property set, may be provided as input.
Invokes the onPostExportCDA
script method (configured in the CDA Exchange+ module) which will modify the FhirToCdaConversionResultJson.modifiableDocument
property.
See the CDA Post Export JavaScript Hook section for more details.
Invokes interceptors with the CDA_POST_EXPORT
pointcut (configured in the CDA Exchange+ module) which will modify the FhirToCdaConversionResultJson.modifiableDocument
property.
See the CDA_POST_EXPORT Pointcut Javadocs for more details.
The route below is equivalent to a system-level /$smile-generate-cda
operation using the CDA Exchange+ module. See the Apply a template section for more details.
<route>
<!-- Consume messages from a Kafka `in-topic` (expected to be `Parameters` resources) -->
<from uri="kafka:in-topic?brokers=localhost:9092"/>
<!-- Uses the scriptName and Parameters in the message body to create a Composition -->
<to uri="smile:cda_exchange_plus/fhirToCdaScriptProcessor?scriptName=default-ccd-template"/>
<setVariable name="conversionResult"><spel>#{body}</spel></setVariable>
<!-- Performs the same functionality as the CDA Exchange+ `persist_generated_composition` configuration property -->
<setBody><spel>#{exchange.getVariable('conversionResult').composition}</spel></setBody>
<to uri="smile:persistence/singleResourceProcessor?method=CREATE" />
<!-- Converts the Composition from fhirToCdaScriptProcessor to a Bundle -->
<to uri="smile:cda_exchange_plus/fhirToCdaCompositionProcessor"/>
<setVariable name="conversionResult"><spel>#{body}</spel></setVariable>
<!-- Performs the same functionality as the CDA Exchange+ `persist_generated_bundle` configuration property -->
<setBody><spel>#{exchange.getVariable('conversionResult').bundle}</spel></setBody>
<to uri="smile:persistence/singleResourceProcessor?method=CREATE" />
<setBody><spel>#{exchange.getVariable('conversionResult')}</spel></setBody>
<!-- Converts the Bundle from fhirToCdaCompositionProcessor to a CDA Document -->
<to uri="smile:cda_exchange_plus/fhirToCdaBundleProcessor"/>
<!-- Invokes the `onPostExportCDA` script method provided in the CDA Exchange+ module configuration -->
<to uri="smile:cda_exchange_plus/fhirToCdaPostConvertScriptProcessor"/>
<!-- Invokes the `CDA_POST_EXPORT` pointcut method provided in the CDA Exchange+ module configuration -->
<to uri="smile:cda_exchange_plus/fhirToCdaPostConvertInterceptorProcessor"/>
<setVariable name="conversionResult"><spel>#{body}</spel></setVariable>
<!-- Performs the same functionality as the CDA Exchange+ `persist_generated_document_as_binary` configuration property -->
<setBody><spel>#{exchange.getVariable('conversionResult')}</spel></setBody>
<to uri="smile:camel/wrapInBinaryResourceProcessor" />
<to uri="smile:persistence/singleResourceProcessor?method=CREATE" />
<setVariable name="binaryUrl"><spel>#{'/' + exchange.getVariable('resourceId')}</spel></setVariable>
<!-- Performs the same functionality as the CDA Exchange+ `persist_generated_document_as_document_reference` configuration property -->
<setBody><spel>#{exchange.getVariable('conversionResult')}</spel></setBody>
<toD uri="smile:camel/wrapInDocumentReferenceProcessor?contentUrl=${variable.binaryUrl}" />
<to uri="smile:persistence/singleResourceProcessor?method=CREATE" />
<!-- Send the exported CDA document to a Kafka `out-topic` -->
<setBody><spel>#{exchange.getVariable('conversionResult').modifiableDocument}</spel></setBody>
<to uri="kafka:out-topic?brokers=localhost:9092"/>
</route>
You are about to leave the Smile Digital Health documentation and navigate to the Open Source HAPI-FHIR Documentation.