Ejemplo n.º 1
0
class RequestValidation(X12SegmentBridge):
    valid_request = ElementAccess("AAA", 1, x12type=boolean("Y"))
    reject_reason = ElementAccess("AAA", 3, x12type=enum(reject_reason_code))
    follow_up_action_code = ElementAccess(
        "AAA",
        4,
        x12type=enum({
            "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"
        }))
Ejemplo n.º 2
0
class Institutional_ClaimDetails(ClaimDetails):
    """Institutional Claim Details from the 2300 Loop."""
    fmt = ElementAccess("DTP", 2)
    stmtDts = ElementAccess("DTP", 3, qualifier=(1, "434"))
    admsDt = ElementAccess("DTP", 3, qualifier=(1, "435"))
    dischHr = ElementAccess("DTP", 3, qualifier=(1, "096"))
    billNote = ElementAccess("NTE", 2, qualifier=(1, "ADD"))
    # Non-"ADD" "NTE" segments are claim notes -- legacy uses an array of up to 10.
    # Only for institutional claims.
    claimNotes = ElementSequenceAccess("NTE",
                                       2,
                                       qualPos=1,
                                       notInList=("ADD", ))

    # DR Composite (Diagnosis Related Group (DRG) Information)
    drg = CompositeAccess("HI", "DR", 1)
    # BP/BR Composite (Principal Procedure Information)
    prinProcCode = CompositeAccess("HI", ("BR", "BP"), 1)
    # BF Composite (Diagnosis) can have a number of attributes
    diagCode = CompositeSequenceAccess("HI", "BF")
    # BG Composite (Condition Information) can have a number of attributes
    condCode = CompositeSequenceAccess("HI", "BG")
    # BK Composite (Principal Diagnosis) is split into two attributes
    prinDiagCode = CompositeAccess("HI", "BK", 1)
    admitDiagCd = CompositeAccess("HI", "BK", 2)
    # BO/BQ Composite (Other Procedure Information) has a number of attributes
    procCode = CompositeSequenceAccess("HI", ("BQ", "BO"))
    # BH Composite (Occurrence Information) has a number of attributes
    occrCode = CompositeSequenceAccess("HI", "BH")
    # BE Composite (Value Information) has a number of attributes
    valueCode = CompositeSequenceAccess("HI", "BE")
Ejemplo n.º 3
0
    class _CurrencyInformation(X12LoopBridge):
        """ Specify the currency and exchange rate, if applicable.

        Only used when the payment is not being made in United States Dollars
        or when the payment is made in a currency different from that in the
        original claim."""
        currency_code = ElementAccess("CUR", 2)
        exchange_rate = ElementAccess("CUR", 3)
Ejemplo n.º 4
0
class DemographicInformation(X12SegmentBridge):
    birth_date = ElementAccess("DMG", 2, x12type=D8, qualifier=(1, "D8"))
    gender = ElementAccess("DMB",
                           3,
                           x12type=enum({
                               "F": "Female",
                               "M": "Male",
                               "U": "Unknown"
                           }))
Ejemplo n.º 5
0
class TransactionSetHeader(X12LoopBridge):

    transaction_set_identifier_code = ElementAccess("ST", 1)

    transaction_set_control_number = ElementAccess("ST", 2)

    def __init__(self, functional_group, x12_message):
        super(TransactionSetHeader, self).__init__(x12_message)
        self.functional_group = functional_group
Ejemplo n.º 6
0
    class _Version(X12LoopBridge):
        """ Reports the version number of the adjudication system which
        generated the claim payments.

        This is *NOT* the version number reported in the GS segment of the
        underlying EDI file. This is sometimes used for customer service
        requests, to help track down where an error was introduced."""
        version_number = ElementAccess("REF", 2, qualifier=(1, "F2"))
        description = ElementAccess("REF", 3, qualifier=(1, "F2"))
        reference_id = ElementAccess("REF", 4, qualifier=(1, "F2"))
