using IRaCIS.Core.Domain.Share;

namespace IRaCIS.Core.Domain.Models;

[Comment("读片模块")]
[Table("ReadModule")]
public class ReadModule : BaseFullDeleteAuditEntity
{
    #region 导航属性

    [JsonIgnore]
    [Comment("受试者")]
    [ForeignKey("SubjectId")]

    public Subject Subject { get; set; }

    [JsonIgnore]
    [Comment("阅片期配置")]
    [ForeignKey("ReadingPeriodSetId")]
    public ReadingPeriodSet ReadingPeriodSet { get; set; }

    [JsonIgnore]
    [Comment("访视")]
    [ForeignKey("SubjectVisitId")]
    public SubjectVisit SubjectVisit { get; set; }

    [JsonIgnore]
    [ForeignKey("TrialId")]
    public Trial Trial { get; set; }
    [JsonIgnore]
    public List<ReadModuleCriterionFrom> ReadModuleCriterionFromList { get; set; } = new List<ReadModuleCriterionFrom>();
    [JsonIgnore]
    public List<VisitTask> ModuleTaskList { get; set; }
    [JsonIgnore]
    public ReadingQuestionCriterionTrial TrialReadingCriterion { get; set; }

    [JsonIgnore]
    public List<ReadingClinicalData> ReadingClinicalDataList { get; set; }
    #endregion
    public Guid SubjectId { get; set; }

    public Guid TrialReadingCriterionId { get; set; }

    [Comment("模块类型")]
    public ModuleTypeEnum ModuleType { get; set; }

    [Comment("模块名称")]
    public string ModuleName { get; set; } = string.Empty;

    [Comment("是否加急")]
    public bool? IsUrgent { get; set; }

    public Guid SubjectVisitId { get; set; }
    [Comment("阅片计划ID")]
    public Guid? ReadingPeriodSetId { get; set; }

    /// <summary>
    /// 阅片计划
    /// </summary>
    public Guid? ReadingPeriodPlanId { get; set; }

    public Guid TrialId { get; set; }
    public bool IsCRCConfirm { get; set; } = false;

    public bool IsPMConfirm { get; set; } = false;

    public bool IsNotNeedPMConfirm { get; set; } = false;

    [Comment("CRC是否正在申请撤回")]
    public bool IsCRCApplicationRevoke { get; set; } = false;
    [Comment("临床数据是否完整")]
    public bool? IsClinicalDataComplete { get; set; }

    [Comment("临床数据是否盲化")]
    public bool? IsClinicalDataBlind { get; set; }

    [Comment("阅片配置的类型")]
    public ReadingSetType ReadingSetType { get; set; }

    /// <summary>
    /// 添加方式
    /// </summary>
    public ReadModuleAddType ReadModuleAddTypeEnum { get; set; } = ReadModuleAddType.Normal;


    public ReadingStatusEnum ReadingStatus { get; set; } = ReadingStatusEnum.TaskAllocate;
}
