Dec 152009

I have been thinking of BizTalk healthcare classes or writing a book for BizTalk in relation to healthcare, viagra adiposity and I thought that I would put the things that I would look for if I was going to pay for a class or heaven forbid; buy a morbid book.

1. The teacher/writer has to have healthcare experience.

2. I want to have a brief understanding of the ‘flow’ of document in a healthcare situation:

     837 (Claims) are submitted to a health plan for payment
     997 (Acknowledgments) are returned to know if they pass Type 1 and Type 2 validation
     824 (Application Notification) can be returned for Type 3 through Type 7 validation, illness depending on the capability of the backend system
     835 (Claim Status) are sent back to notify of Claim status
     270 (Eligibility Request) are sent to health plan to ask for status of patient eligibility for service
     271 (Eligibility Response) are sent from health plan in response to patient eligibility request
     276 (Claim Status Request) are sent to health plan to as for status of claim
     277 (Claim Status Response) are sent from health plan to in response of claim request
     820 (Payment Notification) are sent from the health plan to notify of payment of the claims
     834 (Eligibility) are sent for notification of eligibility

3. I want to map a 837, as that will be the transaction I will most deal with, spend a majority of the the time mapping the 837 transaction if I have to, because that is my biggest pain point.

4. Explain HL7, where it is used

    Provider transactions, largely used in intra department messaging

5. Create a sample ORU^R01 message from a flat file and create a flat file from a ORU^R01 message so I can learn the following HL7 nuances:

    Schema Generation (partner specific schema creation)
    Multipart Messages 
    MSH Segment 
    How to map the flat XML message that the BTAHL7 pipeline (DASM) creates / (ASM) expects 
    Explain MLLP, integrate it into one of the ORU labs

Things I want to briefly want to learn:

    (I need to know what they are, but it should not be the focus of a the class/book)

Things I don’t want to learn:

BAM: BizTalk in a Healthcare Scenario should never be the system of record, the Claim Payment application should be, the out-of-the-box EDI reporting functionality that comes with BizTalk accounts for 99% of what I need
BRE: BizTalk would not be used for message modification/routing/anything else the BRE can be used for, as there are entire workflows designed in every claim payment processing system that deals with changing business rules
AS2: It is too big of a beast to teach along with all of the things that I listed above, and second: NO HEALTHCARE COMPANY TRANSMITS DATA USING AS2
Purchase Orders, Invoices, Advanced Shipment Notifications: I can look at a whole plethora of examples that Microsoft publish. Maybe a MCO deals with ordering supplies for an office, but by in large, I want to know about HIPAA transactions; not transactions I would never see at work.

Anything that I missed? I am thinking of putting together an online class (or via CD) or a book, what would you like to see? Is there any interest in a BizTalk/Healthcare book?

Tell me your experiences!

Jun 182008

I finally was able to start working with BizTalk R2, and we do HIPAA/EDI. Within hours of ‘playing’ with it, I was SHOCKED! How did this get out the door?! Who signed off saying this solves anyone’s EDI integration problems?

Okay — so you are right — it allows the EDI shop to be able to handle eleventeen million different transactions out of the box, yes that is cool, and actually quite useful.

However, the part that keeps me up at night is not: “how am I going to translate this transaction?” but “what happened to this file yesterday, or the other file two weeks ago?”

I had gone to plenty of MS conferences where during the beta bits were shown and the reporting was going to be done using BAM, “cool” I thought, if MS is going down the BAM trail, I should too, so my whole paradigm of reporting changed and now I am an even bigger proponent of BAM.

Once I started playing with the R2 bits, maybe hour two, I was scratching my head, where was all of this famed reporting?

Let me not bore you too much with what R2 has for reporting, I will bullet list the things I required that are not present in the current reporting architecture

Error information in a repository that associated the file with the error

I am not a big fan of reading through the event log to try to find the message that failed and then equally tasking process of finding the event log entry that actually tells me what the error actually is. Even MS was not correct when they stated that the BizTalk 2006 Server message id error and the corresponding BizTalk Server 2006 EDI error are paired together:



Being able to associate the TA1/997 to the original message.

Yes, I know that there is a column in the BAM tables to associate it, but it is not used! The only suggestion was to put a warm and fuzzy query that pulls the control number/sender id/receiver id to associate the original message to the corresponding acknowledgment. This did not work for me, as I test like crazy, throwing the same file at a process eleventeen million times a time before I a satisfied, and there isn’t a great way to pair up the values programmatically.




Finding the original filename.

I know that in the perfect world, we don’t care about file names, we simply care about sender id/control numbers, etc: but our trading partners are in love with filename, bordering on creepy! When they call up the first thing that they say is “I dropped of ‘ABCDEFG12345.edi’ last Wednesday – I never got an ACK, what happened?” I have never gotten, without pulling out my crowbar; what their id is, and the control number.

