Hi there, we’re doing a partial migration out of our Orthanc system to another PACS. I am looking to pull a group of studyuids by date range from Orthanc for comparison to the other PACS to which we have sent the exams.
The original migration was done via drives so there is no direct connection between the two systems. Thus, I am looking to do a database level validation on the other system by comparing the studyuids in Orthanc to what is in the new pacs.
What would be the best way to go about doing this?
Hello,
I’m not sure I caught you correctly…
I would write a quick python script to get the information, here is an API client:
HTH,
Hi there, thanks for the reply bcrickboom.
Basically I am just looking for a simple way to export a full list of all study uids out of Orthanc and into a csv or text file. Preferably something that doesn’t require utilization of anything beyond a simple query or command, if that is at all possible.
Hello,
This is easily achieved using the REST API of Orthanc. Here is a basic example for you to start with:
import requests
URL = 'http://localhost:8042'
r1 = requests.get('%s/studies' % URL)
r1.raise_for_status()
for study in r1.json():
r2 = requests.get('%s/studies/%s' % (URL, study))
r2.raise_for_status()
print(r2.json() ['MainDicomTags']['StudyInstanceUID'])
Regards,
Sébastien-
Much appreciated. This worked fairly well, though due to the config in use I did have to make some changes to allow for authentication and to make it more easily reusable, as I suspect this won’t be the last time I get asked for this.
Thanks again!