Update: 2023-03-25
837 - Health Care Claim
Important
Bishop's X12 NET SDK adheres to the 837 Claims for Healthcare Insurance defined as:
Professional in the ASC X12N/005010X222 Errata A1, Version 5, Release 1, ASC X12 Standards for Electronic Data Interchange, Technical Report Type 3 Implementation Guide (May 2006)
Institutional in the ASC X12N/005010X223 Errata A2, Version 5, Release 1, ASC X12 Standards for Electronic Data Interchange, Technical Report Type 3 Implementation Guide (May 2006)
Dental in the ASC X12N/005010X224 Errata A2, Version 5, Release 1, ASC X12 Standards for Electronic Data Interchange, Technical Report Type 3 Implementation Guide (May 2006)
Please obtain and reference this implementation guide for a detailed explanation of the 837 transaction set and to understand how it defines uniform data content, identifies valid code tables and specifies values applicable for the business focus of the 837.
The 837 is used to submit health care claim billing information, encounter information, or both, by providers of health care products and services to payers for adjudication and remittance.
The 837 is intended to originate with the health care provider or the health care provider’s designated agent and in some instances, it can originate with a health care payer to report a health care encounter to another payer or some sponsoring organization. For example, it may also be used to transmit health care claims and billing payment information between payers with different payment responsibilities where coordination of benefits (COB) is required, or between payers and regulatory agencies for the purpose of monitoring the rendering, billing, and/or payment of health care services.
The 837 must provide all of the necessary information to allow the payer to at least begin to adjudicate the claim and in response it coordinates with a variety of other transactions including, but not limited to 277, the 835 and the Functional Acknowledgment (999).
Create an 837 from scratch
Creating a simple 837 Professional
The following code creates and saves to disk a single Professional bill (aka HCFA1500 or CMS1500) using defaults where ever possible. This 837 has one group, one transaction, one patient, and one claim with one service line. The resulting file can be transferred to the receiving trader as is or it can it be batched with other 837 transactions.
public void Create837P()
{
// Create a X12Doc object passing in the receiver's Interchanged ID Qualifier, the Receiver's ETIN and
// your control number for the Interchange. The sender information is already defined in the X12Source object
// passed to X12Api.Init().
using X12Doc xDoc = X12Doc.Create("ZZ", "ABC123", 1);
// Create a X12Group for professional claims and its first 837P X12Transaction
using X12Transaction ts837P = xDoc
.AddProfessionalClaimGroup(1)
.AddOriginalTransaction(1)
.ToReceiver("McDuck TPA"); // This is the destination (Receiver) of this EDI transaction
// If you are the biller, this would be your information
var billerLevel = ts837P
.AddBillerLevel()
.ForBiller("My Billing Company", "9999999999", "081234567")
.WithAddress("123 Mocking Bird Dr", string.Empty, "Sommerset", "NJ", "08104")
.SendPaymentTo(X12EntityType.NonPerson, "State Road 101", "Box 100", "Atlanta", "GA", "10002");
// The subscriber is the employer in worker compensation
var subscriberLevel = ts837P
.AddSubscriberLevel()
.WithSubscriber(X12EntityType.NonPerson, "Disney Adventures")
.WithPayer("McDuck TPA", "MDT01")
.WithAddress("123 Main St", string.Empty, "Orlando", "FL", "321235");
// Now create a Patient / Claim section of the bill
var patientLevel = ts837P
.AddPatientLevel()
.ForPatient("Minnie", string.Empty, "Mouse", string.Empty, new DateTime(1943, 3, 7), X12Gender.Female)
.WithAddress("123 Disney Lane", string.Empty, "Orlando", "FL", "32123");
// Now add the actual claim for the patient with appropriate details
var claim = patientLevel
.AddClaim("A37YH556", 50094,
X12FacilityCode.Office,
X12ClaimFreqCode.Original,
X12YesNo.Yes,
X12PlanParticipationCode.Assigned,
X12YesNoNA.Yes,
X12YesNo.Yes,
X12YesNo.Yes,
X12RelatedCause.Employment)
.WithDateOfInjury(new DateTime(2022, 12, 31))
.WithFileInfo("LUMI")
.WithNote(X12NoteCode.Additional, "Related Notes")
.WithReport("report1.pdf") // Add references to attachments
.WithReport("report2.pdf")
.WithPrincipleDiagnosis("8920")
.WithRepricing(X12RepriceMethod.ContractualPercentage, 50094, 10000, "L1000", 40094, string.Empty, 0);
claim
.WithReferredBy("Bugs", string.Empty, "Bunny", string.Empty)
.WithRenderedBy("Daisy", string.Empty, "Duck", string.Empty)
.WithFacility("Disney Medical Clinic")
.WithAddress("123 Disney Terrace", string.Empty, "Orlando", "FL", "32124");
// Add a service line to the claim
claim.AddServiceLine()
.WithService("HC", "99211", "25", string.Empty, string.Empty, string.Empty, "Description", 50094, "UN", "1", "1", string.Empty, string.Empty, string.Empty)
.WithDateOfService(new DateTime(2023, 1, 1));
// Call Refresh to update internal data elements (i.e., hierarchical codes, segment counters, control numbers for the entire transaction).
xDoc.Refresh();
// Save the transaction to a file.
xDoc.Save(@"C:\Temp\ClaimPro.837", X12DocOptions.InsertCrLf | X12DocOptions.UseUpperCase);
}
Creating a simple 837 Institutional
The following code creates a single Institutional bill (aka UB04 or CMS1450) using defaults where ever possible. This 837 has one group, one transaction, one patient, and one claim with one service line. The resulting file can be transferred to the receiving trader as is or it can it be batched with other 837 transactions.
public void Create837I()
{
// Create a X12Doc object passing in the receiver's Interchanged ID Qualifier, the Receiver's ETIN and
// your control number for the Interchange. The sender information is already defined in the X12Source object
// passed to X12Api.Init().
using X12Doc xDoc = X12Doc.Create("ZZ", "ABC123", 1);
// Create a X12Group for institutional claims and its first 837I X12Transaction
using X12Transaction ts837P = xDoc
.AddInstituationalClaimGroup(1)
.AddOriginalTransaction(1) // Loop 1000A is automatically applied
.ToReceiver("McDuck TPA");
// If you are the biller, this is your information
var billerLevel = ts837P
.AddBillerLevel()
.ForBiller("My Billing Company", "9999999999", "081234567")
.WithAddress("123 Mocking Bird Dr", string.Empty, "Sommerset", "NJ", "08104")
.SendPaymentTo(X12EntityType.NonPerson, "State Road 101", "Box 100", "Atlanta", "GA", "10002");
var subscriberLevel = ts837P
.AddSubscriberLevel()
.WithSubscriber(X12EntityType.NonPerson, "Disney Adventures")
.WithPayer("McDuck TPA", "MDT01")
.WithAddress("123 Main St", string.Empty, "Orlando", "FL", "321235");
// Now create a Patient / Claim section of the bill
var patientLevel = ts837P
.AddPatientLevel()
.ForPatient("Minnie", string.Empty, "Mouse", string.Empty, new DateTime(1943, 3, 7), X12Gender.Female)
.WithAddress("123 Disney Lane", string.Empty, "Orlando", "FL", "32123");
// Now add the actual claim for the patient with appropriate details
var claim = patientLevel
.AddClaim("A37YH556", 50094,
X12FacilityCode.Office,
X12ClaimFreqCode.Original,
X12YesNo.Yes,
X12PlanParticipationCode.Assigned,
X12YesNoNA.Yes,
X12YesNo.Yes,
X12YesNo.Yes,
X12RelatedCause.Employment)
.WithDateOfStatement(new DateTime(2022, 12, 31), new DateTime(2023, 1, 5))
.WithClaimCode("1", "7", "30")
.WithFileInfo("LUMI")
.WithNote(X12NoteCode.Additional, "Related Notes")
.WithReport("report1.pdf")
.WithReport("report2.pdf")
.WithPrincipleDiagnosis("8920")
.WithAdmittingDiagnosis("T8741")
.WithReasonForVisit("S72142A")
.WithOccurence("04", new DateTime(2022, 12, 31))
.WithRepricing(X12RepriceMethod.ContractualPercentage, 50094, 10000, "L1000", 40094, string.Empty, 0);
claim
.WithReferredBy("Bugs", string.Empty, "Bunny", string.Empty)
.WithRenderedBy("Daisy", string.Empty, "Duck", string.Empty)
.WithFacility("Disney Medical Clinic")
.WithAddress("123 Disney Terrace", string.Empty, "Orlando", "FL", "32124");
// Add a service line to the claim
claim.AddServiceLine()
.WithService("RC100", "HC", "99211", "25", string.Empty, string.Empty, string.Empty, "Description", 50094, "UN", "1", 0)
.WithDateOfService(new DateTime(2023, 1, 1));
// Refresh is necessary to update internal data elements (i.e., hierarchical codes, segment counters, control numbers for the entire transaction).
xDoc.Refresh();
// Save the transaction to a file.
xDoc.Save(@"C:\Temp\ClaimInst.837", X12DocOptions.InsertCrLf | X12DocOptions.UseUpperCase);
}
Batch multiple 837 Transactions into a Single 837 File
Rather then sending many individual bills to a destination, batching is the process of combining individual 837 bill files into a single 837. For example, instead of sending one hundred 837 bills to a payer, a billing provider is advised to combine (batch) all one hundred 837 bills into a single 837 file. This produces significant efficiencies including a smaller payload, less connectivity, easier tracking and troubleshooting, and more.
Note
Although it usually isn't done, all of the following transactions can be batched into a single file 837 (P/I/D), 835 and 277. The GS/GE segments keep the transactions separated for correct processing. For example, 837P will be grouped in the 005010X222 group, while the the 837I will be grouped in the 005010X223 and so on. The SDK automatically figures out how to best batch your transaction however to specify a particular method see X12BatchOptions.
837's are batched by the claim detail (Loop 2300). The claim detail is positioned in the hierarchical level that defines its owner-participant. When the Patient is the Subscriber the Claim detail is placed following loop 2010BB in the Subscriber hierarchical. When the Patient is not the Subscriber, the Claim detail is placed at the Patient hierarchical level which is 2000C.
public void Batch()
{
// collection of actual files to test
FileList filesToBatch = new() {
@"C:\Temp\ClaimInst.837",
@"C:\Temp\ClaimPro.837"
};
List<X12Doc> docs = new();
// Load each individual file
foreach (var file in filesToBatch)
docs.Add(X12Doc.Load(file.FullName));
// Combined the 837's into one or more batch files. The SDK will automatically produce individual
// batch files by destination
var batchedFiles = X12Api.Batch(docs);
// For each destination create a batch file
foreach (X12Doc batchFile in batchedFiles)
{
// Define the destination receiver
string filename = Path.Combine(@"C:\temp\", "batch_" + Path.GetFileNameWithoutExtension(filesToBatch[0].Name) + Path.GetExtension(filesToBatch[0].Extension));
batchFile.Save(filename, X12DocOptions.InsertCrLf);
}
// Remember to clean up resources
foreach (var doc in docs)
doc.Dispose();
}
Load an 837 from file
Read an 837 from a file.
public void Load837()
{
try
{
// 837 file to load
string filename = @"C:\Temp\ClaimPro.837";
// Load an 837 transaction
using X12Doc x837 = X12Doc.Load(filename);
// Generate the 999 transaction in response to the 837. If the 837 contains interchange errors
// the 999 will only contain the ISA/TA1/IEA interchange segments where the TA1 will indicate
// the error as to why the 837 could not be processed.
//
// If the 837 does not contain interchange errors and the 837 contains a request for a TA1 segment
// (see ISA14) then the TA1 will be placed immediately after the ISA segment followed by the
// remainder of the appropriate 999 segments.
// if the 837 does not contain interchange errors and the 837 does not request a TA1 segment
// then only the appropriate 999 segments.
using X12Doc x999 = x837.Generate999(1);
x999.Save(filename + ".999", X12DocOptions.InsertCrLf);
}
catch (X12Exception e)
{
Console.WriteLine(e.ToString());
}
}
Split the 837 into Individual Transactions
Splitting transactions is the process of creating complete individual transactions consisting of one Claim, Payment Advise, or Claim Acknowledgement. 837's are split by claim.
[TODO: Insert sample code]