web stats
Mirth Community - View Single Post - Example Lab Report
View Single Post
  #2  
Old 06-21-2019, 12:02 AM
ASIFM786 ASIFM786 is offline
Mirth Newb
 
Join Date: Oct 2008
Posts: 17
ASIFM786
Smile

currently i have used this layout... but i cannot combine them all together :-

var results = new XML('<tbody></tbody>');
var tr;

for each (mOBX in msg..OBX) {

tr = new XML('<tr></tr>');

tr['td'][0] = '';
if (mOBX['OBX.8']['OBX.8.1'].toString() != "N") {
tr['td'][0]['img']['@src'] = '/mirth/graphics/flag_red.png';
}
// Test Name
tr['td'][1] = mOBX['OBX.3']['OBX.3.2'].toString();
// Result
tr['td'][2] = mOBX['OBX.5']['OBX.5.1'].toString() + " "+ mOBX['OBX.6']['OBX.6.1'].toString();
// Flag - Red if not N = normal
tr['td'][3] = mOBX['OBX.8']['OBX.8.1'].toString();
// Reference range
tr['td'][4] = mOBX['OBX.7']['OBX.7.1'].toString() + " " + mOBX['OBX.6']['OBX.6.1'].toString();

results[''] += tr;
}

channelMap.put("Results",results);
Reply With Quote