|
|
|
@ -386,8 +386,15 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
from unitHaveEmpty in unitExist.DefaultIfEmpty() |
|
|
|
join patientRegister in await _patientRegisterRepository.GetQueryableAsync() on registerCheck.PatientRegisterId equals patientRegister.Id |
|
|
|
where registerCheck.Id == input.RegisterCheckId |
|
|
|
select new { registerCheck, registerAsbitem, registerCheckItem, asbitem, item, |
|
|
|
unitHaveEmpty,patientRegister |
|
|
|
select new |
|
|
|
{ |
|
|
|
registerCheck, |
|
|
|
registerAsbitem, |
|
|
|
registerCheckItem, |
|
|
|
asbitem, |
|
|
|
item, |
|
|
|
unitHaveEmpty, |
|
|
|
patientRegister |
|
|
|
}).AsNoTracking().ToList(); |
|
|
|
|
|
|
|
var resultDto = new GetDiagnosisResultDto |
|
|
|
@ -435,7 +442,7 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
{ |
|
|
|
var inputItem = input.Items.Where(o => o.ItemId == item.item.Id).FirstOrDefault(); |
|
|
|
var inputResult = ""; |
|
|
|
if(inputItem != null) |
|
|
|
if (inputItem != null) |
|
|
|
{ |
|
|
|
inputResult = inputItem.Result; |
|
|
|
} |
|
|
|
@ -443,7 +450,7 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
{ |
|
|
|
ItemId = item.item.Id, |
|
|
|
ItemName = item.item.DisplayName, |
|
|
|
Unit = (item.unitHaveEmpty == null)?"":item.unitHaveEmpty.DisplayName, |
|
|
|
Unit = (item.unitHaveEmpty == null) ? "" : item.unitHaveEmpty.DisplayName, |
|
|
|
IsDiagnosisFunction = item.item.IsDiagnosisFunction, |
|
|
|
DiagnosisFunction = item.item.DiagnosisFunction, |
|
|
|
IsContinueProcess = item.item.IsContinueProcess, |
|
|
|
@ -460,7 +467,7 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
doctorCheckDiagnosisInput.Items.Add(itemInput); |
|
|
|
} |
|
|
|
} |
|
|
|
doctorCheckDiagnosisInput.Items = doctorCheckDiagnosisInput.Items.OrderBy(o=>o.DisplayOrder).ToList(); |
|
|
|
doctorCheckDiagnosisInput.Items = doctorCheckDiagnosisInput.Items.OrderBy(o => o.DisplayOrder).ToList(); |
|
|
|
|
|
|
|
//处理组合项目诊断函数
|
|
|
|
List<string> diagnosisList = new List<string>(); |
|
|
|
@ -485,7 +492,7 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
//设置组合项目默认小结
|
|
|
|
diagnosisList.Add(doctorCheckDiagnosisInput.Asbitems[0].DefaultResult); |
|
|
|
} |
|
|
|
foreach(var diagnosis in diagnosisList) |
|
|
|
foreach (var diagnosis in diagnosisList) |
|
|
|
{ |
|
|
|
var getDiagnosisResult_Detail = new GetDiagnosisResult_Detail() |
|
|
|
{ |
|
|
|
@ -516,7 +523,7 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
itemDiagnosisType.Diagnosis = itemDiagnosisType.Diagnosis.Where(o=>!string.IsNullOrWhiteSpace(o)).ToList(); |
|
|
|
itemDiagnosisType.Diagnosis = itemDiagnosisType.Diagnosis.Where(o => !string.IsNullOrWhiteSpace(o)).ToList(); |
|
|
|
if (itemDiagnosisType.Diagnosis.Count() > _numArry.Count()) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"诊断数量超过{_numArry.Count()}个,不支持"); |
|
|
|
@ -532,7 +539,7 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
{ |
|
|
|
continue; |
|
|
|
} |
|
|
|
if(itemDiagnosisType.Diagnosis.Count() == 1) |
|
|
|
if (itemDiagnosisType.Diagnosis.Count() == 1) |
|
|
|
{ |
|
|
|
diagnosis = diagnosis + itemDiagnosisType.Diagnosis[i] + ";"; |
|
|
|
} |
|
|
|
@ -547,7 +554,7 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(diagnosis)) |
|
|
|
{ |
|
|
|
if(itemDiagnosis.IsNameIntoSummary == 'Y' && !diagnosis.StartsWith(itemDiagnosis.ItemName)) |
|
|
|
if (itemDiagnosis.IsNameIntoSummary == 'Y' && !diagnosis.StartsWith(itemDiagnosis.ItemName)) |
|
|
|
{ |
|
|
|
diagnosis = itemDiagnosis.ItemName + ":" + diagnosis; |
|
|
|
} |
|
|
|
@ -685,7 +692,7 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
continue; |
|
|
|
} |
|
|
|
//通过参考范围获取诊断
|
|
|
|
if(item.ReferenceRangeTypeFlag == ItemReferenceRangeTypeFlag.Number) |
|
|
|
if (item.ReferenceRangeTypeFlag == ItemReferenceRangeTypeFlag.Number) |
|
|
|
{ |
|
|
|
var referenceRangeDiagnosis = await GetItemDiagnosisByReferenceRanges(doctorCheckDiagnosisInput.SexId, doctorCheckDiagnosisInput.Age, item); |
|
|
|
if (!string.IsNullOrWhiteSpace(referenceRangeDiagnosis)) |
|
|
|
@ -771,11 +778,11 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
string diagnosis = null; |
|
|
|
var pos = referenceRange.ReferenceRangeValue.IndexOf("-"); |
|
|
|
string resultStatusId = _registerCheckItemManager.GetNumberResultStatusId(itemInput.Result, referenceRange.ReferenceRangeValue); |
|
|
|
if(resultStatusId == ResultStatusFlag.Low) |
|
|
|
if (resultStatusId == ResultStatusFlag.Low) |
|
|
|
{ |
|
|
|
diagnosis = await GetNumberDiagnosis(itemInput.ItemName, itemInput.Result, itemInput.Unit, true, referenceRange); |
|
|
|
} |
|
|
|
else if(resultStatusId == ResultStatusFlag.High) |
|
|
|
else if (resultStatusId == ResultStatusFlag.High) |
|
|
|
{ |
|
|
|
diagnosis = await GetNumberDiagnosis(itemInput.ItemName, itemInput.Result, itemInput.Unit, false, referenceRange); |
|
|
|
} |
|
|
|
@ -784,7 +791,7 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private async Task<string> GetNumberDiagnosis(string itemName, string result,string unit, bool isLower, |
|
|
|
private async Task<string> GetNumberDiagnosis(string itemName, string result, string unit, bool isLower, |
|
|
|
ReferenceRange referenceRange) |
|
|
|
{ |
|
|
|
string diagnosis = null; |
|
|
|
@ -846,11 +853,11 @@ namespace Shentun.Peis.DiagnosisFunctions |
|
|
|
{ |
|
|
|
if (_isAddAbnormalResult == "Y") |
|
|
|
{ |
|
|
|
if(string.IsNullOrEmpty(unit)) |
|
|
|
if (string.IsNullOrEmpty(unit)) |
|
|
|
{ |
|
|
|
unit = ""; |
|
|
|
} |
|
|
|
diagnosis = diagnosis + "(结果:" + result + unit + ",参考范围:" + referenceRange.ReferenceRangeValue + ")"; |
|
|
|
diagnosis = diagnosis + $"(结果:{result} {unit},参考范围: {referenceRange.ReferenceRangeValue})"; |
|
|
|
} |
|
|
|
} |
|
|
|
return diagnosis; |
|
|
|
|