Module: Stupidedi::Guides::FiftyTen::X221A1

Defined in:
lib/stupidedi/guides/005010.rb,
lib/stupidedi/guides/005010/X221A1-HP835.rb

Constant Summary collapse

HP835 =
b.build(t::HP835,
          d::TableDef.header("Table 1 - Header",
            b::Segment(100, s::ST, "Transaction Set Header",
r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Set Identifier Code", b::Values("835")),
b::Element(e::Required,    "Transaction Set Control Number"),
b::Element(e::NotUsed,     "Implementation Guide Version Name")),
            b::Segment(200, s::BPR, "Financial Information",
r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Handling Code", b::Values("C", "D", "H", "I", "P", "U", "X")),
b::Element(e::Required,    "Total Actual Provider Payment Amount", b::MaxLength(10)),
b::Element(e::Required,    "Credit or Debit Flag Code", b::Values("C", "D")),
b::Element(e::Required,    "Payment Method Code", b::Values("ACH", "BOP", "CHK", "FWT", "NON")),
b::Element(e::Situational, "Payment Format Code", b::Values("CCP", "CTX")),
b::Element(e::Situational, "Depository Financial Institution (DFI) Identification Number Qualifier", b::Values("01", "04")),
b::Element(e::Situational, "Sender DFI Number"),
b::Element(e::Situational, "Account Number Qualifier", b::Values("DA")),
b::Element(e::Situational, "Sender Bank Account Number"),
b::Element(e::Situational, "Payer Identifier"),
b::Element(e::Situational, "Originating Company Supplemental Code"),
b::Element(e::Situational, "Depository Financial Institution (DFI) Identification Number Qualifier", b::Values("01", "04")),
b::Element(e::Situational, "Receiver or Provider Bank ID Number"),
b::Element(e::Situational, "Account Number Qualifier", b::Values("DA", "SG")),
b::Element(e::Situational, "Receiver or Provider Account Number"),
b::Element(e::Required,    "Check Issue or EFT Effective Date"),
b::Element(e::NotUsed,     "Business Function Code"),
b::Element(e::NotUsed,     "(DFI) ID Number Qualifier"),
b::Element(e::NotUsed,     "(DFI) Identification Number"),
b::Element(e::NotUsed,     "Account Number Qualifier"),
b::Element(e::NotUsed,     "Account Number")),
            b::Segment(400, s::TRN, "Reassociation Trace Number",
r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Trace Type Code", b::Values("1")),
b::Element(e::Required,    "Check or EFT Trace Number"),
b::Element(e::Required,    "Payer Identifier"),
b::Element(e::Situational, "Originating Company Supplemental Code")),
            b::Segment(500, s::CUR, "Foreign Currency Information",
r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Entity Identifier Code", b::Values("PR")),
b::Element(e::Required,    "Currency Code"),
b::Element(e::NotUsed,     "Exchange Rate"),
b::Element(e::NotUsed,     "Entity Identifier Code"),
b::Element(e::NotUsed,     "Currency Code"),
b::Element(e::NotUsed,     "Currency Market/Exchange Code"),
b::Element(e::NotUsed,     "Date/Time Qualifier"),
b::Element(e::NotUsed,     "Date"),
b::Element(e::NotUsed,     "Time"),
b::Element(e::NotUsed,     "Date/Time Qualifier"),
b::Element(e::NotUsed,     "Date"),
b::Element(e::NotUsed,     "Time"),
b::Element(e::NotUsed,     "Date/Time Qualifier"),
b::Element(e::NotUsed,     "Date"),
b::Element(e::NotUsed,     "Time"),
b::Element(e::NotUsed,     "Date/Time Qualifier"),
b::Element(e::NotUsed,     "Date"),
b::Element(e::NotUsed,     "Time"),
b::Element(e::NotUsed,     "Date/Time Qualifier"),
b::Element(e::NotUsed,     "Date"),
b::Element(e::NotUsed,     "Time")),
            b::Segment(600, s::REF, "Receiver Identification",
r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Reference Identification Qualifier", b::Values("EV")),
b::Element(e::Required,    "Receiver Identifier"),
b::Element(e::NotUsed,     "Description"),
b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
            b::Segment(600, s::REF, "Version Identification",
r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Reference Identification Qualifier", b::Values("F2")),
b::Element(e::Required,    "Version Identification Code"),
b::Element(e::NotUsed,     "Description"),
b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
            b::Segment(700, s::DTM, "Production Date",
r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Date/Time Qualifier", b::Values("405")),
b::Element(e::Required,    "Production Date"),
b::Element(e::NotUsed,     "Time"),
b::Element(e::NotUsed,     "Time Code"),
b::Element(e::NotUsed,     "Date Time Period Format Qualifier"),
b::Element(e::NotUsed,     "Date Time Period")),

            d::LoopDef.build("1000A PAYER IDENTIFICATION",
d::RepeatCount.bounded(1),
b::Segment( 800, s::N1, "Payer Identification",
  r::Required, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Entity Identifier Code", b::Values("PR")),
  b::Element(e::Required,    "Payer Name"),
  b::Element(e::Situational, "Identification Code Qualifier", b::Values("XV")),
  b::Element(e::Situational, "Payer Identifier"),
  b::Element(e::NotUsed,     "Entity Relationship Code"),
  b::Element(e::NotUsed,     "Entity Identifier Code")),
b::Segment(1000, s::N3, "Payer Address",
  r::Required, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Payer Address Line"),
  b::Element(e::Situational, "Payer Address Line")),
b::Segment(1100, s::N4, "Payer City, State, ZIP Code",
  r::Required, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Payer City Name"),
  b::Element(e::Situational, "Payer State or Province Code"),
  b::Element(e::Situational, "Payer Postal Zone or ZIP Code"),
  b::Element(e::Situational, "Country Code"),
  b::Element(e::NotUsed,     "Location Qualifier"),
  b::Element(e::NotUsed,     "Location Identifier"),
  b::Element(e::Situational, "Country Subdivision Code")),
b::Segment(1200, s::REF, "Additional Payer Identification",
  r::Situational, d::RepeatCount.bounded(4),
  b::Element(e::Required,    "Reference Identification Qualifier", b::Values("2U", "EO", "HI", "NF")),
  b::Element(e::Required,    "Additional Payer Identifier"),
  b::Element(e::NotUsed,     "Description"),
  b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
b::Segment(1300, s::PER, "Payer Business Contact Information",
  r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Contact Function Code", b::Values("CX")),
  b::Element(e::Situational, "Payer Contact Name"),
  b::Element(e::Situational, "Communication Number Qualifier", b::Values("EM", "FX", "TE")),
  b::Element(e::Situational, "Communication Number"),
  b::Element(e::Situational, "Communication Number Qualifier", b::Values("EM", "EX", "FX", "TE")),
  b::Element(e::Situational, "Communication Number"),
  b::Element(e::Situational, "Communication Number Qualifier", b::Values("EX")),
  b::Element(e::Situational, "Communication Number"),
  b::Element(e::NotUsed,     "Contact Inquiry Reference")),
b::Segment(1300, s::PER, "Payer Technical Contact Information",
  r::Required, d::RepeatCount.unbounded,
  b::Element(e::Required,    "Contact Function Code", b::Values("BL")),
  b::Element(e::Situational, "Payer Contact Name"),
  b::Element(e::Situational, "Communication Number Qualifier", b::Values("EM", "TE", "UR")),
  b::Element(e::Situational, "Communication Number"),
  b::Element(e::Situational, "Communication Number Qualifier", b::Values("EM", "EX", "FX", "TE", "UR")),
  b::Element(e::Situational, "Communication Number"),
  b::Element(e::Situational, "Communication Number Qualifier", b::Values("EM", "EX", "FX", "UR")),
  b::Element(e::Situational, "Communication Number"),
  b::Element(e::NotUsed,     "Contact Inquiry Reference")),
b::Segment(1300, s::PER, "Payer Web Site",
  r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Contact Function Code", b::Values("IC")),
  b::Element(e::NotUsed,     "Payer Contact Name"),
  b::Element(e::Required,    "Communication Number Qualifier", b::Values("UR")),
  b::Element(e::Required,    "Communication Number"),
  b::Element(e::NotUsed,     "Communication Number Qualifier"),
  b::Element(e::NotUsed,     "Communication Number"),
  b::Element(e::NotUsed,     "Communication Number Qualifier"),
  b::Element(e::NotUsed,     "Communication Number"),
  b::Element(e::NotUsed,     "Contact Inquiry Reference"))),

            d::LoopDef.build("1000B PAYEE IDENTIFICATION",
d::RepeatCount.bounded(1),
b::Segment( 800, s::N1, "Payee Identification",
  r::Required, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Entity Identifier Code", b::Values("PE")),
  b::Element(e::Required,    "Payee Name"),
  b::Element(e::Required,    "Identification Code Qualifier", b::Values("FI", "XV", "XX")),
  b::Element(e::Required,    "Payee Identification Code"),
  b::Element(e::NotUsed,     "Entity Relationship Code"),
  b::Element(e::NotUsed,     "Entity Identifier Code")),
b::Segment(1000, s::N3, "Payee Address",
  r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Payee Address Line"),
  b::Element(e::Situational, "Payee Address Line")),
b::Segment(1100, s::N4, "Payee City, State, ZIP Code",
  r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Payee City Name"),
  b::Element(e::Situational, "Payee State or Province Code"),
  b::Element(e::Situational, "Payee Postal Zone or ZIP Code"),
  b::Element(e::Situational, "Country Code"),
  b::Element(e::NotUsed,     "Location Qualifier"),
  b::Element(e::NotUsed,     "Location Identifier"),
  b::Element(e::Situational, "Country Subdivision Code")),
b::Segment(1200, s::REF, "Payee Additional Identification",
  r::Situational, d::RepeatCount.unbounded,
  b::Element(e::Required,    "Reference Identification Qualifier", b::Values("0B", "D3", "PQ", "TJ")),
  b::Element(e::Required,    "Additional Payee Identifier"),
  b::Element(e::NotUsed,     "Description"),
  b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
b::Segment(1400, s::RDM, "Remittance Delivery Method",
  r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Report Transmission Code", b::Values("BM", "EM", "FT", "OL")),
  b::Element(e::Situational, "Name"),
  b::Element(e::Situational, "Communication Number"),
  b::Element(e::NotUsed,     "REFERENCE IDENTIFIER"),
  b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")))),

          d::TableDef.detail("Table 2 - Detail",
            d::LoopDef.build("2000 HEADER NUMBER",
d::RepeatCount.bounded(1),
b::Segment(30, s::LX, "Header Number",
  r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Assigned Number")),
b::Segment(50, s::TS3, "Provider Summary Information",
  r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Provider Identifier"),
  b::Element(e::Required,    "Facility Type Code"),
  b::Element(e::Required,    "Fiscal Period Date"),
  b::Element(e::Required,    "Total Claim Count"),
  b::Element(e::Required,    "Total Claim Charge Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::Situational, "Total MSP Payer Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::Situational, "Total Non-Lab Charge Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::Situational, "Total HCPCS Reported Charge Amount"),
  b::Element(e::Situational, "Total HCPCS Payable Amount"),
  b::Element(e::NotUsed,     "Monetary Amount"),
  b::Element(e::Situational, "Total Professional Component Amount"),
  b::Element(e::Situational, "Total MSP Patient Liability Met Amount"),
  b::Element(e::Situational, "Total Patient Reimbursement Amount"),
  b::Element(e::Situational, "Total PIP Claim Count"),
  b::Element(e::Situational, "Total PIP Adjustment Amount")),
b::Segment(70, s::TS2, "Provider Supplemental Summary Information",
  r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Situational,  "Total DRG Amount"),
  b::Element(e::Situational,  "Total Federal Specific Amount"),
  b::Element(e::Situational,  "Total Hospital Specific Amount"),
  b::Element(e::Situational,  "Total Disproportionate Share Amount"),
  b::Element(e::Situational,  "Total Capital Amount"),
  b::Element(e::Situational,  "Total Indirect Medical Education Amount"),
  b::Element(e::Situational,  "Total Outlier Day Count"),
  b::Element(e::Situational,  "Total Day Outlier Count"),
  b::Element(e::Situational,  "Total Cost Outlier Amount"),
  b::Element(e::Situational,  "Average DRG Length of Stay"),
  b::Element(e::Situational,  "Total Discharge Amount"),
  b::Element(e::Situational,  "Total Cost Report Day Count"),
  b::Element(e::Situational,  "Total Covered Day Count"),
  b::Element(e::Situational,  "Total Noncovered Day Count"),
  b::Element(e::Situational,  "Total MSP Pass-Through Count"),
  b::Element(e::Situational,  "Average DRG Weight"),
  b::Element(e::Situational,  "Total PPS Capital FSP DRG Amount"),
  b::Element(e::Situational,  "Total PPS Capital HSP DRG Amount"),
  b::Element(e::Situational,  "Total PPS DSH DRG Amount")),

d::LoopDef.build("2100 CLAIM PAYMENT INFORMATION",
  d::RepeatCount.unbounded,
  b::Segment( 100, s::CLP, "Claim Payment Information",
    r::Required, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Patient Control Number"),
    b::Element(e::Required,    "Claim Status Code", b::Values("1", "2", "3", "4", "19", "20", "21", "22", "23", "25")),
    b::Element(e::Required,    "Total Claim Charge Amount"),
    b::Element(e::Required,    "Claim Payment Amount"),
    b::Element(e::Situational, "Patient Responsibility Amount"),
    b::Element(e::Required,    "Claim Filing Indicator Code", b::Values("12", "13", "14", "15", "16", "17", "AM", "CH", "DS", "HM", "LM", "MA", "MB", "MC", "OF", "TV", "VA", "WC", "ZZ")),
    b::Element(e::Required,    "Payer Claim Control Number"),
    b::Element(e::Situational, "Facility Type Code"),
    b::Element(e::Situational, "Claim Frequency Type Code"),
    b::Element(e::NotUsed,     "Patient Status Code"),
    b::Element(e::Situational, "Diagnosis Related Group (DRG) Code"),
    b::Element(e::Situational, "Diagnosis Related Group (DRG) Weight"),
    b::Element(e::Situational, "Discharge Fraction"),
    b::Element(e::NotUsed,     "Yes/No Condition or Response Code")),
  b::Segment( 200, s::CAS, "Claim Adjustment",
    r::Situational, d::RepeatCount.bounded(99),
    b::Element(e::Required,    "Claim Adjustment Group Code", b::Values("CO", "CR", "OA", "PI", "PR")),
    b::Element(e::Required,    "Adjustment Reason Code"),
    b::Element(e::Required,    "Adjustment Amount"),
    b::Element(e::Situational, "Adjustment Quantity"),
    b::Element(e::Situational, "Adjustment Reason Code"),
    b::Element(e::Situational, "Adjustment Amount"),
    b::Element(e::Situational, "Adjustment Quantity"),
    b::Element(e::Situational, "Adjustment Reason Code"),
    b::Element(e::Situational, "Adjustment Amount"),
    b::Element(e::Situational, "Adjustment Quantity"),
    b::Element(e::Situational, "Adjustment Reason Code"),
    b::Element(e::Situational, "Adjustment Amount"),
    b::Element(e::Situational, "Adjustment Quantity"),
    b::Element(e::Situational, "Adjustment Reason Code"),
    b::Element(e::Situational, "Adjustment Amount"),
    b::Element(e::Situational, "Adjustment Quantity"),
    b::Element(e::Situational, "Adjustment Reason Code"),
    b::Element(e::Situational, "Adjustment Amount"),
    b::Element(e::Situational, "Adjustment Quantity")),
  b::Segment( 300, s::NM1, "Patient Name",
    r::Required, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("QC")),
    b::Element(e::Required,    "Entity Type Qualifier", b::Values("1")),
    b::Element(e::Situational, "Patient Last Name"),
    b::Element(e::Situational, "Patient First Name"),
    b::Element(e::Situational, "Patient Middle Name or Initial"),
    b::Element(e::NotUsed,     "Name Prefix"),
    b::Element(e::Situational, "Patient Name Suffix"),
    b::Element(e::Situational, "Identification Code Qualifier", b::Values("34", "HN", "II", "MI", "MR")),
    b::Element(e::Situational, "Patient Identifier"),
    b::Element(e::NotUsed,     "Entity Relationship Code"),
    b::Element(e::NotUsed,     "Entity Identifier Code"),
    b::Element(e::NotUsed,     "Name Last or Organization Name")),
  b::Segment( 300, s::NM1, "Insured Name",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("IL")),
    b::Element(e::Required,    "Entity Type Qualifier", b::Values("1", "2")),
    b::Element(e::Situational, "Subscriber Last Name"),
    b::Element(e::Situational, "Subscriber First Name"),
    b::Element(e::Situational, "Subscriber Middle Name or Initial"),
    b::Element(e::NotUsed,     "Name Prefix"),
    b::Element(e::Situational, "Subscriber Name Suffix"),
    b::Element(e::Required,    "Identification Code Qualifier", b::Values("FI", "II", "MI")),
    b::Element(e::Required,    "Subscriber Identifier"),
    b::Element(e::NotUsed,     "Entity Relationship Code"),
    b::Element(e::NotUsed,     "Entity Identifier Code"),
    b::Element(e::NotUsed,     "Name Last or Organization Name")),
  b::Segment( 300, s::NM1, "Corrected Patient/Insured Name",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("74")),
    b::Element(e::Required,    "Entity Type Qualifier", b::Values("1")),
    b::Element(e::Situational, "Corrected Patient or Insured Last Name"),
    b::Element(e::Situational, "Corrected Patient or Insured First Name"),
    b::Element(e::Situational, "Corrected Patient or Insured Middle Name or Initial"),
    b::Element(e::NotUsed,     "Name Prefix"),
    b::Element(e::Situational, "Corrected Patient or Insured Name Suffix"),
    b::Element(e::Situational, "Identification Code Qualifier", b::Values("C")),
    b::Element(e::Situational, "Corrected Insured Identification Indicator"),
    b::Element(e::NotUsed,     "Entity Relationship Code"),
    b::Element(e::NotUsed,     "Entity Identifier Code"),
    b::Element(e::NotUsed,     "Name Last or Organization Name")),
  b::Segment( 300, s::NM1, "Service Provider Name",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("82")),
    b::Element(e::Required,    "Entity Type Qualifier", b::Values("1", "2")),
    b::Element(e::Situational, "Rendering Provider Last or Organization Name"),
    b::Element(e::Situational, "Rendering Provider First Name"),
    b::Element(e::Situational, "Rendering Provider Middle Name or Initial"),
    b::Element(e::NotUsed,     "Name Prefix"),
    b::Element(e::Situational, "Rendering Provider Name Suffix"),
    b::Element(e::Required,    "Identification Code Qualifier", b::Values("BD", "BS", "FI", "MC", "PC", "SL", "UP", "XX")),
    b::Element(e::Required,    "Rendering Provider Identifier"),
    b::Element(e::NotUsed,     "Entity Relationship Code"),
    b::Element(e::NotUsed,     "Entity Identifier Code"),
    b::Element(e::NotUsed,     "Name Last or Organization Name")),
  b::Segment( 300, s::NM1, "Crossover Carrier Name",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("TT")),
    b::Element(e::Required,    "Entity Type Qualifier", b::Values("2")),
    b::Element(e::Required,    "Coordination of Benefits Carrier Name"),
    b::Element(e::NotUsed,     "Name First"),
    b::Element(e::NotUsed,     "Name Middle"),
    b::Element(e::NotUsed,     "Name Prefix"),
    b::Element(e::Situational, "Rendering Provider Name Suffix"),
    b::Element(e::Required,    "Identification Code Qualifier", b::Values("AD", "FI", "NI", "PI", "PP", "XV")),
    b::Element(e::Required,    "Coordination of Benefits Carrient Identifier"),
    b::Element(e::NotUsed,     "Entity Relationship Code"),
    b::Element(e::NotUsed,     "Entity Identifier Code"),
    b::Element(e::NotUsed,     "Name Last or Organization Name")),
  b::Segment( 300, s::NM1, "Corrected Priority Payer Name",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("PR")),
    b::Element(e::Required,    "Entity Type Qualifier", b::Values("2")),
    b::Element(e::Required,    "Corrected Priority Payer Name"),
    b::Element(e::NotUsed,     "Name First"),
    b::Element(e::NotUsed,     "Name Middle"),
    b::Element(e::NotUsed,     "Name Prefix"),
    b::Element(e::Situational, "Rendering Provider Name Suffix"),
    b::Element(e::Required,    "Identification Code Qualifier", b::Values("AD", "FI", "NI", "PI", "PP", "XV")),
    b::Element(e::Required,    "Corrected Priority Payer Identification Number"),
    b::Element(e::NotUsed,     "Entity Relationship Code"),
    b::Element(e::NotUsed,     "Entity Identifier Code"),
    b::Element(e::NotUsed,     "Name Last or Organization Name")),
  b::Segment( 300, s::NM1, "Other Subscriber Name",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("GB")),
    b::Element(e::Required,    "Entity Type Qualifier", b::Values("1", "2")),
    b::Element(e::Situational, "Other Subscriber Last Name"),
    b::Element(e::Situational, "Other Subscriber First Name"),
    b::Element(e::Situational, "Other Subscriber Middle Name or Initial"),
    b::Element(e::NotUsed,     "Name Prefix"),
    b::Element(e::Situational, "Other Subscriber Name Suffix"),
    b::Element(e::Situational, "Identification Code Qualifier", b::Values("FI", "II", "MI")),
    b::Element(e::Situational, "Other Subscriber Identifier"),
    b::Element(e::NotUsed,     "Entity Relationship Code"),
    b::Element(e::NotUsed,     "Entity Identifier Code"),
    b::Element(e::NotUsed,     "Name Last or Organization Name")),
  b::Segment( 330, s::MIA, "Inpatient Adjudication Information",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Covered Days or Visits Count"),
    b::Element(e::Situational, "PPS Operating Outlier Amount"),
    b::Element(e::Situational, "Lifetime Psychiatric Days Count"),
    b::Element(e::Situational, "Claim DRG Amount"),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "Claim Disproportionate Share Amount"),
    b::Element(e::Situational, "Claim MSP Pass-Through Amount"),
    b::Element(e::Situational, "Claim PPS Capital Amount"),
    b::Element(e::Situational, "PPS-Capital FSP DRG Amount"),
    b::Element(e::Situational, "PPS-Capital HSP DRG Amount"),
    b::Element(e::Situational, "PPS-Capital DSH DRG Amount"),
    b::Element(e::Situational, "Old Capital Amount"),
    b::Element(e::Situational, "PPS-Capital IME Amount"),
    b::Element(e::Situational, "PPS-Operating Hospital Specific DRG Amount"),
    b::Element(e::Situational, "Cost Report Day Count"),
    b::Element(e::Situational, "PPS-Operating Federal Specific DRG Amount"),
    b::Element(e::Situational, "Claim PPS Capital Outlier Amount"),
    b::Element(e::Situational, "Claim Indirect Teaching Amount"),
    b::Element(e::Situational, "Nonpayable Professional Component Amount"),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "PPS-Capital Exception Amount")),
  b::Segment( 350, s::MOA, "Outpatient Adjudication Information",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Situational, "Reimbursement Rate"),
    b::Element(e::Situational, "Claim HCPCS Payable Amount", b::MaxLength(10)),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "Claim Payment Remark Code"),
    b::Element(e::Situational, "Claim ESRD Payment Amount", b::MaxLength(10)),
    b::Element(e::Situational, "Nonpayable Professional Component Amount", b::MaxLength(10))),
  b::Segment( 400, s::REF, "Other Claim Related Identification",
    r::Situational, d::RepeatCount.bounded(5),
    b::Element(e::Required,    "Reference Identification Qualifier", b::Values("1L", "1W", "28", "6P", "9A", "9C", "BB", "CE", "EA", "F8", "G1", "G3", "IG", "SY")),
    b::Element(e::Required,    "Other Claim Related Identifier"),
    b::Element(e::NotUsed,     "Description"),
    b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
  b::Segment( 400, s::REF, "Rendering Provider Identification",
    r::Situational, d::RepeatCount.bounded(10),
    b::Element(e::Required,    "Reference Identification Qualifier", b::Values("0B", "1A", "1B", "1C", "1D", "1G", "1H", "1J", "D3", "G2", "LU")),
    b::Element(e::Required,    "Rendering Provider Secondary Identifier"),
    b::Element(e::NotUsed,     "Description"),
    b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
  b::Segment( 500, s::DTM, "Statement From or To Date",
    r::Situational, d::RepeatCount.bounded(2),
    b::Element(e::Required,    "Date/Time Qualifier", b::Values("232", "233")),
    b::Element(e::Required,    "Claim Date"),
    b::Element(e::NotUsed,     "Time"),
    b::Element(e::NotUsed,     "Time Code"),
    b::Element(e::NotUsed,     "Date Time Period Format Qualifier"),
    b::Element(e::NotUsed,     "Date Time Period")),
  b::Segment( 500, s::DTM, "Coverage Expiration Date",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Date/Time Qualifier", b::Values("036")),
    b::Element(e::Required,    "Date"),
    b::Element(e::NotUsed,     "Time"),
    b::Element(e::NotUsed,     "Time Code"),
    b::Element(e::NotUsed,     "Date Time Period Format Qualifier"),
    b::Element(e::NotUsed,     "Date Time Period")),
  b::Segment( 500, s::DTM, "Claim Received Date",
    r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Date/Time Qualifier", b::Values("050")),
    b::Element(e::Required,    "Date"),
    b::Element(e::NotUsed,     "Time"),
    b::Element(e::NotUsed,     "Time Code"),
    b::Element(e::NotUsed,     "Date Time Period Format Qualifier"),
    b::Element(e::NotUsed,     "Date Time Period")),
  b::Segment( 600, s::PER, "Claim Contact Information",
    r::Situational, d::RepeatCount.bounded(2),
    b::Element(e::Required,    "Contact Function Code", b::Values("CX")),
    b::Element(e::Situational, "Claim Contact Name"),
    b::Element(e::Required,    "Communication Number Qualifier", b::Values("EM", "FX", "TE")),
    b::Element(e::Required,    "Claim Contact Communication Number"),
    b::Element(e::Situational, "Communication Number Qualifier", b::Values("EM", "EX", "FX", "TE")),
    b::Element(e::Situational, "Claim Contact Communication Number"),
    b::Element(e::Situational, "Communication Number Qualifier", b::Values("EX")),
    b::Element(e::Situational, "Claim Contact Communication Number Extension"),
    b::Element(e::NotUsed,     "Contact Inquiry Reference")),
  b::Segment( 620, s::AMT, "Claim Supplemental Information",
    r::Situational, d::RepeatCount.bounded(13),
    b::Element(e::Required,    "Amount Qualifier Code", b::Values("AU", "D8", "DY", "F5", "I", "NL", "T", "T2", "ZK", "ZL", "ZM", "ZN", "ZO")),
    b::Element(e::Required,    "Claim Supplemental Information Amount"),
    b::Element(e::NotUsed,     "Credit/Debit Flag Code")),
  b::Segment( 640, s::QTY, "Claim Supplemental Information Quantity",
    r::Situational, d::RepeatCount.bounded(14),
    b::Element(e::Required,    "Quantity Qualifier", b::Values("CA", "CD", "LA", "LE", "NE", "NR", "OU", "PS", "VS", "ZK", "ZL", "ZM", "ZN", "ZO")),
    b::Element(e::Required,    "Claim Supplemental Information Quantity"),
    b::Element(e::NotUsed,     "COMPOSITE UNIT OF MEASURE"),
    b::Element(e::NotUsed,     "Free-Form Information")),

  d::LoopDef.build("2110 SERVICE PAYMENT INFORMATION",
    d::RepeatCount.bounded(999),
    b::Segment( 700, s::SVC, "Service Payment Information",
      r::Situational, d::RepeatCount.bounded(1),
      b::Element(e::Required,    "COMPOSITE MEDICAL PROCEDURE IDENTIFIER",
        b::Element(e::Required,    "Product or Service ID Qualifier", b::Values("AD", "ER", "HC", "HP", "IV", "N4", "N6", "NU", "UI", "WK")),
        b::Element(e::Required,    "Adjudicated Procedure Code"),
        b::Element(e::Situational, "Procedure Modifier"),
        b::Element(e::Situational, "Procedure Modifier"),
        b::Element(e::Situational, "Procedure Modifier"),
        b::Element(e::Situational, "Procedure Modifier"),
        b::Element(e::NotUsed,     "Description"),
        b::Element(e::NotUsed,     "Product/Service ID")),
      b::Element(e::Required,    "Line Item Charge Amount", b::MaxLength(10)),
      b::Element(e::Required,    "Line Item Provider Payment Amount", b::MaxLength(10)),
      b::Element(e::Situational, "National Uniform Billing Committee Revenue Code"),
      b::Element(e::Situational, "Units of Service Paid Count"),
      b::Element(e::Situational, "COMPOSITE MEDICAL PROCEDURE IDENTIFIER",
        b::Element(e::Required,    "Product or Service ID Qualifier", b::Values("AD", "ER", "HC", "HP", "IV", "N4", "N6", "NU", "UI", "WK")),
        b::Element(e::Required,    "Procedure Code"),
        b::Element(e::Situational, "Procedure Modifier"),
        b::Element(e::Situational, "Procedure Modifier"),
        b::Element(e::Situational, "Procedure Modifier"),
        b::Element(e::Situational, "Procedure Modifier"),
        b::Element(e::NotUsed,     "Description"),
        b::Element(e::NotUsed,     "Product/Service ID")),
      b::Element(e::Situational, "Original Units of Service Count")),
    b::Segment( 800, s::DTM, "Service Date",
      r::Situational, d::RepeatCount.bounded(2),
      b::Element(e::Required,    "Date/Time Qualifier", b::Values("150", "151", "472")),
      b::Element(e::Required,    "Service Date"),
      b::Element(e::NotUsed,     "Time"),
      b::Element(e::NotUsed,     "Time Code"),
      b::Element(e::NotUsed,     "Date Time Period Format Qualifier"),
      b::Element(e::NotUsed,     "Date Time Period")),
    b::Segment( 900, s::CAS, "Service Adjustment",
      r::Situational, d::RepeatCount.bounded(99),
      b::Element(e::Required,    "Claim Adjustment Group Code", b::Values("CO", "CR", "OA", "PI", "PR")),
      b::Element(e::Required,    "Adjustment Reason Code"),
      b::Element(e::Required,    "Adjustment Amount", b::MaxLength(10)),
      b::Element(e::Situational, "Adjustment Quantity"),
      b::Element(e::Situational, "Adjustment Reason Code"),
      b::Element(e::Situational, "Adjustment Amount", b::MaxLength(10)),
      b::Element(e::Situational, "Adjustment Quantity"),
      b::Element(e::Situational, "Adjustment Reason Code"),
      b::Element(e::Situational, "Adjustment Amount", b::MaxLength(10)),
      b::Element(e::Situational, "Adjustment Quantity"),
      b::Element(e::Situational, "Adjustment Reason Code"),
      b::Element(e::Situational, "Adjustment Amount", b::MaxLength(10)),
      b::Element(e::Situational, "Adjustment Quantity"),
      b::Element(e::Situational, "Adjustment Reason Code"),
      b::Element(e::Situational, "Adjustment Amount", b::MaxLength(10)),
      b::Element(e::Situational, "Adjustment Quantity"),
      b::Element(e::Situational, "Adjustment Reason Code"),
      b::Element(e::Situational, "Adjustment Amount", b::MaxLength(10)),
      b::Element(e::Situational, "Adjustment Quantity")),
    b::Segment(1000, s::REF, "Service Identification",
      r::Situational, d::RepeatCount.bounded(8),
      b::Element(e::Required,    "Reference Identification Qualifier", b::Values("1S", "APC", "BB", "E9", "G1", "G3", "LU", "RB")),
      b::Element(e::Required,    "Provider Identifier"),
      b::Element(e::NotUsed,     "Description"),
      b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
    b::Segment(1000, s::REF, "Line Item Control Number",
      r::Situational, d::RepeatCount.bounded(1),
      b::Element(e::Required,    "Reference Identification Qualifier", b::Values("6R")),
      b::Element(e::Required,    "Line Item Control Number"),
      b::Element(e::NotUsed,     "Description"),
      b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
    b::Segment(1000, s::REF, "Rendering Provider Information",
      r::Situational, d::RepeatCount.bounded(10),
      b::Element(e::Required,    "Reference Identification Qualifier", b::Values("0B", "1A", "1B", "1C", "1D", "1G", "1H", "1J", "D3", "G2", "HPI", "SY", "TJ")),
      b::Element(e::Required,    "Rendering Provider Identifier"),
      b::Element(e::NotUsed,     "Description"),
      b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
    b::Segment(1000, s::REF, "HealthCare Policy Identification",
      r::Situational, d::RepeatCount.bounded(5),
      b::Element(e::Required,    "Reference Identification Qualifier", b::Values("0K")),
      b::Element(e::Required,    "Healthcare Policy Identification"),
      b::Element(e::NotUsed,     "Description"),
      b::Element(e::NotUsed,     "REFERENCE IDENTIFIER")),
    b::Segment(1100, s::AMT, "Service Supplemental Amount",
      r::Situational, d::RepeatCount.bounded(9),
      b::Element(e::Required,    "Amount Qualifier Code", b::Values("B6", "KH", "T", "T2", "ZK", "ZL", "ZM", "ZN", "ZO")),
      b::Element(e::Required,    "Service Supplemental Amount", b::MaxLength(10)),
      b::Element(e::NotUsed,     "Credit/Debit Flag Code")),
    b::Segment(1200, s::QTY, "Service Supplemental Quantity",
      r::Situational, d::RepeatCount.bounded(6),
      b::Element(e::Required,    "Quantity Qualifier", b::Values("ZK", "ZL", "ZM", "ZN", "ZO")),
      b::Element(e::Required,    "Service Supplemental Quantity Count"),
      b::Element(e::NotUsed,     "COMPOSITE UNIT OF MEASURE"),
      b::Element(e::NotUsed,     "Free-Form Information")),
    b::Segment(1300, s::LQ, "Health Care Remark Codes",
      r::Situational, d::RepeatCount.bounded(99),
      b::Element(e::Required,    "Code List Qualifier Code", b::Values("HE", "RX")),
      b::Element(e::Required,    "Remark Code")))))),

          d::TableDef.summary("Table 3 - Summary",
            b::Segment(100, s::PLB, "Provider Adjustment",
r::Situational, d::RepeatCount.unbounded,
b::Element(e::Required,    "Provider Identifier"),
b::Element(e::Required,    "Fiscal Period Date"),
b::Element(e::Required,    "ADJUSTMENT IDENTIFIER",
  b::Element(e::Required,    "Adjustment Reason Code", b::Values("50", "51", "72", "90", "AH", "AM", "AP", "B2", "B3", "BD", "BN", "C5", "CR", "CS", "CT", "CV", "CW", "DM", "E3", "FB", "FC", "GO", "HM", "IP", "IR", "IS", "J1", "L3", "L6", "LE", "LS", "OA", "OB", "PI", "PL", "RA", "RE", "SL", "TL", "WO", "WU")),
  b::Element(e::Situational, "Provider Adjustment Identifier")),
b::Element(e::Required,    "Provider Adjustment Amount", b::MaxLength(10)),
b::Element(e::Situational, "ADJUSTMENT IDENTIFIER",
  b::Element(e::Required,    "Adjustment Reason Code", b::Values("50", "51", "72", "90", "AH", "AM", "AP", "B2", "B3", "BD", "BN", "C5", "CR", "CS", "CT", "CV", "CW", "DM", "E3", "FB", "FC", "GO", "HM", "IP", "IR", "IS", "J1", "L3", "L6", "LE", "LS", "OA", "OB", "PI", "PL", "RA", "RE", "SL", "TL", "WO", "WU")),
  b::Element(e::Situational, "Provider Adjustment Identifier")),
b::Element(e::Situational, "Provider Adjustment Amount", b::MaxLength(10)),
b::Element(e::Situational, "ADJUSTMENT IDENTIFIER",
  b::Element(e::Required,    "Adjustment Reason Code", b::Values("50", "51", "72", "90", "AH", "AM", "AP", "B2", "B3", "BD", "BN", "C5", "CR", "CS", "CT", "CV", "CW", "DM", "E3", "FB", "FC", "GO", "HM", "IP", "IR", "IS", "J1", "L3", "L6", "LE", "LS", "OA", "OB", "PI", "PL", "RA", "RE", "SL", "TL", "WO", "WU")),
  b::Element(e::Situational, "Provider Adjustment Identifier")),
b::Element(e::Situational, "Provider Adjustment Amount", b::MaxLength(10)),
b::Element(e::Situational, "ADJUSTMENT IDENTIFIER",
  b::Element(e::Required,    "Adjustment Reason Code", b::Values("50", "51", "72", "90", "AH", "AM", "AP", "B2", "B3", "BD", "BN", "C5", "CR", "CS", "CT", "CV", "CW", "DM", "E3", "FB", "FC", "GO", "HM", "IP", "IR", "IS", "J1", "L3", "L6", "LE", "LS", "OA", "OB", "PI", "PL", "RA", "RE", "SL", "TL", "WO", "WU")),
  b::Element(e::Situational, "Provider Adjustment Identifier")),
b::Element(e::Situational, "Provider Adjustment Amount", b::MaxLength(10)),
b::Element(e::Situational, "ADJUSTMENT IDENTIFIER",
  b::Element(e::Required,    "Adjustment Reason Code", b::Values("50", "51", "72", "90", "AH", "AM", "AP", "B2", "B3", "BD", "BN", "C5", "CR", "CS", "CT", "CV", "CW", "DM", "E3", "FB", "FC", "GO", "HM", "IP", "IR", "IS", "J1", "L3", "L6", "LE", "LS", "OA", "OB", "PI", "PL", "RA", "RE", "SL", "TL", "WO", "WU")),
  b::Element(e::Situational, "Provider Adjustment Identifier")),
b::Element(e::Situational, "Provider Adjustment Amount", b::MaxLength(10)),
b::Element(e::Situational, "ADJUSTMENT IDENTIFIER",
  b::Element(e::Required,    "Adjustment Reason Code", b::Values("50", "51", "72", "90", "AH", "AM", "AP", "B2", "B3", "BD", "BN", "C5", "CR", "CS", "CT", "CV", "CW", "DM", "E3", "FB", "FC", "GO", "HM", "IP", "IR", "IS", "J1", "L3", "L6", "LE", "LS", "OA", "OB", "PI", "PL", "RA", "RE", "SL", "TL", "WO", "WU")),
  b::Element(e::Situational, "Provider Adjustment Identifier")),
b::Element(e::Situational, "Provider Adjustment Amount", b::MaxLength(10))),
            b::Segment(200, s::SE, "Transaction Set Trailer",
r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Segment Count"),
b::Element(e::Required,    "Transaction Set Control Number"))))