@@ -25,7 +25,7 @@ test_that("regimen with infusion correctly recalculates rates when bioavailabili
2525 bioav = 0.5
2626 )
2727 },
28- " Recalculating infusion rates "
28+ " Setting rate to be handled in NONMEM model "
2929 )
3030 expect_warning(
3131 regimen_to_nm(
@@ -46,7 +46,7 @@ test_that("regimen with infusion correctly recalculates rates when bioavailabili
4646 " RATE"
4747 )
4848 expect_true(all(expected_cols %in% colnames(b )))
49- expect_equal(b $ RATE , c(5 , 0 , 0 , 0 , 5 , 5 , 5 , 5 ))
49+ expect_equal(b $ RATE , c(- 1 , 0 , 0 , 0 , - 1 , - 1 , - 1 , - 1 ))
5050})
5151
5252test_that(" rate is calculated for any regimen with an infusion length" , {
@@ -65,7 +65,7 @@ test_that("rate is calculated for any regimen with an infusion length", {
6565 bioav = 0.5
6666 )
6767 },
68- " Recalculating infusion rates "
68+ " Setting rate to be handled in NONMEM model "
6969 )
7070 expect_message(
7171 {
@@ -76,7 +76,7 @@ test_that("rate is calculated for any regimen with an infusion length", {
7676 bioav = c(0.5 , 1 )
7777 )
7878 },
79- " Recalculating infusion rates "
79+ " Setting rate to be handled in NONMEM model "
8080 )
8181 expected_cols <- c(
8282 " ID" ,
@@ -90,9 +90,9 @@ test_that("rate is calculated for any regimen with an infusion length", {
9090 )
9191 expect_true(all(expected_cols %in% colnames(b )))
9292 expect_true(all(expected_cols %in% colnames(c )))
93- # in NONMEM, oral doses have a RATE of zero, which indicates a bolus dose
94- expect_equal(b $ RATE , c(0 , 0 , 0 , 0 , 0 , 10 , 10 , 0 ))
95- expect_equal(c $ RATE , c(0 , 0 , 0 , 0 , 0 , 10 , 20 , 0 ))
93+ # RATE is set to -1 for doses when bioav is specified, to let NONMEM handle rate calculation
94+ expect_equal(b $ RATE , c(- 1 , 0 , 0 , 0 , - 1 , - 1 , - 1 , - 1 ))
95+ expect_equal(c $ RATE , c(- 1 , 0 , 0 , 0 , - 1 , - 1 , - 1 , - 1 ))
9696})
9797
9898test_that(" throws warning when bioav specified as model parameter and need to convert RATE, but not when not needed" , {
@@ -109,7 +109,7 @@ test_that("throws warning when bioav specified as model parameter and need to co
109109 t_obs = c(1 , 2 , 3 ),
110110 bioav = c(" Fi" , 1 )
111111 )
112- }, " Recalculating infusion rates " )
112+ }, " Setting rate to be handled in NONMEM model " )
113113 a2 <- new_regimen(
114114 amt = 10 ,
115115 time = c(1 , 2 , 3 , 4 ),
0 commit comments