Hi. I need to get the “latest” studies. LastUpdate looks like a good choice for this task. I saw the MetadataQuery parameter on /tools/find, but when I try to use it
-d '{"Level": "Study", "MetadataQuery": {"LastUpdate": "20250314"}}'
"Details" : "Field \"Query\" is missing, or should be a JSON object",
It needs the Query parameter. I don’t have any query to give, but lets do it.
I might as well explain my actual goal. On StableStudy, we tell an external server about a new study. For some reason, the server might be offline. StableStudy won’t run again when the server is online, so I coded a cron job to compare the studies on the server and on Orthanc. This looks like a good plan, but getting the studies on Orthanc intelligently is somewhat harder.
Filtering by StudyDate if wrong, because a client might send us an older study, but it’s still new for us. We don’t really care when the study was acquired, only when we received it.
Using a StudyDate range (see last reply) would do the job, but it doesn’t work. I need to do 2 requests?
A filter like “all studies updated in the last 10 minutes”, or “all studies, sort by LastUpdate, limit 20” would be perfect, but I can’t seem to find the required feature.
When I open OE2, it looks like the studies are sorted by LastUpdate, but I’m not entirely sure. It’s written “Liste des examens les plus récents”, which might mean that they are sorted by StudyDate. Can you please confirm?