# HG changeset patch # User Sebastien Jodogne # Date 1715419405 -7200 # Node ID 824a5fb0774e94792c142aa42e67b958d4a8600f # Parent 8905ffa45fc24a729d601d205ca87a1be40d8e6e removed constructor of ExpandedResource with FindRequest diff -r 8905ffa45fc2 -r 824a5fb0774e OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp --- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Thu May 09 14:59:17 2024 +0200 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Sat May 11 11:23:25 2024 +0200 @@ -3769,100 +3769,4 @@ } } } - - // TODO-FIND: we reuse the ExpandedResource class to reuse Serialization code from ExpandedResource - // But, finally, we might just get rid of ExpandedResource and replace it by FindResponse - ExpandedResource::ExpandedResource(const FindRequest& request, - const FindResponse::Resource& resource) : - id_(resource.GetIdentifier()), - level_(request.GetLevel()), - isStable_(false), - expectedNumberOfInstances_(0), - fileSize_(0), - indexInSeries_(0) - { - if (request.GetLevel() != resource.GetLevel()) - { - throw OrthancException(ErrorCode_InternalError); - } - - if (request.IsRetrieveMainDicomTags(request.GetLevel())) - { - resource.GetMainDicomTags(tags_, request.GetLevel()); - } - - if (request.IsRetrieveChildrenIdentifiers()) - { - const std::set& children = resource.GetChildrenIdentifiers(); - for (std::set::const_iterator it = children.begin(); it != children.end(); ++it) - { - childrenIds_.push_back(*it); - } - } - - if (request.IsRetrieveParentIdentifier()) - { - parentId_ = resource.GetParentIdentifier(); - } - - if (request.IsRetrieveMetadata(request.GetLevel())) - { - metadata_ = resource.GetMetadata(request.GetLevel()); - std::string value; - if (resource.LookupMetadata(value, request.GetLevel(), MetadataType_MainDicomTagsSignature)) - { - mainDicomTagsSignature_ = value; - } - if (resource.LookupMetadata(value, request.GetLevel(), MetadataType_AnonymizedFrom)) - { - anonymizedFrom_ = value; - } - if (resource.LookupMetadata(value, request.GetLevel(), MetadataType_ModifiedFrom)) - { - modifiedFrom_ = value; - } - if (resource.LookupMetadata(value, request.GetLevel(), MetadataType_LastUpdate)) - { - lastUpdate_ = value; - } - if (request.GetLevel() == ResourceType_Series) - { - if (resource.LookupMetadata(value, request.GetLevel(), MetadataType_Series_ExpectedNumberOfInstances)) - { - expectedNumberOfInstances_ = boost::lexical_cast(value); - } - } - if (request.GetLevel() == ResourceType_Instance) - { - if (resource.LookupMetadata(value, request.GetLevel(), MetadataType_Instance_IndexInSeries)) - { - indexInSeries_ = boost::lexical_cast(value); - } - } - } - - if (request.IsRetrieveLabels()) - { - labels_ = resource.GetLabels(); - } - - if (request.IsRetrieveAttachments()) - { - FileInfo attachment; - if (resource.LookupAttachment(attachment, FileContentType_Dicom)) - { - fileSize_ = attachment.GetUncompressedSize(); - fileUuid_ = attachment.GetUuid(); - } - } - - //if (request.IsRetrieveChildrenMetadata()) - { - // TODO-FIND: the status_ is normally obtained from transaction.GetSeriesStatus(internalId, i) - // but, that's an heavy operation for something that is rarely used -> we should have dedicated SQL code - // to compute it AFAP and we should compute it only if the user request it ! - } - - // TODO-FIND: continue: isStable_, status_ - } } diff -r 8905ffa45fc2 -r 824a5fb0774e OrthancServer/Sources/Database/StatelessDatabaseOperations.h --- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.h Thu May 09 14:59:17 2024 +0200 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.h Sat May 11 11:23:25 2024 +0200 @@ -80,9 +80,6 @@ indexInSeries_(0) { } - - ExpandedResource(const FindRequest& request, - const FindResponse::Resource& resource); void SetResource(ResourceType level, const std::string& id)