comparison OrthancServer/Sources/ServerIndex.cpp @ 4514:5b929e6b3c36

removal of "dicom-as-json" attachments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 16 Feb 2021 12:18:41 +0100
parents b4c58795f3a8
children 350a22c094f2
comparison
equal deleted inserted replaced
4513:1f455b86b054 4514:5b929e6b3c36
973 SetInstanceMetadata(content, instanceMetadata, instanceId, 973 SetInstanceMetadata(content, instanceMetadata, instanceId,
974 MetadataType_Instance_HttpUsername, s); 974 MetadataType_Instance_HttpUsername, s);
975 } 975 }
976 } 976 }
977 977
978 // New in Orthanc 1.9.1 978 if (hasPixelDataOffset)
979 SetInstanceMetadata(content, instanceMetadata, instanceId, 979 {
980 MetadataType_Instance_PixelDataOffset, 980 // New in Orthanc 1.9.1
981 (hasPixelDataOffset ? 981 SetInstanceMetadata(content, instanceMetadata, instanceId,
982 boost::lexical_cast<std::string>(pixelDataOffset) : "")); 982 MetadataType_Instance_PixelDataOffset,
983 boost::lexical_cast<std::string>(pixelDataOffset));
984 }
983 985
984 const DicomValue* value; 986 const DicomValue* value;
985 if ((value = dicomSummary.TestAndGetValue(DICOM_TAG_SOP_CLASS_UID)) != NULL && 987 if ((value = dicomSummary.TestAndGetValue(DICOM_TAG_SOP_CLASS_UID)) != NULL &&
986 !value->IsNull() && 988 !value->IsNull() &&
987 !value->IsBinary()) 989 !value->IsBinary())
1898 1900
1899 return db_.GetAllMetadata(target, id); 1901 return db_.GetAllMetadata(target, id);
1900 } 1902 }
1901 1903
1902 1904
1903 void ServerIndex::ListAvailableAttachments(std::list<FileContentType>& target, 1905 void ServerIndex::ListAvailableAttachments(std::set<FileContentType>& target,
1904 const std::string& publicId, 1906 const std::string& publicId,
1905 ResourceType expectedType) 1907 ResourceType expectedType)
1906 { 1908 {
1907 boost::mutex::scoped_lock lock(mutex_); 1909 boost::mutex::scoped_lock lock(mutex_);
1908 1910
2028 int64_t resource = toExplore.top(); 2030 int64_t resource = toExplore.top();
2029 toExplore.pop(); 2031 toExplore.pop();
2030 2032
2031 ResourceType thisType = db_.GetResourceType(resource); 2033 ResourceType thisType = db_.GetResourceType(resource);
2032 2034
2033 std::list<FileContentType> f; 2035 std::set<FileContentType> f;
2034 db_.ListAvailableAttachments(f, resource); 2036 db_.ListAvailableAttachments(f, resource);
2035 2037
2036 for (std::list<FileContentType>::const_iterator 2038 for (std::set<FileContentType>::const_iterator
2037 it = f.begin(); it != f.end(); ++it) 2039 it = f.begin(); it != f.end(); ++it)
2038 { 2040 {
2039 FileInfo attachment; 2041 FileInfo attachment;
2040 if (db_.LookupAttachment(attachment, resource, *it)) 2042 if (db_.LookupAttachment(attachment, resource, *it))
2041 { 2043 {