Generate X12 999 Implementation Acknowledgment Last updated: 2023-04-24
X12 HIPAA 999 Specification
X12 999 specification is available at:
ediFabric .NET C# Examples
The example below is part of the ediFabric .NET C# Code Examples.
Additional operations for X12 999
How to generate X12 999 with ediFabric .NET
var edi = File.OpenRead(Directory.GetCurrentDirectory() + @"\..\..\..\Files\X12\PurchaseOrderInvalid.txt");
var processedMessages = new ConcurrentBag();
var settings = new AckSettings
{
AckHandler = (s, a) =>
{
var tsTa1 = a.Message as TSTA1;
var ts997 = a.Message as TS997;
if (tsTa1 != null)
{
// a.Message is TA1
}
if (ts997 != null)
{
var allFailed = ts997.AK2Loop1.Where(f => f.AK5.TransactionSetAcknowledgmentCode_01 == "R").ToList();
var allAccepted = ts997.AK2Loop1.Where(f => f.AK5.TransactionSetAcknowledgmentCode_01 == "A").ToList();
foreach (var failedMessage in allFailed)
{
if (processedMessages.Contains(failedMessage.AK2.TransactionSetControlNumber_02))
{
failedMessage.AK5.TransactionSetAcknowledgmentCode_01 = "E";
}
}
var ack = AckBuilders.BuildAck(a.InterchangeHeader, a.GroupHeader, ts997, AckVersion.X12_997);
Debug.Write(ack);
}
},
MessageHandler = (s, a) =>
{
if (a.ErrorContext.HasErrors)
{
// In case we decide to process the message anyway, preserve the control number
processedMessages.Add(a.Message.ErrorContext.ControlNumber);
// Process the invalid message
// Reject message
// Log/report it
// Inspect MessageErrorContext for the validation errors
var errors = a.ErrorContext.Flatten();
Debug.WriteLine("Message {0} with control number {1} is invalid with errors:", a.ErrorContext.Name, a.ErrorContext.ControlNumber);
foreach (var error in errors)
{
Debug.WriteLine(error);
}
}
},
AckVersion = AckVersion.X12_997,
// Turn off AK2 for valid messages to reduce size
GenerateForValidMessages = false
};
using (var ackMan = new Plugins.Acknowledgments.X12.AckMan(settings))
{
using (var ediReader = new X12Reader(edi, "EdiFabric.Examples.X12.Templates.V4010"))
{
while (ediReader.Read())
ackMan.Publish(ediReader.Item);
}
}X12 HIPAA 999 Implementation Acknowledgment
The EDI 999 transaction set is an Implementation Acknowledgement document, developed specifically to replace the 997 Functional Acknowledgement document for use in healthcare. Both the 997 and the 999 are used to confirm that a file was received. However, the 999 reports whether the transaction is in compliance with HIPAA requirements.
The 999 transaction set becomes the standard acknowledgment document for healthcare as of March 2012, when version 5010 of the HIPAA EDI standards take effect. The exception to this is the use of a 277 Healthcare Status Notification transaction, used specifically to confirm the receipt of a 276 Health Claim Status Request transaction.
