CID validation for coded concepts.
Validates whether a Dicom.SR.Code is a member of a DICOM Context Group (CID).
Non-extensible CIDs reject codes not in the defined set; extensible CIDs accept
any code but signal it via {:ok, :extensible}.
Summary
Functions
Returns whether a context group is extensible.
Returns the name of a context group.
Returns the number of context groups in the registry.
Returns true if the code is valid for the given CID.
Validates a code against a context group.
Types
Functions
@spec extensible?(non_neg_integer()) :: boolean() | :error
Returns whether a context group is extensible.
@spec name(non_neg_integer()) :: {:ok, String.t()} | :error
Returns the name of a context group.
@spec size() :: non_neg_integer()
Returns the number of context groups in the registry.
@spec valid?(Dicom.SR.Code.t(), non_neg_integer()) :: boolean()
Returns true if the code is valid for the given CID.
A code is valid if it is a defined member or the CID is extensible.
@spec validate(Dicom.SR.Code.t(), non_neg_integer()) :: validation_result()
Validates a code against a context group.
Returns:
:ok— code is a defined member of the CID{:ok, :extensible}— code is not in the CID but the CID is extensible{:error, :not_in_cid}— code is not in a non-extensible CID{:error, :unknown_cid}— CID does not exist in the registry