class documentation

class Subsites:

View In Hierarchy

All tumor subsites as ICD-10 codes with the respective names.

This container class for all the subsite ICD enums provides the convenience of accessing all subsites in a single place. One may use it as follows:

>>> Subsites.Tongue.C02_0.label
'Dorsal surface of tongue'
>>> Subsites.Gum.choices   # doctest: +NORMALIZE_WHITESPACE
[('C03', 'Gum'),
 ('C03.0', 'Upper gum'),
 ('C03.1', 'Lower gum'),
 ('C03.9', 'Gum, unspecified')]
>>> Subsites.all_values()   # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
['C01', 'C01.9', ..., 'C32.9']
Class BaseOfTongue Tumor subsites in the base of the tongue.
Class Cheek Tumor subsites in the gums and cheeks.
Class FloorOfMouth Tumor subsites in the floor of the mouth.
Class Gum Tumor subsites in the gums.
Class Hypopharynx Tumor subsites in the rest of the hypopharynx.
Class Larynx Tumor subsites in the rest of the larynx.
Class Oropharynx Tumor subsites in the rest of the oropharynx.
Class Palate Tumor subsites in the palate.
Class Tongue Tumor subsites in the tongue.
Class Tonsil Tumor subsites in the tonsils.
Class Method all_choices Return concatenated choices list of all subsites.
Class Method all_values Return concatenated values list of all subsites.
Class Method get_subsite_enums Return a dictionary of all subsite enums.
@classmethod
def all_choices(cls) -> list[tuple[str, str]]:

Return concatenated choices list of all subsites.

@classmethod
def all_values(cls) -> list[str]:

Return concatenated values list of all subsites.

@classmethod
def get_subsite_enums(cls) -> dict[str, models.enums.ChoicesMeta]:

Return a dictionary of all subsite enums.

Note that the keys are the subsite names in snake case. E.g., BaseOfTongue would become base_of_tongue. This is done by the convert_camel_to_snake helper function.

>>> Subsites.get_subsite_enums().keys()   # doctest: +NORMALIZE_WHITESPACE
dict_keys(['base_of_tongue', 'tongue', 'gum', 'floor_of_mouth', 'palate',
           'cheek', 'glands', 'tonsil', 'oropharynx', 'hypopharynx', 'larynx'])