添加项目文件。
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public class HistoryVisitRSDTO
|
||||
{
|
||||
|
||||
public Guid StudyId { get; set; }
|
||||
public string StudyCode { get; set; } = String.Empty;
|
||||
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
public string VisitName { get; set; } = String.Empty;
|
||||
|
||||
public string OverallResponse { get; set; } = String.Empty;
|
||||
|
||||
public string TpCode { get; set; } = String.Empty;
|
||||
|
||||
public GlobalRSSelectView GlobalRSSelect { get; set; } = new GlobalRSSelectView();
|
||||
|
||||
}
|
||||
|
||||
public class GlobalRSSelectView
|
||||
{
|
||||
public bool? Agree { get; set; }
|
||||
public string NewRS { get; set; } = String.Empty;
|
||||
public string Note { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
public class HistoryGlobalRsDTO
|
||||
{
|
||||
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
public string VisitName { get; set; } = String.Empty;
|
||||
|
||||
public string OverallResponse { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
public class PreviousGlobalReadsView
|
||||
{
|
||||
public string SubjectNote { get; set; } = String.Empty;
|
||||
|
||||
public List<HistoryGlobalRsDTO> PreviousGlobalReadsList { get; set; } = new List<HistoryGlobalRsDTO>();
|
||||
}
|
||||
|
||||
|
||||
public class GlobalTaskReportCommand
|
||||
{
|
||||
public Guid GlobalId { get; set; }
|
||||
public string SubjectNote { get; set; } = String.Empty;
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public List<GlobalReportCommand> GlobalRSReportList { get; set; }=new List<GlobalReportCommand>();
|
||||
}
|
||||
|
||||
public class GlobalReportCommand
|
||||
{
|
||||
public Guid GlobalId { get; set; }
|
||||
public string TpCode { get; set; } = String.Empty;
|
||||
public int VisitNum { get; set; }
|
||||
public bool? Agree { get; set; }
|
||||
public string NewRS { get; set; } = String.Empty;
|
||||
public string Note { get; set; } = String.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class AdReportDTO
|
||||
{
|
||||
public WorkloadAD ADInfo { get; set; } = new WorkloadAD();
|
||||
public PreviousGlobalReadsView Global1 { get; set; } = new PreviousGlobalReadsView();
|
||||
public PreviousGlobalReadsView Global2 { get; set; } = new PreviousGlobalReadsView();
|
||||
|
||||
public IEnumerable<HistoryVisitRSDTO> Global1VisitRS { get; set; }=new List<HistoryVisitRSDTO>();
|
||||
public IEnumerable<HistoryVisitRSDTO> Global2VisitRS { get; set; } = new List<HistoryVisitRSDTO>();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class ADReportCommand
|
||||
{
|
||||
|
||||
public Guid AdId { get; set; }
|
||||
public Guid SelectGlobalId { get; set; }
|
||||
public string ADNote { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public class LesionInformation
|
||||
{
|
||||
public Guid TUId { get; set; }
|
||||
public int LesionType { get; set; } //病灶类型
|
||||
public string STUDYID { get; set; } = string.Empty; // 项目ID
|
||||
public string USUBJID { get; set; } = string.Empty;// 受试者ID
|
||||
public int TUSEQ { get; set; } // 病灶序号
|
||||
|
||||
// 病灶分组,主要是用于将分裂或者结合在一起的已经被标识的肿瘤分类
|
||||
public string TUGRPID { get; set; } = string.Empty;
|
||||
|
||||
//内部或外部的肿瘤/病灶标识。 例如:医学影像 ID
|
||||
public string TUREFID { get; set; } = string.Empty;
|
||||
|
||||
public string TUSPID { get; set; } = string.Empty;// 申办方标识
|
||||
|
||||
// 关联测量结果,及TUGRPID一起,标识分裂及合并
|
||||
public string TULNKID { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 检查项目
|
||||
/// TUMIDENT (Tumor Identification )
|
||||
/// TUSPLIT (Tumor Split )
|
||||
/// TUMERGE (Tumor Merged)
|
||||
/// </summary>
|
||||
public string TUTESTCD { get; set; } = string.Empty;
|
||||
public string TUTEST { get; set; } = string.Empty;
|
||||
|
||||
public string TUORRES { get; set; } = string.Empty;//TARGET, NON-TARGET, NEW
|
||||
|
||||
public string TUSTRESC { get; set; } = string.Empty;//包含从 TUORRES拷贝的所有发现的结果
|
||||
public string TUNAM { get; set; } = string.Empty;//完成肿瘤标识的供应商名称或标识
|
||||
|
||||
public string LocDescription { get; set; } = string.Empty;// 部位描述
|
||||
public string TULOC { get; set; } = string.Empty; // 解剖学部位
|
||||
public string TULAT { get; set; } = string.Empty;//解剖学部位或者样本更详细的偏侧性修饰语,比如,左侧, 右侧,双侧。
|
||||
public string TUDIR { get; set; } = string.Empty;//解剖学部位或者样本更详细的方向性修饰语,比如,上边的 ,里面的。
|
||||
public string TUPORTOT { get; set; } = string.Empty;//解剖学部位或者样本更详细的分布,安排,分配的修饰语, 比如,全部的,单一的,部分的,多数的。
|
||||
|
||||
public string TUMETHOD { get; set; } = string.Empty; //用来标识肿瘤的办法。 例如,核磁共振,CT扫描。
|
||||
|
||||
public string TUEVAL { get; set; } = string.Empty; //评估者的角色。 例如:研究者,独立评估者。
|
||||
public string TUEVALID { get; set; } = string.Empty;//这个特定的评估者变量是与 TUEVAL一起使用来提供更详 细的信息
|
||||
public string TUACPTFL { get; set; } = string.Empty;
|
||||
|
||||
// 访视信息
|
||||
public decimal VISITNUM { get; set; } = 0;
|
||||
public string VISIT { get; set; } = string.Empty;
|
||||
public int VISITDY { get; set; }
|
||||
public string EPOCH { get; set; } = string.Empty;
|
||||
public string TUDTC { get; set; } = string.Empty;
|
||||
public int TUDY { get; set; } = 0;
|
||||
|
||||
//TR
|
||||
|
||||
public string TRTESTCD { get; set; } = string.Empty;
|
||||
public string TRTEST { get; set; } = string.Empty;
|
||||
public string TRORRES { get; set; } = string.Empty;//原始收到或采集的肿瘤测量/评估结
|
||||
public string TRORRESU { get; set; } = string.Empty;//原始单位
|
||||
public string TRSTRESC { get; set; } = string.Empty;//标准化结 果
|
||||
public double TRSTRESN { get; set; }//标准化结 果(N)
|
||||
public string TRSTRESU { get; set; } = string.Empty;// 标准化单位
|
||||
public string TRSTAT { get; set; } = string.Empty; // 未做状态
|
||||
public string TRREASND { get; set; } = string.Empty; // 未做原因
|
||||
public string Note { get; set; } = string.Empty;
|
||||
public string TRGRPID { get; set; } = string.Empty;
|
||||
public string TRDTC { get; set; } = string.Empty;
|
||||
public int TRDY { get; set; } = 0;
|
||||
////RS
|
||||
//public string RSCAT { get; set; } // 类别,用来识别对反应评估中使用的标准,以及适当时提供版本号
|
||||
//public string RSORRES { get; set; } //原始接收、采集或者计算的肿瘤反应评估的结果。
|
||||
//public string RSSTRESC { get; set; } //标准化结果
|
||||
|
||||
public bool CoveredLesion { get; set; }
|
||||
}
|
||||
public class VisitLesion : LesionInformation
|
||||
{
|
||||
public LesionInformation CurrentLesion { get; set; } = new LesionInformation();
|
||||
}
|
||||
|
||||
public class EfficacyAssessment
|
||||
{
|
||||
public string TargetLesion { get; set; } = string.Empty;
|
||||
public string Non_targetLesion { get; set; } = string.Empty;
|
||||
public string OverallAssessment { get; set; } = string.Empty;
|
||||
|
||||
public string TargetLesionNote { get; set; } = string.Empty;
|
||||
public string Non_targetLesionNote { get; set; } = string.Empty;
|
||||
public string OverallAssessmentNote { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class PreviousOverallAssessment
|
||||
{
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
public string OverallAssessment { get; set; } = string.Empty;
|
||||
}
|
||||
public class VisitLesionInfo
|
||||
{
|
||||
//基线病灶信息及本次访视测量信息
|
||||
public IList<VisitLesion> BLLesionList { get; set; } = new List<VisitLesion>();
|
||||
// public IList<LesionInformation> BLVisitLesionList { get; set; } = new List<LesionInformation>();
|
||||
//public IList<LesionInformation> CurrentVisitLesionList { get; set; } = new List<LesionInformation>();
|
||||
|
||||
// 以往病灶信息
|
||||
public IList<VisitLesion> PreviousNewLesionList { get; set; } = new List<VisitLesion>();
|
||||
//本次疑似新病灶
|
||||
public IList<LesionInformation> EquivocalNewLesionList { get; set; } = new List<LesionInformation>();
|
||||
public IList<LesionInformation> UnequivocalNewLesionList { get; set; } = new List<LesionInformation>();
|
||||
public ReportDTO ReportResult { get; set; } = new ReportDTO();
|
||||
public EfficacyAssessment Efficacy { get; set; } = new EfficacyAssessment();
|
||||
public List<PreviousOverallAssessment> PreviousOverallAssessment { get; set; } = new List<PreviousOverallAssessment>();
|
||||
|
||||
public MinVisit MinVisitInfo { get; set; } = new MinVisit();
|
||||
}
|
||||
|
||||
public class MinVisit
|
||||
{
|
||||
public double MinSum { get; set; } = 0.0;
|
||||
public string MinVistName { get; set; } = string.Empty;
|
||||
}
|
||||
public class ReportCommand
|
||||
{
|
||||
public List<LesionInformation> LesionInformationList { get; set; } = new List<LesionInformation>();
|
||||
|
||||
//RS
|
||||
public string RSCAT { get; set; } = string.Empty;// 类别,用来识别对反应评估中使用的标准,以及适当时提供版本号
|
||||
public string RSORRES { get; set; } = string.Empty; //原始接收、采集或者计算的肿瘤反应评估的结果。
|
||||
public string RSSTRESC { get; set; } = string.Empty; //标准化结果
|
||||
}
|
||||
public class TUDTO
|
||||
{
|
||||
public int LesionType { get; set; }
|
||||
public string STUDYID { get; set; } = string.Empty;
|
||||
public string USUBJID { get; set; } = string.Empty;
|
||||
public int TUSEQ { get; set; }
|
||||
public string TUGRPID { get; set; } = string.Empty;
|
||||
public string TUREFID { get; set; } = string.Empty;//内部或外部的肿瘤/病灶标识。 例如:医学影像 ID
|
||||
public string TUSPID { get; set; } = string.Empty;
|
||||
public string TULNKID { get; set; } = string.Empty;
|
||||
public string TUTESTCD { get; set; } = string.Empty;
|
||||
public string TUTEST { get; set; } = string.Empty;
|
||||
|
||||
public double TUORRES { get; set; } = 0;
|
||||
public string TUSTRESC { get; set; } = string.Empty;
|
||||
public string TUNAM { get; set; } = string.Empty;
|
||||
public string TULOC { get; set; } = string.Empty;
|
||||
public string TULAT { get; set; } = string.Empty;
|
||||
public string TUDIR { get; set; } = string.Empty;
|
||||
public string TUPORTOT { get; set; } = string.Empty;
|
||||
public string TUMETHOD { get; set; } = string.Empty;
|
||||
public string TUEVAL { get; set; } = string.Empty;
|
||||
public string TUEVALID { get; set; } = string.Empty;
|
||||
public string TUACPTFL { get; set; } = string.Empty;
|
||||
public double VISITNUM { get; set; } = 0;
|
||||
public string VISIT { get; set; } = string.Empty;
|
||||
public string VISITDY { get; set; } = string.Empty;
|
||||
public string EPOCH { get; set; } = string.Empty;
|
||||
public string TUDTC { get; set; } = string.Empty;
|
||||
public int TUDY { get; set; } = 0;
|
||||
}
|
||||
public class TRDTO
|
||||
{
|
||||
public string STUDYID { get; set; } = string.Empty;
|
||||
public string DOMAIN { get; set; } = string.Empty;
|
||||
public string USUBJID { get; set; } = string.Empty;
|
||||
public int TRSEQ { get; set; }
|
||||
public string TRGRPID { get; set; } = string.Empty;
|
||||
public string TRREFID { get; set; } = string.Empty;
|
||||
public string TRSPID { get; set; } = string.Empty;
|
||||
public string TRLNKID { get; set; } = string.Empty;
|
||||
public string TRLNKGRP { get; set; } = string.Empty;
|
||||
public string TRTESTCD { get; set; } = string.Empty;
|
||||
public string TRTEST { get; set; } = string.Empty;
|
||||
public string TRORRES { get; set; } = string.Empty;
|
||||
public string TRORRESU { get; set; } = string.Empty;
|
||||
public string TRSTRESC { get; set; } = string.Empty;
|
||||
public double TRSTRESN { get; set; } = 0;
|
||||
public string TRSTRESU { get; set; } = string.Empty;
|
||||
public string TRSTAT { get; set; } = string.Empty;
|
||||
public string TRREASND { get; set; } = string.Empty;
|
||||
public string TRNAM { get; set; } = string.Empty;
|
||||
public string TRMETHOD { get; set; } = string.Empty;
|
||||
public string TREVAL { get; set; } = string.Empty;
|
||||
public string TREVALID { get; set; } = string.Empty;
|
||||
public string TRACPTFL { get; set; } = string.Empty;
|
||||
public decimal VISITNUM { get; set; } = 0;
|
||||
public string VISIT { get; set; } = string.Empty;
|
||||
public int VISITDY { get; set; } = 0;
|
||||
public string EPOCH { get; set; } = string.Empty;
|
||||
public string TRDTC { get; set; } = string.Empty;
|
||||
public int TRDY { get; set; } = 0;
|
||||
public string Note { get; set; } = string.Empty;
|
||||
public bool CoveredLesion { get; set; } = true;
|
||||
}
|
||||
|
||||
public class RSDTO
|
||||
{
|
||||
public string STUDYID { get; set; } = string.Empty;
|
||||
public string DOMAIN { get; set; } = string.Empty;
|
||||
public string USUBJID { get; set; } = string.Empty;
|
||||
public int RSSEQ { get; set; }
|
||||
public string RSGRPID { get; set; } = string.Empty;
|
||||
public string RSREFID { get; set; } = string.Empty;
|
||||
public string RSSPID { get; set; } = string.Empty;
|
||||
public string RSLNKID { get; set; } = string.Empty;
|
||||
public string RSLNKGRP { get; set; } = string.Empty;
|
||||
public string RSTESTCD { get; set; } = string.Empty;
|
||||
public string RSTEST { get; set; } = string.Empty;
|
||||
public string RSCAT { get; set; } = string.Empty;
|
||||
public string RSORRES { get; set; } = string.Empty;
|
||||
public string RSSTRESC { get; set; } = string.Empty;
|
||||
public string RSSTAT { get; set; } = string.Empty;
|
||||
public string RSREASND { get; set; } = string.Empty;
|
||||
public string RSNAM { get; set; } = string.Empty;
|
||||
|
||||
public string RSEVAL { get; set; } = string.Empty;
|
||||
public string RSEVALID { get; set; } = string.Empty;
|
||||
public string RSACPTFL { get; set; } = string.Empty;
|
||||
public decimal VISITNUM { get; set; } = 0;
|
||||
public string VISIT { get; set; } = string.Empty;
|
||||
public int VISITDY { get; set; } = 0;
|
||||
public string EPOCH { get; set; } = string.Empty;
|
||||
public string RSDTC { get; set; } = string.Empty;
|
||||
public int RSDY { get; set; } = 0;
|
||||
public Guid StudyGuid { get; set; } = Guid.Empty;
|
||||
public Guid TrialGuid { get; set; } = Guid.Empty;
|
||||
public Guid SubjectGuid { get; set; } = Guid.Empty;
|
||||
|
||||
public string Note { get; set; } = string.Empty;
|
||||
}
|
||||
public class ReportDTO
|
||||
{
|
||||
public bool Qualified { get; set; } = true;
|
||||
public string DiseaseProgression { get; set; } = string.Empty;
|
||||
public string NotEvaluable { get; set; } = string.Empty;
|
||||
public string Timepoint { get; set; } = string.Empty;
|
||||
public string TrialCode { get; set; } = string.Empty;
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
public decimal? VisitNum { get; set; }
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
public int? DiseaseSituation { get; set; }
|
||||
public string Comment { get; set; } = String.Empty;
|
||||
public Guid? TPId { get; set; }
|
||||
public Guid? DicomStudyId { get; set; }
|
||||
public string TpCode { get; set; } = string.Empty;
|
||||
|
||||
public bool AffectRead { get; set; }//是否影响读片
|
||||
public string AffectReadNote { get; set; } = String.Empty;//备注说明
|
||||
}
|
||||
|
||||
|
||||
public class VisitReportCommand
|
||||
{
|
||||
public List<LesionInformation> LesionInformation { get; set; } = new List<LesionInformation>();
|
||||
public List<TRDTO> TRList { get; set; } = new List<TRDTO>();
|
||||
public List<RSDTO> RSList { get; set; } = new List<RSDTO>();
|
||||
public ReportDTO ReportResult { get; set; } = new ReportDTO();
|
||||
}
|
||||
|
||||
public class BaseLineReportCommand
|
||||
{
|
||||
//public Guid TimepointId { get; set; }
|
||||
public string SumOfDiameter { get; set; } = String.Empty;
|
||||
public string SumDiameterOfNonLymphNode { get; set; } = String.Empty;
|
||||
public IList<LesionInformation> LesionInformation { get; set; } = new List<LesionInformation>();
|
||||
public ReportDTO ReportResult { get; set; } = new ReportDTO();
|
||||
}
|
||||
|
||||
public class BaseLineReportDTO
|
||||
{
|
||||
public IList<LesionInformation> LesionInformation { get; set; } = new List<LesionInformation>();
|
||||
public ReportDTO ReportResult { get; set; } = new ReportDTO();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
|
||||
namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
public class WorkloadReadingDTO
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid StudyId { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public string TrialCode { get; set; } = string.Empty;
|
||||
public string TrialIndication { get; set; } = string.Empty;
|
||||
public string Sponsor { get; set; } = string.Empty;
|
||||
public int Expedited { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
public decimal VisitNum { get; set; }
|
||||
|
||||
|
||||
public Guid WorkloadId { get; set; }
|
||||
public string WorkloadCode { get; set; } = string.Empty;
|
||||
public int WorkloadType { get; set; }
|
||||
public int Status { get; set; }
|
||||
|
||||
public DateTime UpdateTime { get; set; }
|
||||
}
|
||||
|
||||
public class WorkloadQueryParam : PageInput
|
||||
{
|
||||
public Guid? TrialId { get; set; } = Guid.Empty;
|
||||
public string SubjectCode { get; set; } = string.Empty;
|
||||
public int? Status { get; set; }
|
||||
public int WorkloadType { get; set; }
|
||||
public int? Expedited { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
//using IRaCIS.Core.Application.Contracts;
|
||||
//using System.Linq.Dynamic.Core;
|
||||
//using AutoMapper;
|
||||
//using IRaCIS.Application.Contracts;
|
||||
//using IRaCIS.Core.Infra.EFCore;
|
||||
//using IRaCIS.Core.Domain.Models;
|
||||
//using IRaCIS.Core.Infrastructure.Extention;
|
||||
//using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//namespace IRaCIS.Core.Application.Services
|
||||
//{
|
||||
// [ ApiExplorerSettings(GroupName = "Reading")]
|
||||
// public class GlobalReportService : BaseService, IGlobalService
|
||||
// {
|
||||
// private readonly IRepository<GlobalRS> _globalRsRepository;
|
||||
// private readonly IRepository<GlobalResult> _globalResultRepository;
|
||||
// private readonly IRSRepository _rsRepository;
|
||||
// private readonly IRepository<VisitStage> _visitStageRepository;
|
||||
|
||||
// private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
// private readonly IWorkloadADRepository _workloadAdRepository;
|
||||
// private readonly IWorkloadGlobalRepository _workloadGlobalRepository;
|
||||
// private readonly IRepository<Trial> _trialRepository;
|
||||
// private readonly IRepository<Subject> _subjectRepository;
|
||||
|
||||
// public GlobalReportService(IRepository<GlobalRS> globalRsRepository, IRepository<GlobalResult> globalResultRepository,
|
||||
// IRSRepository rsRepository, IRepository<VisitStage> visitStageRepository, IRepository<SubjectVisit> subjectVisitRepository, IWorkloadADRepository workloadAdRepository,
|
||||
// IWorkloadGlobalRepository workloadGlobalRepository, IRepository<Trial> trialRepository, IRepository<Subject> subjectRepository)
|
||||
// {
|
||||
// _globalRsRepository = globalRsRepository;
|
||||
// _globalResultRepository = globalResultRepository;
|
||||
// _rsRepository = rsRepository;
|
||||
// _visitStageRepository = visitStageRepository;
|
||||
|
||||
// _subjectVisitRepository = subjectVisitRepository;
|
||||
// _workloadAdRepository = workloadAdRepository;
|
||||
// _workloadGlobalRepository = workloadGlobalRepository;
|
||||
// _trialRepository = trialRepository;
|
||||
// _subjectRepository = subjectRepository;
|
||||
// }
|
||||
|
||||
// [HttpGet("{trialId:guid}/{subjectId:guid}/{visitNum:decimal}/{globalId:guid}/{globalCode}")]
|
||||
// public IEnumerable<HistoryVisitRSDTO> GetHistoryVisitRsList(Guid trialId, Guid subjectId, decimal visitNum, Guid globalId, string globalCode)
|
||||
// {
|
||||
|
||||
// var tpGroup = 'T' + globalCode.Trim().Substring(globalCode.Trim().Length - 2);
|
||||
|
||||
|
||||
// var query = from rs in _rsRepository.AsQueryable()
|
||||
// .Where(t => t.SubjectGuid == subjectId && t.TrialGuid == trialId && t.RSTESTCD == "OVRLRESP" && t.VISITNUM <= visitNum && t.TpCode.Contains(tpGroup))
|
||||
|
||||
// join globalRs in _globalRsRepository.Where(t => t.GlobalId == globalId) on new { rs.TpCode, VisitNum = rs.VISITNUM } equals new { globalRs.TpCode, globalRs.VisitNum } into cc
|
||||
// from globalRs in cc.DefaultIfEmpty()
|
||||
|
||||
// join visitStage in _visitStageRepository.Where(t => t.TrialId == trialId) on rs.VISITNUM equals visitStage.VisitNum
|
||||
// select new HistoryVisitRSDTO
|
||||
// {
|
||||
// StudyId = rs.StudyGuid,
|
||||
// StudyCode = rs.STUDYID,
|
||||
// VisitNum = visitStage.VisitNum,
|
||||
// VisitName = visitStage.VisitName,
|
||||
// OverallResponse = rs.RSORRES,
|
||||
// TpCode = rs.TpCode,
|
||||
// GlobalRSSelect = new GlobalRSSelectView()
|
||||
// {
|
||||
// Agree = globalRs.Agree,
|
||||
// NewRS = globalRs.NewRS,
|
||||
// Note = globalRs.Note
|
||||
// }
|
||||
// };
|
||||
|
||||
// var visitRsList = query.OrderBy(t => t.VisitNum).ToList();
|
||||
|
||||
// return visitRsList;
|
||||
|
||||
// }
|
||||
// #pragma warning disable
|
||||
// [HttpGet("{trialId:guid}/{subjectId:guid}/{visitNum:decimal}/{globalId:guid}")]
|
||||
// public PreviousGlobalReadsView GetHistoryGlobalRsList(Guid trialId, Guid subjectId, decimal visitNum,
|
||||
// Guid globalId)
|
||||
// {
|
||||
// //subjectCode = subjectCode.Trim();
|
||||
|
||||
// var query = from globalResult in _globalResultRepository.AsQueryable()
|
||||
// .Where(t => t.SubjectId == subjectId && t.VisitNum < visitNum)
|
||||
// join visitStage in _visitStageRepository.Where(t => t.TrialId == trialId) on globalResult.VisitNum equals visitStage.VisitNum
|
||||
// select new HistoryGlobalRsDTO
|
||||
// {
|
||||
// VisitNum = visitStage.VisitNum,
|
||||
// VisitName = visitStage.VisitName,
|
||||
// OverallResponse = globalResult.Result
|
||||
// };
|
||||
|
||||
// var subjectNote = _globalResultRepository.FirstOrDefault(t => t.GlobalId == globalId)?.SubjectNote;
|
||||
|
||||
// return new PreviousGlobalReadsView()
|
||||
// {
|
||||
// PreviousGlobalReadsList = query.ToList(),
|
||||
// SubjectNote = subjectNote
|
||||
// };
|
||||
|
||||
// }
|
||||
|
||||
// public IResponseOutput AddGlobalReport(GlobalTaskReportCommand globalTaskReportCommand)
|
||||
// {
|
||||
// //删除上一次保存得记录
|
||||
// _globalResultRepository.Delete(t => t.GlobalId == globalTaskReportCommand.GlobalId);
|
||||
// _globalRsRepository.Delete(t => t.GlobalId == globalTaskReportCommand.GlobalId);
|
||||
|
||||
|
||||
// var globalRsList = _mapper.Map<List<GlobalRS>>(globalTaskReportCommand.GlobalRSReportList);
|
||||
|
||||
// _globalRsRepository.AddRange(globalRsList);
|
||||
|
||||
// var first = globalRsList.OrderByDescending(t => t.VisitNum).First();
|
||||
|
||||
// var globalResult = new GlobalResult()
|
||||
// {
|
||||
// VisitNum = first.VisitNum,
|
||||
// SubjectCode = globalTaskReportCommand.SubjectCode,
|
||||
// SubjectNote = globalTaskReportCommand.SubjectNote,
|
||||
// SubjectId = globalTaskReportCommand.SubjectId,
|
||||
|
||||
// GlobalId = first.GlobalId,
|
||||
// Result = first.NewRS
|
||||
// };
|
||||
|
||||
// _globalResultRepository.Add(globalResult);
|
||||
|
||||
// return ResponseOutput.Result(_globalResultRepository.SaveChanges()) ;
|
||||
|
||||
// }
|
||||
|
||||
// //public string GetCommentsForSubject(Guid globalId)
|
||||
// //{
|
||||
// // return _globalResultRepository.FirstOrDefault(t => t.GlobalId == globalId)?.SubjectNote;
|
||||
// //}
|
||||
// [HttpGet("{adId}")]
|
||||
// public AdReportDTO GetAdReport(Guid adId)
|
||||
// {
|
||||
// var adReport = new AdReportDTO();
|
||||
// var ad = _workloadAdRepository.FirstOrDefault(t => t.Id == adId);
|
||||
// var globalId1 = ad.Global1Id;
|
||||
// var globalId2 = ad.Global2Id;
|
||||
|
||||
// var query = from global in _workloadGlobalRepository.Where(t => t.Id == globalId1 || t.Id == globalId2)
|
||||
// join trial in _trialRepository.Where(t => t.Id == ad.TrialId) on global.TrialId equals trial.Id
|
||||
// join subject in _subjectRepository.AsQueryable() on global.SubjectId equals subject.Id
|
||||
// select new WorkloadReadingDTO
|
||||
// {
|
||||
// Id = global.Id,
|
||||
// WorkloadId = global.Id,
|
||||
// WorkloadType = 1,
|
||||
// Status = global.Status,
|
||||
// UpdateTime = global.UpdateTime,
|
||||
// TrialId = global.TrialId,
|
||||
// SubjectId = global.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// //VisitNum = visit.VisitNum,
|
||||
// //VisitName = visit.VisitName,
|
||||
// VisitNum = global.VisitNum,
|
||||
// VisitName = global.VisitName,
|
||||
|
||||
// Expedited = trial.Expedited,
|
||||
// TrialCode = trial.TrialCode,
|
||||
// TrialIndication = trial.Indication,
|
||||
// WorkloadCode = global.GlobalCode
|
||||
// };
|
||||
|
||||
// var globalList = query.ToList();
|
||||
|
||||
// var global1 = globalList.First(t => t.Id == globalId1);
|
||||
// var global2 = globalList.First(t => t.Id == globalId2);
|
||||
|
||||
// adReport.Global1VisitRS = GetHistoryVisitRsList(global1.TrialId, global1.SubjectId,
|
||||
// global1.VisitNum, global1.Id, global1.WorkloadCode);
|
||||
|
||||
// adReport.Global2VisitRS = GetHistoryVisitRsList(global2.TrialId, global2.SubjectId
|
||||
// ,global2.VisitNum, global2.Id, global2.WorkloadCode);
|
||||
|
||||
// adReport.Global1 = GetHistoryGlobalRsList(global1.TrialId, global1.SubjectId, global1.VisitNum, global1.Id);
|
||||
// adReport.Global2 = GetHistoryGlobalRsList(global2.TrialId, global2.SubjectId, global2.VisitNum, global2.Id);
|
||||
|
||||
// adReport.ADInfo = ad;
|
||||
|
||||
// return adReport;
|
||||
|
||||
// }
|
||||
|
||||
// public IResponseOutput AddAdjudicationReport(ADReportCommand adReportCommand)
|
||||
// {
|
||||
// return ResponseOutput.Result(_workloadAdRepository.Update(t => t.Id == adReportCommand.AdId,
|
||||
// u => new WorkloadAD()
|
||||
// { AdNote = adReportCommand.ADNote, SelectGlobalId = adReportCommand.SelectGlobalId })) ;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface IGlobalService
|
||||
{
|
||||
//string GetCommentsForSubject(Guid globalId);
|
||||
IEnumerable<HistoryVisitRSDTO> GetHistoryVisitRsList(Guid trialId, Guid subjectId, decimal visitNum, Guid globalId,string globalCode);
|
||||
|
||||
PreviousGlobalReadsView GetHistoryGlobalRsList(Guid trialId, Guid subjectId, decimal visitNum, Guid globalId);
|
||||
|
||||
IResponseOutput AddGlobalReport(GlobalTaskReportCommand globalTaskReportCommand);
|
||||
|
||||
|
||||
|
||||
AdReportDTO GetAdReport(Guid adId);
|
||||
IResponseOutput AddAdjudicationReport(ADReportCommand adReportCommand);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface IReportService
|
||||
{
|
||||
//bool SaveReport(ReportCommand reportCommand);
|
||||
|
||||
/// <summary> 添加基线期病灶标识及测量信息 </summary>
|
||||
bool AddLesion(List<LesionInformation> lesionInformation, ReportDTO report);
|
||||
///// <summary> 获取基线期信息 <summary>
|
||||
//IList<LesionInformation> GetBLLesion(string trialCode, string subjectCode);
|
||||
|
||||
/// <summary>
|
||||
/// 获取访视病灶信息
|
||||
/// </summary>
|
||||
VisitLesionInfo GetVisitLineLesion(string trialCode, string subjectCode, decimal visitNum,string tpCode);
|
||||
|
||||
bool SaveVisitReport(VisitReportCommand visitReportCommand);
|
||||
bool AddBaseLineLesion(BaseLineReportCommand baseLineReportCommand);
|
||||
BaseLineReportDTO getBLLineLesion(string trialCode, string subjectCode, string tpCode);
|
||||
|
||||
bool SubmiteReport(Guid tpId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
|
||||
namespace IRaCIS.Application.Interfaces
|
||||
{
|
||||
public interface IReviewerReadingService
|
||||
{
|
||||
PageOutput<WorkloadReadingDTO> GetWorkloadList(WorkloadQueryParam param);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
//using IRaCIS.Application.Interfaces;
|
||||
//using IRaCIS.Application.Contracts;
|
||||
//using IRaCIS.Core.Infra.EFCore;
|
||||
|
||||
//using IRaCIS.Core.Domain.Models;
|
||||
//using System.Linq.Expressions;
|
||||
//using IRaCIS.Core.Infrastructure.ExpressionExtend;
|
||||
//using IRaCIS.Core.Infrastructure.Extention;
|
||||
//using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//namespace IRaCIS.Core.Application.Services
|
||||
//{
|
||||
// [ApiExplorerSettings(GroupName = "Reading")]
|
||||
// public class ReadingService : BaseService, IReviewerReadingService
|
||||
// {
|
||||
// private readonly IWorkloadTPRepository _workloadTPRepository;
|
||||
// private readonly IWorkloadGlobalRepository _workloadGlobalRepository;
|
||||
// private readonly IWorkloadADRepository _workloadADRepository;
|
||||
// private readonly IRepository<Trial> _trialRepository;
|
||||
|
||||
// private readonly IRepository<Subject> _subjectRepository;
|
||||
// private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
|
||||
// public ReadingService(IWorkloadTPRepository workloadTPRepository,
|
||||
// IWorkloadGlobalRepository workloadGlobalRepository,
|
||||
// IWorkloadADRepository workloadADRepository,
|
||||
// IRepository<Trial> trialRepository,
|
||||
// IRepository<Subject> subjectRepository,
|
||||
// IRepository<SubjectVisit> subjectVisitRepository,
|
||||
// IUserInfo userInfo)
|
||||
// {
|
||||
// _workloadTPRepository = workloadTPRepository;
|
||||
// _workloadGlobalRepository = workloadGlobalRepository;
|
||||
// _workloadADRepository = workloadADRepository;
|
||||
// _trialRepository = trialRepository;
|
||||
|
||||
// _subjectRepository = subjectRepository;
|
||||
// _subjectVisitRepository = subjectVisitRepository;
|
||||
|
||||
// }
|
||||
// /// <summary>
|
||||
// /// 获取医生个人任务列表
|
||||
// /// WorkloadType 1-tp,2-global,3-ad
|
||||
// /// </summary>
|
||||
// /// <param name="param"></param>
|
||||
// /// <returns></returns>
|
||||
// [HttpPost]
|
||||
// public PageOutput<WorkloadReadingDTO> GetWorkloadList(WorkloadQueryParam param)
|
||||
// {
|
||||
// #pragma warning disable
|
||||
// IQueryable<WorkloadReadingDTO> query = null;
|
||||
// Expression<Func<Subject, bool>> subjectLambda = x => true;
|
||||
// if (param.SubjectCode != string.Empty)
|
||||
// {
|
||||
// subjectLambda = subjectLambda.And(o => o.Code.Contains(param.SubjectCode));
|
||||
// }
|
||||
// Expression<Func<Trial, bool>> trialLambda = x => true;
|
||||
// if (param.Expedited != null)
|
||||
// {
|
||||
// trialLambda = trialLambda.And(o => o.Expedited == param.Expedited);
|
||||
// }
|
||||
// if (param.TrialId != null && param.TrialId != Guid.Empty)
|
||||
// {
|
||||
// trialLambda = trialLambda.And(o => o.Id == param.TrialId);
|
||||
// }
|
||||
|
||||
|
||||
// if (param.WorkloadType == 1)// TP
|
||||
// {
|
||||
// Expression<Func<WorkloadTP, bool>> workloadLambda = x => true;
|
||||
// workloadLambda = workloadLambda.And(u => u.ReviewerId == _userInfo.Id);
|
||||
// if (param.Status != null)
|
||||
// {
|
||||
// if (param.Status == 30)//30 的时候,待读和正在读(未提交的)
|
||||
// {
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == 30 || o.Status == 40);
|
||||
// }
|
||||
// else
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == param.Status);
|
||||
// }
|
||||
// query = from tp in _workloadTPRepository.Where(workloadLambda)
|
||||
// join trial in _trialRepository.Where(trialLambda) on tp.TrialId equals trial.Id
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on tp.SubjectId equals subject.Id
|
||||
// join visit in _subjectVisitRepository.AsQueryable() on tp.SubjectVisitId equals visit.Id
|
||||
// select new WorkloadReadingDTO
|
||||
// {
|
||||
// Id = tp.Id,
|
||||
// StudyId = tp.StudyId,
|
||||
// WorkloadId = tp.Id,
|
||||
// WorkloadType = 1,
|
||||
// Status = tp.Status,
|
||||
// UpdateTime = tp.UpdateTime,
|
||||
// TrialId = tp.TrialId,
|
||||
// SubjectId = tp.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// VisitNum = visit.VisitNum,
|
||||
// VisitName = visit.VisitName,
|
||||
// Expedited = trial.Expedited,
|
||||
// TrialCode = trial.TrialCode,
|
||||
// TrialIndication = trial.Indication,
|
||||
// WorkloadCode = tp.TimepointCode
|
||||
// };
|
||||
// }
|
||||
// else if (param.WorkloadType == 2)//Global
|
||||
// {
|
||||
// Expression<Func<WorkloadGlobal, bool>> workloadLambda = x => true;
|
||||
// workloadLambda = workloadLambda.And(u => u.ReviewerId == _userInfo.Id);
|
||||
// if (param.Status != null)
|
||||
// {
|
||||
// if (param.Status == 30)
|
||||
// {
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == 30 || o.Status == 40);
|
||||
// }
|
||||
// else
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == param.Status);
|
||||
// }
|
||||
// query = from global in _workloadGlobalRepository.Where(workloadLambda)
|
||||
// join trial in _trialRepository.Where(trialLambda) on global.TrialId equals trial.Id
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on global.SubjectId equals subject.Id
|
||||
// //join visit in _subjectVisitRepository.GetAll() on global.VisitId equals visit.Id
|
||||
// select new WorkloadReadingDTO
|
||||
// {
|
||||
// Id = global.Id,
|
||||
// WorkloadId = global.Id,
|
||||
// WorkloadType = 1,
|
||||
// Status = global.Status,
|
||||
// UpdateTime = global.UpdateTime,
|
||||
// TrialId = global.TrialId,
|
||||
// SubjectId = global.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// //VisitNum = visit.VisitNum,
|
||||
// //VisitName = visit.VisitName,
|
||||
// VisitNum = global.VisitNum,
|
||||
// VisitName = global.VisitName,
|
||||
|
||||
// Expedited = trial.Expedited,
|
||||
// TrialCode = trial.TrialCode,
|
||||
// TrialIndication = trial.Indication,
|
||||
// WorkloadCode = global.GlobalCode
|
||||
// };
|
||||
// }
|
||||
// else if (param.WorkloadType == 3)//AD
|
||||
// {
|
||||
// Expression<Func<WorkloadAD, bool>> workloadLambda = x => true;
|
||||
// workloadLambda = workloadLambda.And(u => u.ReviewerId == _userInfo.Id);
|
||||
// if (param.Status != null)
|
||||
// {
|
||||
// if (param.Status == 30)//30 的时候,待读和正在读(未提交的)
|
||||
// {
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == 30 || o.Status == 40);
|
||||
// }
|
||||
// else
|
||||
// workloadLambda = workloadLambda.And(o => o.Status == param.Status);
|
||||
// }
|
||||
// query = from ad in _workloadADRepository.Where(workloadLambda)
|
||||
// join trial in _trialRepository.Where(trialLambda) on ad.TrialId equals trial.Id
|
||||
// join subject in _subjectRepository.Where(subjectLambda) on ad.SubjectId equals subject.Id
|
||||
// //join visit in _subjectVisitRepository.GetAll() on ad.visi equals visit.Id
|
||||
// select new WorkloadReadingDTO
|
||||
// {
|
||||
// Id = ad.Id,
|
||||
// WorkloadId = ad.Id,
|
||||
// WorkloadType = 1,
|
||||
// Status = ad.Status,
|
||||
// UpdateTime = ad.UpdateTime,
|
||||
// TrialId = ad.TrialId,
|
||||
// SubjectId = ad.SubjectId,
|
||||
// SubjectCode = subject.Code,
|
||||
// //VisitNum = visit.VisitNum,
|
||||
// //VisitName = visit.VisitName,
|
||||
// Expedited = trial.Expedited,
|
||||
// TrialCode = trial.TrialCode,
|
||||
// TrialIndication = trial.Indication,
|
||||
// WorkloadCode = ad.ADCode
|
||||
// };
|
||||
// }
|
||||
// query.OrderByDescending(u => u.UpdateTime);
|
||||
// var count = query.Count();
|
||||
// query = query.Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
|
||||
// return new PageOutput<WorkloadReadingDTO>(param.PageIndex,
|
||||
// param.PageSize, count, query.ToList());
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,635 @@
|
||||
//using AutoMapper;
|
||||
//using IRaCIS.Core.Infrastructure.ExpressionExtend;
|
||||
//using IRaCIS.Core.Application.Contracts;
|
||||
//using IRaCIS.Core.Infra.EFCore;
|
||||
//using IRaCIS.Core.Domain.Models;
|
||||
|
||||
//using IRaCIS.Core.Domain.Share;
|
||||
//using Microsoft.AspNetCore.Authorization;
|
||||
//using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//namespace IRaCIS.Core.Application.Services
|
||||
//{
|
||||
// [ ApiExplorerSettings(GroupName = "Reading")]
|
||||
// public class ReportService : BaseService, IReportService
|
||||
// {
|
||||
// private readonly ITURepository _tURepository;
|
||||
// private readonly ITRRepository _tRRepository;
|
||||
// private readonly IRSRepository _rSRepository;
|
||||
// private readonly IRepository<Report> _reportRepository;
|
||||
// private readonly IRepository<VisitStage> _visitStageRepository;
|
||||
// private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
// private readonly IWorkloadTPRepository _workloadTPRepository;
|
||||
// private readonly IWorkloadGlobalRepository _workloadGlobalRepository;
|
||||
|
||||
|
||||
// #pragma warning disable
|
||||
// private string linkGroupId;
|
||||
// public ReportService(ITURepository tURepository, ITRRepository tRRepository,
|
||||
// IRSRepository rSRepository, IRepository<Report> reportRepository,
|
||||
// IWorkloadTPRepository workloadTPRepository,
|
||||
// IRepository<VisitStage> visitStageRepository,
|
||||
// IRepository<SubjectVisit> subjectVisitRepository,
|
||||
// IWorkloadGlobalRepository workloadGlobalRepository,
|
||||
// IMapper mapper)
|
||||
// {
|
||||
// _tURepository = tURepository;
|
||||
// _tRRepository = tRRepository;
|
||||
// _rSRepository = rSRepository;
|
||||
// _reportRepository = reportRepository;
|
||||
// _workloadTPRepository = workloadTPRepository;
|
||||
// _visitStageRepository = visitStageRepository;
|
||||
// _subjectVisitRepository = subjectVisitRepository;
|
||||
// _workloadGlobalRepository = workloadGlobalRepository;
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// public bool AddLesion(List<LesionInformation> lesionList, ReportDTO report)
|
||||
// {
|
||||
// TU lastTu = _tURepository.AsQueryable().OrderByDescending("TUSEQ").FirstOrDefault();
|
||||
// int tuSeq = 101;
|
||||
// if (lastTu != null) { tuSeq = lastTu.TUSEQ + 1; }
|
||||
// TR lastTr = _tRRepository.AsQueryable().OrderByDescending("TRSEQ").FirstOrDefault();
|
||||
// int trSeq = 1;
|
||||
// if (lastTr != null) { trSeq = lastTr.TRSEQ + 1; }
|
||||
|
||||
// foreach (var lesion in lesionList)
|
||||
// {
|
||||
// var linkId = lesion.TULNKID;
|
||||
// if (string.IsNullOrWhiteSpace(lesion.TULNKID))
|
||||
// {
|
||||
// linkId = (lesion.TUORRES == "TARGET") ? "T" + tuSeq.ToString() : "NT" + tuSeq.ToString();
|
||||
// }
|
||||
// _tURepository.Add(new TU
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
// LesionType = lesion.LesionType,
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TUSEQ = tuSeq,
|
||||
// TULNKID = linkId,
|
||||
|
||||
// TUTESTCD = lesion.TUTESTCD,
|
||||
// TUTEST = lesion.TUTEST,
|
||||
// TUORRES = lesion.TUORRES,
|
||||
// TUSTRESC = lesion.TUSTRESC,
|
||||
|
||||
// TULOC = lesion.TULOC,
|
||||
// LocDescription = lesion.LocDescription,
|
||||
// TULAT = lesion.TULAT,
|
||||
// TUDIR = lesion.TUDIR,
|
||||
// TUPORTOT = lesion.TUPORTOT,
|
||||
// TUMETHOD = lesion.TUMETHOD,
|
||||
// TUEVAL = lesion.TUEVAL,
|
||||
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
|
||||
// TUREFID = lesion.TUREFID,
|
||||
// TUACPTFL = lesion.TUACPTFL,
|
||||
// TUEVALID = _userInfo.ReviewerCode,//lesion.TUEVALID,
|
||||
// TUGRPID = string.Empty,
|
||||
// TUDY = lesion.TUDY,// 检查日
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TUDTC = lesion.TUDTC,
|
||||
// TUNAM = lesion.TUNAM,
|
||||
// TUSPID = lesion.TUSPID,
|
||||
// TpCode = report.TpCode
|
||||
// });
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = linkId,
|
||||
// TRGRPID = lesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = lesion.TRTESTCD,
|
||||
// TRTEST = lesion.TRTEST,
|
||||
// TRORRES = lesion.TRORRES,
|
||||
// TRORRESU = lesion.TRORRESU,
|
||||
|
||||
// TRNAM = lesion.TUNAM,
|
||||
// TRMETHOD = lesion.TUMETHOD,
|
||||
// TREVAL = lesion.TUEVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,//lesion.TUEVALID,
|
||||
// TRACPTFL = lesion.TUACPTFL,
|
||||
// CoveredLesion = true,
|
||||
// Note = lesion.Note,
|
||||
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TRDTC = lesion.TRDTC,
|
||||
// TRDY = lesion.TRDY,
|
||||
// TpCode = report.TpCode
|
||||
// });
|
||||
// tuSeq++;
|
||||
// trSeq++;
|
||||
// }
|
||||
|
||||
// return _rSRepository.SaveChanges();
|
||||
// }
|
||||
|
||||
// private IList<LesionInformation> GetBLLesion(string trialCode, string SubjectCode, string tpcodeGroup)
|
||||
// {
|
||||
// int[] t = { 1, 2, 3 };
|
||||
// var query = from tu in _tURepository.Where(u => t.Contains(u.LesionType)
|
||||
// && u.STUDYID == trialCode && u.USUBJID == SubjectCode && u.TpCode.Contains(tpcodeGroup) /*u.TUEVALID==_userInfo.ReviewerCode*/)
|
||||
// join tr in _tRRepository.Where(u => u.VISITNUM == 1 && u.STUDYID == trialCode
|
||||
// && u.USUBJID == SubjectCode && u.TREVALID == _userInfo.ReviewerCode)
|
||||
// on tu.TULNKID equals tr.TRLNKID into temp
|
||||
// from tr in temp.DefaultIfEmpty()
|
||||
// select new LesionInformation
|
||||
// {
|
||||
// TUId = tu.Id,
|
||||
// LesionType = tu.LesionType,
|
||||
// TULNKID = tu.TULNKID,
|
||||
// TUSEQ = tu.TUSEQ,
|
||||
// TULOC = tu.TULOC,
|
||||
// LocDescription = tu.LocDescription,
|
||||
// TULAT = tu.TULAT,
|
||||
// TUDIR = tu.TUDIR,
|
||||
// TUPORTOT = tu.TUPORTOT,
|
||||
// TRORRES = tr.TRORRES,
|
||||
// VISITNUM = tu.VISITNUM,
|
||||
// Note = tr.Note
|
||||
// };
|
||||
// return query.ToList();
|
||||
// }
|
||||
|
||||
// /// 获取基线期病灶信息及其他信息
|
||||
// [HttpGet, Route("getBLLineLesion/{trialCode}/{subjectCode}/{tpCode}")]
|
||||
// public BaseLineReportDTO getBLLineLesion(string trialCode, string subjectCode, string tpCode)
|
||||
// {
|
||||
// var tpcodeGroup = tpCode.Substring(tpCode.Length - 3, 3);
|
||||
// var report = _reportRepository.FirstOrDefault(u => u.TrialCode == trialCode && u.SubjectCode == subjectCode && u.VisitNum == 1); ;
|
||||
|
||||
// BaseLineReportDTO result = new BaseLineReportDTO
|
||||
// {
|
||||
// LesionInformation = GetBLLesion(trialCode, subjectCode, tpcodeGroup).Where(u => u.VISITNUM == 1).ToList(),
|
||||
// ReportResult = _mapper.Map<ReportDTO>(report)
|
||||
// };
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// /// 获取其他访视病灶信息
|
||||
// [AllowAnonymous]
|
||||
// [HttpGet, Route("getVisitLineLesion/{trialCode}/{subjectCode}/{visitNum:decimal}/{tpCode}")]
|
||||
// public VisitLesionInfo GetVisitLineLesion(string trialCode, string subjectCode, decimal visitNum, string tpCode)
|
||||
// {
|
||||
// var tpcodeGroup = tpCode.Substring(tpCode.Length - 3, 3);
|
||||
// VisitLesionInfo visitLesionInfo = new VisitLesionInfo();
|
||||
// var blLesionList = GetBLLesion(trialCode, subjectCode, tpcodeGroup);
|
||||
// int[] t = { 1, 2, 3 };
|
||||
// var query = from tu in _tURepository.Where(u => u.STUDYID == trialCode && u.USUBJID == subjectCode && u.TpCode.Contains(tpcodeGroup) /*u.TUEVALID == _userInfo.ReviewerCode*/)
|
||||
// join tr in _tRRepository.Where(u => u.VISITNUM == visitNum && u.STUDYID == trialCode && u.USUBJID == subjectCode && u.TpCode.Contains(tpcodeGroup))
|
||||
// on tu.TULNKID equals tr.TRLNKID into temp
|
||||
// from tr in temp.DefaultIfEmpty()
|
||||
// select new LesionInformation
|
||||
// {
|
||||
// TUId = tu.Id,
|
||||
// TUSEQ = tu.TUSEQ,
|
||||
// TULOC = tu.TULOC,
|
||||
// LesionType = tu.LesionType,
|
||||
// TULNKID = tu.TULNKID,
|
||||
// LocDescription = tu.LocDescription,
|
||||
// TULAT = tu.TULAT,
|
||||
// TUDIR = tu.TUDIR,
|
||||
// TUPORTOT = tu.TUPORTOT,
|
||||
// TRORRESU = tr.TRORRESU,
|
||||
// TRORRES = tr.TRORRES,
|
||||
// Note = tr.Note,
|
||||
// CoveredLesion = tr.CoveredLesion,
|
||||
// VISITNUM = tr.VISITNUM
|
||||
// };
|
||||
// var list = query.ToList();
|
||||
// var currentVisitLesion = list.Where(u => t.Contains(u.LesionType) && u.VISITNUM == visitNum).ToList();
|
||||
// foreach (var item in blLesionList)
|
||||
// {
|
||||
// var temp = _mapper.Map<VisitLesion>(item);
|
||||
// temp.CurrentLesion = currentVisitLesion.Where(u => u.STUDYID == item.STUDYID
|
||||
// && u.USUBJID == item.USUBJID && u.TUEVAL == item.TUEVAL
|
||||
// && u.TULNKID == item.TULNKID).FirstOrDefault() ?? new LesionInformation();
|
||||
// visitLesionInfo.BLLesionList.Add(temp);
|
||||
// }
|
||||
|
||||
// List<Guid> blIdList = blLesionList.Select(u => u.TUId).ToList();
|
||||
// List<Guid> visitIdList = currentVisitLesion.Where(u => t.Contains(u.LesionType)).Select(u => u.TUId).ToList();
|
||||
// var visitLesion = visitIdList.Except(blIdList);
|
||||
|
||||
// foreach (var item in visitLesion)
|
||||
// {
|
||||
// VisitLesion tempLesion = new VisitLesion();
|
||||
// tempLesion.CurrentLesion = currentVisitLesion.Where(u => u.TUId == item).FirstOrDefault() ?? new LesionInformation();
|
||||
// tempLesion.LesionType = tempLesion.CurrentLesion.LesionType;
|
||||
// tempLesion.TUSEQ = tempLesion.CurrentLesion.TUSEQ;
|
||||
// visitLesionInfo.BLLesionList.Add(tempLesion);
|
||||
// }
|
||||
// // 以往新病灶,病灶类型为5,且访视编号小于当前访视,且不是基线
|
||||
// var previousLesion = list.Where(u => u.VISITNUM < visitNum && u.VISITNUM != 1 && u.LesionType == 5).ToList();
|
||||
// foreach (var item in previousLesion)
|
||||
// {
|
||||
// var temp = _mapper.Map<VisitLesion>(item);
|
||||
// temp.CurrentLesion = currentVisitLesion.Where(u => u.TULNKID==item.TULNKID && u.STUDYID == item.STUDYID && u.USUBJID == item.USUBJID && u.TUEVAL == item.TUEVAL).FirstOrDefault() ?? new LesionInformation();
|
||||
// visitLesionInfo.PreviousNewLesionList.Add(temp);
|
||||
// }
|
||||
|
||||
// visitLesionInfo.EquivocalNewLesionList = list.Where(u => u.VISITNUM <= visitNum && u.LesionType == 4).ToList();
|
||||
// visitLesionInfo.UnequivocalNewLesionList = list.Where(u => u.VISITNUM == visitNum && u.LesionType == 5).ToList();
|
||||
|
||||
// var report = _reportRepository.FirstOrDefault(u => u.TrialCode == trialCode && u.SubjectCode == subjectCode && u.VisitNum == visitNum); ;
|
||||
// visitLesionInfo.ReportResult = _mapper.Map<ReportDTO>(report);
|
||||
|
||||
// var rs = _rSRepository.Where(u => u.STUDYID == trialCode && u.USUBJID == subjectCode
|
||||
// && u.RSEVALID == _userInfo.ReviewerCode && u.VISITNUM == visitNum);
|
||||
|
||||
// var target = rs.FirstOrDefault(u => u.RSTESTCD == "TRGRESP");
|
||||
// var non_target = rs.FirstOrDefault(u => u.RSTESTCD == "NTRGRESP");
|
||||
// var overall = rs.FirstOrDefault(u => u.RSTESTCD == "OVRLRESP");
|
||||
|
||||
// visitLesionInfo.Efficacy = new EfficacyAssessment
|
||||
// {
|
||||
|
||||
// TargetLesion = target?.RSORRES,
|
||||
// TargetLesionNote = target?.Note,
|
||||
// Non_targetLesion = non_target?.RSORRES,
|
||||
// Non_targetLesionNote = non_target?.Note,
|
||||
// OverallAssessment = overall?.RSORRES,
|
||||
// OverallAssessmentNote = overall?.Note
|
||||
// };
|
||||
|
||||
// var preRS = _rSRepository.Where(u => u.STUDYID == trialCode && u.USUBJID == subjectCode
|
||||
// && u.VISITNUM < visitNum && u.RSTESTCD == "OVRLRESP"
|
||||
// && u.RSEVAL == _userInfo.ReviewerCode /*&& u.VISITNUM == visitNum*/)
|
||||
// .Select(u => new PreviousOverallAssessment
|
||||
// {
|
||||
// VisitName = u.VISIT,
|
||||
// OverallAssessment = u.RSORRES
|
||||
// }).ToList();
|
||||
// visitLesionInfo.PreviousOverallAssessment = preRS;
|
||||
|
||||
// var targetList = _tRRepository.Where(u => (!string.IsNullOrWhiteSpace(u.TRLNKID)) && (!u.TRLNKID.Contains("N")) && u.STUDYID == trialCode &&
|
||||
// u.USUBJID == subjectCode && u.TpCode.Contains(tpcodeGroup) && u.VISITNUM < visitNum).ToList();
|
||||
|
||||
// var q = from ttt in targetList
|
||||
// group ttt by ttt.VISIT into s
|
||||
// select new MinVisit
|
||||
// {
|
||||
// MinSum = s.Sum(p => p.TRORRES_Double),
|
||||
// MinVistName = s.Key
|
||||
// };
|
||||
// var tempList = q.ToList();
|
||||
// MinVisit min = new MinVisit();
|
||||
// if (tempList.Count>0)
|
||||
// {
|
||||
// min = tempList.FirstOrDefault();
|
||||
// }
|
||||
// foreach (var item in tempList)
|
||||
// {
|
||||
// if (min.MinSum > item.MinSum)
|
||||
// {
|
||||
// min = item;
|
||||
// }
|
||||
// }
|
||||
// visitLesionInfo.MinVisitInfo = min;
|
||||
|
||||
// return visitLesionInfo;
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 提交报告
|
||||
// /// </summary>
|
||||
// [AllowAnonymous]
|
||||
// [HttpPost("{tpId:guid}")]
|
||||
// public bool SubmiteReport(Guid tpId)
|
||||
// {
|
||||
// // 提交报告 同时查询VisitStage(项目访视计划,看是否需要添加全局)
|
||||
|
||||
// var query = from workloadTp in _workloadTPRepository.Where(u => u.Id == tpId)
|
||||
// join subjectVisit in _subjectVisitRepository.AsQueryable()
|
||||
// on workloadTp.SubjectVisitId equals subjectVisit.Id
|
||||
// join visitStage in _visitStageRepository.AsQueryable()
|
||||
// on new { workloadTp.TrialId, subjectVisit.VisitNum } equals new { visitStage.TrialId, visitStage.VisitNum }
|
||||
// select new
|
||||
// {
|
||||
// WorkloadTp = workloadTp,
|
||||
// VisitNum = subjectVisit.VisitNum,
|
||||
// VisitName = subjectVisit.VisitName,
|
||||
// NeedGlobal = visitStage.NeedGlobal
|
||||
// };
|
||||
// var workload = query.ToList().FirstOrDefault();
|
||||
// if (workload != null)
|
||||
// {
|
||||
// if (workload.NeedGlobal)// 需要产生全局
|
||||
// {
|
||||
// var group = workload.WorkloadTp.TimepointCode.Substring(workload.WorkloadTp.TimepointCode.Length - 2, 2);
|
||||
// _workloadGlobalRepository.Add(new WorkloadGlobal
|
||||
// {
|
||||
// GlobalCode = workload.WorkloadTp.TimepointCode + "G" + group,
|
||||
// ReviewerId = Guid.Empty,
|
||||
// SiteId = workload.WorkloadTp.SiteId,
|
||||
// Status = -1,
|
||||
// SubjectId = workload.WorkloadTp.SubjectId,
|
||||
// TrialId = workload.WorkloadTp.TrialId,
|
||||
// VisitId = workload.WorkloadTp.SubjectVisitId,
|
||||
// VisitNum = workload.VisitNum,
|
||||
// VisitName = workload.VisitName,
|
||||
// UpdateTime = DateTime.Now
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// return _workloadTPRepository.Update(u => u.Id == tpId, s => new WorkloadTP
|
||||
// {
|
||||
// Status = (int)WorkloadStatus.ReviewFinish
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// 保存 基线期病灶及测量信息及其他信息,不会改变状态
|
||||
// /// </summary>
|
||||
// [AllowAnonymous]
|
||||
// [HttpPost]
|
||||
// public bool AddBaseLineLesion(BaseLineReportCommand baseLineReportCommand)
|
||||
// {
|
||||
// if (baseLineReportCommand.LesionInformation.Count < 1) return false;
|
||||
|
||||
// var addedLesion = baseLineReportCommand.LesionInformation[0];
|
||||
|
||||
// //删除已经有的数据
|
||||
// _tURepository.Delete(u => u.VISITNUM == addedLesion.VISITNUM && u.USUBJID == addedLesion.USUBJID && u.TUEVALID == _userInfo.ReviewerCode);
|
||||
// _tRRepository.Delete(u => u.VISITNUM == addedLesion.VISITNUM && u.USUBJID == addedLesion.USUBJID && u.TREVALID == _userInfo.ReviewerCode);
|
||||
// _reportRepository.Delete(u => u.TPId == baseLineReportCommand.ReportResult.TPId);
|
||||
|
||||
// _workloadTPRepository.Update(u => u.Id == baseLineReportCommand.ReportResult.TPId, s => new WorkloadTP
|
||||
// {
|
||||
// Status = (int)WorkloadStatus.Reading
|
||||
// });
|
||||
|
||||
// //序号按照每个项目、每个受试者、每个评估者,一条记录
|
||||
// TU lastTu = _tURepository.Where(u => u.STUDYID == addedLesion.STUDYID && u.USUBJID == addedLesion.USUBJID
|
||||
// && u.TUEVAL == addedLesion.TUEVAL).OrderByDescending("TUSEQ").FirstOrDefault();
|
||||
// int tuSeq = 101;
|
||||
// if (lastTu != null) { tuSeq = lastTu.TUSEQ; }
|
||||
// TR lastTr = _tRRepository.AsQueryable().OrderByDescending("TRSEQ").FirstOrDefault();
|
||||
// int trSeq = 1;
|
||||
// if (lastTr != null) { trSeq = lastTr.TRSEQ; }
|
||||
|
||||
// linkGroupId = Guid.NewGuid().ToString();
|
||||
// foreach (var lesion in baseLineReportCommand.LesionInformation)
|
||||
// {
|
||||
// var linkId = lesion.TULNKID;
|
||||
// if (string.IsNullOrWhiteSpace(lesion.TULNKID))
|
||||
// {
|
||||
// linkId = (lesion.TUORRES == "TARGET") ? "T" + tuSeq.ToString() : "NT" + tuSeq.ToString();
|
||||
// }
|
||||
// _tURepository.Add(new TU
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
// LesionType = lesion.LesionType,
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TUSEQ = tuSeq,
|
||||
// TULNKID = linkId,
|
||||
|
||||
// TUTESTCD = lesion.TUTESTCD,
|
||||
// TUTEST = lesion.TUTEST,
|
||||
// TUORRES = lesion.TUORRES,
|
||||
// TUSTRESC = lesion.TUSTRESC,
|
||||
|
||||
// TULOC = lesion.TULOC,
|
||||
// LocDescription = lesion.LocDescription,
|
||||
// TULAT = lesion.TULAT,
|
||||
// TUDIR = lesion.TUDIR,
|
||||
// TUPORTOT = lesion.TUPORTOT,
|
||||
// TUMETHOD = lesion.TUMETHOD,
|
||||
// TUEVAL = lesion.TUEVAL,
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
|
||||
// TUREFID = lesion.TUREFID,
|
||||
// TUACPTFL = lesion.TUACPTFL,
|
||||
// TUEVALID = _userInfo.ReviewerCode,//lesion.TUEVALID,
|
||||
// TUGRPID = string.Empty,
|
||||
// TUDY = lesion.TUDY,// 检查日
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TUDTC = lesion.TUDTC,
|
||||
// TUNAM = lesion.TUNAM,
|
||||
// TUSPID = lesion.TUSPID,
|
||||
|
||||
// TpCode = baseLineReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = linkId,
|
||||
// TRGRPID = lesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = lesion.TRTESTCD,
|
||||
// TRTEST = lesion.TRTEST,
|
||||
// TRORRES = lesion.TRORRES,
|
||||
// TRORRESU = lesion.TRORRESU,
|
||||
|
||||
// TRNAM = lesion.TUNAM,
|
||||
// TRMETHOD = lesion.TUMETHOD,
|
||||
// TREVAL = lesion.TUEVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,//lesion.TUEVALID,
|
||||
// TRACPTFL = lesion.TUACPTFL,
|
||||
|
||||
// Note = lesion.Note,
|
||||
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TRDTC = lesion.TRDTC,
|
||||
// TRDY = lesion.TRDY,
|
||||
// TpCode = baseLineReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// tuSeq++;
|
||||
// trSeq++;
|
||||
// }
|
||||
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = addedLesion.STUDYID,
|
||||
|
||||
// USUBJID = addedLesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = string.Empty,
|
||||
// TRGRPID = addedLesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = addedLesion.TRTESTCD,
|
||||
// TRTEST = "Sum of Diameter",
|
||||
// TRORRES = baseLineReportCommand.SumOfDiameter,
|
||||
// TRORRESU = "mm",//addedLesion.TRORRESU,
|
||||
|
||||
// TRNAM = addedLesion.TUNAM,
|
||||
// TRMETHOD = addedLesion.TUMETHOD,
|
||||
// TREVAL = addedLesion.TUEVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,//addedLesion.TUEVALID,
|
||||
// TRACPTFL = addedLesion.TUACPTFL,
|
||||
|
||||
// Note = string.Empty,
|
||||
|
||||
// VISITNUM = addedLesion.VISITNUM,
|
||||
// VISIT = addedLesion.VISIT,
|
||||
// VISITDY = addedLesion.VISITDY,
|
||||
// EPOCH = addedLesion.EPOCH,
|
||||
// TRDTC = addedLesion.TRDTC,
|
||||
// TRDY = addedLesion.TRDY,
|
||||
// TpCode = baseLineReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// trSeq++;
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = addedLesion.STUDYID,
|
||||
|
||||
// USUBJID = addedLesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = string.Empty,
|
||||
// TRGRPID = addedLesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = addedLesion.TRTESTCD,
|
||||
// TRTEST = "Sum Diameters of Non Lymph Node Tumors",
|
||||
// TRORRES = baseLineReportCommand.SumDiameterOfNonLymphNode,
|
||||
// TRORRESU = "mm",//addedLesion.TRORRESU,
|
||||
|
||||
// TRNAM = addedLesion.TUNAM,
|
||||
// TRMETHOD = addedLesion.TUMETHOD,
|
||||
// TREVAL = addedLesion.TUEVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,//addedLesion.TUEVALID,
|
||||
// TRACPTFL = addedLesion.TUACPTFL,
|
||||
|
||||
// Note = string.Empty,
|
||||
|
||||
// VISITNUM = addedLesion.VISITNUM,
|
||||
// VISIT = addedLesion.VISIT,
|
||||
// VISITDY = addedLesion.VISITDY,
|
||||
// EPOCH = addedLesion.EPOCH,
|
||||
// TRDTC = addedLesion.TRDTC,
|
||||
// TRDY = addedLesion.TRDY,
|
||||
// TpCode = baseLineReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// trSeq++;
|
||||
// _reportRepository.Add(_mapper.Map<Report>(baseLineReportCommand.ReportResult));
|
||||
|
||||
// return _reportRepository.SaveChanges();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 添加访视报告信息
|
||||
// /// LesionInformation 为新病灶及测量信息(包括分裂及合并产生的)
|
||||
// /// TRList 已经存在的病灶的测量信息
|
||||
// /// RSList 疗效信息
|
||||
// /// </summary>
|
||||
// [AllowAnonymous]
|
||||
// [HttpPost, Route("saveVisitReport")]
|
||||
// public bool SaveVisitReport(VisitReportCommand visitReportCommand)
|
||||
// {
|
||||
// linkGroupId = Guid.NewGuid().ToString();
|
||||
// var visitNum = visitReportCommand.ReportResult.VisitNum;
|
||||
// var subjectId = visitReportCommand.ReportResult.SubjectCode;
|
||||
|
||||
// //删除已经有的数据
|
||||
// _tURepository.Delete(u => u.VISITNUM == visitNum && u.USUBJID == subjectId && u.TUEVALID == _userInfo.ReviewerCode);
|
||||
// _tRRepository.Delete(u => u.VISITNUM == visitNum && u.USUBJID == subjectId && u.TREVALID == _userInfo.ReviewerCode);
|
||||
// _reportRepository.Delete(u => u.TPId == visitReportCommand.ReportResult.TPId);
|
||||
// _rSRepository.Delete(u => u.VISITNUM == visitNum && u.RSEVALID == _userInfo.ReviewerCode);
|
||||
|
||||
// var report = visitReportCommand.ReportResult;
|
||||
|
||||
// _workloadTPRepository.Update(u => u.Id == report.TPId, s => new WorkloadTP
|
||||
// {
|
||||
// Status = (int)WorkloadStatus.Reading
|
||||
// });
|
||||
// if (visitReportCommand.LesionInformation.Count > 0)
|
||||
// {
|
||||
// AddLesion(visitReportCommand.LesionInformation, report);
|
||||
// }
|
||||
|
||||
// TR lastTr = _tRRepository.AsQueryable().OrderByDescending("TRSEQ").FirstOrDefault();
|
||||
// int trSeq = 1;
|
||||
// if (lastTr != null) { trSeq = lastTr.TRSEQ + 1; }
|
||||
|
||||
// foreach (var lesion in visitReportCommand.TRList)
|
||||
// {
|
||||
// _tRRepository.Add(new TR
|
||||
// {
|
||||
// STUDYID = lesion.STUDYID,
|
||||
|
||||
// USUBJID = lesion.USUBJID,
|
||||
// TRSEQ = trSeq,
|
||||
// TRLNKID = lesion.TRLNKID,
|
||||
// TRGRPID = lesion.TRGRPID,
|
||||
// TRLNKGRP = linkGroupId,
|
||||
|
||||
// TRTESTCD = lesion.TRTESTCD,
|
||||
// TRTEST = lesion.TRTEST,
|
||||
// TRORRES = lesion.TRORRES,
|
||||
// TRORRESU = lesion.TRORRESU,
|
||||
|
||||
// TRNAM = lesion.TRNAM,
|
||||
// TRMETHOD = lesion.TRMETHOD,
|
||||
// TREVAL = lesion.TREVAL,
|
||||
// TREVALID = _userInfo.ReviewerCode,// lesion.TREVALID,
|
||||
// TRACPTFL = lesion.TRACPTFL,
|
||||
|
||||
// Note = lesion.Note,
|
||||
// CoveredLesion = lesion.CoveredLesion,
|
||||
// VISITNUM = lesion.VISITNUM,
|
||||
// VISIT = lesion.VISIT,
|
||||
// VISITDY = lesion.VISITDY,
|
||||
// EPOCH = lesion.EPOCH,
|
||||
// TRDTC = lesion.TRDTC,
|
||||
// TRDY = lesion.TRDY,
|
||||
// TpCode = visitReportCommand.ReportResult.TpCode
|
||||
// });
|
||||
// trSeq++;
|
||||
// }
|
||||
// foreach (var rs in visitReportCommand.RSList)
|
||||
// {
|
||||
// _rSRepository.Add(new RS
|
||||
// {
|
||||
// STUDYID = rs.STUDYID,
|
||||
// USUBJID = rs.USUBJID,
|
||||
// RSSEQ = 0,//
|
||||
// RSLNKGRP = linkGroupId,
|
||||
// RSTESTCD = rs.RSTESTCD,
|
||||
// RSTEST = rs.RSTEST,
|
||||
// RSCAT = rs.RSCAT,
|
||||
// RSORRES = rs.RSORRES,
|
||||
// RSSTRESC = rs.RSSTRESC,
|
||||
// RSSTAT = rs.RSSTAT,
|
||||
// RSREASND = rs.RSCAT,
|
||||
// RSEVAL = rs.RSEVAL,
|
||||
// RSEVALID = _userInfo.ReviewerCode,//
|
||||
// VISITNUM = rs.VISITNUM,
|
||||
// VISIT = rs.VISIT,
|
||||
// RSDTC = rs.RSDTC,
|
||||
// RSDY = rs.RSDY,
|
||||
// TpCode = visitReportCommand.ReportResult.TpCode,
|
||||
// StudyGuid = rs.StudyGuid,
|
||||
// TrialGuid = rs.TrialGuid,
|
||||
// SubjectGuid = rs.SubjectGuid,
|
||||
// Note = rs.Note
|
||||
// });
|
||||
// }
|
||||
|
||||
// _reportRepository.Add(_mapper.Map<Report>(visitReportCommand.ReportResult));
|
||||
|
||||
// return _rSRepository.SaveChanges();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,23 @@
|
||||
using AutoMapper;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
public class ReadingAndReportConfig : Profile
|
||||
{
|
||||
public ReadingAndReportConfig()
|
||||
{
|
||||
CreateMap<LesionInformation, VisitLesion>();
|
||||
|
||||
CreateMap<ReportDTO, Report>();
|
||||
CreateMap<ImageLabelDTO, ImageLabel>();
|
||||
|
||||
CreateMap<GlobalReportCommand, GlobalRS>();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user