医学审核初步完成

Uat_Study
hang 2022-09-01 10:35:12 +08:00
parent 50e1ba6716
commit 102a6f851a
2 changed files with 71 additions and 22 deletions

View File

@ -85,7 +85,7 @@ namespace IRaCIS.Core.Domain.Models
/// </summary>
public Guid DoctorUserId { get; set; }
[JsonIgnore]
public TaskMedicalReviewRule TaskMedicalReviewRule { get; set; }
@ -144,7 +144,7 @@ namespace IRaCIS.Core.Domain.Models
/// </summary>
public string FileName { get; set; } = string.Empty;
[JsonIgnore]
public List<ReadingMedicalReviewDialog> ReadingMedicalReviewDialogList { get; set; }

View File

@ -135,16 +135,16 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
#endregion
#endregion
#region 已修改
#region 已修改
// 系统文件签署 父层级未记录稽查(系统文档初始数据)
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemDocConfirmedUser)))
// 系统文件签署 父层级未记录稽查(系统文档初始数据)
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemDocConfirmedUser)))
{
var type = GetEntityAuditOpt(item);
@ -196,7 +196,71 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
//医学审核
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TaskMedicalReview)))
{
var type = GetEntityAuditOpt(item);
var entity = item.Entity as TaskMedicalReview;
await InsertInspection<TaskMedicalReview>(entity, type, x => new InspectionConvertDTO()
{
VisitTaskId = entity.VisitTaskId,
ObjectRelationParentId = entity.VisitTaskId,
ObjectRelationParentId2 = entity.MedicalManagerUserId
});
}
//医学审核 问题答案
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingMedicineQuestionAnswer)))
{
var type = AuditOpt.Add;
var list = entitys.Where(x => x.Entity.GetType() == typeof(ReadingMedicineQuestionAnswer)).Select(t => t.Entity as ReadingMedicineQuestionAnswer);
var questionIdList = list.Select(t => t.ReadingMedicineQuestionId).ToList();
var questionNameList = await _dbContext.ReadingMedicineTrialQuestion.Where(x => questionIdList.Contains(x.Id)).Select(t => new { t.QuestionName, ReadingMedicineQuestionId = t.Id, t.ShowOrder }).ToListAsync();
var firstEntity = list.FirstOrDefault();
var cloneEntity = firstEntity.Clone();
//保证Id 唯一
cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.VisitTaskId.ToString(), firstEntity.TaskMedicalReviewId.ToString() );
await InsertInspection(cloneEntity, type, x => new InspectionConvertDTO()
{
VisitTaskId = x.VisitTaskId,
//byzhouhang
ObjectRelationParentId = x.TaskMedicalReviewId,
}, new
{
QuestionAnswerList = list.Join(questionNameList, t => t.ReadingMedicineQuestionId, u => u.ReadingMedicineQuestionId, (t, u) => new { t.Answer, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList(),
});
}
//医学审核对话
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingMedicalReviewDialog)))
{
var type = GetEntityAuditOpt(item);
var entity = item.Entity as ReadingMedicalReviewDialog;
await InsertInspection<ReadingMedicalReviewDialog>(entity, type, x => new InspectionConvertDTO()
{
VisitTaskId = entity.VisitTaskId,
ObjectRelationParentId = entity.TaskMedicalReviewId,
});
}
// Qc 问题答案
@ -1182,22 +1246,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//医学审核
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TaskMedicalReview)))
{
var type = GetEntityAuditOpt(item);
var entity = item.Entity as TaskMedicalReview;
await InsertInspection<TaskMedicalReview>(entity, type, x => new InspectionConvertDTO()
{
VisitTaskId = entity.VisitTaskId,
ObjectRelationParentId = entity.VisitTaskId,
ObjectRelationParentId2 = entity.MedicalManagerUserId
});
}
//一致性分析规则