This section addresses the first part of this common integration challenge through the creation of BizTalk Server components designed around receiving and processing an HL7 v2.4 ADT message into an HL7 v3 Add Person message.
To start our development process, we will focus on preparing BizTalk Server to correctly parse and validate the incoming HL7 v2.4 ADT^A28 message. Once you have installed the BizTalk Accelerator for HL7, you will have an HL7 receive pipeline already deployed into your configuration database. As shown in Figure 9 below, this is the pipeline that you will use to configure the receive location that will receive the incoming message. The HL7 receive pipeline has an HL7 Disassembler component that will parse the incoming message from its flat-file format into the XML format used internally by BizTalk Server.
Figure 9 - Receive location configuration using the HL7 receive pipeline
.gif)
Once the data is parsed, the HL7 Disassembler component will also validate the data against the HL7 v2.4 ADT^A28 schemas provided by the BizTalk Accelerator for HL7. That means that your first development step will be to deploy the HL7 v2.4 schemas that will be used by the accelerator when validating the message. Assuming that this is your initial development activity after installing the accelerator, there are three different projects that you will need to deploy in order to correctly parse and validate your data.
First, you must deploy the schema that defines the MSH segment of the data. During processing through the HL7 Disassembler, the HL7 v2.x message is separated into three distinct components:
-
Message header (as defined by the MSH segment)
-
Message body (as defined by the message schema provided with the accelerator)
-
Z segments (which the user can opt to define through a custom schema for parsing purposes)
Deploy the MSH segment schema
The MSH segment is used to identify the correct message body schema to use to validate the message. This schema must be deployed initially upon accelerator installation as it will be used for all of your HL7 v2.x processing. To deploy it, add a new project to your solution. Into the project add a new item. The MSH schema is contained in a project in the HL7 Projects category called the BTAHL7V2XCommon project (as shown in Figure 10 below).
Figure 10 -The BTAHL7V2XCommon project contains the MSH segment schema
.gif)
After creating and setting a 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 acknowledgment schemas are available in the configuration database.
Deploy the v2.4 message body schemas
The second step you must perform to configure BizTalk Server to process your HL7 v2.4 message is to deploy the necessary schemas so that the message body can be correctly validated. This entails two steps:
-
Deploying definitional schemas used to define the data types, segments, and tables found in the message body
-
Deploying the actual schema that defines the particular message body structure, such as the HL7 v2.4 ADT^A28 structure in this case
These two steps are necessary because, when it comes to HL7 v2.x, individual interpretations of messages abound. To accommodate this, the data fields, segments, and tables identifying looping structures are defined in separate schema files per version to serve almost as a version-specific dictionary. See Figure 11 below.
Figure 11 - Dictionary schemas are used for each v2.x version
.gif)
Then, individual message schemas are created for each message type. As seen in Figure 12 below, 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 may 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 any object-oriented development.
Figure 12 - The message structure schemas for an HL7 v2.4 ADT^A28 message
.gif)
In order to fully configure the accelerator to correctly parse your HL7 v2.4 message, you will need to deploy the project containing the HL7 v2.4 dictionary schemas as well as deploy a project containing the HL7 v2.4 ADT^A28 message schemas.
Deploy the HL7 v2.4 dictionary schema
Definitional schemas are provided for each of the HL7 2.x versions in predefined BizTalk projects by version. You will need to deploy the appropriate project for the HL7 version you are processing. In Solution Explorer, add a new HL7 project. The projects are located under HL7 schema projects and the one you need to add is identified as BTAHL7V24Common Project, where the “V24” indicates the version number. When this opens in Solution Explorer, notice that three schemas—datatypes_24.xsd, segments_24.xsd, and tablevalues_24.xsd—are included in the project. See Figure 13 below.
Figure 13 - The BTAHL7V24CommonProject contains the dictionary schemas that must be deployed
.gif)
After applying the necessary assembly key (.snk) file, deploy this project. This is a one-time step that is necessary for your entire HL7 v2.4 processing because now the definitional schemas referenced by all HL7 v2.4 schemas are available in the configuration database.
Deploy the HL7 v2.4 ADT^A28 message schema
Once the header and version-specific definitional schemas are deployed, you will configure and deploy message-specific schemas as necessary for your HL7 processing. In Solution Explorer, add an empty HL7 project as a new project. In this project, you will add a reference to the previously deployed project containing the definitional schemas for the message version you are processing. For instance, since you are processing an HL7 v2.4 ADT message, you will reference the Version2.4CommonProject you just deployed, as seen in Figure 14 below.
Note |
|---|
|
For purposes of the solution provided with this paper, the message schemas have been placed in a project called HL7_v2_to_v3_Conversion \ADT_A28_24_Conversion and they reference the BTAHL7V24CommonProject. |
Figure 14 - The project containing your message schemas will reference the previously deployed dictionary schema project
.gif)
Once the reference is added, you will add a message schema to this project for each message type you are processing. To do this, add a new item to the project, selecting BTAHL7Schemas under BizTalk Project Items in the category pane of the Add New Item dialog box. In the schema selection dialog box, select the version and message type you are interested in. As shown in Figure 15 below, since you are processing a version 2.4 ADT^A28 message, select 2.4 for the version, ADT for Message Type, and A28 for the Event Type, and then select Finish. This will add the message definition schema to your project. The HL7 Schema Selector dialog box will remain open for you to add other schemas into this project. Because this is the only v2 schema we need, select Cancel to close the dialog box.
Figure 15 - When adding an HL7 schema to a project, the HL7 schema selector helps you choose the desired schema
.gif)
Once you have added a message schema for each message type that you are processing, apply the necessary assembly key (.snk) file and deploy this project. Once done, these are the schemas you will reference and use in your HL7 v2.4 maps and orchestrations.
Configuring BizTalk Server to process the HL7 v3 outgoing message
Because HL7 v3 is encoded as XML you do not need the BizTalk Accelerator for HL7 to process HL7 v3 messages. Rather, you will need to simply add an XSD for the message type you desire to a BizTalk project and then deploy them.
As discussed earlier, it will take multiple schemas to support the HL7 v3 message. The schemas will need to be placed in the same directory. Also, they will need to be edited, as detailed above, so that they include the message specification namespace and so that the includes statements are accurate since the schemas will all be in the same directory.
The schemas used to build the sample scenario provided with this paper came from the HL7 Normative Edition 2006. Figure 16 below shows the schemas used to define our HL7 v3 Add Person message, located in the HL7_v2_to_v3_Conversion \PRPA_IN101001_SchemaSet project called PRPA_IN101001UV01.xsd.
Figure 16 - v3 Add Person message incident schemas
.gif)
In the next step, you will use a BizTalk Server map to translate the HL7 v2.4 data into the HL7 v3 message format. Maps require you to declare both a source and destination schema. You will need to use the HL7 v3 schema for the appropriate message incident as your destination schema.
Deploy the HL7 v3 message schemas
To deploy the schemas, add a new project to your solution. You will use the Add an Existing Item menu selection to add the necessary HL7 v3 schemas (the message incident and all referenced schemas) into your project.
To reproduce this scenario on your own, the PRPA_IN101001UV01 schema and all the referenced schemas for the message type are contained in the project located at HL7_v2_to_v3_Conversion \PRPA_IN101001_SchemaSet so you will simply add that project as an existing project into your Visual Studio solution and make certain to reference the project in the project containing your map. After applying the necessary assembly key (.snk) file, deploy this project.
Configure and deploy a map creating the HL7 v3 message structure
As mentioned earlier, you will use a BizTalk Server map to create the HL7 v3 message structure from the incoming HL7 v2.4 message format. Now that you have deployed your source and target schemas, you are ready to create a map, according to the following steps. The HL7 v3 message will require information to be mapped from the MSH segment of the incoming HL7 v2.x message as well as the rest of the included body segments.
Because the HL7 Disassembler breaks the MSH segment from the body segments of the incoming HL7 v2.x message, mapping values from the MSH segment and the other body segments at the same time will require creating the map from within an orchestration. The detailed click-through steps that follow this section describe the necessary configuration steps.
In short, you need to define your source and destination schemas for the map. The two source schemas will be the HL7 v2.4 message structure (ADT_A28_24_GLO_DEF.xsd and MSH_24_GLO_DEF.xsd) and the destination schema will be the HL7 v3 message incident schema (PRPA_IN101001UV01.xsd).
Note |
|---|
|
For purposes of this scenario, the project included with this white paper at HL7_v2_to_v3_Conversion \ADT_A28_24_Conversion contains an orchestration called CreatePRPA_IN101001UV01.odx and a map called MapPRPA_IN101001.btm, and has all the necessary references to the HL7 v2.4 and HL7 v3 schema projects. If you wish to use this project, you will need to add it to your Visual Studio .NET solution and update the references as necessary. You can download the project by clicking here. |
Figure 17 - v24ORM_to_V3ObsvReqst.btm
.gif)
Figure 17 above shows the map used to create an HL7 v3 Add Person message from an HL7 v2.4 ADT^A28. The map is only a small sampling of the actual mapping that would need to be performed to completely create the HL7 v3 data structure from an HL7 v2.4 ADT. For ease of reference, it is meant to serve as a sampling of the mapping techniques that would be used to create a complete structure.
To fully configure your map, you will locate the incoming data fields in the HL7 v2.4 message and drag and drop them into the proper location in the HL7 v3 message structure. Because of the strict coding and structure rules of the HL7 v3 format, some of your map rules will require hard coding of values while some will require you to evaluate the incoming field for a certain value before you conditionally create an outgoing value.
To hard code a value, access the Properties window for the element and enter the desired text into the Value row in the Properties window. To evaluate incoming data to conditionally create output data, you will use a combination of a logical functoid and a value mapping functoid.
Basically, with the exception of the simplest maps, you’ll use functions such as logical evaluation and value mapping, string manipulation, database access, and others to create the required HL7 v3 structure. These functions, called functoids in BizTalk Server, can be found in the Toolbox and inserted into the map grid between the source and target panes.
It is worth noting that functoids can be chained so that the output of one functoid can be the input to another. If you cannot locate a functoid that meets your specific needs, you can always utilize the script functoid. The script functoid is an open-ended functoid that will allow you to write in-line code in C#, Visual Basic® .NET, J#, or even XSLT. Script functoids can also call code from referenced assemblies.
The enclosed sample map utilizes basic source to destination data element pointers created through dragging and dropping while some destination values are simply hard coded. Finally, some logical and value mapping functoids are utilized to evaluate the input data to conditionally create the HL7 v3 data element.
The following chart depicts the mapping specifications followed to create the HL7 v3 structure in the included MapPRPA_IN101001.btm map. The chart describes the values that were mapped from the HL7 v2 message to create the HL7 v3 message. However, it should be noted that most of the necessary values that compose an HL7 v3 message are hard coded into the structure because they are values that do not exist in the HL7 v2 structure. Those values can be seen in the created HL7 v3 message that follows the chart.
|
From
|
To
|
| '<Schema>' 'Root' 'InputMessagePart_0' 'MSH_24_GLO_DEF' 'MSH' 'MSH.7_DateTimeOfMessage' 'TS.1' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'creationTime' '<Equivalent>' '<TS>' 'value' |
| '<Schema>' 'Root' 'InputMessagePart_0' 'MSH_24_GLO_DEF' 'MSH' 'MSH.8_Security' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'securityText' '<Equivalent>' '<ST>' '<Sequence>' 'reference' 'value' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_11_PatientAddress' 'XAD_2_City' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' 'addr' '<Sequence>' '<Choice>' 'city' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_11_PatientAddress' 'XAD_3_StateOrProvince' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' 'addr' '<Sequence>' '<Choice>' 'state' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_11_PatientAddress' 'XAD_4_ZipOrPostalCode' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' 'addr' '<Sequence>' '<Choice>' 'postalCode' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_11_PatientAddress' 'XAD_5_Country' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' 'addr' '<Sequence>' '<Choice>' 'country' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_13_PhoneNumberHome' 'XTN_0_9999999999X99999CAnyText' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' 'telecom' 'value' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'EVN_EventType' 'EVN_2_RecordedDateTime' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'effectiveTime' '<Choice>' 'high' 'value' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'EVN_EventType' 'EVN_2_RecordedDateTime' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'authorOrPerformer' 'time' '<Choice>' 'high' 'value' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'EVN_EventType' 'EVN_3_DateTimePlannedEvent' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'authorOrPerformer' 'time' '<Choice>' '<Sequence>' and position()='1' 'low' 'value' |
| '<Schema>' 'Root' 'InputMessagePart_0' 'MSH_24_GLO_DEF' 'MSH' 'MSH.13_SequenceNumber' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'sequenceNumber' '<Equivalent>' '<INT>' 'value' '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'processingCode' 'code' |
| '<Schema>' 'Root' 'InputMessagePart_0' 'MSH_24_GLO_DEF' 'MSH' 'MSH.11_ProcessingId' 'PT.0_ProcessingId' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'processingCode' 'code' |
| '<Schema>' 'Root' 'InputMessagePart_0' 'MSH_24_GLO_DEF' 'MSH' 'MSH.11_ProcessingId' 'PT.1_ProcessingMode' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'processingModeCode' 'code' |
| '<Schema>' 'Root' 'InputMessagePart_0' 'MSH_24_GLO_DEF' 'MSH' 'MSH.15_AcceptAcknowledgmentType' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'acceptAckCode' 'code' |
| '<Schema>' 'Root' 'InputMessagePart_0' 'MSH_24_GLO_DEF' 'MSH' 'MSH.5_ReceivingApplication' 'HD.0_NamespaceId' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'receiver' '<Group:InfrastructureRootElements>' 'typeId' 'assigningAuthorityName' |
| '<Schema>' 'Root' 'InputMessagePart_0' 'MSH_24_GLO_DEF' 'MSH' 'MSH.3_SendingApplication' 'HD.0_NamespaceId' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'sender' '<Group:InfrastructureRootElements>' 'typeId' 'assigningAuthorityName' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'EVN_EventType' 'EVN_2_RecordedDateTime' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'effectiveTime' 'value' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_19_SsnNumberPatient' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' '<Group:InfrastructureRootElements>' 'typeId' 'extension' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_3_PatientIdentifierList' 'CX_0_Id' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' '<Group:InfrastructureRootElements>' 'templateId' 'extension' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_11_PatientAddress' 'XAD_0_StreetAddressSad' 'XAD_0_0_StreetOrMailingAddress' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' 'addr' '<Sequence>' '<Choice>' 'streetAddressLine' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_11_PatientAddress' 'XAD_0_StreetAddressSad' 'XAD_0_1_StreetName' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' 'addr' '<Sequence>' '<Choice>' 'streetAddressLine' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_11_PatientAddress' 'XAD_0_StreetAddressSad' 'XAD_0_2_DwellingNumber' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' 'addr' '<Sequence>' '<Choice>' 'streetAddressLine' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_5_PatientName' 'XPN_0_FamilyName' 'XPN_0_0_Surname' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' '<Choice>' 'assignedPerson' 'name' '<Equivalent>' '<EN>' '<Sequence>' '<Choice>' 'family' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_5_PatientName' 'XPN_0_FamilyName' 'XPN_0_1_OwnSurnamePrefix' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' '<Choice>' 'assignedPerson' 'name' '<Equivalent>' '<EN>' '<Sequence>' '<Choice>' 'prefix' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_5_PatientName' 'XPN_1_GivenName' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' '<Choice>' 'assignedPerson' 'name' '<Equivalent>' '<EN>' '<Sequence>' '<Choice>' 'given' |
| '<Schema>' 'Root' 'InputMessagePart_1' 'ADT_A28_24_GLO_DEF' 'PID_PatientIdentification' 'PID_5_PatientName' 'XPN_3_SuffixEGJrOrIii' | '<Schema>' 'PRPA_IN101001UV01' '<Sequence>' 'controlActProcess' 'subject' 'registrationEvent' 'author' 'assignedEntity' '<Choice>' 'assignedPerson' 'name' '<Equivalent>' '<EN>' '<Sequence>' '<Choice>' 'suffix' |
Below is the created HL7 v3 message that shows all the values that must be directly created in the HL7 v3 structure because they do not exist in the HL7 v2 structure:
<?xml version="1.0" encoding="utf-8" ?>
<ns0:PRPA_IN101001UV01 xmlns:ns0="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns0:id xsi:type="ns0:II" root="2.16.840.1.113883.19.3.2409" extension="1-976-245" displayable="true" />
<ns0:creationTime xsi:type="ns0:TS" value="199601121005" />
<ns0:securityText xsi:type="ns0:ST">
<ns0:reference value="" />
</ns0:securityText>
<ns0:versionCode code="V3PR1" />
<ns0:interactionId xsi:type="ns0:II" root="2.16.840.1.113883.19.3.2409" extension="1-976-245" assigningAuthorityName="HL7" displayable="true" />
<ns0:profileId xsi:type="ns0:II" root="2.16.840.1.113883.19.3.2409" extension="1-976-245" displayable="true" />
<ns0:processingCode code="P" codeSystemVersion="2.4" />
<ns0:processingModeCode />
<ns0:acceptAckCode />
<ns0:sequenceNumber xsi:type="ns0:INT" />
<ns0:attachmentText xsi:type="ns0:ED" mediaType="text/plain">
<ns0:reference value="This is a brief note." />
< </ns0:attachmentText>
<ns0:receiver typeCode="RCV">
<ns0:typeId assigningAuthorityName="NewSys" displayable="true" />
<ns0:device classCode="DEV" determinerCode="INSTANCE" />
</ns0:receiver>
<ns0:sender>
<ns0:typeId assigningAuthorityName="HIS" displayable="true" />
</ns0:sender>
<ns0:controlActProcess classCode="INFO" moodCode="CODE">
<ns0:id xsi:type="ns0:II" root="2.16.840.1.113883.19.3.2409" extension="1-976-245-000" displayable="true" />
<ns0:code xsi:type="ns0:CE" code="PRPA_TE101001" codeSystem="2.16.840.1.113883.5.4" codeSystemName="ActCode" displayName="routine">
<ns0:originalText xsi:type="ns0:ST" representation="Person Event Activate Notification" />
</ns0:code>
<ns0:effectiveTime>
<ns0:high value="198808181123" inclusive="true" />
</ns0:effectiveTime>
<ns0:priorityCode xsi:type="ns0:CE" code="R" codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority" displayName="routine" />
<ns0:authorOrPerformer contextControlCode="AP">
<ns0:time>
<ns0:low inclusive="true" />
<ns0:high value="198808181123" inclusive="true" />
</ns0:time>
<ns0:modeCode xsi:type="ns0:CE" code="PHYSICAL" codeSystem="2.16.840.1.113883.5.1064" codeSystemName="ParticipationMode" displayName="physical presence" />
</ns0:authorOrPerformer>
<ns0:subject contextConductionInd="true">
<ns0:registrationEvent>
<ns0:id xsi:type="ns0:II" root="2.16.840.1.113883.19.3.2409" extension="1-976-245-000" displayable="true" />
<ns0:statusCode code="active" />
<ns0:effectiveTime value="198808181123" />
<ns0:author>
<ns0:typeId root="2.16.840.1.113883.19.4.1" extension="111-222-3333" displayable="true" />
<ns0:templateId extension="PATID1234" displayable="true" />
<ns0:templateId extension="123456789" displayable="true" />
<ns0:assignedEntity>
<ns0:id xsi:type="ns0:II" root="2.16.840.1.113883.19.3.2409" displayable="true" />
<ns0:addr use="HP">
<ns0:country />
<ns0:state>IL</ns0:state>
<ns0:city>Metropolis</ns0:city>
<ns0:postalCode>60069</ns0:postalCode>
<ns0:streetAddressLine>123 Center St</ns0:streetAddressLine>
</ns0:addr>
<ns0:telecom value="8665551234" use="H" />
<ns0:assignedPerson>
<ns0:name xsi:type="ns0:EN">
<ns0:family>SMITH</ns0:family>
<ns0:given>HARRY</ns0:given>
<ns0:prefix />
<ns0:suffix>III</ns0:suffix>
</ns0:name>
</ns0:assignedPerson>
</ns0:assignedEntity>
</ns0:author>
</ns0:registrationEvent>
</ns0:subject>
</ns0:controlActProcess>
</ns0:PRPA_IN101001UV01>
When developing your own map, before you build the map, you will need to edit the XSLT and set the GenerateDefaultFixedNode attribute to “no” (as described earlier). If you are using the provided map, this flag is already set correctly.
Once you are satisfied with the map output, you will add the necessary assembly key (.snk) file and deploy the map project. Once deployed, you will want to refresh the configuration database to ensure your access to the maps in the next configuration steps.
Using an orchestration to create a map with multiple input schemas
To configure an orchestration to accept the three parts of an HL7 v2.4 structure that the HL7 Disassembler creates, you will need to add a new item to your project and then add an orchestration. You will also need to add a reference to the Microsoft.Solutions.BTAHL7.HL7Schemas.dll that is located in <HL7 Accelerator install directory>:\Program Files\Microsoft BizTalk Accelerator for HL7 2.0\Bin.
Finally, you will need to add a reference to the BTAHL72XCommonProject because it contains the MSH schema. You will need to access this schema in the map that you are creating in this orchestration.
Note |
|---|
|
The orchestration provided in the HL7_v2_to_v3_Conversion \ADT_A28_24_Conversion project is called CreatePRPA_IN101001UV01.odx. |
There are many necessary configuration steps involved in designing an orchestration. The following chart depicts the steps necessary to receive an HL7 v2.4 message into an orchestration and call a map to transform the HL7 v2.4 data into an HL7 v3 message structure. In the map, you will have access to both the MSH and body segments components of the HL7 v2.4 message.
Use the following procedure to configure the orchestration.
To configure the orchestration
-
Add a Receive shape to the orchestration. Name it "ReceiveADTA28" and set the Activate property to True.
-
Add a Message Assignment shape under the Receive shape. Name the outer Construct shape "ConstructMSH". Name the Assign shape "AssignMSH".
-
Add another Message Assignment shape under the ConstructADTA28Body shape. Name the Construct shape "ConstructADTA28Body" and name the Assignment shape "AssignADTA28Body".
-
Add a Transform shape under the ConstructV3Msg shape. Name the outer Construct shape "ConstructV3Msg". Name the Transform shape "MapPRPA_IN101001".
-
Add a Send shape under the ConstructV3Msg shape. Name it "SendV3Msg".
-
In the Orchestration View window, add the Message definitions you need.
You will need four message definitions:
-
PRPA_IN101001 = PRPA_IN101001UV01.xsd
-
ADTA28_body = ADT_A28_24_GLO_DEF.xsd
-
MSH_Msg = MSH_24_GLO_DEF.xsd
-
CompleteADTA28 = will configure after next step
-
In the Orchestration View window, move under Types and add a Multi-Part Message Type called "CompleteADTA28Type".
Expand the entry and change the Identifier on MessagePart_1 to MSHSegment. Then, add two more message parts called "BodySegments" and "ZSegments".
In the Properties for BodySegments, set BodyPart = True.
-
In the Properties window for BodySegments, under Type, select Schemas, <Select from referenced assembly> to select ADT_A28_24_GLO_DEF.xsd.
-
In the Properties window for MSHSegment, under Type, select Schemas, <Select from referenced assembly> to select MSH_24_GLO_DEF.xsd.
-
In the Properties window for ZSegment, under Type, select .NET Classes, and then click System.String from the drop-down list.
-
Move to the Messages entry, select CompleteADTA28 and open its Properties window. Click Message Type, expand Multi-part Message Types, and then click <ProjectName>.CompleteADTA28Type.
-
To configure your orchestration shapes, assign the following messages to the appropriate shape:
-
Receive = CompletevADTA28
-
ConstructMSH_Msg = MSHMsg
-
ConstructADTBodyMsg = ADA28_body
-
Constructv3AddPerson = PRPA_IN101001
-
Sendv3AddPerson = PRPA_IN101001
-
Move into the properties window for the Transform shape. Select the ellipses in the MapName line. In the Map Dialog box, select New Map. Configure the Source and Destination messages as follows:
-
The Source variable = Click in the first line and select MSHMsg. Then, click in the next line down and select ADTA28_body.
-
The Destination variable = PRPA_IN101001
Notice that the Open Mapper check box is selected. When you select OK to close the dialog box, BizTalk Server will create a map for you that uses a combined schema for both input messages as your source schema.
-
Move into the newly created map and follow the previously detailed mapping specifications.
-
Create the necessary ports you need for the orchestration.
When complete, your orchestration should look like Figure 18 below, as provided in the HL7_v2_to_v3_Conversion \ADT_A28_24_Conversion project is called CreatePRPA_IN101001UV01.odx.
Figure 18 – Orchestration creating an HL7 v3 message – the CreatePRPA_IN101001UV01.odx
.gif)
Once you have configured your orchestration, you are ready to build and deploy it. Once deployed, you will create a receive port/location that receives the HL7 v2.4 data. The receive location will use the HL7 receive pipeline. You will also create a send port that sends the HL7 v3 message to your target application. Because the HL7 v3 message will be XML, you will configure the send port to use the XMLTransport pipeline provided with BizTalk Server. Next, bind the orchestration to your receive and send ports, and then enlist and start the orchestration.
Note |
|---|
|
In order to keep the focus in this example on necessary BizTalk Server artifact configuration, the example is file based. A complete interface will need to take into account reliable messaging concepts and will most likely include Web service calls. |
You are now ready to test the scenario. To do this, place a sample HL7 v2.4 file into the receive location you configured. You should see an HL7 v3-formatted message appear in the file location specified in your send port.
Note |
|---|
|
To test the scenario with the artifacts included with this paper (http://go.microsoft.com/fwlink/?LinkId=100621), open the HL7_v2_to_v3_Conversion solution, make sure that all HL7 v2.4 and HL7 v3 schema references are updated, and then build and deploy. |