# HG changeset patch # User Sebastien Jodogne # Date 1554464173 -7200 # Node ID 63f59ad9381a689eb7ec422008e4767a10f32ee6 # Parent 8f44dadcdbc1a86446b87a8bcdfbceb0af008174 Fix issue #136 (C-Find request fails when found DICOM file does not have certain tags) diff -r 8f44dadcdbc1 -r 63f59ad9381a Core/DicomNetworking/DicomUserConnection.cpp --- a/Core/DicomNetworking/DicomUserConnection.cpp Fri Apr 05 13:02:57 2019 +0200 +++ b/Core/DicomNetworking/DicomUserConnection.cpp Fri Apr 05 13:36:13 2019 +0200 @@ -590,11 +590,11 @@ } } - return new ParsedDicomFile(*fix); + return new ParsedDicomFile(*fix, GetDefaultDicomEncoding(), false /* be strict */); } default: - return new ParsedDicomFile(fields); + return new ParsedDicomFile(fields, GetDefaultDicomEncoding(), false /* be strict */); } } diff -r 8f44dadcdbc1 -r 63f59ad9381a Core/DicomParsing/ParsedDicomFile.cpp --- a/Core/DicomParsing/ParsedDicomFile.cpp Fri Apr 05 13:02:57 2019 +0200 +++ b/Core/DicomParsing/ParsedDicomFile.cpp Fri Apr 05 13:36:13 2019 +0200 @@ -1024,13 +1024,6 @@ } - ParsedDicomFile::ParsedDicomFile(const DicomMap& map) : - pimpl_(new PImpl) - { - CreateFromDicomMap(map, GetDefaultDicomEncoding(), false /* be strict by default */); - } - - ParsedDicomFile::ParsedDicomFile(const void* content, size_t size) : pimpl_(new PImpl) { diff -r 8f44dadcdbc1 -r 63f59ad9381a Core/DicomParsing/ParsedDicomFile.h --- a/Core/DicomParsing/ParsedDicomFile.h Fri Apr 05 13:02:57 2019 +0200 +++ b/Core/DicomParsing/ParsedDicomFile.h Fri Apr 05 13:36:13 2019 +0200 @@ -101,8 +101,6 @@ Encoding defaultEncoding, bool permissive); - ParsedDicomFile(const DicomMap& map); - ParsedDicomFile(const void* content, size_t size); diff -r 8f44dadcdbc1 -r 63f59ad9381a NEWS --- a/NEWS Fri Apr 05 13:02:57 2019 +0200 +++ b/NEWS Fri Apr 05 13:36:13 2019 +0200 @@ -2,6 +2,7 @@ =============================== * Size of the Orthanc static binaries are reduced by compressing ICU data +* Fix issue #136 (C-Find request fails when found DICOM file does not have certain tags) * Fix issue #138 (POST to modalities/{name} accepts invalid characters) diff -r 8f44dadcdbc1 -r 63f59ad9381a OrthancServer/DicomInstanceToStore.cpp --- a/OrthancServer/DicomInstanceToStore.cpp Fri Apr 05 13:02:57 2019 +0200 +++ b/OrthancServer/DicomInstanceToStore.cpp Fri Apr 05 13:36:13 2019 +0200 @@ -179,7 +179,9 @@ } else { - parsed_.TakeOwnership(new ParsedDicomFile(summary_.GetConstContent())); + parsed_.TakeOwnership(new ParsedDicomFile(summary_.GetConstContent(), + GetDefaultDicomEncoding(), + false /* be strict */)); } } diff -r 8f44dadcdbc1 -r 63f59ad9381a OrthancServer/OrthancFindRequestHandler.cpp --- a/OrthancServer/OrthancFindRequestHandler.cpp Fri Apr 05 13:02:57 2019 +0200 +++ b/OrthancServer/OrthancFindRequestHandler.cpp Fri Apr 05 13:36:13 2019 +0200 @@ -371,7 +371,7 @@ } else { - ParsedDicomFile dicom(result); + ParsedDicomFile dicom(result, GetDefaultDicomEncoding(), true /* be permissive, cf. issue #136 */); for (std::list::const_iterator tag = sequencesToReturn.begin(); tag != sequencesToReturn.end(); ++tag) diff -r 8f44dadcdbc1 -r 63f59ad9381a UnitTestsSources/FromDcmtkTests.cpp --- a/UnitTestsSources/FromDcmtkTests.cpp Fri Apr 05 13:02:57 2019 +0200 +++ b/UnitTestsSources/FromDcmtkTests.cpp Fri Apr 05 13:36:13 2019 +0200 @@ -1119,7 +1119,7 @@ { DicomMap m; - ParsedDicomFile dicom(m); + ParsedDicomFile dicom(m, GetDefaultDicomEncoding(), false); ASSERT_EQ(1u, dicom.GetDcmtkObject().getDataset()->card()); CheckEncoding(dicom, Encoding_Ascii); } @@ -1134,7 +1134,7 @@ { DicomMap m; m.SetValue(DICOM_TAG_SPECIFIC_CHARACTER_SET, "ISO_IR 148", false); - ParsedDicomFile dicom(m); + ParsedDicomFile dicom(m, GetDefaultDicomEncoding(), false); ASSERT_EQ(1u, dicom.GetDcmtkObject().getDataset()->card()); CheckEncoding(dicom, Encoding_Latin5); }