using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace Strata.Code.DataAccess.Models;

[Table("DimDepartment", Schema = "fw")]
[Index("DepartmentRollup1Id", Name = "IX_DepartmentRollup1ID")]
[Index("DepartmentRollup2Id", Name = "IX_DepartmentRollup2ID")]
[Index("DepartmentRollup3Id", Name = "IX_DepartmentRollup3ID")]
[Index("DepartmentRollup4Id", Name = "IX_DepartmentRollup4ID")]
[Index("DepartmentRollup5Id", Name = "IX_DepartmentRollup5ID")]
[Index("DepartmentRollup6Id", Name = "IX_DepartmentRollup6ID")]
[Index("DepartmentId", "DepartmentRollup1Id", "DepartmentRollup2Id", "DepartmentRollup3Id", "DepartmentRollup4Id", "DepartmentRollup5Id", "DepartmentRollup6Id", Name = "IX_Hierarchy")]
[Index("MemberGuid", Name = "IX_MemberGUID")]
[Index("IsMrorPr", "DepartmentId", Name = "NCNU_DimDepartment_IsMRorPR_DepartmentID")]
[Index("DepartmentId", "EntityId", Name = "NCNU_EntityID")]
[Index("DepartmentCode", Name = "NCU_DepartmentCode", IsUnique = true)]
public partial class DimDepartment
{
    [Key]
    [Column("DepartmentID")]
    public int DepartmentId { get; set; }

    [Column("MemberGUID")]
    public Guid MemberGuid { get; set; }

    [StringLength(100)]
    public string DepartmentCode { get; set; } = null!;

    [StringLength(100)]
    public string Description { get; set; } = null!;

    [Column("SystemID")]
    public short SystemId { get; set; }

    [StringLength(100)]
    public string System { get; set; } = null!;

    public int SystemSortOrder { get; set; }

    [Column("EntityID")]
    public int EntityId { get; set; }

    [StringLength(303)]
    public string? Entity { get; set; }

    public int EntitySortOrder { get; set; }

    public short EntityTypeOverride { get; set; }

    [Column("DepartmentRollup1ID")]
    public short DepartmentRollup1Id { get; set; }

    [StringLength(200)]
    public string DepartmentRollup1 { get; set; } = null!;

    public int DepartmentRollup1SortOrder { get; set; }

    [Column("DepartmentRollup2ID")]
    public short DepartmentRollup2Id { get; set; }

    [StringLength(200)]
    public string DepartmentRollup2 { get; set; } = null!;

    public int DepartmentRollup2SortOrder { get; set; }

    [Column("DepartmentRollup3ID")]
    public short DepartmentRollup3Id { get; set; }

    [StringLength(200)]
    public string DepartmentRollup3 { get; set; } = null!;

    public int DepartmentRollup3SortOrder { get; set; }

    [Column("DepartmentRollup4ID")]
    public int DepartmentRollup4Id { get; set; }

    [StringLength(200)]
    public string DepartmentRollup4 { get; set; } = null!;

    public int DepartmentRollup4SortOrder { get; set; }

    [Column("DepartmentRollup5ID")]
    public short DepartmentRollup5Id { get; set; }

    [StringLength(200)]
    public string DepartmentRollup5 { get; set; } = null!;

    public int DepartmentRollup5SortOrder { get; set; }

    [Column("DepartmentRollup6ID")]
    public short DepartmentRollup6Id { get; set; }

    [StringLength(200)]
    public string DepartmentRollup6 { get; set; } = null!;

    public int DepartmentRollup6SortOrder { get; set; }

    [Column("CareSettingID")]
    public int CareSettingId { get; set; }

    [StringLength(100)]
    public string CareSetting { get; set; } = null!;

    public int SortOrder { get; set; }

    public bool IsDepartmentRollup { get; set; }

    [Column("FunctionalAreaID")]
    public int FunctionalAreaId { get; set; }

