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

This macro finalizes the numerator dataset by doing final calculation and variables assessment. More...

Detailed Description

This macro finalizes the numerator dataset by doing final calculation and variables assessment.

  • Type 1, 2, and 6 cohort definition:
    • Summarize utilization overlapping _PtsMasterList episodes.
    • Process variables common to type 1, 2, and 6.
      • Censor due to enrollment.
      • Reset censor if episode truncated due to death and original enrollment did not occur on death date.
      • Censor due to death.
      • Censor due to query end.
      • Censor due to DP max.
    • Restrict cohort (if necessary).
    • Compute utilization.
    • Create final dataset.
      • Adjust enr_end for death (for denominators).
      • Time to censor from index date to earliest of disenrollment, death, DP max date, Query End Date.
    • Type 2 and 6:
      • Manage event and previnc.
      • If Autoprev = Y then flag data to identify first prevalent and incident episode.
        • If cohortdef = '01' then only keep the first prevalent and first incident episode per patid.
          • Assign previnc_def based on t2cohortdef value.
      • Merge with event/previnc data and restrict cohort if necessary before computing utilization.
        • The first event for an incident episode will always be less than or equal to the first event for a prevalent episode.
          • Remove incident events where IndexDt is greater than the Feventdt.
      • Compute utilization.
      • Create final dataset:
        • For type 2:
          • Create followuptime.
        • For type 6:
          • Create episodelength.
        • Adjust enr_end for death (for denoms).
        • Time to censor, from index date to earliest of disenrollment, death, DP max date, Query End Date.
        • Compute censoring criteria not handled in the t1t2t6commonprocessing macro.
          • Censor due to event.
          • Censor due to requester defined criteria.
          • Censor due to episode end date.
          • Compute TTC for tree extraction.
    • Finalize, restrict to current look:
      • Save episodes identified in prior look for attrition table.
    • Roll up to 1 row per patient per prevalent/incident data type (if requested).
    • Type 6:
      • Finalize dispensings.
        • Keep dispensings overlapping episodes and remove dispensings that do not meet inclusion/exclusion criteria.
  • Type 3 cohort definition:
    • Keep only valid IndexDt in master file.
    • 01: Cohort includes only the first exposure during the query period.
    • 03: Cohort includes all exposures until an event.
    • Analysis cohort will include incomplete post-index data availability criteria if reqdaysaftind not correctly specified.
    • Finalize, restrict to current look.
      • Save episodes identified in prior look for attrition table.
  • Type 4 cohort definition.
  • Type 5 cohort definition:
    • Enumerate censoring criteria.
      • Initialize censoring variables:
        • Censor due to enrollment.
        • Censor due to death.
        • Censor due to query end.
        • Censor due to DP max.
        • Censor due to requester defined criteria.
        • Censor due to episode end date.
    • Adjust enr_end for death.
    • Check if any continuous dose metrics are requested.
    • Reset computedose to N if dose measures not being computed (=Y if pov3 mincumdose is set).
    • Summarize utilization overlapping only final episodes.
    • Compute cfdd and cumulative dose metrics.
    • Merge demographics at index date.
    • Calculate GapLength and CumEpisodeLength.
    • Calculate months from study start.
    • Calculate AFDD categories.
    • Calculate cumulative dose and categorize.
    • Finalize _dispensings.
    • Assign CFDD categories.
Program inputs
  • work._agegroups (Dataset containing demographics at index date.)
  • work._deliveries (Dataset containing pregnancy outcomes.)
  • work._events (Dataset containing all events.)
  • work._firsteventdtinepisode (Dataset containing the first event in any episode.)
  • work._groupindex (Dataset containing all potential outcomes.)
  • work._groupindex2 (Dataset containing all potential outcomes (type 5).)
  • work._ptsmasterlist (Dataset with valid numerator observations.)
  • work._ptsmasterlist2 (Dataset with valid numerator observations (type 5).)
Program outputs
  • work._dispensings (Dataset containing dispensings overlapping episodes and without dispensings that do not meet inclusion/exclusion criteria.)
  • work._dispensings_sum (Dataset containing cumulative dispensings overlapping episodes and without dispensings that do not meet inclusion/exclusion criteria.)
  • work._episodelength (Dataset containing cumulative episode lengths.)
  • work._grouputilfile (Dataset containing utilization overlapping _PtsMasterList episodes.)
  • work._grouputilfile_sum (Dataset containing cumulative dose metrics.)
  • work._t&TYPE.priorlooks (Dataset containing episodes identified in prior look for attrition table.)

Usage

%ms_finalizeptsmasterlist();
Parameters
None.

SAS Macros Dependencies

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