Mercurial > hg > orthanc
comparison OrthancServer/ServerToolbox.cpp @ 3094:61da3c9b4121 db-changes
cont reorganization
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 05 Jan 2019 17:52:24 +0100 |
parents | 2e1808b6146a |
children | 9c71abbff70f |
comparison
equal
deleted
inserted
replaced
3093:2e1808b6146a | 3094:61da3c9b4121 |
---|---|
74 { | 74 { |
75 DICOM_TAG_SOP_INSTANCE_UID | 75 DICOM_TAG_SOP_INSTANCE_UID |
76 }; | 76 }; |
77 | 77 |
78 | 78 |
79 void ResourcesContent::Store(Compatibility::ISetResourcesContent& compatibility) const | |
80 { | |
81 for (std::list<TagValue>::const_iterator | |
82 it = tags_.begin(); it != tags_.end(); ++it) | |
83 { | |
84 if (it->isIdentifier_) | |
85 { | |
86 compatibility.SetIdentifierTag(it->resourceId_, it->tag_, it->value_); | |
87 } | |
88 else | |
89 { | |
90 compatibility.SetMainDicomTag(it->resourceId_, it->tag_, it->value_); | |
91 } | |
92 } | |
93 | |
94 for (std::list<Metadata>::const_iterator | |
95 it = metadata_.begin(); it != metadata_.end(); ++it) | |
96 { | |
97 compatibility.SetMetadata(it->resourceId_, it->metadata_, it->value_); | |
98 } | |
99 } | |
100 | |
101 | |
102 void ResourcesContent::EncodeForPlugins( | |
103 std::vector<OrthancPluginResourcesContentTags>& identifierTags, | |
104 std::vector<OrthancPluginResourcesContentTags>& mainDicomTags, | |
105 std::vector<OrthancPluginResourcesContentMetadata>& metadata) const | |
106 { | |
107 identifierTags.reserve(tags_.size()); | |
108 mainDicomTags.reserve(tags_.size()); | |
109 metadata.reserve(metadata_.size()); | |
110 | |
111 for (std::list<TagValue>::const_iterator | |
112 it = tags_.begin(); it != tags_.end(); ++it) | |
113 { | |
114 OrthancPluginResourcesContentTags tmp; | |
115 tmp.resource = it->resourceId_; | |
116 tmp.group = it->tag_.GetGroup(); | |
117 tmp.element = it->tag_.GetElement(); | |
118 tmp.value = it->value_.c_str(); | |
119 | |
120 if (it->isIdentifier_) | |
121 { | |
122 identifierTags.push_back(tmp); | |
123 } | |
124 else | |
125 { | |
126 mainDicomTags.push_back(tmp); | |
127 } | |
128 } | |
129 | |
130 for (std::list<Metadata>::const_iterator | |
131 it = metadata_.begin(); it != metadata_.end(); ++it) | |
132 { | |
133 OrthancPluginResourcesContentMetadata tmp; | |
134 tmp.resource = it->resourceId_; | |
135 tmp.metadata = it->metadata_; | |
136 tmp.value = it->value_.c_str(); | |
137 metadata.push_back(tmp); | |
138 } | |
139 | |
140 assert(identifierTags.size() + mainDicomTags.size() == tags_.size() && | |
141 metadata.size() == metadata_.size()); | |
142 } | |
143 | |
144 | |
145 static void StoreMainDicomTagsInternal(ResourcesContent& target, | 79 static void StoreMainDicomTagsInternal(ResourcesContent& target, |
146 int64_t resource, | 80 int64_t resource, |
147 const DicomMap& tags) | 81 const DicomMap& tags) |
148 { | 82 { |
149 DicomArray flattened(tags); | 83 DicomArray flattened(tags); |