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

    Documents: List["DocumentQueryResponseDocument"] = Field(...)
    Meta: "DocumentQueryResponseMeta" = Field(...)
    Patient: "DocumentQueryResponsePatient" = Field(None)


class DocumentQueryResponseDocument(RedoxAbstractModel):

    Author: "DocumentQueryResponseDocumentAuthor" = Field(None)
    DateTime: Union[str, None] = Field(None)
    ID: str = Field(...)
    Locale: Union[str, None] = Field(None)
    Location: "DocumentQueryResponseDocumentLocation" = Field(None)
    Title: Union[str, None] = Field(None)
    Type: "DocumentQueryResponseDocumentType" = Field(None)
    Visit: "DocumentQueryResponseDocumentVisit" = Field(None)


class DocumentQueryResponseDocumentAuthor(RedoxAbstractModel):

    Address: "DocumentQueryResponseDocumentAuthorAddress" = 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: "DocumentQueryResponseDocumentAuthorLocation" = Field(None)
    PhoneNumber: "DocumentQueryResponseDocumentAuthorPhoneNumber" = Field(None)
    Type: Union[str, None] = Field(None)


class DocumentQueryResponseDocumentAuthorAddress(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 DocumentQueryResponseDocumentAuthorLocation(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 DocumentQueryResponseDocumentAuthorPhoneNumber(RedoxAbstractModel):

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


class DocumentQueryResponseDocumentLocation(RedoxAbstractModel):

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


class DocumentQueryResponseDocumentType(RedoxAbstractModel):

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


class DocumentQueryResponseDocumentVisit(RedoxAbstractModel):

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


class DocumentQueryResponseMeta(RedoxAbstractModel):

    DataModel: str = Field(...)
    Destinations: List["DocumentQueryResponseMetaDestination"] = Field(None)
    EventDateTime: Union[str, None] = Field(None)
    EventType: str = Field(...)
    FacilityCode: Union[str, None] = Field(None)
    Logs: List["DocumentQueryResponseMetaLog"] = Field(None)
    Message: "DocumentQueryResponseMetaMessage" = Field(None)
    Source: "DocumentQueryResponseMetaSource" = Field(None)
    Test: Union[bool, None] = Field(None)
    Transmission: "DocumentQueryResponseMetaTransmission" = Field(None)


class DocumentQueryResponseMetaDestination(RedoxAbstractModel):

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


class DocumentQueryResponseMetaLog(RedoxAbstractModel):

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


class DocumentQueryResponseMetaMessage(RedoxAbstractModel):

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


class DocumentQueryResponseMetaSource(RedoxAbstractModel):

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


class DocumentQueryResponseMetaTransmission(RedoxAbstractModel):

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


class DocumentQueryResponsePatient(RedoxAbstractModel):

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


class DocumentQueryResponsePatientIdentifier(RedoxAbstractModel):

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


DocumentQueryResponse.update_forward_refs()
DocumentQueryResponseDocument.update_forward_refs()
DocumentQueryResponseDocumentAuthor.update_forward_refs()
DocumentQueryResponseMeta.update_forward_refs()
DocumentQueryResponsePatient.update_forward_refs()
