Patent Description:
Document <CIT> discloses systems, devices, and methods for determination of an insulin dose to be administered to a patient based on an algorithm that considers physiologically relevant processes. The dose is determined taking into account a "correction factor" representing patient specific sensitivity to insulin, as well as active "insulin on board". This document does not disclose an insulin correction factor that is based on the sum of the past actual therapeutic exogenous substance deliveries over a number of delivery cycles versus the expected insulin needs for the user based on their total daily therapeutic exogenous substance amounts.

Therefore, it would be beneficial if there were a system and processes that accounted for the reduced production of endogenous insulin.

In one aspect, an automatic drug delivery device, includes a processor, and a reservoir configured to contain a therapeutic exogenous medicament or substance. The automatic drug delivery device also includes a pump mechanism communicatively coupled to the processor and fluidically coupled to the reservoir. The automatic drug delivery device also includes a memory coupled to the processor and configured to store a substance delivery history and programming code that, when executed by the processor, configure the drug delivery device to estimate an amount of a therapeutic exogenous substance to deliver, determine an insulin adjustment factor utilizing an estimated therapeutic exogenous substance concentration, wherein the estimated relative therapeutic exogenous substance concentration is determined based on the sum of the past actual therapeutic exogenous substance deliveries over a number of delivery cycles versus the expected insulin needs for the user based on their total daily therapeutic exogenous substance amounts, accounting for the decay and/or absorption of the exogenous insulin within the body over time, calculate a compensating dose of the therapeutic exogenous substance based on the estimated amount of the therapeutic exogenous substance to deliver that is adjusted by the insulin adjustment factor, and causing the calculated compensating dose of the therapeutic exogenous substance to be expelled from the reservoir by the pump mechanism.

In another aspect, a method includes estimating, by a processor of an automatic drug delivery device, an amount of a therapeutic exogenous substance to deliver, determining an insulin adjustment factor utilizing an estimated therapeutic exogenous substance concentration, wherein the estimated relative therapeutic exogenous substance concentration is determined based on the sum of the past actual therapeutic exogenous substance deliveries over a number of delivery cycles versus the expected insulin needs for the user based on their total daily therapeutic exogenous substance amounts, accounting for the decay and/or absorption of the exogenous insulin within the body over time, calculating a compensating dose of the therapeutic exogenous substance based on the estimated amount of the therapeutic exogenous substance to deliver adjusted by an insulin adjustment factor, and causing the calculated compensating dose of the therapeutic exogenous substance to be expelled from a reservoir by a pump mechanism.

In a further aspect, an automatic drug delivery device includes processor, a reservoir configured to contain a therapeutic exogenous substance. The automatic drug delivery device also includes a pump mechanism communicatively coupled to the processor and fluidically coupled to the reservoir. The automatic drug delivery device also includes a memory coupled to the processor and configured to store a substance delivery history and programming code that, when executed by the processor, configure the drug delivery device to calculate a substance correction constraint based on an analyte measurement value, a user's target analyte measurement setting, and a substance sensitivity factor, determine a maximum substance concentration based on the substance correction constraint, determine an estimated therapeutic exogenous substance concentration based on delivery of the therapeutic exogenous substance over a set number of delivery cycles, determine an insulin adjustment factor using the maximum substance concentration and the estimated therapeutic exogenous substance concentration, determine an amount of a therapeutic exogenous substance to deliver based on an analyte measurement value of a user, calculate a compensating dose of the therapeutic exogenous substance based the amount of the therapeutic exogenous substance to deliver and the insulin adjustment factor, and causing the calculated compensating dose of the therapeutic exogenous substance to be expelled from the reservoir by the pump mechanism.

In yet another aspect, a method includes obtaining, by a processor of an automatic drug delivery device, an analyte measurement value of a user, calculating a substance correction constraint based on the analyte measurement value, a user's target analyte measurement setting, and a substance sensitivity factor, determining a maximum substance concentration based on the substance correction constraint, determining an insulin adjustment factor to account for production of an endogenous insulin related to a therapeutic exogenous substance administered by the automatic drug delivery device, calculating a compensating dose of the therapeutic exogenous substance based on the estimated amount of the therapeutic exogenous substance to deliver adjusted by an insulin adjustment factor, and expelling the compensating dose of the therapeutic exogenous substance from the reservoir by the pump mechanism.

In an additional aspect, a non-transitory computer-readable storage medium including instructions that, when executed by a processor, cause the processor to obtain, by a processor of an automatic drug delivery device, an analyte measurement value of a user, calculate a substance correction constraint based on the analyte measurement value, a user's target analyte measurement setting, and a substance sensitivity factor, determine a maximum substance concentration based on the substance correction constraint, determine a insulin adjustment factor utilizing the substance correction constraint, calculate a compensating dose of the therapeutic exogenous substance based on an estimated amount of the therapeutic exogenous substance to deliver adjusted by the insulin adjustment factor, and expel the compensating dose of the therapeutic exogenous substance from the reservoir by the pump mechanism.

In one more aspect, an automatic drug delivery system includes a processor, and a reservoir configured to contain a therapeutic exogenous substance. The automatic drug delivery system also includes a pump mechanism communicatively coupled to the processor and fluidically coupled to the reservoir. The automatic drug delivery system also includes a memory coupled to the processor and configured to store a substance delivery history and programming code that, when executed by the processor, configure the drug delivery device to estimate an amount of a therapeutic exogenous substance to deliver, determine an insulin adjustment factor utilizing an estimated therapeutic exogenous substance concentration, calculate a compensating dose of the therapeutic exogenous substance based on the estimated amount of the therapeutic exogenous substance to deliver that is adjusted by the insulin adjustment factor, and causing the calculated compensating dose of the therapeutic exogenous substance to be expelled from the reservoir by the pump mechanism.

In the following description, various embodiments of the present disclosure are described with reference to the following drawings, in which:.

Systems, devices, computer-readable medium and methods in accordance with the present disclosure will now be described more fully hereinafter with reference to the accompanying drawings, where one or more embodiments are shown. The systems, devices, and methods may be embodied in many different forms and are not to be construed as being limited to the embodiments set forth herein. Instead, these embodiments are provided so the disclosure will be thorough and complete, and will fully convey the scope of methods and devices to those skilled in the art. Each of the systems, devices, and methods disclosed herein provides one or more advantages over conventional systems, components, and methods.

