45.6.1Hl7v2 Inbound Processors

 

Hl7v2 Inbound Processors require the HL7 v2.x Listening Endpoint (ENDPOINT_HL7V2_IN) module. These processors execute each message transformation step of the HL7 v2.x listening endpoint module.

Each Hl7v2 processor has the specifications below:

A description of each Hl7v2 processor is provided below.

45.6.2Pre-Convert Script Processor

 

The hl7v2ToFhirPreConvertScriptProcessor processor executes the logic inside the Javascript onPreConvertHl7V2ToFhir callback function.

45.6.3Pre-Convert Mapper Bean Processor

 

This processor is for backwards compatibility to support custom Mapper Bean Types.

For pre-convert and post-convert customizations, Javascript callbacks (onPreConvertHl7V2ToFhir, onPostConvertHl7V2ToFhir), or Java interceptors (HL7V2IN_PRE_HL7V2_TO_FHIR_MAPPING_PROCESSING, HL7V2IN_POST_HL7V2_TO_FHIR_MAPPING_PROCESSING) should be used instead.

The hl7v2ToFhirPreConvertMapperBeanProcessor processor executes the logic inside the specified custom mapper bean class.

45.6.4Pre-Convert Interceptor Processor

 

The hl7v2ToFhirPreConvertInterceptorProcessor processor executes the logic inside specified by HL7V2IN_PRE_HL7V2_TO_FHIR_MAPPING_PROCESSING interceptor.

45.6.5Convert HL7 v2.x to FHIR

 

The hl7v2ToFhirProcessor processor translates an incoming HL7V2 message into FHIR transaction Bundles using the Smile generic mapper. These Bundles are placed in the bundles field of the outputted Hl7v2ToFhirConversionResultJson.

45.6.6Post-Convert Script Processor

 

The hl7v2ToFhirPostConvertScriptProcessor processor executes the logic inside the Javascript onPostConvertHl7V2ToFhir callback function.

45.6.7Post-Convert Interceptor Processor

 

The hl7v2ToFhirPostConvertInterceptorProcessor processor executes the logic inside specified by theHL7V2IN_POST_HL7V2_TO_FHIR_MAPPING_PROCESSING interceptor.

45.6.8HL7v2 Inbound: Sample Route

 

The following route receives an HL7v2 message from a kafka topic called in-topic and passes it to the pre-convert customization points, the generic Smile Hl7v2-to-FHIR mapper, and the post-convert customization points of the HL7 v2.x listening endpoint module.

After the last Hl7v2 processor has finished executing (i.e. hl7v2ToFhirPostConvertInterceptorProcessor) Camel is used check to make sure the doProcess flag is still true and no errors occurred during the conversion process.

If this check succeeds, the converted bundles of the Hl7v2ToFhirConversionResultJson are persisted using the bundleProcessor.

If the checks are not successful, the entire Hl7v2ToFhirConversionResultJson is posted to the kafka error-topic.

<routes xmlns="http://camel.apache.org/schema/spring">
	<route>
		<from uri="kafka:in-topic?brokers=localhost:9092"/>
		<to uri="smile:endpoint_hl7v2_in/hl7v2ToFhirPreConvertScriptProcessor"/>
		<to uri="smile:endpoint_hl7v2_in/hl7v2ToFhirPreConvertMapperBeanProcessor"/>
		<to uri="smile:endpoint_hl7v2_in/hl7v2ToFhirPreConvertInterceptorProcessor"/>
		<to uri="smile:endpoint_hl7v2_in/hl7v2ToFhirProcessor"/>
		<to uri="smile:endpoint_hl7v2_in/hl7v2ToFhirPostConvertScriptProcessor"/>
		<to uri="smile:endpoint_hl7v2_in/hl7v2ToFhirPostConvertInterceptorProcessor"/>
		<choice>
			<when>
				<spel>#{body.isDoProcess() and !body.hasErrorIssues()}</spel>
				<split>
					<spel>#{body.bundles}</spel>
					<to uri="smile:persistence/bundleProcessor"/>
				</split>
			</when>
			<otherwise>
				<to uri="kafka:error-topic?brokers=localhost:9092"/>
			</otherwise>
		</choice>
	</route>
</routes>