custom identifier on files uploaded to Orthanc

Hi, please excuse if it’s a lame question, i’m very fresh in Orthanc
Question: when my application is uploading Dicom files (via REST), is it possible to tag these files with some application-specific identifier (Id of the record in the application database where the study belongs)? If so, what is the recommended approach?

Thanks,
RG

Hello,

I think you are looking for the so-called “user-defined metadata” mechanism in Orthanc:
https://book.orthanc-server.com/faq/features.html#metadata-attachments

Sébastien-

Thanks, is the metadata searchable? I mean can i run a query by custom metadata with tools/find API?
PS after re-thinking it i concluded it would be easier to store Orthanc’s study Id in my application record, not the other way. And it doesn’t mess with Orthanc de-duplication of studies/instances.

BTW i got one more small question/request
when uploading a dcm instance file via REST, i get json data in return that includes Instance ID
it would be nice if Orthanc also returned study ID and series ID in that Json, so then i can avoid making a second request to get these fields.
Best regards
RG

No, metadata is not searchable.

There does exist a sample Python plugin that introduces searchable metadata, but pay attention to the fact that metadata is not indexed:
https://book.orthanc-server.com/plugins/python.html#filtering-and-returning-metadata

Sébastien-

Regarding your second question, since Orthanc 1.5.0, you get the ParentSeries/Studies/Patient:

curl http://localhost:8042/instances --data-binary @CR000000.dcm
{
“ID” : “04389b99-731fd35c-a8ba10a0-a1d9cb32-d7dbd903”,
“ParentPatient” : “d2f75e82-04fedf2e-acd261e2-461b2964-e3bfd5be”,
“ParentSeries” : “7982dce8-d6a3ce66-d6fac396-d2427a98-61d94367”,
“ParentStudy” : “ba19d592-4bb03a7b-65f06402-ae2b8ab1-6b33c7dc”,
“Path” : “/instances/04389b99-731fd35c-a8ba10a0-a1d9cb32-d7dbd903”,
“Status” : “Success”
}