Various examples provide a method, a system, a device and a computer-readable medium for responding to inputs provided by sensors, such as an analyte sensor, and users of an automatic drug delivery system. "Analyte sensor" may refer to a wearable device that includes sensing and measurement devices configured to detect different analytes in a user's body and particularly in the user's blood, as well as other analytes as described herein. The various devices and sensors that may be used to implement some specific examples may also be used to implement different therapeutic regimens using different drugs than those described in the specific examples.

In one example, the disclosed methods, system, devices or computer-readable medium may perform actions related to managing a user's blood glucose by incorporating an estimated therapeutic drug (such as insulin, glucagon, glucagon-like peptide, or the like) concentration term in automatic therapeutic delivery algorithms to account for endogenous production of an endogenous counterpart or complimentary substance, such as endogenous insulin, to the therapeutic drug, such as exogenous insulin. Said differently, when exogenous insulin is administered to the body, the body responds by not producing as much natural, or endogenous insulin. The effect of the exogenous insulin on the endogenous insulin and the overall insulin generated is an aspect of the present disclosure. A benefit of the disclosed devices, systems, techniques and processes implemented via medication delivery algorithms or applications (MDA), and specifically, AID algorithms for T2DM patients, accounted for the described changes in endogenous insulin delivery for optimal glucose control outcomes. In addition to providing for optimal glucose control outcomes, the following examples mitigate the inefficient delivery of exogenous insulin thereby reducing the waste of a valuable resource. Moreover, the described examples also potentially mitigate adverse physiological reactions and minimize continuous drastic physiological responses to underdelivering or overdelivering exogenous insulin.

The disclosed examples provide techniques that may be used with any additional algorithms or computer applications that manage blood glucose levels and insulin therapy. These algorithms and computer applications may be collectively referred to as "medication delivery algorithms" or "medication delivery applications" and may be operable to deliver different categories of drugs (or medications), such as chemotherapy drugs, pain relief drugs, diabetes treatment drugs (e.g., insulin, glucagon and/or glucagon-like peptides), blood pressure medication, or the like.

A type of medication delivery algorithm (MDA) may include an "artificial pancreas" algorithm-based system, or more generally, an artificial pancreas (AP) application. For ease of discussion, the computer programs and computer applications that implement the medication delivery algorithms or applications may be referred to herein as an "AP application. " An AP application may be configured to provide automatic delivery of insulin based on an analyte sensor input, such as signals received from an analyte sensor, such as a continuous blood glucose monitor, or the like. In an example, the artificial pancreas (AP) application when executed by a processor may enable monitoring of a user's blood glucose measurement values, determine an appropriate level of insulin for the user based on the monitored glucose values (e.g., blood glucose concentrations or blood glucose measurement values) and other information, such as information related to, for example, a correction factor or substance sensitivity factor, and take actions to maintain a user's blood glucose value within an appropriate range. "Insulin adjustment factor" may refer to a value that is used to adjust or modify the dosage of the therapeutic exogenous substance to offset or account for an effect of endogenous production of endogenous insulin related to the therapeutic exogenous substance. "Substance sensitivity factor" may refer to a value that quantifies a user's ability to metabolize a therapeutic exogenous substance. "Therapeutic exogenous substance" may refer to a substance that is input into the body of the user subcutaneously, intraperitoneally, or intravenously. Examples include insulin, glucagon, glucagon-like peptides, chemotherapy drugs, high blood pressure medications, fertility medications, pain medications, hormones, and the like. "Endogenous insulin" may refer to insulin that is produced in a user's body (i.e., endogenously). A target analyte measurement setting, such as a target blood glucose measurement value setting of the particular user may alternatively be a range of blood glucose measurement values that are appropriate for the particular user. "Target analyte measurement setting" may refer to a value or a range of values that are appropriate for a user's condition, such as approximately <NUM>/dL to approximately <NUM>/dL for diabetes, which the automatic drug delivery system attempts to maintain through management of deliveries of therapeutic exogenous substances, such as insulin and the like. For example, a target blood glucose measurement value may be acceptable if it falls within the range of <NUM>/dL to <NUM>/dL, which is a range satisfying a clinical standard of care for treatment of diabetes. In addition, an AP application as described herein may determine when a user's blood glucose wanders into the hypoglycemic range (e.g., below <NUM>/dL) or the hyperglycemic range (e.g., above <NUM>/dL).

As described in more detail with reference to the examples of <FIG>, an automatic drug delivery system may be configured to deliver compensating doses of a therapeutic exogenous substance that account for production of endogenous insulin that is related to the therapeutic exogenous substance. "Compensating dose" may refer to an amount of a therapeutic exogenous substance that has been calculated using a dosage of the therapeutic exogenous substance generated by a medication delivery algorithm and an insulin adjustment factor. For ease of discussion, insulin is referred to as the therapeutic exogenous substance of interest, but the techniques and devices described herein may be used to address a similar problem with other therapeutic substances.

Endogenous insulin production is constantly changing, and prior to the techniques and processes described herein, endogenous delivery of insulin in T2DM patients was not typically accounted for when delivering insulin.

The following examples provide an automatic insulin delivery algorithm or application that provides an estimated dosage of the therapeutic exogenous substance that accounts for the endogenous production of insulin.

<FIG> shows in a graph the response of a type <NUM> diabetic person's endogenous insulin secretion when exogenous insulin was delivered to the user throughout the day. The graph shows that endogenous insulin delivery can be reduced by up to <NUM>% or more compared to a user's peak endogenous insulin delivery values depending on the exogenous insulin deliveries. The three long vertical lines represent times when the user ate a meal. In general, <FIG> shows that the endogenous production of insulin of a person with type <NUM> diabetes decreases in the presence of exogenous insulin. <FIG> was obtained from <NPL>. Glucose Turnover After Replacement of Usual Therapy by Insulin in Insulin-naive Type <NUM> Diabetes Subjects, and is presented to better elucidate the problem that is addressed by the disclosed subject matter as discussed in the following paragraphs and illustrated in the accompanying figures.

An automatic drug delivery device (shown in another figure) may include a processor, a reservoir, a pump mechanism and a memory. The reservoir may be configured to contain a therapeutic exogenous substance, such as insulin, glucagon-like peptide, pramlintide, or a combination two or more of them. The pump mechanism may be communicatively coupled to the processor and fluidically coupled to the reservoir. The memory may also be coupled to the processor and be configured to store a substance delivery history and programming code that, when executed by the processor, configure the drug delivery device to perform processes, techniques and functions, such as those described herein. "Substance delivery history" may refer to a data structure that includes a number of amounts of a substance delivered to the body of a user, delivery times of when respective amounts of the substance was delivered, analyte measurement values corresponding to the delivery times, and the like. Substances include insulin, therapeutic exogenous substances and the like. "Analyte measurement value" may refer to a measurement of an analyte that has been output from the analyte sensor.

