修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
e7193be3d7
commit
c5aaa08326
|
@ -88,6 +88,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
OtherClinicalExperienceCN = systemInfoDcotor.OtherClinicalExperienceCN,
|
OtherClinicalExperienceCN = systemInfoDcotor.OtherClinicalExperienceCN,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#region 概述
|
||||||
///没有就加
|
///没有就加
|
||||||
var summarizeCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId).CountAsync();
|
var summarizeCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId).CountAsync();
|
||||||
if (summarizeCount == 0)
|
if (summarizeCount == 0)
|
||||||
|
@ -95,17 +96,48 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var main = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.IsMain && x.TrialId == null).ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
var main = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.IsMain && x.TrialId == null).ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||||
if (main != null)
|
if (main != null)
|
||||||
{
|
{
|
||||||
main.Id=null;
|
main.Id = null;
|
||||||
main.TrialId = inDto.TrialId;
|
main.TrialId = inDto.TrialId;
|
||||||
main.IsMain = false;
|
main.IsMain = false;
|
||||||
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(main, true);
|
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(main, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
doctorInfo = await _doctorRepository.AddAsync(doctor, true);
|
doctorInfo = await _doctorRepository.AddAsync(doctor, true);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 临床试验
|
||||||
|
|
||||||
|
var trialExperienceList = await _trialExperienceRepository.Where(o => o.DoctorId == inDto.DoctorId)
|
||||||
|
.Where(x => x.ExperienceDataType == ExperienceDataType.System || x.ExperienceDataType == ExperienceDataType.SystemAuto).Include(x => x.ExperienceCriteriaList).ToListAsync();
|
||||||
|
List<TrialExperienceCriteria> criteriaList = new List<TrialExperienceCriteria>();
|
||||||
|
foreach (var item in trialExperienceList)
|
||||||
|
{
|
||||||
|
item.Trial = null;
|
||||||
|
item.TrialId = inDto.TrialId;
|
||||||
|
item.ExperienceDataType = ExperienceDataType.Trial;
|
||||||
|
item.Id = NewId.NextGuid();
|
||||||
|
item.ExperienceCriteriaList.ForEach(x => {
|
||||||
|
|
||||||
|
criteriaList.Add(new TrialExperienceCriteria()
|
||||||
|
{
|
||||||
|
DoctorId = item.DoctorId,
|
||||||
|
EvaluationCriteriaId = x.EvaluationCriteriaId,
|
||||||
|
TrialExperienceId = item.Id
|
||||||
|
});
|
||||||
|
});
|
||||||
|
item.ExperienceCriteriaList = new List<TrialExperienceCriteria>();
|
||||||
|
}
|
||||||
|
await _trialExperienceCriteriaRepository.AddRangeAsync(criteriaList);
|
||||||
|
await _trialExperienceRepository.AddRangeAsync(trialExperienceList);
|
||||||
|
await _trialExperienceRepository.SaveChangesAsync();
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return doctorInfo;
|
return doctorInfo;
|
||||||
|
@ -130,41 +162,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
DoctorId = inDto.DoctorId,
|
DoctorId = inDto.DoctorId,
|
||||||
TrialId = inDto.TrialId.Value,
|
TrialId = inDto.TrialId.Value,
|
||||||
});
|
});
|
||||||
// 当前项目没有则复制
|
|
||||||
if (!(await _trialExperienceRepository.AnyAsync(x => x.TrialId == inDto.TrialId&&x.DoctorId==inDto.DoctorId &&x.ExperienceDataType== ExperienceDataType.Trial))
|
|
||||||
&&(await _doctorRepository.AnyAsync(x => x.TrialId == inDto.TrialId && x.IsAddTrialExperienceToTrial==false && x.DoctorId == inDto.DoctorId))
|
|
||||||
)
|
|
||||||
{
|
|
||||||
var trialExperienceList = await _trialExperienceRepository.Where(o => o.DoctorId == inDto.DoctorId)
|
|
||||||
.Where(x => x.ExperienceDataType == ExperienceDataType.System || x.ExperienceDataType == ExperienceDataType.SystemAuto).Include(x=>x.ExperienceCriteriaList).ToListAsync();
|
|
||||||
List<TrialExperienceCriteria> criteriaList = new List<TrialExperienceCriteria>();
|
|
||||||
foreach (var item in trialExperienceList)
|
|
||||||
{
|
|
||||||
item.Trial = null;
|
|
||||||
item.TrialId = inDto.TrialId;
|
|
||||||
item.ExperienceDataType = ExperienceDataType.Trial;
|
|
||||||
item.Id = NewId.NextGuid();
|
|
||||||
item.ExperienceCriteriaList.ForEach(x => {
|
|
||||||
|
|
||||||
criteriaList.Add(new TrialExperienceCriteria()
|
|
||||||
{
|
|
||||||
DoctorId = item.DoctorId,
|
|
||||||
EvaluationCriteriaId = x.EvaluationCriteriaId,
|
|
||||||
TrialExperienceId = item.Id
|
|
||||||
});
|
|
||||||
});
|
|
||||||
item.ExperienceCriteriaList = new List<TrialExperienceCriteria>();
|
|
||||||
}
|
|
||||||
await _trialExperienceCriteriaRepository.AddRangeAsync(criteriaList);
|
|
||||||
await _trialExperienceRepository.AddRangeAsync(trialExperienceList);
|
|
||||||
await _doctorRepository.BatchUpdateNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId, x => new Doctor()
|
|
||||||
{
|
|
||||||
IsAddTrialExperienceToTrial=true
|
|
||||||
|
|
||||||
});
|
|
||||||
await _trialExperienceRepository.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
var doctorClinicalTrialExperienceList = await _trialExperienceRepository
|
var doctorClinicalTrialExperienceList = await _trialExperienceRepository
|
||||||
.Where(o => o.DoctorId == inDto.DoctorId)
|
.Where(o => o.DoctorId == inDto.DoctorId)
|
||||||
.Where(x => x.ExperienceDataType == ExperienceDataType.Trial|| x.ExperienceDataType == ExperienceDataType.TrialAuto)
|
.Where(x => x.ExperienceDataType == ExperienceDataType.Trial|| x.ExperienceDataType == ExperienceDataType.TrialAuto)
|
||||||
|
|
|
@ -247,9 +247,4 @@ public class Doctor : BaseFullAuditEntity
|
||||||
/// ÏîÄ¿Id
|
/// ÏîÄ¿Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? TrialId { get; set; }
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否添加临床试验到项目
|
|
||||||
/// </summary>
|
|
||||||
public bool IsAddTrialExperienceToTrial { get; set; } = false;
|
|
||||||
}
|
}
|
||||||
|
|
18199
IRaCIS.Core.Infra.EFCore/Migrations/20241125085235_doctorino.Designer.cs
generated
Normal file
18199
IRaCIS.Core.Infra.EFCore/Migrations/20241125085235_doctorino.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,29 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class doctorino : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsAddTrialExperienceToTrial",
|
||||||
|
table: "Doctor");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsAddTrialExperienceToTrial",
|
||||||
|
table: "Doctor",
|
||||||
|
type: "bit",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1428,9 +1428,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<bool>("IsAddTrialExperienceToTrial")
|
|
||||||
.HasColumnType("bit");
|
|
||||||
|
|
||||||
b.Property<bool>("IsVirtual")
|
b.Property<bool>("IsVirtual")
|
||||||
.HasColumnType("bit");
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue