diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs index 61075de67..6b910e772 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs @@ -1,4 +1,5 @@ -using IRaCIS.Core.Application.Helper; +using Amazon.Runtime.Internal.Transform; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; @@ -9,6 +10,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Microsoft.Identity.Client; using MiniExcelLibs; using MiniSoftware; using SixLabors.ImageSharp; @@ -507,7 +509,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public Dictionary StringEmptyTurnedLine(Dictionary myDictionary) { - List notTurnedKeyList = new List() { "ImageOneUrl", "ImageOneMark", "ImageTwoUrl", "ImageTwoMark" }; + + + + Dictionary notTurnedKeyList = new Dictionary() + { + + {"ImageOneUrl",_localizer["CriterionCalculateExport_None"] }, + {"ImageOneMark",string.Empty }, + {"ImageTwoUrl",string.Empty }, + {"ImageTwoMark",string.Empty } + }; foreach (var item in myDictionary) { @@ -531,26 +543,35 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { foreach (var item2 in column) { - if ((item2.Value.ToString() == string.Empty || item.Value == null)&& !notTurnedKeyList.Contains(item2.Key)) + + if (item2.Value.ToString() == string.Empty || item.Value == null) { - bool isOrgan = false; - try + if (notTurnedKeyList.ContainsKey(item2.Key)) { - if (item2.Key == "Organ" && (column["RowMark"] == string.Empty || column["RowMark"] == "-")) + column[item2.Key] = notTurnedKeyList[item.Key]; + } + else + { + bool isOrgan = false; + try { - column[item2.Key] = string.Empty; - isOrgan = true; + if (item2.Key == "Organ" && (column["RowMark"] == string.Empty || column["RowMark"] == "-")) + { + column[item2.Key] = string.Empty; + isOrgan = true; + } + } + catch (Exception) + { + column[item2.Key] = "-"; + + } + if (!isOrgan) + { + column[item2.Key] = "-"; } } - catch (Exception) - { - column[item2.Key] = "-"; - - } - if (!isOrgan) - { - column[item2.Key] = "-"; - } + }; } @@ -1063,6 +1084,18 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } } + if (lesionImage.Count == 0) + { + lesionImage.Add(new Dictionary() + { + { "ImageOneMark",string.Empty}, + { "ImageOneUrl" ,string.Empty}, + { "ImageTwoMark",string.Empty }, + { "ImageTwoUrl",string.Empty}, + + }); + } + return lesionImage; }