Ensure Error, when recipe var/func is missing
Dear deid Team, thank you for the great work you have put into this package.
We are looking to use this package to deidentify large amounts of clinical data for a research PACS.
We mostly use replace_identifiers()
Is there any way to make sure that all var:s and func:s are present when running this. At the moment we see that it just runs and does not replace values if the respective var: is not present.
Is there a way to make sure an error is thrown if this is the case.
Additional info:
- using the current version of deid with Python 3.12
- can provide MWE if that helps
- would be willing to provide pull request if the feature does not exist and you are open to outside input.
Yes! Generally speaking you'd want to have a regular expression that matches that case here: https://github.com/pydicom/deid/blob/14d1e4eb70f2c9fda43fca411794be9d8a5a8516/deid/utils/actions.py#L32 and then throw an error when the particular name for the function is missing, or if the name is not found in "item." I'd be happy to review a PR for that, and a test could go here.
Do i understand you correctly, that strict enforcement of these values is currently not implemented yet?
Then I'll start working on a PR with the hints you gave.