QRP
 
Loading...
Searching...
No Matches
ms_extractmeds.sas File Reference

This macro pre extracts raw claims (diagnosis, dispensing, procedure) based solely on code/codetype match. More...

Detailed Description

This macro pre extracts raw claims (diagnosis, dispensing, procedure) based solely on code/codetype match.

This macro supports both initial claim extraction (useful to use as a pre-extraction to avoid claim duplication) and subsequent extraction when the same claim can be associated with >1 row in the lookup file.

Program inputs
  • &DATAFILE. (Dataset to extract records from.)
  • &LOOKFILE. (Dataset containing the list of codes to extract.)
Program outputs
  • &OUTFILE. (Dataset containing the extracted records.)

Usage

%ms_extractmeds(DATAFILE=indata.&proctable.,
                DATACODE=PX,
                DATACODETYPE=PX_codetype,
                LOOKFILE=_proc, 
                LOOKNODUPVARS=code codetype,
                WHERECLAUSE=adate>='01Jan2020'd,
                OUTFILE=worktemp._procextract(keep=PatID ADate EncType PX PX_CodeType));
Parameters
[in]DATAFILEName of the dataset to extract records from.
[in]DATACODEName of the variable containing the codes.
[in]DATACODETYPEName of the variable containing the CodeType.
[in]LOOKFILEName of the sas dataset containing the list of codes to extract. The name of the variable containing the codes must be called "code" and the one containing the codetype must be called "codetype".
[in]LOOKNODUPVARSTo define variables to dedup lookfile by. Default variables are key variables code and codetype
[in]WHERECLAUSEOptional restriction to apply to DATAFILE
[out]OUTFILEName of the output dataset containing the extracted records.

SAS Macros Dependencies

  • ms_isdata.sas
Author
Sentinel Coordinating Center (info@.nosp@m.sent.nosp@m.inels.nosp@m.yste.nosp@m.m.org)