****************************************************************************************************
* PROGRAM: create_lookup.sas
* Created (mm/dd/yyyy): 03/23/2021
*--------------------------------------------------------------------------------------------------
* PURPOSE: The macro creates all files that reside in the lookuptables folder. These are lookuptables
* used for processing, but cannot be modified by the user.
* Program outputs: The following lookuptables files are created:
* -lookup_footnotes = Footnotes for baseline, effect estimates, KM/CDF, concomitant use, and censor tables
* -lookup_attrition = Mapping QRP attrition descriptions to report descriptions
*--------------------------------------------------------------------------------------------------
* Sentinel Coordinating Center
* info@sentinelsystem.org
***************************************************************************************************;
/* Define libname for location of templatefiles folder */
data lookup.lookup_footnotes;
attrib type length = $10 format = $10.
order length = 3 format = 3.
description length = $575 format = $575.;
/* Footnotes for in Type 4 tables - applied to multiple tables*/
type = "type4"; order = -2; description = "Pregnancy is defined as a pregnancy that resulted in a live birth delivery identified using the method specified in the overview section of this report."; output;
type = "type4"; order = -1; description = "The non-pregnancy cohort includes patients without delivery codes during the pregnancy episode of the matched pregnant patient, who met all inclusion/exclusion criteria and were the same integer age on the last date of the matched pregnant patient's pregnancy episode."; output;
/* Footnotes for baseline table */
type = "baseline"; order = 1; description = "All metrics are based on total number of episodes per group, except for sex, race, and Hispanic origin which are based on total number of unique patients."; output;
type = "baseline"; order = 2; description = "&covar_characteristic. in blue show a standardized difference greater than &sdthreshold.."; output;
type = "baseline"; order = 3; description = "Covariates in italics were not included in the propensity score logistic regression model."; output;
type = "baseline"; order = 4; description = "Weighted patient characteristics tables facilitate the assessment of covariate balance after propensity score (PS) stratum weighting and should not be interpreted as a description of the unweighted population. Treated/control patients are weighted by the proportion of the total patient population included in their PS stratum divided by the proportion of the total treated/control patient population included in their PS stratum."; output;
type = "baseline"; order = 5; description = "Weighted patient characteristics tables facilitate the assessment of covariate balance after propensity score (PS) stratum weighting and should not be interpreted as a description of the unweighted population. Treated patients are assigned a weight of 1, and control patients are weighted by the proportion of the total treated patient population included in their PS stratum divided by the proportion of the total control patient population included in their PS stratum."; output;
type = "baseline"; order = 6; description = "Weighted patient characteristics tables facilitate the assessment of covariate balance after propensity score (PS) stratification and should not be interpreted as a description of the unweighted population. Treated/control patients are weighted by the proportion of the total patient population included in their PS stratum divided by the proportion of the total treated/control patient population included in their PS stratum."; output;
type = "baseline"; order = 7; description = "Weighted patient characteristics tables facilitate the assessment of covariate balance after inverse probability weighting and should not be interpreted as a description of the unweighted population. Treated patients are weighted by the inverse of their propensity score (PS), while reference patients are weighted by the inverse of 1 minus their PS."; output;
type = "baseline"; order = 8; description = "Weighted patient characteristics tables facilitate the assessment of covariate balance after inverse probability weighting and should not be interpreted as a description of the unweighted population. Treated patients are weighted by the proportion of treated patients in the trimmed population divided by the inverse of their propensity score (PS). Reference patients are weighted by 1 minus the proportion of treated patients in the trimmed population divided by 1 minus their PS."; output;
type = "baseline"; order = 9; description = "Weighted patient characteristics tables facilitate the assessment of covariate balance after inverse probability weighting and should not be interpreted as a description of the unweighted population. Treated patients are assigned a weight of 1. Reference patients are weighted by their propensity score (PS) divided by 1 minus their PS."; output;
type = "baseline"; order = 10; description = "With variable ratio matching, each exposed subject is matched to a variable number of comparator subjects. The weight for each treated subject equals 1. The weight for each control subject equals the inverse of the matching ratio for that specific matched set."; output;
type = "baseline"; order = 11; description = "Baseline period in reference to user-defined index date (start of first valid exposed pregnancy resulting in live birth delivery, exposure date, or delivery date)."; output;
type = "baseline"; order = 12; description = "Value represents the proportion of episodes with first switch."; output;
type = "baseline"; order = 13; description = "Value represents the proportion of first switch episodes with second switch."; output;
type = "baseline"; order = 14; description = "Value represents standard deviation where no % follows the value."; output;
type = "baseline"; order = 15; description = "Race data may not be completely populated at all Data Partners; therefore, data about race may be incomplete."; output;
type = "baseline"; order = 16; description = 'Includes members classified as having an unknown race by the Data Partner and patients in race categories where the total member count is between one and ten.'; output;
type = "baseline"; order = 17; description = "Gestational age estimated using a claims-based algorithm, previously validated in the Medication Exposure in Pregnancy Risk Evaluation Program (MEPREP), to identify pregnancies ending in a live birth. ICD-10-CM diagnosis codes indicative of weeks of gestation, and ICD-9-CM and ICD-10-CM diagnosis codes for pre-term and post-term deliveries, were used to calculate the length of the pregnancy episode. Codes had to occur within 7 days of a delivery date in the inpatient setting. In absence of pre-/post-term codes, pregnancy duration was set to 273 days."; output;
type = "baseline"; order = 18; description = "The Charlson/Elixhauser Combined Comorbidity Score is calculated based on comorbidities observed during a requester-defined window around the exposure episode start date. (Gagne JJ, Glynn RJ, Avorn J, Levin R, Schneeweiss S. A combined comorbidity score predicted mortality in elderly patients better than existing scores. J Clin Epidemiol. 2011;64(7):749-759)"; output;
/* Footnotes for L2 effect estimates table */
type = "effectest"; order = 1; description = "All values in this section are weighted."; output;
type = "effectest"; order = 2; description = "Race data may not be completely populated at all Data Partners; therefore, data about race may be incomplete."; output;
type = "effectest"; order = 3; description = "Delivery status based on algorithm-derived pregnancy duration."; output;
type = "effectest"; order = 4; description = "&weightscheme. = &weightschemelong.."; output;
/* Footnotes for attrition table */
type = "attrition"; order = 1; description = '&claim_level_descr. can meet multiple inclusion and/or exclusion criteria; therefore, the total number of %sysfunc(lowcase(&claim_level_descr.)) excluded overall may not equal the sum of all %sysfunc(lowcase(&claim_level_descr.)) in each criterion.'; output;
/* Footnotes for KM/CDF figures */
type = "kmcdf"; order = 1; description = 'A single episode may contribute to multiple categories if a patient was censored due to multiple criteria on the same day.'; output;
/* Footnotes for type 1, type 2 and concomitant use tables */
type = "t1t2conc"; order = 1; description = "Race data may not be completely populated at all Data Partners; therefore, data about race may be incomplete."; output;
type = "t1t2conc"; order = 2; description = 'Eligible Members are reflective of the number of patients that met all cohort entry criteria on at least one day during the query period.'; output;
type = "t1t2conc"; order = 3; description = 'Eligible Member-Days are reflective of the number of patients that met all cohort entry criteria on at least one day during the query period.'; output;
type = "t1t2conc"; order = 4; description = 'Eligible Member-Years are reflective of the number of patients that met all cohort entry criteria on at least one day during the query period.'; output;
type = "t1t2conc"; order = 5; description = 'Eligible Member-Days and Member-Years are reflective of the number of patients that met all cohort entry criteria on at least one day during the query period.'; output;
type = "t1t2conc"; order = 6; description = 'Eligible Members and Member-Years are reflective of the number of patients that met all cohort entry criteria on at least one day during the query period.'; output;
type = "t1t2conc"; order = 7; description = 'Eligible Members and Member-Days are reflective of the number of patients that met all cohort entry criteria on at least one day during the query period.'; output;
type = "t1t2conc"; order = 8; description = 'Eligible Members, Member-Days, and Member-Years are reflective of the number of patients that met all cohort entry criteria on at least one day during the query period.'; output;
type = "t1t2conc"; order = 9; description = 'Includes members classified as having an unknown race by the Data Partner and patients in race categories where the total member count is between one and ten.'; output;
/* Footnotes for type 5 tables and figures (note - dose table footnotes query specific and are generated in t5tables_createdata */
/* order = 1 reserved for dose footnotes*/
type = "t5tablefig"; order = 2; description = 'Includes members classified as having an unknown race by the Data Partner and patients in race categories where the total member count is between one and ten.'; output;
/* Footnotes for types 1, 2, 5, and 6 censor tables */
type = "censor"; order = 1; description = "An episode may be censored due to more than one reason if they occur on the same date. Therefore, the sum of the reasons for censoring may be greater than the total number of episodes."; output;