calDDDsRange is a function to calculate subjects' accumulated daily dosage drugs(DDDs) in RxCui in custom interval period getDDDs is a function to get DDDs in ATC code

calDDDsRange(
  case,
  index_dayColName = Index_Day,
  expo_range_before = 36000,
  expo_range_after = 36000,
  idColName = MemberId,
  AtcCodeColName = ATC,
  DispenseDateColName = DispenseDate,
  DaysSupplyColName = DaysSupply,
  DailyDosageColName = DailyDosage
)

Arguments

case

data.frame include subjects' id, dispensing date, drug ATC code, daily dosage, duration

expo_range_before

days before observation day

expo_range_after

days after observation day

idColName

a column name for subject's id

DispenseDateColName

a column name for dispensing

DaysSupplyColName

a column name for supply day

DailyDosageColName

a column name for DDDs

index_day

observation day

Value

A new data.table index_DDD with following columns.

MemberId patient Id

Start_day the begin date of patient take medicine

Index_Day the begin date of calculating the DDDs

End_day the end date of patient take medicine

DDDs_Before_15_Days calculate DDDs in custom time interval before index 15 day

DDDs_After_30_Days calculate DDDs in custom time interval after index 30 day

Details

User can get the total amount of DDDs accumulated of patients before and after a specific date in a custom interval period or specific date.

Examples

# sample of calculating subjects' accumulated DDDs in a custom interval period index_DDD <- calDDDsRange(case = sample_data_subset_atc,index_dayColName = Index_Day,expo_range_before = 15,expo_range_after = 30,idColName = MemberId,AtcCodeColName = ATC,DispenseDateColName = DispenseDate,DaysSupplyColName = DaysSupply,DailyDosageColName = DailyDosage)
#> Error in calDDDsRange(case = sample_data_subset_atc, index_dayColName = Index_Day, expo_range_before = 15, expo_range_after = 30, idColName = MemberId, AtcCodeColName = ATC, DispenseDateColName = DispenseDate, DaysSupplyColName = DaysSupply, DailyDosageColName = DailyDosage): 找不到物件 'sample_data_subset_atc'
head(index_DDD)
#> Error in head(index_DDD): 找不到物件 'index_DDD'