[D] icd10pcs -- ICD-10-PCS procedure codes
Syntax
Verify that variable contains defined codes
icd10pcs check varname [if] [in] [, checkopts]
Clean variable and verify format of codes
icd10pcs clean varname [if] [in], {generate(newvar) | replace}
[cleanopts]
Generate new variable from existing variable
icd10pcs generate newvar = varname [if] [in], category [check]
icd10pcs generate newvar = varname [if] [in], description [genopts]
icd10pcs generate newvar = varname [if] [in], range(codelist) [check]
Display code descriptions
icd10pcs lookup codelist [, version(#)]
Search for codes from descriptions
icd10pcs search ["]text["] [["]text["] ...] [, searchopts]
Display ICD-10-PCS version
icd10pcs 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 041.E09P 2W3* BQ2L/BQ2LZZZ.
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-PCS codes
generate(newvar) create new variable marking invalid codes
version(#) fiscal year to check codes against; default is
version(2019)
-------------------------------------------------------------------------
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-PCS codes before
cleaning
nodots format codes without a period
-------------------------------------------------------------------------
* Either generate() or replace is required.
genopts Description
-------------------------------------------------------------------------
addcode(begin|end) add code to the beginning or end of the description
nodots format codes without a period; must specify addcode()
check check that variable contains ICD-10-PCS codes before
generating new variable
long use long description rather than short
version(#) select description from year #; default is
version(2019)
-------------------------------------------------------------------------
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-PCS
Description
icd10pcs is a suite of commands for working with ICD-10-PCS procedure
codes from U.S. federal fiscal year 2016 to the present. To see the
current version of the ICD-10-PCS procedure codes and any changes that
have been applied, type icd10pcs query.
icd10pcs check, icd10pcs clean, and icd10pcs generate are data management
commands. icd10pcs check verifies that a variable contains defined
ICD-10-PCS procedure codes and provides a summary of any problems
encountered. icd10pcs clean standardizes the format of the codes.
icd10pcs 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.
icd10pcs lookup and icd10pcs search are interactive utilities. icd10pcs
lookup displays descriptions of the codes specified on the command line.
icd10pcs search looks for relevant ICD-10-PCS procedure codes from
keywords given on the command line.
Options
Options are presented under the following headings:
Options for icd10pcs check
Options for icd10pcs clean
Options for icd10pcs generate
Option for icd10pcs lookup
Options for icd10pcs search
Options for icd10pcs check
fmtonly tells icd10pcs check to verify that the codes fit the format of
ICD-10-PCS procedure codes but not to check whether the codes are
defined.
summary specifies that icd10pcs 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 icd10pcs check list the observation number, the
invalid or undefined ICD-10-PCS procedure 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 icd10pcs 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 11 if the
code is invalid, 77 if the code is valid only for a previous version,
88 if the code is valid only for a later version, 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 icd10pcs check.
version(#) specifies the version of the codes that icd10pcs check should
reference. # indicates the federal fiscal year for the codes. For
example, use 2016 for federal fiscal year 2016 (FFY-2016), which is
October 1, 2015 to September 30, 2016. icd10pcs supports all years
after the United States officially adopted ICD-10-PCS. The
appropriate value of # should be determined from the data source.
The default is version(2019).
Warning: The default value of version() will change over time so that
the most recent codes are used. Using the default value rather than
specifying a specific version may change results after a new version
of the codes is introduced.
Options for icd10pcs 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 icd10pcs clean should first check that varname
contains codes that fit the format of ICD-10-PCS procedure codes.
Specifying the check option will slow down icd10pcs clean.
nodots specifies that the period be removed in the final format.
Options for icd10pcs generate
category, description, and range(codelist) specify the contents of the
new variable that icd10pcs generate is to create. You do not need to
icd10pcs clean varname before using icd10pcs generate; it will accept
any supported format or combination of formats.
category specifies to extract the three-character category code from
the ICD-10-PCS procedure code. The resulting variable may be
used with the other icd10pcs subcommands.
description creates newvar containing descriptions of the ICD-10-PCS
procedure codes.
range(codelist) creates a new indicator variable equal to 1 when the
ICD-10-PCS procedure code is in the range specified, equal to 0
when the ICD-10-PCS procedure 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.
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 icd10pcs generate should first check that varname
contains codes that fit the format of ICD-10-PCS procedure codes.
Specifying the check option will slow down the generate subcommand.
long specifies that the long description of the code be used rather than
the short (abbreviated) description.
version(#) specifies the version of the codes that icd10pcs generate
should reference. # indicates the federal fiscal year for the codes.
For example, use 2016 for federal fiscal year 2016 (FFY-2016), which
is October 1, 2015 to September 30, 2016. icd10pcs supports all
years after the United States officially adopted ICD-10-PCS. The
appropriate value of # should be determined from the data source.
The default is version(2019).
Warning: The default value of version() will change over time so that
the most recent codes are used. Using the default value rather than
specifying a specific version may change results after a new version
of the codes is introduced.
Option for icd10pcs lookup
version(#) specifies the version of the codes that icd10pcs lookup should
reference. # indicates the federal fiscal year for the codes. For
example, use 2016 for federal fiscal year 2016 (FFY-2016), which is
October 1, 2015 to September 30, 2016. icd10pcs supports all years
after the United States officially adopted ICD-10-PCS. The
appropriate value of # should be determined from the data source.
The default is version(2019).
Warning: The default value of version() will change over time so that
the most recent codes are used. Using the default value rather than
specifying a specific version may change results after a new version
of the codes is introduced.
Options for icd10pcs search
or specifies that ICD-10-PCS procedure codes be searched for descriptions
that contain any word specified with icd10pcs search. The default is
to list only descriptions that contain all the words specified.
matchcase specifies that icd10pcs 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 icd10pcs search should
reference. # indicates the federal fiscal year for the codes. For
example, use 2016 for federal fiscal year 2016 (FFY-2016), which is
October 1, 2015 to September 30, 2016. icd10pcs supports all years
after the United States officially adopted ICD-10-PCS.
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 icd10pcs was implemented in Stata
. icd10pcs query
Setup
. webuse hosp2015
. drop if dmonth < tm(2015m10)
Verify that the variable proc1 has valid codes procedure codes for
federal fiscal year 2016
. icd10pcs check proc1, version(2016)
Clean the codes to make them more readable
. icd10pcs clean proc1, replace
Stored results
icd10pcs 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
icd10pcs clean stores the following in r():
Scalars
r(N) number of changes
icd10pcs lookup and icd10pcs search store the following in r():
Scalars
r(N_codes) number of codes found