My take on the course Building Basic HL7 Integrations with InterSystems on InterSystems Learning
Tags: learning, beginners, tutorial, programming
Published: 2023-01-19 20:02:34

Because I had no idea how to build an integration solution for HL7 and didn't know where to start, I decided to follow the course [Building Basic HL7 Integrations with InterSystems](https://learning.intersystems.com/course/view.php?id=1350) on Learning portal to get at least the idea of where to begin. After I studied all of it, I decided it might be a good idea to share my thoughts and reflections about it with everyone.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7e4mysx6zfs9ta6jxrzb.png)

This learning course consists of five steps:

  1. Explore an InterSystems integration engine (30 minutes)
  2. Route HL7v2 messages efficiently (1 hour)
  3. Modify data to meet system requirements (1 hour 20 minutes)
  4. Troubleshoot at the time of need (2 hours)
  5. Practice skills from this path (1 hour 30 minutes)

But before we begin dissecting this course, here are some optional resources that may be useful if you're a complete newbie in InterSystems products:

  * [Online Course: Introduction to InterSystems Products and Technologies (30 minutes)](https://learning.intersystems.com/mod/url/view.php?id=10453)
  * [Video: What is InterSystems IRIS for Health? (3 minutes)](https://learning.intersystems.com/mod/url/view.php?id=10454)

The first course gives the basics of InterSystems products and technologies and lets students discover what products exist, how they are used, and how they compare to each other from a nontechnical perspective. It takes approximately 30 minutes to complete and consists of four instructional lessons and several quiz questions.

From the second course, you will learn what's InterSystems IRIS for Health. Using this platform, developers can create and scale healthcare applications with tools that are uniquely designed to meet the current and future needs of modern healthcare.

After the course in question, the system proposes the user to continue with two more courses:

  * Begin [Building a healthcare production in a development environment](https://learning.intersystems.com/mod/url/view.php?id=10455) (online course, 30 minutes)
  * Continue on to the next step with [Building Advanced HL7 Integrations](https://learning.intersystems.com/mod/url/view.php?id=10456) (learning path, 2 hours)

So, let's get back to the course at hand and look more in detail at these five stages.

The **first** one is the [basic architecture and data flow of a production,](https://learning.intersystems.com/enrol/index.php?id=908) the InterSystems integration solution. It takes around 30 minutes if you don't make pauses. This course consists of three lessons and several quiz questions after each lesson.

This part will teach you the basic architecture of integration capabilities and how data flows through these components, enabling interoperability between systems.

At the end of this course you will be able to:

  * Identify the parts of an integration engine


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3smbn4bm1fx6br3szn5v.png)

  * Explain the functions of business services, business processes, business operations, and adapters.

<p style="margin-left: 40px;">
  After a <em>business service</em> pulls data into production, it can:
</p>

<ul style="margin-left: 40px;">
  <li>
    Send messages to a business process or business operation.
  </li>
  <li>
    Accept responses from a business process or business operation.
  </li>
  <li>
    Return responses to calling applications.
  </li>
</ul>

<p style="margin-left: 40px;">
  <em>Business processes</em> can accept, return, and send response messages to and from business services and business operations:
</p>

<ul style="margin-left: 40px;">
  <li>
    Accept request messages from a business service or other business process.
  </li>
  <li>
    Coordinate requests and responses from multiple production components.
  </li>
  <li>
    Return responses to business processes or business services.
  </li>
</ul>

<p style="margin-left: 40px;">
  The main purpose of a <em>business operation</em> is to send data out of a production.
</p>

<p style="margin-left: 40px;">
  Within a production, <em>adapters </em>do the following:
</p>

<li style="margin-left: 40px;">
  Manage the specific technology and protocol used to communicate with an application.
</li>
<li style="margin-left: 40px;">
  Include details such as ports and message headers that help production communicate with the application.
</li>
<li style="margin-left: 40px;">
  Isolate connection-specific logic from the rest of the production.
</li>

<p style="margin-left: 40px;">
  Some adapters are bi-directional, allowing messages to flow to and from business services or business operations. There are two types of adapters:
</p>

<li style="margin-left: 40px;">
  Inbound adapters – used in business services.
</li>
<li style="margin-left: 40px;">
  Outbound adapters – used in business operations.
</li>

  * Describe message flow within an integration solution.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtautqfk2rjju1kgw06t.png)

The **second step** consists of 1 online course, 4 videos and an exercise:

  1. Course: [HL7 Business Services and Business Operations](https://learning.intersystems.com/mod/url/view.php?id=6500) (30 minutes)
  2. Video: [Configuring Validation of HL7 V2 Messages in Productions](https://learning.intersystems.com/mod/url/view.php?id=13629) (6 minutes)
  3. Video: [Routing HL7 Messages](https://learning.intersystems.com/mod/url/view.php?id=6501) (8 minutes)
  4. Video: [Using HL7 V2 Bracket and Parentheses Syntax To Identify Virtual Properties](https://learning.intersystems.com/mod/url/view.php?id=13152) (6 minutes)
  5. Video: [Using the Expression Editor in Business Rules](https://learning.intersystems.com/mod/url/view.php?id=6502) (8 minutes)
  6. Exercise: [Building a Message Router](https://learning.intersystems.com/mod/url/view.php?id=9893) (15 minutes)

The course contains four lessons and several quiz questions after each lesson.

This part will teach you how to create, configure, and copy the business services and business operations used for HL7v2 message input and output into an InterSystems IRIS data platform production.

Upon completion of this course, you will be able to:

  * Create new HL7v2 business services and business operations in production (both with file and TCP adapters).
  * Copy an HL7v2 component already in production.
  * Configure HL7v2 business services and business operations.

The first video shows how to configure the validation setting on an HL7v2 message router to validate HL7v2 messages in interoperability productions.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbmn2qo036saehxlqhrj.png)

The second video shows the HL7v2 routing rules in InterSystems IRIS for Health productions and how to use the rules editor to create a set of rules to evaluate incoming messages and route them to the appropriate downstream systems.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yi9dxepscffwl8jm6tgs.png)

The following two videos give you an overview of using rules in the business process.

The last exercise will check if you understood how to create a message router and define message routing rules within an HL7v2 production.

You will get hands-on experience on how to:

  * Create an HL7 V2 production.
  * Build a message router.
  * Define message routing rules within a production.

The **third step** consists of an online course, an exercise and a video:

  1. Course: [Data Transformations Basics](https://learning.intersystems.com/mod/url/view.php?id=6503) (1 hour)
  2. Exercise: [Building a Data Transformation](https://learning.intersystems.com/mod/url/view.php?id=9894) (15 minutes)
  3. Video: [Designing Custom Schemas](https://learning.intersystems.com/mod/url/view.php?id=6505) (3 minutes)

The course contains eight lessons and several quiz questions after each lesson.

This part will teach you how to create data transformations using the graphic interface of Management Portal, map fields, use functions to modify fields, and use literals as values for fields.

In the end, you will learn how to test and implement the transformation.

Upon completion of this course, you will be able to:

  * Explain possible reasons for using a data transformation.

<p style="margin-left: 40px;">
  A <em>data transformation</em> creates a target message based on a source message. Frequently, the resulting target message has both a different format and different data from the source.
</p>

  * Create a data transformation using the wizard in the Management Portal.
  * Describe when you would use two possible values of Create: `copy` and `new`.
  * Implement a function to change the value of a field.
  * Assign the value of a target field to a literal value.
  * Explain the difference between the `if` action and the `switch` action, and how to use them in your data transformations.
  * Test a data transformation.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/593gotqk7tuajg629k5p.png)

The exercise will check if you have understood how to create a data transformation in an HL7v2 production. At the end of this exercise, you will be able to:

  * Create a data transformation.
  * Test a data transformation.

The final video will show you when and how to design custom schemas within your productions to handle messages that do not meet HL7v2 standards.

The **fourth step** consists of 2 online courses and a video:

  1. Course: [Searching Messages Using the Message Viewer](https://learning.intersystems.com/mod/url/view.php?id=6506) (1 hour 30 minutes)
  2. Video: [Error Handling in HL7 Productions](https://learning.intersystems.com/mod/url/view.php?id=6507) (7 minutes)
  3. Course: [Introduction to Troubleshooting Productions](https://learning.intersystems.com/mod/url/view.php?id=6508) (30 minutes)

The first course contains four lessons and several quiz questions after each lesson.

This part will teach you how to navigate the Message Viewer and search for messages using information from the message header, message body, and message content.

Upon completion of this course, you will be able to:

  * Access and identify sections of the Message Viewer.

<p style="margin-left: 40px;">
  <em>Message Viewer</em> is a useful tool for searching messages in your system. For example, you can use the Message Viewer to find all messages from a local hospital in the last two hours or all bank transactions for a certain day.
</p>

  * Search for messages in the Message Viewer using base criteria, header fields, body properties, lookup table fields, and virtual document properties.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ufq1dv0aq8ekkrjsjg75.png) 

  * Resend messages.

The video will show you the troubleshooting options for HL7v2 productions in InterSystems IRIS for Health. You'll see how to use alerts to quickly resolve issues, how to handle bad messages and NACKs, and how to resend or suspend messages.

For example, we can add an alert in case of an error:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t2aukhimdoqht8hv8d16.png)

and see the reason for the error in the Event Log:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u5t5c4p8mu4v1sh54bgf.png) 

Additionally, we can add an alert if the incoming message is in the wrong format:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/omoiwwfyvcgevfzw0bi2.png) 

The final course contains five lessons and several quiz questions after each lesson.

This part will teach you how to troubleshoot productions, review locations and purposes of Management Portal pages to view logs, messages, queues and jobs.

Upon completion of this course, you will be able to:

  * Access the Management Portal pages: Configuration, Message Viewer, Event Log, Queues, and Jobs.
  * Find information to help with troubleshooting on the Management Portal pages.
  * Find information to help with troubleshooting in the Configuration page tabs: Log, Messages, Queue, and Jobs.

The **fifth and final step** is an exercise: [Building Your First HL7 Production](https://learning.intersystems.com/mod/url/view.php?id=6510) (1 hour 30 minutes).

The task is to move from a legacy system to InterSystems IRIS for Health and create a production HL7v2 based on a set of specifications, using an approach that creates an interface to generate the same messages as the old system.

At the end of this course, you will be able to:

  * Apply your knowledge of HL7v2 concepts to a real-world scenario.
  * Create your own HL7v2 production with InterSystems IRIS for Health.

I can say that this exercise requires more knowledge than was given during this training. But it is possible to open clues on how to do all the steps. Anyway, I found it very useful and instructive to do this last part. Made it a nice finishing touch to the 6+ hour experience.

If you are new to productions and/or HL7v2, this training will be a great first step. I totally recommend it.

As usual, if you have any questions about this topic or the training, feel free to ask them in the comments.

--

_Disclaimer: All images are taken from the mentioned videos/courses and are the intellectual property of InterSystems._