# test data for drug_tx_by_visit()
hcv_treatment_decisions <- c("Waiting List",
"Initiation/ Re-initiation",
"Continuation same dose",
"Modification due to adverse event",
"Modification due to other reasons",
"Discontinuation due to adverse event",
"Discontinuation (Stop) for other reasons",
"Treatment finished",
"Not specified")
hiv_treatment_decisions <- c("Initiation/ Re-initiation",
"Continuation same dose",
"Modification of regimen",
"Stop all ARVs",
"Not specified")
hcv_treatment <- data.frame(
patient_id = c(1, 1, 1,
2, 2,
3, 3,
4,
5, 5, 5),
visit_date = lubridate::dmy(c("1/1/2010", "5/1/2010", NA_character_,
"12/12/2009", "1/1/2010",
"20/3/2011", "20/3/2011",
"12/6/2013",
"1/1/2017", "1/1/2017", "1/1/2017")),
tx_status = c("Eligible / Already under treatment", "Eligible / Already under treatment",
"Not eligible",
"Not eligible", "Not eligible",
"Follow up after treatment", "Follow up after treatment",
"Not eligible",
"Eligible / Already under treatment", "Eligible / Already under treatment", "Eligible / Already under treatment"),
tx_decision = c("Initiation/ Re-initiation", "Initiation/ Re-initiation", "Initiation/ Re-initiation",
"Modification due to adverse event", "Initiation/ Re-initiation",
"Initiation/ Re-initiation", "Initiation/ Re-initiation",
NA_character_,
"Initiation/ Re-initiation", "Initiation/ Re-initiation", "Initiation/ Re-initiation"),
tx_prescribed = c("SOF/DCV (FDC)", "GLE/PIB (FDC)", "SOF/DCV (FDC)",
"GLE/PIB (FDC)", "SOF/DCV (FDC)",
"Sofosbuvir (SOF)","Daclatasvir (DCV)",
"SOF/DCV (FDC)",
"Sofosbuvir (SOF)", "Ribavirin (RBV)", "Daclatasvir (DCV)"),
stringsAsFactors = FALSE
)
hiv_treatment <- data.frame(
patient_id = c(1, 2, 3, 3, 4, 5, 5),
visit_date = lubridate::dmy(c("1/1/2010", "12/12/2018", "6/3/2019", "6/3/2019", "7/1/2018",
"1/12/2013", "1/12/2013")),
tx_decision = c(hiv_treatment_decisions[1], hiv_treatment_decisions[2],
hiv_treatment_decisions[3], hiv_treatment_decisions[3],
hiv_treatment_decisions[1], hiv_treatment_decisions[1], hiv_treatment_decisions[1]),
tx_prescribed = c("ABC/3TC (FDC)", "Efavirenz (EFV)", "TDF/3TC/DTG (FDC)", "TDF/3TC/DTG (FDC)",
"ATV/r (FDC)", "Lamivudine (3TC)", "Tenofovir (TDF)"),
stringsAsFactors = FALSE
)
drug_tx_testdata <- list(hcv = hcv_treatment, hiv = hiv_treatment)
# save tb_month raw data for SQL testing db
saveRDS(drug_tx_testdata, "inst/testdata/testdata-drug_tx_by_visit.rds", version = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.