Skip to content

Suicide attempts

Presentation

We provide the tag_suicide_attempt() function to extract suicide attempts from ICD-10 codes.

The tag_suicide_attempt() function

from eds_scikit.io import HiveData
data = HiveData(DBNAME)
from eds_scikit.event import tag_suicide_attempt

visit_occurrence = tag_suicide_attempt(
    data.visit_occurrence,
    data.condition_occurrence,
    algo = "X60-X84",
)

Availables algorithms (values for "algo")

Returns the visits that have at least one ICD code that belongs to the range X60 to X84.

Returns the visits that follow the definiton of "Haguenoer, Ken, Agnès Caille, Marc Fillatre, Anne Isabelle Lecuyer, et Emmanuel Rusch. « Tentatives de Suicide », 2008, 4.". This rule requires at least one Main Diagnostic (DP) belonging to S00 to T98, and at least one Associated Diagnostic (DAS) that belongs to the range X60 to X84.

You can check the documentation of the function for additional parameters:

Function to return visits that fulfill different definitions of suicide attempt by ICD10.

PARAMETER DESCRIPTION
visit_occurrence

TYPE: DataFrame

condition_occurrence

TYPE: DataFrame

date_min

Minimal starting date (on visit_start_datetime)

TYPE: Optional[datetime] DEFAULT: None

date_max

Maximal starting date (on visit_start_datetime)

TYPE: Optional[datetime] DEFAULT: None

algo

Method to use. Available values are:

  • "X60-X84": Will return a the visits that have at least one ICD code that belongs to the range X60 to X84.
  • "Haguenoer2008": Will return a the visits that follow the definiton of "Haguenoer, Ken, Agnès Caille, Marc Fillatre, Anne Isabelle Lecuyer, et Emmanuel Rusch. « Tentatives de Suicide », 2008, 4.". This rule requires at least one Main Diagnostic (DP) belonging to S00 to T98, and at least one Associated Diagnostic (DAS) that belongs to the range X60 to X84.

TYPE: str DEFAULT: 'X60-X84'

RETURNS DESCRIPTION
visit_occurrence

Tagged with an additional column SUICIDE_ATTEMPT

TYPE: DataFrame

Tip

These rules were implemented in the CSE project n°210013