Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
3c43498fdb
|
@ -125,13 +125,14 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
if (userTypeSelectEnum == UserTypeSelectEnum.EnrollOrPD_EMailCopy)
|
if (userTypeSelectEnum == UserTypeSelectEnum.EnrollOrPD_EMailCopy)
|
||||||
{
|
{
|
||||||
userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.CRA, UserTypeEnum.ClinicalResearchCoordinator };
|
userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.CPM, UserTypeEnum.SPM, UserTypeEnum.SMM, UserTypeEnum.CMM };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userTypeSelectEnum == UserTypeSelectEnum.EnrollOrPD_EmailReceive)
|
if (userTypeSelectEnum == UserTypeSelectEnum.EnrollOrPD_EmailReceive)
|
||||||
{
|
{
|
||||||
|
userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.CRA, UserTypeEnum.ClinicalResearchCoordinator };
|
||||||
|
|
||||||
userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.CPM, UserTypeEnum.SPM, UserTypeEnum.SMM, UserTypeEnum.CMM };
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,14 +77,7 @@ namespace IRaCIS.Application.Services
|
||||||
.WhereIf(indto.Id != null, x => x.Id != indto.Id)
|
.WhereIf(indto.Id != null, x => x.Id != indto.Id)
|
||||||
.Where(x => x.ClinicalDataTrialSetId == indto.ClinicalDataTrialSetId && x.ReadingId == indto.ReadingId);
|
.Where(x => x.ClinicalDataTrialSetId == indto.ClinicalDataTrialSetId && x.ReadingId == indto.ReadingId);
|
||||||
|
|
||||||
if (await _subjectVisitRepository.AnyAsync(x => x.Id == indto.ReadingId))
|
|
||||||
{
|
|
||||||
indto.IsVisit = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
indto.IsVisit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (await existsQuery.AnyAsync())
|
if (await existsQuery.AnyAsync())
|
||||||
|
@ -92,6 +85,10 @@ namespace IRaCIS.Application.Services
|
||||||
return ResponseOutput.NotOk("存在同类型的临床数据");
|
return ResponseOutput.NotOk("存在同类型的临床数据");
|
||||||
}
|
}
|
||||||
var clinicalDataTrialSet = (await _clinicalDataTrialSetRepository.Where(x => x.Id == indto.ClinicalDataTrialSetId).FirstOrDefaultAsync()).IfNullThrowException();
|
var clinicalDataTrialSet = (await _clinicalDataTrialSetRepository.Where(x => x.Id == indto.ClinicalDataTrialSetId).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
//subject 或者访视级别的 都是在访视传
|
||||||
|
indto.IsVisit = clinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject || clinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit;
|
||||||
|
|
||||||
if (indto.Id == null)
|
if (indto.Id == null)
|
||||||
{
|
{
|
||||||
var entity = _mapper.Map<ReadingClinicalData>(indto);
|
var entity = _mapper.Map<ReadingClinicalData>(indto);
|
||||||
|
@ -418,7 +415,7 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadModule readModule = null;
|
ReadModule readModule = null;
|
||||||
if (inDto.ReadingId != null)
|
if (inDto.IsVisit ==false)
|
||||||
{
|
{
|
||||||
readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId).FirstOrDefaultAsync();
|
readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId).FirstOrDefaultAsync();
|
||||||
}
|
}
|
||||||
|
@ -519,13 +516,14 @@ namespace IRaCIS.Application.Services
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<(List<GetReadingClinicalDataListOutDto>, object)> GetReadingClinicalDataList(GetReadingClinicalDataListIndto inDto)
|
public async Task<(List<GetReadingClinicalDataListOutDto>, object)> GetReadingClinicalDataList(GetReadingClinicalDataListIndto inDto)
|
||||||
{
|
{
|
||||||
GetTrialClinicalDataSelectIndto getTrialClinicalDataSelectIndto = new GetTrialClinicalDataSelectIndto()
|
var getTrialClinicalDataSelectIndto = new GetTrialClinicalDataSelectIndto()
|
||||||
{
|
{
|
||||||
ReadingId = inDto.ReadingId,
|
ReadingId = inDto.ReadingId,
|
||||||
TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
IsBaseLine = inDto.IsBaseLine,
|
IsBaseLine = inDto.IsBaseLine,
|
||||||
SubjectId = inDto.SubjectId,
|
SubjectId = inDto.SubjectId,
|
||||||
IsVisit = inDto.IsVisit,
|
IsVisit = inDto.IsVisit,
|
||||||
|
TrialReadingCriterionId=inDto.TrialReadingCriterionId
|
||||||
};
|
};
|
||||||
|
|
||||||
var clinicalDataList = await this.GetTrialClinicalDataSelect(getTrialClinicalDataSelectIndto);
|
var clinicalDataList = await this.GetTrialClinicalDataSelect(getTrialClinicalDataSelectIndto);
|
||||||
|
|
|
@ -307,4 +307,9 @@ WHERE EXISTS (
|
||||||
SELECT 1
|
SELECT 1
|
||||||
FROM [VisitTask] AS [v1]
|
FROM [VisitTask] AS [v1]
|
||||||
WHERE [v1].SubjectId=v.SubjectId and V1.TrialReadingCriterionId=V.TrialReadingCriterionId and V1.TrialId=V.TrialId and [v1].[IsNeedClinicalDataSign]=1 and V1.IsClinicalDataSign=0 and V1.VisitTaskNum< [v0].[VisitTaskNum]
|
WHERE [v1].SubjectId=v.SubjectId and V1.TrialReadingCriterionId=V.TrialReadingCriterionId and V1.TrialId=V.TrialId and [v1].[IsNeedClinicalDataSign]=1 and V1.IsClinicalDataSign=0 and V1.VisitTaskNum< [v0].[VisitTaskNum]
|
||||||
|
|
||||||
) AND [v0].[Id] = [v].[Id] )
|
) AND [v0].[Id] = [v].[Id] )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
update ReadingClinicalData set IsVisit=1 from ReadingClinicalData INNER JOIN ClinicalDataTrialSet on ReadingClinicalData.ClinicalDataTrialSetId = ClinicalDataTrialSet.Id where ClinicalDataTrialSet.ClinicalDataLevel in (0,1) and ReadingClinicalData.IsVisit=0
|
Loading…
Reference in New Issue