Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ The released versions correspond to PyPi releases.
`LoggingResultHandler`, including condition text, enum values, and invalid
sequences, and tag names are now ordered consistently with
`LoggingResultHandler`'s output
* mandatory tags in user defined modules that share tags with mandatory modules could be
reported as missing in some cases (see [#294](https://github.com/pydicom/dicom-validator/issues/294))

## [Version 0.8.3](https://pypi.python.org/pypi/dicom-validator/0.8.3) (2026-08-28)
Changed invalid sequence handling.
Expand Down
15 changes: 15 additions & 0 deletions dicom_validator/tests/validator/test_iod_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,3 +845,18 @@ def test_recursive_reference(self, validator):
assert not has_tag_error(
result, "SR Document Content", 0x0040_A050, ErrorCode.TagMissing
)

@pytest.mark.tag_set(
{
"SOPClassUID": uid.MultiFrameTrueColorSecondaryCaptureImageStorage,
"NumberOfFrames": "3",
"FrameIncrementPointer": 0x0018_2001,
"PageNumberVector": "1\\2\\3",
"InstanceNumber": "1",
}
)
def test_optional_functional_group_module(self, validator):
result = validator.validate()
assert not has_tag_error(
result, "Multi-frame Functional Groups", 0x5200_9229, ErrorCode.TagMissing
)
5 changes: 3 additions & 2 deletions dicom_validator/validator/iod_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def _validate_module(
# So, let's see if it exists "strongly" enough to be considered
# for further checks.
if maybe_existing_modules and not self._does_module_strongly_exist(
cast(str, module["ref"]), maybe_existing_modules
module["ref"], maybe_existing_modules
):
return {}

Expand Down Expand Up @@ -624,10 +624,11 @@ def _does_module_strongly_exist(
a_module_ref: str, maybe_existing_modules: dict[str, set[DicomTag]]
) -> bool:
a_tags = maybe_existing_modules[a_module_ref]
tags_only_in_a = a_tags.copy()
for b_ref, b_tags in maybe_existing_modules.items():
if b_ref == a_module_ref:
continue
tags_only_in_a = a_tags - (a_tags & b_tags)
tags_only_in_a -= b_tags
if len(tags_only_in_a) == 0:
return False
return True
Expand Down