Examples: Channel Import - Smile CDR Documentation

Channel Import Examples

This page contains example interceptors that can be registered with Channel Import module.

Example: Starter Channel Import interceptor for CHANNEL_IMPORT_MESSAGE_PRE_PROCESSED pointcut

The following interceptor is intended to be used within the Channel Import module as a starter interceptor. The purpose of the pointcut is to provide customers with the capability to inspect, modify or reject messages being processed by the module.

/*-
 * #%L
 * Smile CDR - CDR
 * %%
 * Copyright (C) 2016 - 2026 Smile CDR, Inc.
 * %%
 * All rights reserved.
 * #L%
 */
package com.smilecdr.demo.channelimport;

import ca.cdr.api.fhir.interceptor.CdrHook;
import ca.cdr.api.fhir.interceptor.CdrPointcut;
import ca.uhn.fhir.interceptor.api.Interceptor;
import ca.uhn.fhir.rest.server.messaging.json.ResourceOperationJsonMessage;
import ca.uhn.fhir.util.StopWatch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Sample Channel Import Interceptor implementing all CHANNEL_IMPORT_MESSAGE_PRE_PROCESSED pointcuts.
 * It is intended to be used in CHANNEL IMPORT module 'Interceptor Bean Types'.
 * Can be used as a starting point for your channel import interceptor.
 */
@SuppressWarnings({"unused", "EmptyTryBlock"})
@Interceptor
public class ChannelImportInterceptorTemplate {

private static final Logger ourLog = LoggerFactory.getLogger(ChannelImportInterceptorTemplate.class);

@CdrHook(CdrPointcut.CHANNEL_IMPORT_MESSAGE_PRE_PROCESSED)
    public Boolean channelImportMessagePreProcessed(ResourceOperationJsonMessage theMsg) {

ourLog.info("Interceptor CHANNEL_IMPORT_MESSAGE_PRE_PROCESSED - started");
        StopWatch stopWatch = new StopWatch();
        try {
            // your implementation goes here
        } finally {
            ourLog.info("Interceptor CHANNEL_IMPORT_MESSAGE_PRE_PROCESSED - ended, execution took {}", stopWatch);
        }
        // should return a boolean indicating whether to proceed
        return null;
    }
}

Copy

Examples: Subscription

Examples: Channel Import

Interceptors

Interceptors Pointcuts Starter Project Examples: FHIR Endpoints Examples: HL7v2 Endpoints Examples: FHIR Storage Examples: FHIR Gateway Examples: FHIR Client Examples: MDM Examples: Subscription Examples: Channel Import Examples: Cluster Manager Examples: App Sphere Examples: System To System Data Exchange 2024.02.01 Migration Guide

Examples: Cluster Manager