Thank you Charles for your message,

Following your hints I ended up disabling the parsing of  OML_O21_PRIOR_RESULT, 
that is, simply putting into comments the .add(..) in  
OML_O21_OBSERVATION_REQUEST which seems to work fine for me 

Again, thanks for the quick answer!
Dani

"Charles D. Fisher" <[EMAIL PROTECTED]> wrote: 

Daniel,

The tree tells all: put your message into the TestPanel application that
comes with HAPI and parse it.  You will see how HAPI is creating the
internal tree of the message based on the abstract syntax diagram.
Basically, the second OBR group is being interpreted as an "Order Prior"
group.

I took a quick look at the abstract syntax diagram for the OML^O21 in
Chapter 4 of the HL7 v2.5.1 standard, starting on page 4-15.  It is pretty
long and involved.  I don't remember a lot of detail from my compiler class
in grad school, but I would suspect that HL7 v2.x messages can often
parse/map in more than one way to the abstract syntax diagram (which is
essentially the message "grammar").  In other words, the interpretation is
ambiguous.  This is probably due to the lack of explicit grouping
constructors in the pipe-separated message encoding.  There would be no
such problem in using the XML encoding.

You may be able to disambiguate the message structure by including (or
having the orderer include) some optional, empty segment.  I tried adding
an empty FT1 segment right after the first SPM segment in your message, and
it seems to have had the desired effect: the message now parses into an
OML_O21_ORDER (rep 0) and an OML_O21_ORDER (rep 1)

Charles Fisher
Division of Epidemiology
New York State Dept. of Health
518-474-2735



                                                                           
             Daniel Nebot                                                  
             
             oo.com>                                                    To 
             Sent by:                  hl7api-devel@lists.sourceforge.net  
             hl7api-devel-boun                                          cc 
             [EMAIL PROTECTED]                                             
             orge.net                                              Subject 
                                       [HAPI-devel] OML O21 does not parse 
                                       more than one ORDER group?          
             03/29/2007 06:38                                              
             AM                                                            
                                                                           
                                                                           
                                                                           
                                                                           




Hi there,

I am trying to parse a rather simple message with more than one order into
it, like the one below. Unfortunately, HAPI does not seem to go further
than the first ORC-OBR block.

I have looked to the source code but I cannot see why. This really urges
for me... I would be very grateful should somebody be so kind to throw some
light on how to solve it!
Cheers
MSH|^~\&|OF|Chemistry|AM|Automation|200309060825||OML^O21^OML_O21|msgOF101|T|2.5|123||||USA||EN

PID|1||12345^5^M10^Memphis_Hosp^PI||EVERYMAN^ADAM^^JR^^^L||19800101|M
PV1|1|O|Ward|||||||||||||||12345
ORC|NW|||666^gastric|||||200309060824|222221^NURSE^NANCY|||||||||||
Entero-gastric^^^^^^FI^^^EG02
TQ1|||||||||A
OBR||555_1^chemistry||GLUC^GLUCOSE^L||||||1234^BLEEDER|S|||||222222^PHYSICIAN^^^^DR
 |821
SPM|1|123456781^gastric
||SER|||||||P||||||200309060735|200309060821||||||||1
ORC|NW|||666^gastric|||||200309060710|222221^NURSE^NANCY|||||||||||
Entero-gastric^^^^^^FI^^^EG02
TQ1|||||||||A
OBR||555_2^chemistry||GLUC^GLUCOSE^L||||||1234^BLEEDER|S|||||
222222^PHYSICIAN^^^^DR|821
SPM|1|123456782^gastric||SER|||||||P||||||200309060755|200309060821||||||||1

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to