DCMTK: DSRContextGroup Class Reference

DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
DSRContextGroup Class Reference

Class managing common information on a context group. More...

Inheritance diagram for DSRContextGroup:

## Public Member Functions
| operator const DSRCodedEntryValue & () const
| conversion operator that returns the currently selected coded entry value (might be empty if none is selected)
virtual void | clear ()
| clear list of extended coded entries and forget about the currently selected coded entry
OFBool | isExtensible () const
| check whether context group is extensible
void | setExtensible (const OFBool mode=OFTrue)
| change mode specifying whether the context group is extensible or non-extensible
const OFString & | getIdentifier () const
| get context identifier
const OFString & | getMappingResource () const
| get mapping resource
const OFString & | getKeyword () const
| get context group keyword
const OFString & | getVersion () const
| get context group version (optional)
const OFString & | getUID () const
| get context group UID (optional)
virtual OFBool | hasSelectedValue () const
| check whether a coded entry is selected as the current value
const DSRCodedEntryValue & | getSelectedValue () const
| get currently selected coded entry value (optional)
virtual OFCondition | selectValue (const DSRCodedEntryValue &codedEntryValue, const OFBool check=OFTrue, const OFBool definedContextGroup=OFFalse)
| select a given coded entry as the current value
virtual OFBool | hasCodedEntry (const DSRCodedEntryValue &codedEntryValue) const
| check whether a given coded entry is contained in this context group.
virtual OFCondition | findCodedEntry (const DSRCodedEntryValue &codedEntryValue) const
| search for a given coded entry in this context group.
virtual OFBool | hasExtendedCodedEntries () const
| check whether this context group has any extended coded entries.
virtual OFCondition | addCodedEntry (const DSRCodedEntryValue &codedEntryValue)
| add a coded entry to this context group as an extension, i.e. as a non-standard code.
virtual OFCondition | lookupCodedEntry (DSRCodedEntryValue &codedEntryValue, const OFBool enhancedEncodingMode=OFFalse) const
| search for a given coded entry in this context group and, if found, replace its value with the one found in the context group.
virtual void | print (STD_NAMESPACE ostream &stream) const
| print contents of this context group, i.e. a general header, the currently selected coded entry value (if any) and all coded entries that are contained in this context group (both standard and extended ones).
virtual OFCondition | checkSelectedValue (const OFBool definedContextGroup=OFFalse) const
| check whether the currently selected coded entry is valid.

## Protected Member Functions
| DSRContextGroup (const OFString &contextIdentifier, const OFString &mappingResource, const OFString &contextGroupKeyword="", const OFString &contextGroupVersion="", const OFString &contextGroupUID="", const DSRCodedEntryValue &selectedValue=DSRCodedEntryValue())
| constructor
virtual | ~DSRContextGroup ()
| destructor
virtual void | printHeader (STD_NAMESPACE ostream &stream) const
| print header with some general information on this context group
virtual void | printCodes (STD_NAMESPACE ostream &stream) const
| print details on coded entries that are contained in this context group.
virtual OFCondition | findCodedEntry (const DSRCodedEntryValue &searchForCodedEntry, DSRCodedEntryValue *foundCodedEntry, const OFBool enhancedEncodingMode=OFFalse) const
| search for a given coded entry in this context group
virtual OFCondition | checkCodedEntry (const DSRCodedEntryValue &codedEntryValue, const OFBool definedContextGroup) const
| check whether a given coded entry is valid.

## Private Types
typedef OFList< DSRCodedEntryValue > | CodeList
| type used for storing and managing coded entries

## Private Attributes
const OFString | Identifier
| context identifier (VR=CS, mandatory)
const OFString | MappingResource
| mapping resource (VR=CS, mandatory)
const OFString | Keyword
| context group keyword (optional)
const OFString | Version
| context group version (VR=DT, optional)
const OFString | UID
| context group UID (VR=UI, optional)
DSRCodedEntryValue | SelectedValue
| coded entry selected as the current value (optional, might be empty)
OFBool | ExtensibleMode
| mode indicating whether context group is extensible (default: false)
CodeList | ExtendedCodes
| extended coded entries (e.g. private or implementation-specific ones)

## Detailed Description

Class managing common information on a context group.

