# -*- coding: utf-8 -*-
# ----  AUTO-GENERATED BY redox_lib_gen. DO NOT MODIFY MANUALLY!!  ---- #

from typing import List, Union

from pydantic import Field

from ..abstract_base import EventTypeAbstractModel, RedoxAbstractModel
from ..field_types import Number


class Transaction(EventTypeAbstractModel):

    Meta: "TransactionMeta" = Field(...)
    Patient: "TransactionPatient" = Field(...)
    Transactions: List["TransactionTransaction"] = Field(...)
    Visit: "TransactionVisit" = Field(None)


class TransactionMeta(RedoxAbstractModel):

    DataModel: str = Field(...)
    Destinations: List["TransactionMetaDestination"] = Field(None)
    EventDateTime: Union[str, None] = Field(None)
    EventType: str = Field(...)
    FacilityCode: Union[str, None] = Field(None)
    Logs: List["TransactionMetaLog"] = Field(None)
    Message: "TransactionMetaMessage" = Field(None)
    Source: "TransactionMetaSource" = Field(None)
    Test: Union[bool, None] = Field(None)
    Transmission: "TransactionMetaTransmission" = Field(None)


class TransactionMetaDestination(RedoxAbstractModel):

    ID: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)


class TransactionMetaLog(RedoxAbstractModel):

    AttemptID: Union[str, None] = Field(None)
    ID: Union[str, None] = Field(None)


class TransactionMetaMessage(RedoxAbstractModel):

    ID: Union[Number, None] = Field(None)


class TransactionMetaSource(RedoxAbstractModel):

    ID: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)


class TransactionMetaTransmission(RedoxAbstractModel):

    ID: Union[Number, None] = Field(None)


class TransactionPatient(RedoxAbstractModel):

    Demographics: "TransactionPatientDemographics" = Field(None)
    Identifiers: List["TransactionPatientIdentifier"] = Field(...)
    Notes: List[str] = Field(None)


class TransactionPatientDemographics(RedoxAbstractModel):

    Address: "TransactionPatientDemographicsAddress" = Field(None)
    Citizenship: List[str] = Field(None)
    DeathDateTime: Union[str, None] = Field(None)
    DOB: Union[str, None] = Field(None)
    EmailAddresses: List[str] = Field(None)
    FirstName: Union[str, None] = Field(None)
    IsDeceased: Union[bool, None] = Field(None)
    IsHispanic: Union[bool, None] = Field(None)
    Language: Union[str, None] = Field(None)
    LastName: Union[str, None] = Field(None)
    MaritalStatus: Union[str, None] = Field(None)
    MiddleName: Union[str, None] = Field(None)
    PhoneNumber: "TransactionPatientDemographicsPhoneNumber" = Field(None)
    Race: Union[str, None] = Field(None)
    Religion: Union[str, None] = Field(None)
    Sex: Union[str, None] = Field(None)
    SSN: Union[str, None] = Field(None)


class TransactionPatientDemographicsAddress(RedoxAbstractModel):

    City: Union[str, None] = Field(None)
    Country: Union[str, None] = Field(None)
    County: Union[str, None] = Field(None)
    State: Union[str, None] = Field(None)
    StreetAddress: Union[str, None] = Field(None)
    ZIP: Union[str, None] = Field(None)


class TransactionPatientDemographicsPhoneNumber(RedoxAbstractModel):

    Home: Union[str, None] = Field(None)
    Mobile: Union[str, None] = Field(None)
    Office: Union[str, None] = Field(None)


class TransactionPatientIdentifier(RedoxAbstractModel):

    ID: str = Field(...)
    IDType: str = Field(...)


class TransactionTransaction(RedoxAbstractModel):

    Chargeable: "TransactionTransactionChargeable" = Field(...)
    DateTimeOfService: str = Field(...)
    Department: "TransactionTransactionDepartment" = Field(None)
    Diagnoses: List["TransactionTransactionDiagnosis"] = Field(None)
    EndDateTime: Union[str, None] = Field(None)
    ID: str = Field(...)
    NDC: "TransactionTransactionNDC" = Field(None)
    OrderID: Union[str, None] = Field(None)
    OrderingProviders: List["TransactionTransactionOrderingProvider"] = Field(None)
    Performers: List["TransactionTransactionPerformer"] = Field(None)
    Procedure: "TransactionTransactionProcedure" = Field(None)
    Type: str = Field(...)


class TransactionTransactionChargeable(RedoxAbstractModel):

    Amount: Union[Number, None] = Field(None)
    Code: str = Field(...)
    Codeset: Union[str, None] = Field(None)
    Description: Union[str, None] = Field(None)
    Quantity: Union[str, None] = Field(None)


class TransactionTransactionDepartment(RedoxAbstractModel):

    Code: Union[str, None] = Field(None)
    Codeset: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)


class TransactionTransactionDiagnosis(RedoxAbstractModel):

    Code: Union[str, None] = Field(None)
    Codeset: Union[str, None] = Field(None)
    DocumentedDateTime: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)
    Type: Union[str, None] = Field(None)


