How to get RemoteAet in OnStoredInstance with python plugin

Hi there,
With lua plugin, the OnStoredInstance have parameter (instanceId, tags, metadata, origin),and the origin include RemoteIp, RemoteAet and CalledAet and so on.

with python plugin, if there have the same parameters especial origin, how i can i get the RemoteIp, RemoteAet info with python plugin?

Thank you.


You can use the Orthanc REST API to query for this.

for instance, to check it on all the instances of a study :

studyId = “2135698472394382742”

instances = requests.get(f"http://myorthanc:8042/series/{studyId}/instances")

for instance in instances:
instanceMetadata = requests.get(f"http://myorthanc:8042/instances/{instance[‘ID’]}/metadata?expand")

remoteAet = instance_metadata.get(“RemoteAET”),

The returned value will only be present if the instance was transferred with DICOM.

The “http://myorthanc:8042/modalities?expand” route will return the modalities registered in your Orthanc instance, and you can use the remoteAet found in the code above to find the IP and port, among other information.


Thanks a lot, that’s work good for me.