medkit.text.ner.tnm_attribute
=============================

.. py:module:: medkit.text.ner.tnm_attribute


Classes
-------

.. autoapisummary::

   medkit.text.ner.tnm_attribute.TNMAttribute


Module Contents
---------------

.. py:class:: TNMAttribute(prefix: edsnlp.pipelines.ner.tnm.model.Prefix | None = None, tumour: edsnlp.pipelines.ner.tnm.model.Tumour | None = None, tumour_specification: edsnlp.pipelines.ner.tnm.model.Specification | None = None, tumour_suffix: str | None = None, node: edsnlp.pipelines.ner.tnm.model.Node | None = None, node_specification: edsnlp.pipelines.ner.tnm.model.Specification | None = None, node_suffix: str | None = None, metastasis: edsnlp.pipelines.ner.tnm.model.Metastasis | None = None, resection_completeness: int | None = None, version: str | None = None, version_year: int | None = None, metadata: dict[str, Any] | None = None, uid: str | None = None)

   Bases: :py:obj:`medkit.core.Attribute`


   
   Attribute destructuring the fields of a TNM string.

   The TNM (Tumour/Node/Metastasis) system is used to describe cancer stages.

   This class is replicating EDS-NLP's `TDM` class, making it a medkit
   :class:`Attribute`.


   :Attributes:

       **uid:**
           Identifier of the attribute

       **label:**
           The attribute label, always set to :attr:`TNMAttribute.LABEL`

       **value:**
           Normalized string representation of the TNM (ex: "pTxN1M1")

       **tumour:**
           Tumour score

       **tumour_specification:**
           Tumour specification

       **tumour_suffix:**
           Tumour suffix

       **node:**
           Node score

       **node_specification:**
           Node specification

       **node_suffix:**
           Node suffix

       **metastasis:**
           Metastasis score

       **resection_completeness:**
           Resection completeness (R factor)

       **version:**
           Version (ex: "uicc", "accj")

       **version_year:**
           Version year













   ..
       !! processed by numpydoc !!

   .. py:attribute:: prefix
      :type:  edsnlp.pipelines.ner.tnm.model.Prefix | None


   .. py:attribute:: tumour
      :type:  edsnlp.pipelines.ner.tnm.model.Tumour | None


   .. py:attribute:: tumour_specification
      :type:  edsnlp.pipelines.ner.tnm.model.Specification | None


   .. py:attribute:: tumour_suffix
      :type:  str | None


   .. py:attribute:: node
      :type:  edsnlp.pipelines.ner.tnm.model.Node | None


   .. py:attribute:: node_specification
      :type:  edsnlp.pipelines.ner.tnm.model.Specification | None


   .. py:attribute:: node_suffix
      :type:  str | None


   .. py:attribute:: metastasis
      :type:  edsnlp.pipelines.ner.tnm.model.Metastasis | None


   .. py:attribute:: resection_completeness
      :type:  int | None


   .. py:attribute:: version
      :type:  str | None


   .. py:attribute:: version_year
      :type:  int | None


   .. py:attribute:: LABEL
      :type:  ClassVar[str]
      :value: 'TNM'


      
      Label used for all TNM attributes
















      ..
          !! processed by numpydoc !!


   .. py:method:: to_brat() -> str

      
      Return a value compatible with the brat format.
















      ..
          !! processed by numpydoc !!


   .. py:method:: to_spacy() -> str

      
      Return a value compatible with spaCy.
















      ..
          !! processed by numpydoc !!


   .. py:method:: to_dict() -> dict[str, Any]


   .. py:method:: from_dict(tnm_dict: dict[str, Any]) -> typing_extensions.Self
      :classmethod:


      
      Create an Attribute from a dict.


      :Parameters:

          **attribute_dict: dict of str to Any**
              A dictionary from a serialized Attribute as generated by to_dict()














      ..
          !! processed by numpydoc !!


