How to dynamically set called AE title

Hello, I’m am trying to figure out how to dynamically specify the Called AE title when auto forwarding a study. This is to have Orthanc function as a “passthru” or “proxy” as I sometimes see it called. Below is the high level scenario:

  1. Modality sends a study to Orthanc. Calling AE: MOD1 Called AE: DEST1
  2. Orthanc should then forward the study to a modality but set the Called AE to whatever AE the source study was sent to (DEST1 in this case).

I am able to get the source Called and Calling AE titles from the origin. I just can’t figure out how to overwrite the Called AE title. I am able to set the Calling AE by using the “LocalAET” option.

Is this scenario, I would always route to the IP/port specified in the modality, but just needing to dynamically specify the AE titles of the outbound association.

Is this possible within either a Lua or Python script?

Thanks in advance for the help.

Hi Adam,

You can do this by dynamically creating modalities. https://api.orthanc-server.com/#tag/Networking/paths/~1modalities~1{id}/put

It is best to create a new Orthanc modality for each of your desired Local AETs. You can then forward the study to the correct modality based on the Local AET that you want.

Hope that helps.

Cheers,

James

I was wondering if I’d have to go this route. I was just hoping to not have to check if an AE/modality exist for every series that passes through.

Thank you for taking the time to respond.

Adam