Ejemplo n.º 7
0
    class _ReassociationTraceNumber(X12LoopBridge):
        """ Uniquely identify this transaction set.

        Also aid in reassociating payments and remittances that have been
        separated.
        """
        trace_type = ElementAccess(
            "TRN", 1, x12type=enum({"1": "Current Transaction Trace Numbers"}))
        check_or_eft_trace_number = ElementAccess("TRN", 2)
        payer_id = ElementAccess("TRN", 3)
        originating_company_supplemental_code = ElementAccess("TRN", 4)
Ejemplo n.º 8
0
class EligibilityOrBenefitInquiry(X12SegmentBridge):
    service_type = ElementAccess("EQ", 1, x12type=enum(service_type_codes))
    ada_code = CompositeAccess("EQ", "AD", 2)
    cpt_code = CompositeAccess("EQ", "CJ", 2)
    hcpcs_code = CompositeAccess("EQ", "HC", 2)
    icd_9_cm_code = CompositeAccess("EQ", "ID", 2)
    hiec_code = CompositeAccess("EQ", "IV", 2)
    ndc_code = CompositeAccess("EQ", "ND", 2)
    zz_code = CompositeAccess("EQ", "ZZ", 2)
    coverage_level = ElementAccess("EQ", 3, x12type=enum(coverage_level))
    insurance_type = ElementAccess("EQ", 4, x12type=enum(insurance_type))
Ejemplo n.º 9
0
class Professional_ServiceLine(ServiceLine):
    """Professional Service Line from the 2400 Loop."""
    srvID = ElementAccess("SV1", 1)
    amt = ElementAccess("SV1", 2)
    unitsQual = ElementAccess("SV1", 3)
    units = ElementAccess("SV1", 4)
    facCode = ElementAccess("SV1", 5)
    diagCode = ElementAccess("SV1", 7)
    respCode1 = ElementAccess("SV1", 9)
    respCode2 = ElementAccess("SV1", 11)
    respCode3 = ElementAccess("SV1", 12)
    coPay = ElementAccess("SV1", 15)
Ejemplo n.º 10
0
class Payee(X12LoopBridge):
    """Payee information from 1000B loop."""
    loopName = "1000B"
    state_license = ElementAccess("REF", 2, qualifier=(1, "0B"))
    provider_UPIN = ElementAccess("REF", 2, qualifier=(1, "1G"))
    pharmacy_number = ElementAccess("REF", 2, qualifier=(1, "D3"))
    payee_id = ElementAccess("REF", 2, qualifier=(1, "PQ"))
    tax_id = ElementAccess("REF", 2, qualifier=(1, "TJ"))

    def __init__(self, aLoop, *args, **kwargs):
        super(Payee, self).__init__(aLoop, *args, **kwargs)
        self.contact_details = ContactDetails(aLoop, *args, **kwargs)
Ejemplo n.º 11
0
class Hierarchy(X12SegmentBridge):
    id = ElementAccess("HL", 1)
    parent_id = ElementAccess("HL", 2)
    level = ElementAccess("HL",
                          3,
                          x12type=enum({
                              "20": "Information Source",
                              "21": "Information Receiver",
                              "22": "Subscriber",
                              "23": "Dependent",
                          }))
    has_children = ElementAccess("HL", 4, x12type=boolean("1"))
