Mirth 1.7.1 Reference Guide
Mirth 1.7.1 Reference Guide
Mirth 1.7.1 Reference Guide
1 Reference Guide
pág. 1
Mirth 1.7.1 Reference Guide
Tabla de contenido
Introduction .............................................................................................................................. 5
Mirth ........................................................................................................................................ 5
Requirements ....................................................................................................................... 5
Installation ............................................................................................................................ 5
Microsoft Windows Installation ......................................................................................... 6
Linux Installation ............................................................................................................. 10
Apple Mac OS X .............................................................................................................. 14
Automated Installer ........................................................................................................ 18
Starting Mirth ..................................................................................................................... 19
Mirth Administrator ................................................................................................................ 20
Login ................................................................................................................................... 20
DashBoard .......................................................................................................................... 21
Status Tasks .................................................................................................................... 21
Channel Status ................................................................................................................ 23
Dashboard Status Panel................................................................................................... 23
Channels ............................................................................................................................. 24
Channels List ................................................................................................................... 24
Edit Channel ........................................................................................................................ 25
Summary......................................................................................................................... 25
Source ............................................................................................................................. 27
Destinations .................................................................................................................... 29
Scripts ............................................................................................................................. 31
Reference List ..................................................................................................................... 32
Filters.................................................................................................................................. 36
Filter Tasks ...................................................................................................................... 36
Rule List .......................................................................................................................... 36
Rule Detail (Type=Rule Builder) ....................................................................................... 37
Rule Detail (Type=JavaScript)........................................................................................... 38
Message Template Tab (Filters) ....................................................................................... 39
Reference Tab (Filters) .................................................................................................... 42
Message Trees Tab (Filters) ............................................................................................. 43
pág. 2
Mirth 1.7.1 Reference Guide
Transformers ...................................................................................................................... 44
Transformer Tasks ........................................................................................................... 44
Step List .......................................................................................................................... 44
Step Detail (Type=Message Builder) ................................................................................ 45
Step Detail (Type=Mapper).............................................................................................. 46
Step Detail (Type=JavaScript) .......................................................................................... 48
Message Templates Tab (Transformers) .......................................................................... 49
Reference Tab (Transformers) ......................................................................................... 51
Message Trees Tab (Transformers) .................................................................................. 52
Source Connectors .............................................................................................................. 54
Channel Reader ............................................................................................................... 54
Database Reader ............................................................................................................. 55
FTP Reader ...................................................................................................................... 58
File Reader ...................................................................................................................... 61
HTTP Listener .................................................................................................................. 64
JMS Reader ..................................................................................................................... 66
JavaScript Reader ............................................................................................................ 68
LLP Reader ...................................................................................................................... 69
SFTP Reader .................................................................................................................... 72
SOAP Listener.................................................................................................................. 75
TCP Listener .................................................................................................................... 76
Destination Connectors ....................................................................................................... 78
Channel Writer................................................................................................................ 78
Database Writer .............................................................................................................. 78
Document Writer ............................................................................................................ 81
Email Sender ................................................................................................................... 82
FTP Writer ....................................................................................................................... 83
File Writer ....................................................................................................................... 85
HTTP Sender.................................................................................................................... 87
JMS Writer ...................................................................................................................... 89
JavaScript Writer ............................................................................................................. 92
LLP Sender ...................................................................................................................... 93
SFTP Writer ..................................................................................................................... 96
SOAP Sender ................................................................................................................... 98
pág. 3
Mirth 1.7.1 Reference Guide
pág. 4
Mirth 1.7.1 Reference Guide
Introduction
Mirth is an open source health care integration engine that supports the creation of interfaces,
or channels, that perform message filtering, transforming, and routing between disparate
systems. Channels are created and configured using the Mirth Administrator rich client and are
deployed to the Mirth Server. Once deployed, channels can be monitored and controlled
remotely through the Administrator interface.
Mirth
Requirements
Installation
The Mirth distribution includes installers for Windows, Linux, and Mac OS X. To execute the
installer file, run the following command:
pág. 5
Mirth 1.7.1 Reference Guide
If Mirth is already running as a service, please shut down the Mirth Server Manager by right-
clicking on the system tray icon and choosing Close Manager.
pág. 6
Mirth 1.7.1 Reference Guide
Step 4: If upgrading an existing Mirth installation, click Browse to locate the existing folder.
Otherwise, specify the installation path.
pág. 7
Mirth 1.7.1 Reference Guide
Step 5: Select the components to install. The Mirth Server Manager component helps configure
and manage the Mirth server when running it as a service under Windows 2000/2003/XP/Vista.
pág. 8
Mirth 1.7.1 Reference Guide
Step 8: When installation has successfully completed, there is the option to save an automatic
installation script in order to replicate the installation process on another system.
pág. 9
Mirth 1.7.1 Reference Guide
Linux Installation
pág. 10
Mirth 1.7.1 Reference Guide
Step 4: If upgrading an existing Mirth installation, click Browse to locate the existing folder.
Otherwise, specify the installation path.
pág. 11
Mirth 1.7.1 Reference Guide
pág. 12
Mirth 1.7.1 Reference Guide
Step 8: When installation has successfully completed, there is the option to save an automatic
installation script in order to replicate the installation process on another system.
pág. 13
Mirth 1.7.1 Reference Guide
Apple Mac OS X
pág. 14
Mirth 1.7.1 Reference Guide
Step 4: If upgrading an existing Mirth installation, click Browse to locate the existing folder.
Otherwise, specify the installation path.
pág. 15
Mirth 1.7.1 Reference Guide
pág. 16
Mirth 1.7.1 Reference Guide
Step 7: When installation has successfully completed, there is the option to save an automatic
installation script in order to replicate the installation process on another system.
Step 8: Change directories to the Mirth installation directory by running the following command
at the terminal:
cd /Applications/Mirth
./mirth.sh
pág. 17
Mirth 1.7.1 Reference Guide
Automated Installer
To run the automated installer with a generated installation script, run the following command:
pág. 18
Mirth 1.7.1 Reference Guide
Starting Mirth
The Mirth Server needs to be started before the Administrator can be launched.
pág. 19
Mirth 1.7.1 Reference Guide
Mirth Administrator
Login
When the Mirth Administrator starts, the first thing it will display is the Login dialog.
Server
Enter the URL where Mirth is listening for Administrator logins. This is https://\{ipOfMachineWith
Mirth}:{httpPort}. By default, the httpsPort is 8443. This is always filled in, when webstarting.
Username
Enter the username to log in as. When Mirth is first installed, the only available username is
"admin".
Password
Enter the password for the username entered. The default password for the username admin is
"admin" and should be changed as soon as possible on a production machine.
Login
Click to login to the Mirth Administrator.
Exit
Click to close the Login dialog.
pág. 20
Mirth 1.7.1 Reference Guide
DashBoard
The Dashboard view shows the current status of all deployed channels and their connections,
and provides access to basic channel control operations.
Status Tasks
The Status Tasks area provides access to basic channel control operations.
Refresh
Updates the channel status area of the dashboard. By default, this area is automatically
refreshed every ten seconds. The time between automatic refreshes can be configured via the
Settings view.
pág. 21
Mirth 1.7.1 Reference Guide
Send Message
The Send Message dialog allows a message to be sent to the selected channel, to aid in testing
the channel.
Message Displays the message to be sent. Paste text or drag-and-drop a text file
with the message to be sent here. Right-clicking the text area also gives
more options like showing line ending characters and Find/Replace
Open File... Opens a file and loads it as the message to be sent.
Process Binary File... Sends the loaded message to the channel as an incoming message.
View Messages
Shows the stored messages for the selected channel.
See Message Browser section for full details.
Clear Statistics
Clears the statistics for the selected channel.
Pause Channel
Pauses the selected channel, temporarily suspending its processing of messages. Incoming
messages for the channel will be accepted and queued in memory.
Stop Channel
Stops the selected channel. Attempts to send to the channel will fail.
pág. 22
Mirth 1.7.1 Reference Guide
Channel Status
The Channel Status area shows the status of all deployed channels. Each line corresponds to
one channel.
Status Shows the status of this channel. The status of a channel may be
Started, Stopped or Paused.
Name Shows the name of this channel
Received Shows the number of messages received by this channel since the
statistics were last cleared.
Filtered Shows the number of messages filtered (ignored) by this channel since
the statistics were last cleared.
Queued Shows the number of messages currently queued by this channel. If
this statistic is cleared while messages are queued, it will not accurately
represent the number of messages currently queued.
Sent Shows the number of messages sent by this channel since the statistics
were last cleared.
Errored Shows the number of messages that caused an error on this channel
since the statistics were last cleared.
Connection Shows the current status of the source connector for this channel.
Channel Displays the channel to which the event occurred. This is only shown if
no specific channel is selected above.
Connector Info Displays the channel connector to which the event occurred.
Pause/Resume Log Clicking this button causes the display of the log to pause or resume.
The capture of log events continues while the log display is paused.
Clear Displayed Log Clicking this button causes the log display to be cleared.
Log Size Enter the maximum number of events to maintain in this display.
Change Log Display Clicking this button causes any change entered in the Log Size control
pág. 23
Mirth 1.7.1 Reference Guide
Channels
The Channels View is where channels are created, modified, deleted, and deployed.
Channels List
The Channels list displays a summary of all the channels currently defined.
pág. 24
Mirth 1.7.1 Reference Guide
Edit Channel
Summary
pág. 25
Mirth 1.7.1 Reference Guide
Channel Tasks Save Changes : Saves any changes made to the open Channel.
The Channel remains open for editing.
Export Channel :Exports the open Channel to a file.
Channel Name The name to assign to this channel. Each channel must have a unique
name, may not have more than 40 characters, and must not contain
any special characters.
Incoming Data Selects the format of data the channel should expect to come in.
Initial State Selects whether the channel should start as soon as it is deployed (or
when Mirth is started), or should wait to be manually started.
Enabled Check this box to enable the channel. Channels that are not enabled
(disabled) are not deployed, and are inactive as a result.
Use Transactional Checking transactional endpoints causes all database destination
From Messages from incoming messages. This option is useful for mapping data
received over a web service that includes multiple namespaces.
Synchronize channel Synchronizing a channel enforces the following rules:
All destinations will be executed in the order they are defined in the
destination list.
The source connector will wait for all destinations to complete
before sending a response (if any).
Each destination's response is available for inspection in the
Postprocessor.
The Postprocessor is executed after every destination has
completed processing.
A synchronized channel will operate utilizing a single execution thread
per message received. Message order is not guaranteed if a channel is
not synchronized. Synchronization is required to send response data
from a destination back to a source connector. LLP queuing is not
recommended on a synchronized channel.
Revision Displays the current revision of the channel. The revision starts at zero
when the channel is first created and is automatically incremented each
time the channel is modified and saved.
Last Modified Displays the date and time when the channel was last changed and
saved.
Encrypt messages in Check this box to have the channel's messages stored in an encrypted
pág. 26
Mirth 1.7.1 Reference Guide
database form for privacy, or leave it unchecked to store the messages in clear
form for maximum performance.
Store message data Check this box to store messages for the channel, or uncheck it to not
store messages. A channel configured to not store its messages can
handle more messages per second than the channel configured to
store its messages. It is best to store messages "With errors only" when
running in a production environment.
Do not store filtered Check this box to not store messages which are rejected by the
after number of days. See also Message Pruner section for a more flexible
message pruning approach.
Description Enter the free-form text description of this channel here.
Source
Use the Source tab to configure how the open channel reads messages - the channel's source
connector and its filter and transformer. The connector settings that must be configured vary
widely depending on the type of connector chosen.
Channel Tasks
Validate Connector
Tests whether or not the defined source connector settings, filter, and transformer are valid.
Edit Filter
Clicking this item opens a new panel to edit the filter for the source connector of the open
channel.
pág. 27
Mirth 1.7.1 Reference Guide
A channel's source filter examines the message coming into the channel and decides whether
to accept or reject the message. If the message is accepted, channel processing for the
message continues through the transformer and destination connector stages. If the message is
rejected, no further channel processing occurs for the message.
Filters are constructed as an ordered series of Rules, each of which can be created by the Rule
Builder, or using JavaScript.
See Filters section for full details on how to use filters.
Edit Transformer
Click this item edit the transformer for the source connector of the open channel.
pág. 28
Mirth 1.7.1 Reference Guide
The purpose of a source transformer is to modify or replace the message coming into the
channel by a new message. A new "outbound" message can be created by loading a template
into the Outbound Message Template, and then creating transformer steps to replace parts of
the Outbound Message Template by values obtained from the Inbound Message.
Transformers are constructed as an ordered series of Steps, each of which can be created as a
Mapper, Message Builder, or JavaScript. When the channel receives a message, the steps of
the transformer are executed in the order that they appear in the Step List.
Mapper steps create variables with values taken from the incoming message.
Message Builder steps can help construct a new template-based message, usually
using values from the incoming message.
JavaScript steps perform complex scripted actions.
See Transformers section for full details on how to use transformers.
Connector Type
The Connector Type allows the selection of the type of connector the channel should use to
read messages. The connector type is based on the method to use to communicate with the
destination.
See Source Connectors section for a complete list of source connectors and their specifications.
Destinations
The Destinations tab is used to configure how the open channel writes outbound messages.
This tab contains the channel's destination connectors and their corresponding filters and
transformers. The connector settings that must be configured vary widely depending on the type
of connector chosen.
pág. 29
Mirth 1.7.1 Reference Guide
Channel Tasks
Save Changes Validates the changes made, and if valid, saves them.
Validate Connector Tests if the changes made to the connector, filter, and transformer are
valid.
New Destination Adds a new destination at the end of the destinations list.
Delete Destination Removes the destination currently selected in the destinations list.
Clone Destination Adds a copy of the destination currently selected in the destinations list
to the end of the destinations list.
Disable (Enable) Disables or enables the destination currently selected in the
Destination destinations list. Disabled destinations are saved but are not used
during message processing.
Move Dest. Up Exchanges the destination currently selected in the destinations list with
the one above it. In synchronized channels, destinations execute in
sequential order so use this option to arrange them in the order needed.
Move Dest. Down Exchanges the destination currently selected in the destinations list with
the one below it. In synchronized channels, destinations execute in
sequential order so use this option to arrange them in the order needed.
Edit Filter A channel destination's filter examines the message coming from the
channel's source, and decides whether to pass the message through
the destination's transformer and connector, or ignore the message.
Destination filters are otherwise exactly like source filters. See Filters
section for full details on how to use filters.
Edit Transformer Click this item to edit the transformer for the currently selected
destination.
The purpose of a destination transformer is to modify or extract data
from the message coming out of the channel source. A new outbound
message can be created by loading a template into the Outbound
Message Template and creating transformer steps to replace parts of
the Outbound Message Template with values obtained from the
Inbound Message.
Destination transformers are otherwise exactly like source transformers.
See Transformers section for full details on how to use transformers.
Export Channel Writes the definition of the open channel to a file.
pág. 30
Mirth 1.7.1 Reference Guide
Destinations List
Displays the current list of destinations for the open channel.
Status: Displays whether the channel destination is currently enabled or disabled. Right-
clicking shows a context menu identical to the Channel Tasks list.
Destination: Displays the assigned name for the channel destination. Right-clicking shows
a context menu identical to the Channel Tasks list. Double-click this column to change the
destination's name.
Connector Type: Displays the connector type selected for the channel destination. Right-
clicking shows a context menu identical to the Channel Tasks list.
Destination Mappings
The Destination Mappings list contains a list of elements that can be dragged and dropped into
any edit control in the connector settings. Not all elements make sense for all edit controls, and
not all edit controls support these variables.
Connector Type
The Connector Type allows the selection of the type of connector the channel should use to
read messages. The connector type is based on the method to use to communicate with the
destination.
See Destination Connectors section for a complete list of destination connectors and their
specifications
Scripts
Each channel supports four scripts analogous to the global scripts described in the [Edit Global
Scripts] section. The reason to use these scripts inside of channels is for separation of
concerns. That way, particular logic can be associated with a specific channel. The default
version of each does nothing.
Script Description
Deploy This script is executed each time the engine is started. Only the globalMap is
available to persist data.
The deploy script might be used to construct and initialize common objects that
need to persist the while Mirth is running. The data in the Global Map is shared
by all channels.
Shutdown This script is executed each time the engine is stopped. Only the globalMap is
available to persist data.
The shutdown script is typically used to clean up anything created by the
Deploy script.
Preprocessor This script is executed each time a message is received immediately before the
message is normalized to XML. Channel specific variables are available here as
opposed to the global Preprocessor.
Postprocessor This script is executed immediately after a message is sent. Channel specific
pág. 31
Mirth 1.7.1 Reference Guide
Reference List
Displays a filtered list of available JavaScript templates to be dragged from the list and dropped
into the Editor.
Use Java Class Provides the ability to use any Java class that is on the built-in
classpath or loaded from the conf/custom folder. The fully
qualified path-name is required
Call System Function Execute any system program or function that is available on the
current Mirth user's path
Read File As String Reads a file from the file system and returns the contents as a
Java string
Read File As Bytes Reads a file from the file system and returns the contents as a
Java byte array
Write String to File Write the specified Java/JavaScript string to the specified file path
Write Bytes to File Write the specified Java byte array to the specified file path
BASE-64 Encode Data Converts a Java byte array into a BASE-64 encoded Java string
Decode BASE-64 Data Converts a BASE-64 encoded Java string into a Java byte array
Route Message to Channel Sends any Java string to any channel in the current Mirth
instance based on the channel name.
Route Message to Channel Sends any Java string to any channel in the current Mirth
(w/ queue, synchronized) instance based on the channel name. Booleans can be set for
useQueue and synchronized.
Perform Map Value Replace values in any string with values from the channel map,
Replacement connector map or response map.
Format Overpunch NCPDP Converts currency from the Overpunch format to standard format.
Number For example, '999E' would be converted to '$99.95'.
Convert DICOM into Image Returns a JPEG/TIF image from an uncompressed DICOM image
File (either TIF, JPEG, BMP, PNG, or RAW).
Get DICOM message Returns a byte array representation of the DICOM message,
including any attachments.
pág. 32
Mirth 1.7.1 Reference Guide
Iterate Over Segment A block of code that illustrates how to iterate over a group of
segments with the same name.
Create Segment (individual) Creates a new segment that can be used in any message.
Create Segment (in Creates a segment in the msg object at a certain index.
message, indexed)
Create Segment After Creates a segment after the provided segment object.
Segment
Get Date Object Returns a Java Date object from a specific date string and the Java
1
From Pattern SimpleDateFormat pattern that date string is formatted in.
Format Date Returns a date string from a Java Date object and a SimpleDateFormat
Object pattern to use for formatting the date string.
Convert Date Returns a date string formatted using the given "out pattern". Needs an
String incoming date string and an "in pattern" the date string is currently formatted
in. Both patterns are Java SimpleDateFormat patterns.
Get Current Returns a date string with the current date in the format of the given
Date SimpleDateFormat pattern.
Conversion Description
Functions
Convert HL7 to Converts ER7 encoded HL7 to XML. Pass in Boolean values for
pág. 33
Mirth 1.7.1 Reference Guide
Convert XML to Converts XML-HL7 to ER7-HL7. Pass in Boolean values for useStrictParser,
HL7 useStringValidation, and handleRepetitions. Takes an XML object as the
'message' parameter.
Convert X12 to Converts X12 to XML. Pass in Boolean values for inferDelimiters. Takes an
XML X12 string as the 'message' parameter.
Convert XML to Converts XML to X12. Pass in Boolean values for inferDelimiters. Takes an
X12 XML object as the 'message' parameter.
Convert EDI to Converts EDI to XML. Pass in String values for segmentDelim, elementDelim,
XML and subelementDelim. Takes an EDI string as the 'message' parameter.
Convert XML to Converts XML to EDI. Pass in String values for segmentDelim, elementDelim,
EDI and subelementDelim. Takes an XML object as the 'message' parameter.
Convert NCPDP Converts NCPDP to XML. Pass in String values for segmentDelim,
to XML elementDelim, and groupDelim. Takes an NCPDP string as the 'message'
parameter.
Convert XML to Converts XML to NCPDP. Pass in String values for segmentDelim,
NCPDP elementDelim, and groupDelim. Takes an XML object as the 'message'
parameter.
Log an Info Statement Logs specified INFO message to Mirth.log and Wrapper.log (when
using service).
Log an Error Logs specified ERROR message to Mirth.log and Wrapper.log (when
Statement using service)
Trigger an Alert Sends a message to the alerting system, which will trigger any alerts
that were specified to match that message
Perform Database Query Perform any arbitrary database query against any supported
JDBC database
Perform Parameterized Perform any arbitrary database query against any supported
Database Query JDBC database. Pass in a List of parameters to the query.
Perform Database Update Perform any arbitrary database insert or update against any
supported JDBC database
Perform Parameterized Perform any arbitrary database insert or update against any
Database Update supported JDBC database. Pass in a List of parameters to the
query.
pág. 34
Mirth 1.7.1 Reference Guide
Postgres Connection Template The connection string template for a PostgreSQL connection
MySQL Connection Template The connection string template for a MySQL connection
SQL Server Connection The connection string template for a SQL Server connection
Template
Oracle Connection Template The connection string template for an Oracle connection
Lookup Value in All Maps Checks all maps on the message object for the specified key.
Search begins with connector map then channel, response and
global maps respectively.
Get Global Variable Map Retrieves an object from the global variable map
Put Global Variable Map Inserts an object into the global variable map
Get Channel Variable Map Retrieves an object from the channel variable map
Put Channel Variable Map Inserts an object into the channel variable map
Get Connector Variable Map Retrieves an object from the connector variable map
Put Connector Variable Map Inserts an object into the connector variable map
Get Response Variable Map Retrieves an object from the response variable map
Put Response Variable Map Inserts an object into the response variable map
Put Success Response Puts a SUCCESS response in the Response Map with a given
Variable string as the message
Put Error Response Variable Puts an ERROR response in the Response Map with a given
string as the message
1 http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
pág. 35
Mirth 1.7.1 Reference Guide
Filters
Filter Tasks
Add New Rule: Adds a new rule at the end of the Rule List.
Delete Rule Deletes the currently selected rule in the Rule List.
Move Rule Up Exchanges the currently selected rule with the one above it in the Rule List.
Move Rule Down Exchanges the currently selected rule with the one below it in the Rule List
Rule List
pág. 36
Mirth 1.7.1 Reference Guide
When the rule Type is Rule Builder, the rule detail area appears.
Behavior (Accept/Reject)
If Accept is selected, the rule will accept the message if its condition is met. Otherwise if Reject
is selected, the rule will reject the message if its condition is met.
Field
An E4X expression that selects the part of the message to be tested by the rule. Most
commonly, this is generated by dragging a node in the Message Tree into this edit control.
Condition
Exists The rule condition is true if the specified field appears in the message at all. The
Values list is not used for this condition.
Does Not The rule condition is true if the specified field is missing from the message. The
Exist Values list is not used for this condition.
Equals The rule condition is true if the value in the specified field is any one of the values
listed in the Values list.
Does Not The rule condition is true if the value in the specified field is different than any of
pág. 37
Mirth 1.7.1 Reference Guide
Values
Displays the list of values to be compared to the specified message field, if the Condition is
Equals or Does Not Equal. This field allows JavaScript, so if a literal string is entered, it should
be enclosed in quotes.
New
Adds a new row to the Values list. Double-click the new row, type in the value to be tested
(including quote marks, if necessary), and press enter.
Delete
Removes the currently selected row from the Values list.
When the rule Type is JavaScript, the rule detail area appears.
JavaScript Editor
The editor area is a syntax-colored JavaScript editor. Drag elements from the Reference and
Message Trees tabs to construct a desired rule. A JavaScript rule should return true to accept
the message, or false to reject it. Also, right-click the text area for more options like showing line
ending characters and Find/Replace
pág. 38
Mirth 1.7.1 Reference Guide
Data Type
The expected incoming message format is displayed here. This message format can be defined
in the summary tab of the channel editor.
Name Description
Handle Check this box if repetitions within message segments should be expected and
Repetitions handled by the parser.
pág. 39
Mirth 1.7.1 Reference Guide
Use Strict By default, Mirth parses HL7 2.x messages with a parser which silently
Parser tolerates some non-standard messages. Check this box if Mirth should instead
use a parser which matches the HL7 2.x standard.
Validate in Check this box to check incoming messages if they are valid based on the
Strict Parser strict parser.
Convert LF to Check this box to convert LF (linefeed) characters to CR (carriage return)
CR before parsing messages. This is checked by default.
When the message format is X12, clicking the Properties button brings up a dialog which
specifies some optional details about the message format the channel will expect.
Name Description
Element Delimiter The delimiter character to expect between elements, if Infer X12
Delimiters is not checked.
Infer X12 Delimiters Check this box to allow Mirth to determine the X12 delimiters by
examining the message. Leave it unchecked to manually specify the
delimiters.
Segment Delimiter The delimiter character to expect between segments, if Infer X12
Delimiters is not checked.
Subelement Delimiter The delimiter character to expect between sub-elements, if Infer X12
Delimiters is not checked.
When the message format is EDI, clicking the Properties button brings up a dialog which
specifies some optional details about the message format the channel will expect.
pág. 40
Mirth 1.7.1 Reference Guide
Name Description
Name Description
Use Strict Validation Check this box to reject messages that do not exactly match the
NCPDP standard. Leave the box unchecked to accept messages that
do not exactly match the standard, but which can still be interpreted.
Open File
Click this button to open a standard Open File dialog to select a file to be loaded into the
Inbound Message Template control. This is especially useful for loading binary data templates.
pág. 41
Mirth 1.7.1 Reference Guide
The Reference tab displays a list of JavaScript templates and available variables that can be
dragged and dropped into the JavaScript editor.
Filter
Select a mapping type from the Filter control to display only mappings of that type in the
Reference List below.
Reference List
Displays a list of available JavaScript templates (snippets) which can be dragged and dropped
into the JavaScript editor. The list of templates shown depends on the Filter selected.
See [Reference List] section for full details.
Available Variables
Displays a list of available variables that can be dragged and dropped into the JavaScript editor.
The list of variables displayed is context-sensitive, that is, only variables that can legally be
referenced by this rule are displayed.
pág. 42
Mirth 1.7.1 Reference Guide
The Message Trees tab displays a parsed and annotated form of the message entered into the
Message Templates tab and allows references to parts of the parsed message to be dragged
and dropped in the JavaScript rule editor or the Field control of the Rule Builder.
Filter
Enter a string here to filter the message tree to only display nodes that include the entered
string anywhere in the node text. This can include the node name, node value, and node
description.
Match Exact
Check this box to display only nodes that match the entered filter string as a whole word with
the same case. Leave it unchecked to display nodes that contain the entered filter string, such
as only part of a word, while ignoring the case.
pág. 43
Mirth 1.7.1 Reference Guide
Transformers
Transformer Tasks
Add New Step Adds a new template step at the end of the Step List.
Delete Step Removes the currently selected step from the Step List.
Import Transformer Replaces the entire transformer, including all steps, with the contents
of a saved transformer file.
Export Transformer Copies the entire transformer, including all steps, to a saved
transformer file.
Move Step Down Exchanges the selected step with the one below it in the Step List.
Move Step Up Exchanges the selected step with the one above it in the Step List.
Step List
Name For Mapper steps, displays the name of the variable created by the
step. For Message Builder and JavaScript steps, displays the optional
step name, and can be selected for editing by double-clicking.
pág. 44
Mirth 1.7.1 Reference Guide
Message Builder step moves one value from the inbound message to a place in the inbound or
outbound message, possibly performing some conversions on the way.
When the step type is Message Builder, the step details appear.
Message Segment An E4X expression specifying a part of the output message to be replaced.
Typically, the expression is dragged and dropped from the Outbound Message
Template Tree.
Mapping The value to be substituted into the output message segment. This is typically an
E4X expression that specifies a field in the input message.
Default Value The value to be stored into the outbound message segment if the Mapping is not
present in the input message. This field allows JavaScript, so if a literal string is
entered, it should be enclosed in quotes.
String Replacement Before the value of the Mapping or Default Value is stored in the Message
Segment, it can be translated using the String Replacement table. For each row the
String Replacement list, the Regular Expression is compared to the value of the
Mapping or Default Value. If the value matches, it is replaced by the Replace With
value, and further rows are evaluated in order using the result of the previous
replacement. If no row matches, the original Mapping or Default Value is stored.
New Adds a new row at the end of the String Replacement list. Double-click on the
Regular Expression cell to enter it and hit enter to accept the entered value. Double-
click on the Replace With cell to enter it and hit enter to accept the entered value.
pág. 45
Mirth 1.7.1 Reference Guide
A Mapper step extracts one value from the inbound message to a variable, possibly performing
some conversions on the way.
When the step type is Mapper, the step details appear as above.
Variable
The name of the variable to be created. The variable name can only contain alphanumeric
characters and the underscore character.
Add to
Selects the context where the variable will persist.
Connector Variables created in this context are only visible to subsequent steps in the
Map transformer on the current connector. A variable defined on the source will not be
visible on any destinations and vice versa.
Channel Variables created in this context are only visible to source transformer steps after
Map this step, and to all destination filters, transformers and writers for this channel.
Variables only persist for a single message. Each message received by the source
includes its own channel map context.
pág. 46
Mirth 1.7.1 Reference Guide
Global Map Variables created in this context are visible to all filters, transformers, readers and
writers in all channels and persist across all inbound messages.
Response Destinations automatically populate the response map with any relevant
Map responses generated. The response map has the same visibility as the channel
map and only persists for a single message.
Mapping
An E4X expression describing the part of the inbound message to use as the source value of
the variable.
Default Value
A JavaScript expression for the source value for the variable if the inbound message does not
contain the part specified by the Mapping.
String Replacement
Before the source value from the Mapping or Default Value is stored in the Variable, it can be
replaced based on the String Replacement table. For each row in the String Replacement table,
if the source value matches the Regular Expression, the source value is replaced by the
Replace With value, and no more rows are examined. If no row matches the source value, the
unchanged source value is stored in the variable.
New
Adds a new last row to the String Replacement table. Double-click on the Regular Expression
cell to enter it and hit enter to accept the entered value. Double-click on the Replace With cell to
enter it and hit enter to accept the entered value.
Delete
Deletes the selected row from the String Replacement table.
pág. 47
Mirth 1.7.1 Reference Guide
A JavaScript step can perform extensive, complex message reformatting in a single step, do
database lookups for value conversions, and perform other actions completely unrelated to
message transformation.
When the step type is JavaScript, the step details appear as above.
JavaScript Editor
The editor area is a syntax-colored JavaScript editor. Also, right-click the text area for more
options like showing line ending characters and Find/Replace. Drag elements from the
Reference and Message Trees tabs to construct the desired step. The step can examine or
modify the variable "msg," which contains the inbound message. If no outbound message
template is set, this will be turned into the encoded data (maintaining all changes made to the
"msg" object). The step can also modify the variable "tmp," which contains the outbound
message. Note that at the start of the transformer, the outbound message is loaded with the
contents of the Outbound Message Template control.
pág. 48
Mirth 1.7.1 Reference Guide
pág. 49
Mirth 1.7.1 Reference Guide
the Open File button. Also, right-click the text area for more options like showing line ending
characters and Find/Replace.
This edit control contains a message to be parsed into the Outbound Message Template Tree
control of the Message Trees tab. The message can typed in directly, pasted in, or loaded using
the Open File button. Also, right-click the text area for more options like showing line ending
characters and Find/Replace.
pág. 50
Mirth 1.7.1 Reference Guide
The Reference tab displays a list of JavaScript templates and available variables that can be
dragged and dropped into the JavaScript editor.
Filter
Select a mapping type from the Filter control to display only templates of that type in the
Reference List below.
Reference List
Displays a list of available JavaScript templates, which can be dragged and dropped into the
JavaScript editor. The list of templates shown depends on the Filter selected.
See [Reference List] section for full details.
Available Variables
Displays a list of available variables that can be dragged and dropped into the JavaScript editor.
The list of variables displayed is context-sensitive, that is, only variables that can legally be
referenced by this rule are displayed.
pág. 51
Mirth 1.7.1 Reference Guide
The Message Trees tab displays a parsed and annotated form of the inbound and outbound
messages entered into the Message Templates tab, and allows references to parts of the
parsed messages to be dragged and dropped to the Message Segment control of a Message
Builder step, the Mapping control of a Message Builder or Mapping step, or the JavaScript
editor of a JavaScript step.
pág. 52
Mirth 1.7.1 Reference Guide
message tree node references to the Message Segment control of a Message Builder step in
order to modify the inbound message.
pág. 53
Mirth 1.7.1 Reference Guide
Source Connectors
Channel Reader
Channel Reader connectors read messages written to them by Channel Writer destination
connectors. Using a Channel Reader connector type is never required, but gives a clean way to
not specify any other source connector. This type of connector has no additional settings to
choose.
pág. 54
Mirth 1.7.1 Reference Guide
Database Reader
Database Reader connectors read messages from a database.
(Use JavaScript=No)
(Use JavaScript=Yes)
pág. 55
Mirth 1.7.1 Reference Guide
Driver: Specifies the type of database driver to use to connect to the database.
Name Description
Sun JDBC-ODBC Bridge A generic driver for any database that
provides an ODBC connector. Use this only if
there is no specific driver for the database.
MySQL A specific driver for MySQL.
Oracle 10g Release 2 A specific driver for Oracle 10g Release 2 and
later.
PostgreSQL A specific driver for PostgreSQL.
SQL Server/Sybase A specific driver for SQL Server or Sybase.
URL: The JDBC URL to connect to the database. This is not used when "Use JavaScript" is
checked. However, it is used when the Insert Connection feature is used to generate code.
Username: The user name to connect to the database. This is not used when "Use JavaScript"
is checked. However, it is used when the Insert Connection feature is used to generate code.
Password: The password to connect to the database. This is not used when "Use JavaScript" is
checked. However, it is used when the Insert Connection feature is used to generate code.
Polling Type (Interval / Time) : A database reader polls to determine when new messages
have arrived. It can be configured when to poll in one of two different ways. If "Interval" is
selected, the connector will poll every n milliseconds, where n is specified in the Polling
Frequency control. If "Time" is selected, the connector will poll once a day at the time specified
in the Polling Time control.
Polling Frequency: If the "Interval" Polling Type is selected, the number of milliseconds
between polls must be entered here. Avoid extremely small values because polling can be a
somewhat time-consuming operation.
Polling Time: If the "Time" Polling Type is selected, the time of day to poll must be entered
here.
Use JavaScript (Yes / No): A database reader can be configured either by specifying the SQL
statements to get messages to be processed and mark messages in the database as processed
(Use JavaScript = No) or by coding JavaScript code using JDBC to get the messages to be
processed and mark messages in the database as processed (Use JavaScript = Yes).
JavaScript Insert Connection: If "Yes" is selected for Use JavaScript, this button is enabled.
When clicked, it inserts boilerplate Connection construction code into the JavaScript control at
the current caret location.
JavaScript: If "Yes" is selected for Use JavaScript, this JavaScript editor becomes available to
enter the code to fetch the messages to be processed and return them as a JDBC ResultSet.
SQL: If "No" is selected for Use JavaScript, this SQL editor becomes available to enter the SQL
statement to fetch the messages to be processed.
pág. 56
Mirth 1.7.1 Reference Guide
Run On-Update Statement (Yes / No): When using a database reader, it is usually necessary
to execute a separate SQL statement to mark the message that was just fetched as processed,
so it will not be fetched again the next time a poll occurs. Selecting "Yes" for Run On-Update
Statement turns this behavior on. Selecting "No" turns this behavior off.
Insert Connection: If "Yes" is selected for Use JavaScript and "Yes" is selected for Run On-
Update Statement, this button is enabled. When clicked, it inserts boilerplate Connection
construction code into the On-Update JavaScript control at the current caret location.
On-Update JavaScript: If "Yes" is selected for Use JavaScript and "Yes" is selected for Run On-
Update Statement, this JavaScript editor becomes available to enter the code to mark the
message just fetched as processed.
On-Update SQL: If "No" is selected for Use JavaScript and "Yes" is selected for Run On-Update
Statement, this SQL editor becomes available to enter the SQL statement to mark the message
just fetched as processed.
Mappings: This list is populated with mappings based on the select statement in the
JavaScript or SQL editor. These mappings can dragged into the On-Update JavaScript or SQL
editors.
pág. 57
Mirth 1.7.1 Reference Guide
FTP Reader
FTP Reader connectors read files containing messages from an FTP server. Note that there are
security and privacy issues in FTP. If not running the FTP over a VPN or other secure
connection, consider using SFTP instead.
ftp:// (Domain or IP and Port): Enter the domain name or IP address of the FTP server here,
as seen from the machine running Mirth. Optionally, a port may be specified after the IP:
<ip>[:port]
/ (path): Enter the path to the file to be read here relative to the root FTP directory for the
anonymous user (if Anonymous is Yes) or specified user (if Anonymous is No).
Anonymous (Yes / No): When Anonymous No is selected, a Username and Password must be
supplied to log into the FTP server. When Anonymous Yes is selected, no Username or
Password is required or allowed.
Username: If Anonymous No is selected, enter the username to supply to the FTP server
here.
Password: If Anonymous No is selected, enter the password to supply to the FTP server here.
pág. 58
Mirth 1.7.1 Reference Guide
Validate Connection: If Yes is selected, Mirth will test if the connection to the FTP server is
still open before downloading each file. If No is selected, Mirth will not perform this test.
Selecting No yields a small performance increase when the FTP server connection is still open.
Passive Mode: If Yes is selected, Mirth will connect to the FTP server in Passive Mode (PASV).
If No is selected, Mirth will connect to the FTP server in Active Mode. Selecting Passive Mode
may make it easier to connect to an FTP Server through a firewall.
Filename Filter Pattern: The FTP Server native filename filter pattern for the files this
connector should read as messages. Files that do not match this pattern will be ignored by the
connector. For example, a common pattern is "*.hl7".
Polling Type (Interval / Time): An FTP reader polls to determine when new messages have
arrived. It can be configured when to poll in one of two different ways. If "Interval" is selected,
the connector will poll every n milliseconds, where n is specified in the Polling Frequency
control. If "Time" is selected, the connector will poll once a day at the time specified in the
Polling Time control.
Polling Frequency: If the "Interval" Polling Type is selected, the number of milliseconds
between polls must be entered here. Avoid extremely small values because polling is typically
a somewhat time-consuming operation.
Polling Time: If the "Time" Polling Type is selected, the time of day to poll must be entered
here.
Move-to Directory: If a directory (as seen by the FTP server) is entered here, files successfully
processed by the connector will be moved to that directory after they are processed. If this
control is left blank, files successfully processed by the connector will not be moved.
The value entered in this control is a template and may contain Mappings dragged from the
Move-to Mappings list. The template is re-evaluated for each file processed.
Move-to File Name: If a filename is entered here, files processed by the connector will be
renamed to that name after they are processed. If this control is left blank, files processed by
the connector will not be renamed. The value entered in this control is a template and may
contain Mappings dragged from the Move-to Mappings list. The template is re-evaluated for
each file processed.
Error Move-to Directory: If a directory (as seen by the FTP server) is entered here, files that
fail processing by the connector will be moved to that directory after they are processed. If this
control is left blank, files that fail processing by the connector will not be moved.
The value entered in this control is a template and may contain Mappings dragged from the
Move-to Mappings list. The template is re-evaluated for each file processed.
Move-to Variables: This read-only list contains Variables that may be dragged and dropped
into the Move-to Directory, Move-to File Name, and Error Move-to Directory controls.
Typically these only form part of the directory or filename.
pág. 59
Mirth 1.7.1 Reference Guide
COUNT A counter that increments on every file read. This counter is reset when
channels are redeployed.
Delete File After Read: If Yes is checked, files will be deleted after they are processed by the
source connector. If No is checked, files will not be deleted after they are processed.
Check File Age: If Yes is selected, the source connector will only process files that are less old
(in terms of last modification time) than the time span entered in the File Age control. If No is
selected, the source connector will process files regardless of their age. To prevent the channel
from reprocessing the same file repeatedly, an FTP source connector should be configured to
either move processed files to a different directory, rename processed files so that they do not
match the filename filter pattern, delete processed files, or check the age of files to ignore files
from earlier polls.
File Age: Required if Check File Age is Yes. Enter the age, in milliseconds, of the oldest file to
be processed by the source connector.
File Type: If ASCII is selected, files are interpreted as text. If Binary is selected, files are
interpreted as binary.
Process Batch Files: If Yes is selected, all messages in each file will be read and processed by
the source connector. If No is selected, each entire file is processed as one message.
Sort Files By: The value selected in this control specifies the order that the source connector
should process files when more than one file matches the Filename Filter Pattern. Selecting
Date causes the source connector to process files in the order of increasing last modification
time. Selecting Name causes the source connector to process files in lexicographic name order.
Selecting Size causes the source connector to process files in increasing size order.
Encoding: Select the character encoding system used to write the files being processed by the
source connector. Selecting Default uses the default character encoding for the JVM in which
Mirth is running. Selecting any other value selects the corresponding character encoding.
pág. 60
Mirth 1.7.1 Reference Guide
File Reader
A File Reader connector reads messages from files located on the machine running Mirth.
Directory
The absolute or relative (to Mirth base directory) pathname of the directory containing the files
to be read by this connector.
Polling Frequency
If the "Interval" Polling Type is selected, the number of milliseconds between polls must be
entered here. Avoid extremely small values because polling can be a somewhat time-
consuming operation.
pág. 61
Mirth 1.7.1 Reference Guide
Polling Time
If the "Time" Polling Type is selected, the time of day to poll must be entered here.
Move-to Directory
If a directory is entered here, files successfully processed by the connector will be moved to that
directory after they are processed. If this control is left blank, files successfully processed by the
connector will not be moved.
The value entered in this control is a template and may contain Mappings dragged from the
Move-to Mappings list. The template is re-evaluated for each file processed.
Move-to Mappings
This read-only list contains Mappings that may be dragged and dropped into the Move-to
Directory, Move-to File Name and Error Move-to Directory controls. Typically these only form
part of the directory or filename.
COUNT A counter that increments on every file read. This counter is reset when
channels are redeployed
If Yes is checked, files will be deleted after they are processed by the source connector. If No is
checked, files will not be deleted after they are processed.
pág. 62
Mirth 1.7.1 Reference Guide
processed files so that they do not match the filename filter pattern, delete processed files, or
check the age of files to ignore files from earlier polls.
File Age
Required if Check File Age is Yes. Enter the age of the oldest file to be processed by the source
connector, in milliseconds.
File Type
If ASCII is selected, files are interpreted as text, and the character set encoding can be selected
in the Encoding control below. If Binary is selected, files are interpreted as binary.
Sort Files By
The value selected in this control specifies the order that the source connector should process
files when more than one file matches the Filename Filter Pattern. Selecting Date causes the
source connector to process files in the order of increasing last modification time. Selecting
Name causes the source connector to process files in lexicographic name order. Selecting Size
causes the source connector to process files in increasing size order.
Encoding
Select the character encoding system used to write the files being processed by the source
connector. Selecting Default uses the default character encoding for the JVM in which Mirth is
running. Selecting any other value selects the corresponding character encoding.
pág. 63
Mirth 1.7.1 Reference Guide
HTTP Listener
An HTTP Listener connector listens to a port like an HTTP (web) server for messages to be
transferred by HTTP requests.
Listener Address
Enter the DNS domain name or IP address on which the connector should listen for HTTP
operations.
Listener Port
Enter the port number (0-65535) on which the connector should listen.
Receive Timeout
Enter the number of milliseconds that the connector should keep a connection open without
receiving a request.
Buffer Size
Enter at least the size of the largest HTTP request that will be sent to the connector. Entering
too small a value will cause larger requests to take more time to process. Entering too large a
value wastes memory. Generally, the default value is fine.
pág. 64
Mirth 1.7.1 Reference Guide
Respond from
Select None or the name of a destination of this channel that will generate the response to the
request. If None is selected, the response will always be "200 OK" if the message is
successfully processed or "500 Server Error" if there is an error processing the message.
pág. 65
Mirth 1.7.1 Reference Guide
JMS Reader
Specification: Select 1.1 if the JMS provider supports JMS 1.1. Select 1.0.2b if the JMS
provider supports JMS 1.0.2b.
Use JNDI: Select Yes to use JNDI to look up a connection factory to connect to the topic or
queue. Select No to specify a connection factory class directly.
Provider URL: If Use JNDI Yes is selected, enter the URL of the JNDI provider here.
Initial Context Factory: If Use JNDI Yes is selected, enter the full Java classname of the
JNDI Initial Context Factory class.
Connection Factory Name: If Use JNDI Yes is selected, enter the JNDI name for the
connection factory.
Connection Factory Class: If Use JNDI No is selected, enter the full Java classname of the
JMS connection factory class here.
Destination: Enter the JMS provider name for the queue or topic here.
Username: Enter the login username for access to the queue or topic here.
pág. 66
Mirth 1.7.1 Reference Guide
Password: Enter the login password for access to the queue or topic here.
Durable: Select Yes if connecting to a topic and messages sent to the topic should be queued
whenever the source connector is not connected. Select No if connecting to a queue.
Client ID: If Durable Yes is selected, enter the unique identifier for the source connector as a
client of the topic.
Selector Expression: Enter the selector expression to select which topic or queue messages
the source connector is interested in, or leave blank to read all messages.
ACK Mode: Determine the type of acknowledgement made when a message is received. The
JMS Specification identifies 4 possible values:
transacted - The acknowledgement mode is ignored by the session. This constant was
introduced in JMS 1.1 but the value is still valid in JMS 1.0.2b.
auto acknowledge - The session automatically acknowledges a client's receipt of a
message either when the session has successfully returned from a call to receive or when
the message listener on the session has called to process the message successfully
returns.
client acknowledge - The client acknowledges a consumed message by calling the
message's acknowledge method.
dups ok - Instructs the session to lazily acknowledge the delivery of messages.
Additional Properties: Enter any necessary JMS connection factory properties and values
here. These vary between JMS providers.
Property: Displays the name of the property set by this row. Double-click this cell to edit
the property name.
Value: Displays the value of the property set by this row. Double-click this cell to edit the
property name.
New: Adds a new row to end of the list. Double click the Property and Value cells to
enter their values.
Delete: Deletes the currently selected row from the list.
pág. 67
Mirth 1.7.1 Reference Guide
JavaScript Reader
Polling Frequency
If the "Interval" Polling Type is selected, the number of milliseconds between polls must be
entered here. Avoid extremely small values because polling can be a somewhat time-
consuming operation.
Polling Time
If the "Time" Polling Type is selected, the time of day to poll must be entered here.
JavaScript
A syntax-coloring JavaScript editor for the code that implements the reader. The proper return
value is either a String or List of Strings. Returning a List of Strings will cause Mirth to process
one message per entry in the List. Right click the text area for more options like showing line
ending characters and Find/Replace.
pág. 68
Mirth 1.7.1 Reference Guide
LLP Reader
An LLP Listener connector read messages over an HL7 Lower Level Protocol connection. It can
either act as a server, waiting for connections from clients to send it messages, or as a client
connected to a server, waiting for the server to send it messages.
LLP Mode
Select Server to listen for connections from clients. Select Client to connect to an LLP Server.
Reconnect Interval
If LLP Mode Client is selected, enter the time, in milliseconds, to wait between disconnecting
from the LLP server and connecting to it again.
Receive Timeout
Enter the time, in milliseconds, to wait without receiving a message before disconnecting.
pág. 69
Mirth 1.7.1 Reference Guide
Buffer Size
Enter at least the size, in bytes, of the largest message expected. Entering too small a value will
cause larger messages to be rejected. Entering too large a value wastes memory. Generally,
the default value is fine.
Process Batch
Select process batch to allow Mirth to automatically split batched messages into discrete
messages. This can be used with batch files containing an FSH or BSH header, or it can be
used on batch files that just have multiple MSH segments. The location of each MSH segment
signifies the start of a new message to be processed.
Encoding
Select the character set encoding used by the sender of the message, or Default to assume the
default character set encoding for the JVM running Mirth.
Send ACK
Select Yes to send an ACK message back for every message received. Select No to not send a
response. Select Respond from to use a destination of this channel or a variable from the
Response Map to generate the response to received messages. If the channel is not
synchronized, an ACK will be sent back based upon whether or not the source connector
successfully received/parsed the message.
pág. 70
Mirth 1.7.1 Reference Guide
Respond from
Select "None" to send no response.
Select a destination of this channel that will supply a return value using the Response Map.
Select a variable that has been added to the Response Map.
Successful ACK
If Send Ack Yes is selected, these controls specify the contents of the response sent to valid
messages.
Code: The code part of the response.
Message: The readable text part of the response.
Error ACK
If Send Ack Yes is selected, these controls specify the contents of the response sent to
messages which cause processing errors.
Code: The code part of the response.
Message: The readable text part of the response.
Rejected ACK
If Send Ack Yes is selected, these controls specify the contents of the response sent to
messages which are rejected by the source filter.
Code: The code part of the response.
Message: The readable text part of the response.
ACK Address
If "Yes" is selected for "ACK on New Connection," the DNS domain name or IP address of the
server to send the ACK message to.
ACK Port
If "Yes" is selected for "ACK on New Connection," the port to send the ACK message to.
pág. 71
Mirth 1.7.1 Reference Guide
SFTP Reader
SFTP Reader connectors read files containing messages from an SFTP server.
/ (path)
Enter the path to the file to be read here relative to the root SFTP directory for the anonymous
user (if Anonymous is Yes) or specified user (if Anonymous is No).
Username
If Anonymous No is selected, enter the username to supply to the SFTP server here.
Password
If Anonymous No is selected, enter the password to supply to the SFTP server here.
pág. 72
Mirth 1.7.1 Reference Guide
Polling Frequency
If the "Interval" Polling Type is selected, the number of milliseconds between polls must be
entered here. Avoid extremely small values because polling can be a somewhat time-
consuming operation.
Polling Time
If the "Time" Polling Type is selected, the time of day to poll must be entered here.
Move-to Directory
If a directory (as seen by the SFTP server) is entered here, files successfully processed by the
connector will be moved to that directory after they are processed. If this control is left blank,
files successfully processed by the connector will not be moved.
The value entered in this control is a template and may contain Mappings dragged from the
Move-to Mappings list. The template is re-evaluated for each file processed.
Move-to Mappings
This read-only list contains Mappings that may be dragged and dropped into the Move-to
Directory, Move-to File Name and Error Move-to Directory controls. Typically these only form
part of the directory or filename.
COUNT A counter that increments on every file read. This counter is reset when
channels are redeployed.
pág. 73
Mirth 1.7.1 Reference Guide
File Age
Required if Check File Age is Yes. Enter the age, in milliseconds, of the oldest file to be
processed by the source connector.
File Type
If ASCII is selected, files are interpreted as text. If Binary is selected, files are interpreted as
binary. Some SFTP servers perform end of line delimiter conversions or even character set
conversions when ASCII is selected, which can cause parsing problems if the message format
is actually binary. If this is unknown, Binary is usually safest.
Sort Files By
The value selected in this control specifies the order that the source connector should process
files when more than one file matches the Filename Filter Pattern. Selecting Date causes the
source connector to process files in the order of increasing last modification time. Selecting
Name causes the source connector to process files in lexicographic name order. Selecting Size
causes the source connector to process files in increasing size order.
Encoding
Select the character encoding system used to write the files being processed by the source
connector. Selecting Default uses the default character encoding for the JVM in which Mirth is
running. Selecting any other value selects the corresponding character encoding.
pág. 74
Mirth 1.7.1 Reference Guide
SOAP Listener
A SOAP Listener connector creates a web service that can be invoked to send messages to the
channel.
Listener Address
The DNS domain name or IP address on which the web service should listen for connections.
Port
The port on which the web service should listen for connections.
Service Name
The name to give to the web service.
WSDL URL
Displays the generated WSDL URL for the web service. The client that sends messages to the
service can download this file to determine how to call the web service.
Method
Displays the generated web service method signature the client will call.
Respond from
Select "None" to send no response.
Select a destination of this channel that will supply a return value using the Response Map.
pág. 75
Mirth 1.7.1 Reference Guide
TCP Listener
Listener Address
The DNS domain name or IP address to listen for connections on.
Listener Port
The port to listen for connections on.
Receive Timeout
The amount of time, in milliseconds, to wait without receiving a message before closing a
connection.
Buffer Size
Enter at least the size, in bytes, of the largest message expected. Entering too small a value will
cause larger messages to be rejected. Entering too large a value will waste memory. Generally,
the default value is fine.
Encoding
Select the character set encoding used by the message sender, or Select Default to use the
default character set encoding for the JVM running Mirth.
pág. 76
Mirth 1.7.1 Reference Guide
Data Type
Select Binary if the inbound messages are raw byte streams. Select ASCII if the inbound
messages are text streams.
Respond from
Select "None" to send no response.
Select a destination of this channel that will supply a return value using the Response Map.
Select a variable that has been added to the Response Map.
Response Address
Enter the DNS domain name or IP address to send message responses to.
Response Port
Enter the port to send message responses to.
pág. 77
Mirth 1.7.1 Reference Guide
Destination Connectors
Channel Writer
Channel Writer connectors directly write messages to other channels, and any channel will read
them regardless of its source connector type.
Channel Name
Select the channel to which messages accepted by this destination's filter should be written, or
none to not write the message at all.
Template
A Velocity enabled template for the actual message to be written to the channel. In many cases,
the default value of "${message.encodedData}" is sufficient.
Database Writer
pág. 78
Mirth 1.7.1 Reference Guide
(Use JavaScript=No)
(Use JavaScript=Yes)
pág. 79
Mirth 1.7.1 Reference Guide
Driver
Specifies the type of database driver to use to connect to the database.
Name Description
Sun JDBC-ODBC A generic driver for any database that provides an ODBC connector. Use
Bridge this only if there is no specific driver for the database.
Oracle 10g Release A specific driver for Oracle 10g Release 2 and later.
2
URL
The JDBC URL to connect to the database. This is not used when "Use JavaScript" is checked.
However, it is used when the Insert Connection feature is used to generate code.
Username
The username to connect to the database. This is not used when "Use JavaScript" is checked.
However, it is used when the Insert Connection feature is used to generate code.
Password
The password to connect to the database. This is not used when "Use JavaScript" is checked.
However, it is used when the Insert Connection feature is used to generate code.
SQL
If "No" is selected for Use JavaScript, the SQL editor appears for entering the SQL statement to
insert the outbound message or data into the database.
JavaScript
If "Yes" is selected for Use JavaScript, the JavaScript editor appears for entering the code to
insert the outbound message into the database.
pág. 80
Mirth 1.7.1 Reference Guide
Document Writer
Document Writer connectors construct a document (formatted file) for each message they
accept.
Directory: The directory (folder) where the generated file should be written. The string entered
here is a template that is evaluated for each document created and may contain destination
mappings dragged from the Destination Mappings list.
File Name: The file name to give to the generated file. The string entered here is a template
that is evaluated for each document created and may contain destination mappings dragged
from the Destination Mappings list.
Document Type: The type of document to be created for each message, either PDF to create
a Portable Document Format file or RTF to create a Rich Text Format file.
Encrypted (Yes/No): If Document Type PDF is selected, generated documents can optionally
be encrypted.
Password: If Encrypted Yes is selected, enter the password to be used to later view the
document here.
Template: An Apache Velocity template for the contents of the document to be generated for a
message. The contents of the Template should be valid HTML or plain text with Destination
Mappings dropped in place to fill in the message-specific parts. The template is automatically
wrapped with the html and body tags, so there is no need to redefine them. The string entered
here is a template that is evaluated for each document created and may contain destination
mappings dragged from the Destination Mappings list.
pág. 81
Mirth 1.7.1 Reference Guide
Email Sender
An Email Sender connector sends an email based on each message it accepts.
SMTP Server Host: Enter the DNS domain name or IP address of the SMTP server to use to
send the email messages.
Note that sending email to an SMTP server that is not expecting it may result in the IP of the
box running Mirth being added to the server's "blacklist."
SMTP Server Port: The port number of the SMTP server to send the email message to.
Generally, the default port of 25 is used.
Username: If the SMTP server requires authentication to send a message, enter the username
Password: If the SMTP server requires authentication to send a message, enter the password.
To: The name of the mailbox (person, usually) to which the email should be sent. This is
usually in the form x@y where x is the user name (e.g., "mirth") and y is a domain name (e.g.,
"webreachinc.com").
From: The name that should appear as the "From address" in the email, as it is viewed by its
receiver. Most SMTP servers and email client do not care about the exact format of this field.
Subject: The text that should appear as the subject of the email, as seen by the receiver's
email client.
Body: An Apache Velocity template representing the contents of the email to be generated and
sent. This should be plain text, although some email clients will accept messages generated
from HTML entered here. The string entered here is a template that is evaluated for each email
created and may contain destination mappings dragged from the Destination Mappings list.
pág. 82
Mirth 1.7.1 Reference Guide
FTP Writer
FTP Writer connectors write files containing messages to an FTP server. Note that there are
security and privacy issues in FTP
1
If not running the FTP over a VPN or other secure connection, consider using SFTP instead.
Enter the DNS domain name or IP address of the FTP server here, as seen from the machine
running Mirth. Optionally, a port may be specified after the IP: <ip>[:port]
/ (path)
Enter the path (directory or folder) where the generated file is to be written, relative to the root
FTP directory for the anonymous user (if Anonymous is Yes) or specified user (if Anonymous is
No).
Username
If Anonymous No is selected, enter the username to supply to the FTP server here.
pág. 83
Mirth 1.7.1 Reference Guide
Password
If Anonymous No is selected, enter the password to supply to the FTP server here.
File Name
The name of the file to be generated. The string entered here is a template that is evaluated for
each file created and may contain destination mappings dragged from the Destination Mappings
list.
Passive Mode
If Yes is selected, Mirth will connect to the FTP server in Passive Mode (PASV). If No is
selected, Mirth will connect to the FTP server in Active Mode. Selecting Passive Mode may
make it easier to connect to an FTP Server through a firewall.
File Type
If ASCII is selected, files are written as ASCII text. If Binary is selected, files are written as
binary byte streams.
Validate Connection
If Yes is selected, Mirth will test if the connection to the FTP server is still open before uploading
each file. If No is selected, Mirth will not perform this test. Selecting No yields a small
performance increase when the FTP server connection is still open.
Template
An Apache Velocity template representing the contents of the file to be generated. This should
be plain text. The string entered here is a template that is evaluated for each file created and
may contain destination mappings dragged from the Destination Mappings list.
pág. 84
Mirth 1.7.1 Reference Guide
File Writer
A File Writer connector writes messages to files located on the machine running the Mirth
server.
Directory
The directory (folder) where the generated file should be written. The string entered here is a
template that is evaluated for each file created and may contain destination mappings dragged
from the Destination Mappings list.
File Name
The file name to give to the generated file. The string entered here is a template that is
evaluated for each file created and may contain destination mappings dragged from the
Destination Mappings list.
Append to File
If Yes is selected, messages accepted by this destination will be appended to a single file
specified in the File Name. If No is selected, messages accepted by this destination will replace
any existing file of the same name. This feature will not work if a template is used for the File
Name which generates a new file name when a message is processed.
pág. 85
Mirth 1.7.1 Reference Guide
File Type
If ASCII is selected, messages are written as text, and the character set encoding used can be
selected in the Encoding control below. If Binary is selected, messages are written as binary
byte streams.
Encoding
Select the character encoding system to use to write the files accepted by the destination
connector. Selecting Default uses the default character encoding for the JVM in which Mirth is
running. Selecting any other value selects the corresponding character encoding.
Template
An Apache Velocity template representing the contents of the file to be generated. This should
be plain text. The string entered here is a template that is evaluated for each file created and
may contain destination mappings dragged from the Destination Mappings list.
pág. 86
Mirth 1.7.1 Reference Guide
HTTP Sender
An HTTP Sender connector sends messages to an HTTP (web) server as GET or POST
requests.
URL
Enter the URL of the HTTP server to send each message to.
Send Response To
Selects a channel to send the response from the HTTP server as a new inbound message or
None to ignore the response from the HTTP server.
pág. 87
Mirth 1.7.1 Reference Guide
Request Variables
Request variables are encoded as x=y pairs as part of the request URL, separated from it by a
'?' and from each other by an '&'.
Variable
The name of the variable to be passed - the "x" of the "x=y" pair. Double-click this column to edit
the Variable name.
Value
The value of the variable to be passed - the "y" of the "x=y" pair. Double-click this column to edit
the Value. The string entered here is a template that is evaluated for each request created and
may contain destination mappings dragged from the Destination Mappings list.
New
Delete
Deletes the currently selected row in the Request Variables list.
Header Variables
Header variables are encoded as HTTP headers in the HTTP request sent to the server.
Variable
The name of the header to be added. It is traditional for all nonstandard headers to start with "X-
". Double-click this cell to edit the name of the header.
Value
The value of the header to be added. Double-click this cell to edit the value of the header. The
string entered here is a template that is evaluated for each request created and may contain
destination mappings dragged from the Destination Mappings list.
New
Adds a new row to the end of the Header Variables list.
Delete
Deletes the currently selected row from the Header Variables list.
pág. 88
Mirth 1.7.1 Reference Guide
JMS Writer
Specification
Select 1.1 if the JMS provider supports JMS 1.1. Select 1.0.2b if the JMS provider supports JMS
1.0.2b.
Use JNDI
Select Yes to use JNDI to look up a connection factory to connect to the topic or queue. Select
No to specify a connection factory class directly.
Provider URL
If Use JNDI Yes is selected, enter the URL of the JNDI provider here.
pág. 89
Mirth 1.7.1 Reference Guide
Destination
Enter the JMS provider's name for the queue or topic here.
Username
Enter the login username for access to the queue or topic here.
Password
Enter the login password for access to the queue or topic here.
Durable
Select Yes if connecting to a topic and messages sent to the topic should be queued whenever
the source connector is not connected. Select No if connecting to a queue.
Client ID
If Durable Yes is selected, enter the unique identifier for the destination connector as a client of
the topic.
ACK Mode
Determine the type of acknowledgement made when a message is received. The JMS
Specification identifies 4 possible values:
TRANSACTED - The acknowledgement mode is ignored by the session. This constant was
introduced in JMS 1.1 but the value is valid in JMS 1.0.2b.
AUTO ACKNOWLEDGE - The session automatically acknowledges a client's receipt of a
message either when the session has successfully returned from a call to receive or when
the message listener on the session has called to process the message successfully
returns.
CLIENT ACKNOWLEDGE - The client acknowledges a consumed message by calling the
message's acknowledge method.
DUPS OK - Instructs the session to lazily acknowledge the delivery of messages.
Additional Properties
Enter any necessary JMS connection factory properties and values here. These vary between
JMS providers.
pág. 90
Mirth 1.7.1 Reference Guide
Property: Displays the name of the property set by this row. Double-click this cell to edit
the property name.
Value: Displays the value of the property set by this row. Double-click this cell to edit the
property name. The string entered here is a template that is evaluated for each
document created and may contain destination mappings dragged from the Destination
Mappings list.
New: Adds a new last row to the list. Double click the Property and Value cells to enter
their values.
Delete: Deletes the currently selected row from the list.
Template
A Velocity template for the text to be sent to the JMS topic or queue. The string entered here is
a template that is evaluated for each message created and may contain destination mappings
dragged from the Destination Mappings list.
pág. 91
Mirth 1.7.1 Reference Guide
JavaScript Writer
JavaScript
A syntax-coloring JavaScript editor for the code that implements the writer. Anything within the
scope of the destination can be accessed here. Return values are not supported on this
connector.
pág. 92
Mirth 1.7.1 Reference Guide
LLP Sender
An LLP Sender connector writes messages over an HL7 Lower Level Protocol connection.
Host Address
Enter the DNS domain name or IP address to connect to (LLP Mode Client).
Host Port
Enter the port number to connect to (LLP Mode Client).
Send Timeout
Enter the number of milliseconds that the connector should keep its host connection open even
if it has no messages to send. If it has no messages to send after this much time, it will close
the connection and reopen it later when messages need to be sent.
Reconnect Interval
The reconnect interval determines the amount of time, in milliseconds, Mirth will wait before
resending a failed message.
pág. 93
Mirth 1.7.1 Reference Guide
Buffer Size
Enter at least the size, in bytes, of the largest response message expected. Entering too small a
value will cause larger messages to be rejected. Entering too large a value wastes memory.
Generally, the default value is fine.
ACK Timeout
If Ignore ACK is not checked, the number of milliseconds the connector should wait for an ACK
response after sending a message. If an ACK is not received in this time, the message's state is
set to error.
Ignore ACK
If checked, the connector does not wait for an ACK response after sending a message. If not
checked, the connector waits for an ACK for the time specified in ACK Timeout.
pág. 94
Mirth 1.7.1 Reference Guide
Encoding
Select the character set encoding to apply to the message sent to the Host, or Default to use
the default character set encoding for the JVM running the Mirth Server.
Send Response to
If None is selected, responses sent by the Host are discarded. Otherwise, they are sent to the
selected channel as a new inbound message for processing.
Template
A Velocity template for the actual message to be sent to the Host. In many cases, the default
value of "${message.encodedData}" is sufficient. The string entered here is a template that is
evaluated for each message and may contain destination mappings dragged from the
Destination Mappings list.
pág. 95
Mirth 1.7.1 Reference Guide
SFTP Writer
SFTP Writer connectors write a file for each message they accept to an SFTP server.
sftp://
Enter the DNS domain name or IP address of the SFTP server here.
/
Enter the path (directory or folder) where the generated files should be written.
Username
Enter the login name for the SFTP server.
Password
Enter the password for the SFTP server.
File Name
The name of the file to be generated for a message. The string entered here is a template that
is evaluated for each file created and may contain destination mappings dragged from the
Destination Mappings list.
pág. 96
Mirth 1.7.1 Reference Guide
Template
An Apache Velocity template for the contents of the file to be generated. This should be plain
text. The string entered here is a template that is evaluated for each document created and may
contain destination mappings dragged from the Destination Mappings list.
pág. 97
Mirth 1.7.1 Reference Guide
SOAP Sender
WSDL URL
Enter the full URL to the WSDL file describing the web service method to be called, and then
click the Get Methods button.
Get Methods
Clicking this button fetches the WSDL file from the specified URL and parses it to obtain a
description of the data types and methods used by the web service to be called. It replaces the
values of all of the controls below by values taken from the WSDL file.
Send Response to
Select None to ignore the response from the web service method, or select a channel to send to
as a new inbound message.
pág. 98
Mirth 1.7.1 Reference Guide
Method
Select the web service method to be called from this list.
Rebuild Envelope
Clicking this button regenerates the contents of the SOAP Envelope control based on the other
controls, discarding any changes that may have been made.
Generate Envelope
When "Yes" is selected, any change to the controls above replaces the contents of the SOAP
Envelope control below, which is the actual SOAP envelope that will be sent to the web service
to send the outbound message. When "No" is selected, changes to the controls above are not
reflected in the SOAP Envelope control.
SOAP Envelope
A syntax-colored XML editor for the Apache Velocity template to generate the SOAP envelope
to be sent to the web service to call the selected method. The string entered here is a template
that is evaluated for each document created and may contain destination mappings dragged
from the Destination Mappings list. If all web service systems implemented the SOAP standards
in the same way, this control would be read-only and would never need modification. However,
web services don't all implement the SOAP standards in the same way. When encountering a
web service that does not accept the envelope generated by Mirth, paste a corrected envelope
here, and replace the variable parts of the envelope by mappings dragged from the Destination
Mappings list.
pág. 99
Mirth 1.7.1 Reference Guide
TCP Sender
pág. 100
Mirth 1.7.1 Reference Guide
where <Mirth Directory> is the main Mirth install root and <ChannelID> is the unique id
of the current channel.
Response Timeout: The number of milliseconds the connector should wait for a
response from the host after sending a message.
Ignore Response: If checked, the connector will not wait for a response after sending a
message. If unchecked, the connector will wait for a response from the host after each
message is sent and optionally pass the response received to a Mirth channel.
Encoding: The character set encoding to use when converting the outbound message to
a byte stream if Data Type ASCII is selected below. Select Default to use the default
character set encoding for the JVM running the Mirth server.
Data Type (Binary/ASCII): Select Binary if the outbound message is a byte stream (will
not undergo character set encoding), or select ASCII if the outbound message is text
(will undergo character set encoding).
Send Response to: Select None to not process any response received from the host, or
select the channel to send the response to as a new inbound message.
Template: A Velocity template for the data written to the host. The string entered here is
a template that is evaluated for each message created and may contain destination
mappings dragged from the Destination Mappings list.
pág. 101
Mirth 1.7.1 Reference Guide
Message Browser
From the Dashboard, the Message Browser can be accessed by double-clicking a channel or
by selecting "View Messages" from the task menu when a channel is selected.
pág. 102
Mirth 1.7.1 Reference Guide
Message Tasks
Refresh: Updates the Message List area.
Send Message: See [Send Message] section.
Import Messages: Imports messages from a file and processes them as input
messages to the channel.
Export Filtered Messages: Exports the messages contained in the search results to a
file.
Remove All Messages: Permanently removes all messages for the channel from
storage.
Remove Filtered Messages: Permanently removes all messages contained in the
search results from storage.
Reprocess Filtered Messages: Reprocesses all messages contained in the search
results as new messages. This is normally done to test changes made to a channel.
Search
The Search area contains controls that determine the subset of the messages to be displayed in
the Message List. The default is to show all stored messages for the current day in the Message
List.
Start Time: Enter the earliest date and time for messages to include in the message
list. The default is 12:00AM on the current day.
End Time: Enter the latest date and time for messages to include in the message list.
The default is 11:59PM on the current day.
Status: Select the status of messages to include in the message list, or ALL to include
messages with any status. The default is ALL.
Advanced...: Clicking the Advanced button brings up the Advanced Search Filter dialog,
which provides additional search filtering options.
pág. 103
Mirth 1.7.1 Reference Guide
Connector: Enter "Source" to include only messages related to the Source connector of
this channel, enter the name of a Destination of this channel to include only messages
related to that Destination, or leave the control blank to include messages related to any
connector. The default is blank.
Protocol: Select a protocol to include only messages in the corresponding format, or
ALL to include messages in any format. The default is ALL.
Message Type: Some message formats, such as HL7, have a message type. Enter a
message type here to include only messages of that type, or leave the control blank to
include messages of any type. The default is blank.
The value to be entered here is the same value as is displayed in the Type column of
the Message List.
Source: Some message formats have a message source such as the sending facility in
HL7 messages. Enter a message source here to include only messages with that
source, or leave the control blank to include messages with any source. The default is
blank.
The value to be entered here is the same value as is displayed in the Source column of
the Message List.
Containing: Enter a string to include only messages that contain that string, or leave
the control blank to include all messages. The default is blank.
Raw, Transformed, Encoded: Check these boxes to include only messages that
contain the Containing string in the corresponding form of the message. The default for
each is unchecked.
If none of the boxes are checked, messages will be included regardless of the value
entered for the Containing string.
If one of the boxes is checked, messages will be included only if the corresponding form
of the message contains the string.
If more than one of the boxes is checked, messages will be included only if at least one
of the corresponding forms of the message contains the string.
pág. 104
Mirth 1.7.1 Reference Guide
Ok: Records the advanced search parameters for use when the Search button is
clicked, and closes the Advanced Search Filter dialog.
Cancel: Closes the Advanced Search Filter dialog, discarding any changes made to the
advanced search parameters.
Search: Updates the contents of the Message List based on the search control values
and the stored messages.
Page Size: Enter the maximum number of messages to be displayed in the Message
List at a time. The Search button must be pressed in order for new page sizes to be
displayed. The default page size (20) can be configured via the Settings view.
Previous Page: Displays the previous page of retrieved messages in the Message List.
Next Page: Displays the next page of retrieved messages in the Message List.
Message List: Displays the current page of messages matching the search controls.
Date: Displays the date and time at which Mirth processed the message.
Connector: Displays "Source" if the message is for the source connector of this
channel, or the name of the destination if the message is for a destination of this
channel.
Type: Displays the Type of the message for message formats that support the concept,
or blank for those that do not.
Source: Displays the Source of the message for message formats that support the
concept, or blank for those that do not.
Status: Displays the status of the message. Messages have one of these possible
statuses:
Status Meaning
ACCEPTED The message was accepted by the connector's filter. The Mappings tab
displays any mappings that were created.
TRANSFORMED The message has been transformed by the connector's transformer. The
Transformed Message tab displays the results of the transformation.
ERROR Processing of the message caused an error. See the Error tab for details.
SENT The encoded message was successfully sent to the destination. The
encoded message is viewable in the Encoded Message tab.
QUEUED The encoded message was queued because the destination is currently
inaccessible.
Protocol: Displays the format of the message (i.e. HL7 v2, XML, EDI).
Raw Message
Displays the incoming message received by the connector.
pág. 105
Mirth 1.7.1 Reference Guide
Transformed Message
Displays the transformed message out of the connector's transformer.
Encoded Message
Displays the encoded message to be sent on to the destination.
Mappings
Displays contents of the connector, channel, and global maps at the end of message
processing.
Errors
Displays the details of any error that may have occurred during message processing.
pág. 106
Mirth 1.7.1 Reference Guide
Users
When an operation logs an Event, the user who triggered the Event is logged with it. Mirth
provides the Users section for editing the set of users allowed to use the application. Note that
Mirth does not currently have the concept of user permissions. All users have full control.
pág. 107
Mirth 1.7.1 Reference Guide
User Tasks
Refresh: Refreshes the user list.
New (Edit) User: Clicking the New User task brings this dialog up to create a new user.
Clicking the Edit User task brings this dialog up to modify the data for the user currently
selected in the Users list.
Username: Enter the login name for this user. This is also the name that will appear in
the Users list and Events list for this user. Each user must have a distinct name.
Password: Enter the login password for this user.
Re-type Password: Re-enter the login password for this user. Mirth will check if the two
copies of the password entered are identical.
Full Name: Enter the full displayed name for this user. This name will appear only in the
Users list.
Email: Enter an email address for this user. This address will appear only in the Users
list.
Phone Number: Enter a phone number for this user. This phone number will appear
only in the Users list.
Description: Enter a description for this user. This description will appear only in the
Users list.
Delete User: Permanently removes the user currently selected in the Users list.
Users:
pág. 108
Mirth 1.7.1 Reference Guide
Settings
Use the Settings area to configure some option values that affect the Mirth Administrator and
Mirth Server. It also can be used for configuration maintenance.
pág. 109
Mirth 1.7.1 Reference Guide
Settings Tasks
Refresh: Updates the values displayed in the control from the current Mirth Server
settings.
Save Settings: Records the changes to the settings so that they take effect. Some
changes require a restart of either the Mirth Administrator or Mirth Server before they
take effect.
Settings
Client: These settings affect Mirth Administrator on the client's computer.
Dashboard refresh interval: When the Dashboard is displayed, Mirth Administrator will
wait the entered number of seconds between automatic refreshes of the Channel Status
list. See Channel Status section.
Alternate row highlighting in tables: When "Yes" is selected, Mirth Administrator will
display odd- and even-numbered rows in some lists with different background colors.
When No is selected, all rows will be displayed using the same background color.
Browser page size: Mirth will display this number of Messages per page when
displaying the stored messages for a channel. See [Message List] section. This number
is also used for the Event Browser page size, see [System Events List] section.
pág. 110
Mirth 1.7.1 Reference Guide
Alerts
The Alerts area provides tools for managing Alerts. Mirth Alerts are rules to monitor the
operation of Mirth and send email messages when an error is encountered.
Alert Tasks
Save Alerts: Commits the changes made in the Alerts area to Mirth, causing them to
take effect.
New Alert: Adds a new alert to the end of the Alerts list.
Delete Alert: Removes the alert currently selected in the Alerts list.
Disable (Enable) Alert: Disables or enables the currently selected alert in the Alerts
list. Disabled alerts never send email messages.
Alerts List
The Alerts list displays the alerts currently defined, including both enabled and disabled
alerts.
Status: Displays the status of the alert represented by this row, either Enabled or
Disabled.
Name: Displays the name of the alert represented by this row. Double-click this cell to
edit the name assigned to the alert.
Apply to Channels
This list selects which channels the alert watches.
pág. 111
Mirth 1.7.1 Reference Guide
Channel Name: Displays the name of the channel represented by the row.
Applied: When checked, the alert will watch for errors on the channel represented by
the row. When not checked, the alert will ignore errors on this channel.
Error Codes
This list contains the possible error codes and error code categories to be used in the Error
Matching Field.
Error Template
This edit box contains a Velocity template used to generate the email sent to the listed address
when this alert detects a matching error. The variable "${ERROR}" can be used to include the
full stack-trace in the email. Also, the variable "${SYSTIME}" can be used to include the time of
the error in the email.
pág. 112
Mirth 1.7.1 Reference Guide
Code Templates
The Code Templates area provides tools for managing templates for variables and code along
with global functions. The templates and functions that are defined show up in the reference list
when editing scripts throughout Mirth.
pág. 113
Mirth 1.7.1 Reference Guide
Template/Function
This is where the template or function is defined. Variable and Code templates are not
compiled, and therefore, only provide the template that was defined. On the other hand, be
careful when defining functions because they must begin with a function definition and compile.
Reference Lists
After defining code templates, check the reference lists in the various script editors and drag
and drop the templates to use them. There will be a section corresponding to each of the types
of templates prefixed with the words "User Defined." Right click on a scripting text box to see
the same templates; however, these are only updated when the Administrator is first launched.
pág. 114
Mirth 1.7.1 Reference Guide
pág. 115
Mirth 1.7.1 Reference Guide
Events
The event browser is used to view all of the system events that have occurred. It also has a
search functionality to help pinpoint specific events.
Event Tasks
Refresh: Manually updates the System Events list according to the search criteria.
Remove All Events: Permanently clears all System Events.
Remove Filtered Events: Permanently removes all events that match the current
search criteria.
Remove Event: Permanently removes the event currently selected in the System
Events list.
Search
The Search controls filter the System Events list to help find specific events.
pág. 116
Mirth 1.7.1 Reference Guide
Event: If a string is entered, only events that contain the entered string will be included
in the System Events list display.
Level: If ALL is selected, events with any level will be included in the System Events list
display. Otherwise, only events with the selected level will be included.
Start Date: The System Events list will display only events that occurred on or after the
selected start date. By default, this is set to the current date.
End Date: The System Events list will display only events that occurred on or before the
selected end date. By default, this is set to the current date.
Page Size: Because the number of events that match the search criteria can potentially
be very large, only a page of them at a time is displayed. The number of events on a
page can be specified here. The Search button must be pressed in order for new page
sizes to be displayed. The default page size (20) can be configured via the Settings
view.
pág. 117
Mirth 1.7.1 Reference Guide
Plugins
The Plugins page contains the display components of plugins installed. The two default plugins
that are bundled with Mirth are the Extension Manager and the Message Pruner.
Extension Manager
Mirth is constructed largely of plugins, allowing it to be freely extended in certain areas. The
Extensions Manager tab of the Plugins area shows the installed collection of connectors and
plugins and helps with maintaining and updating them.
Manager Tasks
Refresh: Updates the displayed lists of Installed Connectors and Installed Plugins.
Save: Commits any changes made to the lists of Installed Connectors and Installed
Plugins to Mirth. Many changes will require a Mirth Server and Administrator restart.
Download Extensions: Clicking this task checks the Mirth extensions site for new
extensions and gives the opportunity to download and install any that may be of
interest.
pág. 118
Mirth 1.7.1 Reference Guide
Available Extensions list: Displays the list of available extensions that are not
currently installed in the Mirth configuration.
Type: Displays the type of the extension, either Connector or Plugin.
Name: Displays the name of the extension, such as "PDF Viewer".
Version: Displays the available version of the extension.
Author: Displays the author of the extension.
Install: Check this box to select this extension for installation, or leave it unchecked to
not select this extension.
Install Selected: Downloads and installs all of the extensions that are checked.
Refresh Extensions: Checks the Mirth extensions site again for new extensions, and
updates the displayed list.
Close: Closes this dialog.
Check All for Updates: Clicking this task checks the Mirth extensions site for updates
to the installed connectors and plugins, displaying them in a list and giving the option
of updating them.
pág. 119
Mirth 1.7.1 Reference Guide
Extension Updates list: Lists those extensions and plugins installed in the Mirth
configuration for which an update is currently available.
Name: Displays the name of the connector or plugin.
Installed Version: Displays the version of the connector or plugin that is installed in the
Mirth configuration.
Update Version: Displays the updated version from the Mirth extensions site.
Update: If checked, this update will be downloaded and installed when the Install
Updates button is clicked. If unchecked, this update will not be installed.
Install Updates: When clicked, downloads and installs all updates in the list for which
the Update box is checked.
Check for Updates: Checks the Mirth extensions site again for updates and refreshes
the Extension Updates list.
Close: Closes this dialog.
Check for Updates: Clicking this task checks the Mirth extensions site for updates to
the currently selected connector or plugin and gives the option to update it.
pág. 120
Mirth 1.7.1 Reference Guide
Extension Updates list: Displays the currently selected connector or plugin and
whether or not an update for it is currently available.
Name: Displays the name of the extension or plugin.
Installed Version: Displays the version of the connector or plugin that is installed in
the Mirth configuration.
Update Version: Displays the updated version from the Mirth extensions site.
Update: If checked, this update will be downloaded and installed when the Install
Updates button is clicked. If unchecked, this update will not be installed.
Install Updates: When clicked, downloads and installs all updates in the list for which
the Update box is checked.
Check for Updates: Checks the Mirth extensions site again for updates and refreshes
the Extension Updates list.
Close: Closes this dialog.
Disable (Enable) Extension: If the connector or plugin currently selected in the
Installed Connectors or Installed Plugins list is currently enabled, disables it. Otherwise
it disables the selected connector or plugin.
Show Properties: Displays the properties of the connector or plugin currently
selected.
Installed Connectors
Lists all connector extensions currently installed in the Mirth configuration and whether they are
enabled or disabled.
pág. 121
Mirth 1.7.1 Reference Guide
Status: Displays the current status of this connector, either Enabled or Disabled.
Name: Displays the name of this connector.
Author: Displays the author of this connector.
URL: Displays the URL of the extension manager site for this connector.
Version: Displays the version number of this connector.
Mirth Version: Displays the Mirth version number required by this connector version.
Installed Plugins
Lists all plugin extensions currently installed in the Mirth configuration, whether they are enabled
or disabled.
Status: Displays the current status of this plugin, Enabled or Disabled.
Name: Displays the name of this plugin.
Author: Displays the author of this plugin.
URL: Displays the URL of the extension manager site for this plugin.
Version: Displays the version number of this plugin.
Mirth Version: Displays the Mirth version number required by this plugin version.
pág. 122
Mirth 1.7.1 Reference Guide
Message Pruner
The Message Pruner tab of the Plugins area controls when message pruning (deleting)
operations occur and displays a log of message pruning operations. The selection of which
messages to prune is made separately for each channel. See Summary section.
Settings
These controls determine when the message pruner runs.
Hourly: If checked, the message pruner runs once per hour.
Daily: If checked, the message pruner runs once a day at the time of day selected.
Weekly: If checked, the message pruner runs once a week on the day selected at the
time of day selected.
Monthly: If checked, the message pruner runs once a month on the day of the month
selected at the time of day selected.
Activity Log
This list displays a log of the dates and times on which the message pruner ran for each
channel.
Channel: Displays the name of the channel the message pruner examined.
Time Pruned: Displays the date and time at which the message pruner examined the
channel.
Messages Pruned: Displays the number of messages the pruner removed.
pág. 123
Mirth 1.7.1 Reference Guide
The Mirth Server Manager is a Windows system tray applet that provides basic server
management and a launch point for the Mirth Administrator. Right-click on it to see a short
menu of possible operations, or double-click it to open the Mirth Server Manager Dialog.
Menu
Show Manager: Clicking this item cause the Mirth Server Manager Dialog to be
displayed.
Launch Administrator: Clicking this item launches Mirth Administrator via Java Web
Start. One or more security warning dialogs may pop up saying that the Mirth
Administrator is not digitally signed. Simply click the Run button to continue if this
occurs.
Close Manager: Causes the Mirth Server Manager system tray applet to exit.
pág. 124
Mirth 1.7.1 Reference Guide
Administrator: Clicking this button launches Mirth Administrator via Java Web Start.
One or more security warning dialogs may pop up saying that the Mirth Administrator is
not digitally signed. Simply click the Run button to continue if this occurs.
Ok: Commits any changes made to any settings on any tabs to Mirth. Changes to the
settings will not take effect until the Mirth service is restarted.
Cancel: Discards any changes made to any settings on any tabs, and closes the dialog.
Service
The Service tab provides controls to start, restart, or stop the Mirth Service (server).
Start
Clicking this button starts the Mirth Service.
pág. 125
Mirth 1.7.1 Reference Guide
Restart: Clicking this button stops the Mirth Service and then starts it again.
Stop: Clicking this button stops the Mirth Service.
Server
The Server tab displays controls to change the network ports that the Mirth Server listens on
and the level of detail to include in the server logs. Also, it has the ability to view the current
server log file contents.
WebStart Port: Enter the port at which the Mirth Server should listen to serve up the
Mirth Administrator application via Java Web Start. The common reason for changing
the default value is that it may conflict with some other server running on the same
machine.
Administrator Port: Enter the port which Mirth Server and Mirth Administrator or the
Mirth Shell should use to communicate with each other. The common reason for
changing the default value is that it may conflict with some other server running on the
same machine.
Main Log Level: The log level to use for the Mirth server logging.
Database Log Level: The log level to use for Mirth server interactions with the
database.
Log Files: Displays the names of the Mirth Server log files. Mirth related events are
logged in mirth.log. The other file, wrapper.log, contains everything in mirth.log in
addition to JVM and Mirth Service related events.
Refresh: Refreshes the values displayed by the controls from the current server
settings. Only necessary if the server settings are changed by some entity other than
this instance of the Mirth Server Manager.
View File: Displays the contents of the log file selected in the Log Files list in Notepad.
Most Mirth related events are logged in mirth.log. The other file, wrapper.log, contains
everything in mirth.log in addition to JVM and Mirth Service related events.
Database
The Database tab specifies the database used by Mirth to store messages, channels, and other
internal Mirth data.
pág. 126
Mirth 1.7.1 Reference Guide
pág. 127
Mirth 1.7.1 Reference Guide
Mirth shell
In addition to the graphical Mirth Administrator, Mirth provides a command line interface known
as the Mirth Shell. The Mirth Shell is a small java program which for a default installation can be
executed as:
java -jar shell-launcher.jar shell-launcher.xml
-a https://127.0.0.1:8443 -u admin -p admin -v 0.0.0
The available command line options for the shell are:
-v version Specifies the version of Mirth Shell being used (required). Use 0.0.0 to ignore this
property.
-s file Specifies a script file pathname to be read for commands to be executed. The shell
exits after the last command in the file is executed. If the -s option is not specified,
the shell enters interactive mode and presents a prompt to manually enter
commands (optional).
-h Causes the shell to display a short summary of the available command line options
and immediately exit.
pág. 128
Mirth 1.7.1 Reference Guide
Shell Commands
Help : Displays a summary of the available shell commands.
Status: Lists the status of all deployed channels. For example:
$status
ID Status Name
2d286176-8ada-49e2-a295-9aa145cd26c7 STARTED Channel 1
a74dbfd9-7aed-4142-a519-1ff080fc6438 STARTED Channel 2
$
Start : Starts all deployed channels.
Stop: Stops all deployed channels.
Pause: Pauses all deployed channels.
Resume: Resumes all paused channels.
deploy [timeout]: Deploys all Channels with optional timeout (in seconds).
import "path" [force]: Imports channel specified by <path>. Optional 'force'
overwrites existing channels.
export id | "name" | * "path": Exports the specified channel or channels to <path>.
importcfg "path": Imports the saved Mirth configuration specified by <path>.
exportcfg "path": Exports the current Mirth configuration to <path>.
importscript Deploy | Preprocessor | Postprocessor | Shutdown "path" : Imports
the named global script from the file specified by <path>.
exportscript Deploy | Preprocessor | Postprocessor | Shutdown "path": Exports the
named global script to the file specified by <path>.
channel start|stop|pause|resume|stats id|"name"|*: Starts, stops, pauses, resumes,
or displays statistics for the specified channel.
channel remove|enable|disable id|"name"|*: Removes, enables, or disables the
specified channel.
channel list: Lists all Channels, deployed or not. For example:
$channel list
ID Enabled Name
2d286176-8ada-49e2-a295-9aa145cd26c7 ENABLED Channel 1
a74dbfd9-7aed-4142-a519-1ff080fc6438 ENABLED Channel 2
5218528e-a8c4-430f-8951-1d5dd1034858 DISABLED
$
Clear: Removes all messages from all Channels.
Resetstats: Resets the statistics for all Channels.
dump stats|events "path": Writes all channel statistics or events to specified file.
user list: Lists the currently defined users. For example:
$user list
ID User Name Name Email
1 admin null null
$
pág. 129
Mirth 1.7.1 Reference Guide
user add username "password" "name" "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 out of the Mirth Shell.
Shutdown: Shuts down the Mirth server.
pág. 130
Mirth 1.7.1 Reference Guide
Examples
In this example we will configure a channel to listen for HL7 v2.x messages using and LLP
connection, extract some patient data such as name and address from the message, and write
the data to both a text file and a database depending on the message's sender.
This example will demonstrate:
Configuring a channel
Using message templates
Creating transformer mapping steps
Creating filter rules
Configuring multiple destinations
Step 1: Create a new channel, making sure that the Incoming Data field is set to HL7 v2.x.
pág. 131
Mirth 1.7.1 Reference Guide
Step 2: Set the Source connector type to LLP Listener and configure any listener properties as
needed. In this example, Mirth is listening for HL& messages on port 6661.
Step 3: Edit the Transformer for the Source connector and paste in a sample HL7 message into
the Inbound Message Template field on the Message Templates tab.
pág. 132
Mirth 1.7.1 Reference Guide
Step 4: Click on the Message Trees tab to view the tree generated for the Inbound Message
Template. Right-clicking on any node in the tree displays a context menu to expand and
collapse nodes in the tree.
Step 5: Drag nodes from the tree to the Transformer area to create new Mapping steps. In this
pág. 133
Mirth 1.7.1 Reference Guide
example, seven mapping steps were created to extract patient information. Since these steps
are in the transformer for the Source connector, they will be available to all destinations for this
channel.
Step 6: In the Destinations area, create a new File Writer destination to generate a text file with
the mapping data. Notice that the File Name field is set to a generated unique ID using the
variable available in the Destination Mappings section on the right. The content of the text file as
specified in the Template field also contains mappings, which were created in the transformer.
When the channel is deployed and a message is received, the variables in the template will be
replaced with the actual values from the message.
pág. 134
Mirth 1.7.1 Reference Guide
Step 7: Edit the Filter for the File Writer destination and create a new rule of type Rule Builder
that only accepts messages with a sending facility of "001". The Field can be specified by
dragging and dropping a node from the Inbound Message Template Tree if an Inbound
Message Template has been specified. When the channel is deployed and a message is
received, a message will be sent to this destination only if the filter accepts the message.
The same rule can also be written in a JavaScript rule type. The rule can contain arbitrary
JavaScript, but must return either TRUE to accept the message or FALSE. Multiple rules are
joined using the AND operator by default, and can be changed to OR by modifying the Operator
drop-down field. As with the Rule Builder step, nodes can be dragged and dropped into the
JavaScript field from the Inbound Message Template tree.
pág. 135
Mirth 1.7.1 Reference Guide
Step 8: Create a new Database Writer destination to insert the extract message data into a
PostgreSQL database instance. Notice that the URL entered for the database is a JDBC
database connection string. Like the Template field in the File Writer, use any of the available
mappings to form the INSERT statement.
pág. 136
Mirth 1.7.1 Reference Guide
Message Builder
This example will show how to configure a channel to read data from a database, form an HL7
v2.x message using the data, and send it over an LLP connection.
This example will demonstrate:
Using the Database Reader
Generating an HL7 v2.x message from a template
pág. 137
Mirth 1.7.1 Reference Guide
Step 2: Set to Source connector type to Database Reader and enter the connection
information. In this example, the connector is set to poll the database every 5 seconds and
execute the specified SELECT query. Columns entered in the FROM clause are automatically
added as available variables. Note that the On-Update SQL statement that is executed
immediately after the query can make use of variables returned from the initial query.
pág. 138
Mirth 1.7.1 Reference Guide
Step 3: Edit the transformer for the Source connector and click on the Message Templates tab
to paste in an example Outbound Message Template, making sure to set the Data Type to HL7
v2.x. This template will be used as the base for new outbound HL7 messages generated by the
channel.
The Inbound Message Template is an example of what an inbound message resulting from the
database query will look like. This shows how the XML has been generated using the columns
selected.
pág. 139
Mirth 1.7.1 Reference Guide
Step 4: Click on the Message Trees tab to view the trees for both the Inbound and Outbound
message templates.
pág. 140
Mirth 1.7.1 Reference Guide
Step 5: In order to map data from the database to the message template, click on a node in the
Inbound tree and drag-and-drop it over the node in the Outbound tree which should be
replaced. This example shows replacing the "PID.5.1 (Family Name)" field in the message
template with the "last_name" variable from the database. The auto-generated name of the
transformer step reflects this mapping.
pág. 141
Mirth 1.7.1 Reference Guide
Step 6: Add a new destination connector of type LLP Sender. The Template is the data that will
be sent over the LLP connection to the host address and by default is set to the Encoded Data,
which in this example is an HL7 v2.x message.
pág. 142
Mirth 1.7.1 Reference Guide
Definitions
DNS - Domain Name System. The standard Internet protocol for mapping between textual
"domain names" humans use to identify specific computers, and the binary IP addresses
computers understand. See http://en.wikipedia.org/wiki/Domain_name_system for more details.
E4X (ECMAScript for XML) - "a set of programming language extensions adding native XML
support to ECMAScript [JavaScript]." See http://www.ecma-
international.org/publications/standards/Ecma-357.htm for full details.
FTP - File Transfer Protocol. An older, common protocol for transferring files between machines
over the internet. See http://en.wikipedia.org/wiki/File_Transfer_Protocol for details.
HTTP - Hypertext Transfer Protocol. The main protocol underlying the World Wide Web. See
http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol for details.
IP - Internet Protocol. The core protocol used on the Internet for sending packets of information
between machines, on which all other Internet protocols are based. See
http://en.wikipedia.org/wiki/Internet_Protocol for details.
JavaScript - the primary scripting language for Mirth. Mirth uses the open source Rhino
implementation. See http://www.mozilla.org/rhino/ for more information.
JDBC - Java Database Connectivity. A Java API for accessing databases. See
http://en.wikipedia.org/wiki/JDBC for more information.
JMS - Java Message Service. A messaging standard for Java applications. See
http://java.sun.com/developer/technicalArticles/Ecommerce/jms/ for an overview.
LLP - Lower Level Protocol. The standard protocol used for exchanging HL7 messages over
networks. See http://www.hl7.org/ for more information.
Mule - an open source messaging platform based on Enterprise Service Bus (ESB) concepts
used as the core of Mirth. See http://mule.mulesource.org/display/MULE/Home for more
information.
ODBC - Open Database Connectivity. A standard language-neutral API for database access.
See http://en.wikipedia.org/wiki/Open_database_connectivity for more information.
PDF - Portable Document Format. A common file format for formatted text document
interchange originally created by Adobe Systems and since recast as an open standard. See
http://en.wikipedia.org/wiki/Portable_Document_Format for more information.
RTF - Rich Text Format. A proprietary file format for formatted text documented interchange
created by Microsoft. See http://en.wikipedia.org/wiki/Rich_text_format for more information.
SMTP - Simple Mail Transfer Protocol. The standard Internet protocol for sending email
messages. See http://en.wikipedia.org/wiki/Smtp for more information.
SOAP - Simple Object Access Protocol. See http://en.wikipedia.org/wiki/SOAP for an overview.
TCP - Transmission Control Protocol. The standard connection-based communication protocol
on which most Internet protocols are based.
URI - Uniform Resource Identifier. A globally unique (across all web services) name for a web-
accessible resource of some kind. See http://en.wikipedia.org/wiki/Uniform_Resource_Identifier
for the gory technical details.
pág. 143
Mirth 1.7.1 Reference Guide
URL - Uniform Resource Locator. A global unique (across all web services) location where a
web-accessible resource may be found. See
http://en.wikipedia.org/wiki/Uniform_Resource_Locator for the gory technical details.
Velocity. An open source template processing engine used by Mirth. See
http://en.wikipedia.org/wiki/Apache_Velocity.
WSDL - Web Services Description Language. A standard XML-based language for describing
web services. See http://en.wikipedia.org/wiki/Web_Services_Description_Language for
technical details.
XML - Extensible Markup Language. An open standard for a general-purpose markup
language, now commonly used to store various kinds of data in a semi-human-readable way.
See http://en.wikipedia.org/wiki/XML for technical details.
pág. 144