Suicide Events - Code module

lauren.brinck
30 October 2024

Outputs:

SQL: [IDI_Community].[hlth_suicide_events].[suicide_events_202603]
SAS: libname cm_suicide_events dsn=IDI_community_srvprd schema=hlth_suicide_events; run ;
How to access a code module in the Data Lab: Read here

Inputs:

Dependency Dependency Type
[IDI_Clean_202603].[moh_clean].[mortality_registrations] Source
[IDI_Metadata_202603].[moh_mort].[death_certifier_code] Source
[IDI_Metadata_202603].[moh_mort].[facility_code] Source
[IDI_Metadata_202603].[moh_mort].[post_mortem_code] Source
[IDI_Metadata_202603].[moh_pop_cohort].[nhi_domicile_code] Source

What this is:

The purpose of this module is to identify individuals who have died by suicide in NZ. This dataset will list the individuals, the cause of death, the year of death, the individual’s age at death and some other variables available in the Mortality dataset, e.g. facility, location. The output table also contains snz_dia_death_reg_uid allowing the user to to link the event to other datasets in IDI (the Mortality registry and DIA Births, Deaths and Marriages (BDM) register) to obtain additional information about the events in this table.

What this is not:

Key concepts

How is suicide data identified in IDI?

The suicide data in the IDI comes from the Mortality Collection (MORT) provided by Te Whatu Ora, which classifies the underlying cause of death for all deaths registered in New Zealand. MORT combines death registration (and stillbirth registration) data with cause of death information which is then collated and coded to create national cause of death statistics.
New Zealand is currently using the ICD-10-AM classification and the WHO ICD Rules and Guidelines for Mortality Coding.

How causes of death are assigned

What counts as self-inflicted: it is possible to extend the definition to include injuries of undetermined intent which will capture some additional self-harm deaths but also a lot of deaths that are not self-harm (especially unintentional self-injury in infants). There may be instances (particularly in relation to mental health treatment) where this extension is justified. Some international reporting will include undetermined intents in suicide deaths as there are concerns around whether all suicides are being identified. This isn’t generally considered to be an issue in New Zealand.

A coronial process is needed to assign a suicide and as it can take several years for the coroner to determine the causes of death there is always a delay on assigning suicide as cause of death. Currently there is a 2-year time lag on the data.

Collection methodology

In New Zealand, aggregate suicide data is published by both Te Whatu Ora and by the Chief Coroner, Ministry of Justice.

Consequently, the Chief Coroner’s statistics are published more quickly than the Te Whatu Ora’s statistics and there are differences between the numbers reported.
Data in IDI comes from the Te Whatu Ora (Mortality dataset); therefore, it is aligned to the Te Whatu Ora’s statistics rather than to the Chief Coroner’s statistics.

Practical notes

References and contacts

List of the most important reference documents readers might need to consult with:

List of key contacts form the Community of Interest

|Domain |Agency|Person|
|-|-|
|Subject Matter Expert |Virtual Health Network New Zealand (VHNZ) and Department of Public Health - University of Otago|Sheree Gibb|
|Subject Matter Expert |Te Whatu Ora|Chris Lewis|
|IDI Experts |SWA|Simon Anastasiadis|
| | |

Module business rules

The intent of this module is to obtain a list of individuals who have died of suspected suicide. The intended business key is this dataset is the person, the year of death and age at death.

Key rules applied

Suicide events are identified using the data sources and rules displayed in the table below.

|Data Source|Variable Name|How to identify suicide|
|-|-|
[IDI_Clean].[moh_clean].[mortality_registrations]|moh_mor_icd_d_code|X60-X84 (Intentional self-harm)|
| | |

Relevant ICD-10-AM codes are sourced from here: Data sources and ICD-10-AM codes | Manatu Hauora NZ: https://www.health.govt.nz/our-work/populations/maori-health/tatau-kahukura-maori-health-statistics/appendices-tatau-kahukura-maori-health-statistics/data-sources-and-icd-10-am-codes

Parameters

The following parameters should be supplied to this module to run in the database:

  1. {targetdb}
  2. {targetschema}
  3. {projprefix}
  4. {idicleanversion}
  5. {idimetaversion}

Variable Description

Column name Description
data_source A tag signifying a source dataset description (hard-coded to “SUICIDE”).
snz_uid The unique STATSNZ person identifier for the the individual
snz_moh_uid A local unique identifier, derived by Stats NZ from the source agency’s unique identifiers.
							This identifier will remain the same for an identity across refreshes. Where we receive more information
							during a subsequent refresh that indicates that two or more identifies represent the same identity, 
							the identifier may change. The snz_moh_uid represents a distinct identity in all of MoH tables in ID.|

