Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation of enumerated values #72

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

mrbean-bremen
Copy link
Member

Still to do:

  • values depending on a condition
  • single values not defined in an enumeration ("value shall be...")
  • probably more...

- directly mentioned and linked values are handled,
  some indirectly defined values are not handled yet
@codecov-commenter
Copy link

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 ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mrbean-bremen mrbean-bremen merged commit 4b23b82 into pydicom:main Jan 7, 2024
16 checks passed
@dwikler
Copy link

dwikler commented Mar 27, 2024

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
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants