# frozen_string_literal: true
module Stupidedi
  module Versions
    module FiftyTen
      module ElementDefs
        t = ElementTypes
        r = ElementReqs
        s = Schema

        E2    = t::Nn.new(:E2   , "Number of Accepted Transaction Sets"  , 1, 6, 0)
        E19   = t::AN.new(:E19  , "City Name"                            , 2, 30)
        E26   = t::ID.new(:E26  , "Country Code"                         , 2, 3,
          s::CodeList.external("5"))
        E28   = t::Nn.new(:E28  , "Group Control Number"                 , 1, 9, 0)
        E61   = t::AN.new(:E61  , "Free-form Information"                , 1, 30)
        E65   = t:: R.new(:E65  , "Height"                               , 1, 8)
        E66   = t::ID.new(:E66  , "Identification Code Qualifier"        , 1, 2,
          s::CodeList.build(
            "1"  => s::CodeList.external("16"),
            "9"  => s::CodeList.external("16"),
            "21" => s::CodeList.external("121"),
            "24" => "Employer’s Identification Number",
            "34" => "Social Security Number",
            "38" => s::CodeList.external("5"),
            "46" => "Electronic Transmitter Identification Number (ETIN)",
            "51" => s::CodeList.external("51"),
            "58" => "@todo",
            "94" => "Code assigned by the organization that is the ultimate destination of the transaction set",
            "AC" => "Attachment Control Number",
            "AD" => "Blue Cross Blue Shield Associtation Plan Code",
            "BD" => "Blue Cross Provider Number",
            "BS" => "Blue Shield Provider Number",
            "C"  => "Insured's Changed Unique Identification Number",
            "C1" => "@todo",
            "CF" => s::CodeList.external("91"),
            "CI" => "@todo",
            "EI" => "@todo",
            "FA" => "Facility Identification",
            "FI" => "Federal Taxpayer's Identification Number",
            "HN" => "Health Insurance Claim (HIC) Number",
            "II" => "Standard Unique Health Identifier for each Individual in the United States",
            "LD" => s::CodeList.external("457"),
            "LE" => s::CodeList.external("102"),
            "NI" => "National Association of Insurance Commisioners (NAIC) Identification",
            "MI" => "Member Identification Number",
            "MC" => "Medicaid Provider",
            "MR" => "Medicaid Recipient Identification Number",
            "PC" => "Provider Commercial Number",
            "PI" => "Payor Identification",
            "PP" => "Pharmacy Processor Number",
            "SJ" => s::CodeList.external("22"),
            "SL" => "State License Number",
            "SV" => "Service Provider Number",
            "UP" => "Unique Physician Identification Number (UPIN)",
            "XV" => s::CodeList.external("540"),
            "XX" => s::CodeList.external("537"),
            "ZZ" => "Mutually Defined"))
        E67   = t::AN.new(:E67  , "Identification Code"                  , 2, 80)
        E81   = t:: R.new(:E81  , "Weight"                               , 1, 10)
        E93   = t::AN.new(:E93  , "Name"                                 , 1, 60)
        E96   = t::Nn.new(:E96  , "Number of Included Segments"          , 1, 10, 0)
        E97   = t::Nn.new(:E97  , "Number of Transaction Sets Included"  , 1, 6, 0)
        E98   = t::ID.new(:E98  , "Entity Identifier Code"               , 2, 3,
          s::CodeList.build(
            "03"  => "Dependent",
            "13"  => "Contracted Service Provider",
            "17"  => "Consultant's Office",
            "1E"  => "Health Maintenance Organization (HMO)",
            "1G"  => "Oncology Center",
            "1H"  => "Kidney Dialysis Unit",
            "1I"  => "Preferred Provider Organization (PPO)",
            "1O"  => "Acute Care Hospital",
            "1P"  => "Provider",
            "1Q"  => "Military Facility",
            "1R"  => "University, College or School",
            "1S"  => "Outpatient Surgicenter",
            "1T"  => "Physician, Clinic or Group Practice",
            "1U"  => "Long Term Care Facility",
            "1V"  => "Extended Care Facility",
            "1W"  => "Psychiatric Health Facility",
            "1X"  => "Laboratory",
            "1Y"  => "Retail Pharmacy",
            "1Z"  => "Home Health Care",
            "28"  => "Subcontractor",
            "2A"  => "Federal, State, County or City Facility",
            "2B"  => "Third-Party Administrator",
            "2D"  => "Miscellaneous Health Care Facility",
            "2E"  => "Non-Health Care Miscellaneous Facility",
            "2I"  => "Church Operated Facility",
            "2K"  => "Partnership",
            "2J"  => "Individial",
            "2P"  => "Public Health Service Facility",
            "2Q"  => "Veterans Aadministration Facility",
            "2S"  => "Public Health Service Indian Service Facility",
            "2T"  => "Department of Justice Facility",
            "2Y"  => "General Medical and Surgical Facility",
            "2Z"  => "Hospital Unit of an Institution (Prison Hospital, College Infirmary, etc.)",
            "30"  => "Service Supplier",
            "31"  => "Postal Mailing Address",
            "36"  => "Employer",
            "3A"  => "Hospital Unit Within an Institution for the Mentally Retarded",
            "3B"  => "Psychiatric Facility",
            "3C"  => "Tuberculosis and Other Respitory Diseases Facility",
            "3D"  => "Obstetrics and Gynecology Facility",
            "3E"  => "Ear, Eye, Nose and Throat Facility",
            "3F"  => "Rehabilitation Facility",
            "3G"  => "Orthopedic Facility",
            "3H"  => "Chronic Disease Facility",
            "3I"  => "Other Specialty Facility",
            "3J"  => "Children's General Facility",
            "3K"  => "Children's Hospital Unit of an Institution",
            "3L"  => "Children's Psychiatric Facility",
            "3M"  => "Children's Tuberculosis and Other Respitory Diseases Facility",
            "3N"  => "Children's Eye, Ear, Nose and Throat Facility",
            "3O"  => "Children's Rehabilitation Facility",
            "3P"  => "Children's Othropedic Facility",
            "3Q"  => "Children's Chronic Disease Facility",
            "3R"  => "Children's Other Specialty Facility",
            "3S"  => "Institution for Mental Retardation",
            "3T"  => "Alcoholism and Other Chemical Dependency Facility",
            "3U"  => "General Inpatient Care for AIDS/ARC Facility",
            "3V"  => "AIDS/ARC Unit",
            "3W"  => "Specialized Outpatient Program for AIDS/ARC",
            "3X"  => "Alcohol/Drug Abuse or Dependency Inpatient Unit",
            "3Y"  => "Alcohol/Drug Abuse or Dependency Outpatient Services",
            "3Z"  => "Arthritis Treatment Center",
            "40"  => "Receiver",
            "41"  => "Submitter",
            "43"  => "Claimant Authorized Representative",
            "44"  => "Data Processing Service Bureau",
            "45"  => "Drop-off Location",
            "4A"  => "Birthing Room/LDRP Room",
            "4B"  => "Burn Care Unit",
            "4C"  => "Cardiac Catherization Labratory",
            "4D"  => "Open-Heart Surgery Facility",
            "4E"  => "Cardiac Intensive Car Unit",
            "4F"  => "Angioplasty Facility",
            "4G"  => "Chronic Obstructive Pulmonary Disease Service Facility",
            "4H"  => "Emergency Department",
            "4I"  => "Trauma Center (Certified)",
            "4J"  => "Extracorporeal Shock-Wave Lithotripter (ESWL) Unit",
            "4K"  => "Fitness Center",
            "4L"  => "Genetic Counseling/Screening Services",
            "4M"  => "Adult Day Care Program Facility",
            "4N"  => "Alzheimer's Diagnostic/assessment Service",
            "4O"  => "Comprehensive Geriatric Assessment Facility",
            "4P"  => "Emergency Response (Geriatric) Unit",
            "4Q"  => "Geriatric Acute Care Unit",
            "4R"  => "Geriatric Clinics",
            "4S"  => "Respite Care Facility",
            "4U"  => "Patient Education Unit",
            "4V"  => "Community Health Promotion Facility",
            "4W"  => "Worksite Health Promotion Facility",
            "4X"  => "Hemodialysis Facility",
            "4Y"  => "Home Health Services",
            "4Z"  => "Hospice",
            # yes, the lack of commas are in the document
            # yes, this makes me very sad
            "5A"  => "Medical Surgical or Other Intensive Care Unit",
            "5B"  => "Hisopathology Laboratory",
            "5C"  => "Blood Bank",
            "5D"  => "Neonatal Intensive Care Unit",
            "5E"  => "Obstetrics Unit",
            "5F"  => "Occupational Health Services",
            "5G"  => "Organized Outpatient Services",
            "5H"  => "Pediatric Acute Inpatient Unit",
            "5I"  => "Psychiatric Child/Adolescent Services",
            "5J"  => "Psychiatric Consultation-Liaison Services",
            "5K"  => "Psychiatric Education Services",
            "5L"  => "Psychiatric Emergency Services",
            "5M"  => "Psychiatric Geriatric Services",
            "5N"  => "Psychiatric Inpatient Unit",
            "5O"  => "Psychiatric Outpatient Services",
            "5P"  => "Psychiatric Partial Hospitalization Program",
            "5Q"  => "Megavoltage Radiation Therapy Unit",
            "5R"  => "Radioactive Implants Unit",
            "5S"  => "Therapeutic Radioisotope Facility",
            "5T"  => "X-Ray Radiation Therapy Unit",
            "5U"  => "CT Scanner Unit",
            "5V"  => "Diagnostic Radioisotope Facility",
            "5W"  => "Magnetic Resonance Imaging (MRI) Facility",
            "5X"  => "Ultrasound Unit",
            "5Y"  => "Rehabilitation Inpatient Unit",
            "5Z"  => "Rehabilitation Outpatient Services",
            "61"  => "Performed At",
            "62"  => "Applicant's Employer",
            "6A"  => "Reproductive Health Services",
            "6B"  => "Skilled Nursing or Other Long-Term Care Unit",
            "6C"  => "Single Photon Emission Computerized Tomography (SPECT) Unit",
            "6D"  => "Organized Social Work Service Facility",
            "6E"  => "Outpatient Social Work Services",
            "6F"  => "Emergency Department Social Work Services",
            "6G"  => "Sports Medicine Clinic/Services",
            "6H"  => "Hospital Auxiliary Unit",
            "6I"  => "Patient Representative Services",
            "6J"  => "Volunteer Services Department",
            "6K"  => "Putpatient Surgery Services",
            "6L"  => "Organ/Tissue Transplant Unit",
            "6M"  => "Orthopedic Surgery Facility",
            "6N"  => "Occupational Therapy Services",
            "6O"  => "Physical Therapy Services",
            "6P"  => "Recreational Therapy Services",
            "6Q"  => "Respiratory Therapy Services",
            "6R"  => "Speech Therapy Services",
            "6S"  => "Women's Health Center/Services",
            "6U"  => "Cardiac Rehabilitation Program Facility",
            "6V"  => "non-Invasive Cardiac Assessment Services",
            "6W"  => "Emergency Medical Technician",
            "6X"  => "Disciplinary Contact",
            "6Y"  => "Case Manager",
            "70"  => "Prior Incorrect Insured",
            "71"  => "Attending Physician",
            "72"  => "Operating Physician",
            "73"  => "Other Physician",
            "74"  => "Corrected Insured",
            "75"  => "Participant",
            "77"  => "Service Location",
            "7C"  => "Place of Occurence",
            "7O"  => "Federally Chartered Facility",
            "80"  => "Hospital",
            "82"  => "Rendering Provider",
            "84"  => "Subscriber's Employer",
            "85"  => "Billing Provider",
            "87"  => "Pay-to Provider",
            "8B"  => "Primary Residence",
            "95"  => "Research Institute",
            "98"  => "Receiver",
            "9K"  => "Key Person",
            "AG"  => "Agent/Agency",
            "AY"  => "Clearinghouse",
            "BO"  => "Broker or Sales Office",
            "CK"  => "Pharmacist",
            "CZ"  => "Admitting Surgeon",
            "D0"  => "Admitting Physician",
            "D2"  => "Commerical Insurer",
            "DD"  => "Assistant Surgeon",
            "DJ"  => "Consulting Physician",
            "DK"  => "Ordering Physician",
            "DN"  => "Referring Provider",
            "DQ"  => "Supervising Physician",
            "DO"  => "Dependent Name",
            # RESTART HERE
            "E1"  => "Person or Other Entity Legally Responsible for a Child",
            "E2"  => "Person or Other Entity With Whom a Child Resides",
            "E7"  => "Previous Employer",
            "E9"  => "Participating Laboratory",
            "EI"  => "Executor of Estate",
            "EXS" => "Ex-spouse",
            "EY"  => "@todo",
            "FA"  => "Facility",
            "FD"  => "Physical Address",
            "FE"  => "Mail Address",
            "FS"  => "Final Scheduled Destination",
            "G0"  => "Dependent Insured",
            "G3"  => "Clinic",
            "GB"  => "Other Insured",
            "GD"  => "Guardian",
            "GI"  => "Paramedic",
            "GJ"  => "Paramedical Company",
            "GK"  => "Previous Insured",
            "GM"  => "Spouse Insured",
            "GP"  => "Gateway Provider",
            "GW"  => "Group",
            "GY"  => "Treatment Facility",
            "HF"  => "Healthcare Professional Shortage Area (HPSA) Facility",
            "HH"  => "Home Health Agency",
            "HK"  => "Subscriber",
            "I3"  => "Independent Physicians Association (IPA)",
            "IJ"  => "Injection Point",
            "IL"  => "Insured or Subscriber",
            "IN"  => "Insurer",
            "J6"  => "Power of Attorney",
            "L5"  => "Contact",
            "LI"  => "Independent Lab",
            "LR"  => "Legal Representative",
            "M5"  => "Migrant Health Clinic",
            "M8"  => "Educational Institution",
            "MR"  => "Medical INsurance Carrier",
            "MSC" => "Mammography Screening Center",
            "ND"  => "Next Destination",
            "O4"  => "Factor",
            "OB"  => "Ordered By",
            "OC"  => "Origin Carrier",
            "OD"  => "Doctor of Optometry",
            "OOP" => "Other Operating Physician",
            "OX"  => "Oxygen Therapy Facility",
            "P0"  => "Patient Facility",
            "P2"  => "Primary Insured or Subscriber",
            "P3"  => "Primary Care Provider",
            "P4"  => "Prior Insurance Carrier",
            "P5"  => "Plan Sponsor",
            "P6"  => "Third Party Reviewing Preferred Provider Organization (PPO)",
            "P7"  => "Third Party Reviewing Preferred Provider Organization (PPO)",
            "PE"  => "Payee",
            "PT"  => "Party to Receive Test Report",
            "PTP" => "Pay-to Plan Name",
            "PR"  => "Payer",
            "PRP" => "Primary Payer",
            "PV"  => "Party performing certification",
            "PW"  => "Pickup Address",
            "QA"  => "Pharmacy",
            "QB"  => "Purchase Service Provider",
            "QC"  => "Patient",
            "QD"  => "Responsible Party",
            "QE"  => "Policyholder",
            "QH"  => "Physician",
            "QK"  => "Managed Care",
            "QL"  => "Chiropractor",
            "QN"  => "Dentist",
            "QM"  => "Dialysis Centers",
            "QO"  => "Doctor of Osteopathy",
            "QS"  => "Podiatrist",
            "QV"  => "Group Practice",
            "QY"  => "Medical Doctor",
            "R3"  => "Next Scheduled Destination",
            "RC"  => "Receiving Location",
            "S1"  => "Parent",
            "S3"  => "Custodial Parent",
            "SEP" => "Secondary Payer",
            "SJ"  => "Service Provider",
            "SU"  => "Supplier/Manufacturer",
            # Used to identify the geographic location where a patient is transferred or diverted
            "T4"  => "Transfer Point",
            "TL"  => "Testing Laboratory",
            "TP"  => "Primary Taxpayer",
            "TQ"  => "Third Party Reviewing Organization (TPO)",
            "TT"  => "Transfer To",
            "TTP" => "Tertiary Payer",
            "TU"  => "Third Party Repricing Organization (TPO)",
            "TV"  => "Third Party Administrator (TPA)",
            "TZ"  => "Significant Other",
            "RM"  => "@todo",
            "RW"  => "Rural Health Clinic",
            "S4"  => "Skilled Nursing Facility",
            "UH"  => "Nursing Home",
            "VER" => "Party Performing Verification",
            "VN"  => "Vendor",
            "VY"  => "Organization Completing Configuration Change",
            "X3"  => "Utilitazion Management Origanization",
            "X4"  => "Spouse",
            "X5"  => "Durable Medical Equipment Supplier",
            "Y2"  => "Managed Care Organization",
            "ZD"  => "Party to Receive Reports",
            "ZZ"  => "Mutually Defined"))
        E100  = t::ID.new(:E100 , "Currency Code"                        , 3, 3,
          s::CodeList.external("5"))
        E107  = t::ID.new(:E107 , "Payment Method Type Code"             , 1, 2)
        E116  = t::ID.new(:E116 , "Postal Code"                          , 3, 15,
          s::CodeList.external("51"))
        E118  = t:: R.new(:E118 , "Rate"                                 , 1, 9)
        E123  = t::Nn.new(:E123 , "Number of Received Transaction Sets"  , 1, 6, 0)
        E124  = t::AN.new(:E124 , "Application Receiver's Code"          , 2, 15)
        E127  = t::AN.new(:E127 , "Reference Identification"             , 1, 50)
        E128  = t::ID.new(:E128 , "Reference Identification Qualifier"   , 2, 3,
          s::CodeList.build(
            "00"  => "Contracting District Number",
            "01"  => "American Bankers Assoc. (ABA) Transit/Routing Number (Including Check Digit, 9 Digits)",
            "04"  => s::CodeList.external("91"),
            "0B"  => "State License Number",
            "0F"  => "Subscriber Number",
            "0N"  => "@todo",
            "0K"  => "Policy Form Identifying Number",
            "14"  => "@todo",
            "17"  => "Client Reporting Category",
            "18"  => "Plan Number",
            "19"  => "Division Identifier",
            "1A"  => "Blue Cross Provider Number",
            "1B"  => "Blue Shield Provider Number",
            "1C"  => "Medicare Provider Number",
            "1D"  => "Medicaid Provider Number",
            "1G"  => "Provider UPIN Number",
            "1H"  => "CHAMPUS Identification Number",
            "1J"  => "Facility ID Number",
            "1K"  => "Payor's Claim Number",
            "1L"  => "Group or Policy Number",
            "1S"  => "Ambulatory Patient Group (APG) Number",
            "1W"  => "Member Identification Number",
            "23"  => "Client Number",
            "26"  => "Union Number",
            "28"  => "Employee Identification Number",
            "2F"  => "@todo",
            "2U"  => "Payer Identification Number",
            "38"  => "Master Policy Number",
            "3H"  => "Case Number",
            "3L"  => "Branch Identifier",
            "4A"  => "Personal Identification Number (PIN)",
            "4N"  => "Special Payment Reference Number",
            "49"  => "Family Unit Number",
            "60"  => "Account Suffix Code",
            "6M"  => "Application Number",
            "6O"  => "Cross Reference Number",
            "6P"  => "Group Number",
            "6R"  => "Provider Control Number",
            "82"  => "Data Item Description (DID) Reference",
            "9A"  => "Repriced Claim Reference Number",
            "9B"  => "Repriced Line Item Reference Number",
            "9C"  => "Adjusted Repriced Claim Reference Number",
            "9D"  => "Adjusted Repriced Line Item Reference Number",
            "9F"  => "Referral Number",
            "9K"  => "Servicer",
            "9V"  => "Payment Category",
            "9X"  => "Account Category",
            "A6"  => "Provider Identifier",
            "ABB" => "Personal ID Number",
            "ABY" => s::CodeList.external("540"),
            "ACY" => s::CodeList.external("672"),
            "ALS" => "Alternative List ID",
            "AP"  => "Ambulatory Payment Classification",
            "APC" => s::CodeList.external("468"),
            "AZ"  => "Health Insurance Policy Number",
            "BAF" => "Receipt Number",
            "BB"  => "Authorization Number",
            "BLT" => "Billing Type",
            "BT"  => "Batch Number",
            "CE"  => "Class of Contract Code",
            "CLI" => "Coverage List ID",
            "CT"  => "Contract Number",
            "CPT" => s::CodeList.external("133"),
            "D3"  => s::CodeList.external("307"),
            "D9"  => "Claim Number",
            "DNS" => s::CodeList.external("16"),
            "DP"  => "Department Number",
            "DU"  => "Dependents Information",
            "DUN" => s::CodeList.external("16"),
            "DX"  => "Department/Agency Number",
            "E8"  => "Service Contract (Coverage) Number",
            "E9"  => "Attachment Code",
            "EA"  => "Medical Record Identification Number",
            "EL"  => "Electronic Device PIN Number",
            "EI"  => "Employer's Identification Number",
            "EJ"  => "Patient Account Number",
            "EO"  => "Submitter Identification Number",
            "EV"  => "Receiver Identification Number",
            "EW"  => "Mammography Certification Number",
            "F2"  => "Version Code - Local",
            "F4"  => "Facility Certification Number",
            "F5"  => "Medicare Version Code",
            "F6"  => "Health Insurance Claim (HIC) Number",
            "F8"  => "Original Reference Number",
            "FJ"  => "Line Item Control Number",
            "FO"  => "Drug Formulary Number",
            "FY"  => "Claim Office Number",
            "G1"  => "Prior Authorization Number",
            "G2"  => "Provider Commercial Number",
            "G3"  => "Predetermination of Benefits Identification Number",
            "G5"  => "Provider Site Number",
            "GH"  => "Identification Card Serial Number",
            "G4"  => "Peer Review Organization (PRO) Approval Number",
            "GE"  => "Geographic Number",
            "HI"  => s::CodeList.external("121"),
            "HJ"  => "Identity Card Number",
            "HPI" => s::CodeList.external("537"),
            "ICD" => s::CodeList.external("131"),
            "IF"  => "Issue Number",
            "IG"  => "Insurance Policy Number",
            "IJ"  => "Standard Industry Classification (SIC) Code",
            "JD"  => "User Identification",
            "LOI" => s::CodeList.external("663"),
            "LU"  => "Location Number",
            "LX"  => "Qualified Products List",
            "M7"  => "Medical Assistance Category",
            "MRC" => s::CodeList.external("844"),
            "MRN" => "Mother's Medical Record Identification Number",
            "N5"  => "Provider Plan Network Identification Number",
            "N6"  => "Plan Network Identification Number",
            "N7"  => "Facitily Network Identification Number",
            "NF"  => s::CodeList.external("245"),
            "NQ"  => "Medicaid Recipient Identification Number",
            "NT"  => "Administrator's Reference Number",
            "P4"  => "Project Code",
            "P5"  => "Position Code",
            "PID" => "Program Identification Number",
            "POL" => "Policy Number",
            "PQ"  => "Payee Indentification",
            "PSM" => "Credit Card Number",
            "PXC" => s::CodeList.external("682"),
            "Q4"  => "Prior Identifier Number",
            "QQ"  => "Unit Number",
            "RB"  => "Rate code number",
            "SOJ" => s::CodeList.external("22"),
            "SY"  => "Social Security Number",
            "T4"  => "Signal Code",
            "TJ"  => "Federal Taxpayer's Identification Number",
            "TV"  => s::CodeList.external("224"),
            "VV"  => "Voucher",
            "VY"  => "Link Sequence Number",
            "Y4"  => "Agency Claim Number",
            "WH"  => "Master Reference (Link) Number",
            "X4"  => "Clinical Laboratory Improvement Amendment Number",
            "X9"  => "Internal Control Number",
            "XM"  => "Issuer Number",
            "XX1" => "Special Program Code",
            "XX2" => "Service Area Code",
            "XZ"  => "Pharmacy Prescription Number",
            "YY"  => "Geographic Key",
            "ZH"  => "Carrier Assigned Reference Number",
            "ZX"  => "County Code",
            "ZZ"  => "Mutually Defined"))
        E142  = t::AN.new(:E142 , "Application's Sender Code"            , 2, 15)
        E143  = t::ID.new(:E143 , "Transaction Set Identifier Number"    , 3, 3,
          # http://www.x12.org/x12org/docs/editransactions.pdf
          s::CodeList.build(
            # X12C Communications & Controls
            "102" => "Associated Data",
            "242" => "Data Status Tracking",
            "815" => "Cryptographic Service Message",
            "864" => "Text Message",
            "868" => "Electronic Form Structure",
            "993" => "Secured Receipt or Acknowledgment",
            "997" => "Functional Acknowledgment",
            "999" => "Implementation Acknowledgment",

            # X12F Finance
            "130" => "Student Educational Record (Transcript)",
            "131" => "Student Educational Record (Transcript) Acknowledgment",
            "132" => "Human Resource Information",
            "133" => "Educational Institution Record",
            "135" => "Student Aid Origination Record",
            "138" => "Education Testing and Prospect Request and Report",
            "139" => "Student Loan Guarantee Result",
            "144" => "Student Loan Transfer and Status Verification",
            "146" => "Request for Student Educational Record (Transcript)",
            "147" => "Response to Request for Student Educational Record (Transcript)",
            "155" => "Business Credit Report",
            "188" => "Educational Course Inventory",
            "189" => "Application for Admission to Educational Institutions",
            "190" => "Student Enrollment Verification",
            "191" => "Student Loan Pre-Claims and Claims",
            "197" => "Real Estate Title Evidence",
            "198" => "Loan Verification Information",
            "199" => "Real Estate Settlement Information",
            "200" => "Mortgage Credit Report",
            "201" => "Residential Loan Application",
            "202" => "Secondary Mortgage Market Loan Delivery",
            "203" => "Secondary Mortgage Market Investor Report",
            "205" => "Mortgage Note",
            "206" => "Real Estate Inspection",
            "245" => "Real Estate Tax Service Response",
            "248" => "Account Assignment/Inquiry & Service/Status",
            "259" => "Residential Mortgage Insurance Explanation of Benefits",
            "260" => "Application for Mortgage Insurance Benefits",
            "261" => "Real Estate Information Request",
            "262" => "Real Estate Information Report",
            "263" => "Residential Mortgage Insurance Application Response",
            "264" => "Mortgage Loan Default Status",
            "265" => "Real Estate Title Insurance Services Order",
            "266" => "Mortgage or Property Record Change Notification",
            "810" => "Invoice",
            "811" => "Consolidated Service Invoice/Statement",
            "812" => "Credit/Debit Adjustment",
            "814" => "General Request, Response or Confirmation",
            "819" => "Joint Interest Billing and Operating Expense Statement",
            "820" => "Payment Order/Remittance Advice",
            "821" => "Financial Information Reporting",
            "822" => "Account Analysis",
            "823" => "Lockbox",
            "824" => "Application Advice",
            "827" => "Financial Return Notice",
            "828" => "Debit Authorization",
            "829" => "Payment Cancellation Request",
            "831" => "Application Control Totals",
            "833" => "Mortgage Credit Report Order",
            "844" => "Product Transfer Account Adjustment",
            "849" => "Response to Product Transfer Account Adjustment",
            "872" => "Residential Mortgage Insurance Application",
            "880" => "Grocery Products Invoice",

            # X12G Government
            "103" => "Abandoned Property Filings",
            "105" => "Business Entity Filings",
            "113" => "Election Campaign & Lobbyist Reporting",
            "149" => "Notice of Tax Adjustment or Assessment",
            "150" => "Tax Rate Notification",
            "151" => "Electronic Filing of Tax Return Data Acknowledgment",
            "152" => "Statistical Government Information",
            "153" => "Unemployment Insurance Tax Claim or Charge Information",
            "154" => "Secured Interest Filing",
            "157" => "Notice of Power of Attorney",
            "158" => "Tax Jurisdiction Sourcing",
            "175" => "Court and Law Enforcement Notice",
            "176" => "Court Submission",
            "179" => "Environmental Compliance Reporting",
            "185" => "Royalty Regulatory Report",
            "194" => "Grant or Assistance Application",
            "195" => "Federal Communications Commission (FCC) License Application",
            "196" => "Contractor Cost Data Reporting",
            "249" => "Animal Toxicological Data",
            "251" => "Pricing Support",
            "280" => "Voter Registration Information",
            "283" => "Tax or Fee Exemption Certification",
            "284" => "Commercial Vehicle Safety Reports",
            "285" => "Commercial Vehicle Safety and Credentials Information Exchange",
            "286" => "Commercial Vehicle Credentials",
            "288" => "Wage Determination",
            "500" => "Medical Event Reporting",
            "501" => "Vendor Performance Review",
            "511" => "Requisition",
            "517" => "Material Obligation Validation",
            "521" => "Income or Asset Offset",
            "527" => "Material Due-In and Receipt",
            "536" => "Logistics Reassignment",
            "540" => "Notice of Employment Status",
            "561" => "Contract Abstract",
            "567" => "Contract Completion Status",
            "568" => "Contract Payment Management Report",
            "650" => "Maintenance Service Order",
            "805" => "Contract Pricing Proposal",
            "806" => "Project Schedule Reporting",
            "813" => "Electronic Filing of Tax Return Data",
            "826" => "Tax Information Exchange",
            "836" => "Procurement Notices",
            "838" => "Trading Partner Profile",
            "839" => "Project Cost Reporting",
            "996" => "File Transfer",

            # X12I Transportation
            "104" => "Air Shipment Information",
            "106" => "Motor Carrier Rate Proposal",
            "107" => "Request for Motor Carrier Rate Proposal",
            "108" => "Response to a Motor Carrier Rate Proposal",
            "109" => "Vessel Content Details",
            "110" => "Air Freight Details and Invoice",
            "120" => "Vehicle Shipping Order",
            "121" => "Vehicle Service",
            "125" => "Multilevel Railcar Load Details",
            "126" => "Vehicle Application Advice",
            "127" => "Vehicle Baying Order",
            "128" => "Dealer Information",
            "129" => "Vehicle Carrier Rate Update",
            "160" => "Transportation Automatic Equipment Identification",
            "161" => "Train Sheet",
            "163" => "Transportation Appointment Schedule Information",
            "204" => "Motor Carrier Load Tender",
            "210" => "Motor Carrier Freight Details and Invoice",
            "211" => "Motor Carrier Bill of Lading",
            "212" => "Motor Carrier Delivery Trailer Manifest",
            "213" => "Motor Carrier Shipment Status Inquiry",
            "214" => "Transportation Carrier Ship. Status Message",
            "215" => "Motor Carrier Pick-up Manifest",
            "216" => "Motor Carrier Shipment Pick-up Notification",
            "217" => "Motor Carrier Loading and Route Guide",
            "219" => "Logistics Service Request",
            "220" => "Logistics Service Response",
            "222" => "Cartage Work Assignment",
            "223" => "Consolidators Freight Bill and Invoice",
            "224" => "Motor Carrier Summary Freight Bill Manifest",
            "225" => "Response to a Cartage Work Assignment",
            "227" => "Trailer Usage Report",
            "228" => "Equipment Inspection Report",
            "240" => "Motor Carrier Package Status",
            "250" => "Purchase Order Shipment Management Document",
            "300" => "Reservation (Booking Request) (Ocean)",
            "301" => "Confirmation (Ocean)",
            "303" => "Booking Cancellation (Ocean)",
            "304" => "Shipping Instructions",
            "309" => "Customs Manifest",
            "310" => "Freight Receipt and Invoice (Ocean)",
            "311" => "Canada Customs Information",
            "312" => "Arrival Notice (Ocean)",
            "313" => "Shipment Status Inquiry (Ocean)",
            "315" => "Status Details (Ocean)",
            "317" => "Delivery/Pickup Order",
            "319" => "Terminal Information",
            "322" => "Terminal Operations and Intermodal Ramp Activity",
            "323" => "Vessel Schedule and Itinerary (Ocean)",
            "324" => "Vessel Stow Plan (Ocean)",
            "325" => "Consolidation of Goods in Container",
            "326" => "Consignment Summary List",
            "350" => "Customs Status Information",
            "352" => "U.S. Customs Carrier General Order Status",
            "353" => "Customs Events Advisory Details",
            "354" => "U.S. Customs Auto. Manifest Archive Status",
            "355" => "U.S. Customs Acceptance/Rejection",
            "356" => "U.S. Customs Permit to Transfer Request",
            "357" => "U.S. Customs In-Bond Information",
            "358" => "Customs Consist Information",
            "359" => "Customs Customer Profile Management",
            "361" => "Carrier Interchange Agreement (Ocean)",
            "404" => "Rail Carrier Shipment Information",
            "410" => "Rail Carrier Freight Details and Invoice",
            "412" => "Trailer or Container Repair Billing",
            "414" => "Rail Carhire Settlements",
            "417" => "Rail Carrier Waybill Interchange",
            "418" => "Rail Advance Interchange Consist",
            "419" => "Advance Car Disposition",
            "420" => "Car Handling Information",
            "421" => "Estimated Time of Arrival & Car Scheduling",
            "422" => "Equipment Order",
            "423" => "Rail Industrial Switch List",
            "424" => "Rail Carrier Services Settlement",
            "425" => "Rail Waybill Request",
            "426" => "Rail Revenue Waybill",
            "429" => "Railroad Retirement Activity",
            "431" => "Railroad Station Master File",
            "432" => "Rail Deprescription",
            "433" => "Railroad Reciprocal Switch File",
            "434" => "Railroad Mark Register Update Activity",
            "435" => "Standard Transportation Commodity Code Master",
            "436" => "Locomotive Information",
            "437" => "Railroad Junctions & Interchanges Activity",
            "440" => "Shipment Weights",
            "451" => "Railroad Event Report",
            "452" => "Railroad Problem Log Inquiry or Advice",
            "453" => "Railroad Service Commitment Advice",
            "455" => "Railroad Parameter Trace Registration",
            "456" => "Railroad Equipment Inquiry or Advice",
            "460" => "Railroad Price Distribution Request or Response",
            "463" => "Rail Rate Reply",
            "466" => "Rate Request",
            "468" => "Rate Docket Journal Log",
            "470" => "Railroad Clearance",
            "475" => "Rail Route File Maintenance",
            "485" => "Ratemaking Action",
            "486" => "Rate Docket Expiration",
            "490" => "Rate Group Definition",
            "492" => "Miscellaneous Rates",
            "494" => "Rail Scale Rates",
            "601" => "U.S. Customs Export Shipment Information",
            "603" => "Transportation Equipment Registration",
            "715" => "Intermodal Group Loading Plan",
            "854" => "Shipment Delivery Discrepancy Info.",
            "858" => "Shipment Information",
            "859" => "Freight Invoice",
            "920" => "Loss or Damage Claim - Gen.  Commodities",
            "924" => "Loss or Damage Claim - Motor Vehicle",
            "925" => "Claim Tracer",
            "926" => "Claim Status Report and Tracer Reply",
            "928" => "Automotive Inspection Detail",
            "980" => "Functional Group Totals",
            "990" => "Response to a Load Tender",
            "998" => "Set Cancellation",

            # X12M Supply Chain
            "101" => "Name and Address Lists",
            "140" => "Product Registration",
            "141" => "Product Service Claim Response",
            "142" => "Product Service Claim",
            "143" => "Product Service Notification",
            "159" => "Motion Picture Booking Confirmation",
            "170" => "Revenue Receipts Statement",
            "180" => "Return Merchandise Authorization & Notification",
            "244" => "Product Source Information",
            "290" => "Cooperative Advertising Agreements",
            "503" => "Pricing History",
            "504" => "Clauses and Provisions",
            "620" => "Excavation Communication",
            "625" => "Well Information",
            "753" => "Request For Routing Instructions",
            "754" => "Routing Instructions",
            "816" => "Organizational Relationships",
            "818" => "Commission Sales Report",
            "830" => "Planning Schedule w/ Release Capability",
            "832" => "Price/Sales Catalog",
            "840" => "Request for Quotation",
            "841" => "Specifications/Technical Information",
            "842" => "Nonconformance Report",
            "843" => "Response to Request for Quotation",
            "845" => "Price Authorization Acknowledgment/Status",
            "846" => "Inventory Inquiry/Advice",
            "847" => "Material Claim",
            "848" => "Material Safety Data Sheet",
            "850" => "Purchase Order",
            "851" => "Asset Schedule",
            "852" => "Product Activity Data",
            "853" => "Routing and Carrier Instruction",
            "855" => "Purchase Order Acknowledgment",
            "856" => "Ship Notice/Manifest",
            "857" => "Shipment and Billing Notice",
            "860" => "Purchase Order Change Request - Buyer Initiated",
            "861" => "Receiving Advice/Acceptance Certificate",
            "862" => "Shipping Schedule",
            "863" => "Report of Test Results",
            "865" => "Purchase Order Change Acknowledgment /Request - Seller Initiated",
            "866" => "Production Sequence",
            "867" => "Product Transfer and Resale Report",
            "869" => "Order Status Inquiry",
            "870" => "Order Status Report",
            "873" => "Commodity Movement Services",
            "874" => "Commodity Movement Services Response",
            "875" => "Grocery Products Purchase Order",
            "876" => "Grocery Products Purchase Order Change",
            "877" => "Manufacturer Coupon Family Code Structure",
            "878" => "Product Authorization/De-authorization",
            "879" => "Price Information",
            "881" => "Manufacturer Coupon Redemption Detail",
            "882" => "Direct Store Delivery Summary Information",
            "883" => "Market Development Fund Allocation",
            "884" => "Market Development Fund Settlement",
            "885" => "Retail Account Characteristics",
            "886" => "Customer Call Reporting",
            "887" => "Coupon Notification",
            "888" => "Item Maintenance",
            "889" => "Promotion Announcement",
            "890" => "Contract & Rebate Management",
            "891" => "Deduction Research Report",
            "893" => "Item Information Request",
            "894" => "Delivery/Return Base Record",
            "895" => "Delivery/Return Acknowledgment or Adjustment",
            "896" => "Product Dimension Maintenance",
            "940" => "Warehouse Shipping Order",
            "943" => "Warehouse Stock Transfer Shipment Advice",
            "944" => "Warehouse Stock Transfer Receipt Advice",
            "945" => "Warehouse Shipping Advice",
            "947" => "Warehouse Inventory Adjustment Advice",

            # X12N Insurance
            "100" => "Insurance Plan Description",
            "111" => "Individual Insurance Policy & Client Info.",
            "112" => "Property Damage Report",
            "124" => "Vehicle Damage",
            "148" => "Report of Injury, Illness, or Incident",
            "186" => "Insurance Underwriting Requirements Reporting",
            "187" => "Premium Audit Request and Return",
            "252" => "Insurance Producer Administration",
            "255" => "Underwriting Information Services",
            "256" => "Periodic Compensation",
            "267" => "Individual Life Annuity & Disability Application",
            "268" => "Annuity Activity",
            "269" => "Health Care Benefit Coordination Verification",
            "270" => "Eligibility, Coverage or Benefit Inquiry",
            "271" => "Eligibility, Coverage or Benefit Information",
            "272" => "Property and Casualty Loss Notification",
            "273" => "Insurance/Annuity Application Status",
            "274" => "Health Care Provider Information",
            "275" => "Patient Information",
            "276" => "Health Care Claim Status Request",
            "277" => "Health Care Information Status Notification",
            "278" => "Health Care Services Review Information",
            "362" => "Cargo Insurance Advice of Shipment",
            "834" => "Benefit Enrollment and Maintenance",
            "835" => "Health Care Claim Payment/Advice",
            "837" => "Health Care Claim"))
        E156  = t::ID.new(:E156 , "State or Province Code"               , 2, 2,
          s::CodeList.external("22"))
        E166  = t::AN.new(:E166 , "Address Information"                  , 1, 55)
        E212  = t:: R.new(:E212 , "Unit Price"                           , 1, 17)
        E234  = t::AN.new(:E234 , "Product/Service ID"                   , 1, 48)
        E235  = t::ID.new(:E235 , "Product/Service ID Qualifier"         , 2, 2,
          s::CodeList.build(
            "AD" => s::CodeList.external("135"),
            "A5" => s::CodeList.external("22"),
            "CH" => s::CodeList.external("5"),
            "CJ" => s::CodeList.external("135"),
            "DC" => s::CodeList.external("897"),
            "DX" => s::CodeList.external("131"),
            "EN" => "EAN/UCC - 13",
            "EO" => "EAN/UCC - 8",
            "ER" => s::CodeList.external("576"),
            "HC" => s::CodeList.external("130"),
            "HP" => s::CodeList.external("716"),
            "ID" => s::CodeList.external("131"),
            "IP" => s::CodeList.external("896"),
            "IV" => s::CodeList.external("513"),
            "HI" => "HIBC (Health Care Industry Bar Code) Supplier Labeling Standard Primary Data Message",
            "LB" => s::CodeList.external("663"),
            "N1" => s::CodeList.external("240"),
            "N2" => s::CodeList.external("240"),
            "N3" => s::CodeList.external("240"),
            "N4" => s::CodeList.external("240"),
            "N5" => s::CodeList.external("240"),
            "N6" => s::CodeList.external("240"),
            "NU" => s::CodeList.external("132"),
            "ON" => "Customer Order Number",
            "TD" => s::CodeList.external("359"),
            "UI" => "U.P.C. Consumer Package (1-5-5)",
            "UK" => "GTIN 14-digit Data Structure",
            "UP" => "UCC - 12",
            "RB" => s::CodeList.external("132"),
            "WK" => s::CodeList.external("843"),
            "ZZ" => "Mutually Defined"))
        E236  = t::ID.new(:E236 , "Price Identifier Code"                , 3, 3)
        E280  = t:: R.new(:E280 , "Exchange Rate"                        , 4, 10)
        E289  = t::Nn.new(:E289 , "Multiple Price Quantity"              , 1, 2, 0)
        E305  = t::ID.new(:E305 , "Transaction Handling Code"            , 1, 2,
          s::CodeList.build(
            "C" => "Payment Accompanies Remittance Advice",
            "D" => "Make Payment Only",
            "H" => "Notification Only",
            "I" => "Remittance Information Only",
            "P" => "Prenotification of Future Transfers",
            "U" => "Split Payment and Remittance",
            "X" => "Handling Party's Option to Split Payment and Remittance"))
        E306  = t::ID.new(:E306 , "Action Code"                          , 1, 2,
          s::CodeList.build(
            "1"  => "Add",
            "2"  => "Change (Update)",
            "4"  => "Verify",
            "51" => "Complete",
            "71" => "Term Expired",
            "A1" => "Certified in Total",
            "A2" => "Certified - Partial",
            "A3" => "Not Certified",
            "A4" => "Pended",
            "A6" => "Modified",
            "C"  => "Cancelled",
            "CT" => "Contact Payer",
            "NA" => "No Action Required",
            "RX" => "Replace",
            "U"  => "Reject",
            "WQ" => "Accept"))
        E309  = t::ID.new(:E309 , "Location Qualifier"                   , 1, 2,
          s::CodeList.build(
            "60" => "Area",
            "CY" => "County/Parish",
            "PQ" => s::CodeList.external("51"),
            "PR" => s::CodeList.external("51"),
            "PS" => s::CodeList.external("51"),
            "RJ" => s::CodeList.external("DOD1")))
        E310  = t::ID.new(:E310 , "Location Identifier"                  , 1, 30)
        E329  = t::AN.new(:E329 , "Transaction Set Control Number"       , 4, 9)
        E332  = t:: R.new(:E332 , "Percent, Decimal Format"              , 1, 6)
        E337  = t::TM.new(:E337 , "Time"                                 , 4, 8)
        E338  = t:: R.new(:E338 , "Terms Discount Percent"               , 1, 6)
        E350  = t::AN.new(:E350 , "Assigned Identification"              , 1, 20)
        E352  = t::AN.new(:E352 , "Description"                          , 1, 80)
        E353  = t::ID.new(:E353 , "Transaction Set Purpose Code"         , 2, 2,
          s::CodeList.build(
            "00" => "Original",
            "01" => "Cancellation",
            "06" => "Confirmation",
            "08" => "Status",
            "15" => "Re-Submission",
            "11" => "Response",
            "13" => "Request",
            "18" => "Reissue",
            "22" => "Information Copy",
            "49" => "Original - No Response Necessary",
            "52" => "Response to Historical Inquiry"))
        E355  = t::ID.new(:E355 , "Unit or Basis for Measurement Code"   , 2, 2,
          s::CodeList.build(
            "01" => "Actual Pounds",
            "DA" => "Days",
            "DH" => "Miles",
            "DK" => "Kilometers",
            "F2" => "International Unit",
            "GR" => "Gram",
            "LB" => "Pound",
            "ME" => "Milligram",
            "MJ" => "Minutes",
            "ML" => "Milliliter",
            "MO" => "Months",
            "UN" => "Units",
            "WK" => "Week",
            "VS" => "Visit",
            "YR" => "Years"))
        E363  = t::ID.new(:E363 , "Note Reference Code"                  , 3, 3,
          s::CodeList.build(
            "ADD" => "Additional Information",
            "ALG" => "Allergies",
            "CER" => "Certification Narrative",
            "DCP" => "Goals, Rehabilitation Potential, or Discharge Plans",
            "DGN" => "Diagnosis Description",
            "DME" => "Durable Medical Equipment (DME) and Supplies",
            "MED" => "Medications",
            "NTR" => "Nutritional Requirements",
            "ODT" => "Orders for Disciplines and Treatments",
            "RHB" => "Functional Limitations, Reason Homebound, or Both",
            "RLH" => "Reasons Patient Leaves Home",
            "RNH" => "Times and Reasons Patient Not at Home",
            "SET" => "Unusual Home, Social Environment, or Both",
            "SFM" => "Safety Measures",
            "SPT" => "Supplementary Plan of Treatment",
            "TPO" => "Third Party Organization Notes",
            "UPI" => "Updated Information"))
        E364  = t::AN.new(:E364 , "Communication Number"                 , 1, 256)
        E365  = t::ID.new(:E365 , "Communication Number Qualifier"       , 2, 2,
          s::CodeList.build(
            "AP" => "Alternate Telephone",
            "BN" => "Beeper Number",
            "CP" => "Cellular Phone",
            "ED" => "Electronic Data Interchange Access Number",
            "EM" => "Electronic Mail",
            "EX" => "Telephone Extension",
            "FX" => "Facsimile",
            "HP" => "Home Phone Number",
            "TE" => "Telephone",
            "UR" => "Uniform Resource Locator (URL)",
            "WP" => "Work Phone Number"))
        E366  = t::ID.new(:E366 , "Contract Function Code"               , 2, 2,
          s::CodeList.build(
            "1I" => "Local Contact",
            "AJ" => "Primary Contact",
            "AL" => "Alternate Contact",
            "BI" => "Bill Inquiry Contact",
            "BL" => "Technical Department",
            "CN" => "General Contact",
            "CX" => "Payers Claim Office",
            "EP" => "Employer Contact",
            "IC" => "Information Contact",
            "IP" => "Insured Party",
            "RP" => "Responsible Person",
            "PQ" => "Parent or Guardian",
            "SK" => "School Clerk"))
        E373  = t::DT.new(:E373 , "Date"                                 , 8, 8)
        E374  = t::ID.new(:E374 , "Date/Time Qualifier"                  , 3, 3,
          s::CodeList.build(
            "007" => "Effective",
            "009" => "Process",
            "011" => "Shipped",
            "036" => "Expiration",
            "050" => "Received",
            "090" => "Report Start",
            "091" => "Report End",
            "096" => "Discharge",
            "102" => "Issue",
            "139" => "Estimated",
            "150" => "Service Period Start",
            "151" => "Service Period End",
            "152" => "Effective Date of Change",
            "193" => "Period Start",
            "194" => "Period End",
            "196" => "Start",
            "198" => "Completion",
            "232" => "Claim Statement Period Start",
            "233" => "Claim Statement Period End",
            "286" => "Retirement",
            "290" => "Coordination of Benefits",
            "291" => "Plan",
            "292" => "Benefit",
            "295" => "Primary Care Provider",
            "296" => "Initial Disability Period Return To Work",
            "297" => "Initial Disability Period Last Day Worked",
            "300" => "Enrollment Signature Date",
            "301" => "Consolidated Omnibus Budget Reconciliation Act (COBRA) Qualifying Event",
            "303" => "Maintenance Effective",
            "304" => "Latest Visit or Consultation",
            "307" => "Eligibility",
            "314" => "Disability",
            "318" => "Added",
            "336" => "Employment Begin",
            "337" => "Employment End",
            "338" => "Medicare Begin",
            "339" => "Medicare End",
            "340" => "Consolidated Omnibus Budget Reconciliation Act (COBRA) Begin",
            "341" => "Consolidated Omnibus Budget Reconciliation Act (COBRA) End",
            "342" => "Premium Paid to Date Begin",
            "343" => "Premium Paid to Date End",
            "344" => "Coordination of Benefits Begin",
            "345" => "Coordination of Benefits End",
            "346" => "Plan Begin",
            "347" => "Plan End",
            "348" => "Benefit Begin",
            "349" => "Benefit End",
            "350" => "Education Begin",
            "351" => "Education End",
            "356" => "Eligibility Begin",
            "357" => "Eligibility End",
            "360" => "Initial Disability Period Start",
            "361" => "Initial Disability Period End",
            "382" => "Enrollment",
            "383" => "Adjusted Hire",
            "385" => "Credited Service Begin",
            "386" => "Credited Service End",
            "388" => "Payment Cancellation",
            "393" => "Plan Participation Suspension",
            "394" => "Rehire",
            "405" => "Production",
            "431" => "Onset of Current Symptoms or Illness",
            "434" => "Statement",
            "435" => "Admission",
            "439" => "Accident",
            "441" => "Prior Placement",
            "442" => "Date of Birth",
            "444" => "First Visit or Consultation",
            "446" => "Replacement",
            "452" => "Appliance Placement",
            "453" => "Acute Manifestation of a Chronic Condition",
            "454" => "Initial Treatment",
            "455" => "Last X-Ray",
            "458" => "Certification",
            "461" => "Last Certification",
            "463" => "Begin Therapy",
            "471" => "Prescription",
            "472" => "Service",
            "473" => "Medicaid Begin",
            "474" => "Medicaid End",
            "484" => "Last Menstrual Period",
            "523" => "Date of Claim",
            "539" => "Policy Effective",
            "540" => "Policy Expiration",
            "543" => "Last Premium Paid Date",
            "573" => "Date Claim Paid",
            "582" => "@todo",
            "607" => "Certification Revision",
            "636" => "Date of Last Update",
            "695" => "Previous Period",
            "738" => "Most Recent Hemoglobin or Hematocrit or Both",
            "739" => "Most Recent Serum Creatine",
            "754" => "Next Payment Due",
            "771" => "Status",
            "881" => "Request",
            "866" => "Examination",
            "903" => "Application Entry",
            "AAH" => "Event",
            "AB4" => "Time Period",
            "ABC" => "Estimated Date of Birth",
            "ABW" => "Credit Card Expiration",
            "AEC" => "Medicare Part A Coverage Effective Date",
            "AED" => "Medicare Part A Termination Date",
            "AEG" => "Medicare Part B Coverage Effective Date",
            "AEH" => "Medicare Part B Termination Date",
            "AFC" => "Medicare Part D Coverage Effective Date",
            "AFD" => "Medicare Part D Termination Date"))
        E380  = t:: R.new(:E380 , "Quantity"                             , 1, 15)
        E426  = t::ID.new(:E426 , "Adjustment Reason Code"               , 2, 2,
          s::CodeList.build(
            "50" => "Late Charge",
            "51" => "Interest Penalty Charge",
            "72" => "Authorized Return",
            "90" => "Early Payment Allowance",
            "AH" => "Origination Fee",
            "AM" => "Applied to Borrower's Account",
            "AP" => "Acceleration of Benefits",
            "B2" => "Rebate",
            "B3" => "Recovery Allowance",
            "BD" => "Bad Debt Adjustment",
            "BN" => "Bonus",
            "C5" => "Temporary Allowance",
            "CR" => "Capitation Interest",
            "CS" => "Adjustment",
            "CT" => "Capitation Payment",
            "CV" => "Capital Passthru",
            "CW" => "Certified Registered Nurse Anesthetist Passthru",
            "DM" => "Direct Medical Education Passthru",
            "E3" => "Withholding",
            "FB" => "Forwarding Balance",
            "FC" => "Fund Allocation",
            "GO" => "Graduate Medicale Education Passthru",
            "HM" => "Hemophelia Clotting Factor Supplement",
            "IP" => "Incentive Premium Payment",
            "IR" => "Internal Revenue Service Withholding",
            "IS" => "Interim Settlement",
            "J1" => "Nonreimbursable",
            "L3" => "Penalty",
            "L6" => "Interest Owed",
            "LE" => "Levy",
            "LS" => "Lump Sum",
            "OA" => "Organ Acquisition Passthru",
            "OB" => "Offset for Affiliated Providers",
            "PI" => "Periodic Interim Payment",
            "PL" => "Payment Final",
            "RA" => "Retro-activity Adjustment",
            "RE" => "Return on Equity",
            "SL" => "Student Loan Repayment",
            "TL" => "Third Party Liability",
            "WO" => "Overpayment Recovery",
            "WU" => "Unspecified Recovery"))
        E429  = t::AN.new(:E429 , "Check Number"                         , 1, 16)
        E443  = t::AN.new(:E443 , "Contract Inquiry Reference"           , 1, 20)
        E447  = t::AN.new(:E447 , "Loop Identifier Code"                 , 1, 4)
        E449  = t::AN.new(:E449 , "Fixed Format Information"             , 1, 80)
        E478  = t::ID.new(:E478 , "Credit/Debit Flag Code"               , 1, 1,
          s::CodeList.build(
            "C"   => "Credit",
            "D"   => "Debit",
            "ACH" => "Automated Clearing House (ACH)",
            "BOP" => "Financial Institution Option",
            "CHK" => "Check",
            "FWT" => "Federal Reserve Funds/Wire Transfer - Nonrepetitive",
            "NON" => "Non-Payment Data"))
        E479  = t::ID.new(:E479 , "Functional Identifier Code"           , 2, 2,
          s::CodeList.build(
            "AA" => "Account Analysis (822)",
            "AB" => "Logistics Service Request (219)",
            "AD" => "Individual Life, Annuity and Disability Application (267)",
            "AF" => "Application for Admission to Educational Institutions (189)",
            "AG" => "Application Advice (824)",
            "AH" => "Logistics Service Response (220)",
            "AI" => "Automotive Inspection Detail (928)",
            "AK" => "Student Educational Record (Transcript) Acknowledgment (131)",
            "AL" => "Set Cancellation (998) and Application Acceptance/Rejection Advice (499)",
            "AN" => "Return Merchandise Authorization and Notification (180)",
            "AO" => "Income or Asset Offset (521)",
            "AR" => "Warehouse Stock Transfer Shipment Advice (943)",
            "AS" => "Transportation Appointment Schedule Information (163)",
            "AT" => "Animal Toxicological Data (249)",
            "AW" => "Warehouse Inventory Adjustment Advice (947)",
            "BC" => "Business Credit Report (155)",
            "BE" => "Benefit Enrollment and Maintenance (834)",
            "BF" => "Business Entity Filings (105)",
            "BL" => "Motor Carrier Bill of Lading (211)",
            "BS" => "Shipment and Billing Notice (857)",
            "CA" => "Purchase Order Change Acknowledgment/Request - Seller Initiated (865)",
            "CB" => "Unemployment Insurance Tax Claim or Charge Information (153)",
            "CC" => "Clauses and Provisions (504)",
            "CD" => "Credit/Debit Adjustment (812)",
            "CE" => "Cartage Work Assignment (222)",
            "CF" => "Corporate Financial Adjustment Information (844 and 849)",
            "CG" => "Administrative Message (994)",
            "CH" => "Car Handling Information (420)",
            "CI" => "Consolidated Service Invoice/Statement (811)",
            "CJ" => "Manufacturer Coupon Family Code Structure (877)",
            "CK" => "Manufacturer Coupon Redemption Detail (881)",
            "CM" => "Component Parts Content (871)",
            "CN" => "Coupon Notification (887)",
            "CO" => "Cooperative Advertising Agreements (290)",
            "CP" => "Electronic Proposal Information (251, 805)",
            "CR" => "Rail Carhire Settlements (414)",
            "CS" => "Cryptographic Service Message (815)",
            "CT" => "Application Control Totals (831)",
            "CV" => "Commercial Vehicle Safety and Credentials Information Exchange (285)",
            "D3" => "Contract Completion Status (567)",
            "D4" => "Contract Abstract (561)",
            "D5" => "Contract Payment Management Report (568)",
            "DA" => "Debit Authorization (828)",
            "DD" => "Shipment Delivery Discrepancy Information (854)",
            "DF" => "Market Development Fund Allocation (883)",
            "DI" => "Dealer Information (128)",
            "DM" => "Shipper's Car Order (422)",
            "DS" => "Data Status Tracking (242)",
            "DX" => "Direct Exchange Delivery and Return Information (894, 895)",
            "EC" => "Educational Course Inventory (188)",
            "ED" => "Student Educational Record (Transcript) (130)",
            "EI" => "Railroad Equipment Inquiry or Advice (456)",
            "ER" => "Revenue Receipts Statement (170)",
            "ES" => "Notice of Employment Status (540)",
            "EV" => "Railroad Event Report (451)",
            "EX" => "Excavation Communication (620)",
            "FA" => "Functional Acknowledgment (997, 999)",
            "FB" => "Freight Invoice (859)",
            "FC" => "Court and Law Enforcement Information (175, 176)",
            "FG" => "Motor Carrier Loading and Route Guide (217)",
            "FH" => "Motor Carrier Tariff Information (218)",
            "FR" => "Financial Reporting (821, 827)",
            "FT" => "File Transfer (996)",
            "GB" => "Average Agreement Demurrage (423)",
            "GC" => "Damage Claim Transaction Sets (920, 924, 925, 926)",
            "GE" => "General Request, Response or Confirmation (814)",
            "GF" => "Response to a Load Tender (990)",
            "GL" => "Intermodal Group Loading Plan (715)",
            "GP" => "Grocery Products Invoice (880)",
            "GR" => "Statistical Government Information (152)",
            "GT" => "Grant or Assistance Application (194)",
            "HB" => "Eligibility, Coverage or Benefit Information (271)",
            "HC" => "Health Care Claim (837)",
            "HI" => "Health Care Services Review Information (278)",
            "HN" => "Health Care Claim Status Notification (277)",
            "HP" => "Health Care Claim Payment/Advice (835)",
            "HR" => "Health Care Claim Status Request (276)",
            "HS" => "Eligibility, Coverage or Benefit Inquiry (270)",
            "IA" => "Air Freight Details and Invoice (110, 980)",
            "IB" => "Inventory Inquiry/Advice (846)",
            "IC" => "Rail Advance Interchange Consist (418)",
            "ID" => "Insurance/Annuity Application Status (273)",
            "IE" => "Insurance Producer Administration (252)",
            "IG" => "Direct Store Delivery Summary Information (882)",
            "II" => "Rail Freight Details and Invoice Summary (411)",
            "IJ" => "Report of Injury, Illness or Incident (148)",
            "IM" => "Motor Carrier Freight Details and Invoice (210, 980)",
            "IN" => "Invoice Information (810,819)",
            "IO" => "Ocean Shipment Billing Details (310, 312, 980)",
            "IP" => "Intermodal Ramp Activity (622)",
            "IR" => "Rail Carrier Freight Details and Invoice (410, 980)",
            "IS" => "Estimated Time of Arrival and Car Scheduling (421)",
            "KM" => "Commercial Vehicle Credentials (286)",
            "LA" => "Federal Communications Commission (FCC) License Application (195)",
            "LB" => "Lockbox (823)",
            "LI" => "Locomotive Information (436)",
            "LN" => "Property and Casualty Loss Notification (272)",
            "LR" => "Logistics Reassignment (536)",
            "LS" => "Asset Schedule (851)",
            "LT" => "Student Loan Transfer and Status Verification (144)",
            "MA" => "Motor Carrier Summary Freight Bill Manifest (224)",
            "MC" => "Request for Motor Carrier Rate Proposal (107)",
            "MD" => "Department of Defense Inventory Management (527)",
            "ME" => "Mortgage Origination (198, 200, 201, 261, 262, 263, 833, 872)",
            "MF" => "Market Development Funds Settlement (884)",
            "MG" => "Mortgage Servicing Transaction Sets (203, 206, 260, 264, 266)",
            "MH" => "Motor Carrier Rate Proposal (106)",
            "MI" => "Motor Carrier Shipment Status Inquiry (213)",
            "MJ" => "Secondary Mortgage Market Loan Delivery (202)",
            "MK" => "Response to a Motor Carrier Rate Proposal (108)",
            "MM" => "Medical Event Reporting (500)",
            "MN" => "Mortgage Note (205)",
            "MO" => "Maintenance Service Order (650)",
            "MP" => "Motion Picture Booking Confirmation (159)",
            "MQ" => "Consolidators Freight Bill and Invoice (223)",
            "MR" => "Multilevel Railcar Load Details (125)",
            "MS" => "Material Safety Data Sheet (848)",
            "MT" => "Electronic Form Structure (868)",
            "MV" => "Material Obligation Validation (517)",
            "MW" => "Rail Waybill Response (427)",
            "MX" => "Material Claim (847)",
            "MY" => "Response to a Cartage Work Assignment (225)",
            "NC" => "Nonconformance Report (842)",
            "NL" => "Name and Address Lists (101)",
            "NP" => "Notice of Power of Attorney (157)",
            "NT" => "Notice of Tax Adjustment or Assessment (149)",
            "OC" => "Cargo Insurance Advice of Shipment (362)",
            "OG" => "Order Group - Grocery (875, 876)",
            "OR" => "Organizational Relationships (816)",
            "OW" => "Warehouse Shipping Order (940)",
            "PA" => "Price Authorization Acknowledgment/Status (845)",
            "PB" => "Railroad Parameter Trace Registration (455)",
            "PC" => "Purchase Order Change Request - Buyer Initiated (860)",
            "PD" => "Product Activity Data (852)",
            "PE" => "Periodic Compensation (256)",
            "PF" => "Annuity Activity (268)",
            "PG" => "Insurance Plan Description (100)",
            "PH" => "Pricing History (503)",
            "PI" => "Patient Information (275)",
            "PJ" => "Project Schedule Reporting (806)",
            "PK" => "Project Cost Reporting (839) and Contractor Cost Data Reporting (196)",
            "PL" => "Railroad Problem Log Inquiry or Advice (452)",
            "PN" => "Product Source Information (244)",
            "PO" => "Purchase Order (850)",
            "PQ" => "Property Damage Report (112)",
            "PR" => "Purchase Order Acknowledgement (855)",
            "PS" => "Planning Schedule with Release Capability (830)",
            "PT" => "Product Transfer and Resale Report (867)",
            "PU" => "Motor Carrier Shipment Pick-up Notification (216)",
            "PV" => "Purchase Order Shipment Management Document (250)",
            "PY" => "Payment Cancellation Request (829)",
            "QG" => "Product Information (878, 879, 888, 889, 893, 896)",
            "QM" => "Transportation Carrier Shipment Status Message (214)",
            "QO" => "Ocean Shipment Status Information (313, 315)",
            "RA" => "Payment Order/Remittance Advice (820)",
            "RB" => "Railroad Clearance (470)",
            "RC" => "Receiving Advice/Acceptance Certificate (861)",
            "RD" => "Royalty Regulatory Report (185)",
            "RE" => "Warehouse Stock Receipt Advice (944)",
            "RH" => "Railroad Reciprocal Switch File (433)",
            "RI" => "Routing and Carrier Instruction (853)",
            "RJ" => "Railroad Mark Register Update Activity (434)",
            "RK" => "Standard Transportation Commodity Code Master (435)",
            "RL" => "Rail Industrial Switch List (423)",
            "RM" => "Railroad Station Master File (431)",
            "RN" => "Requisition Transaction (511)",
            "RO" => "Ocean Booking Information (300, 301,303)",
            "RP" => "Commission Sales Report (818)",
            "RQ" => "Request for Quotation (840) and Procurement Notices (836)",
            "RR" => "Response to Request For Quotation (843)",
            "RS" => "Order Status Information (869, 870)",
            "RT" => "Report of Test Results (863)",
            "RU" => "Railroad Retirement Activity (429)",
            "RV" => "Railroad Junctions and Interchanges Activity (437)",
            "RW" => "Rail Revenue Waybill (426)",
            "RX" => "Rail Deprescription (432)",
            "RY" => "Request for Student Educational Record (Transcript) (146)",
            "RZ" => "Response to Request for Student Educational Record (Transcript) (147)",
            "SA" => "Air Shipment Information (104)",
            "SB" => "Switch Rails (424)",
            "SC" => "Price/Sales Catalog (832)",
            "SD" => "Student Loan Pre-Claims and Claims (191)",
            "SE" => "Shipper's Export Declaration (601)",
            "SG" => "SG Receiving Advice - Grocery (885)",
            "SH" => "Ship Notice/Manifest (856)",
            "SI" => "Shipment Information (858)",
            "SJ" => "Transportation Automatic Equipment Identification (160)",
            "SL" => "Student Loan Application and Guarantee (135, 139)",
            "SM" => "Motor Carrier Load Tender (204)",
            "SN" => "Rail Route File Maintenance (475)",
            "SO" => "Ocean Shipment Information (304, 306, 309, 311, 317, 319, 321, 322, 323, 324, 325, 350, 352, 353, 354, 355, 356, 357, 358, 361)",
            "SP" => "Specifications/Technical Information (841)",
            "SQ" => "Production Sequence (866)",
            "SR" => "Rail Carrier Shipment Information (404, 419)",
            "SS" => "Shipping Schedule (862)",
            "ST" => "Railroad Service Commitment Advice (453)",
            "SU" => "Account Assignment/Inquiry and Service/Status (248)",
            "SV" => "Student Enrollment Verification (190)",
            "SW" => "Warehouse Shipping Advice (945)",
            "TA" => "Electronic Filing of Tax Return Data Acknowledgment (151)",
            "TC" => "Court Submission (176)",
            "TD" => "Trading Partner Profile (838)",
            "TF" => "Electronic Filing of Tax Return Data (813)",
            "TI" => "Tax Information Exchange (826)",
            "TM" => "Motor Carrier Delivery Trailer Manifest (212)",
            "TN" => "Tax Rate Notification (150)",
            "TO" => "Real Estate Title Services (197, 199, 265)",
            "TP" => "Rail Rate Transactions (460, 463, 466, 468, 485, 486, 490, 492, 494)",
            "TR" => "Train Sheet (161)",
            "TS" => "Transportation Services Tender (602)",
            "TT" => "Testing Results Request and Report (138)",
            "TX" => "Text Message (864)",
            "UA" => "Retail Account Characteristics (885)",
            "UB" => "Customer Call Reporting (886)",
            "UC" => "Uniform Commercial Code Filing (154)",
            "UD" => "Deduction Research Report (891)",
            "UI" => "Underwriting Information Services (255)",
            "UP" => "Motor Carrier Pick-up Manifest (215)",
            "UW" => "Insurance Underwriting Requirements Reporting (186)",
            "VA" => "Vehicle Application Advice (126)",
            "VB" => "Vehicle Baying Order (127)",
            "VC" => "Vehicle Shipping Order (120)",
            "VD" => "Vehicle Damage (124)",
            "VE" => "Vessel Content Details (109)",
            "VH" => "Vehicle Carrier Rate Update (129)",
            "VI" => "Voter Registration Information (280)",
            "VS" => "Vehicle Service (121)",
            "WA" => "Product Service Transaction Sets (140, 141, 142, 143)",
            "WB" => "Rail Carrier Waybill Interchange (417)",
            "WG" => "Vendor Performance Review (501)",
            "WI" => "Wage Determination (288)",
            "WL" => "Well Information (625)",
            "WR" => "Shipment Weights (440)",
            "WT" => "Rail Waybill Request (425)"))
        E455  = t::ID.new(:E455 , "Responsible Agency Code"              , 1, 2,
          s::CodeList.build(
            "X" => "Accredited Standards Committee X12"))
        E480  = t::AN.new(:E480 , "Version / Release / Identifier Code"  , 1, 12,
          s::CodeList.external("881"))
        E481  = t::ID.new(:E481 , "Trace Type Code"                      , 1, 2,
          s::CodeList.build(
            "1" => "Current Transaction Trace Numbers",
            "2" => "Referenced Transaction Trace Numbers",
            "3" => "@todo"))
        E499  = t::AN.new(:E499 , "Condition Value"                      , 1, 10)
        E506  = t::ID.new(:E506 , "DFI Identification Number Qualifier"  , 2, 2,
          s::CodeList.build(
            "01" => s::CodeList.external("4"),
            "04" => s::CodeList.external("91")))
        E507  = t::AN.new(:E507 , "DFI Identification Number"            , 3, 12,
          s::CodeList.external("60"))
        E508  = t::AN.new(:E508 , "Account Number"                       , 1, 35)
        E509  = t::AN.new(:E509 , "Originating Company Identifier"       , 10,10)
        E510  = t::AN.new(:E510 , "Originating Company Supplemental Code", 9, 9)
        E522  = t::ID.new(:E522 , "Amount Qualifier Code"                , 1, 3,
          s::CodeList.build(
            "93"  => "Contribution",
            "A8"  => "Noncovered Charges - Actual",
            "AU"  => "Coverage Amount",
            "B6"  => "Allowed Amount",
            "B9"  => "Co-insurance - Actual",
            "C1"  => "Co-Payment Amount",
            "D"   => "Payor Amount Paid",
            "D2"  => "Deductible Amount",
            "D8"  => "Discount Amount",
            "DY"  => "Per Day Limit",
            "EAF" => "Amount Owed",
            "EBA" => "Expected Expenditure Amount",
            "F3"  => "Patient Responsibility - Estimated",
            "F4"  => "Postage Claimed",
            "F5"  => "Patient Amount Paid",
            "FK"  => "Other Unlisted Amount",
            "GT"  => "Goods and Services Tax",
            "I"   => "Interest",
            "JN"  => "Employer Contribution",
            "KH"  => "Deduction Amount",
            "N8"  => "Miscellaneous Taxes",
            "NL"  => "Negative Ledger Balance",
            "P3"  => "Premium Amount",
            "T3"  => "Total Submitted Charges",
            "PB"  => "Billed Amount",
            "R"   => "Spend Down",
            "SCT" => "State Care Tax",
            "T"   => "Tax",
            "T2"  => "Total Claim Before Taxes",
            "YU"  => "In Process",
            "YY"  => "Returned",
            "ZK"  => "Federal Medicare or Medicaid Payment Mandate Category 1",
            "ZL"  => "Federal Medicare or Medicaid Payment Mandate Category 2",
            "ZM"  => "Federal Medicare or Medicaid Payment Mandate Category 3",
            "ZN"  => "Federal Medicare or Medicaid Payment Mandate Category 4",
            "ZO"  => "Federal Medicare or Medicaid Payment Mandate Category 5"))
        E554  = t::Nn.new(:E554 , "Assigned Number"                      , 1, 6, 0)
        E559  = t::ID.new(:E559 , "Agency Qualifier Code"                , 2, 2,
          s::CodeList.build(
            "LB" => s::CodeList.external("407")))
        E569  = t::ID.new(:E569 , "Account Number Qualifier"             , 1, 3,
          s::CodeList.build(
            "DA" => "Demand Deposit",
            "SG" => "Savings"))
        E584  = t::ID.new(:E584 , "Employment Status Code"               , 2, 2,
          s::CodeList.build(
            "AC" => "Active",
            "AE" => "@todo",
            "AO" => "Active Military - Overseas",
            "AU" => "Active Military - USA",
            "AS" => "@todo",
            "AT" => "@todo",
            "CC" => "@todo",
            "DD" => "@todo",
            "DI" => "Deceased",
            "HD" => "@todo",
            "IR" => "@todo",
            "FT" => "Full-time",
            "L1" => "Leave of Absence",
            "LX" => "@todo",
            "PE" => "@todo",
            "PT" => "Part-time",
            "PV" => "Previous",
            "RE" => "@todo",
            "RM" => "@todo",
            "RR" => "@todo",
            "RU" => "Retired Military - USA",
            "RT" => "Retired",
            "TE" => "Terminated"))
        E591  = t::ID.new(:E591 , "Payment Method Code"                  , 3, 3)
        E594  = t::ID.new(:E594 , "Frequency Code"                       , 1, 1,
          s::CodeList.build(
            "1" => "Weekly",
            "2" => "Biweekly",
            "3" => "Semimonthly",
            "4" => "Monthly",
            "6" => "Daily",
            "7" => "Annual",
            "8" => "Two Calendar Months",
            "9" => "Lump-Sum Separation Allowance",
            "B" => "Year-to-Date",
            "C" => "Single",
            "H" => "Hourly",
            "Q" => "Quarterly",
            "S" => "Semiannual",
            "U" => "Unknown"))
        E609  = t::Nn.new(:E609 , "Count"                                , 1, 9, 0)
        E615  = t::ID.new(:E615 , "Time Period Qualifier"                , 1, 2,
          s::CodeList.build(
            "6"  => "Hour",
            "7"  => "Day",
            "13" => "24 Hours",
            "21" => "Years",
            "22" => "Service Year",
            "23" => "Calendar Year",
            "24" => "Year to Date",
            "25" => "Contract",
            "26" => "Episode",
            "27" => "Visit",
            "28" => "Outlier",
            "29" => "Remaining",
            "30" => "Exceeded",
            "31" => "Not Exceeded",
            "32" => "Lifetime",
            "33" => "Lifetime Remaining",
            "34" => "Month",
            "35" => "Week",
            "36" => "Admission"))
        E616  = t::Nn.new(:E616 , "Number of Periods"                    , 1, 3, 0)
        E618  = t::ID.new(:E618 , "Implementation Transaction Set Syntax Error Code", 1, 3,
          s::CodeList.build(
            "1"  => "Transaction Set Not Supported",
            "2"  => "Transaction Set Trailer Missing",
            "3"  => "Transaction Set Control Number in Header and Trailer Do Not Match",
            "4"  => "Number of Included Segments Does Not Match Actual Content",
            "5"  => "One or More Segments in Error",
            "6"  => "Missing or Invalid Transaction Set Identifier",
            "7"  => "Missing or Invalid Transaction Set Control Number",
            "8"  => "Authentication Key Name Unknown",
            "9"  => "Encryption Key Name Unknown",
            "10" => "Requested Service (Authentication or Encrypted) Not Available",
            "11" => "Unknown Security Recipient",
            "12" => "Incorrect Message Length (Encryption Only)",
            "13" => "Message Authentication Code Failed",
            "15" => "Unknown Security Originator",
            "16" => "Syntax Error in Decrypted Text",
            "17" => "Security Not Supported",
            "18" => "Transaction Set not in Functional Group",
            "19" => "Invalid Transaction Set Implementation Convention Reference",
            "23" => "Transaction Set Control Number Not Unique within the Functional Group",
            "24" => "S3E Security End Segment Missing for S3S Security Start Segment",
            "25" => "S3S Security Start Segment Missing for S3E Security End Segment",
            "26" => "S4E Security End Segment Missing for S4S Security Start Segment",
            "27" => "S4S Security Start Segment Missing for S4E Security End Segment",
            "I5" => "Implementation One or More Segments In Error",
            "I6" => "Implementation Convention Not Supported"))

        E620  = t::ID.new(:E620 , "Implementation Segment Syntax Error Code", 1, 3,
          s::CodeList.build(
            "1"  => "Unrecognized segment ID",
            "2"  => "Unexpected segment",
            "3"  => "Required Segment Missing",
            "4"  => "Loop Occurs Over Maximum Times",
            "5"  => "Segment Exceeds Maximum Use",
            "6"  => "Segment Not in Defined Transaction Set",
            "7"  => "Segment Not in Proper Sequence",
            "8"  => "Segment Has Data Element Errors",
            "I4" => "Implementation 'Not Used' Segment Present",
            "I6" => "Implementation Dependent Segment Missing",
            "I7" => "Implementation Loop Occurs Under Minimum Times",
            "I8" => "Implementation Segment Below Minimum Use",
            "I9" => "Implementation Dependent 'Not Used' Segment Present"))
        E621  = t::ID.new(:E621 , "Implementation Data Element Syntax Error Code", 1, 3,
          s::CodeList.build(
            "1"   => "Required Data Element Missing",
            "2"   => "Conditional Required Data Element Missing",
            "3"   => "Too Many Data Elements",
            "4"   => "Data Element Too Short",
            "5"   => "Data Element Too Long",
            "6"   => "Invalid Character In Data Element",
            "7"   => "Invalid Code Value",
            "8"   => "Invalid Date",
            "9"   => "Invalid Time",
            "10"  => "Exclusion Conditional Violated",
            "12"  => "Too Many Repetitions",
            "13"  => "Too Many Components",
            "I6"  => "Code Value Not Used in Implementation",
            "I9"  => "Implementation Dependent Data Element Missing",
            "I10" => "Implementation 'Not Used' Data Element Present",
            "I11" => "Implementation Too Few Repetitions",
            "I12" => "Implementation Pattern Match Failure",
            "I13" => "Implementation Dependent 'Not Used' Data Element Present"))
        E623  = t::ID.new(:E623 , "Time Code"                            , 2, 2,
          s::CodeList.build(
            "01" => "Equivalent to ISO P01",
            "02" => "Equivalent to ISO P02",
            "03" => "Equivalent to ISO P03",
            "04" => "Equivalent to ISO P04",
            "05" => "Equivalent to ISO P05",
            "06" => "Equivalent to ISO P06",
            "07" => "Equivalent to ISO P07",
            "08" => "Equivalent to ISO P08",
            "09" => "Equivalent to ISO P09",
            "10" => "Equivalent to ISO P10",
            "11" => "Equivalent to ISO P11",
            "12" => "Equivalent to ISO P12",
            "13" => "Equivalent to ISO M12",
            "14" => "Equivalent to ISO M11",
            "15" => "Equivalent to ISO M10",
            "16" => "Equivalent to ISO M09",
            "17" => "Equivalent to ISO M08",
            "18" => "Equivalent to ISO M07",
            "19" => "Equivalent to ISO M06",
            "20" => "Equivalent to ISO M05",
            "21" => "Equivalent to ISO M04",
            "22" => "Equivalent to ISO M03",
            "23" => "Equivalent to ISO M02",
            "24" => "Equivalent to ISO M01",
            "AD" => "Alaska Daylight Time",
            "AS" => "Alaska Standard Time",
            "AT" => "Alaska Time",
            "CD" => "Central Daylight Time",
            "CS" => "Central Standard Time",
            "CT" => "Central Time",
            "ED" => "Eastern Daylight Time",
            "ES" => "Eastern Standard Time",
            "ET" => "Eastern Time",
            "GM" => "Greenwich Mean Time",
            "HD" => "Hawaii-Aleutian Daylight Time",
            "HS" => "Hawaii-Aleutian Standard Time",
            "HT" => "Hawaii-Aleutian Time",
            "LT" => "Local Time",
            "MD" => "Mountain Daylight Time",
            "MS" => "Mountain Standard Time",
            "MT" => "Mountain Time",
            "ND" => "Newfoundland Daylight Time",
            "NS" => "Newfoundland Standard Time",
            "NT" => "Newfoundland Time",
            "PD" => "Pacific Daylight Time",
            "PS" => "Pacific Standard Time",
            "PT" => "Pacific Time",
            "TD" => "Atlantic Daylight Time",
            "TS" => "Atlantic Standard Time",
            "TT" => "Atlantic Time",
            "UT" => "Universal Time Coordinate"))
        E628  = t::AN.new(:E628 , "Hierachical ID Number"                , 1, 12)
        E639  = t::ID.new(:E639 , "Basis of Unit Price Code"             , 2, 2)
        E640  = t::ID.new(:E640 , "Transaction Type Code"                , 2, 2,
          s::CodeList.build(
            "18" => "Response - No Further Updates to Follow",
            "19" => "Response - Further Updates to Follow",
            "31" => "Subrogation Demand",
            "CH" => "Chargeable",
            "DG" => "Response",
            "NO" => "Notice",
            "P5" => "Predetermination - Medical",
            "P6" => "Predetermination - Dental",
            "RD" => "Returns Detail",
            "RP" => "Reporting",
            "RQ" => "Request",
            "RS" => "Response - Additional Response(s) Available",
            "RT" => "Spend Down",
            "RU" => "Medical Services Reservation",
            "TH" => "Receipt Acknowledgement Advice",
            "ZW" => "Sort and Segregate Detail"))
        E648  = t::ID.new(:E648 , "Price Multiplier Qualifier"           , 3, 3)
        E649  = t:: R.new(:E649 , "Multiplier"                           , 1, 10)
        E659  = t::ID.new(:E659 , "Basis of Verification Code"           , 1, 2)
        E669  = t::ID.new(:E669 , "Currency Market/Exchnage Code"        , 3, 3)
        E673  = t::ID.new(:E673 , "Quantity Qualifier"                   , 2, 2,
          s::CodeList.build(
            "8H" => "Minimum",
            "90" => "Acknowledged Quantity",
            "99" => "Quantity Used",
            "AA" => "Unacknowledged Quantity",
            "CA" => "Covered - Actual",
            "CD" => "Co-insured - Actual",
            "CE" => "Covered - Estimated",
            "D3" => "Number of Co-insurance Days",
            "DB" => "Deductible Blood Units",
            "DY" => "Days",
            "FA" => "Facility Identification",
            "FI" => "Federal Taxpayer's Identification Number",
            "DT" => "Dependent Total",
            "ET" => "Employee Total",
            "FL" => "Units",
            "HS" => "Hours",
            "II" => "Standard Unique Health Identifier For Each Individual In The United States",
            "LA" => "Life-time Reserve - Actual",
            "LE" => "Life-time Reserve - Estimated",
            "M2" => "Maximum",
            "MI" => "Member Identification Number",
            "MN" => "Month",
            "NE" => "Non-Covered Amount - Estimated",
            "NI" => "National Association of Insurance Commissioners (NAIC) Identification",
            "NR" => "Not Replaced Blood Units",
            "OU" => "Outlier Days",
            "P6" => "Number of Services or Procedures",
            "PI" => "Payor Identification",
            "PP" => "Pharmacy Processor Number",
            "PS" => "Prescription",
            "PT" => "Patients",
            "QA" => "Quantity Approved",
            "QC" => "Quantity Disapproved",
            "S7" => "Age, High Value",
            "S8" => "Age, Low Value",
            "SV" => "Service Provider Number",
            "TO" => "Total",
            "VS" => "Visits",
            "XV" => s::CodeList.external("540"),
            "XX" => s::CodeList.external("537"),
            "YY" => "Years",
            "ZK" => "Federal Medicare or Medicaid Payment Mandate Category 1",
            "ZL" => "Federal Medicare or Medicaid Payment Mandate Category 2",
            "ZM" => "Federal Medicare or Medicaid Payment Mandate Category 3",
            "ZN" => "Federal Medicare or Medicaid Payment Mandate Category 4",
            "ZO" => "Federal Medicare or Medicaid Payment Mandate Category 5"))
        E678  = t::ID.new(:E678 , "Ship/Delivery or Calendar Pattern Code", 1, 2,
          s::CodeList.build(
            "1"   => "1st Week of the Month",
            "2"   => "2nd Week of the Month",
            "3"   => "3rd Week of the Month",
            "4"   => "4th Week of the Month",
            "5"   => "5th Week of the Month",
            "6"   => "1st & 3rd Weeks of the Month",
            "7"   => "2nd & 4th Weeks of the Month",
            "8"   => "1st Working Day of Period",
            "9"   => "Last Working Day of Period",
            "A"   => "Monday through Friday",
            "B"   => "Monday through Saturday",
            "C"   => "Monday through Sunday",
            "D"   => "Monday",
            "E"   => "Tuesday",
            "F"   => "Wednesday",
            "G"   => "Thursday",
            "H"   => "Friday",
            "J"   => "Saturday",
            "K"   => "Sunday",
            "L"   => "Monday through Thursday",
            "M"   => "Immediately",
            "N"   => "As Directed",
            "O"   => "Daily Mon. through Fri.",
            "P"   => "1/2 Mon. & 1/2 Thurs.",
            "Q"   => "1/2 Tues. & 1/2 Thurs.",
            "R"   => "1/2 Wed. & 1/2 Fri.",
            "S"   => "Once Anytime Mon. through Fri.",
            "SG"  => "Tuesday through Friday",
            "SL"  => "Monday, Tuesday and Thursday",
            "SP"  => "MOnday, Tuesday and Friday",
            "SX"  => "Wednesday and Thursday",
            "SY"  => "Monday, Wednesday and Thursday",
            "SZ"  => "Tuesday, Thursday and Friday",
            "SGT" => "uesday through Friday",
            "SLM" => "onday, Tuesday and Thursday",
            "SPM" => "onday, Tuesday and Friday",
            "SXW" => "ednesday and Thursday",
            "SYM" => "onday, Wednesday and Thursday",
            "SZT" => "uesday, Thursday and Friday",
            "T"   => "1/2 Tue. & 1/2 Fri.",
            "U"   => "1/2 Mon. & 1/2 Wed.",
            "V"   => "1/3 Mon., 1/3 Wed., 1/3 Fri.",
            "W"   => "Whenever Necessary",
            "X"   => "1/2 By Wed., Bal. By Fri.",
            "Y"   => "None (Also Used to Cancel or Override a Previous Pattern)"))
        E679  = t::ID.new(:E679 , "Ship/Delivery Pattern Time Code"      , 1, 1,
          s::CodeList.build(
            "A" => "1st Shift (Normal Working Hours)",
            "B" => "2nd Shift",
            "C" => "3rd Shift",
            "D" => "A.M.",
            "E" => "P.M.",
            "F" => "As Directed",
            "G" => "Any Shift",
            "Y" => "None (Also Used to Cancel or Override a Previous Pattern)"))
        E687  = t::ID.new(:E687 , "Class of Trade Code"                  , 2, 2)
        E704  = t::ID.new(:E704 , "Paperwork/Report Action Code"         , 1, 2)

        # @note Copied from an unverified source
        E706  = t::ID.new(:E706 , "Entity Relation Code"                 , 2, 2)
        E715  = t::ID.new(:E715 , "Functional Group Acknowledgment Code" , 1, 1,
          s::CodeList.build(
            "A" => "Accepted",
            "E" => "Accepted, But Errors Were Noted",
            "M" => "Rejected, Message Authentication Code (MAC) Failed",
            "P" => "Partially Accepted, At Least One Transaction Set Was Rejected",
            "R" => "Rejected",
            "W" => "Rejected, Assurance Failed Validity Tests",
            "X" => "Rejected, Content After Decryption Could Not Be Analyzed"))
        E716  = t::ID.new(:E716 , "Functional Group Syntax Error Code"   , 1, 3,
          s::CodeList.build(
            "1"  => "Functional Group Not Supported",
            "2"  => "Functional Group Version Not Supported",
            "3"  => "Functional Group Trailer Missing",
            "4"  => "Group Control Number in the Functional Group Header and Trailer Do Not Agree",
            "5"  => "Number of Included Transaction Sets Does Not Match Actual Count",
            "6"  => "Group Control Number Violates Syntax",
            "10" => "Authentication Key Name Unknown",
            "11" => "Encryption Key Name Unknown",
            "12" => "Requested Service (Authentication or Encryption) Not Available",
            "13" => "Unknown Security Recipient",
            "14" => "Unknown Security Originator",
            "15" => "Syntax Error in Decrypted Text",
            "16" => "Security Not Supported",
            "17" => "Incorrect Message Length (Encryption Only)",
            "18" => "Message Authentication Code Failed",
            "19" => "Functional Group Control Number not Unique within Interchange",
            "23" => "S3E Security End Segment Missing for S3S Security Start Segment",
            "24" => "S3S Security Start Segment Missing for S3E Security End Segment",
            "25" => "S4E Security End Segment Missing for S4S Security Start Segment",
            "26" => "S4S Security Start Segment Missing for S4E Security End Segment"))
        E717  = t::ID.new(:E717 , "Transaction Set Acknowledgment Code"  , 1, 1,
          s::CodeList.build(
            "A" => "Accepted",
            "E" => "Accepted But Errors Were Reported",
            "M" => "Rejected, Message Authentication Code (MAC) Failed",
            "R" => "Rejected",
            "W" => "Rejected, Assurance Failed Validity Tests",
            "X" => "Rejected, Content After Decryption Could Not Be Analyzed"))
        E718  = t::ID.new(:E718 , "Transaction Set Syntax Error Code"    , 1, 3)
        E719  = t::Nn.new(:E719 , "Segment Position in Transaction Set"  , 1, 10, 0)
        E720  = t::ID.new(:E720 , "Segment Syntax Error Code"            , 1, 3)
        E721  = t::ID.new(:E721 , "Segment ID Code"                      , 2, 3,
          s::CodeList.external("77"))
        E722  = t::Nn.new(:E722 , "Element Position in Segment"          , 1, 2, 0)
        E723  = t::ID.new(:E723 , "Data Element Syntax Error Code"       , 1, 3)
        E724  = t::AN.new(:E724 , "Copy of Bad Data Element"             , 1, 99)
        E725  = t::Nn.new(:E725 , "Data Element Reference Number"        , 1, 4, 0)
        E734  = t::AN.new(:E734 , "Hierarchical Parent ID Number"        , 1, 12)
        E735  = t::ID.new(:E735 , "Hierarchical Level Code"              , 1, 2,
          s::CodeList.build(
            "19" => "Provider of Service",
            "20" => "Information Source",
            "21" => "Information Receiver",
            "22" => "Subscriber",
            "23" => "Dependent",
            "EV" => "Event",
            "PT" => "Patient",
            "SS" => "Services"))
        E736  = t::ID.new(:E736 , "Hierarchical Child Code"              , 1, 1,
          s::CodeList.build(
            "0" => "No Subordinate HL Segment in This Hierarchical Structure",
            "1" => "Additional Subordinate HL Data Segment in This Hierarchical Structure"))
        E737  = t::ID.new(:E737 , "Measurement Reference ID Code"        , 2, 2,
          s::CodeList.build(
            "OG" => "Original",
            "TR" => "Test Results"))
        E738  = t::ID.new(:E738 , "Measurement Qualifier"                , 2, 2,
          s::CodeList.build(
            "HT" => "Height",
            "R1" => "Hemoglobin",
            "R2" => "Hematocrit",
            "R3" => "Epoetin Starting Dosage",
            "R4" => "Creatinine"))
        E739  = t:: R.new(:E739 , "Measurement Value"                    , 1, 20)
        E740  = t:: R.new(:E740 , "Range Minimum"                        , 1, 20)
        E741  = t:: R.new(:E741 , "Range Maximum"                        , 1, 20)
        E752  = t::ID.new(:E752 , "Surface/Layer/Position Code"          , 2, 2)
        E753  = t::ID.new(:E753 , "Measurement Method or Device"         , 2, 4)
        E755  = t::ID.new(:E755 , "Report Type Code"                     , 2, 2,
          s::CodeList.build(
            "03" => "Report Justifying Treatment Beyond Utilization Guidelines",
            "04" => "Drugs Administered",
            "05" => "Treatment Diagnosis",
            "06" => "Initial Assesment",
            "07" => "Functional Goals",
            "08" => "Plan of Treatment",
            "09" => "Progress Report",
            "10" => "Continued Treatment",
            "11" => "Chemical Analysis",
            "13" => "Certified Test Report",
            "15" => "Justification for Admission",
            "21" => "Recovery Plan",
            "48" => "Social Security Benefit Letter",
            "55" => "Rental Agreement",
            "59" => "Benefit Letter",
            "77" => "Support Data for Verification",
            "A3" => "Allergies/Sensitivies Document",
            "A4" => "Autopsy Report",
            "AM" => "Ambulance Certification",
            "AS" => "Admission Summary",
            "B2" => "Prescription",
            "B3" => "Physician Order",
            "B4" => "Referral Form",
            "BR" => "Benchmark Testing Results",
            "BS" => "Baseline",
            "BT" => "Blanket Test Results",
            "CB" => "Chiropractic Justification",
            "CK" => "Conset Form(s)",
            "CT" => "Certification",
            "D2" => "Drug Profile Document",
            "DA" => "Dental Models",
            "DB" => "Durable Medical Equipment Prescription",
            "DG" => "Diagnostic Report",
            "DJ" => "Discharge Monitoring Report",
            "DS" => "Discharge Summary",
            "EB" => "Explanation of Benefits (Coordination of Benefits or Medicare Secondary Payer)",
            "FM" => "Family Medical History Document",
            "HC" => "Health Cerification",
            "HR" => "Health Clinic Records",
            "I5" => "Immunization Record",
            "IR" => "State School Immunization Records",
            "LA" => "Laboratory Results",
            "M1" => "Medical Record Attachment",
            "MT" => "Models",
            "NN" => "Nursing Notes",
            "OB" => "Operative Note",
            "OC" => "Oxygen Content Averaging Report",
            "OD" => "Orders and Treatments Document",
            "OE" => "Objective Physical Examination (including vital signs) Document",
            "OX" => "Oxygen Therapy Certification",
            "OZ" => "Support Data for Claim",
            "P4" => "Pathology Report",
            "P5" => "Patient Medical History Document",
            "P6" => "Periodontal Charts",
            "PE" => "Parenteral or Enteral Certification",
            "PN" => "Physical Therapy Notes",
            "PO" => "Prosthetics or Orthotic Certification",
            "PQ" => "Paramedical Results",
            "PY" => "Physician's Report",
            "PZ" => "Physical Therapy Certification",
            "RB" => "Radiology Films",
            "RR" => "Radiology Reports",
            "RT" => "Report of Tests and Analysis Report",
            "RX" => "Renewable Oxygen Content Averaging Report",
            "SG" => "Symptoms Document",
            "V5" => "Death Notification",
            "XP" => "Photographs"))
        E756  = t::ID.new(:E756 , "Report Transmission Code"             , 1, 2,
          s::CodeList.build(
            "AA" => "Available on Request at Provider Site",
            "AB" => "Previously Submitted to Payer",
            "AD" => "Certification Included in this Claim",
            "AF" => "Narrative Segment Included in this Claim",
            "AG" => "No Documentation is Required",
            "BM" => "By Mail",
            "EL" => "Electronically Only",
            "EM" => "E-Mail",
            "FT" => "File Transfer",
            "FX" => "By Fax",
            "NS" => "Not Specified",
            "OL" => "On-Line",
            "VO" => "Voice"))
        E757  = t::Nn.new(:E757 , "Report Copies Needed"                 , 1, 2, 0)
        E782  = t:: R.new(:E782 , "Monetary Amount"                      , 1, 18)
        E786  = t::ID.new(:E786 , "Security Level Code"                  , 2, 2,
          s::CodeList.build(
            "00" => "Company Non-Classified",
            "01" => "Company Internal Use Only",
            "02" => "Company Confidential",
            "03" => "Company Confidential, Restricted (Need to Know)",
            "04" => "Company Registered (Signature Required)",
            "05" => "Personal",
            "06" => "Supplier Proprietary",
            "09" => "Company Defined (Trading Partner Level)",
            "11" => "Competition Sensitive",
            "20" => "Court Restricted",
            "21" => "Juvenile Record Restricted",
            "90" => "Government Non-Classified",
            "92" => "Government Confidential",
            "93" => "Government Secret",
            "94" => "Government Top Secret",
            "99" => "Government Defined (Trading Partner Level)",
            "ZZ" => "Mutually Defined"))
        E799  = t::AN.new(:E799 , "Version Identifier"                   , 1, 30)
        E812  = t::ID.new(:E812 , "Payment Format Code"                  , 3, 3,
          s::CodeList.build(
            "CCP" => "Cash Concentration/Disbursement plus Addenda (CCD+)(ACH)",
            "CTX" => "Corporate Trade Exchange (CTX) (ACH)"))
        E875  = t::ID.new(:E875 , "Maintenance Type Code"                , 3, 3,
          s::CodeList.build(
            "001" => "Change",
            "002" => "Delete",
            "021" => "Addition",
            "024" => "Cancellation or Termination",
            "025" => "Reinstatement",
            "026" => "Correction",
            "030" => "Audit or Compare",
            "032" => "Employee Information Not Applicable"))
        E889  = t::ID.new(:E889 , "Follow-up Action Code"                , 1, 1,
          s::CodeList.build(
            "C" => "Please Correct and Resubmit",
            "N" => "Resubmission Not Allowed",
            "P" => "Please Resubmit Original Transaction",
            "R" => "Resubmission Allowed",
            "S" => "Do Not Resubmit; Inquiry Initiated to a Third Party",
            "W" => "Please Wait 30 Days and Resubmit",
            "X" => "Please Wait 10 Days and Resubmit",
            "Y" => "Do Not Resubmit; We Will Hold Your Request and Respond Again Shortly"))
        E901  = t::ID.new(:E901 , "Reject Reason Code"                   , 2, 2,
          s::CodeList.build(
            "04" => "Authorization Quantity Exceeded",
            "15" => "Required Application Data Missing",
            "33" => "Input Errors",
            "35" => "Out of Network",
            "41" => "Authorization/Access Restrictions",
            "42" => "Unable to Respond at Current Time",
            "43" => "Invalid/Missing Provider Identification",
            "44" => "Invalid/Missing Provider Name",
            "45" => "Invalid/Missing Provider Specialty",
            "46" => "Invalid/Missing Provider Phone Number",
            "47" => "Invalid/Missing Provider State",
            "48" => "Invalid/Missing Referring Provider Identification Number",
            "49" => "Provider is Not Primary Care Physician",
            "50" => "Provider Ineligible for Inquiries",
            "51" => "Provider Not on File",
            "52" => "Service Dates Not Within Provider Plan Enrollment",
            "53" => "Inquired Benefit Inconsistent with Provider Type",
            "54" => "Inappropriate Product/Service ID Qualifier",
            "55" => "Inappropriate Product/Service ID",
            "56" => "Inappropriate Date",
            "57" => "Invalid/Missing Date(s) of Service",
            "58" => "Invalid/Missing Date-of-Birth",
            "60" => "Date of Birth Follows Date(s) of Service",
            "61" => "Date of Death Preceeds Date(s) of Service",
            "62" => "Date of Service Not Within Allowable Inquiry Period",
            "63" => "Date of Service in Future",
            "64" => "Invalid/Missing Patient ID",
            "65" => "Invalid/Missing Patient Name",
            "66" => "Invalid/Missing Patient Gender Code",
            "67" => "Patient Not Found",
            "68" => "Duplicate Patient ID Number",
            "69" => "Inconsistent with Patient's Age",
            "70" => "Inconsistent with Patient's Gender",
            "71" => "Patient Birth Date Does Not Match That for the Patient on the Database",
            "72" => "Invalid/Missing Subscriber/Insured ID",
            "73" => "Invalid/Missing Subscriber/Insured Name",
            "74" => "Invalid/Missing Subscriber/Insured Gender Code",
            "75" => "Subscribed/Insured Not Found",
            "76" => "Duplicate Subscriber/Insured ID Number",
            "77" => "Subscriber Found, Patient Not Found",
            "78" => "Subscriber/Insured Not in Group/Plan Identified",
            "79" => "Invalid Participant Identification",
            "80" => "No Response Received - Transaction Terminated",
            "95" => "Patient Not Eligible",
            "97" => "Invalid or Missing Provider Address",
            "98" => "Experimental Service or Procedure",
            "AA" => "Authorization Number Not Found",
            "AE" => "Requires Primary Care Physician Authorization",
            "AF" => "Invalid/Missing Diagnosis Code(s)",
            "AG" => "Invalid/Missing Procedure Code(s)",
            "AO" => "Additional Patient Condition Information Required",
            "CI" => "Certification Information Does Not Match Patient",
            "E8" => "Requires Medical Review",
            "IA" => "Invalid Authorization Number Format",
            "IP" => "Inappropriate Provider Role",
            "MA" => "Missing Authorization Number",
            "NC" => "No Certification Information Found",
            "T1" => "Cannot Identify Provider as TPO (Third Party Organization) Participant",
            "T2" => "Cannot Identify Payer as TPO (Third Party Organization) Participant",
            "T3" => "Cannot Identify Insured as TPO (Third Party Organization) Participant",
            "T4" => "Payer Name or Identifier Missing",
            "T5" => "Certification Information Missing",
            "T6" => "Claim does not contain enough information for re-pricing"))
        E923  = t::ID.new(:E923 , "Prognosis Code"                       , 1, 1,
          s::CodeList.build(
            "1" => "Poor",
            "2" => "Guarded",
            "3" => "Fair",
            "4" => "Good",
            "5" => "Very Good",
            "6" => "Excellent",
            "7" => "Less than 6 Months to Live",
            "8" => "Terminal"))
        E933  = t::AN.new(:E933 , "Free-form Message Text"               , 1, 264)
        E934  = t::AN.new(:E934 , "Printer Carriage Control Code"        , 2, 2)
        E935  = t::ID.new(:E935 , "Measurement Significance Code"        , 2, 2)
        E936  = t::ID.new(:E936 , "Measurement Attribute Code"           , 2, 2)
        E954  = t:: R.new(:E954 , "Percentage as Decimal"                , 1,  10)
        E1005 = t::ID.new(:E1005, "Hierarchical Structure Code"          , 4, 4,
          s::CodeList.build(
            "0007" => "Information Source, Information Receiver, Subscriber, Dependent, Event, Services",
            "0010" => "Information Source, Information Receiver, Provider of Service, Subscriber, Dependent",
            "0019" => "Information Source, Subscriber, Dependent",
            "0022" => "Information Source, Information Receiver, Subscriber, Dependent",
            "0085" => "Information Source, Information Receiver, Provider of Service, Patient"))
        E1018 = t:: R.new(:E1018, "Exponent"                             , 1, 15)
        E1028 = t::AN.new(:E1028, "Claim Submitter's Identifier"         , 1, 38)
        E1029 = t::ID.new(:E1029, "Claim Status Code"                    , 1, 2,
          s::CodeList.build(
            "1"  => "Processed as Primary",
            "2"  => "Processed as Secondary",
            "3"  => "Processed as Tertiary",
            "4"  => "Denied",
            "19" => "Processed as Primary, Forwarded to Additional Payer(s)",
            "20" => "Processed as Secondary, Forwarded to Additional Payer(s)",
            "21" => "Processed as Tertiary, Forwarded to Additional Payer(s)",
            "22" => "Reversal of Previous Payment",
            "23" => "Not Our Claim, Forwarded to Additional Payer(s)",
            "25" => "Predetermination Pricing Only - No Payment"))
        E1032 = t::ID.new(:E1032, "Claim Filing Indicator Code"          , 1, 2,
          s::CodeList.build(
            "11" => "Other Non-Federal Programs",
            "12" => "Preferred Provider Organization (PPO)",
            "13" => "Point of Service (POS)",
            "14" => "Exclusive Provider Organization (EPO)",
            "15" => "Indemnity Insurance",
            "16" => "Health Maintenance Organization (HMO) Medicare Risk",
            "17" => "Dentail Maintenance Organization",
            "AM" => "Automobile Medical",
            "BL" => "Blue Cross/Blue Shield",
            "CH" => "Champus",
            "CI" => "Commercial Insurance Co.",
            "DS" => "Disability",
            "FI" => "Federal Employees Program",
            "HM" => "Health Maintenance Organization",
            "LM" => "Liability Medical",
            "MA" => "Medicare Part A",
            "MB" => "Medicare Part B",
            "MC" => "Medicaid",
            "ME" => "Medicare Advantage Plan",
            "OF" => "Other Federal Program",
            "TV" => "Title V",
            "UK" => "Unknown",
            "VA" => "Veterans Affairs Plan",
            "WC" => "Worker's Compensation Health Claim",
            "ZZ" => "Mutually Defined"))
        E1033 = t::ID.new(:E1033, "Claim Adjustment Group Code"          , 1, 12,
          s::CodeList.build(
            "CO" => "Contractual Obligations",
            "CR" => "Corrections and Reversals",
            "OA" => "Other adjustments",
            "PI" => "Payor Initiated Reductions",
            "PR" => "Patient Responsibility"))
        E1034 = t::ID.new(:E1034, "Claim Adjustment Reason Code"         , 1, 5,
          s::CodeList.external("139"))
        E1035 = t::AN.new(:E1035, "Name Last or Organization Name"       , 1, 60)
        E1036 = t::AN.new(:E1036, "Name First"                           , 1, 35)
        E1037 = t::AN.new(:E1037, "Name Middle"                          , 1, 25)
        E1038 = t::AN.new(:E1038, "Name Prefix"                          , 1, 10)
        E1039 = t::AN.new(:E1039, "Name Suffix"                          , 1, 10)
        E1048 = t::ID.new(:E1048, "Business Function Code"               , 1, 3)
        E1065 = t::ID.new(:E1065, "Entity Type Qualifier"                , 1, 1,
          s::CodeList.build(
            "1" => "Person",
            "2" => "Non-Person Entity"))
        E1066 = t::ID.new(:E1066, "Citizenship Status Code"              , 1, 2)
        E1067 = t::ID.new(:E1067, "Marital Status Code"                  , 1, 1,
          s::CodeList.build(
            "A" => "Common Law",
            "B" => "Registered Domestic Partner",
            "C" => "Not Applicable",
            "D" => "Divorced",
            "I" => "Single",
            "K" => "Unknown",
            "M" => "Married",
            "R" => "Unreported",
            "S" => "Separated",
            "U" => "Unmarried (Single or Divorced or Widowed)",
            "W" => "Widowed",
            "X" => "Legally Separated"))
        E1068 = t::ID.new(:E1068, "Gender Code"                          , 1, 1,
          s::CodeList.build(
            "F" => "Female",
            "M" => "Male",
            "U" => "Unknown"))
        E1069 = t::ID.new(:E1069, "Individual Relationship Code"         , 2, 2,
          s::CodeList.build(
            "01" => "Spouse",
            "03" => "Father or Mother",
            "04" => "Grandfather or Grandmother",
            "05" => "Grandson or Granddaughter",
            "06" => "Uncle or Aunt",
            "07" => "Nephew or Niece",
            "08" => "Cousin",
            "09" => "Adopted Child",
            "10" => "Foster Child",
            "11" => "Son-in-law or Daughter-in-law",
            "12" => "Brother-in-law or Sister-in-law",
            "13" => "Mother-in-law or Father-in-law",
            "14" => "Brother or Sister",
            "15" => "Ward",
            "16" => "Stepparent",
            "17" => "Stepson or Stepdaughter",
            "18" => "Self",
            "19" => "Child",
            "20" => "Employee",
            "21" => "Unknown",
            "22" => "Handicapped Dependent",
            "23" => "Sponsored Dependent",
            "24" => "Dependent of a Minor Dependent",
            "25" => "Ex-spouse",
            "26" => "Guardian",
            "29" => "Significant Other",
            "31" => "Court Appointed Guardian",
            "32" => "Mother",
            "33" => "Father",
            "34" => "Other Adult",
            "38" => "Collateral Dependent",
            "39" => "Organ Donor",
            "40" => "Cadaver Donor",
            "41" => "Injured Plaintiff",
            "43" => "Child Where Insured Has No Financial Responsibility",
            "53" => "Life Partner",
            "60" => "Annuitant",
            "D2" => "Trustee",
            "G8" => "Other Relationship",
            "G9" => "Other Relative"))
        E1073 = t::ID.new(:E1073, "Yes/No Condition or Response Code"    , 1, 1,
          s::CodeList.build(
            "N" => "No",
            "U" => "Unknown",
            "Y" => "Yes",
            "W" => "Not Applicable"))
        E1109 = t::ID.new(:E1109, "Race or Ethnicity Code"               , 1, 1)
        E1136 = t::ID.new(:E1136, "Code Category"                        , 2, 2,
          s::CodeList.build(
            "07" => "Ambulance Certification",
            "09" => "Durable Medical Equipment Certification",
            "12" => "Medicare Secondary Working Aged Beneficiary or Spouse with Employer Group Health Plan",
            "13" => "Medicare Secondary End-Stage Renal Disease Beneficiary in Mandated Coordination Period with an Employer's Group Health Plan",
            "14" => "Medicare Secondary, No-fault Insurance including Auto is Primary",
            "15" => "Medicare Secondary Worker's Compensation",
            "16" => "Medicare Secondary Public Health Service (PHS) or Other Federal Agency",
            "41" => "Medicare Secondary Black Lung",
            "42" => "Medicare Secondary Veteran's Administration",
            "43" => "Medicare Secondary Disabled Beneficiary Under Age 65 with Large Group Health Plan (LGHP)",
            "44" => "Nature of Injury",
            "47" => "Medicare Secondary, Other Liability Insurance is Primary",
            "70" => "Hospice",
            "75" => "Functional Limitations",
            "E1" => "Spectacle Lenses",
            "E2" => "Contact Lenses",
            "E3" => "Spectacle Frames",
            "ZZ" => "Mutually Defined"))
        E1137 = t::AN.new(:E1137, "Medical Code Value"                   , 1, 15)
        E1138 = t::ID.new(:E1138, "Payer Responsibility Sequence"        , 1, 1,
          s::CodeList.build(
            "P" => "Primary",
            "S" => "Secondary",
            "T" => "Tertiary",
            "U" => "Unknown",
            "A" => "Payer Responsibility Four",
            "B" => "Payer Responsibility Five",
            "C" => "Payer Responsibility Six",
            "D" => "Payer Responsibility Seven",
            "E" => "Payer Responsibility Eight",
            "F" => "Payer Responsibility Nine",
            "G" => "Payer Responsibility Ten",
            "H" => "Payer Responsibility Eleven",
            "N" => "Unconfirmed"))
        E1143 = t::ID.new(:E1143, "Coordination of Benefits Code"        , 1, 1,
          s::CodeList.build(
            "1" => "Coordination of Benefits",
            "5" => "Unknown",
            "6" => "No Coordination of Benefits"))
        E1146 = t::ID.new(:E1146, "Disability Type Code"                 , 1, 1,
          s::CodeList.build(
            "1" => "Short Term Disability",
            "2" => "Long Term Disability",
            "3" => "Permanent or Total Disability",
            "4" => "No Disability"))
        E1149 = t::ID.new(:E1149, "Occupation Code"                      , 4, 6)
        E1154 = t::ID.new(:E1154, "Work Intensity Code"                  , 1, 1)
        E1161 = t::ID.new(:E1161, "Product Option Code"                  , 1, 2)
        E1165 = t::ID.new(:E1165, "Confidentiality Code"                 , 1, 1,
          s::CodeList.build(
            "R" => "Restricted Access",
            "U" => "Unrestricted Access"))
        E1166 = t::ID.new(:E1166, "Contract Type Code"                   , 2, 2,
          s::CodeList.build(
            "01" => "Diagnosis Related Group (DRG)",
            "02" => "Per Diem",
            "03" => "Variable Per Diem",
            "04" => "Flat",
            "05" => "Captitated",
            "06" => "Percent",
            "09" => "Other"))
        E1167 = t:: R.new(:E1167, "Sample Selection Modulus"             , 1, 6)
        E1176 = t::ID.new(:E1176, "Employment Class Code"                , 2, 3,
          s::CodeList.build(
            "01" => "Union",
            "02" => "Non-Union",
            "03" => "Executive",
            "04" => "Non-Executive",
            "05" => "Management",
            "06" => "Non-Management",
            "07" => "Hourly",
            "08" => "Salaried",
            "09" => "Administrative",
            "10" => "Non-Administrative",
            "11" => "Exempt",
            "12" => "Non-Exempt",
            "17" => "Highly Compensated",
            "18" => "Key-Employee",
            "19" => "Bargaining",
            "20" => "Non-Bargaining",
            "21" => "Owner",
            "22" => "President",
            "23" => "Vice President"))
        E1201 = t::ID.new(:E1201, "Information Status Code"              , 1, 1,
          s::CodeList.build(
            "A" => "Partial",
            "C" => "Current",
            "L" => "Latest",
            "O" => "Oldest",
            "P" => "Prior",
            "S" => "Second Most Current",
            "T" => "Third Most Current"))

        E1203 = t::ID.new(:E1203, "Maintenance Reason Code"              , 2, 3,
          s::CodeList.build(
            "01" => "Divorce",
            "02" => "Birth",
            "03" => "Death",
            "04" => "Retirement",
            "05" => "Adoption",
            "06" => "Strike",
            "07" => "Termination of Benefits",
            "08" => "Termination of Employment",
            "09" => "Consolidation Omnibus Budget Reconciliation Act (COBRA)",
            "10" => "Consolidation Omnibus Budget Reconciliation Act (COBRA) Premium Paid",
            "11" => "Surviving Spouse",
            "14" => "Voluntary Withdrawal",
            "15" => "Primary Care Provider (PCP) Change",
            "16" => "Quit",
            "17" => "Fired",
            "18" => "Suspended",
            "20" => "Active",
            "21" => "Disability",
            "22" => "Plan Change",
            "25" => "Change in Identifying Data Elements",
            "26" => "Declined Coverage",
            "27" => "Pre-Enrollment",
            "28" => "Initial Enrollment",
            "29" => "Benefit Selection",
            "31" => "Legal Separation",
            "32" => "Marriage",
            "33" => "Personnel Data",
            "37" => "Leave of Absence with Benefits",
            "38" => "Leave of Absence without Benefits",
            "39" => "Lay Off with Benefits",
            "40" => "Lay Off without Benefits",
            "41" => "Re-enrollment",
            "43" => "Change of Location",
            "46" => "Current Customer Information File in Error",
            "59" => "Non Payment",
            "AA" => "Dissatisfaction with Office Staff",
            "AB" => "Dissatisfaction with Medical Care/Services Rendered",
            "AC" => "Inconvenient Office Location",
            "AD" => "Dissatisfaction with Office Hours",
            "AE" => "Unable to Schedule Appointments in a Timely Manner",
            "AF" => "Dissatisfaction with Physician's Referral Policy",
            "AG" => "Less Respect and Attention Time Given than to Other Patients",
            "AH" => "Patient Moved to a New Location",
            "AI" => "No Reason Given",
            "AJ" => "Appointment Times not Met in a Timely Manner",
            "AL" => "Algorithm Assigned Benefit Selection",
            "EC" => "Member Benefit Selection",
            "XN" => "Notification Only",
            "XT" => "Transfer"))
        E1204 = t::AN.new(:E1204, "Plan Coverage Description"            , 1, 50)
        E1205 = t::ID.new(:E1205, "Insurance Line Code"                  , 2, 3,
          s::CodeList.build(
            "AC"  => "Basic Life",
            "ADD" => "Accidental Death and Dismemberment",
            "AG"  => "Preventative Care/Wellness",
            "AH"  => "24 Hour Care",
            "AJ"  => "Medicare Risk",
            "AK"  => "Mental Health",
            "DCP" => "Dental Capitation",
            "DEN" => "Dental",
            "EPO" => "Exclusive Provider Organization",
            "FAC" => "Facility",
            "HE"  => "Hearing",
            "HLT" => "Health",
            "HMO" => "Health Maintenance Organization",
            "LIF" => "Life",
            "LTC" => "Long-Term Care",
            "LTD" => "Long-Term Disability",
            "MM"  => "Major Medical",
            "MOD" => "Mail Order Drug",
            "PDG" => "Prescription Drug",
            "POS" => "Point of Service",
            "PPO" => "Preferred Provider Organization",
            "PRA" => "Practitioners",
            "STD" => "Short-Term Disability",
            "UR"  => "Utilization Review",
            "VIS" => "Vision"))
        E1207 = t::ID.new(:E1207, "Coverage Level Code"                  , 3, 3,
          s::CodeList.build(
            "CHD" => "Children Only",
            "DEP" => "Dependents Only",
            "E1D" => "Employee and One Dependent",
            "E2D" => "Employee and Two Dependents",
            "E3D" => "Employee and Three Dependents",
            "E5D" => "Employee and One or More Dependents",
            "E6D" => "Employee and Two or More Dependents",
            "E7D" => "Employee and Three or More Dependents",
            "E8D" => "Employee and Four or More Dependents",
            "E9D" => "Employee and Five or More Dependents",
            "ECH" => "Employee and Children",
            "EMP" => "Employee Only",
            "ESP" => "Employee and Spouse",
            "FAM" => "Family",
            "IND" => "Individual",
            "SPC" => "Spouse and Children",
            "SPO" => "Spouse Only",
            "TWO" => "Two Party"))
        E1209 = t::ID.new(:E1209, "Underwriting Decision Code"           , 1, 1)
        E1211 = t::ID.new(:E1211, "Drug House Code"                      , 2, 3)
        E1212 = t::ID.new(:E1212, "Health-Related Code"                  , 1, 1,
          s::CodeList.build(
            "N" => "None",
            "S" => "Substance Abuse",
            "T" => "Tobacco Use",
            "U" => "Unknown",
            "X" => "Tobacco Use and Substance Abuse"))
        E1213 = t::ID.new(:E1213, "Current Health Condition Code"        , 1, 1)
        E1214 = t::AN.new(:E1214, "Salary Grade"                         , 1, 5)
        E1215 = t::ID.new(:E1215, "Identification Card Type Code"        , 1, 1,
          s::CodeList.build(
            "D" => "Dental Insurance",
            "H" => "Health Insurance",
            "P" => "Prescription Drug Service Drug Insurance"))
        E1216 = t::ID.new(:E1216, "Benefit Status Code"                  , 1, 1,
          s::CodeList.build(
            "A" => "Active",
            "C" => "Consolidated Omnibus Budget Reconciliation Act (COBRA)",
            "S" => "Surviving Insured",
            "T" => "Tax Equity and Fiscal Responsibility Act (TEFRA)"))
        E1218 = t::ID.new(:E1218, "Benefit Status Code"                  , 1, 1,
          s::CodeList.build(
            "A" => "Medicare Part A",
            "B" => "Medicare Part B",
            "C" => "Medicare Part A and B",
            "D" => "Medicare",
            "E" => "No Medicare",
            "F" => "Medicare Part D",
            "G" => "Medicare Part A and D",
            "H" => "Medicare Part B and D",
            "I" => "Medicare Part A, B, and D"))
        E1219 = t::ID.new(:E1219, "Consolidated Omnibus Budget Reconciliation Act (COBRA) Qualifying", 1, 2,
          s::CodeList.build(
            "1"  => "Termination of Employment",
            "2"  => "Reduction of work hours",
            "3"  => "Medicare",
            "4"  => "Death",
            "5"  => "Divorce",
            "6"  => "Separation",
            "7"  => "Ineligible Child",
            "8"  => "Bankruptcy of Retiree's Former Employer (26 U.S.C. 4980B(f)(3)(F))",
            "9"  => "Layoff",
            "10" => "Leave of Absence",
            "ZZ" => "Mutually Defined"))
        E1220 = t::ID.new(:E1220, "Student Status Code"                  , 1, 1,
          s::CodeList.build(
            "F" => "Full-time",
            "N" => "Not a Student",
            "P" => "Part-time"))
        E1221 = t::ID.new(:E1221, "Provider Code"                        , 1, 3,
          s::CodeList.build(
            "AD" => "Admitting",
            "AS" => "Assistant Surgeon",
            "AT" => "Attending",
            "BI" => "Billing",
            "CO" => "Consulting",
            "CV" => "Covering",
            "H"  => "Hospital",
            "HH" => "Home Health Care",
            "LA" => "Laboratory",
            "OP" => "Operating",
            "OR" => "Ordering",
            "OT" => "Other Physician",
            "P1" => "Pharmacist",
            "P2" => "Pharmacy",
            "PC" => "Primary Care Physician",
            "PE" => "Performing",
            "R"  => "Rural Health Clinic",
            "RF" => "Referring",
            "SB" => "Submitting",
            "SK" => "Skilled Nursing Facility",
            "SU" => "Supervising"))
        E1222 = t::AN.new(:E1222, "Provider Specialty Code"              , 1, 3)

        # @note Copied from an unverified source
        E1223 = t::ID.new(:E1223, "Provider Organization Code"           , 3, 3)
        E1250 = t::ID.new(:E1250, "Date Time Period Format Qualifier"    , 2, 3,
          s::CodeList.build(
            "CC"  => "First Two Digits of Year Expressed in Format CCYY",
            "CD"  => "Month and Year Expressed in Format MMMYYY",
            "CM"  => "Date in Format CCYYMM",
            "CQ"  => "Date in Format CCYYQ",
            "CY"  => "Year Expressed in Format CCYY",
            "D6"  => "Date Expressed in Format YYMMDD",
            "D8"  => "Date Expressed in Format CCYYMMDD",
            "DA"  => "Range of Dates within a Single Month Expressed in Format DD-DD",
            "DB"  => "Date Expressed in Format MMDDCCYY",
            "DD"  => "Day of Month in Numeric Format",
            "DDT" => "Range of Dates and Time Expressed in Format CCYYMMDD-CCYYMMDDHHMM",
            "DT"  => "Date and Time Expressed in Format CCYYMMDDHHMM",
            "DTD" => "Range of Dates and Time Expressed in Format CCYYMMDDHHMM-CCYYMMDD",
            "DTS" => "Range of Date and Time Expressed in Format CCYYMMDDHHMMSS-CCYYMMDDHHMMSS",
            "EH"  => "Last Digit of Year and Julian Date Expressed in Format YDDD",
            "KA"  => "Date Expressed in Format YYMMMDD",
            "MD"  => "Month of Year and Day of Month Expressed in Format MMDD",
            "MM"  => "Month of Year in Numeric Format",
            "RD"  => "Range of Dates Expressed in Format MMDDCCYY-MMDDCCYY",
            "RD2" => "Range of Years Expressed in Format YY-YY",
            "RD4" => "Range of Years Expressed in Format CCYY-CCYY",
            "RD5" => "Range of Years and Months Expressed in Format CCYYMM-CCYYMM",
            "RD6" => "Range of Dates Expressed in Format YYMMDD-YYMMDD",
            "RD8" => "Range of Dates Expressed in Format CCYYMMDD-CCYYMMDD",
            "RDM" => "Range of Dates Expressed in Format YYMMDD-MMDD",
            "RDT" => "Range of Date and Time Expressed in Format CCYYMMDDHHMM-CCYYMMDDHHMM",
            "RMD" => "Range of Months and Days Expressed in Format MMDD-MMDD",
            "RMY" => "Range of Years and Months Expressed in Format YYMM-YYMM",
            "RTM" => "Range of Time Expressed in Format HHMM-HHMM",
            "RTS" => "Date and Time Expressed in Format CCYYMMDDHHMMSS",
            "TC"  => "Julian Date Expressed in Format DDD",
            "TM"  => "Time Expressed in Format HHMM",
            "TQ"  => "Date Expressed in Format MMYY",
            "TR"  => "Date and Time Expressed in Format DDMMYYHHMM",
            "TS"  => "Time Expressed in Format HHMMSS",
            "TT"  => "Date Expressed in Format MMDDYY",
            "TU"  => "Date EXpressed in Format YYDDD",
            "UN"  => "Unstructured",
            "YM"  => "Year and Month Expressed in Format YYMM",
            "YMM" => "Range of Year and Month Expressed in Format CCYYMM-MMM",
            "YY"  => "Last Two Digits of Year Expressed in Format CCYY"))
        E1251 = t::AN.new(:E1251, "Date Time Period"                     , 1, 35)
        E1270 = t::ID.new(:E1270, "Code List Qualifier Code"             , 1, 3,
          s::CodeList.build(
            "65"  => s::CodeList.external("508"),
            "68"  => s::CodeList.external("682"),
            "AAA" => s::CodeList.external("662"),
            "AAU" => s::CodeList.external("131"),
            "AAW" => s::CodeList.external("133"),
            "AAX" => s::CodeList.external("131"),
            "AAY" => s::CodeList.external("135"),
            "ABF" => s::CodeList.external("897"),
            "ABJ" => s::CodeList.external("897"),
            "ABK" => s::CodeList.external("897"),
            "ABN" => s::CodeList.external("897"),
            "ABU" => s::CodeList.external("897"),
            "ABV" => s::CodeList.external("897"),
            "ADD" => s::CodeList.external("897"),
            "APR" => s::CodeList.external("897"),
            "AS"  => s::CodeList.external("656"),
            "ASD" => s::CodeList.external("897"),
            "ATD" => s::CodeList.external("897"),
            "CAH" => s::CodeList.external("843"),
            "BBQ" => s::CodeList.external("896"),
            "BBR" => s::CodeList.external("896"),
            "BE"  => s::CodeList.external("132"),
            "BF"  => s::CodeList.external("131"),
            "BG"  => s::CodeList.external("132"),
            "BH"  => s::CodeList.external("132"),
            "BI"  => s::CodeList.external("132"),
            "BK"  => s::CodeList.external("131"),
            "BJ"  => s::CodeList.external("131"),
            "BN"  => s::CodeList.external("131"),
            "BO"  => s::CodeList.external("130"),
            "BP"  => s::CodeList.external("130"),
            "BQ"  => s::CodeList.external("131"),
            "BR"  => s::CodeList.external("131"),
            "BT"  => s::CodeList.external("407"),
            "BU"  => s::CodeList.external("407"),
            "BUR" => s::CodeList.external("971"),
            "BS"  => s::CodeList.external("133"),
            "DD"  => s::CodeList.external("131"),
            "DR"  => s::CodeList.external("229"),
            "EK"  => s::CodeList.external("407"),
            "GR"  => s::CodeList.external("284"),
            "GS"  => s::CodeList.external("407"),
            "GU"  => s::CodeList.external("407"),
            "GW"  => s::CodeList.external("407"),
            "HE"  => s::CodeList.external("411"),
            "HI"  => s::CodeList.external("121"),
            "HO"  => s::CodeList.external("537"),
            "JO"  => s::CodeList.external("135"),
            "JP"  => s::CodeList.external("135"),
            "LOI" => s::CodeList.external("663"),
            "NI"  => s::CodeList.external("284"), # or s::CodeList.external("407")
            "NUB" => s::CodeList.external("132"),
            "NDC" => s::CodeList.external("240"),
            "PR"  => s::CodeList.external("131"),
            "PB"  => s::CodeList.external("407"),
            "REC" => s::CodeList.external("860"),
            "RET" => s::CodeList.external("859"),
            "RM"  => s::CodeList.external("973"),
            "RX"  => s::CodeList.external("530"),
            "S"   => s::CodeList.external("327"),
            "SD"  => s::CodeList.external("131"),
            "SJ"  => s::CodeList.external("407"),
            "SL"  => s::CodeList.external("407"),
            "TC"  => s::CodeList.external("359"),
            "TD"  => s::CodeList.external("131"),
            "TQ"  => s::CodeList.external("135"),
            "UT"  => s::CodeList.external("528"),
            "ZZ"  => "Mutually Defined"))
        E1271 = t::AN.new(:E1271, "Industry Code"                        , 1, 30,
          s::CodeList.external("508"))
        E1330 = t::ID.new(:E1330, "Dosage Form Code"                     , 2, 3,
          s::CodeList.build(
            "10" => "Tablet",
            "20" => "Capsule",
            "30" => "Lozenge or Troche",
            "31" => "Internal Powder",
            "43" => "Injectable Lyophilized Powder",
            "60" => "Elixir",
            "61" => "Suspension",
            "62" => "Syrup",
            "63" => "Solution",
            "64" => "Emulsion",
            "67" => "Liquid",
            "69" => "Rectal Cream or Ointment",
            "70" => "Rectal Suppository",
            "71" => "Vaginal Suppository",
            "73" => "Vaginal Cream",
            "75" => "Urethral Suppository",
            "76" => "Enema",
            "78" => "Vaginal Ointment",
            "80" => "External Ointment",
            "81" => "External Cream",
            "86" => "External Powder"))
        E1303 = t::ID.new(:E1303, "Use of Language Indicator"            , 1, 2,
          s::CodeList.build(
            "5" => "Language Reading",
            "6" => "Language Writing",
            "7" => "Language Speaking",
            "8" => "Native Language"))
        E1314 = t::ID.new(:E1314, "Admission Source Code"                , 1, 1,
          s::CodeList.external("230"))
        E1315 = t::ID.new(:E1315, "Admission Type Code"                  , 1, 1,
          s::CodeList.external("231"))
        E1316 = t::ID.new(:E1316, "Ambulance Transport Code"             , 1, 1,
          s::CodeList.build(
            "I" => "Initial Trip",
            "R" => "Return Trip",
            "T" => "Transfer Trip",
            "X" => "Round Trip"))
        E1317 = t::ID.new(:E1317, "Ambulance Transport Reason Code"      , 1, 1,
          s::CodeList.build(
            "A" => "Patient was transported to nearest facility for care of symptoms, complaints, or both",
            "B" => "Patient was transported for the benefit of a preferred physician",
            "C" => "Patient was transported for the nearness of family members",
            "D" => "Patient was transported for the care of a specialist or for availability of specialized equipment",
            "E" => "Patient Transferred to Rehabilitation Facility"))
        E1321 = t::ID.new(:E1321, "Condition Indicator"                  , 2, 3,
          s::CodeList.build(
            "00"  => "Patient was transported in an emergency situation",
            "01"  => "Patient was admitted to a hospital",
            "02"  => "Patient was bed confined before the ambulance service",
            "03"  => "Patient was bed confined after the ambulance service",
            "04"  => "Patient was moved by stretcher",
            "05"  => "Patient was unconscious or in shock",
            "06"  => "Patient was transported in an emergency situation",
            "07"  => "Patient had to be physically restrained",
            "08"  => "Patient had visible hemorrhaging",
            "09"  => "Ambulance service was medically necessary",
            "10"  => "Patient is ambulatory",
            "11"  => "Ambulation is Impaired and Walking Aid is Used for Therapy or Mobility",
            "12"  => "Patient is confined to a bed or chair",
            "14"  => "Ambulation is Impaired and Walking Aid is Used for Mobility",
            "15"  => "Patient Condition Requires Positioning of the Body or Attachments Which Would Not be Feasible With the Use of an Ordinary Bed",
            "16"  => "Patient needs a trapeze bar to sit up due to respiratory condition or change body positions for other medical reasons",
            "17"  => "Patient's Ability to Breathe is Severely Impaired",
            "18"  => "Patient condition requires frequent and/or immediate changes in body positions",
            "19"  => "Patient can operate controls",
            "20"  => "Siderails Are to be Attached to a Hospital Bed Owned by the Beneficiary",
            "21"  => "Patient owns equipment",
            "22"  => "Mattress or Siderails are Being Used with Prescribed Medically Necessary Hospital Bed Owned by the Beneficiary",
            "23"  => "Patient Needs Lift to Get In or Out of Bed or to Assist in Transfer from Bed to Wheelchair",
            "24"  => "Patient has an orthopedic impairment requiring traction equipment which prevents ambulation during period of use",
            "25"  => "Item has been prescribed as part of a planned regimen of treatment in patient home",
            "27"  => "Patient or a care-giver has been instructed in use of equipment",
            "29"  => "A 6-7 hour nocturnal study documents 30 episodes of apnea each lasting more than 10 seconds",
            "30"  => "Without the equipment, the patient would require surgery",
            "31"  => "Patient has had a total knee replacement",
            "32"  => "Patient has intractable lymphedema of the extremities",
            "33"  => "Patient is in a nursing home",
            "35"  => "This Feeding is the Only Form of Nutritional Intake for This Patient",
            "37"  => "Oxygen delivery equipment is stationary",
            "38"  => "Certification signed by the physician is on file at the supplier's office",
            "39"  => "Patient Has Mobilizing Respiratory Tract Secretions",
            "40"  => "Patient or Caregiver is Capable of Using the Equipment Without Technical or Professional Supervision",
            "41"  => "Patient or Caregiver is Unable to Propel or Lift a Standard Weight Wheelchair",
            "42"  => "Patient Requires Leg Elevation for Edema or Body Alignment",
            "43"  => "Patient Weight or Usage Needs Necessitate a Heavy Duty Wheelchair",
            "44"  => "Patient Requires Reclining Function of a Wheelchair",
            "45"  => "Patient is Unable to Operate a Wheelchair Manually",
            "46"  => "Patient or Caregiver Requires Side Transfer into Wheelchair, Commode or Other",
            "58"  => "Durable Medical Equipment (DME) Purchased New",
            "59"  => "Durable Medical Equipment (DME) Is Under Warranty",
            "5A"  => "Treatment is rendered related to the terminal illness",
            "5P"  => "Replacement",
            "60"  => "Transportation Was To the Nearest Facility",
            "65"  => "Open",
            "68"  => "Severe",
            "69"  => "Moderate",
            "9D"  => "Lack of Appropriate Facility within Reasonable Distance to Treat Patient in the Event of Complications",
            "9E"  => "Sudden Onset of Disorientation",
            "9F"  => "Sudden Onset of Severe, Incapacitating Pain",
            "9H"  => "Patient Requires Intensive IV Therapy",
            "9J"  => "Patient Requires Protective Isolation",
            "9K"  => "Patient Requires Frequent Monitoring",
            "AA"  => "Amputation",
            "AL"  => "Ambulation Limitations",
            "ATR" => "Atrophy",
            "AV"  => "Available - Not Used",
            "BL"  => "Bowel Limitations, Bladder Limitations, or both (Incontinence)",
            "BPD" => "Beneficiary is Partially Dependent",
            "BTD" => "Beneficiary is Totally Dependent",
            "BR"  => "Bedrest BRP (Bathroom Privileges)",
            "CA"  => "Cane Required",
            "CB"  => "Complete Bedrest",
            "CM"  => "Comatose",
            "CNJ" => "Cumulative Injury",
            "CO"  => "Contracture",
            "CR"  => "Crutches Required",
            "DX"  => "Unable to Respond",
            "DY"  => "Dyspnea with Minimal Exertion",
            "EL"  => "Endurance Limitations",
            "EP"  => "Exercises Prescribed",
            "F3"  => "Inactive",
            "HL"  => "Hearing Limitations",
            "IH"  => "Independent at Home",
            "L1"  => "General Standard of 20 Degree or .5 Diopter Sphere or Cylinder Change Met",
            "L2"  => "Replacement Due to Loss or Theft",
            "L3"  => "Replacement Due to Breakage or Damage",
            "L4"  => "Replacement Due to Patient Preference",
            "L5"  => "Replacement Due to Medical Reason",
            "LB"  => "Legally Blind",
            "LE"  => "Lethargic",
            "NU"  => "Not Used",
            "NR"  => "No Restrictions",
            "OL"  => "Other Limitation",
            "PA"  => "Paralysis",
            "PAR" => "Paraplegia",
            "PW"  => "Partial Weight Bearing",
            "S2"  => "Under Treatment",
            "S9"  => "Atypical Functional Condition",
            "SL"  => "Speech Limitations",
            "ST"  => "New Services Requested",
            "TNJ" =>"Traumatic Injury",
            "TR"  => "Transfer to Bed, or Chair, or Both",
            "UT"  => "Up as Tolerated",
            "WA"  => "Walker Required",
            "WR"  => "Wheelchair Required",
            "ZV"  => "Replacement Item"))
        E1322 = t::ID.new(:E1322, "Certification Type Code"              , 1, 1,
          s::CodeList.build(
            "1" => "Appeal - Immediate",
            "2" => "Appeal - Standard",
            "3" => "Cancel",
            "4" => "Extension",
            "I" => "Initial",
            "N" => "Reconsideration",
            "R" => "Renewal",
            "S" => "Revised"))
        E1325 = t::ID.new(:E1325, "Claim Frequency Type Code"            , 1, 1,
          s::CodeList.external("235"))
        E1327 = t::ID.new(:E1327, "Copay Status Code"                    , 1, 1,
          s::CodeList.build(
            "0" => "Copay exempt"))
        E1328 = t::Nn.new(:E1328, "Diagnosis Code Pointer"               , 1, 2, 0)
        E1331 = t::AN.new(:E1331, "Facility Code Value"                  , 1, 2)
          # S237
        E1332 = t::ID.new(:E1332, "Facility Code Qualifier"              , 1, 2,
          s::CodeList.build(
            "A" => s::CodeList.external("236"),
            "B" => s::CodeList.external("237")))
        E1333 = t::ID.new(:E1333, "Record Format Code"                   , 1, 2)
        E1334 = t::ID.new(:E1334, "Professional Shortage Area Code"      , 1, 1)
        E1335 = t::ID.new(:E1335, "Insulin Type Code"                    , 1, 3)
        E1336 = t::ID.new(:E1336, "Insurance Type Code"                  , 1, 3,
          s::CodeList.build(
            "02" => "Physically Handicapped Children's Program",
            "03" => "Special Federal Funding",
            "05" => "Disability",
            "09" => "Second Opinion or Surgery",
            "12" => "Medicare Secondary Working Aged Beneficiary or Spouse with Employer Group Health Plan",
            "13" => "Medicare Secondary End-Stage Renal Disease Beneficiary in the Mandated Coordination Period",
            "14" => "Medicare Secondary, No-fault Insurance including Auto is Primary",
            "15" => "Medicare Secondary Worker's Compensation",
            "16" => "Medicare Secondary Public Health Service (PHS) or Other Federal Agency",
            "41" => "Medicare Secondary Black Lung",
            "42" => "Medicare Secondary Veteran's Administration",
            "43" => "Medicare Secondary Disabled Beneficiary Under Age 65 with Large Group Health Plan (LGHP)",
            "47" => "Medicare Secondary, Other Liability Insurance is Primary",
            "AP" => "Auto Insurance Policy",
            "C1" => "Commercial",
            "CO" => "Consolidated Omnibus Budget Reconciliation Act (COBRA)",
            "CP" => "Medicare Conditionally Primary",
            "D"  => "Disability",
            "DB" => "Disability Benefits",
            "EP" => "Exclusive Provider Organization",
            "FF" => "Family or Friends",
            "GP" => "Group Policy",
            "HM" => "Health Maintenance Organization (HMO)",
            "HN" => "Health Maintenance Organization (HMO) - Medicare Risk",
            "HS" => "Special Low Income Medicare Beneficiary",
            "IN" => "Indemnity",
            "IP" => "Individual Policy",
            "LC" => "Long Term Care",
            "LD" => "Long Term Policy",
            "LI" => "Life Insurance",
            "LT" => "Litigation",
            "MA" => "Medicare Part A",
            "MB" => "Medicare Part B",
            "MC" => "Medicaid",
            "MH" => "Medigap Part A",
            "MI" => "Medigap Part B",
            "MP" => "Medicare Primary",
            "OT" => "Other",
            "PE" => "Property Insurance - Personal",
            "PL" => "Personal",
            "PP" => "Personal Payment (Cash - No Insurance)",
            "PR" => "Preferred Provider Organization (PPO)",
            "PS" => "Point of Service (POS)",
            "QM" => "Qualified Medicare Beneficiary",
            "RP" => "Property Insurance - Real",
            "SP" => "Supplemental Policy",
            "TF" => "Tax Equity Fiscal Responsibility Act (TEFRA)",
            "WC" => "Workers Compensation",
            "WU" => "Wrap Up Policy"))
        E1337 = t::ID.new(:E1337, "Level of Care Code"                   , 1, 1,
          s::CodeList.build(
            "1" => "Skilled Nursing Facility (SNF)",
            "2" => "Intermediate Care Facility (ICF)",
            "3" => "Intermediate Care Facility - Mentally Retarded (ICF-MR)",
            "4" => "Chronic Disease Hospital (CD)",
            "5" => "Intermediate Care Facility (ICF) Level II",
            "6" => "Special Skilled Nursing Facility (SNF)",
            "7" => "Nursing Facility (NF)",
            "8" => "Hospice"))
        E1338 = t::ID.new(:E1338, "Level of Service Code"                , 1, 3)
        E1339 = t::AN.new(:E1339, "Procedure Modifier"                   , 2, 2)
        E1340 = t::ID.new(:E1340, "Multiple Procedure Code"              , 1, 2)
        E1341 = t::AN.new(:E1341, "National or Local Assigned Review"    , 1, 2)
        E1342 = t::ID.new(:E1342, "Nature of Condition Code"             , 1, 1,
          s::CodeList.build(
            "A" => "Acute Condition",
            "C" => "Chronic Condition",
            "D" => "Non-acute",
            "E" => "Non-Life Threatening",
            "F" => "Routine",
            "G" => "Symptomatic",
            "M" => "Acute Manifestation of a Chronic Condition"))
        E1343 = t::ID.new(:E1343, "Non-Institutional Claim Type Code"    , 1, 2)
        E1345 = t::ID.new(:E1345, "Nursing Home Residential Status Code" , 1, 1)
        E1348 = t::ID.new(:E1348, "Oxygen Equipment Type Code"           , 1, 1,
          s::CodeList.build(
            "A" => "Concentrator",
            "B" => "Liquid Stationary",
            "C" => "Gaseous Stationary",
            "D" => "Liquid Portable",
            "E" => "Gaseous Portable",
            "O" => "Other"))
        E1351 = t::ID.new(:E1351, "Patient Signature Source Code"        , 1, 1,
          s::CodeList.build(
            "P" => "Signature generated by provider because the patient was not physically present for services"))
        E1352 = t::ID.new(:E1352, "Patient Status Code"                  , 1, 2,
          s::CodeList.external("239"))
        E1354 = t::ID.new(:E1354, "Diagnosis Related Group (DRG) Code"   , 1, 4,
          s::CodeList.external("229"))
        E1358 = t::ID.new(:E1358, "Prosthesis, Crown, or Inlay Code"     , 1, 1,
          s::CodeList.build(
            "I" => "Initial Placement",
            "R" => "Replacement"))
        E1359 = t::ID.new(:E1359, "Provider Accept Assignment Code"      , 1, 1,
          s::CodeList.build(
            "A" => "Assigned",
            "B" => "Assigned Accepted on Clinical Lab Services Only",
            "C" => "Not Assigned"))
        E1360 = t::ID.new(:E1360, "Provider Agreement Code"              , 1, 1)
        E1361 = t::ID.new(:E1361, "Oral Cavity Designation Code"         , 1, 3,
          s::CodeList.external("135"))
        E1362 = t::ID.new(:E1362, "Related-Causes Code"                  , 2, 3,
          s::CodeList.build(
            "AA" => "Auto Accident",
            "EM" => "Employment",
            "OA" => "Other Accident"))
        E1363 = t::ID.new(:E1363, "Release of Information Code"          , 1, 1,
          s::CodeList.build(
            "I" => "Informed Consent to Release Medical Information for Conditions or Diagnoses Regulated by Federal Statutes",
            "Y" => "Yes, Provider has a Signed Statement Permitting Release of Medical Billing Data Related to a Claim"))
        E1364 = t::ID.new(:E1364, "Review Code"                          , 1, 2)
        E1365 = t::ID.new(:E1365, "Service Type Code"                    , 1, 2,
          s::CodeList.build(
            "1"  => "Medical Care",
            "2"  => "Surgical",
            "3"  => "Consultation",
            "4"  => "Diagnostic X-Ray",
            "5"  => "Diagnostic Lab",
            "6"  => "Radiation Therapy",
            "7"  => "Anesthesia",
            "8"  => "Surgical Assistance",
            "9"  => "Other Medical",
            "10" => "Blood Charges",
            "11" => "Used Durable Medical Equipment",
            "12" => "Durable Medical Equipment Purchase",
            "13" => "Ambulatory Service Center Facility",
            "14" => "Renal Supplies in the Home",
            "15" => "Alternate Method Dialysis",
            "16" => "Chronic Renal Disease (CRD) Equipment",
            "17" => "Pre-Admission Testing",
            "18" => "Durable Medical Equipment Rental",
            "19" => "Pneumonia Vaccine",
            "20" => "Second Surgical Opinion",
            "21" => "Third Surgical Opinion",
            "22" => "Social Work",
            "23" => "Diagnostic Dental",
            "24" => "Periodontics",
            "25" => "Restorative",
            "26" => "Endodontics",
            "27" => "Maxillofacial Prosthetics",
            "28" => "Adjunctive Dental Services",
            "30" => "Health Benefit Plan Coverage",
            "32" => "Plan Waiting Period",
            "33" => "Chiropractic",
            "34" => "Chiropractic Office Visits",
            "35" => "Dental Care",
            "36" => "Dental Crowns",
            "37" => "Dental Accident",
            "38" => "Orthodontics",
            "39" => "Prosthodontics",
            "40" => "Oral Surgery",
            "41" => "Routine (Preventive) Dental",
            "42" => "Home Health Care",
            "43" => "Home Health Prescriptions",
            "44" => "Home Health Visits",
            "45" => "Hospice",
            "46" => "Respite Care",
            "47" => "Hospital",
            "48" => "Hospital - Inpatient",
            "49" => "Hospital - Room and Board",
            "50" => "Hospital - Outpatient",
            "51" => "Hospital - Emergency Accident",
            "52" => "Hospital - Emergency Medical",
            "53" => "Hospital - Ambulatory Surgical",
            "54" => "Long Term Care",
            "55" => "Major Medical",
            "56" => "Medically Related Transportation",
            "57" => "Air Transportation",
            "58" => "Cabulance",
            "59" => "Licensed Ambulance",
            "60" => "General Benefits",
            "61" => "In-vitro Fertilization",
            "62" => "MRI/CAT Scan",
            "63" => "Donor Procedures",
            "64" => "Acupuncture",
            "65" => "Newborn Care",
            "66" => "Pathology",
            "67" => "Smoking Cessation",
            "68" => "Well Baby Care",
            "69" => "Maternity",
            "70" => "Transplants",
            "71" => "Audiology Exam",
            "72" => "Inhalation Therapy",
            "73" => "Diagnostic Medical",
            "74" => "Private Duty Nursing",
            "75" => "Prosthetic Device",
            "76" => "Dialysis",
            "77" => "Otological Exam",
            "78" => "Chemotherapy",
            "79" => "Allergy Testing",
            "80" => "Immunizations",
            "AN" => "Routine Exam",
            "AO" => "Lenses",
            "AQ" => "Nonmedically Necessary Physical",
            "AR" => "Experimental Drug Therapy",
            "B1" => "Burn Care",
            "B2" => "Brand Name Prescription Drug - Formulary",
            "B3" => "Brand Name Prescription Drug - Non-Formulary",
            "BA" => "Independent Medical Evaluation",
            "BB" => "Partial Hospitalization (Psychiatric)",
            "BC" => "Day Care (Psychiatric)",
            "BD" => "Cognitive Therapy",
            "BE" => "Massage Therapy",
            "BF" => "Pulmonary Rehabilitation",
            "BG" => "Cardiac Rehabilitation",
            "BH" => "Pediatric",
            "BI" => "Nursery",
            "BJ" => "Skin",
            "BK" => "Orthopedic",
            "BL" => "Cardiac",
            "BM" => "Lymphatic",
            "BN" => "Gastrointestinal",
            "BP" => "Endocrine",
            "BQ" => "Neurology",
            "BR" => "Eye",
            "BS" => "Invasive Procedures",
            "BT" => "Gynecological",
            "BU" => "Obstetrical",
            "BV" => "Obstetrical/Gynecological",
            "BW" => "Mail Order Prescription Drug: Brand Name",
            "BX" => "Mail Order Prescription Drug: Generic",
            "BY" => "Physician Visit - Office: Sick",
            "BZ" => "Physician Visit - Office: Well",
            "C1" => "Coronary Care",
            "CA" => "Private Duty Nursing - Inpatient",
            "CB" => "Private Duty Nursing - Home",
            "CC" => "Surgical Benefits - Professional (Physician)",
            "CD" => "Surgical Benefits - Facility",
            "CE" => "Mental Health Provider - Inpatient",
            "CF" => "Mental Health Provider - Outpatient",
            "CG" => "Mental Health Facility - Inpatient",
            "CH" => "Mental Health Facility - Outpatient",
            "CI" => "Substance Abuse Facility - Inpatient",
            "CJ" => "Substance Abuse Facility - Outpatient",
            "81" => "Routine Physical",
            "82" => "Family Planning",
            "83" => "Infertility",
            "84" => "Abortion",
            "85" => "AIDS",
            "86" => "Emergency Services",
            "87" => "Cancer",
            "88" => "Pharmacy",
            "89" => "Free Standing Prescription Drug",
            "90" => "Mail Order Prescription Drug",
            "91" => "Brand Name Prescription Drug",
            "92" => "Generic Prescription Drug",
            "93" => "Podiatry",
            "94" => "Podiatry - Office Visits",
            "95" => "Podiatry - Nursing Home Visits",
            "96" => "Professional (Physician)",
            "97" => "Anesthesiologist",
            "98" => "Professional (Physician) Visit - Office",
            "99" => "Professional (Physician) Visit - Inpatient",
            "A0" => "Professional (Physician) Visit - Outpatient",
            "A1" => "Professional (Physician) Visit - Nursing Home",
            "A2" => "Professional (Physician) Visit - Skilled Nursing Facility",
            "A3" => "Professional (Physician) Visit - Home",
            "A4" => "Psychiatric",
            "A5" => "Psychiatric - Room and Board",
            "A6" => "Psychotherapy",
            "A7" => "Psychiatric - Inpatient",
            "A8" => "Psychiatric - Outpatient",
            "A9" => "Rehabilitation",
            "AA" => "Rehabilitation - Room and Board",
            "AB" => "Rehabilitation - Inpatient",
            "AC" => "Rehabilitation - Outpatient",
            "AD" => "Occupational Therapy",
            "AE" => "Physical Medicine",
            "AF" => "Speech Therapy",
            "AG" => "Skilled Nursing Care",
            "AH" => "Skilled Nursing Care - Room and Board",
            "AI" => "Substance Abuse",
            "AJ" => "Alcoholism",
            "AK" => "Drug Addiction",
            "AL" => "Vision (Optometry)",
            "AM" => "Frames",
            "CK" => "Screening X-ray",
            "CL" => "Screening laboratory",
            "CM" => "Mammogram, High Risk Patient",
            "CN" => "Mammogram, Low Risk Patient",
            "CO" => "Flu Vaccination",
            "CP" => "Eyewear and Eyewear Accessories",
            "CQ" => "Case Management",
            "DG" => "Dermatology",
            "DM" => "Durable Medical Equipment",
            "DS" => "Diabetic Supplies",
            "GF" => "Generic Prescription Drug - Formulary",
            "GN" => "Generic Prescription Drug - Non-Formulary",
            "GY" => "Allergy",
            "IC" => "Intensive Care",
            "MH" => "Mental Health",
            "NI" => "Neonatal Intensive Care",
            "ON" => "Oncology",
            "PT" => "Physical Therapy",
            "PU" => "Pulmonary",
            "RN" => "Renal",
            "RT" => "Residential Psychiatric Treatment",
            "TC" => "Transitional Care",
            "TN" => "Transitional Nursery Care",
            "UC" => "Urgent Care"))
        E1366 = t::ID.new(:E1366, "Special Program Code"                 , 2, 3,
          s::CodeList.build(
            "01" => "Early & Periodic Screening, Diagnosis, and Treatment (EPSDT) or Child Health Assessment Program (CHAP)",
            "02" => "Physically Handicapped Children's Program",
            "03" => "Special Federal Funding",
            "05" => "Disability",
            "09" => "Second Opinion or Surgery"))
        E1367 = t::ID.new(:E1367, "Sublaxation Level Code"               , 2, 3,
          s::CodeList.build(
            "C1"  => "Cervical 1",
            "C2"  => "Cervical 2",
            "C3"  => "Cervical 3",
            "C4"  => "Cervical 4",
            "C5"  => "Cervical 5",
            "C6"  => "Cervical 6",
            "C7"  => "Cervical 7",
            "CO"  => "Coccyx",
            "IL"  => "Ilium",
            "L1"  => "Lumbar 1",
            "L2"  => "Lumbar 2",
            "L3"  => "Lumbar 3",
            "L4"  => "Lumbar 4",
            "OC"  => "Occiput",
            "SA"  => "Sacrum",
            "T1"  => "Thoracic 1",
            "T10" => "Thoracic 10",
            "T11" => "Thoracic 11",
            "T12" => "Thoracic 12",
            "T2" => "Thoracic 2",
            "T3" => "Thoracic 3",
            "T4" => "Thoracic 4",
            "T5" => "Thoracic 5",
            "T6" => "Thoracic 6",
            "T7" => "Thoracic 7",
            "T8" => "Thoracic 8",
            "T9" => "Thoracic 9"))
        E1368 = t::ID.new(:E1368, "Tooth Status Code"                    , 1, 2,
          s::CodeList.build(
            "E" => "To Be Extracted",
            "I" => "Impacted",
            "M" => "Missing",
            "X" => "Extracted"))
        E1369 = t::ID.new(:E1369, "Tooth Surface Code"                   , 1, 2,
          s::CodeList.build(
            "B" => "Buccal",
            "D" => "Distal",
            "F" => "Facial",
            "I" => "Incisal",
            "L" => "Lingual",
            "M" => "Mesial",
            "O" => "Occlusal"))
        E1371 = t:: R.new(:E1371, "Unit Rate"                            , 1, 10)
        E1382 = t::ID.new(:E1382, "Oxygen Delivery System Code"          , 1, 1,
          s::CodeList.build(
            "A" => "Nasal Cannula",
            "B" => "Oxygen Conserving Device",
            "C" => "Oxygen Conserving Device with Oxygen Pulse System",
            "D" => "Oxygen Conserving Device with Resevoir System",
            "E" => "Transtrachael Catheter"))
        E1383 = t::ID.new(:E1383, "Claim Submission Reason Code"         , 2, 2,
          s::CodeList.build(
            "08" => "@todo",
            "PB" => "Predetermination of Dental Benefits"))
        E1384 = t::ID.new(:E1384, "Patient Location Code"                , 1, 1)
        E1390 = t::ID.new(:E1390, "Eligibility or Benefit Information Code", 1, 2,
          s::CodeList.build(
            "1"  => "Active Coverage",
            "2"  => "Active - Full Risk Capitation",
            "3"  => "Active - Services Capitated",
            "4"  => "Active - Services Capitated to Primary Care Physician",
            "5"  => "Active - Pending Investigation",
            "6"  => "Inactive",
            "7"  => "Inactive - Pending Eligibility Update",
            "8"  => "Inactive - Pending Investigation",
            "A"  => "Co-Insurance",
            "B"  => "Co-Payment",
            "C"  => "Deductible",
            "CB" => "Coverage Basis",
            "D"  => "Benefit Description",
            "E"  => "Exclusions",
            "F"  => "Limitations",
            "G"  => "Out of Pocket (Stop Loss)",
            "H"  => "Unlimited",
            "I"  => "Non-Covered",
            "J"  => "Cost Containment",
            "K"  => "Reserve",
            "L"  => "Primary Care Provider",
            "M"  => "Pre-existing Condition",
            "MC" => "Managed Care Coordinator",
            "N"  => "Services Restricted to Following Provider",
            "O"  => "Not Deemed a Medical Necessity",
            "P"  => "Benefit Disclaimer",
            "Q"  => "Second Surgical Opinion Required",
            "R"  => "Other or Additional Payor",
            "S"  => "Prior Year(s) History",
            "T"  => "Card(s) Reported Lost/Stolen",
            "U"  => "Contact Following Entity for Eligibility or Benefit Information",
            "V"  => "Cannot Process",
            "W"  => "Other Source of Data",
            "X"  => "Health Care Facility",
            "Y"  => "Spend Down"))
        E1403 = t::ID.new(:E1403, "Implant Type Code"                    , 1, 1,
          s::CodeList.build(
            "1" => "Pulse Generator",
            "2" => "Arterial Lead",
            "3" => "Ventricular Lead",
            "4" => "Implantable Cardioverter Defibrillator (ICDs)",
            "5" => "Implantable Cardiac Pacemaker (ICPs)",
            "6" => "Cardiac Resynchronization Therapy Devices (CRTs)",
            "7" => "Pacing Leads",
            "8" => "Pacing Battery",
            "9" => "Coronary Stent",
            "A" => "Peripheral Stent",
            "B" => "Heart Valve",
            "C" => "Ventricular-Assist Device",
            "D" => "Implantable Heart Monitor",
            "E" => "Knee",
            "F" => "Hip",
            "G" => "Shoulder",
            "H" => "Elbow",
            "I" => "Ankle",
            "J" => "Toe",
            "K" => "Finger",
            "L" => "Spinal",
            "M" => "Orthobiologic",
            "N" => "Tissue",
            "O" => "Facial",
            "P" => "Dental",
            "Q" => "Opthalmic",
            "R" => "Gynecologic",
            "S" => "Urogynecologic",
            "T" => "Drug",
            "U" => "Otolaryngeal",
            "V" => "Cochlear",
            "W" => "Cosmetic",
            "X" => "Gastroenterologic",
            "Y" => "Urologic",
            "Z" => "Other"))
        E1401 = t::ID.new(:E1401, "Implant Status Code"                  , 1, 1,
          s::CodeList.build(
            "1" => "Implanted",
            "2" => "Explanted"))
        E1470 = t::Nn.new(:E1470, "Number"                               , 1, 9, 0)
        E1473 = t::ID.new(:E1473, "Pricing Methodology"                  , 2, 2,
          s::CodeList.build(
            "00" => "Zero Pricing (Not Covered Under Contract)",
            "01" => "Priced as Billed at 100%",
            "02" => "Priced at the Standard Fee Schedule",
            "03" => "Priced at a Contractual Percentage",
            "04" => "Bundled Pricing",
            "05" => "Peer Review Pricing",
            "06" => "Per Diem Pricing",
            "07" => "Flat Rate Pricing",
            "08" => "Combination Pricing",
            "09" => "Maternity Pricing",
            "10" => "Other Pricing",
            "11" => "Lower of Cost",
            "12" => "Ratio of Cost",
            "13" => "Cost Reimbursed",
            "14" => "Adjustment Pricing"))
        E1476 = t::ID.new(:E1476, "Language Proficiency Indicator"       , 1, 1)
        E1514 = t::ID.new(:E1514, "Delay Reason Code"                    , 1, 2,
          s::CodeList.build(
            "1"  => "Proof of Eligibility Unknown or Unavailable",
            "2"  => "Litigation",
            "3"  => "Authorization Delays",
            "4"  => "Delay in Certifying Provider",
            "5"  => "Delay in Shipping Billing Forms",
            "6"  => "Delay in Delivery of Custom-made Appliances",
            "7"  => "Third Party Processing Delay",
            "8"  => "Delay in Eligibility Determination",
            "9"  => "Original Claim Rejected or Denied Due to a Reason Unrelated to the Billing Limitation Rules",
            "10" => "Administration Delay in the Prior Approval Process",
            "11" => "Other",
            "15" => "Natural Disaster"))
        E1525 = t::ID.new(:E1525, "Request Category Code"                , 1, 2,
          s::CodeList.build(
            "AR" => "Admission Review",
            "HS" => "Health Services Review",
            "IN" => "Individual",
            "SC" => "Specialty Care Review"))
        E1526 = t::ID.new(:E1526, "Policy Compliance Code"               , 1, 2,
          s::CodeList.build(
            "1" => "Procedure Followed (Compliance)",
            "2" => "Not Followed - Call Not Made (Non-Compliance Call Not Made)",
            "3" => "Not Medically Necessary (Non-Compliance Non-Medically Necessary)",
            "4" => "Not Followed Other (Non-Compliance Other)",
            "5" => "Emergency Admit to Non-Network Hospital"))
        E1527 = t::ID.new(:E1527, "Exception Code"                       , 1, 2,
          s::CodeList.build(
            "1" => "Non-Network Professional Provider in Network Hospital",
            "2" => "Emergency Care",
            "3" => "Services or Specialist not in Network",
            "4" => "Out-of-Service Area",
            "5" => "State Mandates",
            "6" => "Other"))
        E1528 = t::Nn.new(:E1528, "Component Data Element Position in Composite", 1, 2, 0)
        E1595 = t::ID.new(:E1595, "Government Service Affilition Code"   , 1, 1,
          s::CodeList.build(
            "A" => "Air Force",
            "B" => "Air Force Reserves",
            "C" => "Army",
            "D" => "Army Reserves",
            "E" => "Coast Guard",
            "F" => "Marine Corps",
            "G" => "Marine Corps Reserves",
            "H" => "National Guard",
            "I" => "Navy",
            "J" => "Navy Reserves",
            "K" => "Other",
            "L" => "Peace Corp",
            "M" => "Regular Armed Forces",
            "N" => "Reserves",
            "O" => "U.S. Public Health Service",
            "Q" => "Foreign Military",
            "R" => "American Red Cross",
            "S" => "Department of Defense",
            "U" => "United Services Organization",
            "W" => "Military Sealift Command"))
        E1596 = t::ID.new(:E1596, "Military Service Rank"                , 1, 1,
          s::CodeList.build(
            "A1" => "Admiral",
            "A2" => "Airman",
            "A3" => "Airman First Class",
            "B1" => "Basic Airman",
            "B2" => "Brigadier General",
            "C1" => "Captain",
            "C2" => "Chief Master Sergeant",
            "C3" => "Chief Petty Officer",
            "C4" => "Chief Warrant",
            "C5" => "Colonel",
            "C6" => "Commander",
            "C7" => "Commodore",
            "C8" => "Corporal",
            "C9" => "Corporal Specialist 4",
            "E1" => "Ensign",
            "F1" => "First Lieutenant",
            "F2" => "First Sergeant",
            "F3" => "First Sergeant-Master Sergeant",
            "F4" => "Fleet Admiral",
            "G1" => "General",
            "G4" => "Gunnery Sergeant",
            "L1" => "Lance Corporal",
            "L2" => "Lieutenant",
            "L3" => "Lieutenant Colonel",
            "L4" => "Lieutenant Commander",
            "L5" => "Lieutenant General",
            "L6" => "Lieutenant Junior Grade",
            "M1" => "Major",
            "M2" => "Major General",
            "M3" => "Master Chief Petty Officer",
            "M4" => "Master Gunnery Sergeant Major",
            "M5" => "Master Sergeant",
            "M6" => "Master Sergeant Specialist 8",
            "P1" => "Petty Officer First Class",
            "P2" => "Petty Officer Second Class",
            "P3" => "Petty Officer Third Class",
            "P4" => "Private",
            "P5" => "Private First Class",
            "R1" => "Rear Admiral",
            "R2" => "Recruit",
            "S1" => "Seaman",
            "S2" => "Seaman Apprentice",
            "S3" => "Seaman Recruit",
            "S4" => "Second Lieutenant",
            "S5" => "Senior Chief Petty Officer",
            "S6" => "Senior Master Sergeant",
            "S7" => "Sergeant",
            "S8" => "Sergeant First Class Specialist 7",
            "S9" => "Sergeant Major Specialist 9",
            "SA" => "Sergeant Specialist 5",
            "SB" => "Staff Sergeant",
            "SC" => "Staff Sergeant Specialist 6",
            "T1" => "Technical Sergeant",
            "V1" => "Vice Admiral",
            "W1" => "Warrant Officer"))
        E1686 = t::Nn.new(:E1686, "Repeating Data Element Position"      , 1, 4, 0)
        E1701 = t::ID.new(:E1701, "Eligibility Reason Code"              , 1, 1,
          s::CodeList.build(
            "0" => "Age",
            "1" => "Disability",
            "2" => "End Stage Renal Disease (ESRD)"))
        E1705 = t::AN.new(:E1705, "Implementation Convention Reference"  , 1, 35)
        E1715 = t::ID.new(:E1715, "Country Subdivision Code"             , 1, 3,
          s::CodeList.external("5"))
        # E1773 = t::ID.new(:E1774, "Claim Authorization Code"             , 1, 2,
        #   s::CodeList.build(
        #     "1" => "Immediate/Urgent Care",
        #     "2" => "Services Rendered in a Retroactive Period",
        #     "3" => "Emergency Care",
        #     "4" => "Client Has Temporary Medicaid",
        #     "5" => "Request from County for Second Opinion to Determine if Recipient Can Work",
        #     "6" => "Request for Override Pending",
        #     "7" => "Special Handling",
        #     "Z" => "Mutually Defined"))
        E9998 = t::AN.new(:E9998, "Context Reference"                    , 1, 35)
        E9999 = t::AN.new(:E9999, "Context Name"                         , 1, 35)

        C001 = Schema::CompositeElementDef.build(:C001,
          "Composite Unit of Measure",
          "To identify a composite unit of measure",
          E355 .component_use(r::Mandatory),
          E1018.component_use(r::Optional),
          E649 .component_use(r::Optional),
          E355 .component_use(r::Optional),
          E1018.component_use(r::Optional),
          E649 .component_use(r::Optional),
          E355 .component_use(r::Optional),
          E1018.component_use(r::Optional),
          E649 .component_use(r::Optional),
          E355 .component_use(r::Optional),
          E1018.component_use(r::Optional), # If not used, value is interpreted as 1
          E649 .component_use(r::Optional), # If not used, value is interpreted as 1
          E355 .component_use(r::Optional),
          E1018.component_use(r::Optional), # If not used, value is interpreted as 1
          E649 .component_use(r::Optional)) # If not used, value is interpreted as 1

        # @note Copied from an unverified internet source
        C002 = Schema::CompositeElementDef.build(:C002,
          "Actions Indicated",
          "",
          E704.component_use(r::Mandatory),
          E704.component_use(r::Optional),
          E704.component_use(r::Optional),
          E704.component_use(r::Optional),
          E704.component_use(r::Optional))
        C003 = Schema::CompositeElementDef.build(:C003,
          "Composite Medical Procedure Identifier",
          "To identify a procedure by its standardized codes and applicable modifiers",
          E235 .component_use(r::Mandatory),
          E234 .component_use(r::Mandatory), # Qualified by C003-01
          E1339.component_use(r::Optional),
          E1339.component_use(r::Optional),
          E1339.component_use(r::Optional),
          E1339.component_use(r::Optional),
          E352 .component_use(r::Optional),
          E234 .component_use(r::Optional)) # Qualified by C003-01
        C004 = Schema::CompositeElementDef.build(:C004,
          "Composite Diagnosis Code Pointer",
          "To identify one or more diagnosis code pointers",
          E1328.component_use(r::Mandatory),
          E1328.component_use(r::Optional),
          E1328.component_use(r::Optional),
          E1328.component_use(r::Optional))
        C005 = Schema::CompositeElementDef.build(:C005,
          "Tooth Surface",
          "To identify one or more tooth surface codes",
          E1369.component_use(r::Mandatory),
          E1369.component_use(r::Optional),
          E1369.component_use(r::Optional),
          E1369.component_use(r::Optional),
          E1369.component_use(r::Optional))
        C006 = Schema::CompositeElementDef.build(:C006,
          "Oral Cavity Designation",
          "To identify one or more areas of oral cavity",
          E1361.component_use(r::Mandatory),
          E1361.component_use(r::Optional),
          E1361.component_use(r::Optional),
          E1361.component_use(r::Optional),
          E1361.component_use(r::Optional))
        C022 = Schema::CompositeElementDef.build(:C022,
          "Health Care Code Information",
          "To send health care codes and their associated dates, amounts and quantities",
          E1270.component_use(r::Mandatory),
          E1271.component_use(r::Mandatory),
          E1250.component_use(r::Relational),
          E1251.component_use(r::Relational),
          E782 .component_use(r::Optional),
          E380 .component_use(r::Optional),
          E799 .component_use(r::Optional),
          E1271.component_use(r::Relational),
          E1073.component_use(r::Relational),
          SyntaxNotes::P.build(3, 4),
          SyntaxNotes::E.build(8, 9))
        C023 = Schema::CompositeElementDef.build(:C023,
          "Health Care Service Location Information",
          "To provide information that identifies the place of service or the type of bill related to the location at which a health care service was rendered",
          E1331 .component_use(r::Mandatory),
          E1332 .component_use(r::Optional),
          E1325 .component_use(r::Optional))
        C024 = Schema::CompositeElementDef.build(:C024,
          "Related Causes Information",
          "To identify one or more related causes and associated state or country information",
          E1362.component_use(r::Mandatory),
          E1362.component_use(r::Optional),
          E1362.component_use(r::Optional),
          E156 .component_use(r::Optional),
          E26  .component_use(r::Optional))
        C030 = Schema::CompositeElementDef.build(:C030,
          "Position in Segment",
          "Code indicating the relative position of the simple data element or composite data structure in error within a segment, count beginning with 1 for the position immediately following the segment ID; additionally, indicating the relative position of a repeating structure in error, count beginning with 1 for the position immediately following the preceding element separator; additionally indicating the relative position of a component of a composite data structure in error, count beginning with 1 for the position following the preceding element or repetition separator",
          E722 .component_use(r::Mandatory),
          E1528.component_use(r::Optional),
          E1686.component_use(r::Optional))

        # @note Copied from an unverified source
        C035 = Schema::CompositeElementDef.build(:C035,
          "Provider Specialty Information",
          "",
          E1222.component_use(r::Mandatory),
          E559 .component_use(r::Optional),
          E1073.component_use(r::Optional))
        C040 = Schema::CompositeElementDef.build(:C040,
          "Reference Identifier",
          "To identify one or more reference numbers or identification numbers as specified by the Reference Qualifier",
          E128 .component_use(r::Mandatory),
          E127 .component_use(r::Mandatory),
          E128 .component_use(r::Relational),
          E127 .component_use(r::Relational),
          E128 .component_use(r::Relational),
          E127 .component_use(r::Relational),
          SyntaxNotes::P.build(3, 4),
          SyntaxNotes::P.build(5, 6))
        C042 = Schema::CompositeElementDef.build(:C042,
          "Adjustment Identifier",
          "To provide the category and identifying reference information for an adjustment",
          E426 .component_use(r::Mandatory),
          E127 .component_use(r::Optional))
        C043 = Schema::CompositeElementDef.build(:C043,
          "Health Care Claim Status",
          "Used to convey status of the entire claim or a specific service line",
          E1271.component_use(r::Mandatory),
          E1271.component_use(r::Mandatory),
          E98  .component_use(r::Optional),
          E1270.component_use(r::Optional))

        # @note Copied from unverified source
        C052 = Schema::CompositeElementDef.build(:C052,
          "Medicare Status Code",
          "To provide Medicare coverage and associated reason for Medicare eligibility",
          E1218.component_use(r::Mandatory),
          E1701.component_use(r::Optional),
          E1701.component_use(r::Optional),
          E1701.component_use(r::Optional))
        C056 = Schema::CompositeElementDef.build(:C056,
          "Composite Race or Ethnicity Information",
          "",
          E1109.component_use(r::Optional),
          E1270.component_use(r::Relational),
          E1271.component_use(r::Relational))
        C998 = Schema::CompositeElementDef.build(:C998,
          "Context Identification",
          "Holds information to identify a context",
          E9999.component_use(r::Mandatory),
          E9998.component_use(r::Optional))
        C999 = Schema::CompositeElementDef.build(:C999,
          "Reference in Segment",
          "To hold the reference number of a data element and optionally component data element within a composite",
          E725.component_use(r::Mandatory),
          E725.component_use(r::Mandatory))
      end
    end
  end
end