|snz_dia_death_reg_uid |Stats NZ’s encrypted unique identification number assigned to a deceased by the Births, Deaths,
and Marriages. This identifier will remain the same for an identity across refreshes.
Where we receive more information during a subsequent refresh that indicates that two or more
identifies represent the same identity, the identifier may change. The snz_moh_uid represents
a distinct identity in all of MoH tables in ID.|
|start_date |The year on which the person died. For more information about the year of death, please, refer on the
practical notes.|
|end_date |Same as the start_date.|
|moh_mor_icd_d_code |The underlying cause of death. Here it is one of the listed ICD-10 codes: X60-X80.
Notes: The underlying cause of death is defined by the World Health Organization (WHO) as “the disease
or injury which initiated the train of morbid events leading directly to der the circumstances of
the accident or violence which produced the fatal injury.â€<9d> The underlyingath o cause of death is coded using
the International Statistical Classification of Diseases and Related Health Problems, 10th Revision,
Australian modification (ICD-10-AM). The specific version used for each year is as follows:
From Jan 2002 – Dec 2007 the version used was ICD10-AM-II
From Jan 2008– Dec 2013 the version used was ICD10-AM-VI
From Jan 2014 onwards the version used was ICD10-AM-VIII|
|moh_mor_dth_locn |The place where the deceased died. Notes: Entered by the funeral director on the BDM28 Notification of
Death for Registration.|
|moh_mor_health_facility_code |The code that uniquely identifies a healthcare facility. This will be the code of the health facility
where the person died if they died in a hospital, or where an infant was born or stillborn. Notes: The
default code used for those who die outside of hospital is ‘9990’. If a person dies in Accident and
Emergency, there may not be a health event recorded in the NMDS.|
|facility_name |Description of the MoH mortality health facility code that uniquely identifies a healthcare
facility.
Notes:The default code used for those who die outside of hospital is ‘9990’ and the name is ‘Default
value for birth/death registrations’.|
|moh_mor_domicile_code |A four-digit code representing the healthcare users usual residential address when they died.
Notes: The domicile code used is from either the 1996, 2001 or 2006 census domicile codes depending on
the year of death. If the year of death was between:
- 1 January 2002 – 31 December 2002, the 1996 code was used.
- 1 January 2003 – 31 December 2007, the 2001 code was used.
- 1 January 2008 – 30 June 2015, the 2006 code was used.
Domicile code is geocoded from the healthcare user’s address which is obtained from the death
certificate. Quality checks are undertaken to ensure the address has been geocoded to a meaningful
domicile code. Because of this additional step, the quality of the domicile code information in
Mortality is higher than other collections such as the NHI which only rely on an automated process.|
|domicile_name |The name of the domicile, based on the following metadata table:
IDI_Metadata.[clean_read_CLASSIFICATIONS].[moh_nhi_domicile_code]|
|moh_mor_death_cert_code |A code defining the type of person certifying the death. Notes: Sourced directly from the BDM 28 Death
Registration the Medical Certificate of Causes of Death and from the Coroners records are additional
sources. Options include: doctor, coroner with inquest, coroner without inquest, coroner’s interim
report, midwife. Midwives are only legally permitted to certify cause of death of still births.|
|death_certifier_description |The description of the person certifying the death, based on the following metadata table:
IDI_Metadata.[clean_read_CLASSIFICATIONS].[moh_mort_death_certifier]|
|moh_mor_post_mortem_code |The code representing whether, or not, a post mortem examination was performed on the deceased and if it
was, whether the report has been viewed by a mortality coder and the underlying cause of death code
updated with any new information provided.
Notes: If no information is provided the default code is ‘3’ (Not performed). The source document is the
BDM 50/167, Post mortem/Autopsy Report from pathology laboratories.
- 1 PM performed but not received
- 2 Not stated whether post mortem performed or not
- 3 Not performed
- 4 PM performed, and read by Ministry staff
- 5 PM performed, read and code change. |
|post_mortem_description |The description of the person certifying the death, based on the following metadata table: |
IDI_Metadata.[clean_read_CLASSIFICATIONS].[moh_mort_post_mortem]|
| | |

Module version and change history

Date Version Comments
2024-09-16 Updated Metadata reference table names
2024-03-12 Updated Metadata references to reflect changes in where datasets are put in the IDI
2023-12-02 Additional Testing and adding output table (Todd Nicholson)
2022-09-19 After expert reviews from Sheree Gibb and Chris Lewis. (Marianna Pekar)
2022-07-05 Initial version based on specifications from commissioning document, subsetting for events, only where the mortality event is suspected suicide. (Marianna Pekar)
2020-08-04 Mixed Mortality SAS codes recoded into SQL (Simon Anastasiadis)
2016-10-04 Mixed Mortality SAS codes created for the Social Investment Agency (Ernestynne Walsh)

