Presentation is loading. Please wait.

Presentation is loading. Please wait.

Clinical Data Exchange using HL7 and Mirth Connect Lecture 12 - Using JavaScript with Mirth Connect – III - Advanced Message Routing - XSLT transforms.

Similar presentations


Presentation on theme: "Clinical Data Exchange using HL7 and Mirth Connect Lecture 12 - Using JavaScript with Mirth Connect – III - Advanced Message Routing - XSLT transforms."— Presentation transcript:

1 Clinical Data Exchange using HL7 and Mirth Connect Lecture 12 - Using JavaScript with Mirth Connect – III - Advanced Message Routing - XSLT transforms - Mirth Connect Command Line Interface - Java client API Siv Raman, MD, MS

2 2 ADVANCED MESSAGE ROUTING: Common Routing Patterns  Broadcast mode: Single incoming message is filtered and transformed in the source connector, then routed to multiple destinations Mirth Connect Channel Source Connector Data Source Filter Transformer Destination Connector Destination Connector Destination Connector Destination Connector Destination

3 3 ADVANCED MESSAGE ROUTING: Common Routing Patterns  Router mode: Single incoming message is routed to multiple destinations, each having its own filter and transformer Mirth Connect Channel Source Connector Data Source Filter Transformer Destination Destination Connector Filter Transformer Destination Connector Filter Transformer Destination Connector Filter Transformer Destination Connector Filter Transformer

4 4 ADVANCED MESSAGE ROUTING: Common Routing Patterns  Application Integration mode: Single incoming message is routed to an application and a response is sent back Mirth Connect Channel Source Connector Data Source Filter Transformer Destination Application Destination Connector

5 5 ADVANCED MESSAGE ROUTING: Common Routing Patterns  Chaining: One or more destination connectors route messages to another channel, having its own filter and transformer Mirth Connect Channel Source Connector Data Source Filter Transformer Destination Connector Destination Mirth Connect Channel Source Connector Filter Transformer Destination Connector

6 6 ADVANCED MESSAGE ROUTING: Internal Routing  Routing of messages between channels  Two ways to route messages internally:  Channel Reader/Writer  Channel Reader allows a channel to only listen for new messages from other channels  Can respond from one of its destinations  Channel Writer provides a way to pass messages between channels  Can choose to wait for response from Channel Reader  If not waiting for a response, message data will be temporarily queued to file system  VMRouter  Accessible from any JavaScript context  Can route any data to any channel router.routeMessage (channelName, message); router.routeMessage (channelName, message, useQueue);  useQueue boolean option specifies whether to use file system to temporarily queue message (true by default)  If useQueue is false, the router can wait for response from a Channel Reader that is set to return a response

7 7 ADVANCED MESSAGE ROUTING: Internal Routing  Two ways to route messages internally, cont.  VMRouter, cont.  router.routeMessage() returns a VMResponse object  Call its getMessage() method to get the response message  Message data must be in the format expected by the Destination source connector  Use appropriate serializer to convert from XML if in a filter or transformer  Code will continue to be executed after call  For either the Channel Writer or VMRouter, the destination channel does not need to be a channel with a Channel Reader  From a Channel Writer or VMRouter, you can route to any channel regardless of its source connector type  However, the Channel Writer or VMRouter can only receive a response back from a Channel Reader  Forwarding responses  Destination connectors for response-based protocols provide the option to send the response to another channel for further processing  HTTP, LLP, TCP, Web Service  Some HL7 message types expect a non-ACK message response  For example, VXQ response is VXR or VXX

8 8 ADVANCED MESSAGE ROUTING: Dynamic Configuration  Many channel properties can be determined dynamically on a per-message basis  Channel map variables can be derived from message values and used as properties on destination connectors  Routing can be performed with single connector  Global Variables can be created in a Deploy script and used in source or destination connectors  Use ${} notation to add placeholder (i.e. Velocity template variable) for the value  Example: ${ipaddress}

9 9 XSLT Transformers  XSLT  EXtensible Stylesheet Language Transformations  Transforms XML documents into other document formats (e.g., HTML, plain text, other XML)  XSLT template/stylesheet defines how data is transformed  At this time, Mirth Connect uses the Apache Xalan XSLT Engine XML document (input) XSLT file/stylesheet Output document (XML, HTML, plain text, …) XSLT Engine/Processor

10 10 XSLT Transformers, cont.  To create an XSLT transformer step, specify:  Variable containing XML code to transform (for example, msg )  Name of channel map variable in which to store the results  XSLT Template code  Turn off the "Strip Namespaces" option

11 11 Mirth Connect Command Line Interface  Alternate command-line interface for Mirth Connect  Interactive mode  Scripted mode  Ability to import/export channels, modify users, check channel stats and statuses, stop/start/pause/deploy channels, etc.  Cannot edit channels  Remote access via HTTPS  Script mode allows a batch of commands to be executed  Automatically disconnects when all commands are completed  Two ways to specify scripted mode and script file:  Add -s scriptfile to the command line: mccommand.exe -s scriptfile  Add script=scriptfile property to conf/mirth-cli-config.properties

12 12 Mirth Connect Command Line Interface: Available commands status Returns status of deployed channels deploy [timeout] Deploys all Channels with optional timeout (in seconds) import "path" [force] Imports channel specified by. Optional 'force' overwrites existing channels. export id|"name"|* "path" Exports the specified channel to importcfg "path" Imports configuration specified by exportcfg "path" Exports the configuration to importalerts "path" Imports alerts specified by exportalerts "path" Exports alerts to importscripts "path" Imports global script specified by exportscripts "path" Exports global script to importcodetemplates "path" Imports code templates specified by exportcodetemplates "path" Exports code templates to importmessages "path" id Imports messages specified by into the channel specified by exportmessages "path" id [xml|raw|transformed|encoded] [pageSize] Exports all messages for channel specified by to channel undeploy|deploy|start|stop|pause|resume|stats id|"name"|* Performs specified channel action channel remove|enable|disable id|"name"|* Remove, enable or disable specified channel channel list Lists all Channels clear Removes all messages from all Channels resetstats Removes all stats from all Channels dump stats|events "path" Dumps stats or events to specified file user list Returns a list of the current users user add username "password" "firstName" "lastName" "organization" "email" Adds the specified user user remove id|username Removes the specified user user changepw id|username "newpassword" Changes the specified user's password quit Quits Mirth Connect Shell

13 13 Java Client API  Any Java application can interface with the Mirth Connect Server  Class com.mirth.connect.client.core.Client in mirth-client-core.jar  Same class called by Mirth Connect Administrator and Shell client  Client class communicates with server via REST


Download ppt "Clinical Data Exchange using HL7 and Mirth Connect Lecture 12 - Using JavaScript with Mirth Connect – III - Advanced Message Routing - XSLT transforms."

Similar presentations


Ads by Google