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

    Meta: "QueryMeta" = Field(...)
    Patient: "QueryPatient" = 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):

    Demographics: "QueryPatientDemographics" = Field(None)
    Identifiers: List["QueryPatientIdentifier"] = Field(None)
    Notes: List[str] = Field(None)


class QueryPatientDemographics(RedoxAbstractModel):

    Address: "QueryPatientDemographicsAddress" = 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: "QueryPatientDemographicsPhoneNumber" = 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 QueryPatientDemographicsAddress(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 QueryPatientDemographicsPhoneNumber(RedoxAbstractModel):

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


class QueryPatientIdentifier(RedoxAbstractModel):

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


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