Should be a straightforward change, but probably requires the report classes to handle concurrent writes if they don't already.
|
public override int Run() |
|
{ |
|
_logger.Info($"Recursing from Directory: {_opts.Directory}"); |
|
|
|
if (!FileSystem.Directory.Exists(_opts.Directory)) |
|
{ |
|
_logger.Info($"Cannot Find directory: {_opts.Directory}"); |
|
throw new ArgumentException($"Cannot Find directory: {_opts.Directory}"); |
|
} |
|
|
|
ProcessDirectory(_opts.Directory); |
|
|
|
CloseReports(); |
|
|
|
return errors; |
|
} |
|
|
|
private void ProcessDirectory(string root) |
|
{ |
|
//deal with files first |
|
foreach (var file in FileSystem.Directory.GetFiles(root, _opts.Pattern)) |
|
{ |
|
try |
|
{ |
|
ValidateDicomFile(FileSystem.FileInfo.New(file)); |
|
} |
|
catch (Exception ex) |
|
{ |
|
if (ThrowOnError) |
|
{ |
|
throw; |
|
} |
|
else |
|
{ |
|
_logger.Error(ex, $"Failed to validate {file}"); |
|
errors++; |
|
} |
|
|
|
} |
|
} |
Should be a straightforward change, but probably requires the report classes to handle concurrent writes if they don't already.
IsIdentifiable/IsIdentifiable/Runners/DicomFileRunner.cs
Lines 134 to 173 in f03bc23