Skip to content

Commit

Permalink
Merge branch 'release/2.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
tznind committed Dec 12, 2019
2 parents cf64f74 + f85234e commit 6c62302
Show file tree
Hide file tree
Showing 13 changed files with 382 additions and 277 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ services:

before_script:
- sudo docker run --name=mssql-server-linux-latest -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=YourStrong!Passw0rd' -p 1433:1433 -d microsoft/mssql-server-linux:2017-latest
- sudo apt install libc6-dev
- sudo apt install libgdiplus

script:
- dotnet build "./Rdmp.Dicom/Rdmp.Dicom.csproj"
- wget https://github.com/HicServices/RDMP/releases/download/v3.2.1/rdmp-cli-linux-x64.zip
- wget https://github.com/HicServices/RDMP/releases/download/v4.0.1/rdmp-cli-linux-x64.zip
- unzip -d rdmp-cli rdmp-cli-linux-x64.zip || true # Ignore exit code since unzip returns 1 for a warning we don't care about
- cd rdmp-cli
- chmod +x rdmp
- ./rdmp install localhost TEST_ -u sa -p 'YourStrong!Passw0rd'
- cd ..
- dotnet build "./Rdmp.Dicom.Tests/Rdmp.Dicom.Tests.csproj"
- dotnet test "./Rdmp.Dicom.Tests/Rdmp.Dicom.Tests.csproj" -v d
- dotnet test "./Rdmp.Dicom.Tests/Rdmp.Dicom.Tests.csproj" -v d
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

...

## [2.0.5] 2019-12-12

### Added

- Added better logging of error(s) in `FoDicomAnonymiser` (now includes file path of image failing)

### Changed

- DicomSource now expresses relative paths (where possible) with the `./` prefix e.g. `./subdir/1.dcm` (previously `subdir/1.dcm`)

### Fixed

- Fixed relative path expression bug when loading an explicit file list (of dicoms). Bug caused file path to be expressed as filename only (i.e. no path)
- Fixed DicomSource not expressing subdirectories of zip files (meaning it previously only worked when everything was in the root of the zip file).

## [2.0.4] 2019-12-04

### Changed
Expand Down Expand Up @@ -87,7 +102,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial commit from private repo

[Unreleased]: https://github.com/HicServices/RdmpDicom/compare/v2.0.4...develop
[Unreleased]: https://github.com/HicServices/RdmpDicom/compare/v2.0.5...develop
[2.0.5]: https://github.com/HicServices/RdmpDicom/compare/v2.0.4...v2.0.5
[2.0.4]: https://github.com/HicServices/RdmpDicom/compare/v2.0.3...v2.0.4
[2.0.3]: https://github.com/HicServices/RdmpDicom/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/HicServices/RdmpDicom/compare/v2.0.1...v2.0.2
Expand Down
31 changes: 22 additions & 9 deletions Rdmp.Dicom.Tests/Integration/FoDicomAnonymiserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,20 @@ public void TestAnonymisingDataset(Type putterType)
var eds = new ExternalDatabaseServer(CatalogueRepository, "eds", patcher);
eds.SetProperties(uidMapDb);

Dictionary<DicomTag,string> thingThatShouldDisapear = new Dictionary<DicomTag, string>()
Dictionary<DicomTag,string> thingThatShouldDisappear = new Dictionary<DicomTag, string>()
{
//Things we would want to disapear
//Things we would want to disappear
{DicomTag.PatientName,"Moscow"},
{DicomTag.PatientBirthDate,"2001-01-01"},
{DicomTag.StudyDescription,"Frank has lots of problems this study identifies those, he lives at 60 Pancake road"},
{DicomTag.StudyDescription,"Frank has lots of problems, he lives at 60 Pancake road"},
{DicomTag.SeriesDescription,"Coconuts"},
{DicomTag.SmokingStatus,"Dave loves to smoke fine cigars"},
{DicomTag.StudyDate,"2002-01-01"},
};

Dictionary<DicomTag,string> thingsThatShouldRemain = new Dictionary<DicomTag, string>()
{
//Things we would want to remain
{DicomTag.SmokingStatus,"CIGARS"},
};

var dicom = new DicomDataset()
Expand All @@ -84,10 +90,12 @@ public void TestAnonymisingDataset(Type putterType)
{DicomTag.SeriesInstanceUID, "123.4.5"},
{DicomTag.StudyInstanceUID, "123.4.6"},
{DicomTag.SOPClassUID,"1"},
{DicomTag.StudyDate,"2002-01-01"},
};

foreach (var kvp in thingThatShouldDisapear)
foreach (var kvp in thingThatShouldDisappear)
dicom.AddOrUpdate(kvp.Key, kvp.Value);

foreach (var kvp in thingsThatShouldRemain)
dicom.AddOrUpdate(kvp.Key, kvp.Value);

var fi = new FileInfo(Path.Combine(TestContext.CurrentContext.WorkDirectory, "madness.dcm"));
Expand Down Expand Up @@ -152,9 +160,8 @@ public void TestAnonymisingDataset(Type putterType)

Assert.AreEqual(anoDt.Rows[0]["StudyInstanceUID"], anoDicom.Dataset.GetValue<string>(DicomTag.StudyInstanceUID, 0));

Assert.AreEqual(df.Dataset.GetValue<string>(DicomTag.StudyDate, 0), anoDicom.Dataset.GetValue<string>(DicomTag.StudyDate, 0));

foreach (KeyValuePair<DicomTag, string> kvp in thingThatShouldDisapear)
foreach (KeyValuePair<DicomTag, string> kvp in thingThatShouldDisappear)
{
//if it chopped out the entire tag
if(!anoDicom.Dataset.Contains(kvp.Key))
Expand All @@ -166,13 +173,19 @@ public void TestAnonymisingDataset(Type putterType)
var value = anoDicom.Dataset.GetSingleValue<string>(kvp.Key);
switch (value)
{
//allowed values
//allowed values
case "ANONYMOUS":continue;

//anonymous date
case "00010101":continue;

default: Assert.Fail("Unexpected value for " + kvp.Key + ":" + value);
break;
}
}

foreach (KeyValuePair<DicomTag, string> kvp in thingsThatShouldRemain)
Assert.AreEqual(kvp.Value, anoDicom.Dataset.GetValue<string>(kvp.Key, 0));
}

// The following commented tests will fail due to underlying system limits on paths
Expand Down
1 change: 1 addition & 0 deletions Rdmp.Dicom.Tests/Rdmp.Dicom.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<ProjectReference Include="..\Rdmp.Dicom\Rdmp.Dicom.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HIC.BadMedicine.Dicom" Version="0.0.4" />
<PackageReference Include="HIC.RDMP.Plugin.Test" Version="4.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
Expand Down

This file was deleted.

Loading

0 comments on commit 6c62302

Please sign in to comment.