How to Configure BTAHL7 Configuration Explorer

A Party needs to be added to the BTAHL7 Configuration Explorer before Receive and Send Ports can work properly. The following process shows the location in the A01 message of the Party Name to be added and the steps to add the Party and configure acknowledgments.

Example A01Message: The highlighted Sending Application is the Party Name to be added.

  1. Open BizTalk Server Administration Console
  2. Expand BizTalk Group
  3. Right click Parties->New->Party
    1. Under General
      1. Rename Party1 to “SendingParty” from the example above
      2. Click Apply, Click OK
    2. Under Send ports
      1. Select “SendACKs” from the Name drop down list
    3. “SendingParty” is now located in Parties and Business Profiles
  4. Open BTAHL7 Configuration Explorer
    1. Located in Programs under Microsoft BizTalk 2013 Accelerator for HL7
    2. “SendingParty” is now Available to Configure
  5. Under Acknowledgement
    1. Select “Original Mode” for Acknowledgement type
    2. Click “Save”
  6. Under Validation
    1. Uncheck “Validate body segments”
      1. This will reduce the amount of errors the HL7 pipeline will pick up
    2. Click “Save”
  7. Restart the BizTalk Host Instance under Platform settings
  8. Drop the following ADT^A01 Sample file in the ReceiveADTA01Location:
    MSH|^~&|SendingParty|SendFac|ReceApp|RecFac|201307092343||ADT^A01|msgCtrId|P|2.5.1
    EVN|A01|198808181318||01
    PID|9|M11|M11||JOHN^DOE^A^JR||19310615|M||C|303 Test DRIVE^TestCITY^CO^81505|GL|(919)555-5555|(919)555-5555||M|A|M11|987654321|143257NC
    NK1|1|DOE^JANE^A|WIFE
    PV1|1|I|2000|A|||004777^SMITH^DAVID^SR|||SUR|||||A0
  9. Notice the Acknowledgment in the SendACKs folder
    1. MSA-1 is the type of Acknowledgment
      1. AA – Application Accepted
      2. AE – Application Error
        1. ERR segment will follow with Segment – field error information
      3. AR – Application Rejected
    2. MSA-2 is the Message Control Id and can be used to find the Original Message. It is located in MSH.10_MessageControlId

How to Set Up Ports in BizTalk for an ADT^A01 HL7 Message

DLLs need to be added to BizTalk to access artifacts in the ports. The following steps show how to add assemblies, set up ports to receive and send an HL7 message and send an acknowledgement which shows whether the message was accepted, produced an error or was rejected.

  1. Open BizTalk Server Administration Console
  2. Expand BizTalk Group
  3. Expand Applications
  4. Expand BizTalk Application1
    1. This is the Application set up for HL7
  5. Right Click “BizTalk Application1” Add->BizTalk Assemblies
    1. Click Add browse to the necessary assemblies
    2. Click OK
    3. Check “Overwrite all”
    4. Check “Add the Global assembly cache on add resource”
      1. Check this for each assembly, If adding multiple assemblies
    5.  Click OK
  6. Right Click Receive Ports-> New -> One-way Receive Port
    1. Rename ReceivePort1 to “ReceiveADTA01”
  7. Under Receive Locations Click New
    1. Under General
      1. Rename Receive Location1 to “ReceiveADTA01”
      2. Select “File” for Type
      3. Click Configure
        1. Browse to the location to receive ADTA01 flat file message
        2. Change the File mask to *.* or *.txt if this is the file extension of your message.
        3. Click Apply, Click OK
      4. Select “BTAHL72XReceivePieline” for the Receive Pipeline
        1. This is the HL7 Receive Pipeline for flat file messages
      5. Click Apply, Click OK
  8. Right Click Send Ports-> New Static One-Way Send Port
    1. Under General
      1. Rename “SendPort1” to “SendADTA01”
      2. Select “File” for Type
      3. Click Configure
        1. Browse to the to send Location
        2. Keep current File Mask
      4. Select “XML Transmit” for the Send Pipeline
      5. Click Apply, Click OK
    2. Under Filters
      1. Add the following Properties:
  9. Right Click Send Ports-> New Static One-Way Send Port
    1. Under General
      1. Rename “SendPort1” to “SendACKs”
      2. Select “File” for Type
      3. Click Configure
        1. Browse to the to send Location
        2. Change the File Mask to %MessageID%.txt
      4. Select “BTAHL72XSendPipeline” for the Send Pipeline
        1. This Pipeline will output a flat file ACK
    2. Under Filters
      1. Select the following Properties

