Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Use handleInfusionStartDefault instead of _getDur for inf time
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Sep 16, 2023
1 parent fa4f7f7 commit ef52e51
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions inst/include/rxode2parseHandleEvid.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ extern "C" {
}

static inline int handleTlastInlineUpateDosingInformation(rx_solving_options_ind *ind, double *curDose, double *tinf) {
unsigned int p;
switch (ind->whI) {
case EVIDF_MODEL_RATE_ON: // modeled rate.
case EVIDF_MODEL_DUR_ON: // modeled duration.
Expand All @@ -279,8 +278,13 @@ extern "C" {
return 0;
} else {
// The amt in rxode2 is the infusion rate, but we need the amt

tinf[0] = _getDur(ind->ixds, ind, 2, &p);
int startIdx, endIdx, idx;
startIdx=endIdx=ind->ixds;
idx=ind->idx;
double amt = getDoseNumber(ind, idx);
handleInfusionStartDefault(&startIdx, &endIdx, &amt, &idx,
&rx_global, &op_global,ind);
tinf[0] = getAllTimes(ind, ind->idose[endIdx]) - getAllTimes(ind, ind->idose[startIdx]);
if (!ISNA(tinf[0])) {
curDose[0] = tinf[0] * curDose[0];
return 1;
Expand Down

0 comments on commit ef52e51

Please sign in to comment.