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

Commit

Permalink
Create and use new flag for added on/off dose to respect data-based flg
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Feb 7, 2024
1 parent 3e9b16b commit 4eb3660
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions inst/include/rxode2parseHandleEvid.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ extern "C" {
// xx = 30, Turn off compartment
// xx = 40, Steady state constant infusion
// xx = 50, Phantom event, used for transit compartments
// xx = 60, Dose that does not track as a dose turn on system
// Steady state events need a II data item > 0
#define EVID0_REGULAR 1
#define EVID0_RATEADJ 2
Expand All @@ -110,7 +111,7 @@ extern "C" {
#define EVID0_OFF 30
#define EVID0_SSINF 40
#define EVID0_PHANTOM 50

#define EVID0_ONDOSE 60

static inline void getWh(int evid, int *wh, int *cmt, int *wh100, int *whI, int *wh0){
*wh = evid;
Expand Down Expand Up @@ -229,8 +230,7 @@ static inline int handleTlastInlineUpateDosingInformation(rx_solving_options_ind
}
break;
}
if (curDose[0] == 0.0 &&
getEvidP1(ind, ind->idx) == 2) {
if (ind->wh0 == EVID0_ONDOSE) {
// evid=2 can add zero dose to turn on a compartment;
// therefore if the current dose is zero and the next evid = 2
// don't treat it as a new dose.
Expand Down
4 changes: 2 additions & 2 deletions src/etTran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1417,10 +1417,10 @@ List etTransParse(List inData, List mv, bool addCmt=false,
ndose++;
// + cmt needs to turn on cmts.
// This gives a zero dose to cmt
if (cmtCol != -1 && cmt > 0 && cmt <= baseSize){
if (cmtCol != -1 && cmt > 0 && cmt <= baseSize) {
// Turn on state with dose
id.push_back(cid);
evid.push_back(cevid);
evid.push_back(cevid-flg+60);
cmtF.push_back(cmt);
time.push_back(ctime);
amt.push_back(0.0);
Expand Down

0 comments on commit 4eb3660

Please sign in to comment.