How to Create an HL7 Project

An HL7 project requires you to include multiple schemas. The following steps show how to setup projects and retrieve all the schemas for your HL7 needs.

Be sure to rename each project something meaningful. Finally, sign each project in the Properties section before deploying DLLs to the BizTalk Administration Console.

  1. Open Visual Studio 2012
  2. Select New Project from the Start Page or File->New->Project
  3. Under BizTalk Project, Select “Empty BTAHL7 Project”
  4. Rename Solution “Sample.HL7.ADTA01”
  5. Right click the solution and Add->New Project
  6. Select “BTAHL7V251Common Project”
    1. This project includes the following schemas for version 2.5.1:
      1. Datatypes
      2. Segments
      3. Tablevalues
    2. Note: Build this project first
  7. Right click the solution and Add->New Project
  8. Select “BTAHL7V2XCommon Project”
    1. This project includes the MSH and ACK Schemas
    2. Note: if the Tutorial is installed you will not need to deploy this to BizTalk
  9. Right Click Project “Sample.HL7.ADTA01” Add->Existing Item
  10. Browse to C:Program Files (x86)Microsoft BizTalk 2013 Accelerator for HL7TemplatesSchemasV2.X2.5.1Patient AdministrationADT and Select “ADT_A01_251_GLO_DEF” Schema
  11. Right Click References ->Add Reference
  12. Select “BTAHL7V251Common Project1”

Example: ADT A01 message. MSH-12 is the version.

ADT A01 Schema Version 2.5.1

Installing the BizTalk 2013 HL7 Accelerator

The HL7 accelerator for BizTalk 2013 can be found in the install media for BizTalk (as shown in the following image).  Run the setup application in the BizTalk Accelerators folder.

Note, during installation, you may need to add features to your existing SQL Server installation (for example, if the “Starter Project” does not show under “Other Components”).  The SQL features should be:

The account you use for installation can be the administrator or service account that you’ve used to install/configure the core BizTalk engine.  If you use an administrator account, you will get the following error, which can be ignored:

Once accepted, you will see this screen:

Once you have completed the installation, you should see the following starter projects available in Visual Studio.  In future posts, we will look at creating and deploying HL7 solutions.

Mapping an 837P with an HL Looping Structure

Mapping an 837 can appear like a daunting task, especially when dealing with a large schema and the hierarchical looping that is associated with it. However, if you know some XSLT, you are already ahead of the game. In this example we will a proprietary XML format to an 837P and focus on the HL Looping structure.

You will notice the lack of mapping lines in this example. This is due to the fact that we are only mapping the header section with the BizTalk Mapper, and most of the functionality is rolled into custom scripting functoids.

In order to create our HL Looping we need a few things:

  • Variable to hold our counter
  • Function to increment our counter
  • Function to return our counter
  • Variable to hold our billing provider HL01(XSLT)
  • Variable to hold our subscriber HL01(XSLT)

These can all be located in one custom C# scripting functoid:

Billing provider HL01:

The first HL Loop is the billing provider. This is the easiest component.

Then we just call the GetHL01 function and hard code the rest.

Next up is the Subscriber loop:

XSLT breakdown:

  1. Incrementing our HL01 value
  2. Setting the parent ID number which for Subscriber is the Billing HL01
  3. Hard coding the HL03 value, 22 for subscriber
  4. Testing if there is a patient or not.
    1. In our proprietary format there is a patient flag, but if there is not a flag, you can simply test if there is a patient subordinate to the subscriber.
  5. Setting the current HL01 for the subscriber

Last is the Patient Loop:

XSLT breakdown:

  1. Increment the HL01 value
  2. Set the Parent ID which is ‘Subscriber’ for Patient
  3. Hard Code HL03 and HL04 Values