# -*- 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 NewUnsolicited(EventTypeAbstractModel):

    Meta: "NewUnsolicitedMeta" = Field(...)
    Orders: List["NewUnsolicitedOrder"] = Field(...)
    Patient: "NewUnsolicitedPatient" = Field(...)
    Visit: "NewUnsolicitedVisit" = Field(None)


class NewUnsolicitedMeta(RedoxAbstractModel):

    DataModel: str = Field(...)
    Destinations: List["NewUnsolicitedMetaDestination"] = Field(None)
    EventDateTime: Union[str, None] = Field(None)
    EventType: str = Field(...)
    FacilityCode: Union[str, None] = Field(None)
    Logs: List["NewUnsolicitedMetaLog"] = Field(None)
    Message: "NewUnsolicitedMetaMessage" = Field(None)
    Source: "NewUnsolicitedMetaSource" = Field(None)
    Test: Union[bool, None] = Field(None)
    Transmission: "NewUnsolicitedMetaTransmission" = Field(None)


class NewUnsolicitedMetaDestination(RedoxAbstractModel):

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


class NewUnsolicitedMetaLog(RedoxAbstractModel):

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


class NewUnsolicitedMetaMessage(RedoxAbstractModel):

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


class NewUnsolicitedMetaSource(RedoxAbstractModel):

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


class NewUnsolicitedMetaTransmission(RedoxAbstractModel):

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


class NewUnsolicitedOrder(RedoxAbstractModel):

    ApplicationOrderID: str = Field(...)
    CollectionDateTime: Union[str, None] = Field(None)
    CompletionDateTime: Union[str, None] = Field(None)
    ID: Union[str, None] = Field(None)
    Notes: List[str] = Field(None)
    Priority: Union[str, None] = Field(None)
    Procedure: "NewUnsolicitedOrderProcedure" = Field(None)
    Provider: "NewUnsolicitedOrderProvider" = Field(None)
    ResponseFlag: Union[str, None] = Field(None)
    ResultCopyProviders: List["NewUnsolicitedOrderResultCopyProvider"] = Field(None)
    Results: List["NewUnsolicitedOrderResult"] = Field(...)
    ResultsStatus: Union[str, None] = Field(None)
    Status: str = Field(...)
    TransactionDateTime: Union[str, None] = Field(None)


class NewUnsolicitedOrderProcedure(RedoxAbstractModel):

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


class NewUnsolicitedOrderProvider(RedoxAbstractModel):

    Address: "NewUnsolicitedOrderProviderAddress" = 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: "NewUnsolicitedOrderProviderLocation" = Field(None)
    NPI: Union[str, None] = Field(None)
    PhoneNumber: "NewUnsolicitedOrderProviderPhoneNumber" = Field(None)


