FHIR On Mirth Connect
FHIR On Mirth Connect
FHIR On Mirth Connect
All rights reserved. No part of the contents of this book may be reproduced or
transmitted in any form or by any means without the written permission of the author.
The companies, organizations, products, domain names, email addresses, logos, people,
places, and/or data mentioned herein in examples are fictitious. No association with any
real company, organization, product, domain name, email address, logo, person, place,
or data is intended or should be inferred.
This book expresses the author’s views and opinions. The information contained in this
book is provided without any express, statutory, or implied warranties. The author, Mirth
Corporation, Health Level Seven International, resellers and distributors will NOT be held
liable for any damages caused or alleged to be caused either directly or indirectly by this
book.
This is a preview edition of the book. The full version is available only at -
http://fhironmirth.shamilpublishing.com
Introduction 2
Contents
PART 1 GETTING STARTED
3 Introduction
Chapter 6 HL7v2 Enricher on HAPI-FHIR .......................................................................................... 53
Global Scripts .................................................................................................................... 54
Deploy Scripts ................................................................................................................... 55
Destinations Connector ................................................................................................... 56
Channel Implementation Verification .............................................................................. 62
Summary ........................................................................................................................... 63
Chapter 7 Cerner FHIR Client ........................................................................................................... 65
Configuration Map ............................................................................................................ 65
Summary Tab .................................................................................................................... 65
Source Connector ............................................................................................................. 66
Destinations Connector ................................................................................................... 66
Channel Implementation Verification .............................................................................. 71
Summary ........................................................................................................................... 72
Introduction 4
PART IV BULK DATA ACCESS
5 Introduction
APPENDICES
A: Profile Validation ....................................................................................................... 143
B: Archive Content ......................................................................................................... 146
Introduction 6
Introduction
Introduction
As Mirth Corporation says on their web-site, “Mirth Connect is the Swiss Army knife of
healthcare integration engines, specifically designed for HL7 message integration. It
provides the necessary tools for developing, testing, deploying, and monitoring interfaces.
And because it’s open source, you get all of the advantages of a large community of users
with commercial quality support.”
In addition, “The 2014 HL7 Interface Technology Survey Results” show that Mirth Connect
is one of the fastest growing healthcare messaging platforms due to its open-source
paradigm, and robust functionality for HL7 messaging and X12 documents. Mirth
Connect also speeds up the development of interfaces for data exchange across different
formats and diverse healthcare systems environment.
This book describes version 4.x of Mirth Connect to the point that reader are confident
enough to start building their own healthcare data exchange interfaces using a new set
of HL7 standards called FHIR (Fast Healthcare Interoperability Resources).
As you read this book, you will be implementing a number of fictitious FHIR related
services. Each connection point (channel and destination) is explained in a separate
chapter, which in turn provides step-by-step instructions on how to create and code data
transformation rules.
This book is written using Mirth Connect version 4.x. Consequently, other releases may
include new features, and features used in this book may change or disappear. You may
also notice differences between screen shots provided in the book and those you see
when using Mirth Connect.
I wrote this book primarily for application developers and system integrators who have
found the online Mirth Connect documentation lacking and needed a guidebook that
covers topics in a more detailed and organized way.
A book of this size cannot cover every feature in Mirth Connect; consequently, I assume
you already have some familiarity with its main components, functions and use.
7 Introduction
Assumption
This book assumes that you are dealing with applications that use message-oriented
middleware products and expects that you have at least a minimal understanding of
Web service technologies including, but not limited to, XML, JSON, REST and OAuth.
Before you start reading this book, you should have a basic knowledge of Mirth Connect
development paradigm, JavaScript, Java and E4X objects; and are familiar with operating
system environment variable settings.
You should also have basic knowledge of HL7, the standard that is being used to
exchange healthcare data, both version 2 and FHIR.
As mentioned earlier, the purpose of this book is to provide the reader with a high-level
overview of the capabilities and features in Mirth Connect. This book is not intended to
be a step-by-step comprehensive guide or substitute of any kind for training and
certification programs provided by NextGen.
This book is also not a tutorial on a specific messaging or middleware technology. All
examples included in this book are for illustrative purposes only. If you are interested in
learning more about a specific technology or product, please refer to one of the many
on-line resources, or trainings and certifications provided by NextGen, Mirth Connect
team or its affiliates.
This book does not cover any specific installation, configuration, deployment or
monitoring activities for system administrators.
I have made every effort to ensure the accuracy of this book and its companion content.
If you find an error, please report through email - [email protected]
Introduction 8
Warning and Disclaimer
The purpose of this book is to educate and entertain. Every effort has been made to
make this book as complete and accurate as possible, but no warranty or fitness is
implied.
The information is provided on an “as is” basis. The author shall have neither liability nor
responsibility to any person or entity for any loss or damage caused, or alleged to be
caused, directly or indirectly by the information contained in this book or from the use of
software mentioned in this book. The information, methods and techniques described by
the author are based on his own experience. They may not work for you and no
recommendation is made to follow the same course of action. No representation is made
that following the advice in this book will work in your case.
The author is not an employee or representative of NextGen and never has been, and
author’s views and opinions are not necessarily those of NextGen. This book is not based
on trainings or certifications provided by Mirth NextGen or its affiliates.
This book contains links to third-party websites that are not under the control of the
author, and the author is not responsible for the content of any linked site. If you access
a third-party website mentioned in this book, you do so at your own risk. The author
provides these links only as a convenience, and the inclusion of the link does not imply
that the author endorses or accepts any responsibility for the content of those third-
party sites.
Furthermore, this book contains information on the subject only up to the publication
date.
Acknowledgements
Like most books, this guide has been a long time in the making. I would like to
acknowledge everyone who has assisted in this project. I could not have done this
without you.
My biggest thanks go to Wayne Zafft and Taylor Clark, who were incredibly gracious with
their time and effort in reviewing the final version of the book.
9 Introduction
Roadmap
Part I provides an introduction to Mirth Connect and a high-level overview of the HL7
Fast Healthcare Interoperability Resources (FHIR) standard.
Introduction 10
Chapter 7, Cerner FHIR Client
Introduces readers to the Cerner FHIR sandbox and walks through the
implementation of a Mirth Connect client to explore the capabilities of the external
FHIR Server.
11 Introduction
Part V is dedicated to CDS Hooks implementation.
Appendices include:
Profile Validation
A Java class used to validate FHIR resource instances against FHIR profiles used in
Chapter 10.
Archive Content
A list of supplementary materials required for parts II to V included with this book.
Introduction 12
PART I – GETTING STARTED
Getting Started
CHAPTER 1 Mirth Connect Basics
Make sure your computer meets minimum system requirements before you start:
Java 8 or higher;
1 GB of RAM is recommended;
Installation
You can install Mirth Connect in either of two ways based on which package you
downloaded or which package is available on the website. In one case, the package is an
archive of all files and classes you need to run Mirth Connect on your computer. You
simply unzip and copy the package to an appropriate folder, for example to C:\Program
Files\Mirth Connect\. In the other case, there is a GUI based wizard that you start to
go through the steps in the installation. The installation process itself is quite straight
forward.
Both methods install Mirth Connect Server, Mirth Connect Server Manager, Mirth
Connect Administrator and Mirth Connect Command Line Interface. During the
installation you have to decide which port is used by the Mirth Connect Server. The
default is 8080 for unsecure communication and 8443 for the SSL connection. You can
change the ports later using the Mirth Connect Server Manager, if necessary.
If you see the Dashboard statistics page with, most likely, no channels available, you have
successfully installed Mirth Connect and are ready to continue. If not, refer to the Mirth
Connect User Guide written by “the same Mirth technical experts who developed the
Configuration
The Mirth Connect Server Manager can be used as a single point to launch Mirth
Connect Service, configure ports, allocate memories, and to establish database
connections. However, a fully-fledged configuration description is beyond the scope of
this book.
If any application on your computer or firewall uses ports 8080 or 8443 you can either
change Mirth’s ports by using Mirth Connect Server Manager or by manually modifying
the configuration file located in \conf\mirth.properties. Do not forget to restart the
Mirth Connect Server or Service to activate your changes.
The Mirth Connect Administrator is a Java application. It’s invoked by the Mirth Connect
Administrator Laucnher. This is to ensure that the Mirth Connect Administrator matches
the version of the Mirth Connect Server being used.
If everything is done correctly, each time you login, you will see the Dashboard as the
initial screen. The Dashboard displays two information panels:
Channels status and statistics – shows the number of messages Received, Filtered,
Queued, Sent, and Errored. The left sidebar of the Dashboard has tasks panel, with
menu options related to your current activity. For example, when you are developing
a channel, menu options such as Refresh, Send Messages, and Remove All Messages
are displayed. These menu items can be also accessed by right clicking on a channel
name in the Channel List.
Logs – Server Log, Connection Log and Global Maps. The Server Log is used to debug
channel development. Double-clicking on a Server Log entry brings a pop-up
window where you can view and copy the entire log entry content. The Server Log is
stored by Mirth Connect Server in the database; closing and opening the Mirth
Connect Administrator brings back all entries not explicitly purged. To clear the
Server Log click Clear Displayed Log under the Server Log or Connection Log area.
Channels
The Channel is an essential part of Mirth Connect and can be seen as one-to-many
abstract unidirectional pipes that decouple components from each other to transfer
healthcare data between two or more applications. The channel architecture
implemented in Mirth Connect can divide a large message processing task into a
sequence of smaller independent steps. This affords developers the flexibility for
dependency, maintenance and/or performance. Some of the processing tasks can even
be external to Mirth Connect and developed independently.
In general, each channel consists of inbound and outbound Connectors, Filters and
Transformers. The connector that receives inbound messages from the Sending
Application is called the Source. Similarly, the connector that sends outbound messages
is called the Destination. From the Source connector, data is passed through the channel,
where filters and transformers perform operations on the data, for example, routing a
message to one or another Destinations connector and transforming the data
representation. Deciding each channel’s tasks is when wearing an analyst's hat comes
into play.
Before you create a new channel, you need to elicit the following requirements:
Type of Application the channel reads data from (Source connector type);
Type of Application the channel sends data to (Destination connector type);
Connectors
Mirth Connect supports sending and receiving messages over a variety of connectors
listed here in no particular order:
TCP/MLLP;
Database (MySQL, PostgreSQL, Oracle, Microsoft SQL Server, ODBC);
File (local file system and network shares);
FHIR;
PDF and RTF documents;
JMS;
HTTP (note that HTTPS is not supported in the free version);
SMTP;
SOAP (over HTTP).
The connector that receives the data is called a Reader, for example the MLLP Reader.
The connector that sends the data is called a Writer, the Database Writer is an example.
Connector types are configured under Source and Destinations tabs of the channel.
Obviously, some settings are common across all connectors while others are unique to a
specific connector type.
You can develop your own connector if you need one that is not shipped with the Mirth
Connect installation package, e.g., HTTPS connector. However, this is out of scope of this
book.
Filters
In a real world scenario, when numerous applications and channels are connected, a
channel may receive messages from several sources and may process these messages
differently, based on the message type or other criteria.
There are two paradigms for addressing this requirement, a Router and a Filter:
Filters can be as simple as comparing specific elements against a hard coded value or as
complex as a scripting language routine. Filters can also be omitted allowing all
messages to pass through. Some routing capabilities have been introduced in Mirth
Connect v3.1 by using a "destinationSet". If a destination is removed from the
destination set, this destination will not receive the message.
If a single channel needs to process more than one type of message, you can create any
number of separate pipes – Destinations - and specify none, one or more filters for each
pipe.
Transformers
More often than not, messages are sent between legacy systems, custom applications
and third-party solutions, each of which is built around a proprietary data model. Even
systems that claim to support a single standard may place specific requirements on data
format and content. If we could bring all legacy systems to a single format when a new
business requirement is proposed, we would avoid conversion issues. Unfortunately, for
most legacy systems, data format, content or data sequence changes are difficult and
risky, and simply not feasible.
How do we communicate data using different formats then? Mirth Connect does this in a
message Transformer that translates one data format into another. As a result, a
destination application can receive messages it understands and which can be processed
and stored in the application’s internal data format.
Mirth Connect allows message transformation to occur at different levels and to chain
message transformers to achieve a required result.
Scripts
Channels also support unique features called Scripts to enhance message processing
logic. Scripts apply to a channel itself and all messages that are passing through.
Besides the channel level, Mirth Connect employs Global Scripts that play the same role
as channel scripts and help in separating the business logic. They have the same Deploy,
Undeploy, Preprocessor and Postprocessor scripts; the only difference is that they apply to
all channels.
This concludes Mirth Connect introduction section. To find out more, you may refer to
numerous web resources, including trainings and books provided by Mirth Corporation.
Book Resources
Other titles you may be interested in:
Creating effective HL7 interfacing is an absolute necessity for vendors and hospital/HIE
organizations. HL7 is not a single standard, it is a family of standards. Nine times out of ten, it is a
difficult challenge to navigate through HL7 set of standards without a technical background and
practical experience in this field.
I have the domain knowledge to guide you through HL7 interfaces development to address your
most painful and common needs.
SKILLS SUMMARY
With this experience background, I hope I can definitely add value to your team.
Appendices
A: Profile Validation
B: Archive Content
APPENDICES 26