The first step in developing an HL7 solution is getting the inbound data into the BizTalk message box. This entails having an understanding of the message types and versions that you will be processing. Once you know the message type and version that you will be using, you have all the information you need to configure and deploy the appropriate HL7 message schema. You can then receive, validate, and parse your messages into the BizTalk message box.
The HL7 schemas provided by the HL7 Accelerator were created directly from the HL7 organization’s HL7 v2.x message database. This means that the schemas you deploy out of the box in BizTalk Server match the HL7 organization’s version-specific definitions.
However, it is rare that an HL7 message will match the industry defined standard exactly. Although you can easily determine the message type and version you are processing, it is not likely that you will be aware of the exact differences between your particular data file and the industry standard. During your initial pass of HL7 data through BizTalk Server, those differences, if any, will be identified in detail via a message acknowledgement.
This section details how to configure BizTalk Server to process HL7 messages that comply with the defined HL7 message structure. Additionally, it addresses how to quickly and easily identify messages that do not exactly match the HL7 standards. For structurally compliant messages, you can begin accepting and processing HL7 data through BizTalk Server with minimal development.
For non-compliant messages, the next step is to customize the provided HL7 message schema as necessary for the interface. The next section details how to customize your HL7 v2 message schema.
Configuring a test solution allows you to immediately move data into BizTalk Server. During this process, all issues with non-standard compliant data are identified. Once identified, schemas can be customized as necessary. Since schemas are central to all BizTalk processes, this step is vital to the rapid development of an HL7 solution.
The steps to configuring a test HL7 solution are:
-
Deploy the necessary schema
-
Message header and acknowledgement schema
-
Dictionary schema
-
Message structure schema
-
Configure acknowledgements
-
Configure a receive location to use the HL7 Receive Pipeline
-
Configure send ports
-
Use the HL7 Send Pipeline
-
Use proper filters
The steps are detailed in the sections that follow, along with an explanation of why they are necessary. The explanations about the role of each development step help explain the necessary steps when customizing HL7 schema for non-standard compliant data. A sample test solution can be configured by following the step-by-step click-through instructions at the end of this section.
Deploying the Necessary HL7 Schema
As mentioned earlier, the HL7 Accelerator comes with 1300 predefined schemas to match every 2.X (2.1 through 2.4) message type. These schemas were generated from a Microsoft Access database that the HL7 organization provided, so they are considered “official” definitions.
However, when it comes to a version 2.X message, you rarely see an “official” message. Rather, individual interpretations of messages abound. To accommodate this reality without adding an excessive amount of complexity to the schema, the data fields, segments, and tables that identify looping structures are defined in separate schemas per version. They serve almost as a version-specific dictionary.
Individual message components are defined in “dictionary” schema.gif)
Note |
|---|
|
The current release of the HL7 Accelerator does not contain predefined schema for versions higher than v2.5. Handling higher versions is discussed in the “Customizing the HL7 v2 Schema” section. Future releases of the HL7 Accelerator will provide schema for versions higher than v2.5.
|
After they are defined, individual message schemas are created for each message type. These individual message schemas depict the necessary message structure. Message schemas then reference the dictionary schemas for common individual definitions. You can think of this as the same way a Microsoft Visual Studio® project might reference external assemblies to access classes. In fact, a BizTalk project, just like any other development project in Visual Studio, follows the same reference rules of object-oriented development.
Message schema depict the message structure and reference the dictionary schema for individual definitions.gif)
The benefit of this definitional separation is that message structures can be both globally and locally altered from the official standard. If you want to alter the definition of a segment or data field for every message that you process, alter the definitional schema. If you want to only vary from the standard for that particular message type, you can make the change locally in the message schema. The usability benefit of this definitional separation is that the message schemas are less complex, and thus easier to work with inside the mapping tool.
Because of the backward-compatibility rules, the version 2.5 MSH segment and acknowledgment (ACK) structures are appropriate for all prior versions. Furthermore, regardless of the specific HL7 version that you are processing, you will always have an MSH segment, and the engine will auto-generate acknowledgements. For this reason, separate schemas have been provided for the MSH segment and for HL7 acknowledgements in a version 2.5 format.
The Message header schema.gif)
To understand what needs to be deployed, take a look at the provided schemas. Starting with the premise, as discussed earlier, that both definitional and message structure schema are provided by version, it is necessary to deploy both of these schema types. Because the message structure schemas rely on the definitional schemas, it is necessary to make sure that the message structure schemas have the appropriate reference to the definitional schemas once deployed. Additionally, you will need to deploy the schemas that define the MSH segment and acknowledgements.
Deploy the Project That Contains MSH and ACK Schemas
To begin, in Solution Explorer in Visual Studio, open the predefined BizTalk HL7 project called BTAHL7V2XCommon Project. This contains the MSH and ACK schemas.
The BTAHL7V2XCommon Project contains schemas for the MSH segment and HL7 acknowledgments.gif)
Open a Visual Studio 2005 command prompt, go to C:\BizTalk HL7 Dev, and then run the following command:
sn -k MyKeyFile.snk
After creating and setting this required Assembly Key (.snk) file, deploy this project. This is a one-time step that is necessary for all of your HL7 processing because now the message header and acknowledgement schemas are available in the configuration database.
Note |
|---|
|
This project should only be deployed once. Once you have done it as part of your initial HL7 test solution, you will not need to perform this step again while you are using this particular message box.
|
Deploy the Version-Specific Definitional Schemas
Definitional schemas are provided for each of the 2.X versions in predefined BizTalk projects by version. You will need to deploy the appropriate project for the HL7 version that you are processing. In Solution Explorer, add an existing HL7 project. The projects are located under HL7 schema projects and are identified as BTAHL7V231Common Project, where the “V231” indicates the version number. When this opens in Solution Explorer, notice that three schemas—datatypes_231.xsd, segments_231.xsd, and tablevalues_231.xsd—are included in the project.
The BTAHL7V231Common Project contains the definitional schema referred to by all Version 2.31 message schemas.gif)
After applying the necessary Assembly Key (.snk) file, deploy this project. This is a one-time step that is necessary for all of your version 2.31 processing because now the definitional schemas referenced by all version 2.31 schemas are available in the configuration database.
Note |
|---|
|
This project should only be deployed once for each HL7 version. Once you have done it as part of your initial HL7 test solution for a particular version, you do not need to perform this step again while you are using this particular message box. If, however, you desire to test a different version, such as v2.4, you will need to repeat this step for the v2.4 Dictionary Schema.
|
Deploy Specific Message Schemas
Once the header, acknowledgement, and version-specific definitional schemas are deployed, configure and deploy message specific schema as necessary for your HL7 processing. In Solution Explorer, add an empty HL7 project. In this project, add a reference to the previously deployed project that contains the definitional schemas for the message version you are processing. For instance, if you are processing a Version 2.31 Admissions Discharge and Transfer (ADT) message, you would reference the Version2.31 Common Project that you just deployed.
Reference the version-specific definitional schema in your HL7 message project.gif)
Once the reference is added, add a message schema to this project for each message type that you are processing. To do this, add a new item to the project, selecting schemas under BTAHL7 Items. In the HL7 Schema Selector dialog box, select the version and message type that you want. For example, if you are processing a version 2.31 ADT^A01 message, select 2.31 for the version, ADT for the message type, and A01 for the trigger event. This adds the message definition schema to your project.
Select the version, message type, and trigger event code to add a message definition schema.gif)
Once you have added all of the message schema that you want, apply the necessary Assembly Key (.snk) file, and deploy this project. Once done, these are the schemas you will reference and use in your maps and orchestrations.
Note |
|---|
|
For ease of maintenance, it is a recommended practice to deploy your message schemas separately from maps and orchestrations.
|
Configuring Acknowledgements
The HL7 Disassembler (DASM) found in the HL7 Receive Pipeline automatically generates HL7 acknowledgements. However, if you do not configure BizTalk Server appropriately, the acknowledgements will sit unprocessed in the message box.
The HL7 Accelerator makes use of party definitions to associate acknowledgements to sending applications. A party is the means through which BizTalk Server uniquely identifies a sending application by associating the sending application’s identifier with the specific acknowledgement and batching configurations desired for that application.
Once a party has been defined, the BizTalk Accelerator for HL7 Configuration Explorer (accessed via the Start menu) is used to configure the type and format of the acknowledgements sent to that party. You need to add a party for each application that sends data into BizTalk Server. The party definition must contain the value that the particular application places in the MSH.3 field in the message header because that is how the parser matches the data to the party definitions.
Parties are defined and configured in BizTalk Explorer. To add a party, simply right-click the Parties tab within BizTalk Explorer under your configuration database, and then select Add New Party. Name the party something that is relevant to your processing. In the Aliases column, enter the value that occurs in the MSH.3 field in the message header.
Define a party for each application sending data into BizTalk Server.gif)
Once you have defined the party, you can configure the acknowledgements going to this party in the BizTalk Accelerator for HL7 Configuration Explorer.
The HL7 Configuration Explorer.gif)
To configure an acknowledgment, select the desired party on the Parties tab, and then click the Acknowledgment tab. The generated application acknowledgement details all areas where the received message does not match the schema. Use this to identify the parts of the schema that must be customized in order to process your desired message type.
The HL7 DASM can create three basic types of acknowledgements based on the configuration settings found in the HL7 Configuration Explorer:
-
Commit Acknowledgment, which basically informs the sending system that BizTalk actually received the message.
-
Application Acknowledgment, which identifies how BizTalk Server handled the message contents. It is in the Application Acknowledgment that you will see details on any parsing errors.
-
Static Acknowledgment, which is used when you want to always return a user-defined acknowledgment.
Both the Original and Enhanced Mode acknowledgment types will return an Application Acknowledgement (App ACK). The difference is that the Original Mode will only return an App ACK while the Enhanced Mode will return both an App ACK and a System ACK. For purposes of a test solution, you only need to set the acknowledgement type to Original.
Note |
|---|
|
Acknowledgment settings play a key role in how BizTalk Server interacts with your receiving system. Regardless of your ACK settings, the value in the MSH.15 of the inbound message determines whether an ACK will be generated. If there is nothing in the MSH.15, then your settings in here will determine behavior.
|
Acknowledgement settings in the HL7 Configuration Explorer.gif)
At the point that the ACK is being created, BizTalk Server is the acknowledging application; however, BizTalk Server theoretically acknowledges the message on behalf of the receiving application (the entity identified in the MSH.5 element). The default behavior is for the DASM to automatically switch the MSH.3 value in the incoming message to the MSH.5 element in the ACK. In this way, the automatically generated ACK will have an MSH that identifies the original receiving application (the MSH.5) as the now-sending application (the MSH.3). Likewise, the original sending application (the MSH.3) becomes the now-receiving application (the MSH.5) in the ACK. If you want to override this behavior, perhaps to identify BizTalk Server as the acknowledging application, you can enter desired MSH values on the Acknowledgment tab of the HL7 Configuration Explorer.
Acknowledgments will be discussed again later in this paper in regards to controlling message flow through BizTalk Server. However, at this point, you are using the ACK to identify any structural issues with your data. Therefore, for purposes of a test solution, you need only configure the system for application acknowledgements.
Configuring Validation Settings
At this point, the only validation setting that you need to consider is the Allow Trailing Delimiters setting found on the Validation tab of the HL7 Configuration Explorer. The default behavior of the HL7 DASM is to not expect to see delimiter values holding the place for optional elements that come at the end of a segment when those elements are not present. Basically, the standard states that segments should end after the last element that holds a value, as in the following example.
Message with no trailing delimiters
MSH|^~\&|HIS|MCM|NewSys||199601121005||ADT^A01|000001|P|2.3.1
EVN|A01|198808181123
PID|||PATID1234^5.0^M11~123456789^5
NK1|1>
However, it is quite common for sending applications to produce data that does contain delimiters between empty elements at the end of a segment, as shown in the following example. This is commonly referred to as trailing delimiters.
Message with trailing delimiters
MSH|^~\&|HIS|MCM|NewSys||199601121005||ADT^A01|000001|P|2.3.1
EVN|A01|198808181123|||
PID|||PATID1234^5.0^M11~123456789^5|||||||||
NK1|1|||||
Before running your test solution, you should look at your test file to determine if trailing delimiters are present. If they are, click the Validation tab in the HL7 Configuration Explorer for the correct party (the MSH.3 message value). On the Validation tab, select the Allow Trailing Delimiters check box. If trailing delimiters are not present, you do not need to configure this setting.
The HL7 Receive Pipeline
The BTAHL7 (BizTalk Accelerator for HL7) Receive Pipeline contains its own disassembler component (DASM) that reads the MSH segment to determine the message type and version. Based on this information, it then looks to the configuration database to locate the appropriate message schema that defines the message.
Armed with the schema that defines the structure, the data is then parsed, or disassembled, from its delimited structure and converted into XML for use by the BizTalk engine. As the data is disassembled, it is validated against the message schema. This all occurs within the disassembler component of the pipeline and is alternatively referred to as the BTAHL7 Disassembler. Unlike the default flat-file DASM that BizTalk Server provides, the HL7 one does not require that a schema be specified per pipeline.
Once the message is validated, the DASM also creates the appropriate acknowledgement of the message. More than one acknowledgement may be created, depending on the acknowledgement level that was configured for the party that sent the original message. As discussed earlier, the DASM will create system and application level message acknowledgements. These are created after validation by the BTAHL7 DASM component. Both the XML-ized message and acknowledgement are then published to the BizTalk message box where they will remain until subscribing systems pick them up.
The BTAHL7 Receive Pipeline is automatically deployed when you install the BizTalk Accelerator for HL7. Thus, there is out-of-the box functionality, meaning that you do not need to do anything special to use the pipeline in your HL7 receive locations.
Locations receiving HL7 data must use the BTAHL7 Receive Pipeline.gif)
However, functionally speaking, the BTAHL7 Receive Pipeline is simply a custom BizTalk pipeline. Because of this, you can re-use the DASM within your own custom pipelines and have the ability to add components before or after the DASM stage. This is useful if you need to preprocess the data before publication to the message box.
The HL7 Send Pipeline
Similar to the BTAHL7 Receive Pipeline, the BTAHL7 Send Pipeline uses the HL7 message schema to assemble, or serialize, and validate the structure of the data into a delimited flat-file before it is sent to subscribing systems. Essentially, the BTAHL7 Assembler (ASM) takes the XML document from the BizTalk message box and returns an HL7-encoded message.
As with the BTAHL7 Receive Pipeline, the BTAHL7 Send Pipeline is automatically deployed upon installation of the BizTalk Accelerator for HL7. The BTAHL7 Send Pipeline is used in all send port definitions that subscribe to HL7 data and require HL7 output.
Send Ports sending HL7 data must use the BTAHL7 Send Pipeline.gif)
As with the BTAHL7 Receive Pipeline, the BTAHL7 ASM can be re-used in your own custom send pipelines. A component added before the assembly stage affects the data while it is still in its XML form; a component added afterwards will occur once the data has already been serialized into an HL7-encoded message.
Configuring Send and Receive Ports
As the message passes through the HL7 DASM in the HL7 Receive Pipeline, one of two things happens to it. If the data matches the deployed HL7 schema, it is parsed into XML and placed in the message box. If the data does not match the deployed HL7 schema, it is passed through to the message box in its original form.
In both cases, if you have configured BizTalk Server to produce an acknowledgment, one will be generated and placed in the message box with the message. If the message was parsed, a positive ACK will be generated. If the data had structural errors (also referred to as parse errors) then a negative ACK (or NACK) will be generated.
Use the Application ACK to identify what, if any, schema changes are necessary to be able to process your message through BizTalk Server. If you receive an ACK, you do not need to alter the HL7 schema.
Positive Application Acknowledgement (ACK)
MSH|^~\&|NewSys||HIS|MCM|20061117155328||ACK^A01^ACK|100000|P|2.3.1|||NE
MSA|AA|000001
If you receive a NACK, it will contain details of what needs to be altered in your schemas to process your message through BizTalk Server. As you can see in the following example, the NACK contains an entry for every element and segment that is in error.
Negative Application Acknowledgement (NACK)
MSH|^~\&|NewSys||HIS|MCM|20061117155436||ACK^A01^ACK|100000|P|2.3.1|||NE
MSA|AE|000001
ERR|PV1_PatientVisitSegment^1^2^103&Table value not found&HL7nnnn
ERR|DRG_DiagnosisRelatedGroupSegment^1^11^unexpected data found
For example, the NACK just shown has identified that the second element in the first instance of the PV1 segment is in error because the value in the element does not match its restriction list. Furthermore, the DRG segment is in error because it is structurally incorrect—perhaps because the segment contains more elements than allowed or because the element contains components that it is not expected to have. These entries and their fixes are discussed in further detail in the “Customizing the HL7 v2 Schema” section that follows.
Because some sort of acknowledgment is dropped to the message box along with your message, whether good or bad, you need to have send ports that subscribe to:
-
The good HL7 message (assuming you wish to re-serialize it to an HL7 v2 format via the HL7 Send Pipeline).
-
The bad HL7 message (because it will have been unparsed and thus will fail serialization through the HL7 Send Pipeline).
-
The acknowledgement (one port can receive both ACKs and NACKs).
To configure a send port to receive the good HL7 message, use the HL7 Send Pipeline and a filter that looks for the original MSH.5 value, which is the value for the receiving system. You might also want to add a condition that says there were no parse errors.
Send Port filter for good messages.gif)
To configure a send port to receive any messages that fail validation, or bad messages, you will use the default PassThru Pipeline. This is because the message will not have been parsed into XML and by definition is not properly formed in the expected HL7 structure. You will see it produced to you in its original format. As a filter, set the condition to check for all messages that are both HL7 messages and have parse errors.
Send Port filter for bad messages.gif)
Finally, to configure a send port to receive your acknowledgments, use the HL7 Send Pipeline, and set a filter that looks for the original MSH.3 value in the MSH.5 position, since the ACK will reverse the original MSH.3 and MSH.5 values. So, for example, if the original message has an MSH.3 of HIS, the filter for the acknowledgment send port looks for HIS in the MSH.5 position.
Note |
|---|
|
A send port with the filter pictured in the following figure receives any message that has the value HIS in the MSH5.1 position. To guarantee that you only receive acknowledgment messages at this send port, add a filter for the ACK message type.
|
Send Port filter for acknowledgements.gif)
Once you have the send ports configured, you can create a receive port and receive location that will pick up the original message from a test file location. The only necessary configuration for the receive location is that you use the HL7 Receive Pipeline.
Receive Locations for HL7 data use the HL7 Receive Pipeline.gif)
Once you have configured your receive port and three send ports, enable, enlist, and start all. You are now ready to send your desired message through BizTalk Server by placing it in your receive location. Once the message is consumed, check to see if an ACK or NACK was generated. If an ACK was generated, there is no need to customize your schema. If a NACK was generated, compare the errors to the message to determine what values in the schema need to be altered to match your message format and structure.
When altering schema, it is a good idea to create custom schema that are specific by interface or vendor. The next section details how to customize the HL7 schema.
Note |
|---|
|
This approach presumes that your test data is similar to your production data. To ensure that your test solution mimics real life, to the extent possible, your test messages should be obtained from a production feed. This approach is meant to quickly identify necessary BizTalk schema customization. It is not meant to negate the need for developers to perform an initial message analysis and to understand the message specifications of the systems involved in the exchange.
|
Click-Through Steps for Configuring a Test Solution
The following steps detail how to configure a test solution.
To configure a test solution
-
Create a blank solution. A solution might include only one BizTalk project if the solution is relatively simple. A solution might include many BizTalk projects, if the solution consists of numerous projects that are developed independently and then must be integrated later.
-
Click Start, point to All Programs, point to Microsoft Visual Studio .NET 2005, and then click Microsoft Visual Studio .NET 2005.
-
On the File menu, point to New, and then select Project.
-
In the New Project dialog box, select Empty BizTalk Server Project template.
-
In the Name field, type ADT_Test as the solution name.
-
In the Location field type C:\BizTalk HL7 Dev.
-
In the Solution Name field type Test Solution.
-
Check the Create Directory for Solution box.
-
To open the new solution, click OK.
-
Add the HL7 2X Common Project to the solution. The schemas in this project are used by the Disassembler to determine which message type/version to validate against and to create the acknowledgment. This project is not version-specific, and is common to all message types. It must be deployed along with the version-specific schema projects you will create in a later step.
-
In Solution Explorer, right-click Test Solution, point to Add, and then select New Project.
-
In the Add New Project dialog box, navigate to BizTalk Projects.
-
In the Templates pane, select BTAHL7V2XCommon Project.
-
In the Name field, type BTAHL7V2XCommon as the project name and save into the C:\BizTalk HL7 Dev\Test Solution folder.
-
Click OK to open the new project.
Note |
|---|
|
In Solution Explorer, notice that three schemas (MSH_25_GLO_DEF.xsd, ACK_24_GLO_DEF.xsd and ACK_25_GLO_DEF.xsd) are included in the project.
|
-
Assign a Strong Key file to the project and deploy.
-
In Solution Explorer, right-click the BTAHL7V2XCommon project and select Properties.
-
In left pane of the BTAHL7V2XCommon Property Pages page, click Assembly.
-
In the right pane, scroll down to the Strong Name section, click the field to the right of Assembly Key File, and then click the ellipses (…).
-
In the Assembly Key File dialog box, navigate to C:\BizTalk HL7 Dev\MyKeyFile.snk, and then click Open.
-
To save changes, click OK.
-
Build and deploy the project.
-
In Solution Explorer, right-click the BTAHL7V2XCommon project, and then select Build. The build results are displayed in the Output window.
-
Right-click the BTAHL7V2XCommon project and select Deploy. The build results are displayed in the Output window.
-
On the File menu, select Save All to save your work.
-
Add the BTAHL7V231Common Project to the solution. The schemas in this project are common to all message types in version 2.3.1.
-
In Solution Explorer, right-click the Test Solution point to Add, and then select New Project.
-
In the Add New Project dialog box, navigate to BizTalk Projects.
-
In the Templates pane, select BTAHL7V231Common Project.
-
In the Name field type BTAHL7V231Common as the project name and save it to the C:\BizTalk HL7 Dev\Test Solution folder.
Click OK to open the new project.
In Solution Explorer, notice that three schemas (datatypes_231.xsd, segments_231.xsd, and tablevalues_231.xsd) are included in the project.
-
Assign a Strong Key file to the project.
-
In Solution Explorer, right-click the BTAHL7V231Common project and select Properties.
-
In left pane of the BTAHL7V231Common Property Pages page, click Assembly.
-
In the right pane, scroll down to the Strong Name section, click the field to the right of Assembly Key File, and then click the ellipses (…).
-
In the Assembly Key File dialog box, navigate to C:\BizTalk HL7 Dev\MyKeyFile.snk, and then click Open.
-
Click OK to save changes.
-
Build and deploy the project.
-
In Solution Explorer, right-click the BTAHL7V231Common project and select Build.
-
Right-click the BTAHL7V231Common project, and then select Deploy.
-
To save your work, on the File menu, select Save All.
-
Add a reference to the project that is going to contain the message structure schemas.
-
In Solution Explorer, select the ADT_Test project.
-
Right-click References, and then select Add a Reference.
-
In the References dialog box, click Projects tab, and then select BTAHL7V231Common.
-
Click OK to close the dialog box.
-
Add the message-specific schema to the project.
-
In Solution Explorer, select ADT_Test, right-click and select Add New Item.
-
In the Add New Item dialog box, select BTAHL7Schemas, in the Templates pane, click BTAHL7 Schemas, and then click Add.
-
From the Version drop-down menu, select 2.31. From the Message Type drop-down menu, select ADT. For Trigger Event, select A01. To add the schema to your project, select Finish.
-
To close the dialog box, select Cancel.
In Solution Explorer, notice that the ADT_A01_231_GLO_DEF.xsd schema has been added to the project.
-
Assign a Strong Key file to the project.
-
In Solution Explorer, right-click the ADT_Test project, and then select Properties.
-
In left pane of the ADT_Test Property Pages page, select Assembly.
-
In the right pane, scroll down to the Strong Name section, click the field to the right of Assembly Key File, and then click the ellipses (…).
-
In the Assembly Key File dialog box, navigate to C:\BizTalk HL7 Dev\MyKeyFile.snk, and then click Open.
-
To save changes, click OK.
-
Build and deploy the project.
-
In Solution Explorer, right-click the ADT_Test project, and then select Build.
-
Right-click the ADT_Test project, and then select Deploy.
-
To save your work, on the File menu, select Save All.
-
Create the necessary receive port and receive location to send the HL7 message through BizTalk Server.
-
Right-click Receive Ports, and then select Add Receive Port.
-
In the Create New Receive Port dialog box, click OK to accept the default One-Way Port receive port.
-
In the One-Way Receive Port Properties dialog box, type fromHIS in the Name box, and then click OK.
-
Right-click Receive Locations, and then select Add Receive Location.
-
In the Receive Location Properties dialog box, type ReceiveHIS in the Name box.
-
In the Transport Type box, select File from the drop-down list.
-
In the Address URI box, click the ellipses (…).
-
In the File Transport Properties dialog box, type C:\BizTalk HL7 Dev\Scenario Test Folders\fromHIS in the Receive Folder box. Change the file mask to *.txt and then click OK.
-
In the Receive Handler box, select BizTalkServerApplication.
-
In the Receive Pipeline box, select BTAHL72XPipelines.BTAHL72XReceivePipeline (Microsoft.Solutions.BTAHL7.HL72fDasm).
-
Click OK to close the Receive Location Properties dialog box.
-
Right-click the ReceiveHIS receive location, and then select Enable.
-
Create the necessary send ports to send the HL7 message through BizTalk Server and to capture the original message as well as the generated acknowledgment.
-
In BizTalk Explorer, right-click Send Ports, and then select Add Send Port.
-
To accept the default Static One-Way Port, click OK.
-
In the Static One-Way Send Port Properties page, type toNewSys in the Name box.
-
In the Transport Type box, select File from the drop-down list.
-
In the Address URI box, click the ellipses (…).
-
In the File Transport Properties dialog box, type C:\BizTalk HL7 Dev\Scenario Test Folders\toNewSys in the Destination Folder box. Next change the file mask extension to %MessageID%.txt and then click OK.
-
In the left pane, click the Send node.
-
In the Send Pipeline box, select BTAHL72XPipelines.BTAHL72XSendPipeline (Microsoft.Solutions.BTAHL7.HL72fAsm).
-
In the left pane, click the Filters & Maps>Filters node.
-
In the right pane, under the Properties column drop down, select BTAHL7Schemas.MSH3_1.
This is because, in the ACK, the MSH3.1 and MSH5.1 from the original message are switched.
-
Under the Operator column, select == and under the Value column, type the publishing system name of HIS.
Note |
|---|
|
This entry is case-sensitive and must match the MSH.3 value in the message.
|
-
To close the dialog box, click OK.
-
Right-click the toNewSys port, select Enlist, and then click Start.
-
In BizTalk Explorer, right-click Send Ports, and then select Add Send Port.
-
To accept the default Static One-Way Port, click OK.
-
In the Static One-Way Send Port Properties page, type ACKs in the Name box.
-
In the Transport Type box, select File from the drop-down list.
-
In the Address URI box, click the ellipses (…).
-
In the File Transport Properties dialog box, type C:\BizTalk HL7 Dev\Scenario Test Folders\ACKs in the Destination Folder box, change the file mask to %MessageID%.txt, then click OK.
-
In the left pane, click the Send node.
-
In the Send Pipeline box, select BTAHL72XPipelines.BTAHL72XSendPipeline (Microsoft.Solutions.BTAHL7.HL72fAsm).
-
Click OK.
-
In the left pane, click the Filters & Maps<Filters node.
-
In the right pane, under the Properties column drop down, select BTAHL7Schemas.MSH5_1. Then, under the Operator column, select ==. Finally, under the Value column, type the publishing system name of HIS.
-
To close the dialog box, click OK.
-
Right-click the ACKs port, select Enlist, and then click Start.
-
Add party definitions for the sending and receiving parties in the MSH.3 and MSH.5 fields.
-
In BizTalk Explorer, right-click Parties, and then select Add Party.
-
In the Add Party dialog box, type HIS as the name.
-
To close, click OK.
-
Repeat these steps to add another party definition named NEWSYS.
-
Configure the incoming party definition for the desired acknowledgment type.
-
Open the HL7 Configuration Explorer from Start>Programs>Microsoft BizTalk Accelerator for HL7 2.0>BTAHL7 Configuration Explorer.
-
In the Parties navigation panel, select HIS, and then navigate to the Acknowledgement tab.
-
Under Acknowledgement Type, select Original Mode.
-
Select Save.
-
Test the message for errors by sending through the system.
-
Copy the file C:\BizTalk HL7 Dev\Scenario test Folders\Test Data\HIS1_ADT^A01.txt to the receive location, C:\BizTalk HL7 Dev\Scenario Test Folders\fromHIS.
-
Move to C:\BizTalk HL7 Dev\Scenario Test Folders\toNewSys to see the processed message.
-
Move to C:\BizTalk HL7 Dev\Scenario Test Folders\ACKs to see the generated acknowledgment.
-
Repeat these steps for C:\BizTalk HL7 Dev\Scenario Test Folders\Test Data\HIS_ADT^A01x.txt. You will notice that no message appears in C:\BizTalk HL7 Dev\Scenario Test Folders\toNewSys. This is because the inbound message does not match the schema, so it is considered invalid. The ACK will indicate the errors: C:\BizTalk HL7 Dev\Scenario Test Folders\ACKs.
-
Open the BizTalk Server Administration console, and view the Windows Event Log.
-
Use the Windows Event Log and/or the Acknowledgement to determine which fields are in error.
-
Note that the error segment indicates that the PV1.2 element contains a value that is not in the element’s table. This means that the value in the message is not included in the list of restrictions for that field.
-
By selecting the PV1.2 element in the ADT_A01_231_GLO_DEF.xsd schema in the ADT_Test project and opening its properties window, you will notice that the field is limited by Table4.
-
Identify the needed schema changes.
-
Double-click the Tablevalues_231.xsd schema in the BTAHL7V231Common Project to open it.
-
Select Table4 in the schema and open its properties window. Notice that there is no ZZ in the list of allowed values.