119 lines
4.1 KiB
C#
119 lines
4.1 KiB
C#
using AutoMapper;
|
|
using IRaCIS.Application.Interfaces;
|
|
using IRaCIS.Application.ViewModels;
|
|
using IRaCIS.Application.ViewModels.Pay;
|
|
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
|
using IRaCIS.Core.Application.Contracts.DTO;
|
|
using IRaCIS.Core.Domain.Models;
|
|
using System.Linq;
|
|
|
|
namespace IRaCIS.Core.Application.Contracts.AutoMapper
|
|
{
|
|
public class DomainToViewModelMappingProfile : Profile
|
|
{
|
|
public DomainToViewModelMappingProfile()
|
|
{
|
|
#region Reviewer
|
|
|
|
CreateMap<Doctor, DoctorBasicInfoCommand>();
|
|
CreateMap<Education, EducationInfoViewModel>();
|
|
|
|
CreateMap<Vacation, VacationCommand>();
|
|
CreateMap<Education, EducationInfoViewModel>();
|
|
CreateMap<ResearchPublication, ResearchPublicationDTO>();
|
|
CreateMap<Postgraduate, PostgraduateViewModel>();
|
|
CreateMap<Attachment, AttachmentDTO>();
|
|
CreateMap<Doctor, ResumeConfirmDTO>();
|
|
|
|
CreateMap<Doctor, DoctorSelectDTO>();
|
|
|
|
CreateMap<Doctor, TrialExperienceViewModel>();
|
|
CreateMap<TrialExperience, TrialExperienceCommand>();
|
|
|
|
CreateMap<Doctor, DoctorBasicInfo>();
|
|
|
|
#endregion
|
|
|
|
#region Management
|
|
|
|
CreateMap<User, UserDetailDTO>();
|
|
CreateMap<Role, RoleDTO>();
|
|
CreateMap<MenuFunction, MenuFunctionDTO>();
|
|
CreateMap<MenuFunction, MenuTreeNodeSelect>();
|
|
|
|
CreateMap<User, UserSelectionModel>();
|
|
|
|
#endregion
|
|
|
|
#region institution
|
|
|
|
CreateMap<Hospital, HospitalDTO>();
|
|
CreateMap<CRO, CROCompanyDTO>();
|
|
CreateMap<Sponsor, SponsorDTO>();
|
|
CreateMap<CRO, CroSelectDTO>();
|
|
CreateMap<Sponsor, SponsorSelectDTO>();
|
|
CreateMap<Site, SiteSelectionDTO>();
|
|
|
|
#endregion
|
|
|
|
#region WrokLoad
|
|
|
|
CreateMap<Workload, WorkloadDTO>();
|
|
|
|
#endregion
|
|
|
|
CreateMap<Dictionary, DicViewModelDTO>();
|
|
|
|
CreateMap<Dictionary, KeyNameType>();
|
|
|
|
#region finacial
|
|
|
|
CreateMap<RankPrice, RankPriceDTO>();
|
|
CreateMap<VolumeReward, AwardPriceDTO>();
|
|
CreateMap<RankPrice, RankDic>();
|
|
CreateMap<ExchangeRate, ExchangeRateCommand>();
|
|
CreateMap<Payment, CalculateNeededDTO>();
|
|
|
|
CreateMap<VolumeReward, AwardPriceCalculateDTO>();
|
|
CreateMap<PaymentDetail, PaymentDetailDTO>();
|
|
|
|
CreateMap<TrialPaymentPrice,TrialSOWPathDTO > ();
|
|
#endregion
|
|
|
|
#region image
|
|
|
|
CreateMap<VisitStage, VisitStageDTO>();
|
|
CreateMap<SubjectVisit, SubjectVisitDTO>();
|
|
CreateMap<StudyStatusDetail, StudyStatusDetailDTO>();
|
|
|
|
CreateMap<VisitStage, VisitStageSelectDTO>();
|
|
CreateMap<DicomInstance, DicomInstanceDTO>();
|
|
CreateMap<DicomStudy, DicomStudyDTO>();
|
|
CreateMap<DicomSeries, DicomSeriesDTO>();
|
|
#endregion
|
|
|
|
#region QA
|
|
CreateMap<QATemplate, QATemplateCommand>();
|
|
CreateMap<QATemplate, QATemplateDTO>();
|
|
|
|
CreateMap<QADictionary, QADictionaryCommand>();
|
|
|
|
|
|
CreateMap<QARecord, QARecordCommand>();
|
|
#endregion
|
|
CreateMap<TrialAttachment, AcquisitionSpecificationDTO>();
|
|
CreateMap<Report, ReportDTO>();
|
|
CreateMap<ImageLabel, ImageLabelDTO>();
|
|
CreateMap<DicomSeries, DicomSeriesWithLabelDTO>();
|
|
|
|
CreateMap<TrialPaymentPrice, TrialPaymentPriceDTO>()
|
|
.ForMember(t => t.TrialCode, u => u.MapFrom(t => t.Trial.Code))
|
|
.ForMember(t => t.ReviewMode, u => u.MapFrom(t => t.Trial.ReviewMode.Value))
|
|
.ForMember(t => t.Cro, u => u.MapFrom(t => t.Trial.CRO.CROName))
|
|
.ForMember(t => t.Indication, u => u.MapFrom(t => t.Trial.Indication))
|
|
.ForMember(t => t.Expedited, u => u.MapFrom(t => t.Trial.Expedited))
|
|
.ForMember(t => t.DoctorsNames, u => u.MapFrom(t => string.Join(",", t.Trial.EnrollList.Select(x => x.Doctor.ChineseName))));
|
|
}
|
|
}
|
|
}
|