Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
4934:94a7b681b340 | 4935:acd3f72e2a21 |
---|---|
35 { | 35 { |
36 class DatabaseLookup; | 36 class DatabaseLookup; |
37 class ParsedDicomFile; | 37 class ParsedDicomFile; |
38 struct ServerIndexChange; | 38 struct ServerIndexChange; |
39 | 39 |
40 struct ExpandedResource : public boost::noncopyable | |
41 { | |
42 std::string id_; | |
43 DicomMap tags_; // all tags from DB | |
44 std::string mainDicomTagsSignature_; | |
45 std::string parentId_; | |
46 std::list<std::string> childrenIds_; | |
47 std::map<MetadataType, std::string> metadata_; | |
48 ResourceType type_; | |
49 std::string anonymizedFrom_; | |
50 std::string modifiedFrom_; | |
51 std::string lastUpdate_; | |
52 | |
53 // for patients/studies/series | |
54 bool isStable_; | |
55 | |
56 // for series only | |
57 int expectedNumberOfInstances_; | |
58 std::string status_; | |
59 | |
60 // for instances only | |
61 size_t fileSize_; | |
62 std::string fileUuid_; | |
63 int indexInSeries_; | |
64 }; | |
65 | |
66 | |
40 class StatelessDatabaseOperations : public boost::noncopyable | 67 class StatelessDatabaseOperations : public boost::noncopyable |
41 { | 68 { |
42 public: | 69 public: |
43 typedef std::list<FileInfo> Attachments; | 70 typedef std::list<FileInfo> Attachments; |
44 typedef std::map<std::pair<ResourceType, MetadataType>, std::string> MetadataMap; | 71 typedef std::map<std::pair<ResourceType, MetadataType>, std::string> MetadataMap; |
446 | 473 |
447 void Apply(IReadOnlyOperations& operations); | 474 void Apply(IReadOnlyOperations& operations); |
448 | 475 |
449 void Apply(IReadWriteOperations& operations); | 476 void Apply(IReadWriteOperations& operations); |
450 | 477 |
451 bool ExpandResource(Json::Value& target, | 478 bool ExpandResource(ExpandedResource& target, |
452 const std::string& publicId, | 479 const std::string& publicId, |
453 ResourceType level, | 480 ResourceType level, |
454 DicomToJsonFormat format); | 481 DicomToJsonFormat format); |
455 | 482 |
456 void GetAllMetadata(std::map<MetadataType, std::string>& target, | 483 void GetAllMetadata(std::map<MetadataType, std::string>& target, |