    [StringLength(100)]
    public string FunctionalArea { get; set; } = null!;

    [Column("ResearchDepartmentCategoryID")]
    public int ResearchDepartmentCategoryId { get; set; }

    [StringLength(100)]
    public string ResearchDepartmentCategoryName { get; set; } = null!;

    public int ResearchDepartmentCategorySortOrder { get; set; }

    [Column("AttributionTypeID")]
    public int AttributionTypeId { get; set; }

    [StringLength(200)]
    public string AttributionType { get; set; } = null!;

    [Column("CAPIsDefined")]
    public bool CapisDefined { get; set; }

    [Column("IsCAP")]
    public bool IsCap { get; set; }

    [Column("DSSIsDefined")]
    public bool DssisDefined { get; set; }

    [Column("IsDSS")]
    public bool IsDss { get; set; }

    [Column("DepartmentTypeOLD")]
    [StringLength(100)]
    public string DepartmentTypeOld { get; set; } = null!;

    [Column("DSSDeptGrouping")]
    [StringLength(200)]
    public string DssdeptGrouping { get; set; } = null!;

    [Column("DSSDepartmentRollup1ID")]
    public int DssdepartmentRollup1Id { get; set; }

    [Column("DSSDepartmentRollup1Name")]
    [StringLength(100)]
    public string DssdepartmentRollup1Name { get; set; } = null!;

    [Column("DSSDepartmentRollup2ID")]
    public int DssdepartmentRollup2Id { get; set; }

    [Column("DSSDepartmentRollup2Name")]
    [StringLength(100)]
    public string DssdepartmentRollup2Name { get; set; } = null!;

    [Column("DSSDepartmentRollup3ID")]
    public int DssdepartmentRollup3Id { get; set; }

    [Column("DSSDepartmentRollup3Name")]
    [StringLength(100)]
    public string DssdepartmentRollup3Name { get; set; } = null!;

    public bool IsOverhead { get; set; }

    [Column("OBIsDefined")]
    public bool ObisDefined { get; set; }

    [Column("IsOB")]
    public bool IsOb { get; set; }

    [Column("IsMRPlan")]
    public bool IsMrplan { get; set; }

    public bool IsActive { get; set; }

    public bool IsVariable { get; set; }

    public bool IsAccountFlexing { get; set; }

    [Column("FlexingBucketGUID")]
    public Guid FlexingBucketGuid { get; set; }

    [Column("OBGlobalStatisticsPlanID")]
    public int ObglobalStatisticsPlanId { get; set; }

    [Column("OBGlobalStatisticsPlan")]
    [StringLength(1000)]
    public string ObglobalStatisticsPlan { get; set; } = null!;

    [Column("OBReimbursementPlanID")]
    public int ObreimbursementPlanId { get; set; }

    [Column("OBReimbursementPlan")]
    [StringLength(458)]
    public string ObreimbursementPlan { get; set; } = null!;

    [Column("OBServiceLinePlanID")]
    public int ObserviceLinePlanId { get; set; }

    [Column("OBServiceLinePlan")]
    [StringLength(458)]
    public string ObserviceLinePlan { get; set; } = null!;

    [Column("SPIsDefined")]
    public bool SpisDefined { get; set; }

    [Column("IsLRFP")]
    public bool IsLrfp { get; set; }

    [Column("RollingPlanID")]
    public int RollingPlanId { get; set; }

    [Column("SPRollingForecastPlanName")]
    [StringLength(200)]
    public string SprollingForecastPlanName { get; set; } = null!;

    [Column("OpsPlanID")]
    public int OpsPlanId { get; set; }

    [Column("SPOperationsPlanName")]
    [StringLength(200)]
    public string SpoperationsPlanName { get; set; } = null!;

    [Column("BalPlanID")]
    public int BalPlanId { get; set; }

