How to create a message set for CWF to do opaque parsing? - messagebroker

I will receive messages with 5 different formats. All the messages will have first 20 characters in the same format. I have to find out the message type using characters 10 to 20. Then apply the appropriate message set. I dont want a compute node to figure out the text rather I want to create a message format that will parse 0 to 20 and 5 other message formats to parse the rest?

Using Websphere Message Broker v7, I created a message set by defining the header fields and since the body will be of varying length, I defined the body as complex type with Composition as "message". After I figure out the message type from the header, i applied the appropriate message set to parse the message.

Related

Do we have standard for HL7 OBX-4 containment hierarchy

I am processing HL7 message. OBX-4field gives containment hierarchy.I see different dotted hierarchy in the message.
is there any standard for containment hierarchy dotted number?
For below example. will first dotted 1 always mean MDC_DEV_MON_PHYSIO_MULTI_PARAM_MDS and 2nd dot 5-always mean MDC_DEV_ECG_VMD.
are these number configurable in the medical device.I want to store data uniquely based using MDS/VMD/CHAN.
Right now I am getting HL7 from one source..will these hierarchy will always be same for that source.
is this would be valid if i get hl7 message from other source.
MDC_DEV_MON_PHYSIO_MULTI_PARAM_MDS/MDC_DEV_ECG_VMD/MDC_ECG_HEART_RATE
to Acehive
1.5.0.1
1-MDC_DEV_MON_PHYSIO_MULTI_PARAM_MDS
5-MDC_DEV_ECG_VMD
13-MDC_DEV_METER_PRESS_BLD_VMD
1-MDC_DEV_METER_PRESS_BLD_CHAN
OBX|1||69965^MDC_DEV_MON_PHYSIO_MULTI_PARAM_MDS^MDC|1.0.0.0|||||||X
OBX|2||69798^MDC_DEV_ECG_VMD^MDC|1.5.0.0|||||||X
OBX|3|NM|147842^MDC_ECG_HEART_RATE^MDC|1.5.0.1|88|{beat}/min^{beat}/min^UCUM|||||R|||20200508051804.8340+0530||||DFG~01^^Y71A57FFFE6188F3^EUI-64
OBX|4|NM|148066^MDC_ECG_V_P_C_RATE^MDC|1.5.0.2|7|{beat}/min^{beat}/min^UCUM|||||R|||20200508051804.8340+0530||||DFG~01^^Y71A57FFFE6188F3^EUI-64
OBX|17||69854^MDC_DEV_METER_PRESS_BLD_VMD^MDC|1.13.0.0|||||||X
OBX|18||69855^MDC_DEV_METER_PRESS_BLD_CHAN^MDC|1.13.1.0|||||||X OBX|19|NM|150018^MDC_PRESS_BLD_DIA^MDC|1.13.1.15|68|mm[Hg]^mm[Hg]^UCUM|||||X|||20200508051804.8340+0530||||DFG~01^^Y71A57FFFE6188F3^EUI-64||unknow
This particular HL7 ORU example is a more strict protocol within the HL7 format. It is defined by IHE, and the message type of this example is PCD (Patient Care Device) You can start searching for details of this message format here: https://wiki.ihe.net/index.php/Patient_Care_Device
You'll need to consider things:
HL7 event type of the message, found in MSH.9
If you have the specs of HL7 v2, then you can check on what the segments are usually use and the hierarchy of it.
If you don't have the HL7 spec directly from HL7.org, you'll need to ask the client sending the HL7 message their own spec. Their spec will guide you on how they structured their message. What are repeating, required and optional fields.
HL7 is a loose standard, some organizations don't strictly implement directly what the HL7 spec has, instead they repurpose some of the segments and fields, so it's best to have the client's own HL7 spec. That means other sources of HL7 may have a different approach.
I usually use this link to check on the HL7 definitions: https://hl7-definition.caristix.com/v2/HL7v2.5.1
Based from my experience, OBX segments are repeating and are usually under the OBR segment as child nodes. OBX.2 is the index, which is odd in your message since I see index 4 is followed by index 17.
So far after exploration i understood that those dotted numbers are not standard.Below is IHE documents.
Probably it depends on the profile. which can be different at different point.
https://www.hl7.org/documentcenter/public/wg/healthcaredevices/N0262_WG7_RCH.1g.pdf
I marking it is as answer. I will change this if something better explanation comes.

Bean Validation Min/Max wrong message

