comparison OrthancServer/Sources/ServerContext.cpp @ 5607:a3732285f8b6 find-refactoring

added main DICOM tags to ResourceFinder
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 08 May 2024 12:58:16 +0200
parents 81a29ad7fb4b
children 3f13db27b399
comparison
equal deleted inserted replaced
5606:6e2dad336446 5607:a3732285f8b6
2714 boost::posix_time::ptime nowUtc = boost::posix_time::second_clock::universal_time(); 2714 boost::posix_time::ptime nowUtc = boost::posix_time::second_clock::universal_time();
2715 boost::posix_time::time_duration elapsed = nowUtc - serverStartTimeUtc_; 2715 boost::posix_time::time_duration elapsed = nowUtc - serverStartTimeUtc_;
2716 2716
2717 return elapsed.total_seconds(); 2717 return elapsed.total_seconds();
2718 } 2718 }
2719
2720 void ServerContext::AppendFindResponse(Json::Value& target,
2721 const FindRequest& request,
2722 const FindResponse::Resource& item,
2723 DicomToJsonFormat format,
2724 const std::set<DicomTag>& requestedTags,
2725 bool allowStorageAccess)
2726 {
2727 // convert to ExpandedResource to re-use the serialization code TODO-FIND: check if this is the right way to do. shouldn't we copy the code and finally get rid of ExpandedResource ?
2728 ExpandedResource resource(request, item);
2729
2730 ExpandResourceFlags expandFlags = ExpandResourceFlags_None;
2731 if (request.IsRetrieveChildrenIdentifiers())
2732 {
2733 expandFlags = static_cast<ExpandResourceFlags>(expandFlags | ExpandResourceFlags_IncludeChildren);
2734 }
2735 if (request.IsRetrieveMetadata(request.GetLevel()))
2736 {
2737 expandFlags = static_cast<ExpandResourceFlags>(expandFlags | ExpandResourceFlags_IncludeAllMetadata | ExpandResourceFlags_IncludeMetadata );
2738 }
2739 if (request.IsRetrieveMainDicomTags(request.GetLevel()))
2740 {
2741 expandFlags = static_cast<ExpandResourceFlags>(expandFlags | ExpandResourceFlags_IncludeMainDicomTags);
2742 }
2743 if (true /* request.HasResponseContent(FindRequest::ResponseContent_IsStable) */) // TODO-FIND: Is this correct?
2744 {
2745 expandFlags = static_cast<ExpandResourceFlags>(expandFlags | ExpandResourceFlags_IncludeIsStable);
2746 }
2747 if (request.IsRetrieveLabels())
2748 {
2749 expandFlags = static_cast<ExpandResourceFlags>(expandFlags | ExpandResourceFlags_IncludeLabels);
2750 }
2751
2752 Json::Value jsonItem;
2753 SerializeExpandedResource(jsonItem, resource, format, requestedTags, expandFlags);
2754 target.append(jsonItem);
2755 }
2756
2757
2758 } 2719 }