Thursday, October 30, 2008

Parser Optimization

There are few errors that you can get while running data through your schemas that are related to Parser Optimization.

I recently started receiving "Unexpected data found while looking for..." errors. I had been playing the schema trying to solve another problem...it wasn't picking up segments (will talk about that later).

It turns out that the Parser Optimization had been set to Complexity at some point....I tend to try alot of things, then forget that I tried them.

I switched it back to Speed and everything worked fine.

You set Parser Optimization in the Properties Pane of the the Node. As discussed you have two options Speed (default) and Complexity.

When the PO is set to speed the parser will look at your file from the top down and try to fit what it finds into the right slot in the outbound file.

With complexity is runs from top to bottom and bottom to top simultaneously. This provides a more accurate matching of data but can take a few seconds longer to run. A real problem if you're processing alot of messages.

Tuesday, October 28, 2008

"The document type does not match any of the given schemas"

Its been sometime since I've posted but I've been quite busy.


It was telling me that a schema (the one referenced in the Receive Pipeline) wasn't available to the send port. I thought that was odd as I wasn't referencing it on that side of the map (big clue there).

If I set the receive port to pass-thru it worked...but what good is that?

This particular error took me a few days to sort out. There's not alot of information out on the internet that tells you how to fix this error...some on what causes it. But if you're like me and not experienced with BizTalk it all seems a bit confusing.

After 3 days of working on this problem I took a day off...a mental health day as I was so frustrated I wanted to cry.

Anyway, the solution occurred to me when I was driving out to meet some friends for lunch on my day off.

I had forgotten to set the maps on the receive port! I was passing it to the send port without a map so it was looking for the source schema in the send pipeline!

Stupid mistake. /shrug

Its one of those cases as not understanding the advice until after the problem is solved.

Tuesday, October 7, 2008

Persistant Scripting Variables

Here's another one that baffled me this morning.

I need to break an OHIP number into number and version.

I get it like this 123456789-VS1 I needed the numbers in one field and the letters (the version) in another.

Easy enough eh?

So I wrote the one Scripting Functoid

Public Function HC_Number(ByVal strHCN as String) As String
Dim strReturn() As String

strReturn = Microsoft.VisualBasic.Split(strHCN, "-")
HC_Number = strReturn(0)
End Function


Like I said...easy

So I copied that over to the functoid to pull the version and changed the (0) to a (1).

I tested the map and was stunned to see that same value in both fields.

I even called Gord into my office to see if maybe for some reason I was seeing two separate lines going into two separate fields but no one else could.

Everything looked fine to him. He asks to see my code...and points out the obvious.

I needed to change HC_Number to HC_Version in the second functoid. (why do I keep wanting to call them scriptoids?)

Anyway, as you can see, I'm a bit of a noob.

Monday, October 6, 2008

Postfix, Infix and Prefix

I recently started working with ORU messages that send observation data (lab, pathology etc).
I pulled some messages off our feed and ran them through my template schema only to have them fail.
It took me a bit but I realized that unlike the ADT feed segments weren't terminated by a "|" but rather would flow right into the next segment.

So instead of

|||2.3|EVN

I got

|||2.3EVN

I was baffled. I worked on it for awhile and finally sent off a quick message to my contact at our integration vendor Summit.
I got a response back pretty quick telling me to check the Child Order settings and change them infix.

This worked beautifully.

I'm the kind of guy that likes to understand why things work, so I did some research into Infix, Postfix and Prefix.