Ejemplo n.º 12
0
class ContactInformation(X12SegmentBridge):
    contact_code = ElementAccess(
        "PER", 1, x12type=enum({
            "IC": "Information Contact"
        }, raw_unknowns=True))
    contact_name = ElementAccess("PER", 2)
    contact_edi = ElementAccess("PER", oneOf=("ED", (3, 4), (5, 6), (7, 8)))
    contact_email = ElementAccess("PER", oneOf=("EM", (3, 4), (5, 6), (7, 8)))
    contact_fax = ElementAccess("PER", oneOf=("FX", (3, 4), (5, 6), (7, 8)))
    contact_home_phone = ElementAccess("PER", oneOf=("HP", (3, 4), (5, 6), (7, 8)))
    contact_work_phone = ElementAccess("PER", oneOf=("WP", (3, 4), (5, 6), (7, 8)))
    contact_phone = ElementAccess("PER", oneOf=("TE", (3, 4), (5, 6), (7, 8)))
    contact_phone_ext = ElementAccess("PER", oneOf=("EX", (3, 4), (5, 6), (7, 8)))
    contact_url = ElementAccess("PER", oneOf=("UR", (3, 4), (5, 6), (7, 8)))
Ejemplo n.º 13
0
class Payer(X12LoopBridge):
    """Payer information from the 1000A loop."""
    loopName = "1000A"
    payer_id = ElementAccess("REF", 2, qualifier=(1, "2U"))
    submitter_id = ElementAccess("REF", 2, qualifier=(1, "EO"))
    # health industry number
    hin = ElementAccess("REF", 2, qualifier=(1, "HI"))
    naic_code = ElementAccess("REF", 2, qualifier=(1, "NF"))

    def __str__(self):
        return "%s, %s %s %s" % (self.last, self.first, self.mid, self.suffix)

    def __init__(self, aLoop, *args, **kwargs):
        super(Payer, self).__init__(aLoop, *args, **kwargs)
        self.contact_details = ContactDetails(aLoop, *args, **kwargs)
Ejemplo n.º 14
0
class ServiceLine(X12LoopBridge):
    """Service Line from the 2400 Loop."""
    loopName = "2400"
    SrvLNo = ElementAccess("LX", 1)
    format = ElementAccess("DTP", 2)
    srvDT = ElementAccess("DTP", 3, qualifier=(1, "472"))
    dmeCode = ElementAccess("SV5", 1)
    qualifier = ElementAccess("SV5", 2)
    amt1 = ElementAccess("SV5", 3)
    amt2 = ElementAccess("SV5", 4)
    amt3 = ElementAccess("SV5", 5)
    amt4 = ElementAccess("SV5", 6)
Ejemplo n.º 15
0
class TraceNumber(X12SegmentBridge):
    """ Uniquely identify this transaction set.

    Also aid in reassociating payments and remittances that have been
    separated.
    """
    trace_type = ElementAccess(
        "TRN",
        1,
        x12type=enum({
            "1": "Current Transaction Trace Numbers",
            "2": "Referenced Transaction Trace Numbers (Value from 270)"
        }))
    trace_number = ElementAccess("TRN", 2)
    entity_id = ElementAccess("TRN", 3)
    entity_additional_id = ElementAccess("TRN", 4)
Ejemplo n.º 16
0
class NamedEntity(X12SegmentBridge):
    entity_identifier = ElementAccess(
        "NM1",
        1,
        x12type=enum(
            {
                "03": "Dependent",
                "13": "Contracted Service Provider",
                "1P": "Provider",
                "2B": "Third-Party Administrator",
                "36": "Employer",
                "73": "Other Physician",
                "80": "Hospital",
                "FA": "Facility",
                "GP": "Gateway Provider",
                "IL": "Insured",
                "LR": "Legal Representative",
                "P3": "Primary Care Provider",
                "P4": "Prior Insurance Carrier",
                "P5": "Plan Sponsor",
                "PR": "Payer",
                "PRP": "Primary Payer",
                "QC": "Patient",
                "SEP": "Secondary Payer",
                "TTP": "Tertiary Payer",
                "VN": "Vendor",
                "X3": "Utilization Management Organization"
            },
            raw_unknowns=True))
    entity_type = ElementAccess("NM1",
                                2,
                                x12type=enum({
                                    "1": "Person",
                                    "2": "Non-Person Entity"
                                }))

    last_name = ElementAccess("NM1", 3)
    org_name = ElementAccess("NM1", 3)
    first_name = ElementAccess("NM1", 4)
    middle_initial = ElementAccess("NM1", 5)
    suffix = ElementAccess("NM1", 7)

    id_code = ElementAccess("NM1", 9)
    id_code_qual = ElementAccess("NM1", 8, x12type=enum(id_code_qualifier))

    @property
    def is_person(self):
        return self.entity_type[0] == "1"

    @property
    def is_organization(self):
        return self.entity_type[0] == "2"
