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

    Document: "DocumentQueryDocument" = Field(None)
    Location: "DocumentQueryLocation" = Field(None)
    Meta: "DocumentQueryMeta" = Field(...)
    Patient: "DocumentQueryPatient" = Field(...)
    Visit: "DocumentQueryVisit" = Field(None)


class DocumentQueryDocument(RedoxAbstractModel):

    EndDate: Union[str, None] = Field(None)
    StartDate: Union[str, None] = Field(None)
    Types: List["DocumentQueryDocumentType"] = Field(None)


class DocumentQueryDocumentType(RedoxAbstractModel):

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


class DocumentQueryLocation(RedoxAbstractModel):

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


class DocumentQueryMeta(RedoxAbstractModel):

    DataModel: str = Field(...)
    Destinations: List["DocumentQueryMetaDestination"] = Field(None)
    EventDateTime: Union[str, None] = Field(None)
    EventType: str = Field(...)
    FacilityCode: Union[str, None] = Field(None)
    Logs: List["DocumentQueryMetaLog"] = Field(None)
    Message: "DocumentQueryMetaMessage" = Field(None)
    Source: "DocumentQueryMetaSource" = Field(None)
    Test: Union[bool, None] = Field(None)
    Transmission: "DocumentQueryMetaTransmission" = Field(None)


class DocumentQueryMetaDestination(RedoxAbstractModel):

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


class DocumentQueryMetaLog(RedoxAbstractModel):

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


class DocumentQueryMetaMessage(RedoxAbstractModel):

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


class DocumentQueryMetaSource(RedoxAbstractModel):

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


class DocumentQueryMetaTransmission(RedoxAbstractModel):

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


class DocumentQueryPatient(RedoxAbstractModel):

    Identifiers: List["DocumentQueryPatientIdentifier"] = Field(...)


class DocumentQueryPatientIdentifier(RedoxAbstractModel):

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


class DocumentQueryVisit(RedoxAbstractModel):

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


DocumentQuery.update_forward_refs()
DocumentQueryDocument.update_forward_refs()
DocumentQueryMeta.update_forward_refs()
DocumentQueryPatient.update_forward_refs()