class NewUnsolicitedOrderProviderAddress(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 NewUnsolicitedOrderProviderLocation(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 NewUnsolicitedOrderProviderPhoneNumber(RedoxAbstractModel):

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


class NewUnsolicitedOrderResult(RedoxAbstractModel):

    AbnormalFlag: Union[str, None] = Field(None)
    Code: str = Field(...)
    Codeset: Union[str, None] = Field(None)
    CompletionDateTime: Union[str, None] = Field(None)
    Description: Union[str, None] = Field(None)
    FileType: Union[str, None] = Field(None)
    Notes: List[str] = Field(None)
    ObservationMethod: "NewUnsolicitedOrderResultObservationMethod" = Field(None)
    Performer: "NewUnsolicitedOrderResultPerformer" = Field(None)
    PrimaryResultsInterpreter: "NewUnsolicitedOrderResultPrimaryResultsInterpreter" = (
        Field(None)
    )
    Producer: "NewUnsolicitedOrderResultProducer" = Field(None)
    ReferenceRange: "NewUnsolicitedOrderResultReferenceRange" = Field(None)
    RelatedGroupID: Union[str, None] = Field(None)
    Specimen: "NewUnsolicitedOrderResultSpecimen" = Field(None)
    Status: Union[str, None] = Field(None)
    Units: Union[str, None] = Field(None)
    Value: str = Field(...)
    ValueType: str = Field(...)


class NewUnsolicitedOrderResultCopyProvider(RedoxAbstractModel):

    Address: "NewUnsolicitedOrderResultCopyProviderAddress" = 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: "NewUnsolicitedOrderResultCopyProviderLocation" = Field(None)
    PhoneNumber: "NewUnsolicitedOrderResultCopyProviderPhoneNumber" = Field(None)


class NewUnsolicitedOrderResultCopyProviderAddress(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 NewUnsolicitedOrderResultCopyProviderLocation(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 NewUnsolicitedOrderResultCopyProviderPhoneNumber(RedoxAbstractModel):

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


class NewUnsolicitedOrderResultObservationMethod(RedoxAbstractModel):

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


class NewUnsolicitedOrderResultPerformer(RedoxAbstractModel):

    Address: "NewUnsolicitedOrderResultPerformerAddress" = 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: "NewUnsolicitedOrderResultPerformerLocation" = Field(None)
    PhoneNumber: "NewUnsolicitedOrderResultPerformerPhoneNumber" = Field(None)


class NewUnsolicitedOrderResultPerformerAddress(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 NewUnsolicitedOrderResultPerformerLocation(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 NewUnsolicitedOrderResultPerformerPhoneNumber(RedoxAbstractModel):

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


class NewUnsolicitedOrderResultPrimaryResultsInterpreter(RedoxAbstractModel):

    Address: "NewUnsolicitedOrderResultPrimaryResultsInterpreterAddress" = 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: "NewUnsolicitedOrderResultPrimaryResultsInterpreterLocation" = Field(None)
    NPI: Union[str, None] = Field(None)
    PhoneNumber: "NewUnsolicitedOrderResultPrimaryResultsInterpreterPhoneNumber" = (
        Field(None)
    )


class NewUnsolicitedOrderResultPrimaryResultsInterpreterAddress(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 NewUnsolicitedOrderResultPrimaryResultsInterpreterLocation(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 NewUnsolicitedOrderResultPrimaryResultsInterpreterPhoneNumber(RedoxAbstractModel):

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


class NewUnsolicitedOrderResultProducer(RedoxAbstractModel):

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


class NewUnsolicitedOrderResultProducerAddress(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 NewUnsolicitedOrderResultReferenceRange(RedoxAbstractModel):

    High: Union[Number, None] = Field(None)
    Low: Union[Number, None] = Field(None)
    Text: Union[str, None] = Field(None)


class NewUnsolicitedOrderResultSpecimen(RedoxAbstractModel):

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


class NewUnsolicitedPatient(RedoxAbstractModel):

    Contacts: List["NewUnsolicitedPatientContact"] = Field(None)
    Demographics: "NewUnsolicitedPatientDemographics" = Field(None)
    Identifiers: List["NewUnsolicitedPatientIdentifier"] = Field(...)
    Notes: List[str] = Field(None)


class NewUnsolicitedPatientContact(RedoxAbstractModel):

    Address: "NewUnsolicitedPatientContactAddress" = Field(None)
    EmailAddresses: List[str] = Field(None)
    FirstName: Union[str, None] = Field(None)
    LastName: Union[str, None] = Field(None)
    MiddleName: Union[str, None] = Field(None)
    PhoneNumber: "NewUnsolicitedPatientContactPhoneNumber" = Field(None)
    RelationToPatient: Union[str, None] = Field(None)
    Roles: List[str] = Field(None)


class NewUnsolicitedPatientContactAddress(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 NewUnsolicitedPatientContactPhoneNumber(RedoxAbstractModel):

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


class NewUnsolicitedPatientDemographics(RedoxAbstractModel):

    Address: "NewUnsolicitedPatientDemographicsAddress" = 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: "NewUnsolicitedPatientDemographicsPhoneNumber" = 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 NewUnsolicitedPatientDemographicsAddress(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 NewUnsolicitedPatientDemographicsPhoneNumber(RedoxAbstractModel):

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


class NewUnsolicitedPatientIdentifier(RedoxAbstractModel):

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


class NewUnsolicitedVisit(RedoxAbstractModel):

    AccountNumber: Union[str, None] = Field(None)
    AdditionalStaff: List["NewUnsolicitedVisitAdditionalStaff"] = Field(None)
    AttendingProvider: "NewUnsolicitedVisitAttendingProvider" = Field(None)
    Location: "NewUnsolicitedVisitLocation" = Field(None)
    PatientClass: Union[str, None] = Field(None)
    ReferringProvider: "NewUnsolicitedVisitReferringProvider" = Field(None)
    VisitDateTime: Union[str, None] = Field(None)
    VisitNumber: Union[str, None] = Field(None)


class NewUnsolicitedVisitAdditionalStaff(RedoxAbstractModel):

    Address: "NewUnsolicitedVisitAdditionalStaffAddress" = 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: "NewUnsolicitedVisitAdditionalStaffLocation" = Field(None)
    PhoneNumber: "NewUnsolicitedVisitAdditionalStaffPhoneNumber" = Field(None)
    Role: "NewUnsolicitedVisitAdditionalStaffRole" = Field(None)


class NewUnsolicitedVisitAdditionalStaffAddress(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 NewUnsolicitedVisitAdditionalStaffLocation(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 NewUnsolicitedVisitAdditionalStaffPhoneNumber(RedoxAbstractModel):

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


class NewUnsolicitedVisitAdditionalStaffRole(RedoxAbstractModel):

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


class NewUnsolicitedVisitAttendingProvider(RedoxAbstractModel):

    Address: "NewUnsolicitedVisitAttendingProviderAddress" = 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: "NewUnsolicitedVisitAttendingProviderLocation" = Field(None)
    PhoneNumber: "NewUnsolicitedVisitAttendingProviderPhoneNumber" = Field(None)


class NewUnsolicitedVisitAttendingProviderAddress(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 NewUnsolicitedVisitAttendingProviderLocation(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 NewUnsolicitedVisitAttendingProviderPhoneNumber(RedoxAbstractModel):

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


class NewUnsolicitedVisitLocation(RedoxAbstractModel):

    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 NewUnsolicitedVisitReferringProvider(RedoxAbstractModel):

    Address: "NewUnsolicitedVisitReferringProviderAddress" = 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: "NewUnsolicitedVisitReferringProviderLocation" = Field(None)
    PhoneNumber: "NewUnsolicitedVisitReferringProviderPhoneNumber" = Field(None)


class NewUnsolicitedVisitReferringProviderAddress(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 NewUnsolicitedVisitReferringProviderLocation(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 NewUnsolicitedVisitReferringProviderPhoneNumber(RedoxAbstractModel):

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


NewUnsolicited.update_forward_refs()
NewUnsolicitedMeta.update_forward_refs()
NewUnsolicitedOrder.update_forward_refs()
NewUnsolicitedOrderProvider.update_forward_refs()
NewUnsolicitedOrderResult.update_forward_refs()
NewUnsolicitedOrderResultCopyProvider.update_forward_refs()
NewUnsolicitedOrderResultPerformer.update_forward_refs()
NewUnsolicitedOrderResultPrimaryResultsInterpreter.update_forward_refs()
NewUnsolicitedOrderResultProducer.update_forward_refs()
NewUnsolicitedPatient.update_forward_refs()
NewUnsolicitedPatientContact.update_forward_refs()
NewUnsolicitedPatientDemographics.update_forward_refs()
NewUnsolicitedVisit.update_forward_refs()
NewUnsolicitedVisitAdditionalStaff.update_forward_refs()
NewUnsolicitedVisitAttendingProvider.update_forward_refs()
NewUnsolicitedVisitReferringProvider.update_forward_refs()