Ejemplo n.º 17
0
class Relationship(X12SegmentBridge):
    is_insured = ElementAccess("INS", 1, x12type=boolean('Y'))
    relationship = ElementAccess("INS",
                                 2,
                                 x12type=enum(
                                     {
                                         "01": "Spouse",
                                         "18": "Self",
                                         "19": "Child",
                                         "21": "Unknown",
                                         "34": "Other Adult"
                                     },
                                     raw_unknowns=True))
    maintenance_type = ElementAccess("INS",
                                     3,
                                     x12type=enum({"001": "Change"},
                                                  raw_unknowns=True))
    maintenance_reason = ElementAccess(
        "INS",
        4,
        x12type=enum({"25": "Change in Identifying Data Elements"},
                     raw_unknowns=True))
    student_status = ElementAccess("INS",
                                   9,
                                   x12type=enum({
                                       "F": "Full-time",
                                       "N": "Not a Student",
                                       "P": "Part-time"
                                   }))
    handicapped = ElementAccess("INS", 10, x12type=boolean("Y"))
    birth_sequence_number = ElementAccess("INS", 17)
Ejemplo n.º 18
0
class ServiceLineAdj(X12LoopBridge):
    """Service Line Adjustment from the 2430 Loop."""
    loopName = "2430"
    idCode = ElementAccess("SVD", 1)
    amt = ElementAccess("SVD", 2)
    procID = ElementAccess("SVD", 3)
    svcID = ElementAccess("SVD", 4)
    qty = ElementAccess("SVD", 5)
    assNo = ElementAccess("SVD", 6)
    format = ElementAccess("DTP", 2)
    srvDT = ElementAccess("DTP", 3, qualifier=(1, "579"))
Ejemplo n.º 19
0
class Institutional_ServiceLine(ServiceLine):
    """Institutional Service Line from the 2400 Loop."""
    revenueCode = ElementAccess("SV2", 1)
    procID = ElementAccess("SV2", 2)
    amt = ElementAccess("SV2", 3)
    unitsQual = ElementAccess("SV2", 4)
    units = ElementAccess("SV2", 5)
    unitRate = ElementAccess("SV2", 6)
    amtNotCovered = ElementAccess("SV2", 7)
Ejemplo n.º 20
0
class Diagnosis(X12SegmentBridge):
    principal_diagnosis_icd9_code = ElementAccess("III",
                                                  2,
                                                  qualifier=(1, "BK"))
    diagnosis_icd9_code = ElementAccess("III", 2, qualifier=(1, "BF"))
    other_code = ElementAccess(
        "III",
        2,
        qualifier=(1, "ZZ"),
        x12type=enum(
            {
                "11": "Office",
                "12": "Home",
                "21": "Inpatient Hospital",
                "22": "Outpatient Hospital",
                "23": "Emergency Room - Hospital",
                "24": "Ambulatory Surgical Center",
                "25": "Birthing Center",
                "26": "Military Treatment Facility",
                "31": "Skilled Nursing Facility",
                "32": "Nursing Facility",
                "33": "Custodial Care Facility",
                "34": "Hospice",
                "41": "Ambulance - Land",
                "42": "Ambulance - Air or Water",
                "50": "Federally Qualified Health Center",
                "51": "Inpatient Psychiatric Facility",
                "52": "Psychiatric Facility Partial Hospitalization",
                "53": "Community Mental Health Center",
                "54": "Intermediate Care Facility/Mentally Retarded",
                "55": "Residential Substance Abuse Treatment Facility",
                "56": "Psychiatric Residential Treatment Center",
                "60": "Mass Immunization Center",
                "61": "Comprehensive Inpatient Rehabilitation Facility",
                "62": "Comprehensive Outpatient Rehabilitation Facility",
                "65": "End-Stage Renal Disease Treatment Facility",
                "71": "State or Local Public Health Clinic",
                "72": "Rural Health Clinic",
                "81": "Independent Laboratory 99 Other Unlisted Facility"
            },
            raw_unknowns=True))
