# Channel Import Examples

This page contains example interceptors that can be registered with [Channel Import module](/content/docs/modules/channel_import.html).

# 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.

```java
/*-
 * #%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](/content/docs/interceptors/examples_subscription.html)

Examples: Channel Import

Interceptors

[Interceptors](/content/docs/interceptors/interceptors.html)
[Pointcuts](/content/docs/interceptors/pointcuts.html)
[Starter Project](/content/docs/interceptors/starter_project.html)
[Examples: FHIR Endpoints](/content/docs/interceptors/examples_fhir_endpoint.html)
[Examples: HL7v2 Endpoints](/content/docs/interceptors/examples_hl7v2_endpoint.html)
[Examples: FHIR Storage](/content/docs/interceptors/examples_fhir_storage.html)
[Examples: FHIR Gateway](/content/docs/interceptors/examples_fhir_gateway.html)
[Examples: FHIR Client](/content/docs/interceptors/examples_fhir_client.html)
[Examples: MDM](/content/docs/interceptors/examples_mdm.html)
[Examples: Subscription](/content/docs/interceptors/examples_subscription.html)
[Examples: Channel Import](/content/docs/interceptors/examples_channel_import.html)
[Examples: Cluster Manager](/content/docs/interceptors/examples_cluster_manager.html)
[Examples: App Sphere](/content/docs/interceptors/examples_app_sphere.html)
[Examples: System To System Data Exchange](/content/docs/interceptors/examples_s2s_data_exchange.html)
[2024.02.01 Migration Guide](/content/docs/interceptors/jakarta_upgrade.html)

[Examples: Cluster Manager](/content/docs/interceptors/examples_cluster_manager.html)
