Link to home
Start Free TrialLog in
Avatar of valipotor
valipotor

asked on

HL7 Special protocols

Hi
I am implementing an HL7 v2.x compliant messaging server.
I would like to know the order for applying fragmentation protocol (where it apllies) and the sequence number protocol. I mean, which one of them get's applied first.
Thank you
valipotor
Avatar of sigmacon
sigmacon

If I understand your question correctly, you are asking about how the protocol REQUIREMENTS of HL7 are applied. If that is your question, than the answer is that under the most common circumstances, these fragmantation control and sequence number requirements are already addressed by the underlying data transport layer, which is usually TCP/IP. The HL7 requirements state that in case of message fragmantation, the transport layer SHOULD assure the proper ordering of data packets. The sequence number requirement states that replay attacks SHOULD not be possible. These are all concerns addressed by a particular TCP/IP implementation. So, in that case, you don't have to worry about that at all and can focus on the actual message parsing or message creation. Please also be aware of the fact that HL7 is now at version 3, which is XML based and not X12 anymore - although most HL7 messaging is currently done using 2.4

If this is not an answer to your question, please provide more detailed information about what you would like to know.
Avatar of valipotor

ASKER


>>The HL7 requirements state that in case of message fragmantation, the transport layer SHOULD assure the proper ordering of >>data packets
Message fragmenentation is independent of the transport layer as i understood. I mean that the message must be fratgmented in smaller pieces in order to be processed sucessfuly by the receiving application.

>>Please also be aware of the fact that HL7 is now at version 3, which is XML based and not X12 anymore - although most HL7 >>messaging is currently done using 2.4

I know that ... but i also know that v3 is not standardized completly right now. Also, what is X12?
I only know that there is a xml based implementation for v2.x HL7 messages.



Fragmentation refers to two interconnected things: A message being hacked to pieces into packets used by the underlying protocol and those packets getting to the receiver in different order. TCP/IP will reassamble the message properly, but because of fragmentation, the entire message might not be available at a given point in time. How you deal with this depends entirely the way you implements this. Your responsibility is to make sure that you have and entire message before you start parsing and processing it. This is the only part where I see the fragmentation protocol requirement touching something you will be responsible for.

> message must be fratgmented in smaller pieces in order to be processed sucessfuly by the receiving application.

Are you referring to the PARSING of the message with this statement? I really hope we're on the same page here and not talking about two completely different things ;-)
BTW: X12 is an industry messaging standard on which HL7 is based.
yes, i am reffering to parsing the message
as i understood, fragmentation occurs when the message is to big to be sent in one piece
the fragments must be rejoined on the destination and then the message must be parsed
Yes, that would be correct. I have not come accross a single instance where the sender would sent an incomplete message, but if you want to account for the fact, the sequence number mechanism will help re-assamble the message parts. In that scenario, defragmantation and sequence number ordering need to be happen simultaneously, since you can't defragment without ordering properly.

What size of message are you talking about? Even a batch transaction with lots of embedded messages that's several MB large will usually be send in one piece, even if it is as a file and not directly as a network endpoint-to-endpoint communication.
i am talking about site imposed limits on the message length
since i am trying to create a all versions compatible hl7 server, i have to take this into account

>>In that scenario, defragmantation and sequence number ordering need to be happen simultaneously, since you can't >>defragment without ordering properly.

What do you mean by that?
Here is a possible scenario:
Server A is sending a message to server B but it fragments the message, and sends all the fragments to Server B.

The question is:
Is the sequence number protocol applied on the message only or to the fragments too?
So, are all the fragments going to have the same sequence number, or each fragment will have a different sequence number?
The reason i am asking this is because i know for a fact that each fragment has a continuation pointer that allows it to be linked to the following one in the order that was intended. This would make the sequence protocol redundant for fragments.

thanks a lot
valipotor
ASKER CERTIFIED SOLUTION
Avatar of sigmacon
sigmacon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
   Thank you for your answer.
    So, you are sugessting that the continuation protocol and the sequence number protocol apply simultanious.
    One more question. It seems natural to me that the sequence number protocol will be applied for each client connecting to a server. So the server must concurently process multiple streams of messages with different sequence numbers that can at some point overlap (two different client send different messages with the same sequence number).
    But if one server (let's call it server A) is routing the request of multiple clients to another hl7 server( server B ) ... how should this be implemented? Should i consider the comunication from server A to server B as a single message stream or as multiple message streams?

valipotor
First question: Yes and No. If both are used, then one could say simultanious. But they are in fact independent.
Second statement: The sequence number protocol is optional. Other fields in the message header make a particular message stream unique - even if the same sequence numbers as in other message streams are used. It is the 'servers' responsibility to assure proper handling of multiple message streams.
Third question: What do you mean with route? A silent and/or caching proxy will not modify the message at all - although the HL7 specifications don't directly address this. In that case, only one message stream needs to be considered. A proxy, though, is not really a communication end point. So for your particular case, it is probably not of relevance. Any other message handling that involves some form of parsing, processing or coordination should be treated as separate message streams.

What exactly are you trying to accomplish? What answers are you in fact looking for? So far, we discussed very high-level considerations that don't really address any manifestation of a particular implementation.
 I am trying to implement an HL7 Server that is able to comunicate with all other HL7 implementations. So it has to be very general .... and must support entirely the HL7 specification.
Many parts of an actual HL7 transaction can be defined variably by the involved messaging parties - so supporting ALL OTHER HL7 implementations out of the box is going to be very challenging. To get a handle on some of the things discussed here, you may want to prototype something and ask (as new) questions with concrete problems. Good luck.