Ejemplo n.º 21
0
    class _HierarchicalTransaction(X12SegmentBridge):
        """Use this to start the transaction set.

        This also indicates the sequence of hierarchical levels of information
        that will follow, though that information is not used at this time."""
        structure = ElementAccess(
            "BHT",
            1,
            x12type=enum({
                "0022": "Information Source, Information Receiver, Subscriber, "
                        "or Dependent."
            },
                         raw_unknowns=True))
        purpose = ElementAccess(
            "BHT",
            2,
            x12type=enum({
                "01": "Cancellation",
                "11": "Response",
                "13": "Request",
                "36": "Authority to Dedduct (Reply)"
            },
                         raw_unknowns=True))
        transaction_id = ElementAccess("BHT", 3)
        creation_date = ElementAccess("BHT", 4, x12type=D8)
        creation_time = ElementAccess("BHT", 5, x12type=TM)
        type = ElementAccess(
            "BHT",
            6,
            x12type=enum({
                "RT": "Spend Down",
                "RU": "Medical Services Reservation"
            },
                         raw_unknowns=True))
Ejemplo n.º 22
0
class NamedEntity(X12LoopBridge):
    entity_identifier = ElementAccess("NM1",
                                      1,
                                      x12type=enum({
                                          "03": "Dependent",
                                          "1P": "Provider",
                                          "2B": "Third-Party Administrator",
                                          "36": "Employer",
                                          "80": "Hospital",
                                          "FA": "Facility",
                                          "GP": "Gateway Provider",
                                          "IL": "Insured",
                                          "P5": "Plan Sponsor",
                                          "PR": "Payer",
                                          "QC": "Patient"
                                      }))
    entity_type = ElementAccess("NM1",
                                2,
                                x12type=enum({
                                    "1": "Person",
                                    "2": "Non-Person Entity"
                                }))

    last_name = ElementAccess("NM1", 3)
    org_name = ElementAccess("NM1", 3)
    first_name = ElementAccess("NM1", 4)
    middle_initial = ElementAccess("NM1", 5)
    suffix = ElementAccess("NM1", 7)

    id_code = ElementAccess("NM1", 9)
    id_code_qual = ElementAccess("NM1", 8, x12type=enum(id_code_qualifier))

    def is_person(self):
        return self.entity_type[0] == "1"

    def is_organization(self):
        return self.entity_type[0] == "2"

    def __init__(self, aLoop, qualifier=None, *args, **kwargs):
        if qualifier:
            self.qualifier = qualifier
        super(NamedEntity, self).__init__(aLoop)
        #NOTE: Sometimes this can be multiple Elements...
        self.contact_details = ContactDetails(aLoop, *args, **kwargs)
Ejemplo n.º 23
0
class ProviderInformation(X12SegmentBridge):
    provider_code = ElementAccess("PRV",
                                  1,
                                  x12type=enum({
                                      "AD": "Admitting",
                                      "AT": "Attending",
                                      "BI": "Billing",
                                      "CO": "Consulting",
                                      "CV": "Covering",
                                      "H": "Hospital",
                                      "HH": "Home Health Care",
                                      "LA": "Laboratory",
                                      "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"
                                  }))
    reference_id_qualifier = ElementAccess(
        "PRV",
        2,
        x12type=enum(
            {
                "9K": "Servicer",
                "D3": "National Association of Boards of Pharmacy Number",
                "EI": "Employer's Identification Number",
                "HPI":
                "Healthcare Financing Administration National Provider ID",
                "SY": "Social Security Number",
                "TJ": "Federal Taxpayer's Identification Number",
                "ZZ": "Mutually Defined"
            },
            raw_unknowns=True))
    reference_id = ElementAccess("PRV", 3)
