diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 10cef6aa9..567a0b076 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -427,6 +427,41 @@ + + + 截止访视 + + + + + 项目ID + + + + + 阅片期名称 + + + + + 页码 + + + + + 每页大小 + + + + + 排序字段 + + + + + 排序字段 + + 页码 @@ -2520,6 +2555,27 @@ + + + 新增或者修改 + + + + + + + 分页获取 + + + + + + + 删除 + + + + 新增或者修改 diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalDataService.cs new file mode 100644 index 000000000..9f10fcf8d --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalDataService.cs @@ -0,0 +1,74 @@ +using IRaCIS.Application.Interfaces; +using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Application.Filter; +using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Service.WorkLoad.DTO; +using Microsoft.AspNetCore.Authorization; +using IRaCIS.Core.Application.Auth; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Domain.Share.Reading; + +namespace IRaCIS.Application.Services +{ + [ApiExplorerSettings(GroupName = "Reading")] + public class ClinicalDataService : BaseService + { + + public IRepository _subjectVisitRepository; + private readonly IRepository _clinicalDataRepository; + public ClinicalDataService(IRepository subjectVisitRepository, + IRepository clinicalDataRepository + ) + { + _subjectVisitRepository = subjectVisitRepository; + _clinicalDataRepository = clinicalDataRepository; + } + + + /// + /// 新增或者修改 + /// + /// + /// + [HttpPost] + public async Task AddOrUpdateClinicalDataService(ClinicalDataAddOrEdit addOrEditClinicalData) + { + var entity = await _repository.InsertOrUpdateAsync(addOrEditClinicalData, true); + return ResponseOutput.Ok(entity.Id.ToString()); + } + + /// + /// 分页获取 + /// + /// + /// + [HttpPost] + public async Task> GetClinicalDataList(ClinicalDataQuery query) + { + + var readquery = _clinicalDataRepository.AsQueryable() + .WhereIf(query.TrialId!=null,x=>x.TrialId==query.TrialId) + + .ProjectTo(_mapper.ConfigurationProvider); + var pageList= await readquery.ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField == null ? "CreateTime" : query.SortField, + query.SortAsc); + + return pageList; + } + + + + /// + /// 删除 + /// + /// + /// + [HttpDelete("{ClinicalDataId:guid}")] + public async Task DeleteClinicalData(Guid clinicalDataId) + { + var success = await _repository.BatchDeleteAsync(t => t.Id == clinicalDataId); + return ResponseOutput.Result(success); + } + } +} diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalDataServiceViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalDataServiceViewModel.cs new file mode 100644 index 000000000..bb483d68e --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalDataServiceViewModel.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Application.Service.Reading.Dto +{ + public class ClinicalDataAddOrEdit : ClinicalData + { + public new Guid? Id { get; set; } + + } + + + public class ClinicalDataView : ClinicalData + { + + } + + public class ClinicalDataQuery + { + /// + /// 项目ID + /// + public Guid? TrialId { get; set; } + + + + /// + /// 页码 + /// + public int PageIndex { get; set; } = 1; + + /// + /// 每页大小 + /// + public int PageSize { get; set; } = 10; + + + /// + /// 排序字段 + /// + public string? SortField { get; set; } + + /// + /// 排序字段 + /// + public bool SortAsc { get; set; } = true; + } +} diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs index ff7079dd0..1cb904a9b 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs @@ -8,7 +8,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public class ReadingPeriodSetAddOrEdit : ReadingPeriodSet { - } + public new Guid? Id { get; set; } + + } public class ReadingPeriodSetView : ReadingPeriodSet diff --git a/IRaCIS.Core.Domain/Reading/ClinicalData.cs b/IRaCIS.Core.Domain/Reading/ClinicalData.cs new file mode 100644 index 000000000..d8f99a565 --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/ClinicalData.cs @@ -0,0 +1,62 @@ + + +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using IRaCIS.Core.Domain.Share.Reading; + +namespace IRaCIS.Core.Domain.Models +{ + /// + /// 临床资料 + /// + [Table("ClinicalData")] + public class ClinicalData : Entity, IAuditAdd + { + + /// + /// 项目ID + /// + public Guid? TrialId { get; set; } + + /// + /// 受试者ID + /// + public Guid? SubjectId { get; set; } + + /// + /// 访视或者阅片ID + /// + public Guid? VisitOrReadId { get; set; } + + /// + /// 分组类型 + /// + public int? ScopeType { get; set; } + + /// + /// 数据类型 + /// + public int? DataType { get; set; } + + /// + /// 上传方式 + /// + public int? UploadType { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人 + /// + public Guid CreateUserId { get; set; } + + } + + + +}