项目医生简历
This commit is contained in:
@@ -14,26 +14,36 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据医生Id,获取临床试验经历 界面所有数据
|
||||
/// 根据医生Id,获取临床试验经历 界面所有数据 获取其他相关经历
|
||||
/// </summary>
|
||||
[HttpGet("{doctorId:guid}")]
|
||||
public async Task<TrialExperienceModel> GetTrialExperience(Guid doctorId)
|
||||
public async Task<TrialExperienceModel> GetTrialExperience(TrialExperienceModelIndto indto)
|
||||
{
|
||||
var trialExperience = new TrialExperienceModel();
|
||||
|
||||
var doctor = await _doctorRepository.Where(o => o.Id == doctorId)
|
||||
var doctor = await _doctorRepository.Where(o => o.Id == indto.DoctorId)
|
||||
.ProjectTo<TrialExperienceModel>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
trialExperience.ClinicalTrialExperienceList = await GetTrialExperienceList(doctorId);
|
||||
trialExperience.ClinicalTrialExperienceList = await GetTrialExperienceList(indto.DoctorId);
|
||||
|
||||
if (doctor != null)
|
||||
{
|
||||
var trialDoctor = new Doctor();
|
||||
if (indto.TrialId != null)
|
||||
{
|
||||
trialDoctor = await GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
||||
{
|
||||
DoctorId = indto.DoctorId,
|
||||
TrialId = indto.TrialId.Value,
|
||||
});
|
||||
}
|
||||
|
||||
trialExperience.GCP = doctor.GCP;
|
||||
trialExperience.Id = doctor.Id;
|
||||
trialExperience.GCPTime = doctor.GCPTime;
|
||||
trialExperience.GCPAgencies = doctor.GCPAgencies;
|
||||
trialExperience.OtherClinicalExperience = doctor.OtherClinicalExperience ?? "";
|
||||
trialExperience.OtherClinicalExperienceCN = doctor.OtherClinicalExperienceCN ?? "";
|
||||
trialExperience.OtherClinicalExperience =(indto.TrialId != null? trialDoctor.OtherClinicalExperience: doctor.OtherClinicalExperience) ?? "";
|
||||
trialExperience.OtherClinicalExperienceCN = (indto.TrialId != null ? trialDoctor.OtherClinicalExperienceCN : doctor.OtherClinicalExperienceCN) ?? "";
|
||||
var attachment = await _attachmentRepository.FirstOrDefaultAsync(t => t.Id == doctor.GCPId);
|
||||
if (attachment != null)
|
||||
{
|
||||
@@ -51,6 +61,35 @@ namespace IRaCIS.Core.Application.Service
|
||||
return trialExperience;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目编辑的医生信息
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Doctor> GetTrialDoctorInfo(GetTrialDoctorInfoInDto inDto)
|
||||
{
|
||||
var doctorInfo = await _doctorRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId).FirstOrDefaultAsync();
|
||||
if (doctorInfo == null)
|
||||
{
|
||||
|
||||
var systemInfoDcotor = await _doctorRepository.Where(x => x.Id == inDto.DoctorId).FirstNotNullAsync();
|
||||
|
||||
Doctor doctor = new Doctor()
|
||||
{
|
||||
DoctorId = inDto.DoctorId,
|
||||
TrialId = inDto.TrialId,
|
||||
OtherClinicalExperience = systemInfoDcotor.OtherClinicalExperience,
|
||||
OtherClinicalExperienceCN = systemInfoDcotor.OtherClinicalExperienceCN,
|
||||
Summarize = systemInfoDcotor.Summarize,
|
||||
SummarizeEn = systemInfoDcotor.SummarizeEn,
|
||||
};
|
||||
|
||||
doctorInfo = await _doctorRepository.AddAsync(doctor, true);
|
||||
}
|
||||
|
||||
return doctorInfo;
|
||||
}
|
||||
|
||||
private async Task<List<TrialExperienceListDTO>> GetTrialExperienceList(Guid doctorId)
|
||||
{
|
||||
var doctorClinicalTrialExperienceList = await _trialExperienceRepository.Where(o => o.DoctorId == doctorId).OrderBy(t => t.CreateTime)
|
||||
@@ -155,15 +194,30 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// </summary>
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> UpdateOtherExperience(ClinicalExperienceCommand updateOtherClinicalExperience)
|
||||
public async Task<IResponseOutput> UpdateOtherExperience(ClinicalExperienceCommand inDto)
|
||||
{
|
||||
var success = await _doctorRepository.BatchUpdateNoTrackingAsync(o => o.Id == updateOtherClinicalExperience.DoctorId, u => new Doctor()
|
||||
{
|
||||
OtherClinicalExperience = updateOtherClinicalExperience.OtherClinicalExperience ?? string.Empty,
|
||||
OtherClinicalExperienceCN = updateOtherClinicalExperience.OtherClinicalExperienceCN ?? string.Empty
|
||||
});
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
if (inDto.TrialId != null)
|
||||
{
|
||||
var success = await _doctorRepository.BatchUpdateNoTrackingAsync(o => o.Id == inDto.DoctorId&&o.TrialId==inDto.TrialId.Value, u => new Doctor()
|
||||
{
|
||||
OtherClinicalExperience = inDto.OtherClinicalExperience ?? string.Empty,
|
||||
OtherClinicalExperienceCN = inDto.OtherClinicalExperienceCN ?? string.Empty
|
||||
});
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
else
|
||||
{
|
||||
var success = await _doctorRepository.BatchUpdateNoTrackingAsync(o => o.Id == inDto.DoctorId, u => new Doctor()
|
||||
{
|
||||
OtherClinicalExperience = inDto.OtherClinicalExperience ?? string.Empty,
|
||||
OtherClinicalExperienceCN = inDto.OtherClinicalExperienceCN ?? string.Empty
|
||||
});
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user