Mercurial > hg > orthanc
comparison OrthancServer/Sources/ResourceFinder.cpp @ 5674:74f3aab95886 find-refactoring
simplification
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 06 Jul 2024 14:43:46 +0200 |
parents | e300f22a46f0 |
children | b744a2cf408a |
comparison
equal
deleted
inserted
replaced
5673:ebcbb448bea8 | 5674:74f3aab95886 |
---|---|
130 !SerializationToolbox::ParseUnsignedInteger32(expectedNumberOfInstances, s)) | 130 !SerializationToolbox::ParseUnsignedInteger32(expectedNumberOfInstances, s)) |
131 { | 131 { |
132 return SeriesStatus_Unknown; | 132 return SeriesStatus_Unknown; |
133 } | 133 } |
134 | 134 |
135 std::list<std::string> values; | 135 std::set<std::string> values; |
136 if (!resource.LookupChildrenMetadata(values, MetadataType_Instance_IndexInSeries)) | 136 resource.GetChildrenMetadataValues(values, ResourceType_Instance, MetadataType_Instance_IndexInSeries); |
137 { | |
138 throw OrthancException(ErrorCode_BadSequenceOfCalls); | |
139 } | |
140 | 137 |
141 std::set<int64_t> instances; | 138 std::set<int64_t> instances; |
142 | 139 |
143 for (std::list<std::string>::const_iterator | 140 for (std::set<std::string>::const_iterator |
144 it = values.begin(); it != values.end(); ++it) | 141 it = values.begin(); it != values.end(); ++it) |
145 { | 142 { |
146 int64_t index; | 143 int64_t index; |
147 | 144 |
148 if (!SerializationToolbox::ParseInteger64(index, *it)) | 145 if (!SerializationToolbox::ParseInteger64(index, *it)) |
436 request_.GetChildrenRetrieveSpecification(ResourceType_Series).SetRetrieveIdentifiers(true); | 433 request_.GetChildrenRetrieveSpecification(ResourceType_Series).SetRetrieveIdentifiers(true); |
437 request_.SetRetrieveParentIdentifier(true); | 434 request_.SetRetrieveParentIdentifier(true); |
438 break; | 435 break; |
439 | 436 |
440 case ResourceType_Series: | 437 case ResourceType_Series: |
441 request_.AddRetrieveChildrenMetadata(MetadataType_Instance_IndexInSeries); // required for the SeriesStatus | 438 request_.GetChildrenRetrieveSpecification(ResourceType_Instance).AddMetadata(MetadataType_Instance_IndexInSeries); // required for the SeriesStatus |
442 request_.GetChildrenRetrieveSpecification(ResourceType_Instance).SetRetrieveIdentifiers(true); | 439 request_.GetChildrenRetrieveSpecification(ResourceType_Instance).SetRetrieveIdentifiers(true); |
443 request_.SetRetrieveParentIdentifier(true); | 440 request_.SetRetrieveParentIdentifier(true); |
444 break; | 441 break; |
445 | 442 |
446 case ResourceType_Instance: | 443 case ResourceType_Instance: |