Closed joshy closed 2 years ago
It's true that the processing rule will become invalid if it contains a tag that is not contained in the .tags file. However, this should not be an issue in practice. If a specific DICOM tag is not contained in a DICOM file, the getdcmtags module will still create an (empty-valued) entry in the .tags file. Thus, there should always be an entry in the .tags file for all possible tags (i.e. all tags that have been defined in the file main.cpp of the getdcmtags module).
In the new version, the Rule Tester now features a drag-and-drop mechanism, which can be used for testing if a rule works as expected, by dragging different DICOM files onto the UI. If a tag is missing in DICOM files, it will be replaced with a default value. Thus, also in the UI, the problem should not really occur anymore (except if explicitly deleting entries from the Test Values control, but I'd say that it's reasonable if the Rule Tester shows an error in that case).
Forgot that if the DICOM tag is not found the getdcmtags module will still create a empty-valued entry.
Describe the bug Not all tags can be used always. For example if the @ContrastBolusAgent@ tag is missing because it is a series without contrast agent the ui signals an error:
Invalid rule: invalid syntax (, line 1)
.This behavior happens on the old hermes installation but I suppose on mercure the behavior is the same.
To Reproduce Steps to reproduce the behavior:
Additional context After the rule tag replacement is done (https://github.com/mercure-imaging/mercure/blob/master/common/rule_evaluation.py#41), the rule string still contains @ContrastBolusAgent@ which leads to an error. So after the rule tag replacement step is done, another search and replacement for tags is needed. Tags still found needs to be replaced by either False or 0. This is just a proposal, maybe there is a better way to handle it.
BR Joshy