The HA's ePR Allergy HL7 Message contains the following data
1) Name of Drug Allergy e.g. Ampicillin ------- in OBX 5.1
2) Clinical Manifestation of Drug Allergy, e.g. Rash ---- in OBX 5.1 of the OBX segment labelled Manifestation
3) Additional Information, e.g. Rash resolved after Piriton --- in NTE segment follow the OBX
4) Level of Certainty, e.g. Suspected --- in OBX 5.6
5) Date of the information, e.g. 1 March 1998 --- in OBX 14.1
Sample Input HL7 Message:
Innovian can accept and populate the first 4 types of data, but not the 'date of the allergy information'.
Mirth Connect (Javascript Transformer) is used to push the data in OBX14.1 to append to the OBX5.1 data.
JAVASCRIPT CODE:
//The objective of the transformer is to copy OBX 14 (convert to Date) to the OBX 5
// to alternative OBX under manifestation
for each (seg in msg..OBX)
{
var combined = seg['OBX.14']['OBX.14.1'].toString();
seg['OBX.13']['OBX.13.1'] = '(' + combined.substring(6,8) + '/' + combined.substring(4,6) + '/' + combined.substring(0,4) +')';
}
for(var i = 0; i< msg['OBX'].length(); i++) {
if( i % 2 == 0) {
msg['OBX'][i]['OBX.5']['OBX.5.1']= msg['OBX'][i]['OBX.5']['OBX.5.1'].toString();
}
else {
msg['OBX'][i]['OBX.5']['OBX.5.1']= msg['OBX'][i]['OBX.5']['OBX.5.1'].toString() + ' ' + ' ' + ' ' + msg['OBX'][i]['OBX.13']['OBX.13.1'].toString();
}
Output HL7 Message is transformed to become:
Innovian Allergy Box becomes:
Now, Innovian will have all the following information populated in the allergy box
1) Name of Drug Allergy e.g. Ampicillin
2) Manifestation of Drug Allergy, e.g. Rash
3) Additional Information (in Comment)
4) Level of Certainty, e.g. Suspected
5) Date of the information (appended under manifestation)