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

This macro extracts dispensing claims. More...

Detailed Description

This macro extracts dispensing claims.

  • Match codes to a lookup file if rx_codetype is not equal to 'ND'.
    • Split NDC from non-NDC codes.
      • If rx_codetype is equal to 'ND' then the macro will extract either an 11 or 9 digit NDC.
      • Only create code9 variable if source dispensing table has a length of 9.
  • Initial claim extraction: extract 1 claim per RX code in the lookup file (either 9 digit or full).
  • Subsequent claim extraction: extract 1 record per code in lookup file. The same claim in &DATAFILE. may exist multiple times in the final 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_extractdrugs(DATAFILE=worktemp.drugs,
                 LOOKFILE=_ITGroupParamNDCForExtract, 
                 LOOKVAR=code, 
                 MINDATE=,
                 OUTFILE=_ITDrugs);
Parameters
[in]DATAFILEName of the dataset to extract records from.
[in]LOOKFILEName of the sas dataset containing the list of codes to extract.
[in]LOOKVARName of the variable containing the codes to extract.
[in]MINDATEExtract all claims occuring on or after this date.
[in]OUTFILEName of the output dataset containing the extracted records.
[in]DROPLOOKVARIndicator (Y/N) to drop &lookvar or not in final dataset.

SAS Macros Dependencies

None.

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