This class is used as a base class only.

## Constructor & Destructor Documentation

## ◆ DSRContextGroup()

DSRContextGroup::DSRContextGroup | ( | const OFString & | contextIdentifier,
|  | const OFString & | mappingResource,
|  | const OFString & | contextGroupKeyword = "",
|  | const OFString & | contextGroupVersion = "",
|  | const OFString & | contextGroupUID = "",
|  | const DSRCodedEntryValue & | selectedValue = DSRCodedEntryValue() )
| protected

constructor

Parameters

  contextIdentifier | identifier of the context group
  mappingResource | mapping resource that defines the context group
  contextGroupKeyword | keyword of the context group (optional)
  contextGroupVersion | version of the context group (optional)
  contextGroupUID | unique identifier of the context group (optional)
  selectedValue | coded entry to be selected as the current value (optional)

## Member Function Documentation

## ◆ addCodedEntry()

virtual OFCondition DSRContextGroup::addCodedEntry | ( | const DSRCodedEntryValue & | codedEntryValue | ) |
| virtual

add a coded entry to this context group as an extension, i.e. as a non-standard code.

Adding a new coded entry by this method only works for extensible context groups. Please note that the 'codedEntryValue' is not checked for validity.

Parameters

  codedEntryValue | coded entry to be added to this context group

Returns
  status, EC_Normal if successful, an error code otherwise

## ◆ checkCodedEntry()

virtual OFCondition DSRContextGroup::checkCodedEntry | ( | const DSRCodedEntryValue & | codedEntryValue,
|  | const OFBool | definedContextGroup ) const
| protectedvirtual

check whether a given coded entry is valid.

Internally, the method hasCodedEntry() is used if 'definedContextGroup' is OFTrue.

Parameters

  codedEntryValue | coded entry to be checked
  definedContextGroup | flag indicating whether this context group is used as a baseline (default) or defined context group. The first means that the list of coded entries in this context group is just a suggestion. The latter means that one of the coded entries should be used.

Returns
  status, EC_Normal if either no coded entry is selected or the selected one is both valid and allowed for this context group, an error code otherwise

## ◆ checkSelectedValue()

virtual OFCondition DSRContextGroup::checkSelectedValue | ( | const OFBool | definedContextGroup = OFFalse | ) | const
| virtual

check whether the currently selected coded entry is valid.

Internally, the method hasCodedEntry() is used if 'definedContextGroup' is OFTrue.

Parameters

  definedContextGroup | flag indicating whether this context group is used as a baseline (default) or defined context group. The first means that the list of coded entries in this context group is just a suggestion. The latter means that one of the coded entries should be used.

Returns
  status, EC_Normal if either no coded entry is selected or the selected one is both valid and allowed for this context group, an error code otherwise

## ◆ findCodedEntry() [1/2]

virtual OFCondition DSRContextGroup::findCodedEntry | ( | const DSRCodedEntryValue & | codedEntryValue | ) | const
| virtual

search for a given coded entry in this context group.

If found, the type of the entry (standard or extension) is returned:

- SR_EC_CodedEntryInStandardContextGroup
- SR_EC_CodedEntryIsExtensionOfContextGroup

Parameters

  codedEntryValue | coded entry to be searched for

Returns
  result of the search process, SR_EC_CodedEntryNotInContextGroup if coded entry could not be found. Use OFCondition::good() or OFCondition::bad() if not interested in the type of the entry.

Reimplemented in CID10013_CTAcquisitionType, CID10033_CTReconstructionAlgorithm, CID100_QuantitativeDiagnosticImagingProcedure, CID11_AdministrationRoute, CID218_QuantitativeImageFeature, CID244_Laterality, CID247_LateralityLeftRightOnly, CID29_AcquisitionModality, CID4020_PETRadionuclide, CID4021_PETRadiopharmaceutical, CID4031_CommonAnatomicRegion, CID42_NumericValueQualifier, CID5000_Language, CID5001_Country, CID6147_ResponseCriteria, CID7021_MeasurementReportDocumentTitle, CID7181_AbstractMultiDimensionalImageModelComponentUnit, CID7445_DeviceParticipatingRole, CID7452_OrganizationalRole, CID7453_PerformingRole, CID7464_GeneralRegionOfInterestMeasurementModifier, CID7469_GenericIntensityAndSizeMeasurement, and CID7551_GenericPurposeOfReferenceToImagesAndCoordinatesInMeasurement.

