web stats
Parsing OBX message - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2006, 10:25 AM
dzhao00 dzhao00 is offline
What's HL7?
 
Join Date: Oct 2006
Posts: 5
dzhao00
Default Parsing OBX message

Need some help to find a solution ...

I have an incoming channel that receives lab reports. The OBX records in the message looks like this:

OBX|1|NM|2000330^SEGS^SEGMENTED NEUTROPHIL||88|%|^32^66|H|||F|||20061002121200|ABC ^DEF, GHI|ABC^DEF, GHI

The obx.7 is the reference range which in the above example is ^32^66, and it's not showing up on the hl7 tree when I copy the sample message in the hl7 message template.

It seems like the parser can recognize obx.7 value if it is a string, e.g. 32-66, but treat ^32^66 as no value.

What options do I have to be able to parse this value?

Thanks, Dave.

Reply With Quote
  #2  
Old 10-12-2006, 10:58 AM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default Re: Parsing OBX message

Can you paste the full record? By default, HL7 specifies the ^ character as a field seperator, so in the OBX.7 case it is pulling out an empty field.

-Chris
__________________
Chris Lang
Reply With Quote
  #3  
Old 10-12-2006, 11:51 AM
dzhao00 dzhao00 is offline
What's HL7?
 
Join Date: Oct 2006
Posts: 5
dzhao00
Default Re: Parsing OBX message

Here is a sanitized sample:

MSH|^~\&|AAA999|ABC|AAA|ABC_AA|20060901120000||ORU ^R01|11111-111111111111|T|2.2
PID|1||000099999^^^00000||ABC^ABC^ABC||19181010|M| |W||||||||0099999|999999999
PV1|1||BMT^BSEC^01||||||11111^A, ABC~22222^B, ABC~33333^C, ABC|TS|||||||99999^ABC, ABC|O||||||||||||||||||||||||||20060901090000
ORC|RE||099999999^MN||CM||||20060901120000|||| BMT
OBR|1||099999999^MN|2000001^DIFF^DIFFERENTIAL|||20 060901120000|||ABC||U||20060901120000||99999^ABC, ABC||00000000|999999||0000999999999|20060901120000 ||MN|F||^^^20060901120000^^RN~^^^^^RT
OBX|1|NM|2000002^SEGS^SEGMENTED NEUTROPHIL||78|%|^32^66|H|||F|||20060901120000|ABC ^ABC, ABC|ABC^ABC, ABC
OBX|2|NM|2000003^BANDS^BANDS||0|%|^0^2|N|||F|||200 60901120000|ABC^ABC, ABC|ABC^ABC, ABC
OBX|3|NM|2000004^LYMPHOCYTE^LYMPHOCYTES||20|%|^24^ 58|L|||F|||20060901120000|ABC^ABC, ABC|ABC^ABC, ABC


Yes, in the obx.7 case it is pulling out as an empty field, but this is the message we'll receive, so I need to find a way to get the range values.

Thanks for your help Chris!
Reply With Quote
  #4  
Old 10-12-2006, 01:22 PM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default Re: Parsing OBX message

Yes, the problem is that it is parsing the '^' to be a field seperator. There's not much that can be done in 1.1, however 1.2 is scheduled to include a pre-processor that you can run on the message to fix-up any encoding issues before it is passed to the HL7 processor.

(http://www.mirthproject.org/communit...rowse/MIRTH-32)


Sorry about that!
-Chris
__________________
Chris Lang
Reply With Quote
  #5  
Old 10-12-2006, 01:59 PM
dzhao00 dzhao00 is offline
What's HL7?
 
Join Date: Oct 2006
Posts: 5
dzhao00
Default Re: Parsing OBX message

Yeah ... I agree that we should have a pre-processor. I was hoping that in 1.1 we can have a way to access the raw message data before it is converted to xml.

I think this is a very important feature to be more flexible to deal with not so perfect encoding in the real world.

When will 1.2 to be released? I still need to find a solution for this issue really fast ...

Dave.


Reply With Quote
  #6  
Old 10-12-2006, 03:36 PM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default Re: Parsing OBX message

1.2 is scheduled for Oct 25th. You might be able to kludge a solution by accessing the hl7_er7 value from the js.

Do a logger.error(hl7_er7);

In your javascript - is the value retained there?

-Chris
__________________
Chris Lang
Reply With Quote
  #7  
Old 10-13-2006, 06:30 AM
dzhao00 dzhao00 is offline
What's HL7?
 
Join Date: Oct 2006
Posts: 5
dzhao00
Default Re: Parsing OBX message

I did the log on the hl7_er7 object in my javascript and those values are not retained there. I set log4j on debug and from the log it shows that in

com.webreach.mirth.server.mule.util.ER7Util before encoding ER7 message to XML, the raw message still having those values.

after ER7 transforms to XML, those reference range value is gone.

I guess the hl7_er7 is constructed from the converted XML.

Is the raw message data still an accessible object in my javascript? Or, Can I write my own java class to plug-in the mule config, for example in the transformer before com.webreach.mirth.server.mule.transformers.ER7toX ML?

Glad to hear that 1.2 is scheduled for Oct 25th. Hope the pre-processor is in this release.

Thanks Chris! Dave.
Reply With Quote
  #8  
Old 10-13-2006, 10:44 AM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default Re: Parsing OBX message

Try using the 'message' or 'incomingMessage' variable in your JS. logger.error(message.toString());

Any luck there?

-Chris
__________________
Chris Lang
Reply With Quote
  #9  
Old 10-13-2006, 11:14 AM
dzhao00 dzhao00 is offline
What's HL7?
 
Join Date: Oct 2006
Posts: 5
dzhao00
Default Re: Parsing OBX message

Hi Chris, I tried both message and incomingMessage, and those values are not there.

Dave.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HL7 message parsing xavierd Development 5 08-09-2012 04:16 AM
parsing a microbiology lab result message docinthebox Support 5 01-14-2008 09:31 AM
problem parsing the xml message shahin@gmail.com Development 1 01-04-2008 05:34 AM
problem parsing the xml message shahin@gmail.com Development 2 12-28-2007 12:42 PM
Message parsing problem norph Support 1 09-29-2006 11:38 AM


All times are GMT -8. The time now is 02:23 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation