calDDDsAccumulation: Calculate subjects' total daily dosage drugs(DDDs)

View source: R/calDDDsAccumulation.R

calDDDsAccumulationR Documentation

Calculate subjects' total daily dosage drugs(DDDs)

Description

calDDDsAccumulation is a function to calculate subjects' accumulated daily dosage drugs(DDDs) in RxCui before last dispensed. getDDDs is a function to get DDDs in ATC code

Usage

calDDDsAccumulation(
  case,
  PatientIdColName = MemberId,
  DispensingColName = DispenseDate,
  AtcCodeColName = ATC,
  DailyDosageColName = DailyDosage,
  DurationColName = DaysSupply
)

getDDDs(atc)

Arguments

case

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

atc

data.frame include ATC code

Details

User can input data frame containing the patient id, dispensing date, the drug ATC code, drug supply days, and daily dose of the drug column. This function will output a data frame which store DDDs accumulated by patients.

Value

A new data.table accumulat_DDD with following columns.

MemberId patient Id

DDDs accumulated DDDs

Examples

# sample of calculating subjects' accumulated DDDs
accumulat_DDD <- calDDDsAccumulation(case = sample_data_subset_atc, PatientIdColName = MemberId,DispensingColName = DispenseDate,AtcCodeColName = ATC,DailyDosageColName = DailyDosage,DurationColName = DaysSupply)
head(accumulat_DDD)

DHLab-CGU/pharm documentation built on July 2, 2022, 7:16 a.m.