<FIG> illustrates a flowchart of an example process according to aspect of the disclosed subject matter.

A processor of an automatic drug delivery device or automatic drug delivery system when executing programming code stored in the memory is configured to implement process <NUM>. In block <NUM>, the processor may be operable to estimate an amount of a therapeutic exogenous substance, such as those discussed above, to deliver to a user. For example, the therapeutic exogenous substance may be insulin, and the processor may execute programming code, such as an MDA or AP application, that makes the processor operable to receive analyte measurement values, such as blood glucose measurement values or the like, from an analyte sensor and use of the analyte measurement values along with other factors, such as historical analyte measurement values, parameters or constraints, in the estimation of the amount of the therapeutic exogenous substance. It may be helpful to describe an example in which insulin is the therapeutic exogenous substance.

In block <NUM>, the processor upon implementing process <NUM> may determine an insulin adjustment factor utilizing an estimated therapeutic exogenous substance concentration. "Estimated relative therapeutic exogenous substance concentration," which may also be referred to as "relative insulin concentration," may refer to the sum of the past actual therapeutic exogenous substance (e.g., insulin) deliveries over a number of delivery cycles versus the expected insulin needs for the user based on their total daily therapeutic exogenous substance amounts or needs, accounting for the decay and/or absorption of the exogenous insulin within the body over time due to pharmacokinetics or pharmacodynamics of insulin. "Delivery cycle" may refer to a period of time during which different functions are performed by the automatic drug delivery system that may begin with receipt of an analyte measurement value and end with delivery of a dose of a therapeutic exogenous substance, such as a compensating dose of insulin (e.g., that compensates for a high blood glucose level or consumption of a meal). The automatic drug delivery device may also include where the processor is further configured to determine the estimated relative therapeutic exogenous substance concentration (i.e., estimated relative insulin concentration) using a total daily amount of the therapeutic exogenous substance (i.e., insulin) that maintained an analyte measurement value of the user within the range of their target analyte measurement setting.

In an example, the estimated relative insulin concentration may be determined using a number of calculations as shown in the following equation (Eq. <NUM>): <MAT> where Ic is the estimated relative insulin concentration, I(i) is an amount of therapeutic exogenous substance, in this case insulin, delivered over the period from i to h, where h is a tuning factor, and TDI is representative of a total amount of therapeutic exogenous substance delivered in a day, where TDI in the specific example, is the total daily insulin, which is the total amount of insulin delivered over a preset period of time, usually a day (<NUM> hours). The word "relative" in the term "estimated relative insulin concentration (Ic)" may refer to the calculation of the insulin delivery that the user has received relative to the user's typical basal delivery. "Tuning factor" may refer to a number of delivery cycles that provide a representative input into a user's compliance with the target analyte measurement setting. The tuning factor h may be a selected number of delivery cycles, such as <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, or the like.

Programming code in the memory executed by the processor may configure the processor to determine the estimated relative insulin concentration Ic by completing Eq <NUM>. In the numerator of Eq. <NUM>, a sum of an amount past actual delivery of the therapeutic exogenous substance over a predetermined number of delivery cycles, where the predetermined number of delivery cycles is indicated by tuning factor h. For use in the denominator, the processor may calculate a per cycle delivery amount, i.e., <MAT> (where each cycle is <NUM> minutes and hence <NUM> cycles in an hour) by using a total amount of the therapeutic exogenous substance (i.e., TDI) that has been delivered to the user over the course of the preset or predetermined time period (e.g., <NUM> hours).

Returning to the evaluation of Eq. <NUM>, the processor may apply the tuning factor h to the calculated per cycle delivery amount to obtain a divisor. The sum of an amount past actual delivery of the therapeutic exogenous substance over a predetermined number of delivery cycles is divided by the divisor. The resulting quotient of the dividing is stored in the memory as the estimated relative therapeutic exogenous substance concentration (i.e., Ic) of Equation <NUM>.

In an example, the processor may be further configured to determine whether the estimated relative therapeutic exogenous substance concentration Ic has a value within a maximum boundary and a minimum boundary. The maximum boundary may be set at a predetermined percentage of a user's total daily estimated relative therapeutic exogenous substance concentration, which may be a value such as <NUM>%, <NUM>%, <NUM>%, or the like. The percentage when represented as a decimal may be <NUM>, <NUM>, <NUM>, or the like. The minimum boundary may also be a predetermined percentage of a user's total daily estimated relative therapeutic exogenous substance concentration Ic but has a value lower than the maximum boundary. The minimum boundary may be a percentage such as <NUM>%, <NUM>%, <NUM>%, <NUM>%, or the like, which when represented by a decimal value may be <NUM>, <NUM>, <NUM>, <NUM>, or the like.

In response to the value of the estimated relative therapeutic exogenous substance concentration being between or within the maximum and minimum boundaries (i.e., less than the maximum boundary (also referred to as a maximum adjustment factor) but greater than the minimum boundary (also referred to as a minimum adjustment factor)), the processor may set the correction factor, although, it is more appropriately referred to as an insulin adjustment factor (i.e., Icfactor) to be equal to the estimated relative insulin concentration or the estimated relative therapeutic exogenous substance concentration. For example, the result of estimated relative therapeutic exogenous substance concentration Ic from Eq. <NUM> above may be approximately <NUM>. The processor may be operable to evaluate the estimated relative therapeutic exogenous substance concentration Ic result according to the following equation (Eq. <NUM>) to determine the correction factor: <MAT>.

As shown in Eq. <NUM>, the processor of the automatic drug delivery device may further be configured to determine a minimum value between the estimated relative therapeutic exogenous substance concentration or a value of the maximum insulin adjustment factor (i.e., min (Ic, <NUM>)). Once the determination of the minimum value between the estimated relative therapeutic exogenous substance concentration or a value of the maximum insulin adjustment factor is made, the processor may further evaluate the determined minimum value.

