Smile CDR provides a set of sample projects built to demonstrate how to take advantage of various aspects of the system such as hybrid providers, interceptors, theme skinning, CDS hooks, and more.
These demo projects contain complete Maven-based Java code to define functionality around the system. When using a demo project, follow these instructions to make it your own:
pom.xml
file. The <groupId>
, <artifactId>
, and <name>
tags all contain placeholders. You can leave the examples if you are just experimenting, but it is recommended to replace these with something more useful before committing your code to source control.mvn clean install
Maven will create a JAR containing your interceptor classes in the target/
directory. The exact name of the JAR file will vary depending on the groupId and artifactId you picked, but by default it will be called: cdr-interceptor-starterproject-[version].jar
.
Copy this JAR file to the customerlib/
directory in your Smile CDR installation
Restart Smile CDR.
Restart the module.
The remainder of this page will go into the details for each specific demo project.
The cdr-interceptor-starterproject contains a complete example Maven-based Java project to define an interceptor that can be imported into Smile CDR. This project also contains an example showing a Java Consent Service implementation.
The Interceptor Starter Project ships many pre-built java classes. These classes have sample implementations making use of each pointcut available to them.
Class Name | What it is implementing |
---|---|
com.smilecdr.demo.fhirendpoint.ServerInterceptorTemplate | FHIR Endpoint Server interceptor |
com.smilecdr.demo.hl7v2listening.Hl7V2ListeningInterceptorTemplate | HL7v2 Endpoint Server interceptor |
com.smilecdr.demo.fhirstorage.StorageInterceptorTemplate | FHIR Storage interceptor |
com.smilecdr.demo.fhirgateway.GatewayInterceptorTemplate | FHIR Gateway interceptor |
com.smilecdr.demo.fhirclient.ClientInterceptorTemplate | FHIR Client interceptor |
com.smilecdr.demo.mdm.MDMInterceptorTemplate | MDM interceptor |
com.smilecdr.demo.subscription.SubscriptionInterceptorTemplate | Subscription interceptor |
com.smilecdr.demo.channelimport.ChannelImportInterceptorTemplate | Channel Import interceptor |
com.smilecdr.demo.priorauthcrd.PriorAuthCRDInterceptorTemplate | Prior Auth CRD interceptor |
com.smilecdr.demo.s2sdataexchange.S2SDataExchangeInterceptorTemplate | System To System Data Exchange interceptor |
com.smilecdr.demo.fhirstorage.ExampleAttributeEnhancingInterceptor
) to the Interceptor Bean Types property in your module configuration@Configuration
e.g. com.smilecdr.demo.server.r4.TestServerAppCtx
) to the Interceptor Bean Types property in your module configuration, which will allow you to register one or more interceptor beans and use dependency injection with your interceptorsThis demo project specifically shows complete solutions for preConvert and postConvert mapping rules, via the HL7V2IN_PRE_HL7V2_TO_FHIR_MAPPING_PROCESSING
and HL7V2IN_POST_HL7V2_TO_FHIR_MAPPING_PROCESSING
pointcuts.
com.example.endpoint.hl7v2.inbound.PreConvertInterceptor
) to the Interceptor Bean Types property in your module configuration.HL7V2IN_PRE_HL7V2_TO_FHIR_MAPPING_PROCESSING
and HL7V2IN_POST_HL7V2_TO_FHIR_MAPPING_PROCESSING
pointcuts can autowire an ITermConceptClientMappingSvc
in order to perform ContextMap translations.
For this bean to be available for autowiring, the HL7V2 inbound module must have a persistence dependency configured any FHIR Storage Module (any FHIR version)
.
This sample project uses the HL7V2IN_PRE_HL7V2_TO_FHIR_MAPPING_PROCESSING
and HL7V2IN_POST_HL7V2_TO_FHIR_MAPPING_PROCESSING
pointcuts with an autowired ITermConceptClientMappingSvc
which allows performing ConceptMap translations. You can see this code in the com.example.endpoint.hl7v2.inbound.term
package.
HL7V2IN_PRE_HL7V2_TO_FHIR_MAPPING_PROCESSING
and HL7V2IN_POST_HL7V2_TO_FHIR_MAPPING_PROCESSING
pointcuts can instantiate a BundleBuilder
by autowiring a FhirContext
and using it as constructor parameter, in order to facilitate transaction bundle building.
A sample project that uses the HL7V2IN_PRE_HL7V2_TO_FHIR_MAPPING_PROCESSING
pointcut to instantiate a BundleBuilder
can be seen in the com.example.endpoint.hl7v2.inbound.transaction
package of this demo project.
The Camel Demo Project includes sample routes, context configuration classes, and processors.
As camel is slightly more complex than the basic interceptors, see the camel page for detailed packaging and deployment instructions.
This project uses the Timer Component
to create a Message every second with an empty body. This Message is then passed to the TestCustomProcessor
which calls the process(Exchange)
method. This method simply logs the incoming Message body
and headers
,
modifies them, and then logs them again.
Here is the route in the XML format:
<route>
<from uri="timer:test"/>
<to uri="bean:testCustomProcessor"/>
</route>
Here is the same route in YAML format:
- from:
uri: "timer:test"
steps:
- to:
uri: "bean:testCustomProcessor"
customerlib/
directory within your Smile CDR installation.Instructions on how to write a Hybrid Provider can be found in the Hybrid Providers Intro page. Once the code is written, it can be packaged as follows.
customerlib/
directory of the Smile CDR installationsrc/main/resources
. You can modify these files to your liking, or replace them entirely with new files with the same names, at the same path.