修改
This commit is contained in:
@@ -17,7 +17,8 @@ namespace IRaCIS.Application.Services
|
||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||
private readonly IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository;
|
||||
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<Dictionary> _dictionaryRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
|
||||
|
||||
public ClinicalDataSetService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||
@@ -25,7 +26,8 @@ namespace IRaCIS.Application.Services
|
||||
IRepository<ClinicalDataTrialSet> ClinicalDataTrialSetRepository,
|
||||
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
|
||||
IRepository<PreviousPDF> previousPDFRepository,
|
||||
IRepository<Trial> trialRepository
|
||||
IRepository<Dictionary> dictionaryRepository,
|
||||
IRepository<Trial> trialRepository
|
||||
|
||||
|
||||
)
|
||||
@@ -36,7 +38,8 @@ namespace IRaCIS.Application.Services
|
||||
_clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
|
||||
_clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
|
||||
this._previousPDFRepository = previousPDFRepository;
|
||||
this._trialRepository = trialRepository;
|
||||
this._dictionaryRepository = dictionaryRepository;
|
||||
this._trialRepository = trialRepository;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +54,10 @@ namespace IRaCIS.Application.Services
|
||||
public async Task<IResponseOutput> AddOrUpdateClinicalDataSystemSet(ClinicalDataSystemSetAddOrEdit indto)
|
||||
{
|
||||
|
||||
var existsQuery = _clinicalDataSystemSetRepository
|
||||
var dictionary = await _dictionaryRepository.Where(x => x.Parent.Code == "ClinicalDataType" && x.Code == indto.ClinicalDataSetEnum.ToString()).FirstNotNullAsync();
|
||||
indto.ClinicalDataSetName = dictionary.ValueCN;
|
||||
indto.ClinicalDataSetEnName = dictionary.Value;
|
||||
var existsQuery = _clinicalDataSystemSetRepository
|
||||
.WhereIf(indto.Id != null, x => x.Id != indto.Id)
|
||||
.Where(x => x.ClinicalDataSetName == indto.ClinicalDataSetName||x.ClinicalDataSetEnName==indto.ClinicalDataSetEnName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user