    [Column("SPBalanceSheetPlanName")]
    [StringLength(200)]
    public string SpbalanceSheetPlanName { get; set; } = null!;

    public byte PatientTypeRollup { get; set; }

    [StringLength(100)]
    public string PatientTypeRollupName { get; set; } = null!;

    [Column("SPJobCodeGroup")]
    public int SpjobCodeGroup { get; set; }

    [Column("SPJobCodeGroupName")]
    [StringLength(100)]
    public string SpjobCodeGroupName { get; set; } = null!;

    [Column("SPPhysicianGroup")]
    public int SpphysicianGroup { get; set; }

    [Column("SPPhysicianGroupName")]
    [StringLength(100)]
    public string SpphysicianGroupName { get; set; } = null!;

    [Column("SPAccountRollup")]
    public int SpaccountRollup { get; set; }

    [Column("SPAccountRollupName")]
    [StringLength(100)]
    public string SpaccountRollupName { get; set; } = null!;

    [Column("SPServiceLineForecastType")]
    public short SpserviceLineForecastType { get; set; }

    [StringLength(100)]
    public string ConsolidatedCode { get; set; } = null!;

    public bool IsConsolidated { get; set; }

    [Column("TransactionID")]
    public int TransactionId { get; set; }

    [Column("HistoryItemGUID")]
    public Guid HistoryItemGuid { get; set; }

    public byte[] Version { get; set; } = null!;

    [StringLength(203)]
    public string Name { get; set; } = null!;

    [Column("SecureGroupID")]
    public int SecureGroupId { get; set; }

    [Column("WorkWeekID")]
    public int WorkWeekId { get; set; }

    [Column("CAPDefaultSalesTax")]
    public double CapdefaultSalesTax { get; set; }

    [StringLength(100)]
    public string EntityCode { get; set; } = null!;

    [Column("FundID")]
    public int FundId { get; set; }

    [StringLength(100)]
    public string Fund { get; set; } = null!;

    public int FundSortOrder { get; set; }

    [Column("ProjectID")]
    public int ProjectId { get; set; }

    [StringLength(100)]
    public string Project { get; set; } = null!;

    public int ProjectSortOrder { get; set; }

    [Column("HomeDepartmentID")]
    public int HomeDepartmentId { get; set; }

    [StringLength(100)]
    public string HomeDepartment { get; set; } = null!;

    public int HomeDepartmentSortOrder { get; set; }

    [Column("ProgramID")]
    public int ProgramId { get; set; }

    [StringLength(100)]
    public string Program { get; set; } = null!;

    public int ProgramSortOrder { get; set; }

    [Column("PayCycleID")]
    public int PayCycleId { get; set; }

    [Column("FWIsDefined")]
    public bool FwisDefined { get; set; }

    [Column("DepartmentTypeID")]
    public int DepartmentTypeId { get; set; }

    [StringLength(200)]
    public string DepartmentType { get; set; } = null!;

    [StringLength(100)]
    public string DepartmentCodeRaw { get; set; } = null!;

    [Column("IsPR")]
    public bool IsPr { get; set; }

    [Column("MRVicePresident")]
    [StringLength(400)]
    public string MrvicePresident { get; set; } = null!;

    [Column("MRDirector")]
    [StringLength(400)]
    public string Mrdirector { get; set; } = null!;

    [Column("MRManager")]
    [StringLength(400)]
    public string Mrmanager { get; set; } = null!;

    [Column("IsMROrPR")]
    public int IsMrorPr { get; set; }

    [Column("IsMRMetricTracking")]
    public bool IsMrmetricTracking { get; set; }

    public bool IsHealthPlanAdmin { get; set; }

    [StringLength(200)]
    public string DepartmentRollup1Code { get; set; } = null!;

    [StringLength(200)]
    public string DepartmentRollup2Code { get; set; } = null!;

    [StringLength(200)]
    public string DepartmentRollup3Code { get; set; } = null!;

