The 834 is the HIPAA transaction employers, plan sponsors, government agencies and health insurance exchanges use to enroll members in a health plan, change their coverage, or terminate it.
Each member is an INS loop (2000) with the member's name and demographics, followed by HD health coverage loops with the plan, coverage level and effective dates. Files are either full replacements of the membership or change files that only carry updates.
005010X220A1BE (GS01)TS834 in EdiFabric.Templates.HipaaThe full X12 834 layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 21 loops and 76 segment positions, in file order. Loops are shaded and their segments indented; Max use is how many times a segment or loop may repeat.
| Segment / loop | Name | Usage | Max use |
|---|---|---|---|
ST | Transaction Set Header | Required | 1 |
BGN | Beginning Segment | Required | 1 |
REF | Transaction Set Policy Number | Situational | 1 |
DTP | File Effective Date | Situational | >1 |
QTY | Transaction Set Control Totals | Situational | 3 |
| Any order | The loops below can appear in any order | Required | 1 |
| Loop 1000A | Sponsor Name | Required | 1 |
N1 | Sponsor Name | Required | 1 |
| Loop 1000B | Payer | Required | 1 |
N1 | Payer | Required | 1 |
| Loop 1000C | TPA Broker Name | Situational | 2 |
N1 | TPA Broker Name | Required | 1 |
| Loop 1100C | TPA Broker Account Information | Situational | 1 |
ACT | TPA Broker Account Information | Required | 1 |
| Loop 2000 | Member Level Detail | Required | >1 |
INS | Member Level Detail | Required | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
REF | Subscriber Identifier | Required | 1 |
REF | Member Policy Number | Situational | 1 |
REF | Member Supplemental Identifier | Situational | 13 |
DTP | Member Level Dates | Situational | 24 |
| Any order | The loops below can appear in any order | Required | 1 |
| Loop 2100A | Member Name | Required | 1 |
NM1 | Member Name | Required | 1 |
PER | Member Communications Numbers | Situational | 1 |
N3 | Member Residence Street Address | Situational | 1 |
N4 | Member City State ZIP Code | Situational | 1 |
DMG | Member Demographics | Situational | 1 |
EC | Employment Class | Situational | >1 |
ICM | Member Income | Situational | 1 |
AMT | Member Policy Amounts | Situational | 7 |
HLH | Member Health Information | Situational | 1 |
LUI | Member Language | Situational | >1 |
| Loop 2100B | Incorrect Member Name | Situational | 1 |
NM1 | Incorrect Member Name | Required | 1 |
DMG | Incorrect Member Demographics | Situational | 1 |
| Loop 2100C | Member Mailing Address | Situational | 1 |
NM1 | Member Mailing Address | Required | 1 |
N3 | Member Mail Street Address | Required | 1 |
N4 | Member Mail City State ZIP Code | Required | 1 |
| Loop 2100D | Member Employer | Situational | 3 |
NM1 | Member Employer | Required | 1 |
PER | Member Employer Communications Numbers | Situational | 1 |
N3 | Member Employer Street Address | Situational | 1 |
N4 | Member Employer City State ZIP Code | Situational | 1 |
| Loop 2100E | Member School | Situational | 3 |
NM1 | Member School | Required | 1 |
PER | Member School Commmunications Numbers | Situational | 1 |
N3 | Member School Street Address | Situational | 1 |
N4 | Member School City State ZIP Code | Situational | 1 |
| Loop 2100F | Custodial Parent | Situational | 1 |
NM1 | Custodial Parent | Required | 1 |
PER | Custodial Parent Communications Numbers | Situational | 1 |
N3 | Custodial Parent Street Address | Situational | 1 |
N4 | Custodial Parent City State ZIP Code | Situational | 1 |
| Loop 2100G | Responsible Person | Situational | 13 |
NM1 | Responsible Person | Required | 1 |
PER | Responsible Person Communications Numbers | Situational | 1 |
N3 | Responsible Person Street Address | Situational | 1 |
N4 | Responsible Person City State ZIP Code | Situational | 1 |
| Loop 2100H | Drop Off Location | Situational | 1 |
NM1 | Drop Off Location | Required | 1 |
N3 | Drop Off Location Street Address | Situational | 1 |
N4 | Drop Off Location City State ZIP Code | Situational | 1 |
| Loop 2200 | Disability Information | Situational | >1 |
DSB | Disability Information | Required | 1 |
DTP | Disability Eligibility Dates | Situational | 2 |
| Loop 2300 | Health Coverage | Situational | 99 |
HD | Health Coverage | Required | 1 |
DTP | Health Coverage Dates | Required | 6 |
AMT | Health Coverage Policy | Situational | 9 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Health Coverage Policy Number | Situational | 14 |
REF | Prior Coverage Months | Situational | 1 |
IDC | Identification Card | Situational | 3 |
| Loop 2310 | Provider Information | Situational | 30 |
LX | Provider Information | Required | 1 |
NM1 | Provider Name | Required | 1 |
N3 | Provider Address | Situational | 2 |
N4 | Provider City State ZIP Code | Situational | 1 |
PER | Provider Communications Numbers | Situational | 2 |
PLA | Provider Change Reason | Situational | 1 |
| Loop 2320 | Coordinationof Benefits | Situational | 5 |
COB | Coordinationof Benefits | Required | 1 |
REF | Additional Coordinationof Benefits Identifiers | Situational | 4 |
DTP | Coordinationof Benefits Eligibility Dates | Situational | 2 |
| Loop 2330 | Coordinationof Benefits Related Entity | Situational | 3 |
NM1 | Coordinationof Benefits Related Entity | Required | 1 |
N3 | Coordinationof Benefits Related Entity Address | Situational | 1 |
N4 | Coordinationof Benefits Other Insurance Company City State ZIP Code | Situational | 1 |
PER | Administrative Communications Contact | Situational | 1 |
| Loop LS | Additional Reporting Categories | Situational | 1 |
LS | Additional Reporting Categories | Required | 1 |
| Loop 2700 | Member Reporting Categories | Situational | >1 |
LX | Member Reporting Categories | Required | 1 |
| Loop 2750 | Reporting Category | Situational | 1 |
N1 | Reporting Category | Required | 1 |
REF | Reporting Category Reference | Situational | 1 |
DTP | Reporting Category Date | Situational | 1 |
LE | Additional Reporting Categories Termination | Required | 1 |
SE | Transaction Set Trailer | Required | 1 |
Usage follows the 005010X220A1 implementation guide: Required segments must be sent, Situational ones only when the guide's condition applies. Trading partners often add their own rules in companion guides - ediFabric templates can be adjusted to match. Open the element-level definition in the EdiNation spec library.
An enrollment for one subscriber with health coverage details. Paste it into EdiNation to see every element named and validated.
ISA*00* *00* *ZZ*386028429 *30*382328142 *050221*0602*U*00501*000012345*0*P*:~ GS*BE*386028429*382328142*20050221*0602*000012345*X*005010X220A1~ ST*834*12345*005010X220A1~ BGN*00*12456*19980520*1200****2~ N1*P5**FI*999888777~ N1*IN**FI*654456654~ INS*Y*18*021*20*A***FT~ REF*0F*123456789~ REF*1L*123456001~ DTP*356*D8*19960523~ NM1*IL*1*DOE*JOHN*P***34*123456789~ PER*IP**HP*7172343334*WP*7172341240~ N3*100 MARKET ST*APT 3G~ N4*CAMP HILL*PA*17011**CY*CUMBERLAND~ DMG*D8*19400816*M~ HD*021**HLT~ DTP*348*D8*19960601~ COB*P*890111*5~ HD*021**DEN~ DTP*348*D8*19960601~ HD*021**VIS~ DTP*348*D8*19960601~ SE*21*12345~ GE*1*000012345~ IEA*1*000012345~
ediFabric turns every loop, segment and element into a named field. This is the transaction from the sample, in the JSON that ediFabric Native and Cloud return and accept.
{
"ST": {
"TransactionSetIdentifierCode_01": "834",
"TransactionSetControlNumber_02": "12345",
"ImplementationConventionPreference_03": "005010X220A1"
},
"BGN_BeginningSegment": {
"TransactionSetPurposeCode_01": "00",
"TransactionSetReferenceNumber_02": "12456",
"TransactionSetCreationDate_03": "19980520",
"TransactionSetCreationTime_04": "1200",
"ActionCode_08": "2"
},
"AllN1": {
"Loop1000A": {
"N1_SponsorName": {
"EntityIdentifierCode_01": "P5",
"IdentificationCodeQualifier_03": "FI",
"IntermediaryBankIdentifier_04": "999888777"
}
},
"Loop1000B": {
"N1_Payer": {
"EntityIdentifierCode_01": "IN",
"IdentificationCodeQualifier_03": "FI",
"IntermediaryBankIdentifier_04": "654456654"
}
}
},
"Loop2000": [
{
"INS_MemberLevelDetail": {
"InsuredIndicator_01": "Y",
"IndividualRelationshipCode_02": "18",
"MaintenanceTypeCode_03": "021",
"MaintenanceReasonCode_04": "20",
"BenefitStatusCode_05": "A",
"EmploymentStatusCode_08": "FT"
},
"AllREF": {
"REF_SubscriberIdentifier": {
"ReferenceIdentificationQualifier_01": "0F",
"MemberGrouporPolicyNumber_02": "123456789"
},
"REF_MemberPolicyNumber": {
"ReferenceIdentificationQualifier_01": "1L",
"MemberGrouporPolicyNumber_02": "123456001"
}
},
"DTP_MemberLevelDates": [
{
"DateTimeQualifier_01": "356",
"DateTimePeriodFormatQualifier_02": "D8",
"DateTimePeriod_03": "19960523"
}
],
"AllNM1": {
"Loop2100A": {
"NM1_MemberName": {
"EntityIdentifierCode_01": "IL",
"EntityTypeQualifier_02": "1",
"ResponseContactLastorOrganizationName_03": "DOE",
"ResponseContactFirstName_04": "JOHN",
"ResponseContactMiddleName_05": "P",
"IdentificationCodeQualifier_08": "34",
"ResponseContactIdentifier_09": "123456789"
},
"PER_MemberCommunicationsNumbers": {
"ContactFunctionCode_01": "IP",
"CommunicationNumberQualifier_03": "HP",
"ResponseContactCommunicationNumber_04": "7172343334",
"CommunicationNumberQualifier_05": "WP",
"ResponseContactCommunicationNumber_06": "7172341240"
},
"N3_MemberResidenceStreetAddress": {
"ResponseContactAddressLine_01": "100 MARKET ST",
"ResponseContactAddressLine_02": "APT 3G"
},
"N4_MemberCity_State_ZIPCode": {
"AdditionalPatientInformationContactCityName_01": "CAMP HILL",
"AdditionalPatientInformationContactStateCode_02": "PA",
"AdditionalPatientInformationContactPostalZoneorZIPCode_03": "17011",
"LocationQualifier_05": "CY",
"LocationIdentifier_06": "CUMBERLAND"
},
"DMG_MemberDemographics": {
"DateTimePeriodFormatQualifier_01": "D8",
"DependentBirthDate_02": "19400816",
"DependentGenderCode_03": "M"
}
}
},
"Loop2300": [
{
"HD_HealthCoverage": {
"MaintenanceTypeCode_01": "021",
"InsuranceLineCode_03": "HLT"
},
"DTP_HealthCoverageDates": [
{
"DateTimeQualifier_01": "348",
"DateTimePeriodFormatQualifier_02": "D8",
"DateTimePeriod_03": "19960601"
}
],
"Loop2320": [
{
"COB_CoordinationofBenefits": {
"PayerResponsibilitySequenceNumberCode_01": "P",
"MemberGrouporPolicyNumber_02": "890111",
"CoordinationofBenefitsCode_03": "5"
}
}
]
},
{
"HD_HealthCoverage": {
"MaintenanceTypeCode_01": "021",
"InsuranceLineCode_03": "DEN"
},
"DTP_HealthCoverageDates": [
{
"DateTimeQualifier_01": "348",
"DateTimePeriodFormatQualifier_02": "D8",
"DateTimePeriod_03": "19960601"
}
]
},
{
"HD_HealthCoverage": {
"MaintenanceTypeCode_01": "021",
"InsuranceLineCode_03": "VIS"
},
"DTP_HealthCoverageDates": [
{
"DateTimeQualifier_01": "348",
"DateTimePeriodFormatQualifier_02": "D8",
"DateTimePeriod_03": "19960601"
}
]
}
]
}
],
"SE": {
"NumberofIncludedSegments_01": "21",
"TransactionSetControlNumber_02": "12345"
}
}Read the file into typed objects with ediFabric .NET, convert it to JSON in process with the ediFabric Native bindings for Python, Java and C, or post it to the ediFabric Cloud REST API from any language.
using EdiFabric.Templates.Hipaa5010; License.SetSerial("YOUR_SERIAL_KEY"); using (var stream = File.OpenRead(@"C:\edi\BenefitEnrollment.txt")) using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa")) { var items = await reader.ReadToEndAsync(); foreach (var transaction in items.OfType<TS834>()) { if (transaction.IsValid(out MessageErrorContext errors)) Console.WriteLine($"{transaction.ST.TransactionSetControlNumber_02} is valid"); else Console.WriteLine(string.Join(Environment.NewLine, errors.Flatten())); } }
import json import edifabric_x12 as ef serial = "YOUR_SERIAL_KEY" ef.load_library() ef.set_serial(serial) ef.set_map(json.dumps({"default": serial, "maps": {}})) edi = open("BenefitEnrollment.txt", "rb").read() output, offset = ef.parse(edi, ef.ParseMode.JSON_VALIDATE) transactions = output[:offset] report = json.loads(output[offset:]) print(report["errors_count"])
import com.edifabric.nativex12.EdiFabricX12; import com.edifabric.nativex12.ParseMode; import com.edifabric.nativex12.ParseResult; String serial = "YOUR_SERIAL_KEY"; EdiFabricX12.loadLibrary(); EdiFabricX12.setSerial(serial); EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}"); String edi = Files.readString(Path.of("BenefitEnrollment.txt")); ParseResult result = EdiFabricX12.parse(edi, ParseMode.JSON_VALIDATE); System.out.println(result.getTransactions()); System.out.println(result.getReport());
#include "edifabric_x12.h" const char *serial = "YOUR_SERIAL_KEY"; ef_parse_result result; if (ef_load_library(NULL) != 0) return 1; ef_set_serial(serial); ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}"); char *edi = read_file("BenefitEnrollment.txt", NULL); /* helper in example_all_functions.c */ if (ef_parse(edi, EF_PARSE_JSON_VALIDATE, NULL, &result) == 0) { /* transactions = output[0 .. offset), report = output[offset .. length) */ fwrite(result.output.data, 1, (size_t)result.output.length, stdout); ef_free(result.output.data); }
curl -X POST 'https://api.edination.com/v2/x12/read' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/octet-stream' \ --data-binary '@BenefitEnrollment.txt'
Populate a TS834 object in .NET, or pass JSON in the shape shown above to ediFabric Native or ediFabric Cloud, and get a valid 834 file back.
using EdiFabric.Templates.Hipaa5010; License.SetSerial("YOUR_SERIAL_KEY"); var transaction = new TS834(); // Used to indicate the start of a transaction set and to specify a transaction set control number. transaction.ST = new ST(); transaction.ST.TransactionSetIdentifierCode_01 = "834"; transaction.ST.TransactionSetControlNumber_02 = "0001"; // This is an original transaction uniquely identified by the sender with reference #12456. The transaction was created on 5/20/1998 at 12:00 Noon. transaction.BGN_BeginningSegment = new BGN_BeginningSegment(); transaction.BGN_BeginningSegment.TransactionSetPurposeCode_01 = "00"; transaction.BGN_BeginningSegment.TransactionSetReferenceNumber_02 = "12456"; transaction.BGN_BeginningSegment.TransactionSetCreationDate_03 = "19980520"; transaction.BGN_BeginningSegment.TransactionSetCreationTime_04 = "1200"; transaction.BGN_BeginningSegment.ActionCode_08 = "2"; // Occurrence of N1 Loops in any order transaction.AllN1 = new All_N1_834(); // Begin 1000A Loop transaction.AllN1.Loop1000A = new Loop_1000A_834(); // ... set the remaining loops and segments the same way // SegmentBuilders is in the Common project of the example repository using (var stream = new MemoryStream()) { using (var writer = new X12Writer(stream)) { writer.Write(SegmentBuilders.BuildIsa("1")); writer.Write(SegmentBuilders.BuildGs("1", "SENDER1", "RECEIVER1", "005010X220A1")); writer.Write(transaction); } Console.WriteLine(Encoding.UTF8.GetString(stream.ToArray())); }
import json import edifabric_x12 as ef serial = "YOUR_SERIAL_KEY" ef.load_library() ef.set_serial(serial) ef.set_map(json.dumps({"default": serial, "maps": {}})) # the transactions JSON returned by ef.parse, edited or produced by your application transactions = open("BenefitEnrollment.json", "rb").read() edi = ef.build(transactions, postfix="\r\n") print(edi)
import com.edifabric.nativex12.EdiFabricX12; String serial = "YOUR_SERIAL_KEY"; EdiFabricX12.loadLibrary(); EdiFabricX12.setSerial(serial); EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}"); // the transactions JSON returned by parse, edited or produced by your application String transactions = Files.readString(Path.of("BenefitEnrollment.json")); String edi = EdiFabricX12.build(transactions, "\r\n"); System.out.println(edi);
#include "edifabric_x12.h" ef_buffer edi; if (ef_load_library(NULL) != 0) return 1; ef_set_serial("YOUR_SERIAL_KEY"); ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}"); /* the transactions JSON returned by ef_parse, edited or produced by your application */ char *transactions = read_file("BenefitEnrollment.json", NULL); if (ef_build(transactions, "\r\n", &edi) == 0) { fwrite(edi.data, 1, (size_t)edi.length, stdout); ef_free(edi.data); }
# the JSON returned by /read, edited or produced by your application curl -X POST 'https://api.edination.com/v2/x12/write' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/json' \ --data-binary '@BenefitEnrollment.json' \ -o 'BenefitEnrollment.txt'
BGN08 tells the receiver how to apply the file. 2 means change (update) and carries only additions, changes and terminations. 4 means verify, and RX means replace - the file is the complete membership.
INS03 carries the maintenance type code: 021 addition, 001 change, 024 cancellation or termination, 030 audit or compare. INS04 gives the reason.
HIPAA only defines the 999 acknowledgment. Many plans return discrepancy reports or their own 834 audit files by trading partner agreement.
In .NET, install EdiFabric and EdiFabric.Templates.Hipaa, read the file with X12Reader into TS834 objects and write them back with X12Writer. From Python, Java or C, use ediFabric Native, which converts 834 files to JSON and JSON back to X12 inside your process. From any other language, post the file to the ediFabric Cloud REST API.