Referenced by CID10013_CTAcquisitionType::getCodedEntry(), CID10033_CTReconstructionAlgorithm::getCodedEntry(), CID100_QuantitativeDiagnosticImagingProcedure::getCodedEntry(), CID11_AdministrationRoute::getCodedEntry(), CID218_QuantitativeImageFeature::getCodedEntry(), CID244_Laterality::getCodedEntry(), CID247_LateralityLeftRightOnly::getCodedEntry(), CID29_AcquisitionModality::getCodedEntry(), CID4020_PETRadionuclide::getCodedEntry(), CID4021_PETRadiopharmaceutical::getCodedEntry(), CID4031_CommonAnatomicRegion::getCodedEntry(), CID42_NumericValueQualifier::getCodedEntry(), CID5000_Language::getCodedEntry(), CID5001_Country::getCodedEntry(), CID6147_ResponseCriteria::getCodedEntry(), CID7021_MeasurementReportDocumentTitle::getCodedEntry(), CID7181_AbstractMultiDimensionalImageModelComponentUnit::getCodedEntry(), CID7445_DeviceParticipatingRole::getCodedEntry(), CID7452_OrganizationalRole::getCodedEntry(), CID7453_PerformingRole::getCodedEntry(), CID7464_GeneralRegionOfInterestMeasurementModifier::getCodedEntry(), CID7469_GenericIntensityAndSizeMeasurement::getCodedEntry(), and CID7551_GenericPurposeOfReferenceToImagesAndCoordinatesInMeasurement::getCodedEntry().

## ◆ findCodedEntry() [2/2]

virtual OFCondition DSRContextGroup::findCodedEntry | ( | const DSRCodedEntryValue & | searchForCodedEntry,
|  | DSRCodedEntryValue * | foundCodedEntry,
|  | const OFBool | enhancedEncodingMode = OFFalse ) const
| protectedvirtual

search for a given coded entry in this context group

Parameters

  searchForCodedEntry | coded entry to be searched for
  foundCodedEntry | pointer to variable that will store the coded entry (if found and pointer is not NULL)
  enhancedEncodingMode | set enhanced encoding mode for coded entry (not used for this class, only in derived classes)

Returns
  result of the search process, also defines the type of the entry

Reimplemented in CID10013_CTAcquisitionType, CID10033_CTReconstructionAlgorithm, CID100_QuantitativeDiagnosticImagingProcedure, CID11_AdministrationRoute, CID218_QuantitativeImageFeature, CID244_Laterality, CID247_LateralityLeftRightOnly, CID29_AcquisitionModality, CID4020_PETRadionuclide, CID4021_PETRadiopharmaceutical, CID4031_CommonAnatomicRegion, CID42_NumericValueQualifier, CID5000_Language, CID5001_Country, CID6147_ResponseCriteria, CID7021_MeasurementReportDocumentTitle, CID7181_AbstractMultiDimensionalImageModelComponentUnit, CID7445_DeviceParticipatingRole, CID7452_OrganizationalRole, CID7453_PerformingRole, CID7464_GeneralRegionOfInterestMeasurementModifier, CID7469_GenericIntensityAndSizeMeasurement, and CID7551_GenericPurposeOfReferenceToImagesAndCoordinatesInMeasurement.

## ◆ getIdentifier()

const OFString & DSRContextGroup::getIdentifier | ( |  | ) | const
| inline

get context identifier

Returns
  identifier of the context group

References Identifier.

## ◆ getKeyword()

const OFString & DSRContextGroup::getKeyword | ( |  | ) | const
| inline

get context group keyword

Returns
  keyword of the context group (might be empty)

References Keyword.

## ◆ getMappingResource()

const OFString & DSRContextGroup::getMappingResource | ( |  | ) | const
| inline

get mapping resource

Returns
  mapping resource that defines the context group

References MappingResource.

## ◆ getSelectedValue()

const DSRCodedEntryValue & DSRContextGroup::getSelectedValue | ( |  | ) | const
| inline

