using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Domain.Share;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IRaCIS.Core.Application.Service.Third_partyProject.DTO
{
   
    public class TrialListDTO_UltrasonicDicom: TrialBaseInfoDto
    {
        public DateTime CreateTime { get; set; }

        public string Sponsor { get; set; }
        public string TrialStatusStr { get; set; }
    }

    public class VisitTaskQuery_UltrasonicDicom : PageInput
    {
        [NotDefault]
        public Guid TrialId { get; set; }

        public Guid? TrialSiteId { get; set; }

        public Guid? SubjectId { get; set; }

        public string SubjectCode { get; set; } = String.Empty;

        public bool? IsUrgent { get; set; }

        public string TaskName { get; set; } = String.Empty;

        public Guid? DoctorUserId { get; set; }

        public string? TaskCode { get; set; }

        public String? TrialSiteCode { get; set; }

        public Arm? ArmEnum { get; set; }

        public Guid? TrialReadingCriterionId { get; set; }



    }
    public class VisitTaskDTO_UltrasonicDicom
    {
        public Guid Id { get;set; }
        public Guid SubjectId { get; set; }

        public Guid TrialSiteId { get; set; }

        public Guid? SubjectVisitId { get; set; }

        public String TrialSiteCode { get; set; } = String.Empty;
        public string SubjectCode { get; set; } = String.Empty;
        public string UserName { get; set; }
        public string FullName { get; set; }
        public Arm ArmEnum { get; set; }
        public Guid? DoctorUserId { get; set; }
        public string TaskCode { get; set; }
        public string TaskName { get; set; }
        public string TaskBlindName { get; set; }

        public decimal VisitTaskNum { get; set; }

        public int ImageStudyState { get; set; }

        public Guid TrialReadingCriterionId { get; set; }
        public string TrialReadingCriterionName { get; set; }

        public List<string> StudyInstanceUidList { get; set; }
    }

    public class UpdateTaskImageStateCommand
    {
        [NotDefault]
        public  Guid VisitTaskId { get; set; }
        public int ImageStudyState { get; set; }
    }


    public class StudyDTO_UltrasonicDicom : UnionStudyViewModel
    {

    }

    public class StudySeriesModality
    {
        public Guid StudyId { get; set; }

        public int SeriesCount { get; set; }

        public string StudyCode { get; set; }


        public List<ModalitySeriesIdList> ModalitySeriesList => SeriesModalityList.GroupBy(t=>t.Modality).Select(g=>new ModalitySeriesIdList() { Modality= g.Key,SeriesIdList=g.Select(t=>t.SeriesId).ToList() }).ToList(); 

        public List<SeriesModality> SeriesModalityList { get; set; }

    }

    public class StudySeriesModalitySelectDTO
    {
        public Guid StudyId { get; set; }

        public List<Guid> SeriesIdList { get; set; }
    }


    public class ModalitySeriesIdList
    {
        public string Modality { get; set; }

        public List<Guid> SeriesIdList { get; set; }
    }
    public class SeriesModality
    {
        public Guid SeriesId { get; set; }

        public string Modality { get; set; }
    }

    public class InstancePathDTO
    {
        public string StudyInstanceUid { get; set; }
        public string SopInstanceUid { get; set; }
        public string StudyCode { get; set; }
        public string InstancePath { get; set; }
    }



}
