Modify PatientName

Hello,
I have a problem with the Name Patient modification. What am I doing wrong according to the API the entry should look like this:

curl http://localhost:8042/patients/fa5ddcc9-0c875b73-06373e34-48abb220-918928fc/modify -X POST -d “{“Replace” :{“PatientName”: “ANNAS”}, “Force”:true}”

I get the response:

“HttpError” : “Bad Request”,
“HttpStatus” : 400,
“Message” : “Bad file format”,
“Method” : “POST”,
“OrthancError” : “Bad file format”,
“OrthancStatus” : "15,
“Uri” : “/patients/fa5ddcc9-0c875b73-06373e34-48abb220-918928fc/modify”

I am very much asking for help. Thank you in advance

Hi Marcin,

Welcome!
This should work:
curl http://localhost:8042/patients/fa5ddcc9-0c875b73-06373e34-48abb220-918928fc/modify -X POST -d '{"Replace" :{"PatientName": "ANNAS"}, "Force":true}'

Note the use of the right “double quote” char…
HTH,

Unfortunately, it doesn’t work.Any ideas?

Try to add a backslash before double quotes inside curly braces.

Hello Marcin,

Here is an example of a working Windows sample on another route:

curl.exe -v -X PUT http://localhost:8042/modalities/sample \
       -d "{\"AET\" : \"ORTHANCC\", \"Host\": \"127.0.0.1\", \"Port\": 2002}"

Notice two things:

  • the usage of curl.exe instead of curl that avoid this problem
  • the escaped double quotes, as explained by Maksym.

HTH

Hello,
Unfortunately the backslash did not help. I went another way in MicroDicom Viewer you can change the tags. So there I changed and uploaded again to the server.
Thank you all for your help.