How to find original AE title from gate

Hello,
I have three gates with Orthanc (AE: gate1, gate2, gate3) witch automaticlly send studys on one PACS with Orthanc (AE: PACS1). Uploading is done using lua script on every gate.
My lua script:

function OnStoredInstance(instanceId, tags, metadata)

if tags.SeriesDescription and tags.SeriesDescription:find(“Dose Report”) then
print(“Odrzucenie instancji z ‘Dose Report’: " … instanceId)
else
local targetModality = “PACS1”
print(“Przekierowywanie instancji: " … instanceId … " do " … targetModality)
RestApiPost(‘/modalities/’ … targetModality … ‘/store’, '{“Resources”: [”’ … instanceId … '”]}')
end
end

I would like to find the information (probably AE) from which gate the study upload on main server PACS1.

What should I add to my script to make ae appear in tags on the PACS1?

I will be extremely grateful for your help!

Take a look at the below link… “RemoteAET” is what you are looking for

https://orthanc.uclouvain.be/book/faq/features.html#core-metadata

OK, thank You so much but… how should I use it? How to read this tag on main Orthanc?

When I checking for example

localhost:8042/instances/e5dc7664-82a40a83-95857b4b-46ae355f-27d8fc7e/metadata/RemoteAet

I have this message:

{
“HttpError” : “Not Found”,
“HttpStatus” : 404,
“Message” : “Accessing an inexistent item”,
“Method” : “GET”,
“OrthancError” : “Accessing an inexistent item”,
“OrthancStatus” : 7,
“Uri” : “/instances/e5dc7664-82a40a83-95857b4b-46ae355f-27d8fc7e/metadata/RemoteAet”
}

For studies the same:

localhost:8042/studies/475138f1-fb797f43-23edecf2-0ba6aa82-5146fd2f/metadata/RemoteAet

result:

{
“HttpError” : “Not Found”,
“HttpStatus” : 404,
“Message” : “Accessing an inexistent item”,
“Method” : “GET”,
“OrthancError” : “Accessing an inexistent item”,
“OrthancStatus” : 7,
“Uri” : “/studies/475138f1-fb797f43-23edecf2-0ba6aa82-5146fd2f/metadata/RemoteAet”
}

Works! I pasted the wrong ID. Thanks for the help!

I have one more question.

Why is the “RemoteAET” tag attached only to a photo (instance) but not to the entire study? For example

localhost:8042/instances/e5dc7664-82a40a83-95857b4b-46ae355f-27d8fc7e/metadata/RemoteAET

When I check the tag for the entire studies, I have an empty value:

localhost:8042/studies/475138f1-fb797f43-23edecf2-0ba6aa82-5146fd2f/metadata/RemoteAET

Can someone explain to me why there is a tag next to a particular photo?

Hello,

This is because the instances associated with one study might originate from different sources. The instances correspond to the only “atomic” level in the DICOM model of the real-world.

Regards,
Sébastien-

1 Like

Hi! Thank you for Your answer.

Do You know how to add a RemoteAET tag to a Study?

I added it to the Study in ExtraMainDicomTags like this

“ExtraMainDicomTags” : {
“Instance” : [
“Rows”,
“Columns”,
“ImageType”,
“SOPClassUID”,
“ContentDate”,
“ContentTime”,
“FrameOfReferenceUID”,
“PixelSpacing”,
“SpecificCharacterSet”,
“BitsAllocated”
],
“Series” : [ ]
“Study”: [
“RemoteAET”
],
“Patient”: [ ]
},

but I can’t induce it anywhere in metatags from Study. Do You know how to do it?

Best
Paul

Hello,

The RemoteAET metadata is automatically added by Orthanc for all the instances that are received over the DICOM networking protocol. No configuration is needed (and certainly not in the ExtraMainDicomTags configuration option).

Regards,
Sébastien-

Hello Sébastien,

so why I haven’t got RemoteAET during the study?

When I check for example:

localhost:8042/studies/22b2ec3e-5e4f4009-ef4ffd4b-a7928b94-5bb0029b/metadata

I receive only:

[
“LastUpdate”,
“MainDicomTagsSignature”
]

How can I read the RemoteAET from Study?

As explained above, there is no RemoteAET metadata associated with studies. It is only available at the instance level, and only for instances that have been received through the DICOM networking protocol (i.e., not the REST API).

OK, thank You for the detailed explanation.

So may be from a different perspective.

Is it possible to find out from which dicom gate (where is Orthanc) was sent a specyfic Study (on PACS where also is Orthanc)?

I don’t understand this question.

If you want to retrieve something that would look like a RemoteAET for a study of interest, you can always read the RemoteAET metadata of the child instances of this study (taking into account that it might not be unique, as explained above). Retrieving the list of instances of a study can be done using the REST API.

I have several gates (with Orthanc) that send Studies per one PACS (also Othanc).

I would like to be able to find out on my PACS from which gate came a specific Study, omitting instances. This can be a unique name, IP address, tag, anything that identifies a specific gate.

Is it possible?

Sorry, I still don’t understand your use case. Please provide a diagram explaining your network topology.

Hi,

This message explains how to retrieve the RemoteAET for a study based on the RemoteAET of an instance.

HTH,

Alain