-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BREAKING CHANGE: InjectionDynamics #1296
BREAKING CHANGE: InjectionDynamics #1296
Conversation
…imeconcentration-with-injectiondynamics-2
…imeconcentration-with-injectiondynamics-2
…imeconcentration-with-injectiondynamics-2
injection_eye: Side = Field(..., title="Injection eye") | ||
|
||
|
||
class IntraperitonealInjection(Injection): | ||
"""Description of an intraperitoneal injection procedure""" | ||
|
||
time: Optional[AwareDatetimeWithDefault] = Field(default=None, title="Injection time") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't remove the time here - it's not a duration field, it's the time when the injection is done. This is for the NBA project where they do timed injections prior to blood collection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added back
injection_duration: Optional[Decimal] = Field(default=None, title="Injection duration") | ||
injection_duration_unit: Optional[TimeUnit] = Field(default=None, title="Injection duration unit") | ||
dynamics: List[InjectionDynamics] = Field( | ||
..., title="Injection dynamics", description="List of injection events, pattern should match the profile" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe indicate one per injection depth or location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added to description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few small things
…imeconcentration-with-injectiondynamics-2
…imeconcentration-with-injectiondynamics-2
This PR introduces a new concept to the
Injection
class.InjectionDynamics
wrap thevolume
,rate
, andduration
together into a single class that is shared across all injections. The dynamics comes in because the fieldInjection.dynamics
accepts aList[InjectionDynamics]
, allowing people to describe in as much detail as they want the pattern of an injection -- if it's important. All existing injections can probably be ported simply as bolus injections.In addition I added a concept
InjectionProfile
which provides an english-language description of the type of injection. I gave it three options bolus/continuous/pulsed for different types of injection I've seen. There are probably more. A validator prevents users from putting multiple injection events in while describing it as a bolus injection.I also fixed several tests that turned out to not be working at all.