This macro converts overlapping drug dispensings into non-overlapping dispensings.
More...
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] | INFILE | Input file with drug claims data.
|
[in] | CLMDATE | Name of variable in INFILE used to identify the claim date.
|
[in] | CLMSUP | Name of variable in INFILE used to identify the claim days of supply.
|
[in] | CLMAMT | Name of variable in INFILE used to identify the claim amount dispensed.
|
[in] | PROCFLAG | Name of variable used to identify claims other than dispensing claims in INFILE. |
[in] | PERCENTDAYS | Maximum percentage of overlap to push claim date forward.
|
[in] | STRENGTH | Name of variable in INFILE used to identify the claim strength.
|
[in] | GROUPING | Variables in INFILE used to group claims.
|
[in] | SAMEDAY | Specify how the final RxSup and RxAmt values will be determined in INFILE.
|
[in] | SUPRANGE | Range of RxSup values that are allowed in INFILE.
|
[in] | AMTRANGE | Range of RxAmt values that are allowed in INFILE.
|
[in] | ID | Variables from INFILE to keep that are not listed in the GROUPING parameter.
|
[out] | OUTFILE | Output file with stockpiled claims. |
[out] | OUTFILEEXCL | Output 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)