class TransactionTransactionNDC(RedoxAbstractModel):

    Code: Union[str, None] = Field(None)
    Description: Union[str, None] = Field(None)


class TransactionTransactionOrderingProvider(RedoxAbstractModel):

    Address: "TransactionTransactionOrderingProviderAddress" = Field(None)
    Credentials: List[str] = Field(None)
    EmailAddresses: List[str] = Field(None)
    FirstName: Union[str, None] = Field(None)
    ID: Union[str, None] = Field(None)
    IDType: Union[str, None] = Field(None)
    LastName: Union[str, None] = Field(None)
    Location: "TransactionTransactionOrderingProviderLocation" = Field(None)
    PhoneNumber: "TransactionTransactionOrderingProviderPhoneNumber" = Field(None)


class TransactionTransactionOrderingProviderAddress(RedoxAbstractModel):

    City: Union[str, None] = Field(None)
    Country: Union[str, None] = Field(None)
    County: Union[str, None] = Field(None)
    State: Union[str, None] = Field(None)
    StreetAddress: Union[str, None] = Field(None)
    ZIP: Union[str, None] = Field(None)


class TransactionTransactionOrderingProviderLocation(RedoxAbstractModel):

    Department: Union[str, None] = Field(None)
    Facility: Union[str, None] = Field(None)
    Room: Union[str, None] = Field(None)
    Type: Union[str, None] = Field(None)


class TransactionTransactionOrderingProviderPhoneNumber(RedoxAbstractModel):

    Office: Union[str, None] = Field(None)


class TransactionTransactionPerformer(RedoxAbstractModel):

    Address: "TransactionTransactionPerformerAddress" = Field(None)
    Credentials: List[str] = Field(None)
    EmailAddresses: List[str] = Field(None)
    FirstName: Union[str, None] = Field(None)
    ID: Union[str, None] = Field(None)
    IDType: Union[str, None] = Field(None)
    LastName: Union[str, None] = Field(None)
    Location: "TransactionTransactionPerformerLocation" = Field(None)
    PhoneNumber: "TransactionTransactionPerformerPhoneNumber" = Field(None)


class TransactionTransactionPerformerAddress(RedoxAbstractModel):

    City: Union[str, None] = Field(None)
    Country: Union[str, None] = Field(None)
    County: Union[str, None] = Field(None)
    State: Union[str, None] = Field(None)
    StreetAddress: Union[str, None] = Field(None)
    ZIP: Union[str, None] = Field(None)


class TransactionTransactionPerformerLocation(RedoxAbstractModel):

    Department: Union[str, None] = Field(None)
    Facility: Union[str, None] = Field(None)
    Room: Union[str, None] = Field(None)
    Type: Union[str, None] = Field(None)


class TransactionTransactionPerformerPhoneNumber(RedoxAbstractModel):

    Office: Union[str, None] = Field(None)


class TransactionTransactionProcedure(RedoxAbstractModel):

    Code: Union[str, None] = Field(None)
    Codeset: Union[str, None] = Field(None)
    Description: Union[str, None] = Field(None)
    Modifiers: List[str] = Field(None)


class TransactionVisit(RedoxAbstractModel):

    AccountNumber: Union[str, None] = Field(None)
    Guarantor: "TransactionVisitGuarantor" = Field(None)
    Insurances: List["TransactionVisitInsurance"] = Field(None)
    Location: "TransactionVisitLocation" = Field(None)
    VisitDateTime: Union[str, None] = Field(None)
    VisitNumber: Union[str, None] = Field(None)


class TransactionVisitGuarantor(RedoxAbstractModel):

    Address: "TransactionVisitGuarantorAddress" = Field(None)
    DOB: Union[str, None] = Field(None)
    EmailAddresses: List[str] = Field(None)
    Employer: "TransactionVisitGuarantorEmployer" = Field(None)
    FirstName: Union[str, None] = Field(None)
    LastName: Union[str, None] = Field(None)
    MiddleName: Union[str, None] = Field(None)
    Number: Union[str, None] = Field(None)
    PhoneNumber: "TransactionVisitGuarantorPhoneNumber" = Field(None)
    RelationToPatient: Union[str, None] = Field(None)
    Sex: Union[str, None] = Field(None)
    Spouse: "TransactionVisitGuarantorSpouse" = Field(None)
    SSN: Union[str, None] = Field(None)
    Type: Union[str, None] = Field(None)


class TransactionVisitGuarantorAddress(RedoxAbstractModel):

    City: Union[str, None] = Field(None)
    Country: Union[str, None] = Field(None)
    County: Union[str, None] = Field(None)
    State: Union[str, None] = Field(None)
    StreetAddress: Union[str, None] = Field(None)
    ZIP: Union[str, None] = Field(None)


class TransactionVisitGuarantorEmployer(RedoxAbstractModel):

    Address: "TransactionVisitGuarantorEmployerAddress" = Field(None)
    Name: Union[str, None] = Field(None)
    PhoneNumber: Union[str, None] = Field(None)


