I’m using the Docker distribution of Orthanc 1.12.10 with a custom modality that contains private tags, and I see that they are registered in the dictionary at startup in the server logs. I also see that the tag names show up in Orthanc Explorer, so I assume I’ve registered them correctly:
- 1949,0010 (PrivateCreator): SNL
- 1949,1000 (Description): Stuff.
- 1949,1002 (Location): Denver
- 1949,1004 (Tags): foo\bar\baz
With that in mind, I wanted to confirm that the behavior I see using the /tools/find endpoint from Python is expected:
First, I can search using private tags with exact match:
>>> query = {"Level": "Instance", "Query": {"Modality": "TrainingMeta", "Location": "Denver"}}
>>> requests.post(f"{orthanc}/tools/find", auth=auth, json=query).json()
['db8fdc31-4e415b58-07de552f-2a144a45-cac334d3']
… but wildcards are not allowed:
>>> query = {"Level": "Instance", "Query": {"Modality": "TrainingMeta", "Location": "Denver*"}}
>>> requests.post(f"{orthanc}/tools/find", auth=auth, json=query).json()
{'Details': 'Wildcards are not allowed on tag 1949,1002', 'HttpError': 'Bad Request', 'HttpStatus': 400, 'Message': 'Parameter out of range', 'Method': 'POST', 'OrthancError': 'Parameter out of range', 'OrthancStatus': 3, 'Uri': '/tools/find'}
Second, RequestedTags can retrieve private tags by name, but the results don’t use the private tag names:
>>> query = {"Level": "Instance", "Query": {"Modality": "TrainingMeta", "Location": "Denver"}, "RequestedTags": ["Location"], "Expand": True}
>>> requests.post(f"{orthanc}/tools/find", auth=auth, json=query).json()[0]["RequestedTags"]
{'Unknown Tag & Data': 'Denver'}
… which makes it impossible to return more than one private tag:
>>> query = {"Level": "Instance", "Query": {"Modality": "TrainingMeta", "Location": "Denver"}, "RequestedTags": ["Location", "Tags"], "Expand": True}
>>> requests.post(f"{orthanc}/tools/find", auth=auth, json=query).json()[0]["RequestedTags"]
{'Unknown Tag & Data': 'foo\\bar\\baz'}
… so the only usable way to return private tags from a query is by number:
>>> query = {"Level": "Instance", "Query": {"Modality": "TrainingMeta", "Location": "Denver"}, "RequestedTags": ["Location", "Tags"], "Expand": True, "Short": True}
>>> requests.post(f"{orthanc}/tools/find", auth=auth, json=query).json()[0]["RequestedTags"]
{'1949,1002': 'Denver', '1949,1004': 'foo\\bar\\baz'}
Third, when I retrieve an instance with Expand=True, there is no way to retrieve Orthanc ID of the parent study without an extra round trip to the server:
>>> query = {"Level": "Instance", "Query": {"Modality": "TrainingMeta", "Location": "Denver"}, "Expand": True}
>>> requests.post(f"{orthanc}/tools/find", auth=auth, json=query).json()
[{'FileSize': 822, 'FileUuid': '60a23e6e-b91c-413c-b180-a1cd60d80d22', 'ID': 'db8fdc31-4e415b58-07de552f-2a144a45-cac334d3', 'IndexInSeries': None, 'Labels': [], 'MainDicomTags': {'InstanceCreationDate': '20251003', 'InstanceCreationTime': '161542.643970', 'SOPInstanceUID': '1.2.826.0.1.3680043.8.498.62908489879635994875872666628857885306'}, 'ParentSeries': 'ff4c50fb-dd45257d-9ca86bce-6d175199-b329f4e8', 'RequestedTags': {'Unknown Tag & Data': 'Denver'}, 'Type': 'Instance'}]
… i.e. the results contain “ParentSeries” but no “ParentStudy”. ResponseContent doesn’t seem to have any relevant option for this.
Is that all correct? Are there any options I missed that would alter these behaviors?
Thanks in advance,
Tim