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

    AuthorizingProvider: "RequestAuthorizingProvider" = Field(None)
    Meta: "RequestMeta" = Field(...)
    OrderingProvider: "RequestOrderingProvider" = Field(None)
    Patient: "RequestPatient" = Field(...)
    Session: "RequestSession" = Field(None)
    UnsignedMedicationOrders: List["RequestUnsignedMedicationOrder"] = Field(...)
    UnsignedProcedureOrders: List["RequestUnsignedProcedureOrder"] = Field(...)


class RequestAuthorizingProvider(RedoxAbstractModel):

    Address: "RequestAuthorizingProviderAddress" = 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: "RequestAuthorizingProviderLocation" = Field(None)
    PhoneNumber: "RequestAuthorizingProviderPhoneNumber" = Field(None)


class RequestAuthorizingProviderAddress(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 RequestAuthorizingProviderLocation(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 RequestAuthorizingProviderPhoneNumber(RedoxAbstractModel):

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


class RequestMeta(RedoxAbstractModel):

    DataModel: str = Field(...)
    Destinations: List["RequestMetaDestination"] = Field(None)
    EventDateTime: Union[str, None] = Field(None)
    EventType: str = Field(...)
    FacilityCode: Union[str, None] = Field(None)
    Logs: List["RequestMetaLog"] = Field(None)
    Message: "RequestMetaMessage" = Field(None)
    Source: "RequestMetaSource" = Field(None)
    Test: Union[bool, None] = Field(None)
    Transmission: "RequestMetaTransmission" = Field(None)


class RequestMetaDestination(RedoxAbstractModel):

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


class RequestMetaLog(RedoxAbstractModel):

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


class RequestMetaMessage(RedoxAbstractModel):

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


class RequestMetaSource(RedoxAbstractModel):

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


class RequestMetaTransmission(RedoxAbstractModel):

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


class RequestOrderingProvider(RedoxAbstractModel):

    Address: "RequestOrderingProviderAddress" = 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: "RequestOrderingProviderLocation" = Field(None)
    PhoneNumber: "RequestOrderingProviderPhoneNumber" = Field(None)


class RequestOrderingProviderAddress(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 RequestOrderingProviderLocation(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 RequestOrderingProviderPhoneNumber(RedoxAbstractModel):

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


class RequestPatient(RedoxAbstractModel):

    Demographics: "RequestPatientDemographics" = Field(None)
    Identifiers: List["RequestPatientIdentifier"] = Field(...)
    Notes: List[str] = Field(None)


class RequestPatientDemographics(RedoxAbstractModel):

    Address: "RequestPatientDemographicsAddress" = 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: "RequestPatientDemographicsPhoneNumber" = 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 RequestPatientDemographicsAddress(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 RequestPatientDemographicsPhoneNumber(RedoxAbstractModel):

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


class RequestPatientIdentifier(RedoxAbstractModel):

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


class RequestSession(RedoxAbstractModel):

    Questions: List["RequestSessionQuestion"] = Field(None)


class RequestSessionQuestion(RedoxAbstractModel):

    Answer: "RequestSessionQuestionAnswer" = Field(None)
    Question: "RequestSessionQuestionQuestion" = Field(None)


class RequestSessionQuestionAnswer(RedoxAbstractModel):

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


class RequestSessionQuestionQuestion(RedoxAbstractModel):

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


class RequestUnsignedMedicationOrder(RedoxAbstractModel):

    Dose: "RequestUnsignedMedicationOrderDose" = Field(None)
    EndDate: Union[str, None] = Field(None)
    Frequency: "RequestUnsignedMedicationOrderFrequency" = Field(None)
    Identifiers: List["RequestUnsignedMedicationOrderIdentifier"] = Field(...)
    MixtureComponents: List["RequestUnsignedMedicationOrderMixtureComponent"] = Field(
        None
    )
    MixtureType: Union[str, None] = Field(None)
    Mode: Union[str, None] = Field(None)
    Notes: List[str] = Field(None)
    Priority: Union[str, None] = Field(None)
    Product: "RequestUnsignedMedicationOrderProduct" = Field(None)
    Questions: List["RequestUnsignedMedicationOrderQuestion"] = Field(None)
    Route: Union[None] = Field(None)
    StartDate: Union[str, None] = Field(None)


class RequestUnsignedMedicationOrderDose(RedoxAbstractModel):

    Quantity: Union[Number, None] = Field(None)
    Units: Union[str, None] = Field(None)


class RequestUnsignedMedicationOrderFrequency(RedoxAbstractModel):

    Period: Union[str, None] = Field(None)
    Unit: Union[str, None] = Field(None)


class RequestUnsignedMedicationOrderIdentifier(RedoxAbstractModel):

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


class RequestUnsignedMedicationOrderMixtureComponent(RedoxAbstractModel):

    Code: Union[str, None] = Field(None)
    CodeType: Union[str, None] = Field(None)
    Dose: "RequestUnsignedMedicationOrderMixtureComponentDose" = Field(None)


class RequestUnsignedMedicationOrderMixtureComponentDose(RedoxAbstractModel):

    Quantity: Union[str, None] = Field(None)
    Units: Union[str, None] = Field(None)


class RequestUnsignedMedicationOrderProduct(RedoxAbstractModel):

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


class RequestUnsignedMedicationOrderQuestion(RedoxAbstractModel):

    Answer: "RequestUnsignedMedicationOrderQuestionAnswer" = Field(None)
    Question: "RequestUnsignedMedicationOrderQuestionQuestion" = Field(None)


class RequestUnsignedMedicationOrderQuestionAnswer(RedoxAbstractModel):

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


class RequestUnsignedMedicationOrderQuestionQuestion(RedoxAbstractModel):

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


class RequestUnsignedProcedureOrder(RedoxAbstractModel):

    BodySite: "RequestUnsignedProcedureOrderBodySite" = Field(None)
    Code: Union[str, None] = Field(None)
    Codeset: Union[str, None] = Field(None)
    Description: Union[str, None] = Field(None)
    EndDate: Union[str, None] = Field(None)
    Identifiers: List["RequestUnsignedProcedureOrderIdentifier"] = Field(...)
    Mode: Union[str, None] = Field(None)
    Notes: List[str] = Field(None)
    Questions: List["RequestUnsignedProcedureOrderQuestion"] = Field(None)
    ScheduledDate: Union[str, None] = Field(None)
    StartDate: Union[str, None] = Field(None)


class RequestUnsignedProcedureOrderBodySite(RedoxAbstractModel):

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


class RequestUnsignedProcedureOrderIdentifier(RedoxAbstractModel):

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


class RequestUnsignedProcedureOrderQuestion(RedoxAbstractModel):

    Answer: "RequestUnsignedProcedureOrderQuestionAnswer" = Field(None)
    Question: "RequestUnsignedProcedureOrderQuestionQuestion" = Field(None)


class RequestUnsignedProcedureOrderQuestionAnswer(RedoxAbstractModel):

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


class RequestUnsignedProcedureOrderQuestionQuestion(RedoxAbstractModel):

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


Request.update_forward_refs()
RequestAuthorizingProvider.update_forward_refs()
RequestMeta.update_forward_refs()
RequestOrderingProvider.update_forward_refs()
RequestPatient.update_forward_refs()
RequestPatientDemographics.update_forward_refs()
RequestSession.update_forward_refs()
RequestSessionQuestion.update_forward_refs()
RequestUnsignedMedicationOrder.update_forward_refs()
RequestUnsignedMedicationOrderMixtureComponent.update_forward_refs()
RequestUnsignedMedicationOrderQuestion.update_forward_refs()
RequestUnsignedProcedureOrder.update_forward_refs()
RequestUnsignedProcedureOrderQuestion.update_forward_refs()
