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:
- Incrementing our HL01 value
- Setting the parent ID number which for Subscriber is the Billing HL01
- Hard coding the HL03 value, 22 for subscriber
- Testing if there is a patient or not.
- 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.
- Setting the current HL01 for the subscriber
Last is the Patient Loop:
- Increment the HL01 value
- Set the Parent ID which is ‘Subscriber’ for Patient
- Hard Code HL03 and HL04 Values