X12 278 Health Care Services Review: Request for Review and Response Last updated: 2026-09-29
The 278 (005010X217) is the HIPAA transaction for health care services review: providers use it to request prior authorization or a referral from a utilization management organization, and the same transaction set carries the response.
The request identifies the UMO, requester, subscriber, patient and the services in HL loops, with the UM segment describing the review. The response adds HCR segments with the decision, such as certified, not certified or pended, and the authorization number.
At a glance
- Standard
- X12 HIPAA
- Implementation guide
005010X217- Functional group
HI(GS01)- Sent by
- Provider to payer or UMO, and back
- Responses
- 278 response, 999
- ediFabric .NET template
TS278inEdiFabric.Templates.Hipaa- OpenEDI definition
- View 278 in the spec library
278 structure
The full X12 278 layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 44 loops and 313 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 |
| Loop BHT | Beginning of Hierarchical Transaction | Situational | 1 |
BHT | Beginning of Hierarchical Transaction | Situational | 1 |
| Loop 2000A | Utilization Management Organization UMO Level | Situational | 1 |
HL | Utilization Management Organization UMO Level | Required | 1 |
| Loop 2010A | Utilization Management Organization UMO Name | Required | 1 |
NM1 | Utilization Management Organization UMO Name | Required | 1 |
| Loop 2000B | Requester Level | Required | 1 |
HL | Requester Level | Required | 1 |
| Loop 2010B | Requester Name | Required | 1 |
NM1 | Requester Name | Required | 1 |
REF | Requester Supplemental Identification | Situational | 8 |
N3 | Requester Address | Situational | 1 |
N4 | Requester City State ZIP Code | Situational | 1 |
PER | Requester Contact Information | Situational | 1 |
PRV | Requester Provider Information | Situational | 1 |
| Loop 2000C | Subscriber Level | Required | 1 |
HL | Subscriber Level | Required | 1 |
| Loop 2010C | Subscriber Name | Required | 1 |
NM1 | Subscriber Name | Required | 1 |
REF | Subscriber Supplemental Identification | Situational | 9 |
N3 | Subscriber Address | Situational | 1 |
N4 | Subscriber City State ZIP Code | Situational | 1 |
DMG | Subscriber Demographic Information | Situational | 1 |
INS | Subscriber Relationship | Situational | 1 |
| Loop 2000D | Dependent Level | Situational | 1 |
HL | Dependent Level | Required | 1 |
| Loop 2010D | Dependent Name | Required | 1 |
NM1 | Dependent Name | Required | 1 |
REF | Dependent Supplemental Identification | Situational | 3 |
N3 | Dependent Address | Situational | 1 |
N4 | Dependent City State ZIP Code | Situational | 1 |
DMG | Dependent Demographic Information | Situational | 1 |
INS | Dependent Relationship | Situational | 1 |
| Loop 2000E | Patient Event Level | Required | 1 |
HL | Patient Event Level | Required | 1 |
TRN | Patient Event Tracking Number | Situational | 2 |
UM | Health Care Services Review Information | Required | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Previous Review Authorization Number | Situational | 1 |
REF | Previous Review Administrative Reference Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
DTP | Accident Date | Situational | 1 |
DTP | Last Menstrual Period Date | Situational | 1 |
DTP | Estimated Dateof Birth | Situational | 1 |
DTP | Onsetof Current Symptomsor Illness Date | Situational | 1 |
DTP | Event Date | Situational | 1 |
DTP | Admission Date | Situational | 1 |
DTP | Discharge Date | Situational | 1 |
HI | Patient Diagnosis | Situational | 1 |
HSD | Health Care Services Delivery | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
CRC | Ambulance Certification Information | Situational | 1 |
CRC | Chiropractic Certification Information | Situational | 1 |
CRC | Durable Medical Equipment Information | Situational | 1 |
CRC | Oxygen Therapy Certification Information | Situational | 1 |
CRC | Functional Limitations Information | Situational | 1 |
CRC | Activities Permitted Information | Situational | 1 |
CRC | Mental Status Information | Situational | 1 |
CL1 | Institutional Claim Code | Situational | 1 |
CR1 | Ambulance Transport Information | Situational | 1 |
CR2 | Spinal Manipulation Service Information | Situational | 1 |
CR5 | Home Oxygen Therapy Information | Situational | 1 |
CR6 | Home Health Care Information | Situational | 1 |
PWK | Additional Patient Information | Situational | 10 |
MSG | Message Text | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2010EA | Patient Event Provider Name | Situational | 14 |
NM1 | Patient Event Provider Name | Required | 1 |
REF | Patient Event Provider Supplemental Information | Situational | 7 |
N3 | Patient Event Provider Address | Situational | 1 |
N4 | Patient Event Provider City State Zip Code | Situational | 1 |
PER | Patient Event Provider Contact Information | Situational | 1 |
PRV | Patient Event Provider Information | Situational | 1 |
| Loop 2010EB | Patient Event Transport Information | Situational | 5 |
NM1 | Patient Event Transport Information | Required | 1 |
N3 | Patient Event Transport Location Address | Required | 1 |
N4 | Patient Event Transport Location City State ZIP Code | Required | 1 |
| Loop 2010EC | Patient Event Other UMO Name | Situational | 3 |
NM1 | Patient Event Other UMO Name | Required | 1 |
REF | Other UMO Denial Reason | Required | 1 |
DTP | Other UMO Denial Date | Required | 1 |
| Loop 2000F | Service Level | Situational | >1 |
HL | Service Level | Required | 1 |
TRN | Service Trace Number | Situational | 2 |
UM | Health Care Services Review Information | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Previous Review Authorization Number | Situational | 1 |
REF | Previous Review Administrative Reference Number | Situational | 1 |
DTP | Service Date | Situational | 1 |
SV1 | Professional Service | Situational | 1 |
SV2 | Institutional Service Line | Situational | 1 |
SV3 | Dental Service | Situational | 1 |
TOO | Tooth Information | Situational | 32 |
HSD | Health Care Services Delivery | Situational | 1 |
PWK | Additional Service Information | Situational | 10 |
MSG | Message Text | Situational | 1 |
| Loop 2010F | Service Provider Name | Situational | 10 |
NM1 | Service Provider Name | Required | 1 |
REF | Service Provider Supplemental Identification | Situational | 8 |
N3 | Service Provider Address | Situational | 1 |
N4 | Service Provider City State ZIP Code | Situational | 1 |
PER | Service Provider Contact Information | Situational | 1 |
PRV | Service Provider Information | Situational | 1 |
| Loop 2000E | Patient Event Level | Situational | 1 |
HL | Patient Event Level | Required | 1 |
TRN | Patient Event Tracking Number | Situational | 2 |
UM | Health Care Services Review Information | Required | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Previous Review Authorization Number | Situational | 1 |
REF | Previous Review Administrative Reference Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
DTP | Accident Date | Situational | 1 |
DTP | Last Menstrual Period Date | Situational | 1 |
DTP | Estimated Dateof Birth | Situational | 1 |
DTP | Onsetof Current Symptomsor Illness Date | Situational | 1 |
DTP | Event Date | Situational | 1 |
DTP | Admission Date | Situational | 1 |
DTP | Discharge Date | Situational | 1 |
HI | Patient Diagnosis | Situational | 1 |
HSD | Health Care Services Delivery | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
CRC | Ambulance Certification Information | Situational | 1 |
CRC | Chiropractic Certification Information | Situational | 1 |
CRC | Durable Medical Equipment Information | Situational | 1 |
CRC | Oxygen Therapy Certification Information | Situational | 1 |
CRC | Functional Limitations Information | Situational | 1 |
CRC | Activities Permitted Information | Situational | 1 |
CRC | Mental Status Information | Situational | 1 |
CL1 | Institutional Claim Code | Situational | 1 |
CR1 | Ambulance Transport Information | Situational | 1 |
CR2 | Spinal Manipulation Service Information | Situational | 1 |
CR5 | Home Oxygen Therapy Information | Situational | 1 |
CR6 | Home Health Care Information | Situational | 1 |
PWK | Additional Patient Information | Situational | 10 |
MSG | Message Text | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2010EA | Patient Event Provider Name | Situational | 14 |
NM1 | Patient Event Provider Name | Required | 1 |
REF | Patient Event Provider Supplemental Information | Situational | 7 |
N3 | Patient Event Provider Address | Situational | 1 |
N4 | Patient Event Provider City State Zip Code | Situational | 1 |
PER | Patient Event Provider Contact Information | Situational | 1 |
PRV | Patient Event Provider Information | Situational | 1 |
| Loop 2010EB | Patient Event Transport Information | Situational | 5 |
NM1 | Patient Event Transport Information | Required | 1 |
N3 | Patient Event Transport Location Address | Required | 1 |
N4 | Patient Event Transport Location City State ZIP Code | Required | 1 |
| Loop 2010EC | Patient Event Other UMO Name | Situational | 3 |
NM1 | Patient Event Other UMO Name | Required | 1 |
REF | Other UMO Denial Reason | Required | 1 |
DTP | Other UMO Denial Date | Required | 1 |
| Loop 2000F | Service Level | Situational | >1 |
HL | Service Level | Required | 1 |
TRN | Service Trace Number | Situational | 2 |
UM | Health Care Services Review Information | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Previous Review Authorization Number | Situational | 1 |
REF | Previous Review Administrative Reference Number | Situational | 1 |
DTP | Service Date | Situational | 1 |
SV1 | Professional Service | Situational | 1 |
SV2 | Institutional Service Line | Situational | 1 |
SV3 | Dental Service | Situational | 1 |
TOO | Tooth Information | Situational | 32 |
HSD | Health Care Services Delivery | Situational | 1 |
PWK | Additional Service Information | Situational | 10 |
MSG | Message Text | Situational | 1 |
| Loop 2010F | Service Provider Name | Situational | 10 |
NM1 | Service Provider Name | Required | 1 |
REF | Service Provider Supplemental Identification | Situational | 8 |
N3 | Service Provider Address | Situational | 1 |
N4 | Service Provider City State ZIP Code | Situational | 1 |
PER | Service Provider Contact Information | Situational | 1 |
PRV | Service Provider Information | Situational | 1 |
| Loop BHT | Beginning of Hierarchical Transaction | Situational | 1 |
BHT | Beginning of Hierarchical Transaction | Situational | 1 |
| Loop 2000A | Utilization Management Organization UMO Level | Situational | 1 |
HL | Utilization Management Organization UMO Level | Required | 1 |
AAA | Request Validation | Situational | 9 |
| Loop 2010A | Utilization Management Organization UMO Name | Required | 1 |
NM1 | Utilization Management Organization UMO Name | Required | 1 |
PER | Utilization Management Organization UMO Contact Information | Situational | 1 |
AAA | Utilization Management Organization UMO Request Validation | Situational | 9 |
| Loop 2000B | Requester Level | Situational | 1 |
HL | Requester Level | Required | 1 |
| Loop 2010B | Requester Name | Required | 2 |
NM1 | Requester Name | Required | 1 |
REF | Requester Supplemental Identification | Situational | 8 |
AAA | Requester Request Validation | Situational | 9 |
PRV | Requester Provider Information | Situational | 1 |
| Loop 2000C | Subscriber Level | Situational | 1 |
HL | Subscriber Level | Required | 1 |
| Loop 2010C | Subscriber Name | Required | 1 |
NM1 | Subscriber Name | Required | 1 |
REF | Subscriber Supplemental Identification | Situational | 9 |
N3 | Subscriber Mailing Address | Situational | 1 |
N4 | Subscriber City State ZIP Code | Situational | 1 |
AAA | Subscriber Request Validation | Situational | 9 |
DMG | Subscriber Demographic Information | Situational | 1 |
INS | Subscriber Relationship | Situational | 1 |
| Loop 2000E | Patient Event Level | Situational | >1 |
HL | Patient Event Level | Required | 1 |
TRN | Patient Event Tracking Number | Situational | 3 |
AAA | Patient Event Request Validation | Situational | 9 |
UM | Health Care Services Review Information | Required | 1 |
HCR | Health Care Services Review | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Administrative Reference Number | Situational | 1 |
REF | Previous Review Authorization Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
DTP | Accident Date | Situational | 1 |
DTP | Last Menstrual Period Date | Situational | 1 |
DTP | Estimated Dateof Birth | Situational | 1 |
DTP | Onsetof Current Symptomsor Illness Date | Situational | 1 |
DTP | Event Date | Situational | 1 |
DTP | Admission Date | Situational | 1 |
DTP | Discharge Date | Situational | 1 |
DTP | Certification Issue Date | Situational | 1 |
DTP | Certification Expiration Date | Situational | 1 |
DTP | Certification Effective Date | Situational | 1 |
HI | Patient Diagnosis | Situational | 1 |
HSD | Health Care Services Delivery | Situational | 1 |
CL1 | Institutional Claim Code | Situational | 1 |
CR1 | Ambulance Transport Information | Situational | 1 |
CR2 | Spinal Manipulation Service Information | Situational | 1 |
CR5 | Home Oxygen Therapy Information | Situational | 1 |
CR6 | Home Health Care Information | Situational | 1 |
PWK | Additional Patient Information | Situational | 10 |
MSG | Message Text | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2010EA | Patient Event Provider Name | Situational | 14 |
NM1 | Patient Event Provider Name | Required | 1 |
REF | Patient Event Provider Supplemental Identification | Situational | 7 |
N3 | Patient Event Provider Address | Situational | 1 |
N4 | Patient Event Provider City State ZIP Code | Situational | 1 |
PER | Provider Contact Information | Situational | 1 |
AAA | Patient Event Provider Request Validation | Situational | 9 |
PRV | Patient Event Provider Information | Situational | 1 |
| Loop 2010EB | Additional Patient Information Contact Name | Situational | 1 |
NM1 | Additional Patient Information Contact Name | Required | 1 |
N3 | Additional Patient Information Contact Address | Situational | 1 |
N4 | Additional Patient Information Contact City State ZIP Code | Situational | 1 |
PER | Additional Patient Information Contact Information | Situational | 1 |
| Loop 2010EC | Patient Event Transport Information | Situational | 5 |
NM1 | Patient Event Transport Information | Required | 1 |
N3 | Patient Event Transport Location Address | Required | 1 |
N4 | Patient Event Transport Location City State ZIP Code | Required | 1 |
AAA | Patient Event Transport Location Request Validation | Situational | 9 |
| Loop 2000F | Service Level | Situational | >1 |
HL | Service Level | Required | 1 |
TRN | Service Trace Number | Situational | 3 |
AAA | Service Request Validation | Situational | 9 |
UM | Health Care Services Review Information | Situational | 1 |
HCR | Health Care Services Review | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Administrative Reference Number | Situational | 1 |
REF | Previous Review Authorization Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
DTP | Service Date | Situational | 1 |
DTP | Certification Issue Date | Situational | 1 |
DTP | Certification Expiration Date | Situational | 1 |
DTP | Certification Effective Date | Situational | 1 |
HI | Request for Additional Information | Situational | 1 |
SV1 | Professional Service | Situational | 1 |
SV2 | Institutional Service Line | Situational | 1 |
SV3 | Dental Service | Situational | 1 |
TOO | Tooth Information | Situational | 32 |
HSD | Health Care Services Delivery | Situational | 1 |
PWK | Additional Service Information | Situational | 10 |
MSG | Message Text | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2010FA | Service Provider Name | Situational | 12 |
NM1 | Service Provider Name | Required | 1 |
REF | Service Provider Supplemental Identification | Situational | 8 |
N3 | Service Provider Address | Situational | 1 |
N4 | Service Provider City State ZIP Code | Situational | 1 |
PER | Service Provider Contact Information | Situational | 1 |
AAA | Service Provider Request Validation | Situational | 9 |
PRV | Service Provider Information | Situational | 1 |
| Loop 2010FB | Additional Service Information Contact Name | Situational | 1 |
NM1 | Additional Service Information Contact Name | Required | 1 |
N3 | Additional Service Information Contact Address | Situational | 1 |
N4 | Additional Service Information Contact City State ZIP Code | Required | 1 |
PER | Additional Service Information Contact Information | Situational | 1 |
| Loop 2000D | Dependent Level | Situational | 1 |
HL | Dependent Level | Required | 1 |
| Loop 2010D | Dependent Name | Required | 1 |
NM1 | Dependent Name | Required | 1 |
REF | Dependent Supplemental Identification | Situational | 3 |
N3 | Dependent Address | Situational | 1 |
N4 | Dependent City State ZIP Code | Situational | 1 |
AAA | Dependent Request Validation | Situational | 9 |
DMG | Dependent Demographic Information | Situational | 1 |
INS | Dependent Relationship | Situational | 1 |
| Loop 2000E | Patient Event Level | Situational | >1 |
HL | Patient Event Level | Required | 1 |
TRN | Patient Event Tracking Number | Situational | 3 |
AAA | Patient Event Request Validation | Situational | 9 |
UM | Health Care Services Review Information | Required | 1 |
HCR | Health Care Services Review | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Administrative Reference Number | Situational | 1 |
REF | Previous Review Authorization Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
DTP | Accident Date | Situational | 1 |
DTP | Last Menstrual Period Date | Situational | 1 |
DTP | Estimated Dateof Birth | Situational | 1 |
DTP | Onsetof Current Symptomsor Illness Date | Situational | 1 |
DTP | Event Date | Situational | 1 |
DTP | Admission Date | Situational | 1 |
DTP | Discharge Date | Situational | 1 |
DTP | Certification Issue Date | Situational | 1 |
DTP | Certification Expiration Date | Situational | 1 |
DTP | Certification Effective Date | Situational | 1 |
HI | Patient Diagnosis | Situational | 1 |
HSD | Health Care Services Delivery | Situational | 1 |
CL1 | Institutional Claim Code | Situational | 1 |
CR1 | Ambulance Transport Information | Situational | 1 |
CR2 | Spinal Manipulation Service Information | Situational | 1 |
CR5 | Home Oxygen Therapy Information | Situational | 1 |
CR6 | Home Health Care Information | Situational | 1 |
PWK | Additional Patient Information | Situational | 10 |
MSG | Message Text | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2010EA | Patient Event Provider Name | Situational | 14 |
NM1 | Patient Event Provider Name | Required | 1 |
REF | Patient Event Provider Supplemental Identification | Situational | 7 |
N3 | Patient Event Provider Address | Situational | 1 |
N4 | Patient Event Provider City State ZIP Code | Situational | 1 |
PER | Provider Contact Information | Situational | 1 |
AAA | Patient Event Provider Request Validation | Situational | 9 |
PRV | Patient Event Provider Information | Situational | 1 |
| Loop 2010EB | Additional Patient Information Contact Name | Situational | 1 |
NM1 | Additional Patient Information Contact Name | Required | 1 |
N3 | Additional Patient Information Contact Address | Situational | 1 |
N4 | Additional Patient Information Contact City State ZIP Code | Situational | 1 |
PER | Additional Patient Information Contact Information | Situational | 1 |
| Loop 2010EC | Patient Event Transport Information | Situational | 5 |
NM1 | Patient Event Transport Information | Required | 1 |
N3 | Patient Event Transport Location Address | Required | 1 |
N4 | Patient Event Transport Location City State ZIP Code | Required | 1 |
AAA | Patient Event Transport Location Request Validation | Situational | 9 |
| Loop 2000F | Service Level | Situational | >1 |
HL | Service Level | Required | 1 |
TRN | Service Trace Number | Situational | 3 |
AAA | Service Request Validation | Situational | 9 |
UM | Health Care Services Review Information | Situational | 1 |
HCR | Health Care Services Review | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Administrative Reference Number | Situational | 1 |
REF | Previous Review Authorization Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
DTP | Service Date | Situational | 1 |
DTP | Certification Issue Date | Situational | 1 |
DTP | Certification Expiration Date | Situational | 1 |
DTP | Certification Effective Date | Situational | 1 |
HI | Request for Additional Information | Situational | 1 |
SV1 | Professional Service | Situational | 1 |
SV2 | Institutional Service Line | Situational | 1 |
SV3 | Dental Service | Situational | 1 |
TOO | Tooth Information | Situational | 32 |
HSD | Health Care Services Delivery | Situational | 1 |
PWK | Additional Service Information | Situational | 10 |
MSG | Message Text | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2010FA | Service Provider Name | Situational | 12 |
NM1 | Service Provider Name | Required | 1 |
REF | Service Provider Supplemental Identification | Situational | 8 |
N3 | Service Provider Address | Situational | 1 |
N4 | Service Provider City State ZIP Code | Situational | 1 |
PER | Service Provider Contact Information | Situational | 1 |
AAA | Service Provider Request Validation | Situational | 9 |
PRV | Service Provider Information | Situational | 1 |
| Loop 2010FB | Additional Service Information Contact Name | Situational | 1 |
NM1 | Additional Service Information Contact Name | Required | 1 |
N3 | Additional Service Information Contact Address | Situational | 1 |
N4 | Additional Service Information Contact City State ZIP Code | Required | 1 |
PER | Additional Service Information Contact Information | Situational | 1 |
SE | Transaction Set Trailer | Required | 1 |
Sample 278 file
A request for review of a planned service. Paste it into EdiNation to see every element named and validated.
ISA*00* *00* *ZZ*1234567 *ZZ*11111 *170508*1141*^*00501*000000101*1*P*:~ GS*HC*XXXXXXX*XXXXX*20170617*1741*101*X*005010X217~ ST*278*0001*005010X217~ BHT*0007*13*A12345*20050502*1101~ HL*1**20*1~ NM1*X3*2*MARYLAND CAPITAL INSURANCE COMPANY*****46*789312~ HL*2*1*21*1~ NM1*1P*1*GARDENER*JAMES****46*8189991234~ HL*3*2*22*1~ NM1*IL*1*SMITH*JOE****MI*12345678901~ HL*4*3*EV*0~ TRN*1*111099*9012345678~ UM*SC*I*3*11:B*****Y~ HI*BF:41090:D8:20050430~ HSD*VS*1~ NM1*SJ*1*WATSON*SUSAN****34*987654321~ PER*IC**TE*4029993456~ SE*16*0001~ GE*1*101~ IEA*1*000000101~
The same 278 as JSON
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": "278",
"TransactionSetControlNumber_02": "0001",
"ImplementationConventionPreference_03": "005010X217"
},
"LoopBHT": {
"BHT_BeginningOfHierarchicalTransaction": {
"HierarchicalStructureCode_01": "0007",
"TransactionSetPurposeCode_02": "13",
"SubmitterTransactionIdentifier_03": "A12345",
"TransactionSetCreationDate_04": "20050502",
"TransactionSetCreationTime_05": "1101"
},
"Loop2000A": {
"HL_UtilizationManagementOrganization_UMO_Level": {
"HierarchicalIDNumber_01": "1",
"HierarchicalLevelCode_03": "20",
"HierarchicalChildCode_04": "1"
},
"Loop2010A": {
"NM1_UtilizationManagementOrganization_UMO_Name": {
"EntityIdentifierCode_01": "X3",
"EntityTypeQualifier_02": "2",
"ResponseContactLastorOrganizationName_03": "MARYLAND CAPITAL INSURANCE COMPANY",
"IdentificationCodeQualifier_08": "46",
"ResponseContactIdentifier_09": "789312"
}
},
"Loop2000B": {
"HL_RequesterLevel": {
"HierarchicalIDNumber_01": "2",
"HierarchicalParentIDNumber_02": "1",
"HierarchicalLevelCode_03": "21",
"HierarchicalChildCode_04": "1"
},
"Loop2010B": {
"NM1_RequesterName": {
"EntityIdentifierCode_01": "1P",
"EntityTypeQualifier_02": "1",
"ResponseContactLastorOrganizationName_03": "GARDENER",
"ResponseContactFirstName_04": "JAMES",
"IdentificationCodeQualifier_08": "46",
"ResponseContactIdentifier_09": "8189991234"
}
},
"Loop2000C": {
"HL_SubscriberLevel": {
"HierarchicalIDNumber_01": "3",
"HierarchicalParentIDNumber_02": "2",
"HierarchicalLevelCode_03": "22",
"HierarchicalChildCode_04": "1"
},
"Loop2010C": {
"NM1_SubscriberName": {
"EntityIdentifierCode_01": "IL",
"EntityTypeQualifier_02": "1",
"ResponseContactLastorOrganizationName_03": "SMITH",
"ResponseContactFirstName_04": "JOE",
"IdentificationCodeQualifier_08": "MI",
"ResponseContactIdentifier_09": "12345678901"
}
},
"Loop2000E": {
"HL_PatientEventLevel": {
"HierarchicalIDNumber_01": "4",
"HierarchicalParentIDNumber_02": "3",
"HierarchicalLevelCode_03": "EV",
"HierarchicalChildCode_04": "0"
},
"TRN_PatientEventTrackingNumber": [
{
"TraceTypeCode_01": "1",
"CurrentTransactionTraceNumber_02": "111099",
"OriginatingCompanyIdentifier_03": "9012345678"
}
],
"UM_HealthCareServicesReviewInformation": {
"RequestCategoryCode_01": "SC",
"CertificationTypeCode_02": "I",
"ServiceTypeCode_03": "3",
"ValuesEntered_04": {
"FacilityTypeCode_01": "11",
"FacilityCodeQualifier_02": "B"
},
"ReleaseofInformationCode_09": "Y"
},
"HI_PatientDiagnosis": {
"HealthCareCodeInformation_01": {
"CodeListQualifierCode_01": "BF",
"IndustryCode_02": "41090",
"DateTimePeriodFormatQualifier_03": "D8",
"DateTimePeriod_04": "20050430"
}
},
"HSD_HealthCareServicesDelivery": {
"QuantityQualifier_01": "VS",
"BenefitQuantity_02": "1"
},
"AllNM1": {
"Loop2010EA": [
{
"NM1_PatientEventProviderName": {
"EntityIdentifierCode_01": "SJ",
"EntityTypeQualifier_02": "1",
"ResponseContactLastorOrganizationName_03": "WATSON",
"ResponseContactFirstName_04": "SUSAN",
"IdentificationCodeQualifier_08": "34",
"ResponseContactIdentifier_09": "987654321"
},
"PER_PatientEventProviderContactInformation": {
"ContactFunctionCode_01": "IC",
"CommunicationNumberQualifier_03": "TE",
"ResponseContactCommunicationNumber_04": "4029993456"
}
}
]
}
}
}
}
}
},
"SE": {
"NumberofIncludedSegments_01": "16",
"TransactionSetControlNumber_02": "0001"
}
}Parse and validate a 278 file
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\ServicesReview.txt")) using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa")) { var items = await reader.ReadToEndAsync(); foreach (var transaction in items.OfType<TS278>()) { 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("ServicesReview.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("ServicesReview.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("ServicesReview.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 '@ServicesReview.txt'
Generate a 278 file
Populate a TS278 object in .NET, or pass JSON in the shape shown above to ediFabric Native or ediFabric Cloud, and get a valid 278 file back.
using EdiFabric.Templates.Hipaa5010; License.SetSerial("YOUR_SERIAL_KEY"); var transaction = new TS278(); // Begin transaction set 278, control #0001, and implementation convention reference is 005010X217. transaction.ST = new ST(); transaction.ST.TransactionSetIdentifierCode_01 = "278"; transaction.ST.TransactionSetControlNumber_02 = "0001"; transaction.ST.ImplementationConventionPreference_03 = "005010X217"; // Begin Loop BHT transaction.LoopBHT = new Loop_BHT_278(); // This transaction is a request using hierarchical structure 0007 (information source, information receiver, subscriber, dependent, event, services). // The originating system has assigned the Submitter Transaction Identifier “A12345" along with the transaction set creation date and time. transaction.LoopBHT.BHT_BeginningOfHierarchicalTransaction = new BHT_BeginningOfHierarchicalTransaction_6(); transaction.LoopBHT.BHT_BeginningOfHierarchicalTransaction.HierarchicalStructureCode_01 = "0007"; transaction.LoopBHT.BHT_BeginningOfHierarchicalTransaction.TransactionSetPurposeCode_02 = "13"; transaction.LoopBHT.BHT_BeginningOfHierarchicalTransaction.SubmitterTransactionIdentifier_03 = "A12345"; transaction.LoopBHT.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationDate_04 = "20050502"; transaction.LoopBHT.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationTime_05 = "1101"; // Begin 2000A Loop hierarchical level identifies the Insurance Company. transaction.LoopBHT.Loop2000A = new Loop_2000A_278(); // ... 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", "005010X217")); 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("ServicesReview.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("ServicesReview.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("ServicesReview.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 '@ServicesReview.json' \ -o 'ServicesReview.txt'
Complete ediFabric .NET example
A complete C# program for the X12 278, built on TS278 in EdiFabric.Templates.Hipaa. The same code is in the ediFabric .NET examples on GitHub.
using EdiFabric.Framework.Readers;
using EdiFabric.Framework.Writers;
using EdiFabric.Templates.Hipaa5010;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using EdiFabric.Core.Model.Edi;
using EdiFabric.Core.Model.Edi.X12;
using EdiFabric.Examples.X12.Common;
namespace EdiFabric.Examples.X12.T278
{
class Program
{
static void Main(string[] args)
{
SerialKey.Set(Common.SerialKey.Get());
Read();
Write();
}
///
/// Read Services Review
///
static void Read()
{
var ediStream = File.OpenRead(Directory.GetCurrentDirectory() + @"\..\..\..\Files\Hipaa\ServicesReview.txt");
List ediItems;
using (var ediReader = new X12Reader(ediStream, "EdiFabric.Templates.Hipaa"))
ediItems = ediReader.ReadToEnd().ToList();
var transactions = ediItems.OfType();
foreach (var transaction in transactions)
{
if (transaction.HasErrors)
{
// partially parsed
var errors = transaction.ErrorContext.Flatten();
}
}
}
///
/// Write Services Review
///
static void Write()
{
var transaction = BuildServicesReview("1");
using (var stream = new MemoryStream())
{
using (var writer = new X12Writer(stream))
{
writer.Write(SegmentBuilders.BuildIsa("1"));
writer.Write(SegmentBuilders.BuildGs("1", "SENDER1", "RECEIVER1", "005010X217"));
writer.Write(transaction);
}
var ediString = stream.LoadToString();
}
}
///
/// Builds services review.
/// Original from http://www.x12.org/examples/005010X217/referral/X217-referral-request-for-review/
///
static TS278 BuildServicesReview(string controlNumber)
{
var result = new TS278();
// Begin transaction set 278, control #0001, and implementation convention reference is 005010X217.
result.ST = new ST();
result.ST.TransactionSetIdentifierCode_01 = "278";
result.ST.TransactionSetControlNumber_02 = controlNumber.PadLeft(9, '0');
result.ST.ImplementationConventionPreference_03 = "005010X217";
// Begin Loop BHT
result.LoopBHT = new Loop_BHT_278();
// This transaction is a request using hierarchical structure 0007 (information source, information receiver, subscriber, dependent, event, services).
// The originating system has assigned the Submitter Transaction Identifier “A12345" along with the transaction set creation date and time.
result.LoopBHT.BHT_BeginningOfHierarchicalTransaction = new BHT_BeginningOfHierarchicalTransaction_6();
result.LoopBHT.BHT_BeginningOfHierarchicalTransaction.HierarchicalStructureCode_01 = "0007";
result.LoopBHT.BHT_BeginningOfHierarchicalTransaction.TransactionSetPurposeCode_02 = "13";
result.LoopBHT.BHT_BeginningOfHierarchicalTransaction.SubmitterTransactionIdentifier_03 = "A12345";
result.LoopBHT.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationDate_04 = "20050502";
result.LoopBHT.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationTime_05 = "1101";
// Begin 2000A Loop hierarchical level identifies the Insurance Company.
result.LoopBHT.Loop2000A = new Loop_2000A_278();
// HL count is 1. There is no higher, or parent, HL. This HL code is 20, identifying the information source or the insurance company.
// This HL has subordinate levels, or children.
result.LoopBHT.Loop2000A.HL_UtilizationManagementOrganization_UMO_Level = new HL_UtilizationManagementOrganization();
result.LoopBHT.Loop2000A.HL_UtilizationManagementOrganization_UMO_Level.HierarchicalIDNumber_01 = "1";
result.LoopBHT.Loop2000A.HL_UtilizationManagementOrganization_UMO_Level.HierarchicalLevelCode_03 = "20";
result.LoopBHT.Loop2000A.HL_UtilizationManagementOrganization_UMO_Level.HierarchicalChildCode_04 = "1";
// Begin 2010A Loop
result.LoopBHT.Loop2000A.Loop2010A = new Loop_2010A_278();
// The request for a referral is being made to Maryland Capital Insurance Company. Their electronic transmitter identification number is 789312.
result.LoopBHT.Loop2000A.Loop2010A.NM1_UtilizationManagementOrganization_UMO_Name = new NM1_UtilizationManagementOrganization();
result.LoopBHT.Loop2000A.Loop2010A.NM1_UtilizationManagementOrganization_UMO_Name.EntityIdentifierCode_01 = "X3";
result.LoopBHT.Loop2000A.Loop2010A.NM1_UtilizationManagementOrganization_UMO_Name.EntityTypeQualifier_02 = "2";
result.LoopBHT.Loop2000A.Loop2010A.NM1_UtilizationManagementOrganization_UMO_Name.ResponseContactLastorOrganizationName_03 = "MARYLAND CAPITAL INSURANCE COMPANY";
result.LoopBHT.Loop2000A.Loop2010A.NM1_UtilizationManagementOrganization_UMO_Name.IdentificationCodeQualifier_08 = "46";
result.LoopBHT.Loop2000A.Loop2010A.NM1_UtilizationManagementOrganization_UMO_Name.ResponseContactIdentifier_09 = "789312";
// End 2010A Loop
// Begin 2000B Loop hierarchical level identifies the submitting provider.
result.LoopBHT.Loop2000A.Loop2000B = new Loop_2000B_278();
// HL count is 2. This HL is subordinate to HL*1, the parent HL. This HL code is 21, identifying the information receiver or the referring provider.
// This HL has subordinate levels, or children.
result.LoopBHT.Loop2000A.Loop2000B.HL_RequesterLevel = new HL_RequesterLevel();
result.LoopBHT.Loop2000A.Loop2000B.HL_RequesterLevel.HierarchicalIDNumber_01 = "2";
result.LoopBHT.Loop2000A.Loop2000B.HL_RequesterLevel.HierarchicalParentIDNumber_02 = "1";
result.LoopBHT.Loop2000A.Loop2000B.HL_RequesterLevel.HierarchicalLevelCode_03 = "21";
result.LoopBHT.Loop2000A.Loop2000B.HL_RequesterLevel.HierarchicalChildCode_04 = "1";
// Begin 2010B Loop
result.LoopBHT.Loop2000A.Loop2000B.Loop2010B = new Loop_2010B_278();
// The request is being made by James Gardener whose Electronic Transmitter Identification Number is 8189991234.
result.LoopBHT.Loop2000A.Loop2000B.Loop2010B.NM1_RequesterName = new NM1_RequesterName();
result.LoopBHT.Loop2000A.Loop2000B.Loop2010B.NM1_RequesterName.EntityIdentifierCode_01 = "1P";
result.LoopBHT.Loop2000A.Loop2000B.Loop2010B.NM1_RequesterName.EntityTypeQualifier_02 = "1";
result.LoopBHT.Loop2000A.Loop2000B.Loop2010B.NM1_RequesterName.ResponseContactLastorOrganizationName_03 = "GARDENER";
result.LoopBHT.Loop2000A.Loop2000B.Loop2010B.NM1_RequesterName.ResponseContactFirstName_04 = "JAMES";
result.LoopBHT.Loop2000A.Loop2000B.Loop2010B.NM1_RequesterName.IdentificationCodeQualifier_08 = "46";
result.LoopBHT.Loop2000A.Loop2000B.Loop2010B.NM1_RequesterName.ResponseContactIdentifier_09 = "8189991234";
// End 2010B Loop
// Begin 2000C Loop hierarchical level identifies the subscriber, who in this case is also the patient.
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C = new Loop_2000C_278();
// HL count is 3. This HL is subordinate to HL*2, the parent HL. This HL code is 22, identifying the subscriber. This HL has subordinate levels, or children.
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.HL_SubscriberLevel = new HL_SubscriberLevel();
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.HL_SubscriberLevel.HierarchicalIDNumber_01 = "3";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.HL_SubscriberLevel.HierarchicalParentIDNumber_02 = "2";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.HL_SubscriberLevel.HierarchicalLevelCode_03 = "22";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.HL_SubscriberLevel.HierarchicalChildCode_04 = "1";
// Begin 2010C
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2010C = new Loop_2010C_278();
// The patient’s name is Joe Smith; his Member Identification Number is 12345678901.
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2010C.NM1_SubscriberName = new NM1_SubscriberName_3();
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2010C.NM1_SubscriberName.EntityIdentifierCode_01 = "IL";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2010C.NM1_SubscriberName.EntityTypeQualifier_02 = "1";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2010C.NM1_SubscriberName.ResponseContactLastorOrganizationName_03 = "SMITH";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2010C.NM1_SubscriberName.ResponseContactFirstName_04 = "JOE";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2010C.NM1_SubscriberName.IdentificationCodeQualifier_08 = "MI";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2010C.NM1_SubscriberName.ResponseContactIdentifier_09 = "12345678901";
// End 2010C Loop
// Begin 2000E Loop hierarchical level identifies the patient event.
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E = new Loop_2000E_278();
// HL count is 4. This HL is subordinate to HL*3, the parent HL. This HL code is EV, identifying the patient event.
// This HL has no subordinate levels, or children.
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HL_PatientEventLevel = new HL_PatientEventLevel();
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HL_PatientEventLevel.HierarchicalIDNumber_01 = "4";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HL_PatientEventLevel.HierarchicalParentIDNumber_02 = "3";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HL_PatientEventLevel.HierarchicalLevelCode_03 = "EV";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HL_PatientEventLevel.HierarchicalChildCode_04 = "0";
// Repeating TRN
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.TRN_PatientEventTrackingNumber = new List();
// The provider assigned the trace number 111099 to this service request.
// The requester has included the user-assigned identifier of 012345678 to this trace number.
var trn = new TRN_PatientEventTrackingNumber();
trn.TraceTypeCode_01 = "1";
trn.CurrentTransactionTraceNumber_02 = "111099";
trn.OriginatingCompanyIdentifier_03 = "9012345678";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.TRN_PatientEventTrackingNumber.Add(trn);
// Dr. Gardener is requesting an initial consultation for the patient.
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.UM_HealthCareServicesReviewInformation = new UM_HealthCareServicesReviewInformation_3();
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.UM_HealthCareServicesReviewInformation.RequestCategoryCode_01 = "SC";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.UM_HealthCareServicesReviewInformation.CertificationTypeCode_02 = "I";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.UM_HealthCareServicesReviewInformation.ServiceTypeCode_03 = "3";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.UM_HealthCareServicesReviewInformation.ValuesEntered_04 = new C023_HealthCareServiceLocationInformation_4();
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.UM_HealthCareServicesReviewInformation.ValuesEntered_04.FacilityTypeCode_01 = "11";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.UM_HealthCareServicesReviewInformation.ValuesEntered_04.FacilityCodeQualifier_02 = "B";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.UM_HealthCareServicesReviewInformation.ReleaseofInformationCode_09 = "Y";
// The patient has been diagnosed with acute myocardial infarction; unspecified site.
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HI_PatientDiagnosis = new HI_PatientDiagnosis();
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HI_PatientDiagnosis.HealthCareCodeInformation_01 = new C022_HealthCareCodeInformation_24();
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HI_PatientDiagnosis.HealthCareCodeInformation_01.CodeListQualifierCode_01 = "BF";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HI_PatientDiagnosis.HealthCareCodeInformation_01.IndustryCode_02 = "41090";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HI_PatientDiagnosis.HealthCareCodeInformation_01.DateTimePeriodFormatQualifier_03 = "D8";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HI_PatientDiagnosis.HealthCareCodeInformation_01.DateTimePeriod_04 = "20050430";
// Dr. Gardener is requesting a single visit.
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HSD_HealthCareServicesDelivery = new HSD_HealthCareServicesDelivery_2();
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HSD_HealthCareServicesDelivery.QuantityQualifier_01 = "VS";
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.HSD_HealthCareServicesDelivery.BenefitQuantity_02 = "1";
// Occurrence of NM1 Loops in any order
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.AllNM1 = new All_NM1_278_2();
// Repeating 2010EA Loops
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.AllNM1.Loop2010EA = new List();
// Begin 2010EA Loop
var loop2010Ea = new Loop_2010EA_278();
// The patient event provider is identified as Susan Watson. Her Social Security Number is 987654321.
loop2010Ea.NM1_PatientEventProviderName = new NM1_PatientEventProviderName();
loop2010Ea.NM1_PatientEventProviderName.EntityIdentifierCode_01 = "SJ";
loop2010Ea.NM1_PatientEventProviderName.EntityTypeQualifier_02 = "1";
loop2010Ea.NM1_PatientEventProviderName.ResponseContactLastorOrganizationName_03 = "WATSON";
loop2010Ea.NM1_PatientEventProviderName.ResponseContactFirstName_04 = "SUSAN";
loop2010Ea.NM1_PatientEventProviderName.IdentificationCodeQualifier_08 = "34";
loop2010Ea.NM1_PatientEventProviderName.ResponseContactIdentifier_09 = "987654321";
// Dr. Watson can be contacted by telephone at (402)999-3456.
loop2010Ea.PER_PatientEventProviderContactInformation = new PER_PatientEventProviderContactInformation();
loop2010Ea.PER_PatientEventProviderContactInformation.ContactFunctionCode_01 = "IC";
loop2010Ea.PER_PatientEventProviderContactInformation.CommunicationNumberQualifier_03 = "TE";
loop2010Ea.PER_PatientEventProviderContactInformation.ResponseContactCommunicationNumber_04 = "4029993456";
// End 2010EA Loop
result.LoopBHT.Loop2000A.Loop2000B.Loop2000C.Loop2000E.AllNM1.Loop2010EA.Add(loop2010Ea);
// End 2000E Loop
// End 2000C Loop
// End 2000B Loop
// End 2000A Loop
// End Loop BHT
return result;
}
}
}More operations in ediFabric .NET
278 questions
Is the 278 request the same transaction as the response?
Yes. Both are ST*278 with the same implementation guide. BHT02 and the presence of HCR segments show whether a document is a request or a response.
Where is the authorization decision?
In the HCR segment. HCR01 A1 means certified in total, A3 not certified, A4 pended and A6 modified. HCR02 carries the authorization or reference number.
Is prior authorization done in real time?
It can be. The 278 is exchanged both in real time and in batch, depending on the payer's connectivity.
How do I parse and generate X12 278 files in .NET, Python, Java and C?
In .NET, install EdiFabric and EdiFabric.Templates.Hipaa, read the file with X12Reader into TS278 objects and write them back with X12Writer. From Python, Java or C, use ediFabric Native, which converts 278 files to JSON and JSON back to X12 inside your process. From any other language, post the file to the ediFabric Cloud REST API.
Resources
Parse your first X12 278 in five minutes
The Community plan is free forever and needs no credit card. It includes ediFabric .NET, Native and Cloud with one serial key.
Sign up free Validate EDI files free