As far as I understand it (and feel free to post a comment if you think I'm wrong)....

--using | as the delimiter

Postfix refers to where the delimiter appears after the data.

Field|Field|{next record}

Infix refers to where the delimiter appears inbetween the data

Field|Field{next record}

Prefix refers to where the delimiter appears before the data

|Field|Field{next record}


There you have it, the results of at least 45 minutes of research!

Health Level 7

The environment that I'm working in involves HL7 messaging. That is "Health Level 7".

You can learn more about this protocol at HL7.org

Messages are broken into segments and field types.

A segment such as a PID (Patient Identifier) is delineated by a Chr 127. Within each segment are a number of fields. These are delinated by | characters. It is common to have many blank segments, but some can be mandatory based on whatever the system specs say.

So this is what an HL7 message looks like:

MSH|^~\&||STO|||200810021308||ADT^A03|PACS-ADT.1.7960|D|2.2|||AL|NE|||||||EVN|A03|200810021308|||ISBURC|200810021307||
PID|1||H000072|H73|ELF^EIGHT^^^^||19580426|F|^^^^^||^^^^|||||||AA000161/08|
||||||||||||||||||||PV1|1|I|1SRG^342^04|EL|||WILM^WILKS^M.^^^DR.^|||GS|||||||
WILM^WILKS^M.^^^DR.^|IN||U||||||||||||||||H|||STO||DIS|||200809051220|
200810021307||||||||PV2||SP||||||||||||||||||||||||||||||||||||||||||||||AL1|1|MA|
OEALL^EGGS, FLOUR^OE||||AL1|2|MA|OEALL1^YEAST, COCONUT, JAM^OE||||AL1|3|MA|OEALL2^PENICILLIN^OE||||

You'll see the CHR(127) or Hex 7F as . Some of the segments contained in this message are MSH (Message header), PV1 (Patient Visit Segment 1) etc. etc.

In the MSH segment field 8 (MSH8) you'll see the message type ADT^03. This is a patient discharge message. It can be further broken down as MSH8.1 ADT and MSH8.2 A03.

That's a nutshell if you want to learn more about HL7 I'd suggest Google, or ask in a comment and I'll try and help you out.

Thursday, October 2, 2008

Starting the journey....

A bit about myself before we begin....

At the time I write this I'm a month and a bit short of my 43rd birthday. I work in the IT Dept of a group of 5 rural hospitals in south-western Ontario, Canada.
I spent 17 years in the Canadian military, mostly as a medic. When I left the military I opted for IT as I was "good with computers", and, as far as I could tell you didn't get routinely covered with bodily fluids (I've heard that there are people who're into that...I'm not one of them), and no one ever dies on you....although some users act like they will if you don't fix their problem immediately.
When I left the military I went to school for a year, then found a job doing IT support for a factory making insulated cabling for heavy industry. I liked that job...it wasn't too taxing and I liked my co-workers. It was a 3 month contract, which, as the plant was in trouble I didn't opt to extend.
I lived off my pension (and my wife at the time) for a few months. Just when I was getting despondent over the lack of employment I saw an ad on Workopolis looking for an IT type who had a strong background in the clinical sector, and oh, btw, the successful candidate would be sent to Sydney Australia for 2 weeks of training. I clicked the apply button and chuckled to my wife that I would never get that job.
Sydney was lovely...my first trip to a topless beach (I wore a shirt).
The company was an Emergency Dept Information Systems vendor. I gained alot of ED experience in the military and this was my niche. I loved my job for awhile...until I burnt out.
My wife and I got divorced...we're good friends now...she's remarried with a couple of kids. I'm still looking for a girlfriend...so if you're female, reasonably hot with a thing for fat, hairy computer geeks with a weird sense of humour, go ahead and send me an email :-).

Anyway. I got laid off on Halloween of 06. The company closed their Toronto office.

All my friends were glad. The job was killing me.

I went 6 months before finding another job. I lost my house and narrowly avoided financial ruin.

I found a job working for half my previous salary fixing PC based Point-of-Sale devices at quick service restaraunts. I liked the job...and I got alot of free coffee.

I was driving to a call when I received a phone call from the IT Manager here asking me if I'd like to come work for him. My best friend in the entire world works here, and we were a client of mine when I worked for the ED systems vendor....and I'd already interviewed for another position a few months previously.

Wow, look at the time, I need to cut this short....

Anyway, that boss left, we got a new boss whose very much into cutting edge business practice. He recognized my abilities as a programmer (heh, fooled him) early on.

A few weeks ago he walked into my office, dropped a bunch of books on my desk and said, "Learn BizTalk!" and walked out....

That's not actually what happened, it was more discussing business ideas and asking me if I'd be interested in training...naturally I was.

I've had 16 hours of training, and alot of time in books and websites.

Not to blow my own horn but I'm clever and tenacious, so I've been able to solve most of my problems with a bit of help from people on forums.

My friend suggested that I start keeping a blog to use as a reference to all the solutions I'm finding.

So here it is....tomorrow I'll update you on what I've discovered so far.