Selecting claims from medical claims data bases [STB-12: dm12; STB-13 dm12.1] ----------------------------------------------- ^anydx^ newvar code [code [code [...]]] ^anyproc^ newvar code [code [code [...]]] or ^anydx^ newvar mincode maxcode ^, range^ ^anyproc^ newvar mincode maxcode ^, range^ Description ----------- Assuming codes are stored in string variables ^dx1^, ^dx2^, ..., ^anydx^ creates newvar equal to 1 where any of the dx variables contain any of the listed codes and 0 otherwise. ^anyproc^ does the same thing using already existing string variables ^proc1^, ^proc2^, ^proc3^, ... . In both cases, leading and trailing blanks in the dx (proc) variables are irrelevant. The second form sets newvar equal to 1 if any of the dx (or proc) variables is greater than or equal to mincode and less than or equal to maxcode. Both mincode and maxcode must be numbers, but the dx and proc variables may contain both numbers and alphanumeric codes. Any codes that are not numbers are ignored. Example ------- Say you are interested in analyzing data from the claims of patients who had a diagnosis of spinal stenosis (IDC-9 codes 721.42, 721.91, 724.00, 724.02, and 724.09) and laminectomy as the procedure (ICD-9 codes 03.0, 03.02, 03.6, and 03.09): . ^anydx spinal 721.42 721.91 724.00 724.02 724.09^ . ^anyproc lamin 03.0 03.02 03.6 03.09^ . ^keep if spinal & lamin^ The way you enter the codes may differ since different sites store the codes differently (some omitting decimal points, etc.), but that does not matter. Enter the codes as you think of them. You need not worry about blanks at the beginning or end of codes -- regardless of how your data is stored, they will be ignored. Typing, for instance, ^036^ will find "036", " 036", or "036 ". Author ------ Robert J. Vaughn, Clinical Projects Manager, Utah Peer Review Organization Also see -------- STB: dm12 (STB-12), dm12.1 (STB-13)