    [StringLength(200)]
    public string DepartmentRollup4Code { get; set; } = null!;

    [StringLength(200)]
    public string DepartmentRollup5Code { get; set; } = null!;

    [StringLength(200)]
    public string DepartmentRollup6Code { get; set; } = null!;

    [Column("DSSDepartmentRollup4Name")]
    [StringLength(100)]
    public string DssdepartmentRollup4Name { get; set; } = null!;

    [Column("DSSDepartmentRollup4ID")]
    public int DssdepartmentRollup4Id { get; set; }

    [Column("DSSDepartmentRollup5ID")]
    public int DssdepartmentRollup5Id { get; set; }

    [Column("DSSDepartmentRollup5Name")]
    [StringLength(100)]
    public string DssdepartmentRollup5Name { get; set; } = null!;

    [Column("DSSDepartmentRollup6ID")]
    public int DssdepartmentRollup6Id { get; set; }

    [Column("DSSDepartmentRollup6Name")]
    [StringLength(200)]
    public string DssdepartmentRollup6Name { get; set; } = null!;

    [Column("DSSDepartmentRollup7ID")]
    public int DssdepartmentRollup7Id { get; set; }

    [Column("DSSDepartmentRollup7Name")]
    [StringLength(100)]
    public string DssdepartmentRollup7Name { get; set; } = null!;

    [Column("SPHDepartmentRollupID")]
    public int SphdepartmentRollupId { get; set; }

    [Column("SPHDepartmentRollupName")]
    [StringLength(200)]
    public string SphdepartmentRollupName { get; set; } = null!;

    [Column("SPHDepartmentRollupConfidenceScore")]
    public double SphdepartmentRollupConfidenceScore { get; set; }

    [Column("SPHDepartmentTypeID")]
    public int SphdepartmentTypeId { get; set; }

    [Column("SPHDepartmentType")]
    [StringLength(200)]
    public string SphdepartmentType { get; set; } = null!;

    public bool IsClaimsCosting { get; set; }

    [Column("SPHDepartmentRollupIsValidated")]
    public bool SphdepartmentRollupIsValidated { get; set; }

    [Column("CompAnDepartmentID")]
    public int CompAnDepartmentId { get; set; }

    [Column("ProductivityPercentileID")]
    public int ProductivityPercentileId { get; set; }

    [StringLength(200)]
    public string ProductivityPercentile { get; set; } = null!;

    [StringLength(200)]
    public string CompAnDepartment { get; set; } = null!;

    [Column("SPHDepartmentID")]
    public int SphdepartmentId { get; set; }

    [Column("SPHDepartmentConfidenceScore")]
    public double SphdepartmentConfidenceScore { get; set; }

    [Column("SPHDepartmentIsValidated")]
    public bool SphdepartmentIsValidated { get; set; }

    [Column("SPHDepartmentName")]
    [StringLength(200)]
    public string SphdepartmentName { get; set; } = null!;

    [InverseProperty("Department")]
    public virtual ICollection<ChargeVolumeSpread> ChargeVolumeSpreads { get; set; } = new List<ChargeVolumeSpread>();

    [InverseProperty("Department")]
    public virtual ICollection<DepartmentConfig> DepartmentConfigs { get; set; } = new List<DepartmentConfig>();

    [InverseProperty("Department")]
    public virtual ICollection<GeneralLedger> GeneralLedgers { get; set; } = new List<GeneralLedger>();

    [InverseProperty("Department")]
    public virtual ICollection<ProviderCompensationSpread> ProviderCompensationSpreads { get; set; } = new List<ProviderCompensationSpread>();

    [InverseProperty("Department")]
    public virtual ICollection<StaffingSpread> StaffingSpreads { get; set; } = new List<StaffingSpread>();

    [InverseProperty("Department")]
    public virtual ICollection<StatisticsSpread> StatisticsSpreads { get; set; } = new List<StatisticsSpread>();
}
