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

    Meta: "NewMeta" = Field(...)
    Order: "NewOrder" = Field(...)
    Patient: "NewPatient" = Field(...)
    Visit: "NewVisit" = Field(None)


class NewMeta(RedoxAbstractModel):

    DataModel: str = Field(...)
    Destinations: List["NewMetaDestination"] = Field(None)
    EventDateTime: Union[str, None] = Field(None)
    EventType: str = Field(...)
    FacilityCode: Union[str, None] = Field(None)
    Logs: List["NewMetaLog"] = Field(None)
    Message: "NewMetaMessage" = Field(None)
    Source: "NewMetaSource" = Field(None)
    Test: Union[bool, None] = Field(None)
    Transmission: "NewMetaTransmission" = Field(None)


class NewMetaDestination(RedoxAbstractModel):

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


class NewMetaLog(RedoxAbstractModel):

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


class NewMetaMessage(RedoxAbstractModel):

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


class NewMetaSource(RedoxAbstractModel):

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


class NewMetaTransmission(RedoxAbstractModel):

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


class NewOrder(RedoxAbstractModel):

    EnteredBy: "NewOrderEnteredBy" = Field(None)
    ID: str = Field(...)
    Indications: List["NewOrderIndication"] = Field(None)
    Medication: "NewOrderMedication" = Field(...)
    Notes: List[str] = Field(None)
    Pharmacy: "NewOrderPharmacy" = Field(None)
    Priority: Union[str, None] = Field(None)
    Provider: "NewOrderProvider" = Field(None)
    VerifiedBy: "NewOrderVerifiedBy" = Field(None)


class NewOrderEnteredBy(RedoxAbstractModel):

    Address: "NewOrderEnteredByAddress" = 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: "NewOrderEnteredByLocation" = Field(None)
    PhoneNumber: "NewOrderEnteredByPhoneNumber" = Field(None)


class NewOrderEnteredByAddress(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 NewOrderEnteredByLocation(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 NewOrderEnteredByPhoneNumber(RedoxAbstractModel):

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


class NewOrderIndication(RedoxAbstractModel):

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


class NewOrderMedication(RedoxAbstractModel):

    Components: List["NewOrderMedicationComponent"] = Field(None)
    Dispense: "NewOrderMedicationDispense" = Field(None)
    Dose: "NewOrderMedicationDose" = Field(None)
    EndDate: Union[str, None] = Field(None)
    FreeTextSig: Union[str, None] = Field(None)
    Frequency: "NewOrderMedicationFrequency" = Field(None)
    IsPRN: Union[bool, None] = Field(None)
    NumberOfRefillsRemaining: Union[Number, None] = Field(None)
    Product: "NewOrderMedicationProduct" = Field(...)
    Rate: "NewOrderMedicationRate" = Field(None)
    Route: "NewOrderMedicationRoute" = Field(None)
    StartDate: Union[str, None] = Field(None)


class NewOrderMedicationComponent(RedoxAbstractModel):

    Code: Union[str, None] = Field(None)
    CodeSystem: Union[str, None] = Field(None)
    CodeSystemName: Union[str, None] = Field(None)
    Dose: "NewOrderMedicationComponentDose" = Field(None)
    Name: Union[str, None] = Field(None)
    Type: Union[str, None] = Field(None)


class NewOrderMedicationComponentDose(RedoxAbstractModel):

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


class NewOrderMedicationDispense(RedoxAbstractModel):

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


class NewOrderMedicationDose(RedoxAbstractModel):

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


class NewOrderMedicationFrequency(RedoxAbstractModel):

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


class NewOrderMedicationProduct(RedoxAbstractModel):

    AltCodes: List["NewOrderMedicationProductAltCode"] = Field(None)
    Code: str = Field(...)
    CodeSystem: Union[str, None] = Field(None)
    CodeSystemName: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)


class NewOrderMedicationProductAltCode(RedoxAbstractModel):

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


class NewOrderMedicationRate(RedoxAbstractModel):

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


class NewOrderMedicationRoute(RedoxAbstractModel):

    AltCodes: List["NewOrderMedicationRouteAltCode"] = Field(None)
    Code: Union[str, None] = Field(None)
    CodeSystem: Union[str, None] = Field(None)
    CodeSystemName: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)


