Skip to content

Peripheral vascular disease[source]

The eds.peripheral_vascular_disease pipeline component extracts mentions of peripheral vascular disease.

Details of the used patterns
# fmt: off
from ..terms import ASYMPTOMATIC, BRAIN, HEART, PERIPHERAL

acronym = dict(
    source="acronym",
    regex=[
        r"\bAOMI\b",
        r"\bACOM\b",
        r"\bTAO\b",
        r"\bSAPL\b",
        r"\bOACR\b",
        r"\bOVCR\b",
        r"\bSCS\b",
        r"\bTVP\b",
        r"\bCAPS\b",
        r"\bMTEV\b",
        r"\bPTT\b",
        r"\bMAT\b",
        r"\bSHU\b",
    ],
    regex_attr="TEXT",
)

other = dict(
    source="other",
    regex=[
        r"\bbuerger",
        r"takayasu",
        r"\bhorton",
        r"wegener",
        r"churg.{1,10}strauss",
        r"\bsneddon",
        r"budd.chiari",
        r"infarctus.{1,5}(renal|splenique|polaire|pulmo)",
        r"ulcere.{1,5}arter",
        r"syndrome.?hemolytique.{1,8}uremique",
        r"granulomatose.{1,10}polyangeite",
        r"occlusion.{1,10}(artere|veine).{1,20}retine",
        r"syndrome.{1,20}anti.?phospho",
        r"embolie.{1,5}pulm",
    ],
    regex_attr="NORM",
)

with_localization = dict(
    source="with_localization",
    regex=[
        r"angiopathie",
        r"arteriopathies.{1,5}obliterante",
        r"gangren",
        r"claudication",
        r"dissection.{1,10}(aort|arter)",
        r"tromboangeit",
        r"tromboarterit",
        r"(pontage|angioplastie).{1,10}(\bfem|\bpop|\bren|\bjamb)",
        r"arterite",
        r"(ischemie|infarctus).{1,10}mesenterique",
        r"endarteriectomie",
        r"vascularite",
        r"occlusion.{1,10}terminaisons? carotid",
        r"cryoglobulinemie",
        r"colite.{1,5}ischemi",
        r"embole.{1,10}cholesterol",
        r"purpura.?thrombopenique.?idiopa",
        r"micro.?angiopathie.?thrombotique",
    ],
    exclude=[
        dict(
            regex=BRAIN + HEART + ASYMPTOMATIC + [r"inr\srecommande\ssous\savk"],
            window=(-8, 8),
            limit_to_sentence=False,
        ),
    ],
    regex_attr="NORM",
)

thrombosis = dict(
    source="thrombosis",
    regex=[
        r"thrombos",
        r"thrombol[^y]",
        r"thrombophi",
        r"thrombi[^n]",
        r"thrombus",
        r"thrombectomi",
        r"thrombo.?embo",
        r"phlebit",
    ],
    exclude=[
        dict(
            regex=BRAIN + HEART + ["superficiel", "\biv\b", "intra.?vein"],
            window=(-15, 15),
            limit_to_sentence=False,
        ),
        dict(
            regex=[
                "pre",
                "anti",
                "bilan",
            ],
            window=-4,
        ),
    ],
    regex_attr="NORM",
)


ischemia = dict(
    source="ischemia",
    regex=[
        r"ischemi",
    ],
    exclude=[
        dict(
            regex=BRAIN + HEART,
            window=(-7, 7),
        ),
    ],
    assign=[
        dict(
            name="peripheral",
            regex="(" + r"|".join(PERIPHERAL) + ")",
            window=15,
        ),
    ],
    regex_attr="NORM",
)

