Mercurial > hg > orthanc
changeset 6500:0c3e38427616
merge
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Tue, 25 Nov 2025 20:46:27 +0100 |
| parents | 8fc86cc3b31c (current diff) 26e24c3ad974 (diff) |
| children | f57e8e7645cb |
| files | |
| diffstat | 2 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Tue Nov 25 20:46:17 2025 +0100 +++ b/NEWS Tue Nov 25 20:46:27 2025 +0100 @@ -68,6 +68,9 @@ while downloading the response. * Fix issue #227: In SQL, string literals must use 'single quotes' https://stackoverflow.com/a/25141338 +* Fix: Avoid adding twice the same tag in DB for the same resource e.g. when you have added TimeZoneOffsetFromUTC + to the ExtraMainDicomTags at Patient level. + https://discourse.orthanc-server.org/t/jobs-api-the-dicommovescu-job-doesnt-seems-to-track-progress/3140/14 * Upgraded dependencies for static builds: - civetweb 1.16, including patch for CVE-2025-55763 - SQLite 3.50.4
--- a/OrthancServer/Sources/Database/ResourcesContent.h Tue Nov 25 20:46:17 2025 +0100 +++ b/OrthancServer/Sources/Database/ResourcesContent.h Tue Nov 25 20:46:27 2025 +0100 @@ -122,6 +122,8 @@ ListTags tags_; ListMetadata metadata_; + std::map<int64_t, std::set<DicomTag> > mainDicomTagsPerResource_; + public: explicit ResourcesContent(bool isNewResource) : isNewResource_(isNewResource) @@ -132,7 +134,18 @@ const DicomTag& tag, const std::string& value) { - tags_.push_back(TagValue(resourceId, false, tag, value)); + // avoid adding twice the same tag for the same resource e.g, when the same tag is registered at study and patient level + // https://discourse.orthanc-server.org/t/jobs-api-the-dicommovescu-job-doesnt-seems-to-track-progress/3140/14 + if (mainDicomTagsPerResource_.find(resourceId) == mainDicomTagsPerResource_.end()) + { + mainDicomTagsPerResource_[resourceId] = std::set<DicomTag>(); + } + + if (mainDicomTagsPerResource_[resourceId].find(tag) == mainDicomTagsPerResource_[resourceId].end()) + { + tags_.push_back(TagValue(resourceId, false, tag, value)); + mainDicomTagsPerResource_[resourceId].insert(tag); + } } void AddIdentifierTag(int64_t resourceId,