I'm using Min/Max Beanvalidation. Here is an example:
#Min(value = 100, message="too low")
#Max(value = 1000, message="too high")
private Integer example;
If i enter 99 i get the correct message "too low". If i enter 1001 i also get the correct message "too high". If i enter a very high number e.g. 10000000000 i get a generic message which i found out is this one: javax.faces.converter.BigIntegerConverter.BIGINTEGER={2}. So i suspect that if the user enters a number which is larger then the actual field type, he will get another message.
This is actually not what i want to achieve. I always want to show the user "too high". Is there a way to achieve this?
There are really two things going on, conversion and validation. In a first step JSF needs to take your string input and convert it to a number. This is where you get the error. Your value cannot be converted to an Integer. If conversions works, JSF populates your model and that's where validation kicks in. If validation then fails you get the defined Bean Validation messages. So what can you do:
Configure the JSF message for javax.faces.converter.BigIntegerConverter.BIGINTEGER={2} to be more descriptive
Change the datatype, for example use BigInteger. In this case the conversion from string to number will work
Use string in the bean and validate the string. You probably need then to convert to a number at a different point though, but that depends on you use case.
The maximum for Integer in java is 2^31 which is just over 2.1 billion. The input you used, 10 billion, is then beyond the maximum of an integer and would overflow the field, so it is not a valid given the field type, regardless of any validation you may have in place. you could switch the field type to be a BigInteger, then override the default validation messages to fit your needs, but that may be overkill given the purpose of your question. You can also have custom messages
Why not just limit the amount of characters in the inputfield in the frontend, for example
<h:inputText maxlength="4"/>
I'd guess it's possible to bypass if you really want, but I would'nt worry too much about the usability for someone hacking the site :-)

Can an attachment be split in an HL7 file and recreated after the message is transmitted?

I am using the HAPI parser to parse the HL7 files that come through my company. We are working on moving attachments through the OBX segment of the HL7 file. There are some validators that my stack uses that will not allow an attachment over 64k to pass. Is there a way to take multiple OBX segments and break an attachment up and then recreate it after it has passed through the wire to the other side?
HL7 identifies two possible cases and uses continuation pointer protocol for each. These cases are:
A single segment may be too large. HL7 uses the "ADD" segment to handle breaking a single segment into several smaller segments.
A single HL7 message may be too large. HL7 uses the DSC segment (in conjunction with the MSH-14 filed) and the continuation protocol to handle message fragmentation.
Chapter 2 “Controls” of the HL7v2 spec talks about it in more details.

Line break and also getting space in HL7 message

My BizTalk receive XML message as a input message. I am converting that message to HL7 message using Transform in orchestration.
Now if input message consists of any empty field in any of the node, the HL7 message breaks up at that postion and also include space in that message.
Can anyone help me to resolve this issue? following is my HL7 message:
Note --- Copy this message in Textpad to get to know exact space in it
MSH|^~\&|EEHR^bbbbbbbbbb|aaaaaaaaaaaaaaaaa^12699^DNS|KYIR|CDP|201103060733||VXU^V04|14962|P|2.3.1||||
PID|1||765874316^^^^SS||ssssss^anan^T|wwwww^^^^^^M|20100217|M||2135-2^YYYYYYYY or jjjjjj^HL70005|5896 hyhyhyhy Ave^Apt# 112^Wanta Fe^NM^85678^XXX^H^^049||5033331120X
^PRN^PH^^^505^5551120^~^NET^X.400^xxxxxx#yutyutopo.com|5056083515X4365^WPN^PH^^^505^6086715^4365|es^English^HL70296||||215486702|||H^erererer or qwqwqw^HL70189|bnbnbn|Y|1||||
Thanks.
I'm not entirely sure what the issue is - is it that there are spaces in the output HL7 message string? I'm not on my windows partition right now, so I'm not able to actually see any glaring issues with spacing in your posted message.
Anyway, if it is just spaces, can you just parse through the string and replace spaces in fields with an empty string?
Something like: message.replaceAll("\\| \\|", "||"); <-- This is Java code
That previous code would replace all instances of '| |' with '||' (i.e. replace fields with a space with an empty string).
Hope that helps.
Cheers
It seems your problem is that there are wrong segment separators.
As it would be possible to find just all segment headers as a combination of a blank followed by a known segment header and a field delimiter and to replace the blank by the correct segment separator, there is no guarantee, that you will not get the same combination by chance at a position different from the start of a segment.
So best advice would be to avoid the wrong segment separators und to provide it right.

Best convention of tcp-messaging

I'am using this message convetion : %total_msg_length%|%msg_body% to recieve string data over tcp-sockets (python/pyqt). Is this is the good convetion, or should i try something else?
It's not uncommon.
Another way than having a separator (like your |) would be to have the message length be fixed size, like always 4 or 8 characters. Then you can read 4 (or 8 or what you choose) to get the message size. The problem with this is that you have to make at least two calls to recv: One for the length and one for the body.

Resources