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

    Meta: "QueryResponseMeta" = Field(...)
    Orders: List["QueryResponseOrder"] = Field(None)


class QueryResponseMeta(RedoxAbstractModel):

    DataModel: str = Field(...)
    Destinations: List["QueryResponseMetaDestination"] = Field(None)
    EventDateTime: Union[str, None] = Field(None)
    EventType: str = Field(...)
    FacilityCode: Union[str, None] = Field(None)
    Logs: List["QueryResponseMetaLog"] = Field(None)
    Message: "QueryResponseMetaMessage" = Field(None)
    Source: "QueryResponseMetaSource" = Field(None)
    Test: Union[bool, None] = Field(None)
    Transmission: "QueryResponseMetaTransmission" = Field(None)


class QueryResponseMetaDestination(RedoxAbstractModel):

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


class QueryResponseMetaLog(RedoxAbstractModel):

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


class QueryResponseMetaMessage(RedoxAbstractModel):

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


class QueryResponseMetaSource(RedoxAbstractModel):

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


class QueryResponseMetaTransmission(RedoxAbstractModel):

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


class QueryResponseOrder(RedoxAbstractModel):

    ApplicationOrderID: Union[str, None] = Field(None)
    CollectionDateTime: Union[str, None] = Field(None)
    CompletionDateTime: Union[str, None] = Field(None)
    ID: Union[str, None] = Field(None)
    LastUpdated: Union[str, None] = Field(None)
    Notes: List[str] = Field(None)
    Patient: "QueryResponseOrderPatient" = Field(None)
    Priority: Union[str, None] = Field(None)
    Procedure: "QueryResponseOrderProcedure" = Field(None)
    Provider: "QueryResponseOrderProvider" = Field(None)
    ResponseFlag: Union[str, None] = Field(None)
    ResultCopyProviders: List["QueryResponseOrderResultCopyProvider"] = Field(None)
    Results: List["QueryResponseOrderResult"] = Field(None)
    ResultsStatus: Union[str, None] = Field(None)
    Status: Union[str, None] = Field(None)
    TransactionDateTime: Union[str, None] = Field(None)
    Visit: "QueryResponseOrderVisit" = Field(None)


class QueryResponseOrderPatient(RedoxAbstractModel):

    Identifiers: List["QueryResponseOrderPatientIdentifier"] = Field(None)


class QueryResponseOrderPatientIdentifier(RedoxAbstractModel):

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


class QueryResponseOrderProcedure(RedoxAbstractModel):

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


class QueryResponseOrderProvider(RedoxAbstractModel):

    Address: "QueryResponseOrderProviderAddress" = 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: "QueryResponseOrderProviderLocation" = Field(None)
    NPI: Union[str, None] = Field(None)
    PhoneNumber: "QueryResponseOrderProviderPhoneNumber" = Field(None)


class QueryResponseOrderProviderAddress(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 QueryResponseOrderProviderLocation(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 QueryResponseOrderProviderPhoneNumber(RedoxAbstractModel):

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


class QueryResponseOrderResult(RedoxAbstractModel):

    AbnormalFlag: Union[str, None] = Field(None)
    Code: Union[str, None] = Field(None)
    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: "QueryResponseOrderResultObservationMethod" = Field(None)
    Performer: "QueryResponseOrderResultPerformer" = Field(None)
    PrimaryResultsInterpreter: "QueryResponseOrderResultPrimaryResultsInterpreter" = (
        Field(None)
    )
    Producer: "QueryResponseOrderResultProducer" = Field(None)
    ReferenceRange: "QueryResponseOrderResultReferenceRange" = Field(None)
    RelatedGroupID: Union[str, None] = Field(None)
    Specimen: "QueryResponseOrderResultSpecimen" = Field(None)
    Status: Union[str, None] = Field(None)
    Units: Union[str, None] = Field(None)
    Value: Union[str, None] = Field(None)
    ValueType: Union[str, None] = Field(None)


class QueryResponseOrderResultCopyProvider(RedoxAbstractModel):

    Address: "QueryResponseOrderResultCopyProviderAddress" = 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: "QueryResponseOrderResultCopyProviderLocation" = Field(None)
    PhoneNumber: "QueryResponseOrderResultCopyProviderPhoneNumber" = Field(None)


class QueryResponseOrderResultCopyProviderAddress(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 QueryResponseOrderResultCopyProviderLocation(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 QueryResponseOrderResultCopyProviderPhoneNumber(RedoxAbstractModel):

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


class QueryResponseOrderResultObservationMethod(RedoxAbstractModel):

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


class QueryResponseOrderResultPerformer(RedoxAbstractModel):

    Address: "QueryResponseOrderResultPerformerAddress" = 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: "QueryResponseOrderResultPerformerLocation" = Field(None)
    PhoneNumber: "QueryResponseOrderResultPerformerPhoneNumber" = Field(None)


class QueryResponseOrderResultPerformerAddress(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 QueryResponseOrderResultPerformerLocation(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 QueryResponseOrderResultPerformerPhoneNumber(RedoxAbstractModel):

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


class QueryResponseOrderResultPrimaryResultsInterpreter(RedoxAbstractModel):

    Address: "QueryResponseOrderResultPrimaryResultsInterpreterAddress" = 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: "QueryResponseOrderResultPrimaryResultsInterpreterLocation" = Field(None)
    NPI: Union[str, None] = Field(None)
    PhoneNumber: "QueryResponseOrderResultPrimaryResultsInterpreterPhoneNumber" = Field(
        None
    )


class QueryResponseOrderResultPrimaryResultsInterpreterAddress(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 QueryResponseOrderResultPrimaryResultsInterpreterLocation(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 QueryResponseOrderResultPrimaryResultsInterpreterPhoneNumber(RedoxAbstractModel):

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


class QueryResponseOrderResultProducer(RedoxAbstractModel):

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


class QueryResponseOrderResultProducerAddress(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 QueryResponseOrderResultReferenceRange(RedoxAbstractModel):

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


class QueryResponseOrderResultSpecimen(RedoxAbstractModel):

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


class QueryResponseOrderVisit(RedoxAbstractModel):

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


QueryResponse.update_forward_refs()
QueryResponseMeta.update_forward_refs()
QueryResponseOrder.update_forward_refs()
QueryResponseOrderPatient.update_forward_refs()
QueryResponseOrderProvider.update_forward_refs()
QueryResponseOrderResult.update_forward_refs()
QueryResponseOrderResultCopyProvider.update_forward_refs()
QueryResponseOrderResultPerformer.update_forward_refs()
QueryResponseOrderResultPrimaryResultsInterpreter.update_forward_refs()
QueryResponseOrderResultProducer.update_forward_refs()
