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.
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to