[BitBucket user: Marco Barnig] [BitBucket date: 2019-05-03.20:47:46] **What steps will reproduce the problem?** Upload the attached DICOM file radiologic.dcm to Orthanc server. By adding the attached radiologic-dic.json file to the Orthanc configuration the private tags are displayed as expected in the Orthanc tag panel. ![](2583496647-orthanc-tags.jpg) An extract of a dump created with the dicom3tool dciodvfy is shown below: ![](3173254069-radiologic-dump.jpg) Execute the curl command ``` curl http://<ip-adress:port>/instances/f1c8c9de-c1f0dd83-a1de5468-03def2fe-c24d3589/modify -X POST -d ‘{"Replace":{"RadioButton3":"aaabbbccc"}}’ > modified-rest-api.dcm ``` or ``` curl http://<ip-adress:port>/instances/f1c8c9de-c1f0dd83-a1de5468-03def2fe-c24d3589/modify -X POST -d ‘{"Replace":{"4321,1012":"aaabbbccc"}}’ > modified-rest-api.dcm ``` The related Orthanc log file is attached as orthanc-trace-log.txt. **What is the expected output?** A new DICOM file with value in tag \(4321,1013\) changed from _jklmnopq_ to _aaabbbccc_. **What do you see instead?** A new DICOM file with VR of tag \(4321,1013\) changed from LO to UN. An extract of a dump created with the dicom3tool dciodvfy is shown below: ![](3565065530-modified-rest-api-dump.jpg) When modifying the series, study or patient instead of the instance with the REST API, the result is the same. **What version of the product are you using? On what operating system?** Orthanc 1.5.6 in Docker Linux, natif in Windows 10 and natif in OS X 10.13.6. Same results in all systems. **Temporary solution:** As a workaround I can use my own callback in a plugin to modify the files. Here is my code snippet: ``` { string myDcmtkCommand = "dcmtk-3.6.4/bin/dcmodify -m '(4321,1012)=aaabbbcc' /temp/radiologic.dcm"; int resultDcmtk = system(myDcmtkCommand.c_str()); ... return OrthancPluginErrorCode_Success; } ``` An extract of a dump created with the dicom3tool dciodvfy is shown below: ![](2363588212-modified-system-dcmtk-dump.jpg) Another workaround consist in using the modified files with VR = UN, because I can read the hexadecimal content and convert it to a string. Both methods are not very elegant. **What are references?** My contributions in the Orthanc Forum dated April 9, 2019 \( [Managing private tags is tricky](https://groups.google.com/forum/#!searchin/orthanc-users/mbarnig%7Csort:date/orthanc-users/p5S4YkHcTrc/h8PgZ2seAgAJ) \) and June 1, 2016 \( [Questions about private tags](https://groups.google.com/forum/#!msg/orthanc-users/v60O7x3uYF0/tiuOQTBuAgAJ) \).
Created attachment 11 [details] 2583496647-orthanc-tags.jpg
Created attachment 12 [details] 3173254069-radiologic-dump.jpg
Created attachment 13 [details] 3565065530-modified-rest-api-dump.jpg
Created attachment 14 [details] 2363588212-modified-system-dcmtk-dump.jpg
Created attachment 27 [details] radiologic-dic.json
Created attachment 28 [details] radiologic.dcm
Created attachment 29 [details] orthanc-trace-log.txt
Created attachment 30 [details] modified-system-dcmtk.dcm
Created attachment 31 [details] modified-rest-api.dcm
[BitBucket user: Sébastien Jodogne] [BitBucket date: 2019-05-06.13:24:29] An integration test is available to reproduce the issue: https://hg.orthanc-server.com/orthanc-tests/changeset/9929e4af2b7a85dbd8812ef5f8927463ca777c11
[BitBucket user: Sébastien Jodogne] [BitBucket date: 2020-02-25.20:44:16] Fix issue #140 (Modifying private tags with REST API changes VR from LO to UN) - DANGEROUS COMMIT → https://hg.orthanc-server.com/orthanc/changeset/4922bdd046dd
[BitBucket user: Sébastien Jodogne] [BitBucket date: 2020-02-25.20:49:51] The trick is first to define the private tag in the configuration file of Orthanc: ``` { [...] "Dictionary": { "4321,1012" : ["LO","RadioButton3",1,1,"RadioLogic"] } } ``` Then, to provide the “PrivateCreator” argument \(introduced in forthcoming Orthanc 1.6.0\) while calling the REST API: `curl <http://ip-adress:port/instances/f1c8c9de-c1f0dd83-a1de5468-03def2fe-c24d3589/modify> -X POST -d ‘{"Replace":{"RadioButton3":"aaabbbccc"},”PrivateCreator”:”RadioLogic”}’ > modified-rest-api.dcm`