get currently selected coded entry value (optional)

Returns
  current value (might be empty if none is selected)

References SelectedValue.

Referenced by operator const DSRCodedEntryValue &().

## ◆ getUID()

const OFString & DSRContextGroup::getUID | ( |  | ) | const
| inline

get context group UID (optional)

Returns
  unique identifier of the context group (might be empty)

## ◆ getVersion()

const OFString & DSRContextGroup::getVersion | ( |  | ) | const
| inline

get context group version (optional)

Returns
  version of the context group (might be empty)

## ◆ hasCodedEntry()

virtual OFBool DSRContextGroup::hasCodedEntry | ( | const DSRCodedEntryValue & | codedEntryValue | ) | const
| virtual

check whether a given coded entry is contained in this context group.

Internally, the method findCodedEntry() is used for this purpose.

Parameters

  codedEntryValue | coded entry to be checked

Returns
  OFTrue if coded entry is part of this context group, OFFalse otherwise

## ◆ hasExtendedCodedEntries()

virtual OFBool DSRContextGroup::hasExtendedCodedEntries | ( |  | ) | const
| virtual

check whether this context group has any extended coded entries.

Extended coded entries are those non-standard codes added by addCodedEntry().

Returns
  OFTrue if there are any extended coded entries, OFFalse otherwise

## ◆ hasSelectedValue()

virtual OFBool DSRContextGroup::hasSelectedValue | ( |  | ) | const
| virtual

check whether a coded entry is selected as the current value

Returns
  OFTrue if a value is selected, OFFalse otherwise

## ◆ isExtensible()

OFBool DSRContextGroup::isExtensible | ( |  | ) | const
| inline

check whether context group is extensible

Returns
  OFTrue if extensible, OFFalse otherwise

References ExtensibleMode.

## ◆ lookupCodedEntry()

virtual OFCondition DSRContextGroup::lookupCodedEntry | ( | DSRCodedEntryValue & | codedEntryValue,
|  | const OFBool | enhancedEncodingMode = OFFalse ) const
| virtual

search for a given coded entry in this context group and, if found, replace its value with the one found in the context group.

This method can, therefore, be used to lookup the "official" code meaning or to set the "enhanced encoding mode".

Parameters

  codedEntryValue | coded entry to be searched for. Should be a valid code, i.e. at least the three mandatory components have to be non-empty. Also used to store the retrieved coded entry.
  enhancedEncodingMode | set enhanced encoding mode for coded entry (if enabled)

Returns
  result of the search process, see findCodedEntry() for details

## ◆ print()

virtual void DSRContextGroup::print | ( | STD_NAMESPACE ostream & | stream | ) | const
| virtual

print contents of this context group, i.e. a general header, the currently selected coded entry value (if any) and all coded entries that are contained in this context group (both standard and extended ones).

See DSRCodedEntryValue::print() for details of the coded entry output.

Parameters

  stream | stream to which the output should be printed

## ◆ printCodes()

virtual void DSRContextGroup::printCodes | ( | STD_NAMESPACE ostream & | stream | ) | const
| protectedvirtual

print details on coded entries that are contained in this context group.

See DSRCodedEntryValue::print() for details of the coded entry output.

Parameters

  stream | stream to which the output should be printed

Reimplemented in CID10013_CTAcquisitionType, CID10033_CTReconstructionAlgorithm, CID100_QuantitativeDiagnosticImagingProcedure, CID11_AdministrationRoute, CID218_QuantitativeImageFeature, CID244_Laterality, CID247_LateralityLeftRightOnly, CID29_AcquisitionModality, CID4020_PETRadionuclide, CID4021_PETRadiopharmaceutical, CID4031_CommonAnatomicRegion, CID42_NumericValueQualifier, CID5000_Language, CID5001_Country, CID6147_ResponseCriteria, CID7021_MeasurementReportDocumentTitle, CID7181_AbstractMultiDimensionalImageModelComponentUnit, CID7445_DeviceParticipatingRole, CID7452_OrganizationalRole, CID7453_PerformingRole, CID7464_GeneralRegionOfInterestMeasurementModifier, CID7469_GenericIntensityAndSizeMeasurement, and CID7551_GenericPurposeOfReferenceToImagesAndCoordinatesInMeasurement.

