annotate OrthancServer/Sources/Database/ResourcesContent.cpp @ 4704:f0038043fb97 openssl-3.x

removed OpenSSL license exception, as OpenSSL 3.0 was relicensed under Apache 2.0
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Jun 2021 07:37:20 +0200
parents 95ffe3b6ef7c
children 2e71a08eea15
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3094
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
4437
d9473bd5ed43 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
3094
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * General Public License for more details.
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #include "../PrecompiledHeadersServer.h"
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include "ResourcesContent.h"
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "Compatibility/ISetResourcesContent.h"
4623
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
26 #include "../ServerToolbox.h"
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
27
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
28 #include "../../../OrthancFramework/Sources/DicomFormat/DicomArray.h"
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
29 #include "../../../OrthancFramework/Sources/OrthancException.h"
3094
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include <cassert>
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 namespace Orthanc
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
4623
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
36 static void StoreMainDicomTagsInternal(ResourcesContent& target,
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
37 int64_t resource,
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
38 const DicomMap& tags)
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
39 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
40 DicomArray flattened(tags);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
41
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
42 for (size_t i = 0; i < flattened.GetSize(); i++)
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
43 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
44 const DicomElement& element = flattened.GetElement(i);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
45 const DicomTag& tag = element.GetTag();
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
46 const DicomValue& value = element.GetValue();
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
47 if (!value.IsNull() &&
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
48 !value.IsBinary())
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
49 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
50 target.AddMainDicomTag(resource, tag, element.GetValue().GetContent());
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
51 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
52 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
53 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
54
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
55
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
56 static void StoreIdentifiers(ResourcesContent& target,
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
57 int64_t resource,
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
58 ResourceType level,
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
59 const DicomMap& map)
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
60 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
61 const DicomTag* tags;
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
62 size_t size;
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
63
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
64 ServerToolbox::LoadIdentifiers(tags, size, level);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
65
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
66 for (size_t i = 0; i < size; i++)
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
67 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
68 // The identifiers tags are a subset of the main DICOM tags
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
69 assert(DicomMap::IsMainDicomTag(tags[i]));
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
70
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
71 const DicomValue* value = map.TestAndGetValue(tags[i]);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
72 if (value != NULL &&
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
73 !value->IsNull() &&
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
74 !value->IsBinary())
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
75 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
76 std::string s = ServerToolbox::NormalizeIdentifier(value->GetContent());
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
77 target.AddIdentifierTag(resource, tags[i], s);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
78 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
79 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
80 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
81
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
82
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
83 void ResourcesContent::AddMetadata(int64_t resourceId,
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
84 MetadataType metadata,
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
85 const std::string& value)
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
86 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
87 if (isNewResource_)
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
88 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
89 metadata_.push_back(Metadata(resourceId, metadata, value));
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
90 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
91 else
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
92 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
93 // This would require to handle the incrementation of revision
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
94 // numbers in the database backend => only allow setting
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
95 // metadata on new resources
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
96 throw OrthancException(ErrorCode_NotImplemented);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
97 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
98 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
99
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
100
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
101 void ResourcesContent::AddResource(int64_t resource,
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
102 ResourceType level,
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
103 const DicomMap& dicomSummary)
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
104 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
105 StoreIdentifiers(*this, resource, level, dicomSummary);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
106
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
107 DicomMap tags;
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
108
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
109 switch (level)
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
110 {
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
111 case ResourceType_Patient:
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
112 dicomSummary.ExtractPatientInformation(tags);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
113 break;
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
114
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
115 case ResourceType_Study:
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
116 // Duplicate the patient tags at the study level (new in Orthanc 0.9.5 - db v6)
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
117 dicomSummary.ExtractPatientInformation(tags);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
118 StoreMainDicomTagsInternal(*this, resource, tags);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
119
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
120 dicomSummary.ExtractStudyInformation(tags);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
121 break;
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
122
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
123 case ResourceType_Series:
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
124 dicomSummary.ExtractSeriesInformation(tags);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
125 break;
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
126
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
127 case ResourceType_Instance:
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
128 dicomSummary.ExtractInstanceInformation(tags);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
129 break;
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
130
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
131 default:
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
132 throw OrthancException(ErrorCode_InternalError);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
133 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
134
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
135 StoreMainDicomTagsInternal(*this, resource, tags);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
136 }
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
137
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
138
3094
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 void ResourcesContent::Store(Compatibility::ISetResourcesContent& compatibility) const
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 {
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 for (std::list<TagValue>::const_iterator
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 it = tags_.begin(); it != tags_.end(); ++it)
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 {
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 if (it->isIdentifier_)
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 {
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 compatibility.SetIdentifierTag(it->resourceId_, it->tag_, it->value_);
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 }
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 else
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 {
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 compatibility.SetMainDicomTag(it->resourceId_, it->tag_, it->value_);
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 }
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 }
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 for (std::list<Metadata>::const_iterator
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 it = metadata_.begin(); it != metadata_.end(); ++it)
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 {
4623
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
157 assert(isNewResource_);
95ffe3b6ef7c handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
158 compatibility.SetMetadata(it->resourceId_, it->metadata_, it->value_, 0 /* initial revision number */);
3094
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 }
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 }
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 }