In an example in which the therapeutic exogenous substance is insulin and the estimated relative therapeutic exogenous substance concentration is an estimated insulin concentration. For example, the estimated relative insulin concentration Ic may be <NUM>. In the evaluation of Eq. <NUM> in such an example with the estimated relative insulin concentration Ic being <NUM>, the minimum value between the estimated relative insulin concentration Ic value of <NUM> and <NUM> is the estimated relative insulin concentration Ic value of <NUM>. The processor continuing to evaluate Eq. <NUM> and may further determine a maximum between the minimum value and the minimum boundary, which in the above example of Eq. <NUM> is <NUM>. The processor, in response to the value of the estimated relative insulin concentration being greater than the value of the minimum boundary, set the insulin adjustment factor to be equal to the value of the estimated relative insulin concentration, which in this example is <NUM>.

Alternatively, in an example where the estimated relative insulin concentration Ic is <NUM>, the processor, when determining the minimum function, may in response to the value of the estimated relative insulin concentration Ic (i.e., <NUM>) being greater than the maximum boundary (i.e., <NUM>), the processor may set the insulin adjustment factor Icfactor to be equal to the value of the maximum insulin adjustment factor, such as <NUM> in this case. This is evident by working through the maximum and minimum functions in Eq. <NUM>. With the estimated relative insulin concentration Ic value being <NUM> in this example, the minimum function returns a value of <NUM> and the maximum function which evaluates the values <NUM> and <NUM> returns the <NUM> as the setting for the Icfactor of Eq. <NUM>.

Or, in a further alternative of the evaluation of Eq. <NUM>, the estimated relative insulin concentration may be <NUM>. The processor, in response to the value of the estimated relative therapeutic exogenous substance concentration (i. e, the estimated relative insulin concentration of <NUM>) being less than the value of the minimum boundary (e.g., <NUM> in Eq. <NUM>), may set the insulin adjustment factor Icfactor to be equal to a value of an estimated relative insulin concentration, which is <NUM> in this example.

In block <NUM>, the processor may calculate a compensating dose of the therapeutic exogenous substance based on the estimated amount of the therapeutic exogenous substance to deliver either based on or modified using the insulin adjustment factor Icfactor. For example, the processor may calculate the compensating dose according to the following equation (Eq. <NUM>): <MAT> where IAID is the estimated amount of the therapeutic exogenous substance to deliver, Icfactor is the insulin adjustment factor, and Ifinal is the compensating dose.

The compensating dose may be calculated to counteract an effect of reduced production of an endogenous insulin that is the compliment to the therapeutic exogenous substance. In more detail, the delivery of amounts of the therapeutic exogenous substance may cause the user's body to produce less of the endogenous insulin because the body reacts to the presence of the therapeutic exogenous substance. As a result, the processor when calculating the compensating dose of the therapeutic exogenous substance may be configured to modify the estimated amount of the therapeutic exogenous substance using the insulin adjustment factor.

In a further example, a memory coupled to the processor may be configured to store a substance delivery history. The substance delivery history may be a record of the doses of the therapeutic exogenous substance, including previous compensating doses, that have been delivered to the user over a period of time. The period of time may be a number of hours, days, weeks, or months, or a number of delivery cycles, such as <NUM>, <NUM>, <NUM>, or the like. In the further example, the processor may obtain, from the substance delivery history stored in the memory, a total amount of the therapeutic exogenous substance that has been delivered to a user over the course of a predetermined time period. Based on the obtained total amount of the therapeutic exogenous substance, the processor may determine a total daily amount of the therapeutic exogenous substance that maintains the user within range of a target analyte measurement setting, such as <NUM> to <NUM>/dL or the like.

The processor may be communicatively coupled to a pump mechanism. The automatic drug delivery system may, in addition to including the processor and pump mechanism include a reservoir. The reservoir may be configured to contain the therapeutic exogenous substance. The pump mechanism may be operable to expel the therapeutic exogenous substance in response to commands from the processor. In block <NUM>, the processor executing process <NUM> may cause a pump mechanism to expel the calculated compensating dose of the therapeutic exogenous substance from a reservoir.

In addition, or alternatively, the insulin adjustment factor Icfactor can be incorporated as a multiplier to the Type-<NUM> diabetic's open loop insulin deliveries as well. For example, the user may determine a dosage of insulin to deliver and the insulin adjustment factor may be applied according the above described processes.

In the following examples, the calculated compensating dose may be limited to a maximum level to mitigate increases that may be due primarily to feedback in the process <NUM>. The processor executing process <NUM> may cause the processor when calculating the compensating dose of the therapeutic exogenous substance to modify the estimated amount of the therapeutic exogenous substance using the insulin adjustment factor Icfactor.

<FIG> illustrates a flowchart of another example process according to another exemplary aspect of the disclosed subject matter. In an example, a processor of an automatic drug delivery device executing programming code may be configured to implement process <NUM>. In block <NUM>, the processor of the automatic drug delivery device may obtain an analyte measurement value (e.g., a blood glucose measurement value at time t, or EGV(t)) of a user. The processor may receive the analyte measurement value from an analyte sensor that is communicatively coupled to the processor. Alternatively, the processor may retrieve the analyte measurement value from a memory that is communicatively coupled to the processor. In some examples, the analyte measurement value retrieved from the memory may be an estimate of the analyte measurement value based on previous analyte measurement values received from the analyte sensor.

In block <NUM>, the processor may be configured to calculate a substance correction constraint (Icorr) based on the analyte measurement value (EGV(t)), a user's target analyte measurement setting (e.g., the user's set point at time t, or SP(t)), and a substance sensitivity factor (which may be calculated by <NUM>/TDI). A "substance correction constraint" may refer to a value that is indicative of how closely a user's analyte measurement values are to remaining within a threshold range of the user's target analyte measurement setting. For example, the processor may determine the substance correction constraint (Icorr) by evaluating an equation such as Eq. <NUM>, as follows: <MAT>.

For example, the processor may determine a difference between the analyte measurement value (EGV(t)) and a target analyte measurement setting (SP(t)) of a user of the automatic drug delivery device. The processor may divide the difference (EGV(t)-SP(t)) by the substance sensitivity factor (<NUM>/TDI), wherein a quotient resulting from the dividing is the substance correction constraint (Icorr).

In block <NUM>, a processor implementing process <NUM> may determine a maximum substance concentration (IC,Max) based on the substance correction constraint. "Maximum substance concentration (IC,Max)" may refer to a maximum setting for the substance concentration based on a number of factors including amount of the substance onboard and the substance correction constraint. For example, the maximum substance concentration (IC,Max) may be determined using an equation such as Eq. <NUM>, as follows: <MAT>.