Ejemplo n.º 24
0
class Professional_Patient(Patient):
    """Patient on an 837P claim."""
    rel = ElementAccess("PAT", 1)
    dateFormat = ElementAccess("PAT", 5)
    dod = ElementAccess("PAT", 6)
    measCode = ElementAccess("PAT", 7)
    weight = ElementAccess("PAT", 8)
    preg = ElementAccess("PAT", 9)
Ejemplo n.º 25
0
class HealthCareServicesDelivery(X12LoopBridge):
    benefit_quantity_type = ElementAccess("HSD", 1,
            x12type=enum(quantity_qualifier))
    benefit_quantity = ElementAccess("HSD", 2)
    unit_or_basis_for_measurement = ElementAccess("HSD", 3, x12type=enum({
        "DA": "Days",
        "MO": "Months",
        "VS": "Visit",
        "WK": "Week",
        "YR": "Years"}))
    sample_selection_modulus = ElementAccess("HSD", 4)
    time_period_type = ElementAccess("HSD", 5,
            x12type=enum(time_period_qualifier))
    period_count = ElementAccess("HSD", 6)
    delivery_frequency = ElementAccess("HSD", 7,
            x12type=enum(delivery_or_calendar_pattern_code))
    delivery_time = ElementAccess("HSD", 8,
            x12type=enum(delivery_time_pattern_code))
Ejemplo n.º 26
0
class Location(X12SegmentBridge):
    city = ElementAccess("N4", 1)
    state = ElementAccess("N4", 2)
    zip = ElementAccess("N4", 3)
    country_code = ElementAccess("N4", 4)
    location_type = ElementAccess(
        "N4",
        5,
        x12type=enum({
            "CY": "County/Parish",
            "FI": "Federal Information Processing Standards (FIPS) 55 (Named "
                  "Populated Places)"
        },
                     raw_unknowns=True))
    location_id = ElementAccess("N4", 6)
Ejemplo n.º 27
0
class FunctionalGroupHeader(X12LoopBridge):

    functional_id_code = ElementAccess("GS", 1)

    application_sender_code = ElementAccess("GS", 2)
    application_receiver_code = ElementAccess("GS", 3)

    date = ElementAccess("GS", 4, x12type=D8)
    time = ElementAccess("GS", 5, x12type=TM)

    group_control_number = ElementAccess("GS", 6)

    responsible_agency_code = ElementAccess("GS", 7)

    version_indicator_code = ElementAccess("GS", 8)

    def __init__(self, x12_message):
        super(FunctionalGroupHeader, self).__init__(x12_message)
        st_loops = x12_message.descendant('LOOP', name='ST_LOOP')
        self.transaction_sets = [
            TransactionSetHeader(self, st_loop)
            for st_loop in st_loops]

    @property
    def version_tuple(self):
        """
        Return a tuple of (version, release, subrelease) numbers.

        Returns None if no version is given or has a different format.
        """
        if self.responsible_agency_code == 'X':
            return X12VersionTuple(
                version=int(self.version_indicator_code[0:3]),
                release=int(self.version_indicator_code[3:5]),
                subrelease=int(self.version_indicator_code[5:6]),
                industry_identifier_code=self.version_indicator_code[6:],
            )
Ejemplo n.º 28
0
class Message(X12LoopBridge):
    message_text = ElementAccess("MSG", 1)
