Skip to content

Resolve an attribute in context

Use contextual resolution to answer questions such as “What type is Modality in the CT Image IOD?” A PS3.6 data-element row alone cannot answer that question.

The knowledge base should include:

  • PS3.3 IOD, module, macro, and attribute-use structures;
  • PS3.4 SOP Class links when resolving by SOP Class;
  • PS3.6 data elements.
Terminal window
EDITION=2025e # Replace with your concrete edition.
uv run dicom-kb resolve attribute-context Modality \
--iod 'CT Image' \
--edition "$EDITION"

The documented alias is equivalent:

Terminal window
EDITION=2025e # Replace with your concrete edition.
uv run dicom-kb context attribute Modality \
--iod 'CT Image' \
--edition "$EDITION"
Terminal window
EDITION=2025e # Replace with your concrete edition.
uv run dicom-kb resolve attribute-context Modality \
--sop-class 'CT Image Storage' \
--edition "$EDITION"

The SOP Class is first resolved through the imported PS3.4 graph to its applicable IOD context.

  1. Confirm the data element matched the intended tag or keyword.
  2. Inspect every applicable attribute-use row.
  3. Distinguish each row’s declared type from the top-level effective_type.
  4. Read the explanation and condition text.
  5. Inspect warnings and references.
  6. Check classification.machine_decidability.

The resolver only reports effective_type when it can make a bounded determination from parsed rows:

  • One applicable use returns its declared type.
  • Multiple applicable uses are compared using the DICOM lowest-type rule.
  • Matched descriptions and condition text are inspected for bounded explicit override language such as “shall be Type 1.”
  • A deterministic explicit override can take precedence.
  • Conflicting or ambiguous override prose leaves effective_type null.
  • Source-reference warnings identify the unresolved boundary.

The response is classified as partially decidable even when a value is returned because the broader condition semantics can require implementation or instance context beyond the parser.

Do not choose the strictest or most convenient type from memory.

Instead:

  1. preserve the matched use rows and warnings;
  2. follow the returned refs;
  3. retrieve a bounded cited excerpt when explanation is needed;
  4. state that the project could not make a unique machine decision.

A safe synthesis instruction is:

Use only the returned attribute-use rows and references. Report effective_type
when non-null. When it is null, describe the ambiguity and do not infer a
normative type.

Pass the full response envelope rather than a flattened result.

  • validation_error: the attribute identifier is malformed.
  • not_found: the data element or requested context did not resolve.
  • candidates or warnings: more than one context or use remains plausible.
  • null effective_type: no bounded unique decision was available.

These outcomes are part of the public contract, not parser crashes.