Hi Jonathan,

 

Looks reasonable to me. Please go ahead and draft an example code and
push it to HAPI.

If you do not have committer access, please send it to my way and I can
commit for you.

 

Thanks.

 

Regards

-Niranjan.

 

From: Jonathan Bartels [mailto:[email protected]] 
Sent: Wednesday, October 20, 2010 10:29 AM
To: [email protected]
Subject: Re: [HAPI-devel] Ignore groups and just access segments

 

I got some help off list and figured this out. 

 

Instead of doing "Message myMessage = new
GenericParser().parse(myMessageString);" you can do "GenericMessage
myMessage = new GenericMessage.UnknownVersion(new
DefaultModelClassFactory()); myMessage.parse(myMessageString);" and get
generic access to the HL7 message.

 

I think that this would be good to add to the "HAPI by Example" page.
Sometimes having HAPI deal with the semantics of each message and the
grouping is desirable, other times "raw" access to an HL7 message is
needed.

 

From: Jonathan Bartels [mailto:[email protected]] 
Sent: Tuesday, October 19, 2010 4:15 PM
To: [email protected]
Subject: RE: Ignore groups and just access segments

 

Replying to myself. Please confirm if this is correct.

 

I'm seeing other posts in the HAPI archive that HAPI simply doesn't work
on a message and generic segments. It applies some semantics and uses
groups on all messages.

 

To access a message as I intend to I would need to either:

 - iterate over each segment in the message, determine its type and
process it appropriately. This would pretty much require that there is a
MessageIterator which guarantees that the order of the segments in the
message will be exactly as they appear in the source message. Do the
MessageIterators guarantee order??

 - Create a generic message definition such that it has all segments as
optional and repeatable on the root of the message. Is this even
possible? The HAPI by Example page shows a "custom model class" example,
but it doesn't really use a custom message definition, it still uses an
ADT_A01. There is a definition for a ZDT_Z01 referenced, is there an
example or doco on how to create a custom message??

 

Thanks!

 

From: Jonathan Bartels [mailto:[email protected]] 
Sent: Tuesday, October 19, 2010 2:46 PM
To: [email protected]
Subject: Ignore groups and just access segments

 

I have a use case where I want to capture data from a segment if it
exists in a message. For example, if a message contains an IN1 or a PID
segment I want to get some data from it. The message type is not
relevant nor is the structural validity relevant.

 

Using a terser works up to a point, I'm using an ADT-A01 to test
against:

"/.PID(0)-2-1" works, returns the data in PID.2.1

"/.IN1(0)-36-1" works, returns the data in the first IN1 segment 36.1

"/.IN1(1)-36-1" DOES NOT WORK

"*INSURANCE(1)/IN1(0)-36-1" works and returns the result expected from
"/.IN1(1)-36-1", the data in the second IN1 segment at 36.1

 

Is there a generic message type or a way to use the terser that would
ignore the groups and just let me get at the segments?

 

A more complex example is ORC segments, to get at an ORC segment in an
ORM_O01 is notably different than an ORU_R01.

 

 

 

 

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to