Ejemplo n.º 29
0
class EligibilityOrBenefitInformation(X12SegmentBridge):
    """Eligibility Information."""
    information_type = ElementAccess("EB", 1, x12type=enum(
        eligibility_or_benefit_code))
    coverage_level = ElementAccess("EB", 2, x12type=enum(
        coverage_level))
    service_type = ElementAccess("EB", 3, x12type=enum(
        service_type_codes))
    insurance_type = ElementAccess("EB", 4, x12type=enum(
        insurance_type))
    description = ElementAccess("EB", 5)
    time_period_type = ElementAccess("EB", 6,
            x12type=enum(time_period_qualifier))
    benefit_amount = ElementAccess("EB", 7, x12type=Money)
    benefit_percent = ElementAccess("EB", 8, x12type=XDecimal)
    quantity_type = ElementAccess("EB", 9, x12type=enum(quantity_qualifier))
    quantity = ElementAccess("EB", 10)
    authorization_or_certification = ElementAccess("EB", 11,
            x12type=boolean("Y"))
    in_plan_network = ElementAccess("EB", 12, x12type=boolean("Y"))
    both_in_out_network = ElementAccess("EB", 12, x12type=boolean("W"))
    ada_code = CompositeAccess("EB", "AD", 13)
    cpt_code = CompositeAccess("EB", "CJ", 13)
    hcpcs_code = CompositeAccess("EB", "HC", 13)
    icd_9_cm_code = CompositeAccess("EB", "ID", 13)
    ndc_code = CompositeAccess("EB", "ND", 13)
    zz_code = CompositeAccess("EB", "ZZ", 13)
Ejemplo n.º 30
0
    class _ClaimPaymentInfo(X12LoopBridge):
        patient_control_number = ElementAccess("CLP", 1)
        status_code = ElementAccess(
            "CLP",
            2,
            x12type=enum({
                "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"
            }))
        total_charge = ElementAccess("CLP", 3, x12type=Money)
        payment = ElementAccess("CLP", 4, x12type=Money)
        patient_responsibility = ElementAccess("CLP", 5, x12type=Money)
        claim_type = ElementAccess(
            "CLP",
            6,
            x12type=enum({
                "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",
                "AM": "Automobile Medical",
                "CH": "Champus",
                "DS": "Disability",
                "HM": "Health Maintenance Organization",
                "LM": "Liability Medical",
                "MA": "Medicare Part A",
                "MB": "Medicare Part B",
                "MC": "Medicaid",
                "OF": "Other Federal Program",
                "TV": "Title V",
                "VA": "Veteran Administration Plan",
                "WC": "Workers Compensation Health Claim"
            }))
        payer_claim_control_number = ElementAccess("CLP", 7)
        facility_type = ElementAccess("CLP", 8)
        frequency_code = ElementAccess("CLP", 9)
        diagnosis_related_group_weight = ElementAccess("CLP", 11)
        discharge_fraction = ElementAccess("CLP", 12)
        # TODO: Medicare inpatient/outpatient adjudication?

        total_covered_charge = ElementAccess("AMT",
                                             2,
                                             qualifier=(1, "AU"),
                                             x12type=Money)
        discount_amount = ElementAccess("AMT",
                                        2,
                                        qualifier=(1, "D8"),
                                        x12type=Money)
        per_day_limit = ElementAccess("AMT",
                                      2,
                                      qualifier=(1, "DY"),
                                      x12type=Money)
        patient_amount_paid = ElementAccess("AMT",
                                            2,
                                            qualifier=(1, "F5"),
                                            x12type=Money)
        interest = ElementAccess("AMT", 2, qualifier=(1, "I"), x12type=Money)
        negative_ledger = ElementAccess("AMT",
                                        2,
                                        qualifier=(1, "NL"),
                                        x12type=Money)
        tax_amount = ElementAccess("AMT", 2, qualifier=(1, "T"), x12type=Money)
        total_claim_before_taxes = ElementAccess("AMT",
                                                 2,
                                                 qualifier=(1, "T2"),
                                                 x12type=Money)