Compare commits
2 Commits
b56bfcbfcf
...
34f5978aea
| Author | SHA1 | Date |
|---|---|---|
|
|
34f5978aea | |
|
|
50576c4ba9 |
|
|
@ -43,6 +43,9 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository,
|
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository,
|
||||||
|
IRepository<Segment> _segmentRepository,
|
||||||
|
IRepository<Segmentation> _segmentationRepository,
|
||||||
|
IRepository<SegmentBinding> _segmentBindingRepository,
|
||||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||||
IRepository<DicomSeries> _dicomSeriesRepository,
|
IRepository<DicomSeries> _dicomSeriesRepository,
|
||||||
IRepository<SubjectCanceDoctor> _subjectCanceDoctorRepository,
|
IRepository<SubjectCanceDoctor> _subjectCanceDoctorRepository,
|
||||||
|
|
@ -2220,7 +2223,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CopyForms(VisitTask newTask, VisitTask origenalTask)
|
private async Task CopyForms(VisitTask newTask, VisitTask origenalTask)
|
||||||
{
|
{
|
||||||
newTask.IsCopyLesionAnswer = true;
|
newTask.IsCopyLesionAnswer = true;
|
||||||
//自定义
|
//自定义
|
||||||
|
|
@ -2236,6 +2239,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
//_ = _readingCustomTagRepository.AddRangeAsync(readingCustomTagList).Result;
|
//_ = _readingCustomTagRepository.AddRangeAsync(readingCustomTagList).Result;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var readingTaskQuestionAnswerList = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
var readingTaskQuestionAnswerList = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||||
|
|
@ -2294,6 +2298,60 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region 分割
|
||||||
|
Dictionary<Guid, Guid> segmentationRelationship = new Dictionary<Guid, Guid>() { };
|
||||||
|
var segmentationList = await _segmentationRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToListAsync();
|
||||||
|
|
||||||
|
foreach (var item in segmentationList)
|
||||||
|
{
|
||||||
|
|
||||||
|
var newSegmentationId = NewId.NextSequentialGuid();
|
||||||
|
segmentationRelationship.Add(item.Id, newSegmentationId);
|
||||||
|
item.Id = newSegmentationId;
|
||||||
|
item.VisitTaskId = newTask.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Dictionary<Guid, Guid> segmentRelationship = new Dictionary<Guid, Guid>() { };
|
||||||
|
var segmentList = await _segmentRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToListAsync();
|
||||||
|
foreach (var item in segmentList)
|
||||||
|
{
|
||||||
|
var newSegmentationId = NewId.NextSequentialGuid();
|
||||||
|
segmentRelationship.Add(item.Id, newSegmentationId);
|
||||||
|
item.Id = newSegmentationId;
|
||||||
|
item.VisitTaskId = newTask.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
var segmentBindingList = await _segmentBindingRepository.Where(x => x.VisitTaskId == origenalTask.Id).ToListAsync();
|
||||||
|
|
||||||
|
foreach (var item in segmentBindingList)
|
||||||
|
{
|
||||||
|
if (segmentationRelationship.ContainsKey(item.SegmentationId))
|
||||||
|
{
|
||||||
|
item.SegmentationId = segmentationRelationship[item.SegmentationId];
|
||||||
|
}
|
||||||
|
if (segmentRelationship.ContainsKey(item.SegmentId))
|
||||||
|
{
|
||||||
|
item.SegmentId = segmentRelationship[item.SegmentId];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.RowId != null && lesionRelationship.ContainsKey(item.RowId.Value))
|
||||||
|
{
|
||||||
|
item.RowId = lesionRelationship[item.RowId.Value];
|
||||||
|
}
|
||||||
|
item.Id = NewId.NextSequentialGuid();
|
||||||
|
item.VisitTaskId = newTask.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_ = _segmentationRepository.AddRangeAsync(segmentationList).Result;
|
||||||
|
_ = _segmentRepository.AddRangeAsync(segmentList).Result;
|
||||||
|
_ = _segmentBindingRepository.AddRangeAsync(segmentBindingList).Result;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in readingTableAnswerRowInfoList)
|
foreach (var item in readingTableAnswerRowInfoList)
|
||||||
{
|
{
|
||||||
if (item.SplitRowId != null && lesionRelationship.ContainsKey(item.SplitRowId.Value))
|
if (item.SplitRowId != null && lesionRelationship.ContainsKey(item.SplitRowId.Value))
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,11 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public class Segment : BaseFullDeleteAuditEntity
|
public class Segment : BaseFullDeleteAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
[JsonIgnore]
|
||||||
|
[Comment("分割分组")]
|
||||||
|
[ForeignKey("SegmentationId")]
|
||||||
|
|
||||||
|
public Segmentation Segmentation { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ namespace IRaCIS.Core.Domain.Models;
|
||||||
public class Segmentation : BaseFullDeleteAuditEntity
|
public class Segmentation : BaseFullDeleteAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<Segment> SegmentList { get; set; } = new List<Segment>();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue