# HG changeset patch # User Alain Mazy # Date 1725374251 -7200 # Node ID 717acb0ea546a0edb8a30fbfcb648c02fed6ac4d # Parent 5d78e5cafabc9bab0ce0945fcc31808abe16ec33 fix DICOMWeb integration tests diff -r 5d78e5cafabc -r 717acb0ea546 NEWS --- a/NEWS Tue Sep 03 11:09:49 2024 +0200 +++ b/NEWS Tue Sep 03 16:37:31 2024 +0200 @@ -2,7 +2,8 @@ =============================== * TODO-FIND: complete the list of updated routes: - /studies?expand and sibbling routes now also return "Metadata" (if the DB implements 'extended-api-v1') + - /studies?expand and sibbling routes now also return "Metadata" (if the DB implements 'extended-api-v1') + - /studies?since=x&limit=0 and sibbling routes: limit=0 now means "no-limit" instead of "no-results" REST API -------- diff -r 5d78e5cafabc -r 717acb0ea546 OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp --- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Tue Sep 03 11:09:49 2024 +0200 +++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Tue Sep 03 16:37:31 2024 +0200 @@ -545,7 +545,7 @@ // need resource labels ? if (request.IsRetrieveLabels()) { - sql = "SELECT id, label " + sql = "SELECT Lookup.internalId, label " "FROM Labels " "INNER JOIN Lookup ON Labels.id = Lookup.internalId"; @@ -648,7 +648,7 @@ // need children identifiers ? if (requestLevel <= ResourceType_Series && request.GetChildrenSpecification(static_cast(requestLevel + 1)).IsRetrieveIdentifiers()) { - sql = "SELECT currentLevel.internalId, childLevel.publicId " + sql = "SELECT Lookup.internalId, childLevel.publicId " "FROM Resources AS currentLevel " "INNER JOIN Lookup ON currentLevel.internalId = Lookup.internalId " "INNER JOIN Resources childLevel ON currentLevel.internalId = childLevel.parentId "; @@ -664,7 +664,7 @@ // need grandchildren identifiers ? if (requestLevel <= ResourceType_Study && request.GetChildrenSpecification(static_cast(requestLevel + 2)).IsRetrieveIdentifiers()) { - sql = "SELECT currentLevel.internalId, grandChildLevel.publicId " + sql = "SELECT Lookup.internalId, grandChildLevel.publicId " "FROM Resources AS currentLevel " "INNER JOIN Lookup ON currentLevel.internalId = Lookup.internalId " "INNER JOIN Resources childLevel ON currentLevel.internalId = childLevel.parentId " @@ -681,7 +681,7 @@ // need resource attachments ? if (request.IsRetrieveAttachments()) { - sql = "SELECT id, fileType, uuid, uncompressedSize, compressedSize, compressionType, uncompressedMD5, compressedMD5 " + sql = "SELECT Lookup.internalId, fileType, uuid, uncompressedSize, compressedSize, compressionType, uncompressedMD5, compressedMD5 " "FROM AttachedFiles " "INNER JOIN Lookup ON AttachedFiles.id = Lookup.internalId"; diff -r 5d78e5cafabc -r 717acb0ea546 OrthancServer/Sources/ResourceFinder.cpp --- a/OrthancServer/Sources/ResourceFinder.cpp Tue Sep 03 11:09:49 2024 +0200 +++ b/OrthancServer/Sources/ResourceFinder.cpp Tue Sep 03 16:37:31 2024 +0200 @@ -758,7 +758,14 @@ { requestedComputedTags_.insert(tag); hasRequestedTags_ = true; - request_.GetChildrenSpecification(ResourceType_Series).AddMainDicomTag(DICOM_TAG_MODALITY); + if (request_.GetLevel() < ResourceType_Series) + { + request_.GetChildrenSpecification(ResourceType_Series).AddMainDicomTag(DICOM_TAG_MODALITY); + } + else if (request_.GetLevel() == ResourceType_Instance) // this happens in QIDO-RS when searching for instances without specifying a StudyInstanceUID -> all Study level tags must be included in the response + { + request_.GetParentSpecification(ResourceType_Series).SetRetrieveMainDicomTags(true); + } } else if (tag == DICOM_TAG_INSTANCE_AVAILABILITY) { diff -r 5d78e5cafabc -r 717acb0ea546 OrthancServer/Sources/Search/ISqlLookupFormatter.cpp --- a/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Tue Sep 03 11:09:49 2024 +0200 +++ b/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Tue Sep 03 16:37:31 2024 +0200 @@ -752,8 +752,14 @@ if (request.HasLimits()) { - sql += " LIMIT " + boost::lexical_cast(request.GetLimitsCount()); - sql += " OFFSET " + boost::lexical_cast(request.GetLimitsSince()); + if (request.GetLimitsCount() > 0) + { + sql += " LIMIT " + boost::lexical_cast(request.GetLimitsCount()); + } + if (request.GetLimitsSince() > 0) + { + sql += " OFFSET " + boost::lexical_cast(request.GetLimitsSince()); + } } }