This macro pre extracts deaths, death encounters and cause of death.
- Extract death encounters.
- When a death is registered in both DeathFile and EncounterFile, keep the first date in DeathFile even if it occurs after the first date in EncounterFile. DeathFileDeathDt will be used for this.
- Compute death_enctype, DeathDt and death_source.
- Extract cause of death if required. Because there can be multiple COD records per patient, create a separate table to avoid duplicate death entries in &DEATHOUTFILE.
- Program inputs
- &CODFILE. (Dataset containing cause of death to extract records from.)
- &CODLOOKUPFILE. (Dataset containing the list of codes to extract from &CODFILE.)
- &DEATHFILE. (Dataset containing deaths to extract records from.)
- &ENCOUNTERFILE. (Dataset containing encounters data.)
- Program outputs
- &CODOUTFILE. (Dataset containing the extracted cause of death records.)
- &DEATHOUTFILE. (Dataset containing the extracted death records.)
Usage
%ms_extractdeaths(DEATHFILE=indata.&DEATHTABLE.,
ENCOUNTERFILE=indata.&enctable.,
CODFILE=indata.&CODTABLE.,
CODLOOKUPFILE=_cod,
DEATHOUTFILE=worktemp.deathextract,
CODOUTFILE=worktemp.codextract);
- Parameters
-
[in] | DEATHFILE | Name of the dataset containing deaths to extract records from. |
[in] | ENCOUNTERFILE | Name of the dataset containing encounters to extract records from. |
[in] | CODFILE | Name of the dataset containing cause of deaths to extract records from. |
[in] | CODLOOKUPFILE | Name of the SAS dataset containing the list of codes to extract from codfile. |
[out] | DEATHOUTFILE | Name of the output dataset containing the extracted death records. |
[out] | CODOUTFILE | Name of the output dataset containing the extracted cause of death records. |
SAS Macros Dependencies
- Author
- Sentinel Coordinating Center (info@.nosp@m.sent.nosp@m.inels.nosp@m.yste.nosp@m.m.org)