The first two digits of the element number of a private tag indicates an offset by "Private Creator". Thus if you want to handle certain private tags, you need to specify it with masks as done in the safe private attributes in the dicom specification.
The current implementation doesn't support masks for private tags, and this PR enable it, with a test to illustrate the behavior.
At the same time, try-catch usage to get an element here seems overkill, since the element could well be removed as a normal course of action. I'd rather use if statement to check the existance of the element as done in the PR.
The first two digits of the element number of a private tag indicates an offset by "Private Creator". Thus if you want to handle certain private tags, you need to specify it with masks as done in the safe private attributes in the dicom specification.
The current implementation doesn't support masks for private tags, and this PR enable it, with a test to illustrate the behavior.
At the same time, try-catch usage to get an element here seems overkill, since the element could well be removed as a normal course of action. I'd rather use if statement to check the existance of the element as done in the PR.