# Origin of Dicom ?

**URL:** https://discourse.orthanc-server.org/t/origin-of-dicom/1043
**Category:** Google Groups archive
**Created:** [July 3, 2018, 8:00am UTC](https://discourse.orthanc-server.org/t/origin-of-dicom/1043 "2018-07-03T08:00:25Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![salimkanoun](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/s/6de8d8/32.png) [@salimkanoun](https://discourse.orthanc-server.org/u/salimkanoun)
#### Post date: [July 3, 2018, 8:00am UTC](https://discourse.orthanc-server.org/t/origin-of-dicom/1043/1 "2018-07-03T08:00:25Z")

</div>

Hi there,

I have a simple question for which I didn’t found a answer yet.

Is there somewhere in Orthanc RestApis where the origin of the DICOM can be found ?

I will try to make an autorouting app in Java using Orthanc APIs and one of the requested features is to make autorouting depending on the origin of the DICOM (in the DICOM comes from AET X send to AET Y).

The /change API do not deliver the origin of the event and I don’t find this information in the orther study / series API.

The Origin AET of DICOM is it stored somewhere ?

Best regards,

Salim

---

<div class="post-metadata">

### Author: ![bdearlove](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/bdearlove/32/1661_2.png) [@bdearlove](https://discourse.orthanc-server.org/u/bdearlove)
#### Post date: [July 3, 2018, 8:28pm UTC](https://discourse.orthanc-server.org/t/origin-of-dicom/1043/2 "2018-07-03T20:28:43Z")

</div>

One option is on OnStoredInstance, take the origin and put it into a tag. (Thats what I do myself)

---

<div class="post-metadata">

### Author: ![Luiz\_Eduardo\_Guida\_V](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@Luiz\_Eduardo\_Guida\_V](https://discourse.orthanc-server.org/u/Luiz_Eduardo_Guida_V)
#### Post date: [July 4, 2018, 12:03am UTC](https://discourse.orthanc-server.org/t/origin-of-dicom/1043/3 "2018-07-04T00:03:30Z")

</div>

I’m sorry I’m on my way home but I’d like to leave my U$0,02 on the table.

If you’re interacting with Orthanc through C/C++ plugins you can obtain an instance’s origin through the OrthancPluginGetInstanceOrigin function.

ref: [https://github.com/jodogne/OrthancMirror/blob/master/Plugins/Samples/AutomatedJpeg2kCompression/Plugin.cpp](https://github.com/jodogne/OrthancMirror/blob/master/Plugins/Samples/AutomatedJpeg2kCompression/Plugin.cpp)

This is so as of 1.3.2, which is the code base I’ve been messing with.

Strictly through Rest API without plugins or Lua Scripts I don’t know how.

![Screenshot_20180703-205757.png](https://discourse.orthanc-server.org/uploads/default/original/1X/4202dcb4d337137eb213ae7d9cfa23fee436c5a9.png)

---

<div class="post-metadata">

### Author: ![jodogne](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/jodogne/32/1511_2.png) [@jodogne](https://discourse.orthanc-server.org/u/jodogne)
#### Post date: [July 12, 2018, 4:07pm UTC](https://discourse.orthanc-server.org/t/origin-of-dicom/1043/4 "2018-07-12T16:07:58Z")

</div>

Hi,

Information about the origin of the instances is stored as Metadata, which can be accessed using the REST API:

$ curl [http://localhost:8042/instances/19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5/metadata](http://localhost:8042/instances/19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5/metadata)  
[  
“IndexInSeries”,  
“ReceptionDate”,  
“RemoteAET”,  
“Origin”,  
“TransferSyntax”,  
“SopClassUid”,  
“RemoteIP”,  
“CalledAET”  
]

The relevant metadata about the origin of an instance is:

- “Origin”: Whether the instance was received from the REST API, the DICOM protocol, some plugin or some Lua script.
- “RemoteAET”: The remote AET (for DICOM).
- “RemoteIP” (new in Orthanc 1.4.0): The IP address of the remote server (for REST API and DICOM).
- “CalledAET” (new in Orthanc 1.4.0): The called AET (for DICOM).
- “HttpUsername” (new in Orthanc 1.4.0): The username that created the instance (for REST API).

HTH,

Sébastien-

---

<div class="post-metadata">

### Author: ![salimkanoun](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/s/6de8d8/32.png) [@salimkanoun](https://discourse.orthanc-server.org/u/salimkanoun)
#### Post date: [July 14, 2018, 9:25am UTC](https://discourse.orthanc-server.org/t/origin-of-dicom/1043/5 "2018-07-14T09:25:47Z")

</div>

Thank you so much Sébastien !

---

<div class="post-metadata">

### Author: ![Thiago\_Regis](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/t/a5b964/32.png) [@Thiago\_Regis](https://discourse.orthanc-server.org/u/Thiago_Regis)
#### Post date: [February 22, 2019, 9:52pm UTC](https://discourse.orthanc-server.org/t/origin-of-dicom/1043/6 "2019-02-22T21:52:22Z")

</div>

This worked gracefully for me.

Additionally, to see the values of these properties, you must add the querystring `_ **?expand** _` at the end of the URL:

\_\*\*[http://localhost:8042/instances/19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5/metadata?expand\*\*\_](http://localhost:8042/instances/19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5/metadata?expand**_)

Thanks Sebastien!

---

<div class="post-metadata">

### Author: ![ranasrule](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@ranasrule](https://discourse.orthanc-server.org/u/ranasrule)
#### Post date: [April 15, 2019, 8:37pm UTC](https://discourse.orthanc-server.org/t/origin-of-dicom/1043/7 "2019-04-15T20:37:48Z")

</div>

how can this be done?

---

<div class="post-metadata">

### Author: ![jodogne](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/jodogne/32/1511_2.png) [@jodogne](https://discourse.orthanc-server.org/u/jodogne)
#### Post date: [April 16, 2019, 5:56am UTC](https://discourse.orthanc-server.org/t/origin-of-dicom/1043/8 "2019-04-16T05:56:43Z")

</div>

[http://book.orthanc-server.com/faq/features.html#metadata-attachments](http://book.orthanc-server.com/faq/features.html#metadata-attachments)