In the example of Equation <NUM>, the processor may determine a maximum (max(Icorr, IOB(t))) between the substance correction constraint (Icorr) and a substance on board parameter (e.g., insulin on board or within the body at time t, or IOB(t)). "A substance on board parameter" may refer to an amount of a substance, such as insulin in the body of a user. The substance on board parameter accounts for amounts of a therapeutic exogenous substance that may have not yet been metabolized by the user's body. The processor may further divide the substance correction constraint (Icorr) by the determined maximum (max (Icorr, IOB(t))). The processor may be further operable to determine a minimum between a constant term (e.g., one (<NUM>)) and a quotient of the division of the substance correction constraint by the determined maximum and multiply determined minimum by a predetermined factor (e.g., <NUM>). The value <NUM>, in the example, is considered a primary value and may be representative of <NUM> percent of IC,max. The processor may add the primary value (which in this case is <NUM>, but may be <NUM>, <NUM>, or the like) to the result of the multiplying of the determined minimum by a predetermined factor to obtain the maximum substance concentration (IC,Max). In an example of a Type-<NUM> diabetic, Eq. <NUM> indicates that the originally stated maximum threshold, <NUM>, can be adjusted down to <NUM> if there is already sufficient insulin delivered or the user's glucose concentration is close to or below the setpoint.

In block <NUM>, process <NUM> determines an insulin adjustment factor (Icfactor) utilizing substance correction constraint. The insulin adjustment factor Icfactor may be determined using an equation such as Eq. <NUM>: <MAT>.

In determining the insulin adjustment factor, the processor may obtain the maximum substance concentration (IC,Max) that was calculated using the substance correction constraint (Icorr). The processor may determine a minimum between estimated relative insulin concentration (Ic) and the maximum substance concentration (IC,Max). A maximum (max (min (Ic, IC,Max), <NUM>)) of the determined minimum between Ic and IC,Max and a lower correction boundary (e.g., <NUM>) may be determined. The processor may set the determined maximum as the insulin adjustment factor Icfactor.

In block <NUM>, process <NUM> calculates a compensating dose of the therapeutic exogenous substance based on an estimated amount of the therapeutic exogenous substance to deliver, adjusted by the insulin adjustment factor Icfactor. The compensating dose Ifinal may, for example, be calculated using Eq. <NUM> from above, which is: <MAT>.

In block <NUM>, a control signal may be generated by the processor in completion of the process <NUM> that causes the pump mechanism to expel the compensating dose (Ifinal) of the therapeutic exogenous substance from the reservoir. The control signal may contain information, such as the compensating dose, a timing for delivery of the compensating dose, and the like.

In the automatic insulin delivery algorithm or application, the estimated insulin concentration Ic may increase due to significant periods of elevated therapeutic delivery prior to a current cycle, thus in turn increase current therapeutic delivery of insulin, up to a physiological limit for reduction in endogenous insulin deliveries.

<FIG> illustrates a flowchart of an example of a detailed process according to another exemplary aspect of the disclosed subject matter. In the example of <FIG>, the therapeutic exogenous substance may be insulin. As an alternative embodiment, a maximum adjustment of the insulin delivery factor can be limited to never exceed a certain proportion of the user's TDI as shown in equation <NUM> (Eq. <NUM>) below. Specifically, the insulin adjustment factor Icfactor can be further limited by reviewing the sum of the user's past insulin deliveries versus the threshold of <NUM>% (e.g., <NUM>) higher than the estimated total delivery based on the user's TDI. Namely, this can be considered as a "constraint" on the value of the estimated relative insulin concentration Ic. This also reduces the risk of overdelivery in case of large manual boluses by automatically limiting the insulin adjustment factor Icfactor from behaving more aggressively than desired until h cycles have passed.

In this example described with reference to <FIG>, the maximum adjustment of the insulin adjustment factor Icfactor can be bounded based on the estimated endogenous insulin delivery values. Specifically, although the endogenous insulin delivery values are reduced by exogenous insulin delivery, endogenous insulin delivery values may also be increased based on the user's current glucose concentrations due to the natural feedback of the user's endocrine system. Consequently, any increases in insulin delivery due to the insulin adjustment factor Icfactor can be applied only up to insulin requests that may not exceed the endogenous insulin delivery that would have occurred without the antagonistic effects of the exogenous insulin delivery.

The processor may implement process <NUM> to determine the maximum adjustment for the insulin adjustment factor Icfactor to a final insulin adjustment factor Ic,final using the following (Eq. <NUM>): <MAT>.

In the implementation of the process <NUM>, the processor may obtain, for example, from a substance delivery history stored in a memory, a total amount of a therapeutic exogenous substance that has been delivered to a user over a preset time period.

During execution of process <NUM> at block <NUM>, the processor may calculate a per cycle amount of the therapeutic exogenous substance delivered over a preset or predetermined time. In Eq. <NUM>, TDI represents the total amount of the therapeutic exogenous substance that has been delivered to the user over the preset time period. The preset time period may be one day, <NUM> hours, <NUM> hours, or the like. The constant value of <NUM> represents the number of cycles that occur in <NUM> hour period when a delivery cycle is <NUM> minutes. When the delivery cycle is <NUM> minutes, there are <NUM> cycles in <NUM> hour (<NUM> minutes) and <NUM> cycles in <NUM> hours. Of course, if the preset time period changes from <NUM> day or <NUM> hours, the constant value changes from <NUM> accordingly. The per cycle amount of the therapeutic exogenous substance, is determined by dividing the TDI by the constant value <NUM>.

In block <NUM>, the processor may multiply the per cycle amount, a tuning factor h and a maximum threshold value (e.g., <NUM>) together.

Process <NUM> in block <NUM> may cause the processor to determine an amount of the therapeutic exogenous substance delivered over a period of time equal to the tuning factor, which is a sum of an amount past actual delivery of the therapeutic exogenous substance over a period of time corresponding to the tuning factor h. The period of time, for example, may be measured from i to h, where i = zero or one, and h is a number of delivery cycles. The delivery cycles, in this example, are <NUM>-minute increments.

At block <NUM>, the result from the multiplying (of the per cycle amount, a tuning factor h and a maximum threshold value (e.g., <NUM>)) is compared to the determined amount of the therapeutic exogenous substance delivered over a period of time equal to the tuning factor h.

