Skip to content

Commit

Permalink
Merge branch 'release/1.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
tznind committed Mar 6, 2020
2 parents cafccbc + 27e26b7 commit 3a6adf9
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 26 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

...

## [1.5.1] - 2020-03-06

- Improved usability of IsIdentifiableReviewer

## [1.5.0] - 2020-03-05
Expand Down Expand Up @@ -200,7 +204,8 @@ First stable release after importing the repository from the private [SMIPlugin]
- Anonymous `MappingTableName` must now be fully specified to pass validation (e.g. `mydb.mytbl`). Previously skipping database portion was supported.


[Unreleased]: https://github.com/SMI/SmiServices/compare/v1.5.0...develop
[Unreleased]: https://github.com/SMI/SmiServices/compare/v1.5.1...develop
[1.5.1]: https://github.com/SMI/SmiServices/compare/v1.5.0...v1.5.1
[1.5.0]: https://github.com/SMI/SmiServices/compare/v1.4.5...v1.5.0
[1.4.5]: https://github.com/SMI/SmiServices/compare/v1.4.4...v1.4.5
[1.4.4]: https://github.com/SMI/SmiServices/compare/v1.4.3...v1.4.4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![GitHub](https://img.shields.io/github/license/SMI/SmiServices)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/SMI/SmiServices.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/SMI/SmiServices/alerts/)

Version: `1.5.0`
Version: `1.5.1`

# SMI Services

Expand Down
6 changes: 3 additions & 3 deletions src/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
[assembly: AssemblyCulture("")]

