Unable to Parse NTE if the segment order is changed - hl7

I got a HL7 message with NTE segment. The HL7 message type RDE_O11 and version 2.5. While passing message with NTE, NHAPI is not parsing it. So with the following message,
MSH|^~\&|xxxx|xxxx|||||RDE^O11^RDE_O11||P|2.5||||||ASCII|||
PID||||||||||||N|||||||||
PV1|||||||||
ORC|||||||
RXO||||||||||||||||||||||||||
RXR||||||
RXE|||||M
NTE|1||#2 from 10/19/15 amb|RE
TQ1||
TQ1|||PO Q6H PRN|A||
RXR||||||
If I change the position of NTE right after MSH, NHAPI is able to parse it.
MSH|^~\&|xxxx|xxxx|||||RDE^O11^RDE_O11||P|2.5||||||ASCII|||
NTE|1||#2 from 10/19/15 amb|RE
PID||||||||||||N|||||||||
PV1|||||||||
ORC|||||||
RXO||||||||||||||||||||||||||
RXR||||||
RXE|||||M
TQ1||
TQ1|||PO Q6H PRN|A||
RXR||||||

What kind of error are you getting? The HL7 specification for the RDE_O11 message structure does allow NTE segments to appear after RXE (among several other locations). So it ought to work.

Related

Error when use kafka-avro-console-consumer consume avro message sent by spring cloud stream kafka

I tried official schema-registry-confluent example (consumer/producer) with my local installed confluent 4.0.0, it can send "sensor" avro message when send post request and receive in listener, but when I use kafka-avro-console-consumer tool shipped with confluent 4.0.0 to view avro message sent, the tool raised the following error (a). I also tried to consume avro message sent by kafka-avro-console-producer tool (and the message can be shown correctly in kafka-avro-console-consumer tool) , it reported the following error (b). Doesn't the given example support confluent 4.0.0? Many thanks!
(a) kafka-avro-console-consumer error =>
ERROR Unknown error when running consumer: (kafka.tools.ConsoleConsumer$:107)
org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id -1
Caused by: org.apache.kafka.common.errors.SerializationException: Unknown magic byte!
(b) listener error =>
org.springframework.messaging.converter.MessageConversionException: Could not read JSON: Invalid UTF-32 character 0x51473863 (above 0x0010ffff) at char #1, byte #7); nested exception is java.io.CharConversionException: Invalid UTF-32 character 0x51473863 (above 0x0010ffff) at char #1, byte #7)
at org.springframework.messaging.converter.MappingJackson2MessageConverter.convertFromInternal(MappingJackson2MessageConverter.java:234) ~[spring-messaging-5.1.0.BUILD-SNAPSHOT.jar!/:5.1.0.BUILD-SNAPSHOT]
Every time there is a MessageConversionException it simply means that the provided Message Converters could not convert Message. . . and rightfully so as we can't handle every scenario, only the common ones.
So, you should implement custom Message Converter (either from scratch or extending one of the existing ones).
Here is more info on how to define custom Message Converter
https://docs.spring.io/spring-cloud-stream/docs/Fishtown.M1/reference/htmlsingle/#spring-cloud-stream-overview-user-defined-message-converters

quickfix/j NewOrderMultileg message get truncated

In my application, I am receiving a NewOrderMultiLeg message. The entire message is logged into the 'messages.log' file. But when I recevie the message into the onMessage(Message message, SessionID sessionID) method, I am getting only a part of the message, the message is getting truncated. i.e I only one element from the repeated group and the rest of the messages are truncated. I pasted here the message I recevied in log file and method.
Please help me to sort out this issue.
Message from application debugger.
8=FIX.4.49=10935=AB34=749=Server52=20150525-07:10:47.05956=TRADERINFO1=0.011=1250000163=1110=0228=0555=3635=0.010=075
Message from FIX logger.
8=FIX.4.49=24735=AB49=Server56=XXXXXXX34=452=20150525-07:08:14.71111=125000011=0.063=1635=0.0110=0228=0555=3616=9623=1687=10565=1616=3623=1687=10565=1616=13623=1687=10565=160=20150525-07:08:09.874152=1040=2376=XXXXXXXSERVER835=310=229
I am using FIX 4.4, quickfixj1.5.3.
Part of my config file
RejectInvalidMessage=N
ValidateFieldsHaveValues=N
ValidateIncomingMessage=N
ValidateFieldsOutOfOrder=N
ValidateUserDefinedFields=N
DefaultApplVerID=FIX.4.4
UseDataDictionary=Y
Thanks in advance.
Thanks
Bibin
I was missing one mandatory field 'LegSymbol' in InstrumentLeg component. In QuickFIX/J FIX4.4 dictionary shows 'LegSymbol' is non mandatory field but I found from some other sources, it is a mandatory field. Once I started receving the message with 'LegSymbol' field, my issues got sorted out.
Thanks
Bibin

