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

This macro converts overlapping drug dispensings into non-overlapping dispensings. More...

Detailed Description

This macro converts overlapping drug dispensings into non-overlapping dispensings.

  • Create translation of format mapping to use to display ranges.
    • Parameter:
      • B ==> Segment/(or section) of the format specifications to be converted to words.
  • Parse the ranges specifications and create formats.
    • Parameters:
      • FMT ==> Format name.
      • A_ ==> User provided string defining the ranges.
    • Create format for mapping values into ranges.
    • Create format for translation of formated category into words.
    • Determine lowest level of the grouping variable to apply algorithm.
    • Determine if claims supply and amount are within allowable ranges.
    • Exclude dispensings with unacceptable values for days supplied and/or dispensed amount.
    • Check if excluded range: outside of allowable format values.
    • Ensure SAMEDAY parameter has valid values.
    • Determine which operator to use for same day supplies.
    • Force RxSup to 1 for non dispensing claims and discard them temporarily.
    • Compute strength for consolidating dispensings when dose analysis requested and manage quantities occuring on the same day.
    • Manage quantities occuring on the same day.
    • Adjust missing PERCENTDAYS parameter in the presence of stockpiling input file.
    • Adjust claim dates.
    • If no overlap then start new episode.
    • Get minimum CLMDATE for each StockEpisodes.
    • Keep old amt and supply to recalculate new amt.
    • Calculate new CLMAMT
    • Discard replaced claims (keep claims with positive supply).
    • Append excluded claims.
    • Append the procedures discarded above.
Program inputs
  • &INFILE. (Dataset with claims data to be stockpiled.)
Program outputs
  • &OUTFILE. (Dataset containing the stockpiled claims.)
  • &OUTFILEEXCL. (Dataset with excluded claims information.)

Usage

%ms_stockpiling(INFILE=_ITDrugs(where=(stockgroup in (&stock_list))),            
                CLMDATE=RxDate,                                 
                CLMSUP=RxSup,                                   
                CLMAMT=RxAmt,                                   
                PROCFLAG=,                                      
                PERCENTDAYS=&PERCENTDAYS.,    
                %if &computedose. = Y %then %do; strength = strength, %end;                               
                GROUPING=StockGroup indexcriteria dateonly 
                         %if %eval(&type. = 2) %then %do; fupcriteria %end;    
                         %else %if %eval(&type. = 3) %then %do; fupcriteria %end;                              
                         %else %if %eval(&type. = 4) %then %do; fupcriteria %end; 
                         %if &excl_incl = Y %then %do; 
                              &InclExclVars. %if &computepov3cumdose. = Y %then %do; mincumdose %end; %if &computepov3cfdd. = Y %then %do; mincfdd maxcfdd %end; 
                         %end;,                        
                SAMEDAY=&SAMEDAY.,                                  
                SUPRANGE=&SUPRANGE.,                                    
                AMTRANGE=&AMTRANGE.,
                ID=CODECAT &t6vars.,                                            
                OUTFILE=_ITDrugs_&z,       
                OUTFILEEXCL=_ITDrugsExcl_&z);
Parameters
[in]INFILEInput file with drug claims data.
[in]CLMDATEName of variable in INFILE used to identify the claim date.
[in]CLMSUPName of variable in INFILE used to identify the claim days of supply.
[in]CLMAMTName of variable in INFILE used to identify the claim amount dispensed.
[in]PROCFLAGName of variable used to identify claims other than dispensing claims in INFILE.
[in]PERCENTDAYSMaximum percentage of overlap to push claim date forward.
[in]STRENGTHName of variable in INFILE used to identify the claim strength.
[in]GROUPINGVariables in INFILE used to group claims.
[in]SAMEDAYSpecify how the final RxSup and RxAmt values will be determined in INFILE.
[in]SUPRANGERange of RxSup values that are allowed in INFILE.
[in]AMTRANGERange of RxAmt values that are allowed in INFILE.
[in]IDVariables from INFILE to keep that are not listed in the GROUPING parameter.
[out]OUTFILEOutput file with stockpiled claims.
[out]OUTFILEEXCLOutput file with excluded claims information.

SAS Macros Dependencies

None.

Note
Two different stockpiling algorithms are possible:
  • For the first stockpiling algorithm, the dispensing date of each overlapping claim is pushed forward to the end of days of supply of the previous dispensing.
  • For the second algorithm, users have the option to specify a maximum allowable overlap percentage which, if not exceeded, the algorithm will stockpile as in the first algorithm. Conversely, if the extent of the overlap is greater than the user-specified percentage, the first dispensing will end on the day prior to the second dispensing and the second dispensing will start on its original date.
Author
Sentinel Coordinating Center (info@.nosp@m.sent.nosp@m.inels.nosp@m.yste.nosp@m.m.org)