|
|
@ -76,6 +76,9 @@ namespace Shentun.Peis.SumSuggestionHeaders |
|
|
join sumDiagnosis in await _sumDiagnosisRepository.GetQueryableAsync() |
|
|
join sumDiagnosis in await _sumDiagnosisRepository.GetQueryableAsync() |
|
|
on new { sumSuggestionHeader.PatientRegisterId, sumSuggestionHeader.Id } equals new { sumDiagnosis.PatientRegisterId, Id = sumDiagnosis.SumSuggestionHeaderId } into bb |
|
|
on new { sumSuggestionHeader.PatientRegisterId, sumSuggestionHeader.Id } equals new { sumDiagnosis.PatientRegisterId, Id = sumDiagnosis.SumSuggestionHeaderId } into bb |
|
|
from sumDiagnosisHaveEmpty in bb.DefaultIfEmpty() |
|
|
from sumDiagnosisHaveEmpty in bb.DefaultIfEmpty() |
|
|
|
|
|
join diagnosis in await _diagnosisRepository.GetQueryableAsync() |
|
|
|
|
|
on sumDiagnosisHaveEmpty.DiagnosisId equals diagnosis.Id into diagnosisTemp |
|
|
|
|
|
from diagnosisHaveEmpty in diagnosisTemp.DefaultIfEmpty() |
|
|
join sumSuggestionContent in await _sumSuggestionContentRepository.GetQueryableAsync() |
|
|
join sumSuggestionContent in await _sumSuggestionContentRepository.GetQueryableAsync() |
|
|
on sumSuggestionHeader.Id equals sumSuggestionContent.SumSuggestionHeaderId into cc |
|
|
on sumSuggestionHeader.Id equals sumSuggestionContent.SumSuggestionHeaderId into cc |
|
|
from sumSuggestionContentHaveEmpty in cc.DefaultIfEmpty() |
|
|
from sumSuggestionContentHaveEmpty in cc.DefaultIfEmpty() |
|
|
@ -85,6 +88,7 @@ namespace Shentun.Peis.SumSuggestionHeaders |
|
|
{ |
|
|
{ |
|
|
sumSuggestionHeader, |
|
|
sumSuggestionHeader, |
|
|
sumDiagnosisHaveEmpty, |
|
|
sumDiagnosisHaveEmpty, |
|
|
|
|
|
diagnosisHaveEmpty, |
|
|
sumSuggestionContentHaveEmpty |
|
|
sumSuggestionContentHaveEmpty |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
@ -98,6 +102,7 @@ namespace Shentun.Peis.SumSuggestionHeaders |
|
|
DisplayOrder = s.FirstOrDefault().sumSuggestionHeader.DisplayOrder, |
|
|
DisplayOrder = s.FirstOrDefault().sumSuggestionHeader.DisplayOrder, |
|
|
DiagnosisIds = s.Where(o => o.sumDiagnosisHaveEmpty != null). |
|
|
DiagnosisIds = s.Where(o => o.sumDiagnosisHaveEmpty != null). |
|
|
Select(x => x.sumDiagnosisHaveEmpty.DiagnosisId).Distinct().ToList(), |
|
|
Select(x => x.sumDiagnosisHaveEmpty.DiagnosisId).Distinct().ToList(), |
|
|
|
|
|
DiagnosisNames = s.Where(m => m.diagnosisHaveEmpty != null).Select(x => x.diagnosisHaveEmpty.DisplayName).Distinct().ToList(), |
|
|
MedicalInterpretations = s.Where(m => m.sumSuggestionContentHaveEmpty != null && |
|
|
MedicalInterpretations = s.Where(m => m.sumSuggestionContentHaveEmpty != null && |
|
|
m.sumSuggestionContentHaveEmpty.SuggestionType == SuggestionTypeFlag.MedicalInterpretation). |
|
|
m.sumSuggestionContentHaveEmpty.SuggestionType == SuggestionTypeFlag.MedicalInterpretation). |
|
|
Select(sa => new SumSuggestionContentData |
|
|
Select(sa => new SumSuggestionContentData |
|
|
@ -156,6 +161,7 @@ namespace Shentun.Peis.SumSuggestionHeaders |
|
|
SuggestionFlag = null, |
|
|
SuggestionFlag = null, |
|
|
DisplayOrder = 0, |
|
|
DisplayOrder = 0, |
|
|
DiagnosisIds = new List<Guid>() { matchDiagnosis.Id }, |
|
|
DiagnosisIds = new List<Guid>() { matchDiagnosis.Id }, |
|
|
|
|
|
DiagnosisNames = new List<string>() { matchDiagnosis.DisplayName }, |
|
|
MedicalInterpretations = matchDiagnosis.Suggestions. |
|
|
MedicalInterpretations = matchDiagnosis.Suggestions. |
|
|
Where(o => o.SuggestionType == SuggestionTypeFlag.MedicalInterpretation) |
|
|
Where(o => o.SuggestionType == SuggestionTypeFlag.MedicalInterpretation) |
|
|
.OrderBy(o => o.DisplayOrder) |
|
|
.OrderBy(o => o.DisplayOrder) |
|
|
@ -199,6 +205,7 @@ namespace Shentun.Peis.SumSuggestionHeaders |
|
|
SuggestionFlag = null, |
|
|
SuggestionFlag = null, |
|
|
DisplayOrder = 0, |
|
|
DisplayOrder = 0, |
|
|
DiagnosisIds = null, |
|
|
DiagnosisIds = null, |
|
|
|
|
|
DiagnosisNames = null |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -301,4 +308,4 @@ namespace Shentun.Peis.SumSuggestionHeaders |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |