R/calDDDsAccumulation.R, R/funPharm.R, R/getDDDs.R
calDDDsAccumulation.RdcalDDDsAccumulation 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
calDDDsAccumulation( case, PatientIdColName = MemberId, DispensingColName = DispenseDate, AtcCodeColName = ATC, DailyDosageColName = DailyDosage, DurationColName = DaysSupply ) getDDDs(atc)
| case | data.frame, include subjects' id, dispensing date, drug ATC code, daily dosage, duration |
|---|---|
| atc | data.frame include ATC code |
A new data.table accumulat_DDD with following columns.
MemberId patient Id
DDDs accumulated DDDs
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.
# sample of calculating subjects' accumulated DDDs accumulat_DDD <- calDDDsAccumulation(case = sample_data_subset_atc, PatientIdColName = MemberId,DispensingColName = DispenseDate,AtcCodeColName = ATC,DailyDosageColName = DailyDosage,DurationColName = DaysSupply)#> Error in calDDDsAccumulation(case = sample_data_subset_atc, PatientIdColName = MemberId, DispensingColName = DispenseDate, AtcCodeColName = ATC, DailyDosageColName = DailyDosage, DurationColName = DaysSupply): 找不到物件 'sample_data_subset_atc'#> Error in head(accumulat_DDD): 找不到物件 'accumulat_DDD'