ep = dict(
    source="ep",
    regex=r"\bEP(?![\w\./-])",
    regex_attr="TEXT",
    exclude=[
        dict(
            regex=[
                r"fibreux",
                r"retin",
                r"\bfove",
                r"\boct\b",
                r"\bmacula",
                r"prosta",
                r"\bip\b",
                r"protocole",
                r"seance",
                r"echange",
                r"ritux",
                r"ivig",
                r"ig.?iv",
                r"\bctc",
                r"corticoide",
                r"serum",
                r"\bcure",
                r"plasma",
                r"mensuel",
                r"semaine",
                r"serologi",
                r"espaces.porte",
                r"projet",
                r"bolus",
            ],
            window=(-25, 25),
            limit_to_sentence=False,
            regex_attr="NORM",
        ),
        dict(
            regex=[r"rdv", r"les", r"des", r"angine"],
            window=(-3, 0),
            regex_attr="NORM",
        ),
    ],
)

hypertension = dict(
    source="main",
    regex=[
        r"\bhta\b",
        r"hyper.?tension.?arte",
        r"hyper.?tendu",
        r"hyper.?tension.?essenti",
        r"hypertensi",
    ],
    exclude=dict(
        regex="(pulmo|porta)",
        window=3,
    ),
)

default_patterns = [
    acronym,
    other,
    with_localization,
    thrombosis,
    ep,
    ischemia,
    hypertension,
]
# fmt: on

Extensions

On each span span that match, the following attributes are available:

  • span._.detailed_status: set to None

Examples

import edsnlp, edsnlp.pipes as eds

nlp = edsnlp.blank("eds")
nlp.add_pipe(eds.sentences())
nlp.add_pipe(
    eds.normalizer(
        accents=True,
        lowercase=True,
        quotes=True,
        spaces=True,
        pollution=dict(
            information=True,
            bars=True,
            biology=True,
            doctors=True,
            web=True,
            coding=True,
            footer=True,
        ),
    ),
)
nlp.add_pipe(eds.peripheral_vascular_disease())

Below are a few examples:

text = "Un AOMI"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: [AOMI]
text = "Présence d'un infarctus rénal"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: [infarctus rénal]
text = "Une angiopathie cérébrale"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: []
text = "Une angiopathie"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: [angiopathie]
text = "Une thrombose cérébrale"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: []
text = "Une thrombose des veines superficielles"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: []
text = "Une thrombose"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: [thrombose]
text = "Effectuer un bilan pre-trombose"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: []
text = "Une ischémie des MI est remarquée."
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: [ischémie des MI]

span = spans[0]

span._.assigned
# Out: {'peripheral': [MI]}
text = "Plusieurs cas d'EP"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: [EP]
text = "Effectuer des cures d'EP"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: []
text = "Le patient est hypertendu"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: [hypertendu]
text = "Une hypertension portale"
doc = nlp(text)
spans = doc.spans["peripheral_vascular_disease"]

spans
# Out: []

Parameters

PARAMETER DESCRIPTION
nlp

The pipeline

TYPE: Optional[PipelineProtocol]

name

The name of the component

TYPE: Optional[str] DEFAULT: 'peripheral_vascular_disease'

patterns

The patterns to use for matching

TYPE: Union[Dict[str, Any], List[Dict[str, Any]]] DEFAULT: [{'source': 'acronym', 'regex': ['\\bAOMI\\b', ...

label

The label to use for the Span object and the extension

TYPE: str DEFAULT: peripheral_vascular_disease

span_setter

How to set matches on the doc

TYPE: SpanSetterArg DEFAULT: {'ents': True, 'peripheral_vascular_disease': T...

Authors and citation

The eds.peripheral_vascular_disease component was developed by AP-HP's Data Science team with a team of medical experts, following the insights of the algorithm proposed by Petit-Jean et al., 2024.


  1. Petit-Jean T., Gérardin C., Berthelot E., Chatellier G., Frank M., Tannier X., Kempf E. and Bey R., 2024. Collaborative and privacy-enhancing workflows on a clinical data warehouse: an example developing natural language processing pipelines to detect medical conditions. Journal of the American Medical Informatics Association. 31, pp.1280-1290. 10.1093/jamia/ocae069