class TransactionVisitGuarantorEmployerAddress(RedoxAbstractModel):

    City: Union[str, None] = Field(None)
    Country: Union[str, None] = Field(None)
    County: Union[str, None] = Field(None)
    State: Union[str, None] = Field(None)
    StreetAddress: Union[str, None] = Field(None)
    ZIP: Union[str, None] = Field(None)


class TransactionVisitGuarantorPhoneNumber(RedoxAbstractModel):

    Business: Union[str, None] = Field(None)
    Home: Union[str, None] = Field(None)
    Mobile: Union[str, None] = Field(None)


class TransactionVisitGuarantorSpouse(RedoxAbstractModel):

    FirstName: Union[str, None] = Field(None)
    LastName: Union[str, None] = Field(None)


class TransactionVisitInsurance(RedoxAbstractModel):

    AgreementType: Union[str, None] = Field(None)
    Company: "TransactionVisitInsuranceCompany" = Field(None)
    CoverageType: Union[str, None] = Field(None)
    EffectiveDate: Union[str, None] = Field(None)
    ExpirationDate: Union[str, None] = Field(None)
    GroupName: Union[str, None] = Field(None)
    GroupNumber: Union[str, None] = Field(None)
    Insured: "TransactionVisitInsuranceInsured" = Field(None)
    MemberNumber: Union[str, None] = Field(None)
    Plan: "TransactionVisitInsurancePlan" = Field(None)
    PolicyNumber: Union[str, None] = Field(None)
    Priority: Union[str, None] = Field(None)


class TransactionVisitInsuranceCompany(RedoxAbstractModel):

    Address: "TransactionVisitInsuranceCompanyAddress" = Field(None)
    ID: Union[str, None] = Field(None)
    IDType: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)
    PhoneNumber: Union[str, None] = Field(None)


class TransactionVisitInsuranceCompanyAddress(RedoxAbstractModel):

    City: Union[str, None] = Field(None)
    Country: Union[str, None] = Field(None)
    County: Union[str, None] = Field(None)
    State: Union[str, None] = Field(None)
    StreetAddress: Union[str, None] = Field(None)
    ZIP: Union[str, None] = Field(None)


class TransactionVisitInsuranceInsured(RedoxAbstractModel):

    Address: "TransactionVisitInsuranceInsuredAddress" = Field(None)
    DOB: Union[str, None] = Field(None)
    FirstName: Union[str, None] = Field(None)
    Identifiers: List["TransactionVisitInsuranceInsuredIdentifier"] = Field(None)
    LastName: Union[str, None] = Field(None)
    MiddleName: Union[str, None] = Field(None)
    Relationship: Union[str, None] = Field(None)
    Sex: Union[str, None] = Field(None)
    SSN: Union[str, None] = Field(None)


class TransactionVisitInsuranceInsuredAddress(RedoxAbstractModel):

    City: Union[str, None] = Field(None)
    Country: Union[str, None] = Field(None)
    County: Union[str, None] = Field(None)
    State: Union[str, None] = Field(None)
    StreetAddress: Union[str, None] = Field(None)
    ZIP: Union[str, None] = Field(None)


class TransactionVisitInsuranceInsuredIdentifier(RedoxAbstractModel):

    ID: Union[str, None] = Field(None)
    IDType: Union[str, None] = Field(None)


class TransactionVisitInsurancePlan(RedoxAbstractModel):

    ID: Union[str, None] = Field(None)
    IDType: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)
    Type: Union[str, None] = Field(None)


class TransactionVisitLocation(RedoxAbstractModel):

    Address: "TransactionVisitLocationAddress" = Field(None)
    Bed: Union[str, None] = Field(None)
    Department: Union[str, None] = Field(None)
    Facility: Union[str, None] = Field(None)
    Room: Union[str, None] = Field(None)
    Type: Union[str, None] = Field(None)


class TransactionVisitLocationAddress(RedoxAbstractModel):

    City: Union[str, None] = Field(None)
    Country: Union[str, None] = Field(None)
    County: Union[str, None] = Field(None)
    State: Union[str, None] = Field(None)
    StreetAddress: Union[str, None] = Field(None)
    ZIP: Union[str, None] = Field(None)


Transaction.update_forward_refs()
TransactionMeta.update_forward_refs()
TransactionPatient.update_forward_refs()
TransactionPatientDemographics.update_forward_refs()
TransactionTransaction.update_forward_refs()
TransactionTransactionOrderingProvider.update_forward_refs()
TransactionTransactionPerformer.update_forward_refs()
TransactionVisit.update_forward_refs()
TransactionVisitGuarantor.update_forward_refs()
TransactionVisitGuarantorEmployer.update_forward_refs()
TransactionVisitInsurance.update_forward_refs()
TransactionVisitInsuranceCompany.update_forward_refs()
TransactionVisitInsuranceInsured.update_forward_refs()
TransactionVisitLocation.update_forward_refs()