In block <NUM>, based on a result of the comparing, the processor may set the maximum adjustment of the insulin adjustment factor by providing a final insulin adjustment factor Icfinal. For example, the processor in response to a result of the comparing indicating that the result is less than or equal to the determined amount of the therapeutic exogenous substance delivered over a period of time equal to the tuning factor, may set the final insulin adjustment factor to one. Alternatively, the processor in response to result of the comparing indicating that the result (of <NUM> × h × (TDI/<NUM>)) is greater than the determined amount of the therapeutic exogenous substance delivered over a period of time from i to the tuning factor h, may set the final insulin adjustment factor Ic,final as the insulin adjustment factor Icfactor. The insulin adjustment factor Icfactor was initially determined to account for a decrease in the user's body's production of the endogenous insulin as a result of the therapeutic exogenous substance administered by the automatic drug delivery device.

It may be helpful to understand the implementation of the various techniques and processes to review an example of a system suitable for implementing the techniques and processes described with reference to <FIG>.

<FIG> illustrates a functional block diagram of a system example suitable for implementing the example processes and techniques described herein.

The automatic drug delivery system <NUM> may implement (and/or provide functionality for) a medication delivery algorithm (MDA), such as an artificial pancreas (AP) application, to govern or control automated delivery of a drug or medication, such as insulin, to a user (e.g., to maintain euglycemia - a normal level of glucose in the blood). The drug delivery system <NUM> may be an automated drug delivery system that may include a wearable automatic drug delivery device <NUM>, an analyte sensor <NUM>, and a controller <NUM>.

The system <NUM>, in an optional example, may also include a smart accessory device <NUM>, such as a smartwatch, a personal assistant device or the like, which may communicate with the other components of system <NUM> via either a wired or wireless communication links <NUM>, <NUM> and <NUM>.

The controller <NUM> may be a computing device such as a smart phone, a tablet, a personal diabetes controller, a dedicated diabetes therapy controller, or the like. In an example, the controller <NUM> may include a processor <NUM>, a controller memory <NUM>, a user interface <NUM>, and a communication device <NUM>. The controller <NUM> may contain analog and/or digital circuitry that may be implemented as a processor <NUM> for executing processes based on programming code stored in the controller memory <NUM>, such as the medication delivery algorithm or application (MDA) <NUM>, to manage a user's blood glucose levels and for controlling the delivery of the drug, medication, or therapeutic agent to the user as well as other functions, such as calculating carbohydrate-compensation dosage, a correction bolus dosage and the like as discussed above. The controller <NUM> may be used to program, adjust settings, and/or control operation of the wearable automatic drug delivery device <NUM> and/or the analyte sensor <NUM> as well as the optional smart accessory device <NUM>.

The processor <NUM> may also be configured to execute programming code stored in the controller memory <NUM>, such as the MDA <NUM>. The MDA <NUM> may be a computer application that is operable to deliver a drug based on information received from the analyte sensor <NUM>, the cloud-based services <NUM> and/or the controller <NUM> or optional smart accessory device <NUM>. The memory <NUM> may also store programming code to, for example, operate the user interface <NUM> (e.g., a touchscreen device, a camera or the like), the communication device <NUM> and the like. The processor <NUM> when executing the MDA <NUM> may be configured to implement techniques and processes related to determining insulin adjustment factors, estimated relative therapeutic exogenous substance concentrations or the estimated relative insulin concentrations, maximum and minimum values, tuning (or tunable) factors, control signals, and the like. The user interface <NUM> may be under the control of the processor <NUM> and be configured to present a graphical user interface that enables the input and output of blood glucose target settings, tuning factors, bolus doses, a selection of whether the user is a Type <NUM> or a Type <NUM> diabetic, and the like as described above. For example, in response to an indication the user is a Type <NUM> diabetic, the processes of <FIG> may be implemented by a respective instance of the MDA, such as <NUM>, <NUM>, <NUM> or <NUM>.

In a specific example, when the MDA <NUM> is an artificial pancreas (AP) application, the processor <NUM> is also configured to execute a diabetes treatment plan (which may be stored in a memory) that is managed by the MDA <NUM> stored in memory <NUM>. In addition to the functions mentioned above, when the MDA <NUM> is an AP application, it may further provide functionality to enable the processor <NUM> to determine a dosage of a therapeutic exogenous substance, such as insulin, based on prior dosages of the therapeutic exogenous substance administered by the drug delivery device <NUM> and the like according to a diabetes treatment plan. In addition, as an AP application, the MDA <NUM> provides functionality to enable the processor <NUM> to output signals to the wearable automatic drug delivery device <NUM> to deliver the determined bolus and basal dosages described with reference to the examples of <FIG>.

The communication device <NUM> may include one or more transceivers such as Transceiver A <NUM> and Transceiver B <NUM> and receivers or transmitters that operate according to one or more radio-frequency protocols. In the example, the transceivers <NUM> and <NUM> may be a cellular transceiver and a Bluetooth® transceiver, respectively. For example, the transceiver A <NUM> or transceiver B <NUM> may be configured to receive and transmit signals containing information usable by the MDA <NUM>.

The controller <NUM> may include a user interface <NUM>, which may be a keypad, a touchscreen display, levers, light-emitting diodes, buttons on a housing of the controller <NUM>, a microphone, a camera, a speaker, a display, or the like, that is configured to allow a user to enter information and allow the controller <NUM> to output information for presentation to the user (e.g., alarm signals or the like). The user interface <NUM> may provide inputs, such as a voice input, a gesture (e.g., hand or facial) input to a camera, swipes to a touchscreen, or the like, to processor <NUM> which the programming code interprets.

The wearable automatic drug delivery device <NUM>, in the example system <NUM>, may include a user interface <NUM>, a processor <NUM>, a pump mechanism <NUM>, a communication device <NUM>, a memory <NUM>, a power source <NUM>, and a reservoir <NUM>. The wearable automatic drug delivery device <NUM> may be configured to perform and execute the processes described in the examples of <FIG> without input from the controller <NUM> or the optional smart accessory device <NUM>. As explained in more detail, the processor <NUM> may be operable, for example, implement the processes of <FIG> as well as determine an amount of insulin delivered, IOB, insulin remaining, and the like. The processor <NUM> alone may implement the processes of <FIG> as well as determine an amount of insulin delivered, IOB, insulin remaining, and the like, such as control insulin delivery, based on an input from the analyte sensor <NUM>.

The memory <NUM> may store programming code executable by the processor <NUM>. The programming code, for example, may enable the processor <NUM> to control expelling insulin from the reservoir <NUM> and control the administering of doses of medication based on signals from the MDA <NUM> or, external devices, if the MDA <NUM> is configured to implement the external control signals.

The reservoir <NUM> may be configured to store drugs, medications or therapeutic agents suitable for automated delivery, such as diabetes treatment drugs (e.g., insulin, glucagon, glucagon-like peptides), pain relief drugs (e.g., morphine), hormones, blood pressure medicines, chemotherapy drugs, or the like.