Ability to see the entire EDI on both the receive and send side.

The transaction (that is stored deep in the DTADb database) doesn’t help me if I have a hard time associating it with it’s entire interchange.


What I did:

I wrote a little email to Steve Ballmer that got some people calling me to assist on an issue where if I wanted to reject an entire EDI interchange if any transaction was in error. It was/still is pretty hard to get a non documented feature limitation corrected. I decided that I had fought my battles and was not going to do it again, so I wrote some of my own components:


I have a separate datastore that is located on the same database as the BAMPrimaryImport (yes I know I shouldn’t) it is SQL 2005 so I can store quite a large amount of data in the following table:


The other things I wanted to log was all of the context properties that are part of the message (and some that aren’t). Here is a snapshot of the view that takes all that will need to know when a trading partner calls up:


Some notes, I have been testing with 50mb – 100mb files and the view was coming up pretty slowly, so I limited what is shown  in the last column is limited in the view to 2500 bytes, and added the Archive Interchange Id so if you need to look at the whole interchange you can run a query against the EDI_Repository.

To get all of this data to show up, I created a couple of pipeline components:

Receive Pipeline


Which you have the following pipeline properties to set when you define your receive location:


And for our outbound EDI data:

Send Pipeline


Which you have the following pipeline properties to set when you define your send port:


You have should specify the database and server, if it can’t find one that is associated with them message (if it wasn’t already attached from the receive side (an automatically generated 997/TA1 for example)) then it will put it in the database you specify.

This is only geared to ANSI X12 transactions, including HIPAA transactions, I have not tested it for UN/EDIFACT.

If you are interested in having this, refer to the services page.

Sep 202007

Stephen Thomas hit me up to write an article for his newsletter (if you aren’t automatically getting it, you should sign up for it here).

I wrote about how to automatically uninstall a BAM definition as part of the MSI uninstall. You can read about it here:

The one dilemma I have is that I cannot seem to figure out how to get a batch script to resolve the installation path by using this code in a batch script:

for /f “skip=2 tokens=2,*” %%a in (‘reg query “HKLM\SOFTWARE\Microsoft\BizTalk Server\3.0” /v “InstallPath”‘) do SET BTSbm=”%%~bTracking\bm.exe remove-all -DefinitionFile:”

I am looking into it and will update this blog entry when I finally do figure it out.

Sep 192007

With the 2006 deployment paradigm shift, I have been kind of left behind.

I have lately been thinking a lot about how to make things better/easier/lazier for me, and it got me looking at the new automatic features in the creation of the MSI.