// These should be overwritten by release builds
[assembly: AssemblyVersion("1.5.0")]
[assembly: AssemblyFileVersion("1.5.0")]
[assembly: AssemblyInformationalVersion("1.5.0")] // This one can have the extra build info after it
[assembly: AssemblyVersion("1.5.1")]
[assembly: AssemblyFileVersion("1.5.1")]
[assembly: AssemblyInformationalVersion("1.5.1")] // This one can have the extra build info after it
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public DicomDirectoryProcessorHost(GlobalOptions globals, DicomDirectoryProcesso

if (!cliOptions.DirectoryFormat.ToLower().Equals("list"))
{
Logger.Info("This indicates that the list mode is not being recognised");

// TODO(rkm 2020-02-12) I think we want to check this regardless of the mode
// (bp 2020-02-13) By not doing this check on list means that the list of paths is not required to be in PACS and can be imported from anywhere
if (!Directory.Exists(globals.FileSystemOptions.FileSystemRoot))
Expand All @@ -44,7 +42,6 @@ public DicomDirectoryProcessorHost(GlobalOptions globals, DicomDirectoryProcesso
}
else
{
Logger.Info("This indicates that the list mode is being recognised");
if (!File.Exists(cliOptions.ToProcessDir.FullName))
throw new ArgumentException("Could not find accession directory list file (" + cliOptions.ToProcessDir.FullName + ")");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Applications.DicomDirectoryProcessor.Execution.DirectoryFinders
public class AccessionDirectoryLister : DicomDirectoryFinder
{
// Regex that matches when we are at the yyyy\mm\dd\xxxxx directory level
private readonly Regex _accDirectoryRegex = new Regex(@"(20\d{2}[\\\/]\d{2}[\\\/]\d{2})[\\\/]\w+[^.]*?$");
private readonly Regex _accDirectoryRegex = new Regex(@"(20\d{2}[\\\/]\d{2}[\\\/]\d{2}[\\\/][a-zA-Z0-9._-]+[\\\/]$)");

public AccessionDirectoryLister(string fileSystemRoot, IFileSystem fileSystem, string dicomSearchPattern, IProducerModel directoriesProducerModel)
: base(fileSystemRoot, fileSystem, dicomSearchPattern, directoriesProducerModel) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class PacsDirectoryFinder : DicomDirectoryFinder
// Regex that matches when we are at the yyyy\mm\dd\ directory level
private readonly Regex _dayDirectoryRegex = new Regex(@"(20\d{2}[\\\/]\d{2}[\\\/]\d{2})([\\\/]|$)");
// Regex that matches when we are at the yyyy\mm\dd\xxxxx directory level
private readonly Regex _accDirectoryRegex = new Regex(@"(20\d{2}[\\\/]\d{2}[\\\/]\d{2})[\\\/]\w+[\\\/]?$");
private readonly Regex _accDirectoryRegex = new Regex(@"(20\d{2}[\\\/]\d{2}[\\\/]\d{2}[\\\/][a-zA-Z0-9._-]+[\\\/]$)");


public PacsDirectoryFinder(string fileSystemRoot, IFileSystem fileSystem, string dicomSearchPattern, IProducerModel directoriesProducerModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ public void OneTimeSetUp()
TestLogger.Setup();
}

// TODO(rkm 2020-02-12) Things to test
// - Valid CSV file
// - CSVs with various invalid data / lines
private String GetListContent()
{
StringBuilder accessionList = new StringBuilder();

accessionList.AppendLine("/PACS/2018/01/01/AAA,"); // exists and has dicom files - pass
accessionList.AppendLine("/PACS/2018/01/01/AAA,"); // exists and has dicom files - fail (requires indication that is dir)
accessionList.AppendLine("/PACS/2018/01/01/AAA/,"); // exists and has dicom files - pass
accessionList.AppendLine("/PACS/2018/01/01/BBB,"); // does exist but has no dicom files - fail
accessionList.AppendLine("/PACS/2018/01/01/E-123/,"); // exists and has dicom files - pass
accessionList.AppendLine("/PACS/2018/01/01/01.01.2018/,"); // exists and has dicom files - pass
accessionList.AppendLine("/PACS/2018/01/01/BBB/,"); // does exist but has no dicom files - fail
accessionList.AppendLine("/PACS/2018/01/01/CCC/,"); // does not exist - fail
accessionList.AppendLine("/PACS/2018/01/01/,"); // not pointing to accession directory - fail
accessionList.AppendLine("/PACS/2018/01/01/testDicom.dcm,"); // not pointing to accession directory - fail
Expand All @@ -55,7 +54,13 @@ public void TestAccessionDirectoryLister()

string testDicom = Path.GetFullPath(Path.Combine(rootDir, "2018/01/01/AAA/test.dcm"));
mockFilesystem.AddFile(testDicom, MockFileData.NullObject);

string specialCase1 = Path.GetFullPath(Path.Combine(rootDir, "2018/01/01/E-123/test.dcm"));
mockFilesystem.AddFile(specialCase1, MockFileData.NullObject);

string specialCase2 = Path.GetFullPath(Path.Combine(rootDir, "2018/01/01/01.01.2018/test.dcm"));
mockFilesystem.AddFile(specialCase2, MockFileData.NullObject);

string testBad = Path.GetFullPath(Path.Combine(rootDir, "2018/01/01/BBB/test.txt"));
mockFilesystem.AddFile(testBad, MockFileData.NullObject);

Expand All @@ -78,7 +83,7 @@ public void TestAccessionDirectoryLister()

accessionLister.SearchForDicomDirectories(accessionList);

Assert.AreEqual(totalSent, 2);
Assert.AreEqual(totalSent, 3);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,40 @@ public void OneTimeSetUp()
public void TestRegexMatches()
{
string rootDir = Path.GetFullPath("/PACS");
string testFile = Path.GetFullPath(Path.Combine(rootDir, "2018/01/01/AAA/testDicom.dcm"));
var mockFs = new MockFileSystem();

string testFile = Path.GetFullPath(Path.Combine(rootDir, "2018/01/01/AAA/testDicom.dcm"));
mockFs.AddFile(testFile, MockFileData.NullObject);

// Test case, expected messages
string specialCase1 = Path.GetFullPath(Path.Combine(rootDir, "2016/01/01/E-12345/testDicom.dcm"));
mockFs.AddFile(specialCase1, MockFileData.NullObject);

string specialCase2 = Path.GetFullPath(Path.Combine(rootDir, "2017/01/01/01.01.2017/testDicom.dcm"));
mockFs.AddFile(specialCase2, MockFileData.NullObject);

string multiLayer1 = Path.GetFullPath(Path.Combine(rootDir, "2015/01/01/E-12345/testDicom.dcm"));
mockFs.AddFile(multiLayer1, MockFileData.NullObject);

string multiLayer2 = Path.GetFullPath(Path.Combine(rootDir, "2015/01/01/AAA/testDicom.dcm"));
mockFs.AddFile(multiLayer2, MockFileData.NullObject);

string multiLayer3 = Path.GetFullPath(Path.Combine(rootDir, "2015/01/01/BBB/testDicom.dcm"));
mockFs.AddFile(multiLayer3, MockFileData.NullObject);

// Test case, expected messages
var testCases = new Dictionary<string, int>
{
{ "2018", 1 },
{ "2018/", 1 },
{ "2018/01", 1 },
{ "2018/01/", 1 },
{ "2018/01/01", 1 },
{ "2018/01/01/", 1 },
{ "2018/01/01/AAA", 1 },
{ "2018/01/01/AAA/", 1 }
{ "2018", 1 },
{ "2018/", 1 },
{ "2018/01", 1 },
{ "2018/01/", 1 },
{ "2018/01/01", 1 },
{ "2018/01/01/", 1 },
{ "2015/01/01/", 3 },
{ "2018/01/01/AAA", 0 },
{ "2018/01/01/AAA/", 1 },
{ "2016/01/01/E-12345/", 1 },
{ "2017/01/01/01.01.2017/", 1 }
};

var totalSent = 0;
Expand Down

0 comments on commit 3a6adf9

Please sign in to comment.