HL7 parser to parse v2.7 messages in java

I'm looking for a HL7 parser that would parse v2.7 messages. I have tried Hapi but it has support only upto v2.6.
Can you anyone please provide any suggestions in parsing v2.7 messages?
Additionally to allowing unknown versions (like nradov pointed out), you need to inject the right model class factory, e.g. GenericModelClassFactory, into the parser or you might end up with an exception:
ca.uhn.hl7v2.HL7Exception: No map found for version null. Only the following are available: [V22, V25, V21, V23, V24]
So the complete solution is
use the GenericModelClassFactory
allow unknown versions
and it looks like this:
final ModelClassFactory modelClassFactory = new GenericModelClassFactory();
final PipeParser parser = new PipeParser(modelClassFactory);
parser.getParserConfiguration()
.setAllowUnknownVersions(true);
final Message message = parser.parse(message);
Like nradov said, you can use HAPI to parse V2.7. But you'll need to call this to prevent the "2.7 is not recognized" Exception:
parser.getParserConfiguration().setAllowUnknownVersions(true);
You can still use HAPI to parse HL7 V2.7. It just doesn't have convenient methods to easily access the new fields that were added after V2.6.

Ranap ErrorIndication

I am new to telecom domain
I am trying to encode and decode the ranap errorIndication message.
but the specification specifies that
Procedure Code is to be used
if Criticality Diagnostics is part
of Error Indication procedure,
and not within the response
message of the same
procedure that caused the
error.
So if I include the procedure code of the failing message in the errorIndication message.Then the wireshark shows the errorIndication as the SACK of the failed message.
So I want to know how we can include the procedure code of the failing message in the errorIndication so that Wireshark should treat the message correctly.
Thanks in Advance.
A quick look at 3GPP TS 25.413 (RANAP signalling) shows that Criticality Diagnostics (9.2.1.35) is part of the Error Indication message (9.1.41).
In section 8.27, the spec says
The Error Indication procedure is initiated by a node to report detected errors in one incoming message, provided they cannot be reported by an appropriate failure message.
The definition for Procedure Code that you quoted in the question, makes it clear that the Procedure Code refers to a message that is NOT being replied to with the Error Indication.
In the Error Indication (section 9.1.41), there is also no code that refers to the message that caused the Error Indication.
The Error Indication information elements are
Message Type
Cause
Criticality Diagnostics (includes the Procedure Code that is causing the error)
CN Domain indicator
Global RNC ID
Global CN ID
Extended RNC ID
So, my conclusion, based on your description, is that I think Wireshark may have interpreted the spec wrongly. Wireshark seems to be looking for a message to which the Error Indicator is a reply.
But the Procedure Code is only supposed to tell you which message caused the error and should be re-sent. It's not supposed to tell you that the Error Indicator is a reply to that particular message.
Apologies if I am slandering Wireshark - if anyone comes up with an answer that proves me wrong, I will happily delete this post. Maybe you should ask this question on the Wireshark forum. I couldn't see anything like the issue you describe among the questions there.

Hapi 2.1 version's MSH-9 filed concerns

I'm using Hapi release version 2.1 and it works perfectly. But I have an issue with an error response that I get from Hapi. My request is:
MSH|^~\&|||||20130612174137.811+0530||OUL^R22^OUL_R22|2801|T|2.5
And my response is:
MSH|^~\&|||||20130612174152.606+0530||ACK^R22^ACK|1624|T|2.5
MSA|AE|2801
ERR|||207^Application internal error^HL70357^^^^^^errmsg|E
In the above response, if you check the MSH-9 field, it is:
ACK^R22^ACK
Shouldn't that be "ACK"? Because it is additionally adding "R22" message to that field, which is not valid. And I suspect that it picks that from the original request.
Can anybody help me on this? How can I avoid that invalid segment?
Why does Hapi additionally add that field in the MSH-9 field?
As the definition of the field MSH-9 in HL7 Version 2.5 is
<Message Code (ID)> ^ <Trigger Event (ID)> ^ <Message Structure (ID)>
this is a correct and valid implementation.
Maybe you can get an generic acknowledgement by using either an older message version in MSH-12 or by using an generic message template.

Resources