We are experiencing a problem with patient ID generation. The medical device we are using generates repetitive identifiers, resulting in different patients receiving identical IDs.
I kindly request assistance in resolving this issue. Specifically, we are interested in:
Changing the patient ID generation mechanism
Configuring automatic modification of duplicate IDs
Implementing an additional unique identifier
I would appreciate a consultation on possible solutions to this technical problem
It is not possible to modify an existing study, due to the immutable nature of DICOM, but this section of the Orthanc Book demonstrates how to generate a new resource based on the original one (in the Orthanc Book, the whole patient is modified but I assume that, due to your specific problem, you need to handle studies one by one)
Here’s how you can modify a study:
$ curl http://localhost:8042/studies/072f4557-6fa22bf0-6fb47ef5-f99515c1-3215aa29/modify -X POST -d '{"Replace":{"PatientID":"NewPatientId-12345","PatientName":"ThisPatientName"},"Force":true}'
The returned payload will contain the ID of a new study that is a duplicate of the original one, except for the modified patient info (all the study, series and instance Orthanc UUIDs will now be different)
Once this function returns, you may safely delete the original study (with a DELETE request to /studies/<ORIGINAL STUDY ID>
If you want to automate the process, you may add a Lua function, or Python plugin that will hook OnStableStudy and execute the requests.
If I am not mistaken, since the patient ID is not enforced to be a valid DICOM id, you may choose any random generation that suits you.