Sidebar

how can i identify a NTE or ADD segment .

0 votes
651 views
asked Feb 28, 2019 by (190 points)
How can i identify a NTE or ADD segment . which NTE or ADD segment comes under which segment for example which observation ?

if i have 23 observation result .one NTE is under OBX-21. how can i know NTE is for OBX-21. In qvera we can only fetch all the nodes all together and itrate through it.

1 Answer

0 votes

You will use a group in your HPATH. You then iterate over those groups. Here is a KB to get you started:

https://www.qvera.com/kb/index.php/826/would-format-nested-loop-operate-group-hl7-message-segments?show=826#q826

There is a For-Loop Generator that will help you as well:

Here is a quick example as well:

var obxGroups = message.getAllNodes('OBX[group=!OBX]');
for (var obxGroup = 0; obxGroup < obxGroups.length; obxGroup++) {
   var obxGroupParsed = qie.parseHL7String(obxGroups[obxGroup]);
   var nteSegs = obxGroupParsed.getAllNodes('NTE');
   for (var nteSeg = 0; nteSeg < nteSegs.length; nteSeg++) {
      var netSegmentParsed = qie.parseHL7String(nteSegs[nteSeg]);
      var nte3 = netSegmentParsed.getNode('NTE-3');
      if (StringUtils.equalsIgnoreCase( nte3, 'cough')) {
         qie.info('obx ' + (obxGroup+1) + ' has the an NTE with value cough in NTE-3');
      }
      //Update to cold instead of cough
      message.setNode('OBX[group=!obx:' + obxGroup + ']/NTE-3', 'cold');
   }
}

answered Feb 28, 2019 by brandon-w-8204 (33,270 points)
edited Feb 28, 2019 by brandon-w-8204
...