Code


/* Establish database for writing views */
:setvar targetdb "{targetdb}"
:setvar targetschema "{targetschema}"
:setvar projprefix "{projprefix}"
:setvar idicleanversion "{idicleanversion}"
:setvar idimetaversion "{idimetaversion}"

USE $(targetdb);
GO

DROP VIEW IF EXISTS [$(targetschema)].[$(projprefix)_suicide_events];
GO

CREATE VIEW [$(targetschema)].[$(projprefix)_suicide_events] AS

SELECT snz_uid snz_moh_uid
    , snz_dia_death_reg_uid
    , [moh_mor_registration_year_nbr]
    , 'MOH_MORTALITY' AS data_source
    , 'SCD' AS subject_area
    , CAST(DATEFROMPARTS(moh_mor_death_year_nbr, moh_mor_death_month_nbr, 1) AS DATETIME) AS [start_date]
    , CAST(DATEFROMPARTS(moh_mor_death_year_nbr, moh_mor_death_month_nbr, 1) AS DATETIME) AS [end_date]
    , moh_mor_icd_d_code
    , CASE
		WHEN moh_mor_birth_month_nbr <= moh_mor_death_month_nbr THEN moh_mor_death_year_nbr - moh_mor_birth_year_nbr 
		ELSE moh_mor_death_year_nbr - moh_mor_birth_year_nbr - 1
	END AS age_at_death
	/*these variables are possible to obtain from the Mortality dataset, but not part of the code module
	moh_mor_alcohol_ind,
	moh_mor_cannabis_ind,
	moh_mor_other_drug_ind,
	moh_mor_illicit_drug_ind,
	moh_mor_prescription_drug_ind,
	moh_mor_substance_ind,
	death_info_source.death_info_src_description AS death_info_src_description,
	moh_mor_occupation_text,*/
    , moh_mor_dth_locn
    , moh_mor_health_facility_code
    , facility.facility_name AS facility_name
    , moh_mor_domicile_code
    , domicile.domicile_name AS domicile_name
    , moh_mor_death_cert_code
	/* ANGUS EDIT 20260330 - metadata column name change */
	/* ,certifier.DEATH_CERTIFIER_DESCRIPTION AS death_certifier_description */
    , certifier.DEATH_CERTIFIER_DESC AS death_certifier_description
    , moh_mor_post_mortem_code
	/* ANGUS EDIT 20260330 - metadata column name change */
	/*,post_mortem.post_mortem_description AS post_mortem_description */
    , post_mortem.post_mortem_desc AS post_mortem_description
FROM [$(idicleanversion)].[moh_clean].[mortality_registrations] registration
/* 
	ANGUS EDIT 20260330 - The following LEFT JOIN is no longer possible due to a missing metadata table
	This table did exist in the IDI_Metadata_202510 database but appears to no longer be available. 
	As the script does not reference any object from this table I have removed this piece of code from the script. 
	This should result in no changes to the output table.
*/
/*
LEFT JOIN [$(idimetaversion)].[moh_mort].[death_info_srce_code] death_info_source /* 20240916 remove year indicator from table */
	ON (registration.moh_mor_death_info_source_code =  death_info_source.DEATH_INFO_SRC_CODE) */
LEFT JOIN [$(idimetaversion)].[moh_mort].[facility_code] facility /* 20240916 remove year indicator from table */
	ON (registration.moh_mor_health_facility_code = facility.facility_code)
LEFT JOIN [$(idimetaversion)].[moh_pop_cohort].[nhi_domicile_code] domicile /* 20240916 remove year indicator from table */
	ON (registration.moh_mor_domicile_code = domicile.domicile_code)

LEFT JOIN [$(idimetaversion)].[moh_mort].[death_certifier_code] certifier /* 20240916 remove year indicator from table */
	ON (registration.moh_mor_death_cert_code = certifier.death_certifier_code)

LEFT JOIN [$(idimetaversion)].[moh_mort].[post_mortem_code] post_mortem /* 20240916 remove year indicator from table */
	ON (registration.moh_mor_post_mortem_code = post_mortem.post_mortem_code)
WHERE SUBSTRING(registration.moh_mor_icd_d_code,1,3) IN ('X60','X61','X62','X63',
			'X64','X65','X66','X67','X68','X69','X70','X71','X72','X73','X74',
			'X75','X76','X77','X78','X79','X80','X81','X82','X83','X84') 
 ;
GO