Mercurial > hg > orthanc
diff OrthancServer/ServerContext.cpp @ 1067:ace99e272203
access metadata in plugins
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 28 Jul 2014 11:09:03 +0200 |
parents | bb82e5e818e9 |
children | 790ff7a5b3bf |
line wrap: on
line diff
--- a/OrthancServer/ServerContext.cpp Fri Jul 25 18:39:02 2014 +0200 +++ b/OrthancServer/ServerContext.cpp Mon Jul 28 11:09:03 2014 +0200 @@ -306,10 +306,20 @@ attachments.push_back(dicomInfo); attachments.push_back(jsonInfo); - std::map<MetadataType, std::string> instanceMetadata; + typedef std::map<MetadataType, std::string> InstanceMetadata; + InstanceMetadata instanceMetadata; StoreStatus status = index_.Store(instanceMetadata, dicom.GetSummary(), attachments, dicom.GetRemoteAet(), dicom.GetMetadata()); + dicom.GetMetadata().clear(); + + for (InstanceMetadata::const_iterator it = instanceMetadata.begin(); + it != instanceMetadata.end(); it++) + { + dicom.GetMetadata().insert(std::make_pair(std::make_pair(ResourceType_Instance, it->first), + it->second)); + } + if (status != StoreStatus_Success) { storage_.Remove(dicomInfo.GetUuid());