This article provides guidelines on how to generate the Reject Acknowledgement when inbound HL7 data parsing fails with fatal exception. It also provide the guidelines on how to extract Version ID, Processing ID and Message Control ID fields from the incoming payload and dynamically populate
%dw 2.0
output application/json
var aux = (payload splitBy("\r"))[0] splitBy("|")
var pt = aux[sizeOf(aux)-1]
var version = aux[sizeOf(aux)-2]
var controlNumber = aux[sizeOf(aux)-3]
var msaError = "AR"
var errorCode = "207"
var errorDesc = error.description
---
{
"Name":"ACK",
"MSH":null,
"Id":"ACK",
"Data":{
"ACK":{
"MSH":{
"MSH-10":"76173",
"MSH-08":"29379",
"MSH-11":{"PT-01":version},
"MSH-12":{"VID-01":pt},
"MSH-03":{"HD-01":""},
"MSH-04":{"HD-01":""},
"MSH-05":{"HD-01":""},
"MSH-06":{"HD-01":""},
"MSH-07":{"TS-01":""},
"MSH-09":{
"MSG-03":"ACK",
"MSG-02":"A01",
"MSG-01":"ACK"}
},
"ERR":[{
"ERR-01":[
{
"ELD-04":{
"CE-01":errorCode,
"CE-02":errorDesc,
"CE-03":"HL80358"
},
"ELD-01":"PV1",
"ELD-02":1,
"ELD-03":3
}
]
}],
"MSA":{"MSA-02":controlNumber, "MSA-01":msaError}
}
}
}
001115823

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.