How to get studies that older than some date using orthanc.RestApi?

Hi.
I can get one study like this:

def OnChange(changeType, level, resource):

if changeType == orthanc.ChangeType.NEW_STUDY:

study = json.loads(orthanc.RestApiGet(‘/studies/%s?expand’ % resource))

How can i get all studies that older than some date, for example : 20230204

The RestApiGet that you list is for a particular study by uuid.

You might be more interested in the tools/find POST:

https://book.orthanc-server.com/users/rest.html#performing-finds-within-orthanc

There is a “Cheat Sheet” for the API here: https://book.orthanc-server.com/users/rest-cheatsheet.html

and there is a more detailed summary of the API here:

https://api.orthanc-server.com/index.html

and here:

https://api.orthanc-server.com/index.html#tag/System/paths/~1tools~1find/post

Read the Additional Options Notes:

To perform date searches you can specify within StudyDate a starting date and/or a before date. For example “StudyDate”:“20180323-” would search for all study dates after the specified date to now. Doing “StudyDate”:“20180323-20180325” would search for all study dates between the specified date.

Stephen D. Scotti, M.D.