Actions
Feature #1076
openOnly process dcmodify operations in case of user-specific conditions
Start date:
2023-05-30
Due date:
% Done:
0%
Estimated time:
Module:
dcmdata
Operating System:
Compiler:
Description
dcmodify executes the operations provided by the user (like -i, -m, -e) in any case. It would be nice to sometimes only run the operations if certain conditions are fulfilled, e.g. if the Patient ID is set to specific value.
Thus something like the following would be nice:
dcmodify -m PatientName="Onken^Michael" -iff "PatientID=4711" -i PatientSex=M
This would only modify the patient and set patient sex if Patient ID equals 4711. Note that one could provide multiple -iff options at once (logical AND). The position of the options do not matter, only if they are all true, then the remaining call is executed.
Notes:- Path syntax (see dcmodify man page) support would be nice, at least without wildcards
- In the above syntax "=" was used instead of "==" since there is already parsing code for the "=" syntax, and it is shorter
- Various other operators could be possible: "!=" for not equal, -iff PatientName for "if patient name tag is present), -iff PatientName="" for "if patient name is empty". Also an option -ifn for "if not" could handle the negative case, instead of adding extra operators for that. Maybe even operators <, >, <=, >= would be cool.
Updated by Michael Onken over 2 years ago
The option is named -iff instead of -if since the latter is already used for "insert from file" in dcmodify, and -iff is still quite easy to remember ("if and only if").
Updated by Jörg Riesmeier about 1 year ago
- Target version changed from 3.7.1+ to 3.6.9
Updated by Jörg Riesmeier 9 months ago
- Assignee set to Tingyan Xu
- Target version changed from 3.6.9 to 3.7.1+
Actions