Sensory Status[source]
The eds.sensory_status pipeline component extracts mentions of the sensory status.
Details of the used patterns
# fmt: off
from ..utils import make_status_assign, normalize_space_characters
healthy = dict(
source="healthy",
regex=[r"acuite (?:visuelle|auditive) normale"],
regex_attr="NORM",
)
severe = dict(
source="severe",
regex=[
r"\bcecite\b",
"aveugle",
"surdite",
],
regex_attr="NORM",
# We skip the blind spot and blinded studies, e.g. `en double aveugle`
exclude=dict(regex=[r"(?:tache|en|double)\s+aveugle"], window="words[-3:0]"),
)
altered = dict(
source="altered",
regex=[
r"appareillages? auditifs?",
r"baisse d'acuite visuelle",
],
regex_attr="NORM",
)
glasses = dict(
source="altered_glasses",
regex=["lunettes"],
regex_attr="NORM",
# We skip nasal cannulas for oxygen therapy, e.g. `O2 2 L/min aux lunettes`
exclude=dict(
regex=[
r"\b[0o]2\b",
"oxyg",
r"\bl\s*/\s*min",
r"\bvni\b",
"nasales?",
"optiflow",
],
window=(-10, 10),
),
)
mild = dict(
source="mild",
regex=[
"hypoacousie",
"presbyacousie",
"difficultes? visuelles?",
],
regex_attr="NORM",
)
assourdi = dict(
source="severe_assourdi",
regex=[
# The word boundaries keep surnames such as `Lesourd` out
r"\bsourde?s?\b",
],
exclude=dict(regex=[r"coeurs?", r"cardiaques?", r"douleurs?", "toux"], window=-3),
regex_attr="NORM",
)
bav = dict(
source="altered_bav",
regex=[r"\bBAV\b"],
exclude=dict(
regex=[
"pacemaker",
"coeur",
r"cardiaques",
"complet",
"nephrologue",
"cardiologue",
"degre",
# We skip atrioventricular blocks in ECG reports, e.g. `BAV 1`
r"\becg\b",
r"\bqrs\b",
"sinusal",
"holter",
"bradycard",
"conduction",
r"\bbav (?:[123]|i{1,3})\b",
],
window=(-15, 10),
regex_attr="NORM",
),
regex_attr="ORTH",
)
other = dict(
source="other",
regex=[
r"bilan ophtalmo(?:logique)?",
"avis ophtalmologique",
"examen ophtalmologique",
],
regex_attr="NORM",
)
status = dict(
source="other_status",
regex=[
"statut visuel",
"etat visuel",
"statut auditif",
"etat auditif",
"statut sensoriel",
"etat sensoriel",
],
regex_attr="NORM",
assign=make_status_assign(),
)
default_patterns = normalize_space_characters(
[
other,
healthy,
altered,
glasses,
mild,
severe,
assourdi,
bav,
status,
]
)
# fmt: on
Extensions
On each span span that match, the following attribute is available:
span._.sensory_status: set to None.
It will specify the severity of the mention regarding the sensory 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.sensory_status")
Below are a few examples:
text = "Patiente sourde"
doc = nlp(text)
spans = doc.spans["sensory_status"]
spans
# Out: [sourde]
span = spans[0]
span._.sensory_status
# Out: 'altered_severe'
text = "Coeur sourd"
doc = nlp(text)
spans = doc.spans["sensory_status"]
spans
# Out: []
Parameters
| PARAMETER | DESCRIPTION |
|---|---|
nlp | The pipeline TYPE: |
name | The name of the component TYPE: |
patterns | The patterns to use for matching TYPE: |
label | The label to use for the TYPE: |
span_setter | How to set matches on the doc TYPE: |