This macro computes the numerators for each cohort and calls many other macros.
More...
This macro computes the numerators for each cohort and calls many other macros.
- 01: Set up variables needed for the run.
- 02: Import input files in SAS format.
- 03: Jump to checkpoint if restarting QRP.
- 04: Initialize macro variables and process input file parameters.
- 05: Process ranges "-" and wilcards "*" in lookup codes.
- 06: Extract raw data and run envelope or create combo records (if applicable).
- 07: Reconcile all enrollment spans.
- 08: Create worktemp.meds partition.
- 09: Process pregnancy outcomes.
- 10: Loop through Group(s).
- 10.a: Loop pre-processing.
- 10.b: Extract loop-specific records.
- 10.c: Shave enrollment spans.
- 10.d: Create claims dataset based on age or calendar date.
- 10.e: Apply StockPiling.
- 10.f: Create raw POVs datasets.
- 10.g: POV1: Find all potential index dates.
- 10.h: POV2: identify all type 4 MOI index dates that are free of POV2 records in washper. For all other types, this is assesed with POV3.
- 10.i: POV3: identify all index dates meeting inclusion Exclusion.
- 10.j: POV4: Create at-risk episodes.
- 10.k: Create final record wrt index date.
- 10.l: Finalize episode list.
- 10.m: Calculate additional metrics.
- Denominators, never exposed cohort, MOI stats, PSA/covariate stratification, multiple events, concomitant use, overlap, tree extraction.
- Program inputs
- infolder.&COHORTCODES. (Dataset with codes used to define exposures and outcomes of interest.)
- infolder.&COHORTFILE. (Dataset used to define enrollment and demographic requirements, type of cohort identification strategy.)
- infolder.&COMBOFILE. (Datasets that specifies how combination items should be created.)
- infolder.&CONCFILE. (Dataset to specify GROUP values from a Type 2 analysis and perform additional analyses.)
- infolder.&COVARIATECODES. (Dataset for request of covariates presence and analytic adjustment.)
- infolder.&COVSTRATFILE. (Dataset describing parameters for a covariate stratification analyses.)
- infolder.&DRUGCLASSFILE. (Dataset required for the use of drug utilization metrics.)
- infolder.&ICD10ICD9MAP. (ICD-10-CM-ICD-9-CM Mapping lookup file for TreeScan analyses.)
- infolder.&INCLUSIONCODES. (Dataset with codes used to define additional cohort inclusion/exclusion criteria.)
- infolder.&IPTWFILE. (Dataset specifying the parameters for an IPTW analysis.)
- infolder.&ITSFILE. (Dataset with ITS analysis specifications.)
- infolder.&METADATAFILE. (Dataset that defines the metadata generated for each time period request for sequential analysis.)
- infolder.&MFUFILE. (Dataset for most frequent utilization MFU assessment.)
- infolder.&MICOHORTFILE. (Dataset for Type 4 analysis with pregnancy cohorts among pregnancies matched to an infant specification.)
- infolder.&MONITORINGFILE. (Dataset with monitoring periods for descriptive, inferential and sequential analyses.)
- infolder.&MULTEVENTFILE. (Dataset to specify COHORTGRP values from a Type 2 analysis and perform additional analyses.)
- infolder.&MULTEVENTFILE_ADHERE. (Dataset to specify multiple criteria to determine overall adherence for a Type 2 multiple events analysis.)
- infolder.&OVERLAPFILE. (Dataset characterizing an overlap of primary and secondary treatment episodes during the observation window.)
- infolder.&OVERLAPFILE_ADHERE. (Dataset to specify multiple criteria to determine overall adherence for a concomitant use analysis.)
- infolder.&PREGNANCYCODES. (Dataset for Type 4 cohort identification strategy.)
- infolder.&PREGNANCYDURATION. (Dataset for Type 4 cohort identification strategy.)
- infolder.&PREGNANCYMETA. (Dataset for Type 4 cohort identification strategy.)
- infolder.&PSCSSUBGROUPFILE. (Dataset with all subgroups and subgroup levels for each analysis group.)
- infolder.&PSESTIMATIONFILE. (Dataset with the parameters for estimating a PS model and is required for PS-based analyses.)
- infolder.&PSMATCHFILE. (Dataset with parameters for a PS matching analysis.)
- infolder.&RISKSCORECODES. (Dataset for risk score calculation if requested.)
- infolder.&RISKSCOREFILE. (Dataset required for calculating one or more risk scores.)
- infolder.&STOCKPILINGFILE. (Dataset with valid dispensings selection used by the stockpiling algorithm to create exposure episodes.)
- infolder.&STRATIFICATIONFILE. (Dataset with parameters for a PS stratification analysis and required for PS-based analyses.)
- infolder.&TREATMENTPATHWAYS. (Dataset with identification and computation of switch pattern episodes.)
- infolder.&TREEFILE. (Dataset with parameters required to execute multiple SI analyses from a basic QRP execution.)
- infolder.&TREELOOKUP. (Dataset with hierarchical tree of codes that are eligible to be HOI.)
- infolder.&TYPE1FILE. (Dataset required for a background rate calculation cohort identification strategy.)
- infolder.&TYPE2FILE. (Dataset required for an exposures and follow-up time cohort identification strategy.)
- infolder.&TYPE3FILE. (Dataset required for a self-controlled risk interval design cohort identification strategy.)
- infolder.&TYPE4FILE. (Dataset required for a pregnancy episodes identification strategy.)
- infolder.&TYPE5FILE. (Dataset required for medical product utilization cohort identification strategy.)
- infolder.&TYPE6FILE. (Dataset required for evaluating manufacture level product utilization and switching patterns.)
- infolder.&USERSTRATA. (Dataset with ouput tables and stratifications specification.)
- infolder.&UTILFILE. (Dataset with medical or drug utilization metrics specification.)
- infolder.&ZIPFILE. (Lookup table required if a request requires stratification of results by geographic location.)
- Program outputs
- dplocal.&RUNID._adjusted (Dataset for covariate stratification and propensity score estimations, ps stratum weighting analysis, inverse probability of treatment weights (IPTW) analysis, and matching strategies and time period.)
- dplocal.&RUNID._ads_mstr (Dataset containing one record per GROUP, PATID, and INDEXDT.)
- dplocal.&RUNID._ads_mstr_concomitance (Dataset for Type 2 analyses with the add on tools for concomitant use event/outcome containing one record per ANALYSISGRP, PATID, and INDEXDT.)
- dplocal.&RUNID._ads_mstr_mi (Dataset for Type 4 analyses creating cohorts for further processing with the PSA module and containing one record per PATID per GROUP.)
- dplocal.&RUNID._ads_mstr_multevent (Dataset for Type 2 analyses with the add on tools for multiple events containing one record per ANALYSISGRP, PATID, and INDEXDT.)
- dplocal.&RUNID._ads_mstr_nopreg (Dataset for Type 4 analyses containing one record per GROUP, PATID, and INDEXDT for the non-pregnant cohort.)
- dplocal.&RUNID._ads_mstr_overlap (Dataset for Type 2 analyses with the add on tools for overlap containing one record per ANALYSISGRP, PATID, and INDEXDT.)
- dplocal.&RUNID._ads_mstr_preg (Dataset for Type 4 analyses containing one record per GROUP, PATID, and INDEXDT for the pregnant cohort.)
- dplocal.&RUNID._ads_t6_switchepisodes (Dataset for Type 6 analyses representing the patient-level baseline characteristics for the switching cohort at index date prior to any switching.)
- dplocal.&RUNID._alldeliveries (Dataset with all deliveries contained in &RUNID._mstr, plus those that do not meet the enrollment eligibility criterion.)
- dplocal.&RUNID._combo_diag (Dataset containing combination items that behave like DX.)
- dplocal.&RUNID._combo_drug (Dataset containing combination items that behave like RX.)
- dplocal.&RUNID._combo_proc (Dataset containing combination items that behave like PX.)
- dplocal.&RUNID._concepi_mstr_nopreg_tri (Dataset produced when using a type 4 analysis for the non-pregnant cohort. It contains trimester statistics for each pregnancy outcome and medical product of interest. It contains one row per individual [patid] per MOI episode.)
- dplocal.&RUNID._concepi_mstr_preg_tri (Dataset for Type 4 analysis for the pregnant cohort containing trimester statistics for each pregnancy outcome and medical product of interest.)
- dplocal.&RUNID._cumulative_mstr_for_ps (Dataset produced for analysis types 2 and 4 when ANALYSIS=TREE. It contains the unmatched population across all looks. Only data from the current look is included in the other output files. It is used to re-compute the propensity score using patients from all looks.)
- dplocal.&RUNID._dispensings (Dataset for Type 5 and Type 6 analyses containing one row per cohort, patient, and dispensing date and only contains valid claims that occur during valid enrollment spans and episodes.)
- dplocal.&RUNID._mstr (Dataset for Type 1 and Type 2 analyses with one record per individual per index date for every GROUP.)
- dplocal.&RUNID._mstr_concomitance (Dataset for Type 2 analyses when using the concomitant use tool containing one row per patient PATID per concomitant episode.)
- dplocal.&RUNID._mstr_mi (Dataset for Type 4 analyses produced for exposed and comparator/unexposed pregnant cohorts.)
- dplocal.&RUNID._mstr_multevent (Dataset for Type 2 analyses when using the multiple events functionality containing one row per patient PATID per primary episode.)
- dplocal.&RUNID._mstr_nopreg (Dataset containing one record per individual per index date for the non-pregnant cohort (i.e., one row per pregnancy episode).)
- dplocal.&RUNID._mstr_overlap (Dataset for Type 2 analyses when using the Overlap Tool containaining one row per patient PATID per primary episode.)
- dplocal.&RUNID._mstr_preg (Dataset containing one record per individual per index date for the pregnant cohort (i.e., one row per pregnancy episode).)
- dplocal.&RUNID._mstr_tree (Dataset produced for Type 2, 3, and 4 analyses when ANALYSIS=TREE. It contains 1 row per ascertained outcome.)
- dplocal.&RUNID._scores (Dataset for every propensity score and covariate stratification and matching strategies and time period.)
- dplocal.&RUNID._sec (Dataset generated for Type 4 requests. It contains each medical product of interest episode for both the pregnancy and comparator cohorts.)
- dplocal.&RUNID._t6_switchepisodes (Dataset containing patient-switch pattern episode level information.)
- freedir.&RUNID._deathtable (Dataset with subset of patient level death data.)
- freedir.&RUNID._demtable (Dataset with subset of patient level demographic data.)
- freedir.&RUNID._diatable (Dataset with subset of patient level diagnosis data.)
- freedir.&RUNID._distable (Dataset with subset of patient level dispensing data.)
- freedir.&RUNID._enctable (Dataset with subset of patient level encounter data.)
- freedir.&RUNID._enrtable (Dataset with subset of patient level enrollment data.)
- freedir.&RUNID._factable (Dataset with facility data.)
- freedir.&RUNID._labtable (Dataset with subset of patient level lab result data.)
- freedir.&RUNID._miltable (Dataset with subset of patient level mother-infant linkage data.)
- freedir.&RUNID._pretable (Dataset with subset of patient level prescribing data.)
- freedir.&RUNID._proctable (Dataset with subset of patient level procedure data.)
- freedir.&RUNID._pvdtable (Dataset with provider data.)
- freedir.&RUNID._signature_freezedata (Dataset produced when FREEZEDATA is specified containing metadata associated with the request.)
- freedir.&RUNID._vittable (Dataset with subset of patient level vital signs data.)
- msoc.&RUNID._runtimes (Dataset containing metrics on total run time, cohort creation run time, and run time for several program processes.)
- msoc.&RUNID._signature (Dataset containing metadata associated with the request, including request identifiers, program identifiers, database version, run time metrics, and SAS environment information.)
- msoc.&RUNID._t6_productsdates (Dataset for Type 6 analysis providing overview of the calendar dates that were computed and may have been used to compute various episode durations and switching metrics.)
- work._ptslist (Dataset containing eligible patients.)
- work._ptslist2 (Dataset containing eligible patients for type 4.)
- work.gi&ITGROUP. (Dataset with valid index date.)
- work.medspartition (Dataset containing patid and partition.)
- work.signature (Dataset containing metadata associated with the request, including request identifiers, program identifiers, database version, run time metrics, and SAS environment information.)
- worktemp.codextract (Dataset with cause of death data.)
Usage
%ms_cidanum(RUNID=&RUNID.,
PROJID=&PROJID.,
WPTYPE=&WPTYPE.,
WPID=&WPID.,
DPID=&DPID.,
VERID=&VERID.,
PERIODIDSTART=&PERIODIDSTART.,
PERIODIDEND=&PERIODIDEND.,
ANALYSIS=&ANALYSIS.,
MONITORINGFILE=&MONITORINGFILE.,
USERSTRATA=&USERSTRATA.,
COMBOFILE=&COMBOFILE.,
COHORTFILE=&COHORTFILE.,
COHORTCODES=&COHORTCODES.,
INCLUSIONCODES=&INCLUSIONCODES.,
STOCKPILINGFILE=&STOCKPILINGFILE.,
RUN_ENVELOPE=&RUN_ENVELOPE.,
FREEZEDATA=&FREEZEDATA.,
ZIPFILE=&ZIPFILE.,
LABCODESMAP=&LABCODESMAP.,
DISTINDEX=&DISTINDEX.,
TYPE1FILE=&TYPE1FILE.,
TYPE2FILE=&TYPE2FILE.,
TYPE3FILE=&TYPE3FILE.,
TYPE4FILE=&TYPE4FILE.,
PREGNANCYMETA=&PREGNANCYMETA.,
PREGNANCYCODES=&PREGNANCYCODES.,
PREGNANCYDURATION=&PREGNANCYDURATION.,
TYPE5FILE=&TYPE5FILE.,
TYPE6FILE=&TYPE6FILE.,
METADATAFILE=&METADATAFILE.,
SURVEILLANCEMODE=&SURVEILLANCEMODE.,
COVARIATECODES=&COVARIATECODES.,
UTILFILE=&UTILFILE.,
RISKSCOREFILE=&RISKSCOREFILE.,
RISKSCORECODES=&RISKSCORECODES.,
DRUGCLASSFILE=&DRUGCLASSFILE.,
PROFILE=&PROFILE.,
MFUFILE=&MFUFILE.,
MULTEVENTFILE=&MULTEVENTFILE.,
MULTEVENTFILE_ADHERE=&MULTEVENTFILE_ADHERE.,
CONCFILE=&CONCFILE.,
OVERLAPFILE=&OVERLAPFILE.,
OVERLAPFILE_ADHERE=&OVERLAPFILE_ADHERE.,
ITSFILE=&ITSFILE.,
TREATMENTPATHWAYS=&TREATMENTPATHWAYS.,
MICOHORTFILE=&MICOHORTFILE.,
TREEFILE=&TREEFILE.,
TREELOOKUP=&TREELOOKUP.,
ICD10ICD9MAP=&ICD10ICD9MAP.,
HDVARSEL_INPUT=&RUNID._claims_ICDDX09 &RUNID._claims_ICDDX10 &RUNID._claims_DRUGCLASS &RUNID._claims_CPT &RUNID._claims_ICDPX09 &RUNID._claims_ICDPX10 &RUNID._claims_HCPCS,
PSESTIMATIONFILE=&PSESTIMATIONFILE.,
PSMATCHFILE=&PSMATCHFILE.,
STRATIFICATIONFILE=&STRATIFICATIONFILE.,
COVSTRATFILE=&COVSTRATFILE.,
IPTWFILE=&IPTWFILE.,
PSCSSUBGROUPFILE=&PSCSSUBGROUPFILE.,
INDLEVEL=&INDLEVEL.,
DIAGNOSTICS=&DIAGNOSTICS.
);
- Parameters
-
[in] | RUNID | Run identifier to denote each execution of the program. |
[in] | PROJID | SOC-defined value. |
[in] | WPTYPE | SOC-defined value. |
[in] | WPID | SOC-defined value. |
[in] | DPID | SOC-defined value. |
[in] | VERID | SOC-defined value. |
[in] | PERIODIDSTART | Starting PERIODID from the MONITORINGFILE. |
[in] | PERIODIDEND | Ending PERIODID from the MONITORINGFILE. |
[in] | ANALYSIS | Indicates whether to perform tree extraction. |
[in] | MONITORNGFILE | Name of the SAS dataset that defines the relevant query periods for execution. |
[in] | USERSTRATA | Name of the SAS dataset that defines the stratifications to return in the MSOC folder. |
[in] | COMBOFILE | Name of the SAS dataset that will be used to create combination items. When this parameter is specified, "CODES" input files is required, and "STOCK" is optional. |
[in] | COHORTFILE | Name of the SAS dataset that defines how the cohort should be created (gaps, coverage,...). |
[in] | COHORTCODES | Name of the SAS dataset that includes the codes defining the cohort. |
[in] | INCLUSIONCODES | Name of the SAS dataset that includes the codes defining inclusions/exclusions. |
[in] | STOCKPILINGFILE | Name of the SAS dataset that defines how the stockpiling algorithm should be performed. |
[in] | RUN_ENVELOPE | Indicates if the envelope macro should include Adate or be turned off entirely. |
[in] | FREEZEDATA | Indicates if SDD patient data should be copied to DPLocal. |
[in] | ZIPFILE | Name of the SAS dataset that contains list of valid zip to geographical area mappings. |
[in] | LABCODESMAP | Name of the SAS dataset that contains laboratory matching information. |
[in] | DISTINDEX | Indicates if distribution of index defining codes should be output to MSOC folder. |
[in] | TYPE1FILE | Name of the SAS dataset that defines type 1 cohort parameters (washouts, cohortdef, ...). |
[in] | TYPE2FILE | Name of the SAS dataset that defines type 2 cohort parameters (washouts, cohortdef, ...). |
[in] | TYPE3FILE | Name of the SAS dataset that defines type 3 cohort parameters (washouts, cohortdef, ...). |
[in] | TYPE4FILE | Name of the SAS dataset that defines type 4 cohort parameters (washouts, cohortdef, ...). |
[in] | PREGNANCYMETA | Name of the SAS dataset that contains metadata on each pregnancy outcome for type 4 analyis. |
[in] | PREGNANCYCODES | Name of the SAS dataset that includes the codes for pregnancy outcomes. |
[in] | PREGNANCYDURATION | Name of the SAS dataset that includes the codes for length of pregnancy duration to outcome. |
[in] | TYPE5FILE | Name of the SAS dataset that defines type 5 cohort parameters (washouts, cohortdef, ...). |
[in] | TYPE6FILE | Name of the SAS dataset that defines type 6 cohort parameters (washouts, cohortdef, ...). |
[in] | METADATAFILE | Name of the SAS dataset that defines the metadata generated for each time period request for sequential analysis. |
[in] | SURVEILLANCEMODE | Indicates if the module should be executed in suveilance mode and which type. |
[in] | COVARIATECODES | Name of the SAS dataset that includes the codes associated with covariate exctraction. |
[in] | UTILFILE | Name of the SAS dataset that defines how medical and drug utilization metrics should be calculated. |
[in] | RISKSCOREFILE | Name of the SAS dataset that defines how the requested risk scores should be calculated. |
[in] | RISKSCORECODES | Name of the SAS dataset that includes the codes required to compute the requested risk scores. |
[in] | DRUGCLASSFILE | Name of the SAS dataset that lists NDCs by generic and class names and allows the program to count the number of distinct generic names and class names. |
[in] | PROFILE | Indicates if a covariate profile file should be produced. |
[in] | MFUFILE | Name of the SAS dataset that defines how MFU analysis should be performed. |
[in] | MULTEVENTFILE | Name of the SAS dataset that defines how a multiple events analysis should be performed. |
[in] | MULTEVENTFILE_ADHERE | Name of the SAS dataset that defines how adherence is calculated for a multiple events analysis. |
[in] | CONCFILE | Name of the SAS dataset that defines how concomitant episodes should be created and evaluated. |
[in] | OVERLAPFILE | Name of the SAS dataset that defines how secondary episode overlap of primary episodes should be evaluated. |
[in] | OVERLAPFILE_ADHERE | Name of the SAS dataset that defines how adherence is calculated for a overlapping episodes analysis. |
[in] | ITSFILE | Name of the SAS dataset that defines parameters for an Interupted Time Series (ITS) analysis. |
[in] | TREATMENTPATHWAYS | Name of the SAS dataset that defines how the switching module should be performed. |
[in] | MICOHORTFILE | Name of the SAS dataset that defines how Type 4 PSA/Mother-Infant cohorts will be created. |
[in] | TREEFILE | Name of the SAS dataset that defines parameters for tree extraction. |
[in] | TREELOOKUP | Name of the SAS dataset that defines the parent-child nodes for tree extraction. |
[in] | ICD10ICD9MAP | Name of the SAS dataset that maps ICD 9 to ICD 10 codes. |
[in] | HDVARSEL_INPUT | For requests calculating a HDPS, lists each data dimension dataset. |
[in] | PSESTIMATIONFILE | Name of the SAS dataset describing parameters for estimating a PS model. |
[in] | PSMATCHFILE | Name of the SAS dataset describing parameters for a PS Matching analysis. |
[in] | STRATIFICATIONFILE | Name of the SAS dataset describing parameters for a PS stratification analyses. |
[in] | COVSTRATFILE | Name of the SAS dataset describing parameters for a covariate stratification analyses. |
[in] | IPTWFILE | Name of the SAS dataset describing parameters for Inverse Probability Treatment Weight(IPTW) analyses. |
[in] | PSCSSUBGROUPFILE | Name of the SAS dataset describing parameters for subgroups within the PS/CS submodule. |
[in] | INDLEVEL | Indicates whether to return an individual level file after PS or Covariate Stratification analysis in the MSOC folder. |
[in] | DIAGNOSTICS | Indicates if proc logistic diagnostic output files should be generated. |
SAS Macros Dependencies
- Author
- Sentinel Coordinating Center (info@.nosp@m.sent.nosp@m.inels.nosp@m.yste.nosp@m.m.org)