In an example, the wearable automatic drug delivery device <NUM> includes a communication device <NUM>, which may be a receiver, a transmitter, or a transceiver that operates according to one or more radio-frequency protocols, such as Bluetooth, Wi-Fi, a near-field communication standard, a cellular standard, or the like. The processor <NUM> may, for example, communicate with the personal diabetes controller <NUM> and the analyte sensor <NUM> via the communication device <NUM>.

The wearable automatic drug delivery device <NUM> may be attached to the body of a user, such as a patient or diabetic, at an attachment location and may deliver any therapeutic exogenous substance, including any drug, therapeutic, or medicine, such as insulin, glucagon, glucagon-like peptide, or the like, to a user at or around the attachment location. A surface of the wearable automatic drug delivery device <NUM> may include an adhesive to facilitate attachment to the skin of a user as described in earlier examples.

The wearable automatic drug delivery device <NUM> may, for example, include a reservoir <NUM> for storing the drug (such as insulin), a needle or cannula (not shown in this example) for delivering the drug into the body of the user (which may be done subcutaneously, intraperitoneally, or intravenously), and a pump mechanism <NUM> for transferring the drug from the reservoir <NUM> through a needle or cannula and into the user. The pump mechanism <NUM> may be fluidly coupled to reservoir <NUM>, and communicatively coupled to the processor <NUM>.

The wearable automatic drug delivery device <NUM> may further include a power source <NUM>, such as a battery, a piezoelectric device, other forms of energy harvesting devices, or the like, for supplying electrical power to the pump mechanism <NUM> and/or other components (such as the processor <NUM>, memory <NUM>, and the communication device <NUM>) of the wearable automatic drug delivery device <NUM>.

In some examples, the wearable automatic drug delivery device <NUM> may include a user interface <NUM>, which may be a keypad, a touchscreen display, levers, light-emitting diodes, buttons on a housing of the drug delivery device <NUM>, a microphone, a camera, a speaker, a display, or the like, that is configured to allow a user to enter information and allow the drug delivery device <NUM> to output information for presentation to the user (e.g., alarm signals or the like). The user interface <NUM> may provide inputs, such as a voice input, a gesture (e.g., hand or facial) input to an optical sensor, swipes to a touchscreen, or the like, to processor <NUM> which the programming code interprets.

When configured to communicate to an external device, such as the controller <NUM> or the analyte sensor <NUM>, the wearable automatic drug delivery device <NUM> may receive signals over the wired or wireless link <NUM> from the controller <NUM> or <NUM> from the analyte sensor <NUM>. The processor <NUM> of the wearable automatic drug delivery device <NUM> may receive and process the signals from the respective external devices as described with reference to the examples of <FIG> as well as implementing delivery of a drug to the user according to a diabetes treatment plan or other drug delivery regimen.

In an operational example, the processor <NUM> when executing the MDA <NUM> may output a control signal operable to actuate the pump mechanism <NUM> to deliver a compensation dosage of insulin, a bolus, a revised basal dosage or the like as described with reference to the examples of <FIG>.

The smart accessory device <NUM> may be, for example, a smart watch, another wearable smart device, including eyeglasses, provided by other manufacturers, a global positioning system-enabled wearable, a wearable fitness device, smart clothing, or the like. Similar to the controller <NUM>, the smart accessory device <NUM> may also be configured to perform various functions including controlling the wearable automatic drug delivery device <NUM>. For example, the smart accessory device <NUM> may include a communication device <NUM>, a processor <NUM>, a user interface <NUM> and a memory <NUM>. The user interface <NUM> may be a graphical user interface presented on a touchscreen display of the smart accessory device <NUM>. The memory <NUM> may store programming code to operate different functions of the smart accessory device <NUM> as well as an instance of the MDA <NUM>. The processor <NUM> that may execute programming code, such as MDA <NUM> for controlling the wearable automatic drug delivery device <NUM> to implement the processes and techniques of <FIG> described herein.

The analyte sensor <NUM> may include a controller <NUM>, a memory <NUM>, a sensing/measuring device <NUM>, a user interface <NUM>, a power source/energy harvesting circuitry <NUM>, and a communication device <NUM>. The analyte sensor <NUM> may be communicatively coupled to the processor <NUM> of the controller <NUM> or processor <NUM> of the wearable automatic drug delivery device <NUM>. The memory <NUM> may be configured to store information and programming code, such as an instance of the MDA <NUM>.

The analyte sensor <NUM> may be configured to detect multiple different analytes, such as lactate, ketones, uric acid, sodium, potassium, alcohol levels, blood glucose, proteins, hormones, or the like, and output results of the detections, such as measurement values or the like. The analyte sensor <NUM> may, in an example, be configured to measure the blood glucose value at a predetermined time interval, such as every <NUM> minutes, or the like. The communication device <NUM> of analyte sensor <NUM> may have circuitry that operates as a transceiver for communicating the measured blood glucose values to the controller <NUM> over a wireless link <NUM> or with wearable automatic drug delivery device <NUM> over the wireless communication link <NUM>. While called an analyte sensor <NUM>, the sensing/measuring device <NUM> of the analyte sensor <NUM> may include one or more additional sensing elements, such as a heart rate monitor, a pressure sensor, or the like. The controller <NUM> may include discrete, specialized logic and/or components, an application-specific integrated circuit, a microcontroller or processor that executes software instructions, firmware, programming instructions stored in memory (such as memory <NUM>), or any combination thereof.

Similar to the processor <NUM>, the controller <NUM> of the analyte sensor <NUM> may be operable to perform many functions. For example, the controller <NUM> may be configured by the programming code stored in the memory <NUM> to manage the collection and analysis of data detected the sensing and measuring device <NUM>, such as blood glucose measurement values, providing trend information and the like.

Although the analyte sensor <NUM> is depicted in <FIG> as separate from the wearable automatic drug delivery device <NUM>, in various examples, the analyte sensor <NUM> and wearable automatic drug delivery device <NUM> may be incorporated into the same unit. That is, in various examples, the sensor <NUM> may be a part of the wearable automatic drug delivery device <NUM> and contained within the same housing of the wearable automatic drug delivery device <NUM> (e.g., the sensor <NUM> or, only the sensing/measuring device <NUM> and memory storing related programming code may be positioned within or integrated into, or into one or more components, such as the memory <NUM>, of, the wearable automatic drug delivery device <NUM>). In such an example configuration, the processor <NUM> may be able to implement the process examples of <FIG> alone without any external inputs from the controller <NUM>, the cloud-based services <NUM>, another sensor (not shown), the optional smart accessory device <NUM>, or the like.

