diff --git a/data/rxReservedKeywords.rda b/data/rxReservedKeywords.rda index 1ec5bb6b3..e05da3bbc 100644 Binary files a/data/rxReservedKeywords.rda and b/data/rxReservedKeywords.rda differ diff --git a/data/rxResidualError.rda b/data/rxResidualError.rda index 5a104fee5..1f9f7e2d7 100644 Binary files a/data/rxResidualError.rda and b/data/rxResidualError.rda differ diff --git a/data/rxSyntaxFunctions.rda b/data/rxSyntaxFunctions.rda index c88115476..f96214a93 100644 Binary files a/data/rxSyntaxFunctions.rda and b/data/rxSyntaxFunctions.rda differ diff --git a/inst/include/rxode2_model_shared.h b/inst/include/rxode2_model_shared.h index 073000d55..0f3d1e3bd 100644 --- a/inst/include/rxode2_model_shared.h +++ b/inst/include/rxode2_model_shared.h @@ -219,9 +219,14 @@ static inline double Rx_pow_di_(double a, double b, rx_solve *rx) { #define _logitInv1(x) expit(x, 0.0, 1.0) #define _logitInv2(x, y) expit(x, y, 1.0) #define _podo0() (_solveData->subjects[_cSub].curDose) +#define _podo00() (ISNA(_solveData->subjects[_cSub].curDose) ? 0 : _solveData->subjects[_cSub].curDose) #define _podo1(x) (_solveData->subjects[_cSub].curDoseS[x]) +#define _podo01(x) (ISNA(_solveData->subjects[_cSub].curDoseS[x]) ? 0 : _solveData->subjects[_cSub].curDoseS[x]) + #define _dose0() (_solveData->subjects[_cSub].curDose) #define _dose1(x) (_solveData->subjects[_cSub].curDoseS[x]) +#define _dose00() (ISNA(_solveData->subjects[_cSub].curDose) ? 0 : _solveData->subjects[_cSub].curDose) +#define _dose01(x) (ISNA(_solveData->subjects[_cSub].curDoseS[x]) ? 0 : _solveData->subjects[_cSub].curDoseS[x]) #define _tad0() (t-_solveData->subjects[_cSub].tlast) #define _tad1(x) (t-_solveData->subjects[_cSub].tlastS[x]) #define _tad00() (ISNA(_solveData->subjects[_cSub].tlast)? 0 : (t- _solveData->subjects[_cSub].tlast)) diff --git a/man/reexports.Rd b/man/reexports.Rd index 2857ff16d..8cba3d62e 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -38,4 +38,3 @@ below to see their documentation. \item{magrittr}{\code{\link[magrittr:pipe]{\%>\%}}} }} -\value{ Inherited from parent routine } diff --git a/src/genModelVars.h b/src/genModelVars.h index 60efbbc4f..26f76e958 100644 --- a/src/genModelVars.h +++ b/src/genModelVars.h @@ -250,6 +250,12 @@ static inline int sortStateVectorsErrHandle(int prop, int pass, int i) { if ((prop & propDose) != 0) { sAppend(&sbt, "'dose(%s)', ", buf); } + if ((prop & propPodo0) != 0) { + sAppend(&sbt, "'podo0(%s)', ", buf); + } + if ((prop & propDose0) != 0) { + sAppend(&sbt, "'dose0(%s)', ", buf); + } // Take off trailing "', sbt.o -= 2; sbt.s[sbt.o] = 0; diff --git a/src/parseFuns.h b/src/parseFuns.h index c3b36afcd..fc136758d 100644 --- a/src/parseFuns.h +++ b/src/parseFuns.h @@ -95,6 +95,9 @@ typedef struct transFunctions { int isDose; int isPodo; + int isDose0; + int isPodo0; + int isTfirst; int isTfirst0; @@ -140,6 +143,10 @@ static inline void transFunctionsIni(transFunctions *tf) { tf->isDose = 0; tf->isPodo = 0; + tf->isDose0 = 0; + tf->isPodo0 = 0; + + tf->isTfirst = 0; tf->isTfirst0 = 0; diff --git a/src/parseFunsDosing.h b/src/parseFunsDosing.h index 2ad5cfbe8..bb45fb6ff 100644 --- a/src/parseFunsDosing.h +++ b/src/parseFunsDosing.h @@ -36,7 +36,10 @@ static inline int isFunctionTadType(transFunctions *tf) { (tf->isTfirst0 = !strcmp("tfirst0", tf->v)) || (tf->isDose = !strcmp("dose", tf->v)) || - (tf->isPodo = !strcmp("podo", tf->v)); + (tf->isPodo = !strcmp("podo", tf->v)) || + + (tf->isPodo0 = !strcmp("podo0", tf->v)) || + (tf->isDose0 = !strcmp("dose0", tf->v)); } static inline int handleFunctionTadEmptyCcode(transFunctions *tf,char *v2) { if (allSpaces(v2)){ @@ -101,6 +104,10 @@ static inline int handleFunctionTadSingleStateCcode(transFunctions *tf,char *v2) tb.dprop[tb.id] += propDose; } else if (tf->isPodo && (tb.dprop[tb.id] & propPodo) == 0) { tb.dprop[tb.id] += propPodo; + } else if (tf->isPodo0 && (tb.dprop[tb.id] & propPodo0) == 0) { + tb.dprop[tb.id] += propPodo0; + } else if (tf->isDose0 && (tb.dprop[tb.id] & propDose0) == 0) { + tb.dprop[tb.id] += propDose0; } return 1; } diff --git a/src/tran.h b/src/tran.h index 38819f336..07585345b 100644 --- a/src/tran.h +++ b/src/tran.h @@ -389,4 +389,7 @@ char *getLine (char *src, int line, int *lloc); #define propPodo 8192 #define propDose 16384 +#define propPodo0 32768 +#define propDose0 65536 + #endif // __TRAN_H__