## ◆ printHeader()

virtual void DSRContextGroup::printHeader | ( | STD_NAMESPACE ostream & | stream | ) | const
| protectedvirtual

print header with some general information on this context group

Parameters

  stream | stream to which the output should be printed

## ◆ selectValue()

virtual OFCondition DSRContextGroup::selectValue | ( | const DSRCodedEntryValue & | codedEntryValue,
|  | const OFBool | check = OFTrue,
|  | const OFBool | definedContextGroup = OFFalse )
| virtual

select a given coded entry as the current value

Parameters

  codedEntryValue | coded entry to be selected as the current value
  check | if enabled, check 'codedEntryValue' for validity and appropriateness before selecting it as the current value. See checkSelectedValue() for details.
  definedContextGroup | flag indicating whether this context group is used as a baseline (default) or defined context group. The first means that the list of coded entries in this context group is just a suggestion. The latter means that one of the coded entries should be used.

Returns
  status, EC_Normal if successful, an error code otherwise

Reimplemented in CID10013_CTAcquisitionType, CID10013e_CTAcquisitionType, CID10033_CTReconstructionAlgorithm, CID10033e_CTReconstructionAlgorithm, CID100_QuantitativeDiagnosticImagingProcedure, CID11_AdministrationRoute, CID218_QuantitativeImageFeature, CID218e_QuantitativeImageFeature, CID244_Laterality, CID244e_Laterality, CID247_LateralityLeftRightOnly, CID29_AcquisitionModality, CID29e_AcquisitionModality, CID4020_PETRadionuclide, CID4021_PETRadiopharmaceutical, CID4031_CommonAnatomicRegion, CID4031e_CommonAnatomicRegion, CID42_NumericValueQualifier, CID5000_Language, CID5001_Country, CID6147_ResponseCriteria, CID7021_MeasurementReportDocumentTitle, CID7181_AbstractMultiDimensionalImageModelComponentUnit, CID7445_DeviceParticipatingRole, CID7452_OrganizationalRole, CID7453_PerformingRole, CID7464_GeneralRegionOfInterestMeasurementModifier, CID7469_GenericIntensityAndSizeMeasurement, and CID7551_GenericPurposeOfReferenceToImagesAndCoordinatesInMeasurement.

Referenced by CID10013_CTAcquisitionType::getCodedEntry(), CID10033_CTReconstructionAlgorithm::getCodedEntry(), CID100_QuantitativeDiagnosticImagingProcedure::getCodedEntry(), CID11_AdministrationRoute::getCodedEntry(), CID218_QuantitativeImageFeature::getCodedEntry(), CID244_Laterality::getCodedEntry(), CID247_LateralityLeftRightOnly::getCodedEntry(), CID29_AcquisitionModality::getCodedEntry(), CID4020_PETRadionuclide::getCodedEntry(), CID4021_PETRadiopharmaceutical::getCodedEntry(), CID4031_CommonAnatomicRegion::getCodedEntry(), CID42_NumericValueQualifier::getCodedEntry(), CID5000_Language::getCodedEntry(), CID5001_Country::getCodedEntry(), CID6147_ResponseCriteria::getCodedEntry(), CID7021_MeasurementReportDocumentTitle::getCodedEntry(), CID7181_AbstractMultiDimensionalImageModelComponentUnit::getCodedEntry(), CID7445_DeviceParticipatingRole::getCodedEntry(), CID7452_OrganizationalRole::getCodedEntry(), CID7453_PerformingRole::getCodedEntry(), CID7464_GeneralRegionOfInterestMeasurementModifier::getCodedEntry(), CID7469_GenericIntensityAndSizeMeasurement::getCodedEntry(), and CID7551_GenericPurposeOfReferenceToImagesAndCoordinatesInMeasurement::getCodedEntry().

## ◆ setExtensible()

void DSRContextGroup::setExtensible | ( | const OFBool | mode = OFTrue | ) |
| inline

change mode specifying whether the context group is extensible or non-extensible

Parameters

  mode | set context group type to extensible if OFTrue (default)

References ExtensibleMode.

The documentation for this class was generated from the following file:

- dcmsr/include/dcmtk/dcmsr/dsrctxgr.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.16.1