In this tutorial we’ll discuss how generate a 999 or 997 Acknowledgement EDI using NodeJS. After validating EDI data using the EDIValidator component acknowledgment data can be generated.
EDIValidator takes two parameters, a validation rules file and the EDI data to validate. The overall validation process looks like the diagram below.
A validation rule file contains all the data elements, segments, and loop meta data pertaining to a specific implementation guide.
The first step is to load and validate EDI data. In this tutorial we will validate 5010 271 EDI data.
The Code
const fs = require(‘fs’);
let validator = new edi.EDIValidator();
//Load a 5010 270 Validation Rules File
let validationRules = fs.readFileSync(‘Validation Rules/5010/Rules_5010_270_005010X279A1.Rules’).toString();
The second step is to generate 999 Acknowledgement data from the EDIValidator
The Code
Sample 999 Output
ISA*00*……….*01*SECRET….*ZZ*RECEIVERS.ID…*ZZ*SUBMITTERS.ID..*190828*1207*^*00501* 1*1*T*:~GS*FA*RECEIVERCODE*SENDER CODE*20190828*1207*1*X*005010X231A1~ST*999* 1*005010X231A1~AK1*HS*1*005010X279A1~AK2*271*1234*005010X279A1~IK5*A~AK9*P*1*1*1~SE*6* 1~GE*1*1~IEA*1* 1~