Repository navigation
Fix pk.calc.ceoi() for intervals with more than one dose row (#695) - #734
Closed
PavanLomati wants to merge 1 commit into
Closed
PavanLomati wants to merge 1 commit into
PavanLomati wants to merge 1 commit into
Conversation
…ed#695) pk.calc.ceoi() assumed a scalar duration.dose, so an interval with two infusion rows stopped pk.nca() with "the condition has length > 1". - Add a time.dose argument so the end of infusion is located as max(time.dose + duration.dose) among doses with duration.dose > 0. Bolus rows (zero or missing duration) are ignored, and infusions separated by a gap use the end of the last infusion. - Return NA with an exclude reason instead of a bare NA when there is no infusion, or no non-missing concentration at the end of the infusion. - Error on a negative duration.dose instead of treating it as no infusion. - Match the sample time with a small tolerance so sums like 0.1 + 0.2 still find a sample at 0.3. - ceoi now reports requires_dose_time = TRUE, so update the check.intervals expectation. Tests cover contiguous segments, a single infusion, a late-start infusion, bolus plus infusion, gaps, unsampled and missing end concentrations, invalid durations, and an end-to-end pk.nca() run.
Member
|
I think that multiple Ceoi measures within a period are not expected and would need to be handled as separate intervals. But, a duration should be validated to be non-negative (zero or greater). Can you please add that validation in a different PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
pk.calc.ceoi() assumed a scalar duration.dose, so an interval with two infusion rows stopped pk.nca() with "the condition has length > 1".
Tests cover contiguous segments, a single infusion, a late-start infusion, bolus plus infusion, gaps, unsampled and missing end concentrations, invalid durations, and an end-to-end pk.nca() run.