Package 'oncmap'

Title: Analyze Data from Electronic Adherence Monitoring Devices
Description: Medication adherence, defined as medication-taking behavior that aligns with the agreed-upon treatment protocol, is critical for realizing the benefits of prescription medications. Medication adherence can be assessed using electronic adherence monitoring devices (EAMDs), pill bottles or boxes that contain a computer chip that records the date and time of each opening (or “actuation”). Before researchers can use EAMD data, they must apply a series of decision rules to transform actuation data into adherence data. The purpose of this R package ('oncmap') is to transform EAMD actuations in the form of a raw .csv file, information about the patient, regimen, and non-monitored periods into two daily adherence values -- Dose Taken and Correct Dose Taken.
Authors: Michal Kouril [aut, cre] , Meghan McGrady [aut] , Mara Constance [aut] , Kevin Hommel [aut]
Maintainer: Michal Kouril <[email protected]>
License: MIT + file LICENSE
Version: 0.1.5
Built: 2025-01-27 23:35:23 UTC
Source: CRAN

Help Index


Pre-process time data for adherence

Description

Pre-process time data for adherence

Usage

adherence_preprocess(
  timestamps,
  regimen,
  patinfo = list(),
  nonmonit = data.frame()
)

Arguments

timestamps

Input timestamps - vector of timestamps

regimen

Regimen - regimen definition

patinfo

Patient info - patient specific information

nonmonit

Non-monitored date intervals

Value

A list of output variables

  • all_periods - Processed timestamps into periods applying input parameters.


Adherence input format definitions

Description

Defines input format parameters to apply when reading input files.

Usage

input_formats

Format

One input format per row described by the following variables:

skip_header_lines

double Number of lines to skip before reading data

header_line_patientid

character Regex to apply to the header line to extract patient ID

patientid_filename

logical Patient id is embedded in the filename

deviceid_header

character Device ID column in the input data

headers

character Comma separated list of expected column headers

patientid_header

character Patient ID column in the input data

datetime_header

character Actuation Date/Time column in the input data

datetime_format

character Actuation Date/Time format

filter

character Inclusion/Exclusion filter to apply on the input data

tz_colon_fix

logical Fix for when TZ contains with ':'


Process input file and return adherence report

Description

Process input file and return adherence report

Usage

process_eamd(
  infile,
  include_formats = NULL,
  exclude_formats = NULL,
  formats_def = NULL,
  infile_data_output = FALSE,
  regimen = NULL,
  patinfo = NULL,
  nonmonit = NULL,
  med = "",
  adhstart = NULL,
  adhend = NULL
)

Arguments

infile

Input CSV file name

include_formats

Which formats to include in checking

exclude_formats

Which formats to exclude from checking

formats_def

New formats definition

infile_data_output

Include infile data frame in the result

regimen

Regimen - regimen definition

patinfo

Patient info - patient specific information

nonmonit

Non-monitored date intervals

med

Medication name

adhstart

Report adherence start date

adhend

Report adherence end date

Value

A list containing variables:

  • report - Per period adherence statistic

  • adh - Summary adherence statistic

Examples

input_file <- system.file('extdata', 'sample-data-ecap2.csv', package = 'oncmap')
  report <- process_eamd("tests/testthat/ecap1.csv")

Read input file

Description

Read input file

Usage

read_input(
  infile,
  include_formats = NULL,
  exclude_formats = NULL,
  formats_def = NULL,
  infile_data_output = FALSE
)

Arguments

infile

Input CSV file name

include_formats

Which formats to include in checking

exclude_formats

Which formats to exclude from checking

formats_def

New formats definition

infile_data_output

Include infile data frame in the result

Value

A list of output variables

  • format - Detected input format name

  • format_def - Detected format definition

  • patient_id - Extracted patient_id

  • device_id - Extracted device_id

  • data - Extracted timestamps

  • log - Log of the format detection

  • infile_data - Raw input data

Examples

input_file <- system.file('extdata', 'sample-data-ecap2.csv', package = 'oncmap')
  input <- read_input("tests/testthat/ecap1.csv")

Adherence regimens definitions

Description

Defines built-in regimen definitions.

Usage

regimens

Format

One regimen per row described by the following variables:

name

character A name of the regimen

doses_per_period

integer Number of doses per period

periods_per_day

integer Number of periods per day

min_wait

integer Minimum wait time (in seconds) between actuations

days_per_week

integer Number of active days per week

weekdays

string Specific days per week when active


Report standarized output of the adherence processing

Description

Report standarized output of the adherence processing

Usage

report_adherence(
  all_periods,
  timestamps,
  med,
  patinfo = list(),
  adhstart = NULL,
  adhend = NULL
)

Arguments

all_periods

output of pre_adherence processing

timestamps

timestamps dataframe from pre_adherence to calculate times and diffs in the report

med

Medication name

patinfo

Patient info - patient specific information

adhstart

Report adherence start date

adhend

Report adherence end date

Value

A list of output variables

  • report - Per period adherence statistic

  • adh - Summary adherence statistic