Sidebar

Adding ORC to an ORU file

0 votes
414 views
asked Mar 24, 2015 by jeremy-c-6009 (300 points)
We are working with a vendor that is requesting ORU files for specific labs.  They typically receive these directly from the Lab, so their system is coded expecting the ORC record, which is not included by CPS.

ORC should just be static, but needs to be inserted prior to the first OBR record.

I can rebuild the File by rewriting the MSH, PID, PV1, adding the ORC, however am not able to figure out how to write out the repeating OBR/OBX records.

1 Answer

+1 vote

You can do this by specifying the instance in the Hpath of the  message.addChildBefore function. 

// Get OBR segment count
var obrCount = message.getCount('OBR');
// Loop through each OBR and add the ORC segment
for (var i=1 ; i <= obrCount ; i++) {
   message.addChildBefore('OBR[' + i + ']', 'ORC', 'ORC|' + i + '|||12345');
}
answered Mar 24, 2015 by brandon-w-8204 (33,270 points)
...