class NewOrderMedicationRouteAltCode(RedoxAbstractModel):

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


class NewOrderPharmacy(RedoxAbstractModel):

    Address: "NewOrderPharmacyAddress" = Field(None)
    Code: Union[str, None] = Field(None)
    Codeset: Union[str, None] = Field(None)
    Description: Union[str, None] = Field(None)
    PhoneNumber: "NewOrderPharmacyPhoneNumber" = Field(None)


class NewOrderPharmacyAddress(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 NewOrderPharmacyPhoneNumber(RedoxAbstractModel):

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


class NewOrderProvider(RedoxAbstractModel):

    Address: "NewOrderProviderAddress" = 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: "NewOrderProviderLocation" = Field(None)
    NPI: Union[str, None] = Field(None)
    PhoneNumber: "NewOrderProviderPhoneNumber" = Field(None)


class NewOrderProviderAddress(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 NewOrderProviderLocation(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 NewOrderProviderPhoneNumber(RedoxAbstractModel):

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


class NewOrderVerifiedBy(RedoxAbstractModel):

    Address: "NewOrderVerifiedByAddress" = 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: "NewOrderVerifiedByLocation" = Field(None)
    PhoneNumber: "NewOrderVerifiedByPhoneNumber" = Field(None)


class NewOrderVerifiedByAddress(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 NewOrderVerifiedByLocation(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 NewOrderVerifiedByPhoneNumber(RedoxAbstractModel):

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


class NewPatient(RedoxAbstractModel):

    Allergies: List["NewPatientAllergy"] = Field(None)
    Demographics: "NewPatientDemographics" = Field(None)
    Identifiers: List["NewPatientIdentifier"] = Field(...)
    Notes: List[str] = Field(None)


class NewPatientAllergy(RedoxAbstractModel):

    AltCodes: List["NewPatientAllergyAltCode"] = Field(None)
    Code: Union[str, None] = Field(None)
    CodeSystem: Union[str, None] = Field(None)
    CodeSystemName: Union[str, None] = Field(None)
    Comment: Union[str, None] = Field(None)
    Criticality: "NewPatientAllergyCriticality" = Field(None)
    EndDate: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)
    Reaction: List["NewPatientAllergyReaction"] = Field(None)
    Severity: "NewPatientAllergySeverity" = Field(None)
    StartDate: Union[str, None] = Field(None)
    Status: "NewPatientAllergyStatus" = Field(None)
    Substance: "NewPatientAllergySubstance" = Field(None)


class NewPatientAllergyAltCode(RedoxAbstractModel):

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


class NewPatientAllergyCriticality(RedoxAbstractModel):

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


class NewPatientAllergyReaction(RedoxAbstractModel):

    AltCodes: List["NewPatientAllergyReactionAltCode"] = Field(None)
    Code: Union[str, None] = Field(None)
    CodeSystem: Union[str, None] = Field(None)
    CodeSystemName: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)
    Severity: "NewPatientAllergyReactionSeverity" = Field(None)
    Text: Union[str, None] = Field(None)


class NewPatientAllergyReactionAltCode(RedoxAbstractModel):

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


class NewPatientAllergyReactionSeverity(RedoxAbstractModel):

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


class NewPatientAllergySeverity(RedoxAbstractModel):

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


class NewPatientAllergyStatus(RedoxAbstractModel):

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


class NewPatientAllergySubstance(RedoxAbstractModel):

    AltCodes: List["NewPatientAllergySubstanceAltCode"] = Field(None)
    Code: Union[str, None] = Field(None)
    CodeSystem: Union[str, None] = Field(None)
    CodeSystemName: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)


class NewPatientAllergySubstanceAltCode(RedoxAbstractModel):

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


class NewPatientDemographics(RedoxAbstractModel):

    Address: "NewPatientDemographicsAddress" = 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: "NewPatientDemographicsPhoneNumber" = 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 NewPatientDemographicsAddress(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 NewPatientDemographicsPhoneNumber(RedoxAbstractModel):

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


class NewPatientIdentifier(RedoxAbstractModel):

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


class NewVisit(RedoxAbstractModel):

    AccountNumber: Union[str, None] = Field(None)
    AttendingProvider: "NewVisitAttendingProvider" = Field(None)
    Insurances: List["NewVisitInsurance"] = Field(None)
    Location: "NewVisitLocation" = Field(None)
    PatientClass: Union[str, None] = Field(None)
    ReferringProvider: "NewVisitReferringProvider" = Field(None)
    VisitDateTime: Union[str, None] = Field(None)
    VisitNumber: Union[str, None] = Field(None)


class NewVisitAttendingProvider(RedoxAbstractModel):

    Address: "NewVisitAttendingProviderAddress" = 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: "NewVisitAttendingProviderLocation" = Field(None)
    PhoneNumber: "NewVisitAttendingProviderPhoneNumber" = Field(None)


class NewVisitAttendingProviderAddress(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 NewVisitAttendingProviderLocation(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 NewVisitAttendingProviderPhoneNumber(RedoxAbstractModel):

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


class NewVisitInsurance(RedoxAbstractModel):

    AgreementType: Union[str, None] = Field(None)
    Company: "NewVisitInsuranceCompany" = Field(None)
    CoverageType: Union[str, None] = Field(None)
    EffectiveDate: Union[str, None] = Field(None)
    ExpirationDate: Union[str, None] = Field(None)
    GroupName: Union[str, None] = Field(None)
    GroupNumber: Union[str, None] = Field(None)
    Insured: "NewVisitInsuranceInsured" = Field(None)
    MemberNumber: Union[str, None] = Field(None)
    Plan: "NewVisitInsurancePlan" = Field(None)
    PolicyNumber: Union[str, None] = Field(None)
    Priority: Union[str, None] = Field(None)


class NewVisitInsuranceCompany(RedoxAbstractModel):

    Address: "NewVisitInsuranceCompanyAddress" = Field(None)
    ID: Union[str, None] = Field(None)
    IDType: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)
    PhoneNumber: Union[str, None] = Field(None)


class NewVisitInsuranceCompanyAddress(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 NewVisitInsuranceInsured(RedoxAbstractModel):

    Address: "NewVisitInsuranceInsuredAddress" = Field(None)
    DOB: Union[str, None] = Field(None)
    FirstName: Union[str, None] = Field(None)
    Identifiers: List["NewVisitInsuranceInsuredIdentifier"] = Field(None)
    LastName: Union[str, None] = Field(None)
    MiddleName: Union[str, None] = Field(None)
    Relationship: Union[str, None] = Field(None)
    Sex: Union[str, None] = Field(None)
    SSN: Union[str, None] = Field(None)


class NewVisitInsuranceInsuredAddress(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 NewVisitInsuranceInsuredIdentifier(RedoxAbstractModel):

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


class NewVisitInsurancePlan(RedoxAbstractModel):

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


class NewVisitLocation(RedoxAbstractModel):

    Bed: Union[str, None] = Field(None)
    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 NewVisitReferringProvider(RedoxAbstractModel):

    Address: "NewVisitReferringProviderAddress" = 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: "NewVisitReferringProviderLocation" = Field(None)
    PhoneNumber: "NewVisitReferringProviderPhoneNumber" = Field(None)


class NewVisitReferringProviderAddress(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 NewVisitReferringProviderLocation(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 NewVisitReferringProviderPhoneNumber(RedoxAbstractModel):

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


New.update_forward_refs()
NewMeta.update_forward_refs()
NewOrder.update_forward_refs()
NewOrderEnteredBy.update_forward_refs()
NewOrderMedication.update_forward_refs()
NewOrderMedicationComponent.update_forward_refs()
NewOrderMedicationProduct.update_forward_refs()
NewOrderMedicationRoute.update_forward_refs()
NewOrderPharmacy.update_forward_refs()
NewOrderProvider.update_forward_refs()
NewOrderVerifiedBy.update_forward_refs()
NewPatient.update_forward_refs()
NewPatientAllergy.update_forward_refs()
NewPatientAllergyReaction.update_forward_refs()
NewPatientAllergySubstance.update_forward_refs()
NewPatientDemographics.update_forward_refs()
NewVisit.update_forward_refs()
NewVisitAttendingProvider.update_forward_refs()
NewVisitInsurance.update_forward_refs()
NewVisitInsuranceCompany.update_forward_refs()
NewVisitInsuranceInsured.update_forward_refs()
NewVisitReferringProvider.update_forward_refs()
