Skip to content

Incontinence Status[source]

The eds.incontinence_status pipeline component extracts mentions of the incontinence_status.

Details of the used patterns
# fmt: off
from ..utils import normalize_space_characters

healthy = dict(
    source="healthy",
    regex=[
        r"\bcontinen(te?|ce)",
    ],
    regex_attr="NORM",
)
severe = dict(
    source="severe",
    regex=[
        r"\bsad\b",
        "sonde a demeure",
        "sonde urinaire",
        r"sonde vesicale?",
        "sondage urinaire",
        "sondage vesical",
        r"sondages? allers?[\s-]retours?",
    ],
    regex_attr="NORM",
)
altered = dict(
    source="altered",
    regex=[
        r"fuites? (anales?|urinaires?)",
        r"incontinente?",
        "incontinence",
        r"pollakiurie nocturne",
        "urgenterie",
        r"globe (?:urinaire|vesicale?)",
        r"troubles? sphincteriens?",
        r"incontinence(?: urinaire| anale)?",
        r"signe fonctionnel urinaire",
        r"dysurie",
        r"retention d'urines?",
        r"\bsfu\b",
        "miction difficile",
    ],
    regex_attr="NORM",
    exclude=dict(
        regex="aigue?s?",
        window=(-3, 3),
    ),
)
severe_lower = dict(source="severe_lower", regex=[r"\bcouches?\b"], regex_attr="LOWER")
protection = dict(
    source="other_protection",
    regex=["protection"],
    exclude=dict(
        regex=[
            "juridique",
            "donnees",
            "tutelle",
            "curatelle",
        ],
        window=5,
    ),
)

lever_nocturne = dict(
    source="mild_noturnal",
    regex=["lever nocturne"],
    regex_attr="NORM",
    assign=dict(name="urinate", regex="(uriner)", window=5, required=True),
)

other = dict(
    source="other",
    regex=[
        "miction spontanee",
        r"reeducation vesicale",
        r"chaise percee",
    ],
    regex_attr="NORM",
)

default_patterns = normalize_space_characters(
    [
        healthy,
        altered,
        severe,
        other,
        severe_lower,
        protection,
        lever_nocturne,
    ]
)

# fmt: on

Extensions

On each span span that match, the following attribute is available:

  • span._.incontinence_status: set to None.

It will specify the severity of the mention regarding the incontinence status of the patient.

Possible values are:

  • healthy : this span suggests the patient is well regarding that domain.
  • altered_nondescript : this span suggests the patient is not well, but it is not yet possible to ascertain the degree of alteration.
  • altered_mild : this span suggests a light alteration regarding this domain.
  • altered_severe : this span suggests a severe alteration regarding this domain.
  • other : this span is not indicative of the level of alteration regarding this domain. Still, it hints that this domain has been evaluated.

Examples

import edsnlp, edsnlp.pipes as eds

nlp = edsnlp.blank("eds")
nlp.add_pipe(eds.sentences())
nlp.add_pipe(eds.normalizer())
nlp.add_pipe(f"eds.incontinence_status")

Below are a few examples:

Parameters

PARAMETER DESCRIPTION
nlp

The pipeline

TYPE: Optional[PipelineProtocol]

name

The name of the component

TYPE: Optional[str] DEFAULT: incontinence_status

patterns

The patterns to use for matching

TYPE: FullConfig DEFAULT: [{'source': 'healthy', 'regex': ['\\bcontinen(t...

label

The label to use for the Span object and the extension

TYPE: str DEFAULT: incontinence_status

span_setter

How to set matches on the doc

TYPE: SpanSetterArg DEFAULT: {'ents': True, 'incontinence_status': True}