I am receiving ORU messages that sometimes contain OBX and NTE segments, and sometimes do not. I have configured the system to contain the segments. Everything works fine when the messages contain the segments, but errors when the message does not contain them. How can I configure the system to see the segments as optional?
Announcement
Collapse
No announcement yet.
All segments not always present in Inbound messages
Collapse
X
-
Re: All segments not always present in Inbound mes
I put a little piece of code in place to check for the presence of the segment.
See below for an example.
Code:var checkSeg = msg['NTE'].toString(); if (checkSeg != ""«») { var ntei = 0; var tempNTE = ""; while (msg['NTE']['NTE.1']['NTE.1.1'][ntei] != null) { tempNK1 = msg['NTE']['NTE.1']['NTE.1.1'][ntei].toString(); if (tempNTE.length > 0) { /* do your mappings here */ } /* increment the index to move on to the next one */ ntei++; } } else { /* do something here like mapping null to values or something if needed*/ }
Comment
-
Comment