Skip to content

Return the abstract syntax in the presentation_contexts() method#687

Merged
Enet4 merged 2 commits intoEnet4:masterfrom
pgimeno4d:add-abstract-syntax-to-pc
Sep 25, 2025
Merged

Return the abstract syntax in the presentation_contexts() method#687
Enet4 merged 2 commits intoEnet4:masterfrom
pgimeno4d:add-abstract-syntax-to-pc

Conversation

@pgimeno4d
Copy link
Copy Markdown
Contributor

@pgimeno4d pgimeno4d commented Sep 17, 2025

This is finally a fix for #683 that I'm comfortable with. The only problem is that it's a breaking change.

The return type of presentation_contexts() is now &[PresentationContextNegotiated], and includes the abstract syntax that was negotiated on each PC. The PresentationContextResult struct remains for protocol handling. This avoids kludges such as using None for the field during internal handling, or adding another separate vector to relate abstract syntax and PC ID.

A broken (or rogue) server may return PC IDs that are not in the list of PCs proposed by the client. These are now filtered out, as it would be impossible to assign an abstract syntax to them.

This adds a description in the docs to PresentationContextResult, while on it.

Fixes #683.

This is a breaking change.

The presentation_contexts() method now returns a vector of a new PresentationContextNegotiated struct which includes all fields that were in PresentationContextResult, plus a new abstract_syntax String field, and the old PresentationContextResult stays for messaging only.

The client can no longer return presentation context entries sent by a broken server that include an ID that was not among the ones proposed.
@Enet4 Enet4 added breaking change Hint that this may require a major version bump on release A-lib Area: library C-ul Crate: dicom-ul labels Sep 18, 2025
@Enet4 Enet4 self-requested a review September 18, 2025 10:37
@Enet4
Copy link
Copy Markdown
Owner

Enet4 commented Sep 18, 2025

This looks rather sound and not too complicated, so I would say it's fine to enter in 0.9.0.

@Enet4 Enet4 added this to the DICOM-rs 0.9 milestone Sep 18, 2025
Copy link
Copy Markdown
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will go ahead and merge, getting us closer to 0.9.0. Thanks! 👍

@Enet4 Enet4 merged commit 2278d26 into Enet4:master Sep 25, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lib Area: library breaking change Hint that this may require a major version bump on release C-ul Crate: dicom-ul

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide means for obtaining abstract syntaxes from ServerAssociation

2 participants