diff OrthancServer/Sources/Database/StatelessDatabaseOperations.h @ 4935:acd3f72e2a21 more-tags

split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
author Alain Mazy <am@osimis.io>
date Thu, 10 Mar 2022 19:00:43 +0100
parents 6eff25f70121
children 8422e4f99a18
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.h	Thu Mar 10 09:03:24 2022 +0100
+++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.h	Thu Mar 10 19:00:43 2022 +0100
@@ -37,6 +37,33 @@
   class ParsedDicomFile;
   struct ServerIndexChange;
 
+  struct ExpandedResource : public boost::noncopyable
+  {
+    std::string                         id_;
+    DicomMap                            tags_;  // all tags from DB
+    std::string                         mainDicomTagsSignature_;
+    std::string                         parentId_;
+    std::list<std::string>              childrenIds_;
+    std::map<MetadataType, std::string> metadata_;
+    ResourceType                        type_;
+    std::string                         anonymizedFrom_;
+    std::string                         modifiedFrom_;
+    std::string                         lastUpdate_;
+
+    // for patients/studies/series
+    bool                                isStable_;
+
+    // for series only
+    int                                 expectedNumberOfInstances_;
+    std::string                         status_;
+
+    // for instances only
+    size_t                              fileSize_;
+    std::string                         fileUuid_;
+    int                                 indexInSeries_;
+  };
+
+
   class StatelessDatabaseOperations : public boost::noncopyable
   {
   public:
@@ -448,7 +475,7 @@
   
     void Apply(IReadWriteOperations& operations);
 
-    bool ExpandResource(Json::Value& target,
+    bool ExpandResource(ExpandedResource& target,
                         const std::string& publicId,
                         ResourceType level,
                         DicomToJsonFormat format);