Skip to content

Commit

Permalink
Merge pull request #829 from Project-MONAI/AC-2259
Browse files Browse the repository at this point in the history
fix for silly mistake
  • Loading branch information
neildsouth authored Jun 5, 2023
2 parents 2045f5e + 52a423e commit 83392de
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/TaskManager/Plug-ins/Email/EmailPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,33 @@ private async Task<Dictionary<string, List<string>>> AddRawMetaFromFile(Dictiona

foreach (var item in _includeMetadata)
{
var values = new List<string>();
if (metadata.ContainsKey(item)) values = metadata[item];

DicomTag tag;
DicomTag? tag = null;
try
{
tag = DicomDictionary.Default[item];
}
catch (Exception)
{
tag = DicomTag.Parse(item);
try
{
tag = DicomTag.Parse(item);
}
catch (Exception)
{
//empty on purpose
}
}
if (tag is not null)
{
values.Add(dcmFile.Dataset.GetString(tag).Trim());
metadata.Add(item, values);
var value = dcmFile.Dataset.GetString(tag).Trim();
if (metadata.ContainsKey(item))
{
metadata[item].Add(value);
}
else
{
metadata.Add(item, new List<string> { value });
}
}
}
}
Expand Down

0 comments on commit 83392de

Please sign in to comment.