Smile CDR v2023.08.PRE
On this page:

12.9Channel Import Examples


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

12.9.1Example: 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 - 2023 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.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"})
public class ChannelImportInterceptorTemplate {

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

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