Using /tools/create-dicom with Private Tags

Hi Orthanc,

I am using /tools/create-dicom to store a raw export XML file in Orthanc.

I send the following body with the POST method

{
PatientName: ‘Love^Sarah’,
PatientID: ‘7’,
PatientBirthDate: ‘19760917’,

PatientSex: ‘F’,
PatientComments: ‘’,
StudyDate: ‘19981202’,
StudyTime: ‘092157’,
SeriesDate: ‘19981202’,
SeriesTime: ‘092157’,
ContentDate: ‘19981202’,
ContentTime: ‘092157’,
InstanceCreationDate: ‘19981202’,
InstanceCreationTime: ‘092157’,
OperatorsName: ‘Clinician^Sample’,
Laterality: ‘L’,
Modality: ‘OPV’,
InstanceNumber: ‘1’,
InstitutionName: ‘Sample Practice’,
DeviceSerialNumber: ‘E30120’,
DateOfLastCalibration: ‘19981123’,
TimeOfLastCalibration: ‘140837’,
SOPClassUID: ‘1.2.840.10008.5.1.4.1.1.66’,
‘0405,0010’: ‘RawDataStore’,
‘0405,1001’: ‘Testing’
}

When I view the resulting file in OrthancExplorer, the private tags exist, but are displayed as

“0405,0010” : {
“Name” : “Unknown Tag & Data”,
“PrivateCreator” : “”,
“Type” : “Null”,
“Value” : null
},
“0405,1001” : {
“Name” : “Unknown Tag & Data”,
“PrivateCreator” : “”,
“Type” : “Null”,
“Value” : null
}

Is it posible to encapsulate a xml doc similar to this using create-dicom?

Thanks very much for your help.

Regards,

James

Hello,

In order to create a DICOM file with private tags, you have to define those tags in the “Dictionary” configuration option.

For instance, here is a minimalist Orthanc configuration:

{
“Dictionary” : {
“0405,0010” : [ “LO”, “Private data element”, 1, 1, “RawDataStore” ],
“0405,1001” : [ “ST”, “XML”, 1, 1, “RawDataStore” ]
},
“DefaultPrivateCreator” : “RawDataStore”
}

Here is (part of) your original POST body:

{
“Tags” :
{
“PatientName” : “Love^Sarah”,
“PatientID” : “7”,
“0405,0010” : “RawDataStore”,
“0405,1001” : “Testing”
}
}

If this POST body is saved in file “sample.json” and given the Orthanc configuration above, here is the command to create the DICOM instance:

$ curl -u orthanc:orthanc http://localhost:8042/tools/create-dicom --data @sample.json

HTH,
Sébastien-

Hi Sébastien,

Thank you very much for that. I missed the Dictionary configuration.

On a related note, is it possible to manually set the Study/Series/SOPInstance UID? The reason I ask is because I have a unique study UUID that can be used to uniquely identify the study. I am trying to avoid accidental duplication in of the study in the database if it is uploaded multiple times. My hope is that by creating a Study/Series/SOP Instance UID (2.25.10576271412622804398) linked to the study UUID (92C676D0-7580-45AE-8339-0CEFAF0244BF), I can’t be duplicated.

Thanks a million.

James

Hello,

You can specify the “Parent” field in the POST body (containing the Orthanc identifier of some parent patient/study/series) in order to make the instance a new child of the given resource.

An example is available about attaching a PDF to a study:
https://book.orthanc-server.com/users/advanced-rest.html#attaching-pdf-file-as-dicom-series

Sébastien-

Thanks Sébastien,

For an instance where there is no parent Patient/Study/Series, is there an API to create the parent relationships first?

James

Not yet, but this is definitely feasible.

Hello,

I have just introduced a “Force” flag in the “/tools/create-dicom” URI in order to bypass all the consistency checks:
https://hg.orthanc-server.com/orthanc/rev/1619cffd1948

Here is a working example:

$ curl http://localhost:8042/tools/create-dicom -d ‘{“Tags”:{“PatientName”:“aa”,“StudyInstanceUID”:“2.25.10576271412622804398”,“SeriesInstanceUID”:“44.44.44”, “SOPInstanceUID”:“1233.5554”},“Force”:true}’

Obviously, beware that bad use of this feature might result in breaking the patient/study/series/instance DICOM hierarchy. This feature is pending in the mainline, and will be part of forthcoming 1.9.0 release.

Regards,
Sébastien-

Hi Sebastian,

Fantastic, thank you so much for this. It really helps us import instances from 3rd parties that don’t support dicom natively.

James