comparison OrthancServer/Sources/OrthancWebDav.cpp @ 5833:58c549b881ae find-refactoring-clean

merged find-refactoring -> find-refactoring-clean
author Alain Mazy <am@orthanc.team>
date Wed, 09 Oct 2024 11:01:11 +0200
parents 593e110de3d8 dd2af8692cbc
children
comparison
equal deleted inserted replaced
5754:f75596b224e0 5833:58c549b881ae
934 query.AddRestConstraint(DICOM_TAG_STUDY_DATE, year_ + month_ + "01-" + year_ + month_ + "31", 934 query.AddRestConstraint(DICOM_TAG_STUDY_DATE, year_ + month_ + "01-" + year_ + month_ + "31",
935 true /* case sensitive */, true /* mandatory tag */); 935 true /* case sensitive */, true /* mandatory tag */);
936 936
937 Visitor visitor(resources); 937 Visitor visitor(resources);
938 938
939 ResourceFinder finder(ResourceType_Study, false /* no expand */); 939 ResourceFinder finder(ResourceType_Study, ResponseContentFlags_ID);
940 finder.SetDatabaseLookup(query); 940 finder.SetDatabaseLookup(query);
941 finder.Execute(visitor, GetContext()); 941 finder.Execute(visitor, GetContext());
942 } 942 }
943 943
944 virtual INode* CreateResourceNode(const std::string& resource) ORTHANC_OVERRIDE 944 virtual INode* CreateResourceNode(const std::string& resource) ORTHANC_OVERRIDE
1012 query.AddRestConstraint(DICOM_TAG_STUDY_DATE, year_ + "0101-" + year_ + "1231", 1012 query.AddRestConstraint(DICOM_TAG_STUDY_DATE, year_ + "0101-" + year_ + "1231",
1013 true /* case sensitive */, true /* mandatory tag */); 1013 true /* case sensitive */, true /* mandatory tag */);
1014 1014
1015 Visitor visitor; 1015 Visitor visitor;
1016 1016
1017 ResourceFinder finder(ResourceType_Study, false /* no expand */); 1017 ResourceFinder finder(ResourceType_Study, ResponseContentFlags_ID);
1018 finder.SetDatabaseLookup(query); 1018 finder.SetDatabaseLookup(query);
1019 finder.Execute(visitor, context_); 1019 finder.Execute(visitor, context_);
1020 1020
1021 for (std::set<std::string>::const_iterator it = visitor.GetMonths().begin(); 1021 for (std::set<std::string>::const_iterator it = visitor.GetMonths().begin();
1022 it != visitor.GetMonths().end(); ++it) 1022 it != visitor.GetMonths().end(); ++it)
1390 else 1390 else
1391 { 1391 {
1392 return false; 1392 return false;
1393 } 1393 }
1394 1394
1395 ResourceFinder finder(level, false /* don't expand */); 1395 ResourceFinder finder(level, ResponseContentFlags_ID);
1396 finder.SetDatabaseLookup(query); 1396 finder.SetDatabaseLookup(query);
1397 finder.SetRetrieveMetadata(true); 1397 finder.SetRetrieveMetadata(true);
1398 1398
1399 switch (level) 1399 switch (level)
1400 { 1400 {
1441 static bool GetOrthancJson(std::string& target, 1441 static bool GetOrthancJson(std::string& target,
1442 ServerContext& context, 1442 ServerContext& context,
1443 ResourceType level, 1443 ResourceType level,
1444 const DatabaseLookup& query) 1444 const DatabaseLookup& query)
1445 { 1445 {
1446 ResourceFinder finder(level, true /* expand */); 1446 ResourceFinder finder(level, ResponseContentFlags_ExpandTrue);
1447 finder.SetDatabaseLookup(query); 1447 finder.SetDatabaseLookup(query);
1448 1448
1449 Json::Value expanded; 1449 Json::Value expanded;
1450 finder.Execute(expanded, context, DicomToJsonFormat_Human, false /* don't add "Metadata" */); 1450 finder.Execute(expanded, context, DicomToJsonFormat_Human, false /* don't add "Metadata" */);
1451 1451
1511 query.AddRestConstraint(DICOM_TAG_SOP_INSTANCE_UID, sopInstanceUid, 1511 query.AddRestConstraint(DICOM_TAG_SOP_INSTANCE_UID, sopInstanceUid,
1512 true /* case sensitive */, true /* mandatory tag */); 1512 true /* case sensitive */, true /* mandatory tag */);
1513 1513
1514 mime = MimeType_Dicom; 1514 mime = MimeType_Dicom;
1515 1515
1516 ResourceFinder finder(ResourceType_Instance, false /* no expand */); 1516 ResourceFinder finder(ResourceType_Instance, ResponseContentFlags_ID);
1517 finder.SetDatabaseLookup(query); 1517 finder.SetDatabaseLookup(query);
1518 finder.SetRetrieveMetadata(true); 1518 finder.SetRetrieveMetadata(true);
1519 finder.SetRetrieveAttachments(true); 1519 finder.SetRetrieveAttachments(true);
1520 1520
1521 DicomFileVisitorV2 visitor(context_, content, modificationTime); 1521 DicomFileVisitorV2 visitor(context_, content, modificationTime);
1641 } 1641 }
1642 } 1642 }
1643 1643
1644 DicomDeleteVisitor visitor(context_, level); 1644 DicomDeleteVisitor visitor(context_, level);
1645 1645
1646 ResourceFinder finder(level, false /* no expand */); 1646 ResourceFinder finder(level, ResponseContentFlags_ID);
1647 finder.SetDatabaseLookup(query); 1647 finder.SetDatabaseLookup(query);
1648 finder.Execute(visitor, context_); 1648 finder.Execute(visitor, context_);
1649 return true; 1649 return true;
1650 } 1650 }
1651 else 1651 else