The communication link <NUM> that couples the cloud-based services <NUM> to the respective devices <NUM>, <NUM>, <NUM> or <NUM> of system <NUM> may be a cellular link, a Wi-Fi link, a Bluetooth link, or a combination thereof. Services provided by cloud-based services <NUM> may include data storage that stores anonymized data, such as blood glucose measurement values, historical IOB or TDI, maximum and minimum boundary values, therapeutic exogenous substance concentration values, substance sensitivity values, and other forms of data. In addition, the cloud-based services <NUM> may process the anonymized data from multiple users to provide generalized information related to TDI, insulin sensitivity, insulin onboard (IOB), and the like.

The wireless communication links <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> may be any type of wireless link operating using known wireless communication standards or proprietary standards. As an example, the wireless communication links <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> may provide communication links based on Bluetooth®, Zigbee®, Wi-Fi, a near-field communication standard, a cellular standard, or any other wireless protocol via the respective communication devices <NUM>, <NUM>, <NUM>, and <NUM>.

Software related implementations of the techniques described herein, such as the processes examples described with reference to <FIG> may include, but are not limited to, firmware, application specific software, or any other type of computer readable instructions that may be executed by one or more processors. The computer readable instructions may be provided via non-transitory computer-readable media. Hardware related implementations of the techniques described herein may include, but are not limited to, integrated circuits (ICs), application specific ICs (ASICs), field programmable arrays (FPGAs), and/or programmable logic devices (PLDs). In some examples, the techniques described herein, and/or any system or constituent component described herein may be implemented with a processor executing computer readable instructions stored on one or more memory components.

In addition, or alternatively, while the examples may have been described with reference to a closed loop algorithmic implementation, variations of the disclosed examples may be implemented to enable open loop use. The open loop implementations allow for use of different modalities of delivery of insulin such as smart pen, syringe or the like. For example, the disclosed AP application and algorithms may be operable to perform various functions related to open loop operations, such as the generation of prompts requesting the input of information such as weight or age. Similarly, a dosage amount of insulin may be received by the AP application or algorithm from a user via a user interface. Other open-loop actions may also be implemented by adjusting user settings or the like in an AP application or algorithm.

Some examples of the disclosed device or processes may be implemented, for example, using a storage medium, a computer-readable medium, or an article of manufacture which may store an instruction or a set of instructions that, if executed by a machine (i.e., processor or controller), may cause the machine to perform a method and/or operation in accordance with examples of the disclosure. Such a machine may include, for example, any suitable processing platform, computing platform, computing device, processing device, computing system, processing system, computer, processor, or the like, and may be implemented using any suitable combination of hardware and/or software. The computer-readable medium or article may include, for example, any suitable type of memory unit, memory, memory article, memory medium, storage device, storage article, storage medium and/or storage unit, for example, memory (including non-transitory memory), removable or non-removable media, erasable or non-erasable media, writeable or re-writeable media, digital or analog media, hard disk, floppy disk, Compact Disk Read Only Memory (CD-ROM), Compact Disk Recordable (CD-R), Compact Disk Rewriteable (CD-RW), optical disk, magnetic media, magneto-optical media, removable memory cards or disks, various types of Digital Versatile Disk (DVD), a tape, a cassette, or the like. The instructions may include any suitable type of code, such as source code, compiled code, interpreted code, executable code, static code, dynamic code, encrypted code, programming code, and the like, implemented using any suitable high-level, low-level, object-oriented, visual, compiled and/or interpreted programming language. The non-transitory computer readable medium embodied programming code may cause a processor when executing the programming code to perform functions, such as those described herein.

Certain examples of the present disclosure were described above. It is, however, expressly noted that the present disclosure is not limited to those examples, but rather the intention is that additions and modifications to what was expressly described herein are also included within the scope of the disclosed examples. Moreover, it is to be understood that the features of the various examples described herein were not mutually exclusive and may exist in various combinations and permutations, even if such combinations or permutations were not made express herein. In fact, variations, modifications, and other implementations of what was described herein will occur to those of ordinary skill in the art. As such, the disclosed examples are not to be defined only by the preceding illustrative description.

Program aspects of the technology may be thought of as "products" or "articles of manufacture" typically in the form of executable code and/or associated data that is carried on or embodied in a type of non-transitory, machine readable medium. Storage type media include any or all of the tangible memory of the computers, processors or the like, or associated modules thereof, such as various semiconductor memories, tape drives, disk drives and the like, which may provide non-transitory storage at any time for the software programming. It is emphasized that the Abstract of the Disclosure is provided to allow a reader to quickly ascertain the nature of the technical disclosure. It is submitted with the understanding that it will not be used to interpret or limit the scope or meaning of the claims. In addition, in the foregoing Detailed Description, various features are grouped together in a single example for streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed examples require more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive subject matter lies in less than all features of a single disclosed example. Thus, the following claims are hereby incorporated into the Detailed Description, with each claim standing on its own as a separate example. In the appended claims, the terms "including" and "in which" are used as the plain-English equivalents of the respective terms "comprising" and "wherein," respectively. Moreover, the terms "first," "second," "third," and so forth, are used merely as labels and are not intended to impose numerical requirements on their objects.

Claim 1:
An automatic drug delivery device, comprising:
a processor,
a reservoir configured to contain a therapeutic exogenous substance;
a pump mechanism communicatively coupled to the processor, and fluidically coupled to the reservoir; and
a memory coupled to the processor and configured to store a substance delivery history and programming code that, when executed by the processor, cause the drug delivery device to:
estimate an amount of the therapeutic exogenous substance to deliver to a user;
determine an insulin adjustment factor utilizing an estimated relative therapeutic exogenous substance concentration, wherein the estimated relative therapeutic exogenous substance concentration is determined based on the sum of the past actual therapeutic exogenous substance deliveries over a number of delivery cycles versus the expected insulin needs for the user based on their total daily therapeutic exogenous substance amounts, accounting for the decay and/or absorption of the exogenous substance within the body over time;
calculate a compensating dose of the therapeutic exogenous substance based on the estimated amount of the therapeutic exogenous substance to deliver that is adjusted by the insulin adjustment factor; and
causing the calculated compensating dose of the therapeutic exogenous substance to be expelled from the reservoir by the pump mechanism.