Stata 15 help for icd10 clean

[D] icd10 -- ICD-10 diagnosis codes

Syntax

Verify that variable contains defined codes

icd10 check varname [if] [in] [, checkopts]

Clean variable and verify format of codes

icd10 clean varname [if] [in], {generate(newvar) | replace} [cleanopts]

Generate new variable from existing variable

icd10 generate newvar = varname [if] [in], {category | short} [check]

icd10 generate newvar = varname [if] [in], description [genopts]

icd10 generate newvar = varname [if] [in], range(codelist) [check]

Display code descriptions

icd10 lookup codelist [, version(#)]

Search for codes from descriptions

icd10 search ["]text["] [["]text["] ...] [, searchopts]

Display ICD-10 version

icd10 query

codelist is one of the following:

icd10code (the particular code) icd10code* (all codes starting with) icd10code/icd10code (the code range)

or any combination of the above, such as A27.0 G40* Y60/Y69.9.

checkopts Description ------------------------------------------------------------------------- fmtonly check only format of the codes summary frequency of each invalid or undefined code list list observations with invalid or undefined ICD-10 codes generate(newvar) create new variable marking invalid codes version(#) year to check codes against; default is version(2016) -------------------------------------------------------------------------

cleanopts Description ------------------------------------------------------------------------- * generate(newvar) create new variable containing cleaned codes * replace replace existing codes with the cleaned codes check check that variable contains ICD-10 codes before cleaning nodots format codes without a period pad add space to the right of three-character codes ------------------------------------------------------------------------- * Either generate() or replace is required.

genopts Description ------------------------------------------------------------------------- addcode(begin|end) add code to the beginning or end of the description pad add spaces to the right of the code; must specify addcode(begin) nodots format codes without a period; must specify addcode() check check that variable contains ICD-10 codes before generating new variable version(#) select description from year #; default is version(2016) -------------------------------------------------------------------------

searchopts Description ------------------------------------------------------------------------- or match any keyword matchcase match case of keywords version(#) select description from year #; default is all -------------------------------------------------------------------------

Menu

Data > ICD codes > ICD-10

Description

icd10 is a suite of commands for working with the World Health Organization's (WHO's) ICD-10 diagnosis codes from the second edition (2003) to the fifth edition (2016). To see the current version of the ICD-10 diagnosis codes and any changes that have been applied, type icd10 query.

icd10 check, icd10 clean, and icd10 generate are data management commands. icd10 check verifies that a variable contains defined ICD-10 diagnosis codes and provides a summary of any problems encountered. icd10 clean standardizes the format of the codes. icd10 generate can create a binary indicator variable for whether the code is in a specified set of codes, a variable containing a corresponding higher-level code, or a variable containing the description of the code.

icd10 lookup and icd10 search are interactive utilities. icd10 lookup displays descriptions of the codes specified on the command line. icd10 search looks for relevant ICD-10 diagnosis codes from key words given on the command line.

Options

Options are presented under the following headings:

Options for icd10 check Options for icd10 clean Options for icd10 generate Option for icd10 lookup Options for icd10 search

Warning: The option descriptions are brief and use jargon. Please read Introduction to ICD coding in [D] icd before using the icd10 command.

Options for icd10 check

fmtonly tells icd10 check to verify that the codes fit the format of ICD-10 diagnosis codes but not to check whether the codes are defined.

summary specifies that icd10 check should report the frequency of each invalid or undefined code that was found in the data. Codes are displayed in descending order by frequency. summary may not be combined with list.

list specifies that icd10 check list the observation number, the invalid or undefined ICD-10 diagnosis code, and the reason the code is invalid or whether it is an undefined code. list may not be combined with summary.

generate(newvar) specifies that icd10 check create a new variable containing, for each observation, 0 if the observation contains a defined code. Otherwise, it contains a number from 1 to 8 if the code is invalid, 99 if the code is undefined, or missing if the code is missing. The positive numbers indicate the kind of problem and correspond to the listing produced by icd10 check.

version(#) specifies the version of the codes that icd10 check should reference. # may be any value between 2003, which is the second edition of ICD-10 without any updates applied, and 2016, which is the fifth edition of ICD-10. The appropriate value of # should be determined from the data source. The default is version(2016).

Options for icd10 clean

generate(newvar) and replace specify how the formatted values of varname are to be handled. You must specify either generate() or replace.

generate() specifies that the cleaned values be placed in the new variable specified in newvar.

replace specifies that the existing values of varname be replaced with the formatted values.

check specifies that icd10 clean should first check that varname contains codes that fit the format of ICD-10 diagnosis codes. Specifying the check option will slow down icd10 clean.

nodots specifies that the period be removed in the final format.

pad specifies that spaces be added to the end of the codes to make the (implied) dots align vertically in listings. The default is to left-align codes without adding spaces.

Options for icd10 generate

category, short, description, and range(codelist) specify the contents of the new variable that icd10 generate is to create. You do not need to icd10 clean varname before using icd10 generate; it will accept any supported format or combination of formats.

category and short generate a new variable that also contains ICD-10 diagnosis codes. The resulting variable may be used with the other icd10 subcommands.

category specifies to extract the three-character category code from the ICD-10 diagnosis code.

short is designed for users who have data with greater specificity than the standard four-character ICD-10 codes. short will reduce five- and six-character codes to their first four characters. Three- and four-character codes are left as they are.

description creates newvar containing descriptions of the ICD-10 diagnosis codes.

range(codelist) creates a new indicator variable equal to 1 when the ICD-10 diagnosis code is in the range specified, equal to 0 when the ICD-10 diagnosis code is not in the range, and equal to missing when varname is missing.

addcode(begin|end) specifies that the code should be included with the text describing the code. Specifying addcode(begin) will prepend the code to the text. Specifying addcode(end) will append the code to the text.

pad specifies that the code that is to be added to the description should be padded spaces to the right of the code so that the start of description text is aligned for all codes. pad may be specified only with addcode(begin).

nodots specifies that the code that is added to the description should be formatted without a period. nodots may be specified only if addcode() is also specified.

check specifies that icd10 generate should first check that varname contains codes that fit the format of ICD-10 diagnosis codes. Specifying the check option will slow down the generate subcommand.

version(#) specifies the version of the codes that icd10 generate should reference. # may be any value between 2003, which is the second edition of ICD-10 without any updates applied, and 2016, which is the fifth edition of ICD-10. The appropriate value of # should be determined from the data source. The default is version(2016).

Option for icd10 lookup

version(#) specifies the version of the codes that icd10 lookup should reference. # may be any value between 2003, which is the second edition of ICD-10 without any updates applied, and 2016, which is the fifth edition of ICD-10. The appropriate value of # should be determined from the data source. The default is version(2016).

Options for icd10 search

or specifies that ICD-10 diagnosis codes be searched for descriptions that contain any word specified with icd10 search. The default is to list only descriptions that contain all the words specified.

matchcase specifies that icd10 search should match the case of the keywords given on the command line. The default is to perform a case-insensitive search.

version(#) specifies the version of the codes that icd10 search should reference. # may be any value between 2003, which is the second edition of ICD-10 without any updates applied, and 2016, which is the fifth edition of ICD-10.

By default, descriptions for all versions are searched, meaning that codes that changed descriptions and that have descriptions in multiple versions that contain the search terms will be duplicated. To ensure a list of unique code values, specify the version number.

Examples

View the current license and log of changes that WHO has made to the list of ICD-10 codes since icd10 was implemented in Stata . icd10 query

Setup . webuse australia10

Verify that the variable cause has valid codes and flag any observations containing invalid codes . icd10 check cause, generate(prob)

Same as above, but also specify that the data were reported using ICD-10 codes from 2010 . icd10 check cause, generate(prob2) version(2010)

Clean the codes to make them more readable . icd10 clean cause, replace

Stored results

icd10 check stores the following in r():

Scalars r(e#) number of errors of type # r(esum) total number of errors r(miss) number of missing values r(N) number of nonmissing values

icd10 clean stores the following in r():

Scalars r(N) number of changes

icd10 lookup and icd10 search store the following in r():

Scalars r(N_codes) number of codes found


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index