.- help for ^icd9^, ^icd9p^ [STB-54: dm76] .- ICD-9-CM diagnostic and procedure codes --------------------------------------- Note: ^icd9^ is for use with diagnostic codes and ^icd9p^ for use with procedure codes. The two commands have syntax that exactly parallels on another. Below, we write ^icd9^[^p^] to mean both commands. ^icd9^[^p^] ^check^ varname [^,^ ^any^ ^l^ist ^g^enerate^(^newvar^)^ ] ^icd9^[^p^] ^clean^ varname [^,^ ^d^ots ^p^ad ] ^icd9^[^p^] ^gen^erate newvar ^=^ varname^,^ ^m^ain ^icd9^[^p^] ^gen^erate newvar ^=^ varname^,^ ^d^escription [^l^ong ^e^nd] ^icd9^[^p^] ^gen^erate newvar ^=^ varname^,^ ^r^ange^(^icd9rangelist^)^ ^icd9^[^p^] ^l^ookup icd9rangelist ^icd9^[^p^] ^sea^rch [^"^]text[^"^] [[^"^]text[^"^] ...] [^,^ ^or^ ] ^icd9^[^p^] ^install^ [^, replace^] ^icd9^[^p^] ^q^uery where icd9rangelist is icd9code (meaning the particular code) icd9code^*^ (meaning all codes starting with) icd9code^/^icd9code (meaning the code range) or any combination of the above, such as "^001* 018/019 E* 018.02^" Note that icd9codes must be typed with leading zeros: ^1^ is an error; type ^001^ (diag- nostic code) or ^01^ (procedure code). Description ----------- ^icd9^ and ^icd9p^ assist with working with ICD-9-CM codes. ICD-9 codes come in to forms: diagnostic codes and procedure codes. 001 (cholera), 941.45 (deep 3rd deg burn nose), etc., are examples of diagnostic codes, although some people write (and datasets record) 94145 rather than 941.45. 01 (incise-excis brain/skill), 55.01 (nephrotomy), etc., are examples of procedure codes, although some people write 5501 rather than 55.01. ^icd9^ and ^icd9p^ understand both ways of recording codes. ^icd9^ and ^icd9p^ parallel each other, it is just that ^icd9^ is for use with diagnostic codes and ^icd9p^ for use with procedure codes. Below we will write ^icd9^[^p^] to mean both commands. ^icd9^[^p^] ^check^ verifies that already existing variable varname contains valid ICD-9 codes. If not, ^icd9^[^p^] check provides a full report on the problems. Use of ^icd9^[^p^] ^check^ is optional. ^icd9^[^p^] check is useful for tracking down problems when any of the other ^icd9^[^p^] commands tell you "variable does not contain ICD-9 codes". ^icd9^[^p^] is a little more thorough, too, in that it verifies that each of the recorded codes actually exists in the official list. ^icd9^[^p^] ^clean^ also verifies that already existing variable varname contains valid ICD-9 codes and, if it does, ^icd9^[^p^] ^clean^ modifies the variable to contain the codes in either of two standard formats. Use of ^icd9^[^p^] ^clean^ is optional; all ^icd9^[^p^] commands work equally well with cleaned or uncleaned codes. There are numerous ways of writing the same ICD-9 code and ^icd9^[^p^] clean is designed (1) to ensure consistency and (2) to make subsequent output look better. ^icd9^[^p^] ^generate^ produces new variables based on already existing variables containing (cleaned or uncleaned) ICD-9 codes. "^icd9^[^p^] ^generate,^ ^main^" produces newvar containing the main code. "^icd9^[^p^] ^generate,^ ^description^" produces newvar containing a textual description of the ICD-9 code. "^icd9^[^p^] ^generate,^ ^range()^" produces numeric newvar containing 1 if varname records an ICD-9 code in the range listed and 0 otherwise. ^icd9^[^p^] ^lookup^ and ^icd9^[^p^] ^search^ are utility routines useful interactively. ^icd9^[^p^] ^lookup^ simply displays descriptions of codes specified on the command line, so if you have a yearning to know what diagnostic E913.1 means, you can type "^icd9 lookup e913.1^". Whatever data you have in memory is irrelevant -- and remains unchanged -- when using ^icd9^[^p^] ^lookup^. ^icd9^[^p^] ^search^ is like ^icd9^[^p^] ^lookup^ except that it turns the problem around; ^icd9^[^p^] ^search^ looks for relevant ICD-9 codes from the description given on the command line. For instance, you could type "^icd9 search liver^" or "^icd9p search liver^" to obtain a list of codes containing the word liver. ^icd9^[^p^] ^install^ has to do with installation of the ^icd9^[^p^] command. See the section Completing the installation below. ^icd9^[^p^] ^query^ displays the identity of the source from which were obtained the ICD-9 codes and textual description that ^icd9^[^p^] uses. Note, ICD-9 codes are commonly written two ways, with and without periods. For instance, with diagnostic codes, one can write 001, 86221, E8008, and V822, or one can write 001., 862.21, E800.8, and V82.2. With procedure codes, one can write 01, 50, 502, 5021, or one can write 01., 50., 50.2, 50.21. The ^icd9^[^p^] command does not care which syntax you use or even whether you are consistent. Case also is irrelevant: v822, v82.2, V822, and V82.2 are all equivalent. Codes may be recorded with or without leading and trailing blanks. Options for use with ^icd9^[^p^] ^check^ ---------------------------------- ^any^ tells ^icd9^[^p^] ^check^ to verify the codes fit the format of ICD-9 codes but to skip checking whether the codes are actually valid. This makes ^icd9^[^p^] ^check^ run faster. For instance, diagnostic code 230.52 (or 23052 if you prefer) looks to be valid, but in fact there is no such ICD-9 code. Without the ^any^ option, 230.52 (or 23052) would be flagged as an error. With any, 230.52 (and 23052) is not considered an error. ^list^ tells ^icd9^[^p^] ^check^ that invalid codes found in the data -- 1, 1.1.1, and perhaps 230.52 assuming ^any^ is not also specified -- are to be individually listed. ^generate(^newvar^)^ specifies that ^icd9^[^p^] ^check^ is to create new variable newvar containing, for each observation, 0 if the code is valid and a number from 1 to 10 if not. The positive numbers indicate the kind of problem and correspond to the listing produced by ^icd9^[^p^] ^check^. For instance, 10 means the code could be valid, it just turns out not to be on the official list. Options for use with ^icd9^[^p^] ^clean^ ---------------------------------- ^dots^ specifies whether periods are to be included in the final format. Do you wish diagnostic codes recorded, for instance, 86221 or 862.21? Without the ^dots^ option, the former format is used. With the ^dots^ option, the later format is used. ^pad^ specifies that the codes are to be padded with spaces, front and back, to make the codes line up vertically in listings. Specifying ^pad^ makes the resulting codes look better when used with most other Stata commands. Options for use with ^icd9^[^p^] ^generate^ ------------------------------------- ^main^, ^description^, and ^range()^ specify what ^icd9^[^p^] ^generate^ is to calculate. In all cases, varname specifies a variable containing ICD-9 codes. ^main^ specifies that the main code is to be extracted from the ICD-9 code. For procedure codes, the main code is the first two characters. For diagnostic codes, the main code is usually the first three or four characters (the characters before the dot if the code has dots). In any case, ^icd9^[^p^] ^generate^ does not care whether the code is padded with blanks in front or how strangely it might be written; ^icd9^[^p^] ^generate^ will find the main code and extract it. The resulting variable is itself an ICD-9 code and may be used with the other ^icd9^[^p^] subcommands. This includes ^icd9^[^p^] ^generate, main^ because main codes of main codes are main codes. ^description^ creates newvar containing descriptions of the ICD-9 codes. ^long^ is for use with description. It specifies that the new variable, in addition to containing the text describing the code, is to contain the code, too. Without ^long^, newvar in an observation might contain "bronchus injury-closed". With ^long^, it would contain " 862.21 bronchus injury-closed". ^end^ modifies ^long^ (specifying ^end^ implies ^long^) and places the code at the end of the string: "bronchus injury-closed 862.21". ^range()^ allows you to create indicator variables equal to 1 when the ICD-9 code is in the inclusive range specified. Options for use with ^icd9^[^p^] ^search^ ----------------------------------- ^or^ specifies that ICD-9 codes are to be searched for any entry that contains any of the words specified after ^icd9^[^p^] ^search^. The default is to list only entries that contain all the words specified. Options for use with ^icd9^[^p^] ^install^ ------------------------------------ ^replace^ specifies that the completion of the installation is to be done again. Specify ^replace^ if you type ^icd9^[^p^] ^install^, are told that you have already done that, and really do want to reinstall. Examples -------- . ^icd9 lookup 526.4^ . ^icd9 lookup 526/527^ . ^icd9 search jaw disease^ . ^icd9 check diag1^ . ^icd9 check diag1, gen(prob)^ . ^icd9 clean diag1^ . ^icd9 clean diag1, dots^ . ^icd9p clean proc1, dots^ . ^icd9p check proc1^ . ^icd9 gen td1 = diag1, desc^ . ^icd9p gen tp2 = proc2, desc^ . ^icd9 gen main1 = diag1, main^ Completing the installation --------------------------- The installation process for the ^icd9^ and ^icd9p^ commands are a little dif- ferent than the standard. In addition to ^net install^, you must ^net get^ and then you must type ^icd9 install^ and ^icd9p install^: . ^net install dm76^ . ^net get dm76^ . ^icd9 install^ . ^icd9p install^ The ^net get^ copies two datasets that ^icd9^ and ^icd9p^ need. The ^icd9 install^ and ^icd9p install^ then moves each of the datasets from the current directory to the directory in which the commands are installed. Saved results ------------- ^icd9^[^p^] ^check^ saves in ^r(e1)^, ^r(e2)^, ..., ^r(e10)^ the number of errors of type 1, 2, ..., 10, and returns in ^r(esum)^ the total number of errors. Author ------ William Gould, Stata Corp. Also see -------- STB-54