diff OrthancServer/Sources/Database/StatelessDatabaseOperations.h @ 5036:877bc3b96476

Handle Dicom sequences in ExtraMainDicomTags and save them in the 'MainDicomSequences' metadata
author Alain Mazy <am@osimis.io>
date Fri, 24 Jun 2022 15:47:10 +0200
parents 8fba26292a9f
children 28db9663fc2d
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.h	Wed Jun 22 15:37:08 2022 +0200
+++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.h	Fri Jun 24 15:47:10 2022 +0200
@@ -37,10 +37,25 @@
   class ParsedDicomFile;
   struct ServerIndexChange;
 
+  /*
+   * contains a map of dicom sequences where:
+   * the key is a DicomTag
+   * the sequence is serialized in Json "full" format
+   */
+  struct DicomSequencesMap : public boost::noncopyable
+  {
+    std::map<DicomTag, Json::Value>     sequences_;
+
+    void FromJson(const Json::Value& serialized);
+    void FromDicomAsJson(const Json::Value& dicomAsJson, const std::set<DicomTag>& tags);
+    void ToJson(Json::Value& target, DicomToJsonFormat format) const;
+  };
+
   struct ExpandedResource : public boost::noncopyable
   {
     std::string                         id_;
-    DicomMap                            tags_;  // all tags from DB
+    DicomMap                            tags_;          // all tags from DB (only leaf tags, not sequences !)
+    DicomSequencesMap                   sequences_;     // the requested sequences
     std::string                         mainDicomTagsSignature_;
     std::string                         parentId_;
     std::list<std::string>              childrenIds_;
@@ -650,6 +665,7 @@
 
     StoreStatus Store(std::map<MetadataType, std::string>& instanceMetadata,
                       const DicomMap& dicomSummary,
+                      const std::map<DicomTag, Json::Value>& sequencesToStore,
                       const Attachments& attachments,
                       const MetadataMap& metadata,
                       const DicomInstanceOrigin& origin,