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

    EndDateTime: Union[str, None] = Field(None)
    Meta: "QueryMeta" = Field(...)
    OrderIDs: List[str] = Field(None)
    Patients: List["QueryPatient"] = Field(None)
    Procedures: List["QueryProcedure"] = Field(None)
    StartDateTime: Union[str, None] = Field(None)
    VisitNumbers: List[str] = Field(None)


class QueryMeta(RedoxAbstractModel):

    DataModel: str = Field(...)
    Destinations: List["QueryMetaDestination"] = Field(None)
    EventDateTime: Union[str, None] = Field(None)
    EventType: str = Field(...)
    FacilityCode: Union[str, None] = Field(None)
    Logs: List["QueryMetaLog"] = Field(None)
    Message: "QueryMetaMessage" = Field(None)
    Source: "QueryMetaSource" = Field(None)
    Test: Union[bool, None] = Field(None)
    Transmission: "QueryMetaTransmission" = Field(None)


class QueryMetaDestination(RedoxAbstractModel):

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


class QueryMetaLog(RedoxAbstractModel):

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


class QueryMetaMessage(RedoxAbstractModel):

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


class QueryMetaSource(RedoxAbstractModel):

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


class QueryMetaTransmission(RedoxAbstractModel):

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


class QueryPatient(RedoxAbstractModel):

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


class QueryPatientIdentifier(RedoxAbstractModel):

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


class QueryProcedure(RedoxAbstractModel):

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


Query.update_forward_refs()
QueryMeta.update_forward_refs()
QueryPatient.update_forward_refs()
