pydicom / dicom-validator

Simple DICOM validator based on DocBook DICOM specs
MIT License
25 stars 11 forks source link

Add validation of enumerated values #72

Closed mrbean-bremen closed 10 months ago

mrbean-bremen commented 10 months ago

Still to do:

codecov-commenter commented 10 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (9118c37) 89.31% compared to head (259d9dd) 89.66%.

Files Patch % Lines
dicom_validator/spec_reader/enum_parser.py 96.36% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #72 +/- ## ========================================== + Coverage 89.31% 89.66% +0.34% ========================================== Files 14 15 +1 Lines 1554 1625 +71 ========================================== + Hits 1388 1457 +69 - Misses 166 168 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dwikler commented 8 months ago

Hello @mrbean-bremen,
I comment on this issue rather than creating a new one because my question relates to the validation of enumerated values. I noticed that when multiple values are encoded for the MR Image Scanning Sequence attribute, an error is reported even if both values match the enumerated values. Here is the output:

Module "MR Image": Tag (0018,0020) (Scanning Sequence) value is not allowed (value: ['SE', 'EP'], allowed: SE, IR, GR, EP, RM)

Is the current implementation limited to single enumerated values?

Very nice work !

mrbean-bremen commented 8 months ago

Thanks for the report! The implementation of enum support is not complete yet, though I would consider that a bug - looks like I don't handle multi-valued attributes correctly. Feel free to write a separate issue for that. I don't have access to a computer right now (traveling), but I will have a closer look sometime next week.