Skip to content

Commit

Permalink
updated .sim_internal to call .add_outcome and use outcome columns, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Apr 25, 2024
1 parent 4cc709f commit de218bd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
8 changes: 5 additions & 3 deletions R/sim_internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
prob_infect,
onset_to_hosp = NULL,
onset_to_death = NULL,
onset_to_recovery = NULL,
hosp_risk = NULL,
hosp_death_risk = NULL,
non_hosp_death_risk = NULL,
Expand Down Expand Up @@ -109,20 +110,21 @@
onset_to_hosp = onset_to_hosp,
hosp_risk = hosp_risk
)
.data <- .add_deaths(
.data <- .add_outcome(
.data = .data,
onset_to_death = onset_to_death,
onset_to_recovery = onset_to_recovery,
hosp_death_risk = hosp_death_risk,
non_hosp_death_risk = non_hosp_death_risk
)

# add hospitalisation and death dates
.data$date_admission <- .data$hospitalisation + outbreak_start_date
.data$date_death <- .data$deaths + outbreak_start_date
.data$date_outcome <- .data$outcome_time + outbreak_start_date

linelist_cols <- c(
"id", "case_type", "sex", "age", "date_onset", "date_admission",
"date_death", "date_first_contact", "date_last_contact"
"outcome", "date_outcome", "date_first_contact", "date_last_contact"
)

if (add_names) {
Expand Down
16 changes: 12 additions & 4 deletions man/dot-sim_internal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit de218bd

Please sign in to comment.