# Pointcuts

This page shows all available pointcuts for each component of Smile CDR.

## FHIR Generic Client

See the [HAPI FHIR Client Pointcuts documentation](/content/hapi-fhir/docs/interceptors/client_pointcuts.html) for the request-processing pipeline and the `CLIENT_REQUEST` / `CLIENT_RESPONSE` pointcuts.

## Persistence

**Basic Persistence Pointcuts**

See the  [HAPI FHIR Server Pointcuts documentation](/content/hapi-fhir/docs/interceptors/server_pointcuts.html) for the Storage / JPA Server pipeline and the full set of `STORAGE_*` pointcuts (`STORAGE_PRESHOW_RESOURCES`, `STORAGE_PRESEARCH_REGISTERED`, `STORAGE_PRESTORAGE_RESOURCE_*`, `STORAGE_PRECOMMIT_RESOURCE_*`, `STORAGE_PREACCESS_RESOURCES`, etc.).

**Bulk Export Pointcuts**

Job ID returned to caller

$export

request

Begin batch job

[Enters job\\
\\
lifecycle\\
\\
(see Batch Job diagram)](/content/docs/interceptors/pointcuts.html#batch-job-lifecycle/index.html) [Java Hook:\\
\\
STORAGE\_PRE\_INITIATE\_BULK\_EXPORT\\
\\
(before permission checks)](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#STORAGE_PRE_INITIATE_BULK_EXPORT/index.html) [Java Hook:\\
\\
STORAGE\_INITIATE\_BULK\_EXPORT](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#STORAGE_INITIATE_BULK_EXPORT/index.html) [Java Hook:\\
\\
STORAGE\_BULK\_EXPORT\_RESOURCE\_INCLUSION\\
\\
(per candidate resource). \\
\\
This is called from inside the batch job, but is shown here for pointcut completeness.](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#STORAGE_BULK_EXPORT_RESOURCE_INCLUSION/index.html)

Binary created

Job complete

**Batch Job Lifecycle**

Client kicks off job

($reindex, $export,

$delete-expunge, ...)

Build JobInstance

(in memory)

Persist

to DB

Maintenance scheduler

picks up QUEUED job

[Run job steps\\
\\
in parallel\\
\\
(chunk processing loop —\\
\\
see Chunk Processing diagram)](/content/docs/interceptors/pointcuts.html#work-chunk-processing/index.html)

Final step completes;

job reaches terminal state

Batch job marked

as complete

Caller queries

results asynchronously

[Java Hook:\\
\\
STORAGE\_PRESTORAGE\_BATCH\_JOB\_CREATE](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#STORAGE_PRESTORAGE_BATCH_JOB_CREATE/index.html) [Java Hook:\\
\\
STORAGE\_POSTSTORAGE\_BATCH\_JOB\_CREATE](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#STORAGE_POSTSTORAGE_BATCH_JOB_CREATE/index.html) [Java Hook:\\
\\
STORAGE\_POSTCOMPLETE\_BATCH\_JOB](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#STORAGE_POSTCOMPLETE_BATCH_JOB/index.html)
**Work Chunk Processing**

ok

error

Worker claims a

READY work chunk

Build new RequestDetails

for task execution context

Execute

step logic

Mark chunk COMPLETED;

queue next chunk(s)

Retry or mark

chunk FAILED

[Java Hook:\\
\\
STORAGE\_BATCH\_TASK\_NEW\_REQUEST\_DETAILS](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#STORAGE_BATCH_TASK_NEW_REQUEST_DETAILS/index.html) [Java Hook:\\
\\
BATCH2\_CHUNK\_PROCESS\_FILTER](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#BATCH2_CHUNK_PROCESS_FILTER/index.html) [Java Hook:\\
\\
BATCH2\_CHUNK\_PROCESS\_FILTER](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#BATCH2_CHUNK_PROCESS_FILTER/index.html) [Java Hook:\\
\\
BATCH2\_CHUNK\_PROCESS\_FILTER](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#BATCH2_CHUNK_PROCESS_FILTER/index.html)

## Subscription

Subscription Module

Broker (Kafka/ActiveMQ)

Persistence Module

FHIR Endpoint Module

Deliverer

Matcher

yes

no

yes

Success

failure

A resource is

created / updated / deleted

Resource modification

received

Resource persisted

to database

[Java Hook:\\
\\
SUBSCRIPTION\_RESOURCE\_MODIFIED\\
\\
(synchronous, in PERSISTENCE module)](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#SUBSCRIPTION_RESOURCE_MODIFIED/index.html)

Matching Queue

Delivery Queue

Did the resource match

any Subscription?

Is resource of

Type Subscription?

[Java Hook:\\
\\
SUBSCRIPTION\_BEFORE\_PERSISTED\_RESOURCE\_CHECKED](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#SUBSCRIPTION_BEFORE_PERSISTED_RESOURCE_CHECKED/index.html) [Java Hook:\\
\\
SUBSCRIPTION\_AFTER\_PERSISTED\_RESOURCE\_CHECKED](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html) [Java Hook:\\
\\
SUBSCRIPTION\_RESOURCE\_DID\_NOT\_MATCH\_ANY\_SUBSCRIPTIONS](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html) [Java Hook:\\
\\
SUBSCRIPTION\_RESOURCE\_MATCHED](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html)

Subscription

Matching

[Java Hook:\\
\\
SUBSCRIPTION\_AFTER\_ACTIVE\_SUBSCRIPTION\_REGISTERED\\
\\
SUBSCRIPTION\_AFTER\_ACTIVE\_SUBSCRIPTION\_UNREGISTERED\\
\\
(when a Subscription resource is activated / removed)](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html) [Java Hook:\\
\\
SUBSCRIPTION\_BEFORE\_DELIVERY\\
\\
SUBSCRIPTION\_BEFORE\_REST\_HOOK\_DELIVERY\\
\\
SUBSCRIPTION\_BEFORE\_MESSAGE\_DELIVERY](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html)

Subscription

Delivery

[Java Hook:\\
\\
SUBSCRIPTION\_AFTER\_DELIVERY\\
\\
SUBSCRIPTION\_AFTER\_REST\_HOOK\_DELIVERY\\
\\
SUBSCRIPTION\_AFTER\_MESSAGE\_DELIVERY](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html) [Java Hook:\\
\\
SUBSCRIPTION\_AFTER\_DELIVERY\_FAILED\\
\\
(on delivery failure)](/content/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/api/Pointcut.html#SUBSCRIPTION_AFTER_DELIVERY_FAILED/index.html)

## FHIR Endpoint

See the [HAPI FHIR Server Pointcuts documentation](/content/hapi-fhir/docs/interceptors/server_pointcuts.html) for the plain-server request lifecycle and the full set of `SERVER_*` pointcuts (`SERVER_INCOMING_REQUEST_*`, `SERVER_OUTGOING_*`, `SERVER_HANDLE_EXCEPTION`, `SERVER_PROCESSING_COMPLETED*`, etc.).

## Channel Import

Kafka /

ActiveMQ

Channel Import

Router

Resource

Ingested

[Java Hook:\\
\\
CHANNEL\_IMPORT\_MESSAGE\_PRE\_PROCESSED](/content/docs/apidocs/cdr-api-public-java/ca/cdr/api/fhir/interceptor/CdrPointcut.html#CHANNEL_IMPORT_MESSAGE_PRE_PROCESSED/index.html)

## FHIR Gateway

GET / POST / PUT / DELETE

/Patient/123

Your application

Gateway Method

Called

Route

Selected

Target

Requests

Target

Responses

Target FHIR

Endpoints

[Java Hook (post route selection):\\
\\
FHIRGW\_CREATE\_POST\_SELECT\_ROUTE\\
\\
FHIRGW\_READ\_POST\_SELECT\_ROUTE\\
\\
FHIRGW\_UPDATE\_POST\_SELECT\_ROUTE\\
\\
FHIRGW\_DELETE\_POST\_SELECT\_ROUTE\\
\\
FHIRGW\_SEARCH\_POST\_SELECT\_ROUTE\\
\\
FHIRGW\_OPERATION\_POST\_SELECT\_ROUTE\\
\\
FHIRGW\_TRANSACTION\_POST\_SELECT\_ROUTE\\
\\
FHIRGW\_INSTANCE\_HISTORY\_POST\_SELECT\_ROUTE](/content/docs/apidocs/cdr-api-public-java/ca/cdr/api/fhir/interceptor/CdrPointcut.html) [Java Hook (once per target):\\
\\
FHIRGW\_CREATE\_TARGET\_PREINVOKE\\
\\
FHIRGW\_READ\_TARGET\_PREINVOKE\\
\\
FHIRGW\_UPDATE\_TARGET\_PREINVOKE\\
\\
FHIRGW\_DELETE\_TARGET\_PREINVOKE\\
\\
FHIRGW\_SEARCH\_TARGET\_PREINVOKE\\
\\
FHIRGW\_SEARCH\_PAGE\_TARGET\_PREINVOKE\\
\\
FHIRGW\_OPERATION\_TARGET\_PREINVOKE\\
\\
FHIRGW\_TRANSACTION\_TARGET\_PREINVOKE\\
\\
FHIRGW\_INSTANCE\_HISTORY\_TARGET\_PREINVOKE\\
\\
FHIRGW\_GET\_TARGET\_PREINVOKE](/content/docs/apidocs/cdr-api-public-java/ca/cdr/api/fhir/interceptor/CdrPointcut.html) [Java Hook (once per target):\\
\\
FHIRGW\_READ\_TARGET\_POSTINVOKE\\
\\
FHIRGW\_SEARCH\_TARGET\_POSTINVOKE\\
\\
FHIRGW\_OPERATION\_TARGET\_POSTINVOKE\\
\\
FHIRGW\_GET\_TARGET\_POSTINVOKE](/content/docs/apidocs/cdr-api-public-java/ca/cdr/api/fhir/interceptor/CdrPointcut.html)

## HL7V2 Listening Endpoint

JavaJavaScript

JPA Server / Storage

HL7 v2 Listener

HL7 v2 message

HL7 v2

Sender

MLLP / HTTP Listener

receives HL7 v2 Message

HL7 v2 Message

transformed into

FHIR Bundles

[Java Hook:\\
\\
HL7V2IN\_PRE\_HL7V2\_TO\_FHIR\_MAPPING\_PROCESSING](/content/docs/apidocs/cdr-api-public-java/ca/cdr/api/fhir/interceptor/CdrPointcut.html#HL7V2IN_PRE_HL7V2_TO_FHIR_MAPPING_PROCESSING/index.html) [Java Hook:\\
\\
HL7V2IN\_POST\_HL7V2\_TO\_FHIR\_MAPPING\_PROCESSING](/content/docs/apidocs/cdr-api-public-java/ca/cdr/api/fhir/interceptor/CdrPointcut.html#HL7V2IN_POST_HL7V2_TO_FHIR_MAPPING_PROCESSING/index.html) [Bundles submitted\\
\\
to transaction processor](/content/hapi-fhir/docs/interceptors/server_pointcuts.html)

JPA Server / Storage

HL7 v2 Listener

HL7 v2 message

HL7 v2

Sender

MLLP / HTTP Listener

receives HL7 v2 Message

HL7 v2 Message

transformed into

FHIR Bundles

[Javascript Hook:\\
\\
onPreConvertHl7V2ToFhir](/content/docs/hl7_v2x_support/inbound_hl7v2.html#function-onpreconverthl7v2tofhirthemessage-theconversionresult/index.html) [Javascript Hook:\\
\\
onPostConvertHl7V2ToFhir](/content/docs/hl7_v2x_support/inbound_hl7v2.html#function-onpostconverthl7v2tofhirthemessage-theconversionresult/index.html) [Bundles submitted\\
\\
to transaction processor](/content/hapi-fhir/docs/interceptors/server_pointcuts.html)

## CDA Import

JavaJavaScript

Document as XML

Operation outcome

Your

client

[$cda-import](/content/docs/guide_tutorials/tutorial_cda_import_json.html)

Create

transaction

bundle

Process

transaction

bundle

[Java Hook:\\
\\
CDA\_PRE\_IMPORT](/content/docs/apidocs/cdr-api-public-java/ca/cdr/api/fhir/interceptor/CdrPointcut.html#CDA_PRE_IMPORT/index.html) [Java Hook:\\
\\
CDA\_POST\_IMPORT](/content/docs/apidocs/cdr-api-public-java/ca/cdr/api/fhir/interceptor/CdrPointcut.html#CDA_POST_IMPORT/index.html)

Document as XML

Operation outcome

Your

client

[$cda-import](/content/docs/guide_tutorials/tutorial_cda_import_json.html)

Create

transaction

bundle

Process

transaction

bundle

[Javascript Hook:\\
\\
onPreImportCDA](/content/docs/cda_exchange_plus/javascript_import_export_hooks.html#cda-pre-import-scripts/index.html) [Javascript Hook:\\
\\
onPostImportCDA](/content/docs/cda_exchange_plus/javascript_import_export_hooks.html#cda-post-import-scripts/index.html)

## CDA Export

JavaJavaScript

POST Bundle/{bundle\_id}/$sdh.generate-cda

Operation Outcome

Your Application

[Export Document](/content/docs/guide_tutorials/tutorial_cda_export.html)

Create

Bundle

Generate external file

[Java Hook:\\
\\
CDA\_POST\_EXPORT](/content/docs/apidocs/cdr-api-public-java/ca/cdr/api/fhir/interceptor/CdrPointcut.html#CDA_POST_EXPORT/index.html)

POST Bundle/{bundle\_id}/$sdh.generate-cda

Operation Outcome

Your Application

[Export Document](/content/docs/guide_tutorials/tutorial_cda_export.html)

Create

Bundle

Generate external file

[Javascript Hook:\\
\\
onPostExportCDA](/content/docs/cda_exchange_plus/javascript_import_export_hooks.html#cda-post-export-script/index.html)

[Interceptors](/content/docs/interceptors/interceptors.html)

Pointcuts

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)

[Starter Project](/content/docs/interceptors/starter_project.html)
