Get calledAE in REST API

Hello,

im using Orthanc for a routing Script i write in python.

The idea is like this:

Modality sends Study to Orthanc Server

  • CallingAE: AE of the Modality
  • CalledAE: Name of Target to which the study should be forwarded to

The questions is: where can i get the CalledAE via REST API?

I know i can get the CallingAE with:
http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/RemoteAet

But what about the CalledAE?

best regards,

Ben

You can try http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/Origin , but if you made any modifications within Lua for example, when you “create” a new instance it will change the CalledAEto Lua. If that is the case, easiest is in the Lua script, take origin[‘CalledAet’] and save it to a tag on the instance so you can get it when required.

Thanks for the feedback Bryan!

I found following LUA Function in an older Topic:

function OnStoredInstance(instanceId, tags, metadata, remoteAet, calledAet)

Would it be possible to get the bold Value also from REST?

My Plan B would be to write the Values on stored Instance with LUA in an Private Tag (but with the incovenience of creating duplicates of each Instance, deleting the original and creating a new one with the ID of the old one afterwards…which i kinda time consuming)

The questions is: where can i get the CalledAE via REST API?

I know i can get the CallingAE with:
http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/RemoteAet

But what about the CalledAE?

Simply replace “/RemoteAet” by “/CalledAET” in your URL:

http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/CalledAET

The list of available metadata for a given instance can be retrieved at:

http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/

I believe CalledAET is no longer in use, instead Origin is. So in Lua use origin[‘CalledAet’]. You can use that and send it to a private tag. Thats what I am doing and has worked without issue.

Instead of storing the info in a private tag, you may also define your own metadata and store it there so you don’t modify your DICOM data.