j修改全局阅片结果
parent
274e0846fe
commit
ab2be64346
|
@ -54,6 +54,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public List<ReadingQuestionSystem> ReadingQuestionSystemList { get; set; } = new List<ReadingQuestionSystem>();
|
public List<ReadingQuestionSystem> ReadingQuestionSystemList { get; set; } = new List<ReadingQuestionSystem>();
|
||||||
|
|
||||||
[ForeignKey("CriterionId")]
|
[ForeignKey("CriterionId")]
|
||||||
|
|
|
@ -230,7 +230,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
var cloneEntity = firstEntity.Clone();
|
var cloneEntity = firstEntity.Clone();
|
||||||
|
|
||||||
//保证Id 唯一
|
//保证Id 唯一
|
||||||
cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.VisitTaskId.ToString(), firstEntity.TaskMedicalReviewId.ToString() );
|
cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.VisitTaskId.ToString(), firstEntity.TaskMedicalReviewId.ToString());
|
||||||
|
|
||||||
await InsertInspection(cloneEntity, type, x => new InspectionConvertDTO()
|
await InsertInspection(cloneEntity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
|
@ -267,7 +267,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingOncologyTaskInfo)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingOncologyTaskInfo)))
|
||||||
{
|
{
|
||||||
var type =AuditOpt.Add;
|
var type = AuditOpt.Add;
|
||||||
|
|
||||||
var entity = item.Entity as ReadingOncologyTaskInfo;
|
var entity = item.Entity as ReadingOncologyTaskInfo;
|
||||||
|
|
||||||
|
@ -279,29 +279,55 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 全局 阅片结果
|
|
||||||
|
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo)))
|
u
|
||||||
|
// 全局 阅片结果
|
||||||
|
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo)))
|
||||||
{
|
{
|
||||||
var type = AuditOpt.Add;
|
var type = AuditOpt.Add;
|
||||||
|
|
||||||
var entity = item.Entity as ReadingGlobalTaskInfo;
|
var list = entitys.Where(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo)).Select(t => t.Entity as ReadingGlobalTaskInfo);
|
||||||
|
|
||||||
var questionName = string.Empty;
|
|
||||||
if(entity.QuestionId != null)
|
foreach (var group in list.GroupBy(t => t.TaskId))
|
||||||
{
|
{
|
||||||
questionName= await _dbContext.ReadingQuestionTrial.Where(t => t.Id == entity.QuestionId).Select(t => t.QuestionName).FirstOrDefaultAsync();
|
var questionAnswerList = group.Where(t => t.QuestionId != null).ToList();
|
||||||
|
|
||||||
|
var reasonStr = group.Where(t => t.QuestionId == null).FirstOrDefault().Answer;
|
||||||
|
|
||||||
|
var questionIdList = questionAnswerList.Select(t => t.QuestionId).ToList();
|
||||||
|
|
||||||
|
var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => questionIdList.Contains(t.Id)).Select(t => new { t.QuestionName, QuestionId = t.Id, t.ShowOrder }).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var firstEntity = questionAnswerList.First();
|
||||||
|
|
||||||
|
var cloneEntity = firstEntity.Clone();
|
||||||
|
|
||||||
|
//保证Id 唯一
|
||||||
|
cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.GlobalTaskId.ToString(), firstEntity.TaskId.ToString(), firstEntity.Id.ToString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
await InsertInspection<ReadingGlobalTaskInfo>(cloneEntity, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
VisitTaskId = x.TaskId,
|
||||||
|
|
||||||
|
ObjectRelationParentId = x.TaskId,
|
||||||
|
|
||||||
|
}, new { Reason = reasonStr, QuestionAnswerList = questionAnswerList.Join(quesionList, t => t.QuestionId, u => u.QuestionId, (t, u) => new { t.Answer, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList() });
|
||||||
}
|
}
|
||||||
|
|
||||||
await InsertInspection<ReadingGlobalTaskInfo>(entity, type, x => new InspectionConvertDTO()
|
|
||||||
{
|
|
||||||
VisitTaskId = entity.TaskId,
|
|
||||||
|
|
||||||
ObjectRelationParentId = entity.TaskId,
|
|
||||||
|
|
||||||
},new { QuestionName= questionName });
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1255,11 +1281,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
var entity = item.Entity as VisitTask;
|
var entity = item.Entity as VisitTask;
|
||||||
|
|
||||||
var obj= new object() { };
|
var obj = new object() { };
|
||||||
|
|
||||||
if(entity.JudgeResultTaskId != null && _userInfo.RequestUrl== "ReadingImageTask/saveJudgeVisitTaskResult")
|
if (entity.JudgeResultTaskId != null && _userInfo.RequestUrl == "ReadingImageTask/saveJudgeVisitTaskResult")
|
||||||
{
|
{
|
||||||
var list= await _dbContext.VisitTask.Where(t => t.TaskState == TaskState.Effect && t.SubjectId == entity.SubjectId && t.VisitTaskNum == entity.VisitTaskNum ).Select(t => new {t.Id, t.DoctorUser.FullName, t.ArmEnum }).OrderBy(t=>t.ArmEnum).ToListAsync();
|
var list = await _dbContext.VisitTask.Where(t => t.TaskState == TaskState.Effect && t.SubjectId == entity.SubjectId && t.VisitTaskNum == entity.VisitTaskNum).Select(t => new { t.Id, t.DoctorUser.FullName, t.ArmEnum }).OrderBy(t => t.ArmEnum).ToListAsync();
|
||||||
|
|
||||||
var r1 = list.First();
|
var r1 = list.First();
|
||||||
var r2 = list.Last();
|
var r2 = list.Last();
|
||||||
|
|
Loading…
Reference in New Issue