One of the things is the ability to deploy BAM definitions automatically. Let’s review how this is done:

  1. On the development server, you still need to manually deploy the BAM definition.
    bm deploy-all
  2. You then want to add the BAM definition file to your application as a resource. Some things to keep in mind, you need to make sure you define a destination, otherwise the BAM definition file does not exist on your next environment. I am using variables that are accessible from the BTSTask.
    BAM Resources
    Doing this will ensure a successful installation of your BAM definition on your new environment, congratulations! However the issue is that if you undeploy the BizTalk application, the BAM definition still exists and is not removed. I asked Keith Lim if this was a feature or flaw. He informed me that this was by design. “I checked with our feature team and this is indeed by design.  The reason is that, for BAM activity deployment, there could already be user data in the database tables and we don’t want to risk having user data deleted implicitly.” — Well, for me, most times I don’t want to have to manually go to an environment that I normally don’t have access to anyway and undeploy BAM definitions if I need to redeploy code, because 90% of the time I will want to start all over with BAM than keep working with the old data. I want a way to automatically undeploy the BAM definition! Here is how:
  3. Now you will need to add a script that will actually remove the BAM Definition. Let’s first create the script (uninstall.bat) and then add it. The code below does the following, determines that it is undeploying and then undeploys the BAM definition
    set LogFile=c:\%BTAD_ApplicationName%_Undeploy.log
    REM ### Uninstall part of the script called for an existing application
    if “%BTAD_ChangeRequestAction%”==”Delete” (
      if “%BTAD_InstallMode%”==”Uninstall” (
        if “%BTAD_HostClass%”==”BizTalkHostInstance” (
            echo “c:\Program Files\Microsoft BizTalk Server 2006\Tracking\bm.exe” remove-all -DefinitionFile:”%BTAD_InstallDir%\%1″ >> “%LogFile%”
            “c:\Program Files\Microsoft BizTalk Server 2006\Tracking\bm.exe” remove-all -DefinitionFile:”%BTAD_InstallDir%\%1″ >> “%LogFile%”
            echo “Pre uninstall part of the script called for %BTAD_ApplicationName%” >> “%LogFile%”

    Now you might ask yourself, “why don’t you determine the path of the install directory right from within the batch file” like this:

    for /f “skip=2 tokens=2,*” %%f in (‘reg query “HKLM\SOFTWARE\Microsoft\BizTalk Server\3.0” /v “InstallPath”‘) do SET BTSbm=”%%~gTracking\bm.exe remove-all -DefinitionFile:”
    echo “%BTSbm%%BTAD_InstallDir%\%1” >> “%LogFile%”

    I tried for quite a while, but for some reason the logic will not resolve to the install path. If anyone knows why, I would be happy to add how to get it to work, in the meantime, go ahead and hard code the install path.

  4. Now you would think that you would simply add the batch file as a PostProcessingScript like this
    however there is no way to add an argument to the calling of this batch file (remember “%BTAD_InstallDir%\%1” ?) So we need to manually add it. We also need to make sure it is a PostProcessingScript, as the documentation states here: “During uninstallation, all scripts run in the opposite order that they run during installation. Therefore, post-processing scripts run at the beginning of uninstallation and pre-processing scripts at the end of uninstallation.” – We don’t want to delete the BAMDefinition.xml before the undeploy process gets to it do you?
  5. I need to add the batch script with an argument (the BAMDefinition.xml). I need to follow the instructions as documented here.
      Import PostProcessing Script
  6. Let’s go back and see the script has been added correctly (click to enlarge)
  7. Let’s create the MSI and don’t extract the Global Parties (since we don’t care about them anyway)
     Create MSI Part 1
  8. Save the file
     Create MSI Part 4
  9. Now you can install it in your new environment. Having done that, just to make sure, lets take a look at the install directory to make sure the two files are there:
     Installed Files
  10. Also the BAM Views are there:
    BAM Views
  11. So lets undeploy the code and see if the magic happens! (Of course it would, or this blog entry would be a total sham!)
  12. And finally the log that we created in the batch script

Congratulations, you now have a MSI that will deploy a BAM solution to the environment you need and will also undeploy the definition when you uninstall the application!


Wouldn’t it be nice to have a dialog box during the uninstallation of a BizTalk application where there is a BAM component asking if we want to undeploy instead of these hoops?

My personal lessons learned:

  • Don’t have spaces in the application name or the BAM Definition file: the BTSTask variables behave oddly and when passing variables into the batch file is almost impossible to troubleshoot
  • Even though I could run a batch file manually that would resolve the installation path of BizTalk, the resolving always came back as null
  • If it is a PreProcessingScript, it will delete the folder in the Program Files directory (and all subsequent files stored there) before executing the script
  • Even though it warns “You should always write scripts intended for production systems in silent mode. This is because a script waiting for user input will cause the BizTalk databases to become locked and inaccessible until the input is received.” I had to test it, I put a pause in the batch file and I ended up rebooting the machine because the installation script was waiting for me to press a key on a DOS prompt that wasn’t available!
Dec 062006

On our development machine, we do not have Office installed, so on my local workstation I copied the BAM.xls spreadsheet to create my activities. When I opened the workbook, I recieved the following error: Error in creating BAM Menu when clicking on theh Details button, it states

Error Description:

ActiveX component can’t create object

Error Source”


I installed msxml 4.0 SP2 on my local machine, and now BAM.xls loads fine. You can download it here.

Oct 172006


When defining objects in the Excel BAM workbook, discount it allows for spaces. However, sildenafil you cannot reference those spaced names in orchestrations, you must use the Name, not the DisplayName.

Here is the rule that will load it successfully into the BAM tables:

Sep 222006


A recent post was written about attempting to query the DTADB database to capture data and send it to a particular customer. I suggested that this is a purpose in Business Activity Monitoring. I have created a sample application that demonstrates some of the powers of BAM.

In this example orders are processed by Biztalk, doctor and key data elements are extracted and sent to the BAMPrimaryImport database.

Another orchestration takes the information in the database and creates a report and sends it out to the customer.


Setup Instructions:

  1. Download this file.
  2. Run the following command from a dos prompt to create the necessary BAM objects: TrackingBM.exe deploy ..BAMReportingActivityInfo.xml
  3. Run the extractBAM.sql against the BAMPrimaryImportDb
  4. Deploy the solution
  5. Modify the binding.xml file to represent your enviornment
  6. Bind the ports using the Deployment wizard.
  7. Enlist the orchestrations
  8. Drop Order 1.xml, Order 2.xml, and Order 3.xml into the Input folder
  9. Wait and then drop the Confirmation 1.xml, Confirmation 2.xml, and Confirmation 3.xml into the Input folder
  10. Drop the Trigger.xml file into the input file and in the output folder there should be an email xml file that shows various BAM data.

This actually goes against my better concience on at least 2 fronts:

  • BizTalk has the ability to do a lot of things, but sometimes it shouldn’t. I know of some people think that it is better than sliced bread, but a more elegant solution would be to use SQLReporting services that would go against the BAMPrimaryImportDB
  • It uses a trigger file to kick off the report, there could be a better way, with a proper stored proc to do some marking of the data so no duplicate reports get run