Correctly handle EVID4 doses at steady state with lag time #1262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EVID===4
resets the system and then doses.SS==1
advances the system to steady-state and then doses. The current behavior is thatEVID 4
records at steady state act just likeEVID 1
records at steady state; this was confirmed by testing against NONMEMs behavior.It was noted in #1261 that, when there is also a lag time for the dose, mrgsolve was dosing as immediately after reset rather than immediately after advancing to steady state. This PR fixes that behavior.
Some terminology / background
Armed
means there appears to be a dose at that time, but nothing is actually dosed; this is in place at the time of the apparent doseimplement
method, if the record is notArmed
, we just break out; there is nothing to reset and we don't want to go on and dose after that resetConfirming that we now match up with NONMEM here:
https://github.com/mrgsolve/nmtests/blob/master/dosing/dosing-vignette.md#23-reset-and-dose-evid-4-with-ss1-and-lag
And the mis-match prior to fixing here:
mrgsolve/nmtests@fc464d8#diff-f9292bfdbc09d870158ed0c0760957e19c4161d00f623e1c4b143ba83503a400
Also, there is a unit test showing that steady state doses with a lag time are identical whether EVID is 1 or 4.