Sidebar
0 votes
57 views
by troy-l-7522 (160 points)

I have a vendor that is rejecting messages that have a NTE immediately following an ORC. They say that a NTE can't be associated with an ORC. According to my Google-Fu, it is OK to have a NTE follow an ORC.
Example:

ORC|RE|OID_ID00017279220250616082456|2506160233|OID_06BQGX47BXNAX61WN5G2||||||^  Kramer^Kayla||SC^CANANNA^SREEN|^^^CRSC West&LH_BJ596521083_9|(906) 366-1999^^^^^906^3661999|20250616095223|||||

NTE|1||Special Chemistry testing done at The CRSC Central Lab 790 Kovor Ave. SE, Grand Marais, MI 49762 p.906-366-4499, f.906-366-9662

How do I remove only the said NTE from the message without removing the other NTEs?

1 Answer

0 votes

Yes a NTE is valid after A ORC segment. However some systems do not accept it. You can use the following mapping that uses a regex to remove them.

var nteRemoved = (message.getNode("/") + '').replace(/(ORC.*\r)(NTE.*\r)+(OBR.*)/gm,'$1$3');

message.setNode('/', nteRemoved);

by brandon-w-8204 (34.2k points)
...