System for improving data quality of distributed data sets
By introducing data processing modules and cluster analysis technology into the drug management system, the pre-injection and treatment doses in insulin injections are automatically distinguished, which solves the problem of low data quality in the existing technology and improves the reliability of treatment decisions and system efficiency. Degree of automation.
Patent Information
- Application Number
- CN201980062764.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-10-03
- Filing Date
- 2019-09-24
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2039-09-24
AI Technical Summary
It is difficult to accurately distinguish and record the pre-injection dose and treatment dose in insulin injections with existing technology, leading to errors in drug tracking and calculation, affecting patient treatment effects and data quality.
By introducing a data processing module into the system, clustering, pattern rules and weight calculation methods are used to automatically segment and label insulin dose data sets, distinguish pre-infusion and injection events, and improve data quality through historical data and confidence analysis.
It achieves accurate labeling and segmentation of insulin dosage data, improves data quality and the reliability of treatment decisions, reduces the burden of manual labeling on users, and enhances the automation of the drug management system.
Smart Images

Figure CN112955968B_ABST
Abstract
Description
[0001] The present invention relates to a system and method for improving the data quality of a drug dose dispensing dataset in order to provide reliable automatic dispensing data reflecting the actual injected dose. Background Art
[0002] Decision support systems (DSS) have been proposed, see for example PCT / EP2019 / 067000, which are designed to help patients titrate to optimal insulin doses. A basic requirement for obtaining a reliable DSS is good data quality in terms of historical injected insulin amounts. Drug delivery devices and additional devices thereof suitable for automatically creating a log of discharged doses have been provided, however, not all captured allocations are clinically relevant, and therefore, it is desirable to provide a data filtering solution for pen-based basal and bolus therapy, which enables filtering injected insulin doses from non-injected insulin doses.
[0003] This problem has also been solved in the past. For example, WO 2016 / 007935 discloses an intelligent drug management system comprising an injection device that communicates with a patient's smartphone, wherein the injection device is capable of detecting and recording the size of the dose assigned (e.g., pre-filled or injected into the patient), and distinguishing between pre-filled doses and therapeutic doses. Before injecting a therapeutic or therapeutic dose, the patient may need to allocate a pre-filled substance or pre-filled dose. For example, in certain use cases, the patient will change his needle and deliver a pre-filled dose intended to clear the air of the new needle. For example, in some cases, the pre-filled dose will be delivered even if the needle is not changed. For example, in some cases, even if the needle is changed, the pre-filled dose will not be delivered. It is necessary to be able to determine which doses are pre-filled doses and which doses are therapeutic doses, wherein data associated with the determination of the dose type should be included in the dose calculation (e.g., "on-board insulin" calculation) and treatment analysis.
[0004] Typically, when a priming dose is delivered, it is followed by a therapeutic dose. For example, in some embodiments of the smart medication management system, a smartphone's software application may include a dose differentiator or identification module to process the dose dispensing data and determine and distinguish between the priming dose and the therapeutic dose dispensed from the pen device.
[0005] For example, in some embodiments of the smart medication management system, a data processing unit on the pen device may include a dose differentiator module to process dose dispensing data and determine and differentiate between a priming dose and a therapeutic dose dispensed from the pen device.
[0006] In some embodiments, the dose discriminator module is configured to implement a dose classification method to group data associated with dispensed drug doses and classify the dispensed doses in the group as priming doses or injection (e.g., therapeutic) doses, such that for any group of doses occurring in close temporal proximity, only the last dose is recorded as a therapeutic dose. Close temporal proximity is a predetermined time threshold, which may be defined, for example, as 10 seconds, 30 seconds, 1 minute, 2 minutes, 5 minutes, or 10 minutes, or others.
[0007] In patients with low insulin requirements, it is important to identify the dose as priming. For example, in children, a typical priming dose may be 2 units, while a typical therapeutic dose may be 0.5 or 1 unit. In this case, if the user were to include all insulin dispensed in the tracking (rather than just therapeutic insulin), the therapeutic tracking would be incorrect, as would any on-board insulin calculations or future dose recommendations.
[0008] This is an example of how you can't differentiate between priming doses based on size alone. In the example given above, the therapeutic dose is much smaller than the priming dose, but for an adult or type 2 patient, the therapeutic dose may be much larger than the priming dose.
[0009] For example, in some cases, a user may pre-fill their device without delivering a therapeutic dose. To prevent the dose discriminator module from incorrectly identifying a dose as a therapeutic dose, in such cases, the system may include an additional mechanism that can be used to quickly identify a dose as "pre-filled" or "therapeutic". In one example of such an additional dose identification mechanism, a user verification input may be included in a software application on a smartphone, as appropriate, to allow the patient to identify that the recorded dose is one of a pre-filled dose or a therapeutic dose, which would then allow such a dose to be included in any therapeutic analysis and on-board insulin calculations. The user verification input mechanism may include: a radio button, a toggle switch, and / or a graphic of a user interface (thereby allowing a dose to be tapped), a slider, or other mechanism.
[0010] In some embodiments, for example, the dose discriminator module can be configured to include one or more additional processes or exceptions to the exemplary dose classification method to group and classify the last dose in a group of doses that occur in close temporal proximity as a therapeutic dose. In an example, a dose classification method can be implemented so that after replacing a cartridge, if only a single dose exists, it is designated as a pre-injection dose rather than a therapeutic dose. In another example, a dose classification method can be implemented so that when a first dose (or an intermediate dose) is greater than a predetermined dose threshold, the dose is considered a therapeutic. For example, any dose determined to be greater than 2, 5, 10 units, or other sizes, can be considered a therapeutic, regardless of its position in the dose sequence.
[0011] The dose discriminator module of the disclosed system for determining the pre-injection dose from the therapeutic dose may include a separate dosing knob on the pen device for pre-injection dosing. An exemplary separate dosing knob may be configured to actuate the dose jack without actuating the dose encoder. In these embodiments, for example, when the user rotates the separate dose knob, the drug is injected but the encoder does not count the dose.
[0012] The dose discriminator module of the disclosed technology for determining a pre-injection dose from a therapeutic dose may include additional or alternative methods for dose differentiation. In one example, a method for determining whether a dispensed dose is a pre-injection includes sensing whether the pen device is in contact with the body during injection. This can be accomplished in any of several ways. In a non-limiting example, the pen device 10 may include a pressure sensor coupled to the tip or end of the needle assembly or the body of the pen device 10 to determine whether a force has been applied to the tip of the needle assembly or the device during injection. In a non-limiting example, the pen device may include a capacitive sensor mounted near the end of the device that will sense proximity to the body. In any of these exemplary cases, sensing pressure or proximity will result in the dose being considered therapeutic rather than a pre-injection.
[0013] The dose classification method for determining the pre-injection dose and the therapeutic dose may include: detecting the speed of the delivered dose. For example, the pre-injection dose may be delivered at a faster rate than the non-pre-injection dose. The encoder mechanism of the pen device may be configured to record the speed of the dose, for example, where the speed data is transmitted to a smartphone for processing. The speed may then be compared with a predetermined dose rate threshold to determine whether the dose is a pre-injection. For example, the encoder mechanism may detect the speed, where the threshold will depend on the gear ratio, and encoder counts per revolution and / or other factors. The dose that causes the average dose rate exceeding the pulse per second threshold may be determined to be a pre-injection dose. The dose rate threshold may be determined by requiring the user to deliver a series of pre-injection doses and therapeutic doses and comparing the average dose speed of each dose. If there is little overlap in the dose speed range of each dose type, the dose speed is a good indication of the dose type. In some embodiments, for example, the dose distinguisher module may use the detected dose speed to identify the therapeutic dose from the pre-injection dose in addition to the dose distribution grouping within a predetermined amount of time proximity. For example, in some embodiments, the dose distinguisher module may use the detected dose speed without considering the dose order in the dose distribution grouping.
[0014] In some embodiments, a dose classification method for determining a priming dose versus a therapeutic dose may involve a pen device that includes a shield assembly surrounding all or a portion of a needle of a needle assembly and a sensor in the shield assembly. In an embodiment, when the needle is injected into a patient, the shield contacts the skin and slides back, thereby triggering the sensor to detect and indicate the actual therapeutic dose. If the shield does not move back, the stylus is held in the air and the dose is considered to be a priming dose. Alternatively, instead of a shield, the sensor may be constructed in an assembly that includes a small button or lever that contacts the skin and functions similarly.
[0015] In some embodiments, a dose classification method for determining a priming dose versus a therapeutic dose may involve a pen device that includes an internal accelerometer, gyroscope, or other rate sensor to detect movement data of the pen device that is transmitted to a smartphone for analysis of the movement data. For example, if the pen senses inward motion before a dose is dispensed and outward motion after a dose is dispensed, the smartphone would indicate that the pen has been injected into the patient, thereby identifying the dispensed dose as a therapeutic dose, whereas, if there are no such movements, it would indicate that the pen has been held in the air.
[0016] For example, in some embodiments of the dose differentiation module, the module may include a "voting" method to determine whether a dose is a priming dose. In an illustrative example of a voting method, the dose differentiation module may implement multiple embodiments of dose classification methods in parallel for a particular dosing sequence, such as an exemplary dose grouping process (e.g., identifying the last dose dispensed in a series of doses dispensed in a predetermined temporal proximity as a therapeutic dose), an exemplary dose velocity detection process, an exemplary motion data detection process, etc. If, after a particular dosing or dosing sequence, a certain majority of the exemplary methods for dose differentiation indicate that the dose dispensed is a priming dose, while a minority of methods indicate that it is not a priming dose, the voting method will determine that the dose in this case will be identified as a priming dose.
[0017] In view of the above, an object of the present invention is to provide a system, method and apparatus suitable for improving the data quality of a drug dose dispensing dataset so as to reliably and economically provide automatic dispensing data reflecting the actual injected dose.
[0018] The improved data can be used in the DSS to provide better, faster and more accurate dosage guidance to patients, for example, in a system suitable for providing insulin adjustment daily dosage recommendations (titration) to treat diabetes for subjects. Alternatively, the system according to the present invention can assist patients in keeping electronic dosage logs (for example, provided by a dosage recording application running on a smartphone and receiving data from a connected drug delivery device), wherein dosage events are automatically marked as injected or non-injected amounts, which eliminates the burden and complexity of this work for patients and provides reliable dosage data to help medical staff and patients work together to provide better compliance. For such applications, the DSS and dosage recording application can be regarded as clients of the services provided by the present invention. Summary of the invention
[0019] In the disclosure of the present invention, various embodiments and aspects will be described which will address one or more of the above-mentioned objects, or will address objects that will be apparent from the following disclosure and from the description of exemplary embodiments.
[0020] Therefore, in a first aspect of the present invention, a computing system for improving the data quality of a query allocation data set is provided. The system comprises: one or more processors; and a memory, in which instructions are stored, and when the instructions are executed by the one or more processors, a method is performed in response to a query request for improving the quality of allocation data received from a client. The method comprises the following steps: (a) obtaining a query allocation data set, the query allocation data set comprising a plurality of allocation records created over time, each corresponding allocation record representing an allocation event, the allocation event comprising: (i) an allocation amount of a medicament, wherein the allocation amount is one of a pre-injection amount [p] or an injection amount [i], each amount corresponding to a certain size, (ii) a corresponding allocation timestamp, and an additional step: (b) segmenting the query allocation data set into one or more current sessions, each current session comprising a series of allocation events clustered in time according to a set of clustering criteria. For each current session, the method includes the following steps: (c) creating a list of possible dispensing patterns based on a set of pattern rules, wherein a dispensing pattern is a series of dispensing amounts, wherein the dispensing amounts are pre-injection amounts or injection amounts, (d) for each pattern, calculating a combined pattern weight, wherein the combined pattern weight is the product of weight factors for each dispensing in the pattern, wherein for a given dispensing type and dispensing size, each weight factor is determined based on a function of the weight factor and the dispensing size, wherein the larger the dispensing size, the more likely it is to represent an injection event and the less likely it is to represent a pre-injection event, (e) identifying a winning pattern as the pattern with the highest combined pattern weight, and (f) storing corresponding dispensing events in a memory, wherein the corresponding dispensing events are marked as pre-injection or injection events corresponding to the winning pattern.
[0021] When defining a query allocation data set to be split into one or more current sessions, this includes allocating the data set without allowing any session to be identified. In addition, splitting the query allocation data set into sessions includes the following situation: where the data set is already obtained in a format that has been split, and then the rules of the claimed method can be used to accept or split the data set again.
[0022] As presented, the method is based on the concept of creating a list of possible dispensing patterns from a set of pattern rules, and then calculating a weight for each pattern in the list, allowing the determination of a winning pattern. More specifically, each dispensing pattern is a specific sequence of pre-injection events and injection events, where each dispensing pattern is a possible interpretation of a dispensing event in the current session. The calculation is based on the recognition that the larger the dispensing size, the more likely it is to represent an injection event, and the less likely it is to represent a pre-injection event. Based on this weight factor and the dispensing size function, a function can be created for each pre-injection amount [p] and each injection amount [i] in each pattern.
[0023] As will be apparent to those skilled in the art, setting the actual rules and determining the actual weighting factors and allocation size functions may be accomplished in a variety of ways and in accordance with conventional design procedures for data processing systems and the design guidelines provided in this specification.
[0024] Through the above steps, a method is provided that allows for marking dispensing events with high reliability and flexibility. The estimated total injection volume for a session can be calculated as the sum of all injection volumes in the winning pattern.
[0025] That is, in an exemplary embodiment, a given event or session tag may be changed by a user and then accepted by the system for future calculations.
[0026] To further refine the reliability and accuracy of the method, a historical allocation data set may be obtained, for example, from data stored in previous query requests, the historical allocation data set including a plurality of previous allocation records created during a previous time.
[0027] The combined pattern weight can be the product of one or more additional factors from the group consisting of: a priming probability factor based on historical dispensing data, a priming variance factor (for bolus injections), and a within-session dispensing spacing factor for sessions with more than two dispensings. When attempting to differentiate primings from small injections commonly seen in bolus medication patients, application of the priming variance factor can help to downweight patterns in which priming dispensings are not uniformly sized, based on the realization that priming doses are more likely to be of a constant size.
[0028] In an exemplary embodiment, the method includes the following additional steps for each current session: generating mean and variance values for the expected total injection volume distribution based on historical dispensing data, and comparing the highest and second highest combined pattern weights, and if the pattern weights are within a given range of close proximity to each other, identifying the updated winning pattern as the pattern with the highest probability according to the generated distribution. In fact, if there is more than one close candidate with the second highest combined pattern weight, these weights should also be compared.
[0029] By combining the use of historical data and calculating the mean and variance values of the expected total injection volume distribution, the method is able to more reliably identify the winning pattern in situations where two (or more) pattern weights are within a given range of proximity to each other.
[0030] To further improve reliability and accuracy, the method may include the following additional steps for each current session: calculating a historical weight of the historical dispensing data on which the expected total injection volume value is based. The historical weight may be based on a relevance criterion including one or more of the following: age of data, time of day similarity, and inter-session gap similarity.
[0031] In other words, the more similar the previous data values are to the current data value, the greater the weight they provide to the calculation. Therefore, unless the historical weight reaches a given minimum threshold, no expected total injection volume value is generated.
[0032] To further improve reliability and accuracy, the method may include the following additional steps for each current session: determining a combined confidence value based on one or more confidence metrics from a group of confidence values, the group of confidence values including: a data confidence value based on the value of the highest combined pattern weight (i.e., the higher the value, the higher the confidence); an expected amount confidence value based on the difference between the estimated total injection amount and the expected total injection amount (if calculated); an ambiguity confidence value based on the probability proximity of the highest and second highest combined pattern weights according to the generated distribution if any (i.e., when two patterns are almost equally likely, the ambiguity confidence is low); and a pre-injection confidence value based on the consistency between the pre-injection behaviors of the winning patterns (i.e., the more the user pre-injected in the past, the higher the confidence of the assumed pre-injection event). The combined confidence value may be calculated in different ways, for example as an average of all values or as a single minimum value. When the combined confidence value is above a given threshold, the estimated total injection amount may be calculated as the sum of all injection amounts in the winning pattern. The estimated total injection volume can then be provided to the requester, such as the patient's personal record or DSS for further calculations.
[0033] Alternatively, the combined confidence value may be combined to provide an estimated total injection volume (regardless of the magnitude of the combined confidence value), allowing the patient or the system to evaluate the results according to the confidence level.
[0034] Furthermore, when the combined confidence value is above a given threshold for the current session, the session can be marked so that the mean and variance values of the expected total injection volume distribution are based only on historical dispensing data from the marked session, which improves the reliability and accuracy of the calculated values. When a session is not marked, the system can prompt the user to mark the session, thereby allowing the session to be used for future calculations.
[0035] The combined mode weight may be the product of one or more additional factors selected from the group consisting of: a pre-injection probability factor based on historical allocation data, a pre-injection variance factor, and an intra-session allocation spacing factor for sessions with more than two allocations.
[0036] In an exemplary embodiment, the obtained dispensing record includes an identifier for identifying a given dispensing event as a bolus event or a basal event, which allows the rules and parameters of the method to be applied to dispensing data generated with a bolus-only regimen, a basal-only regimen, or a bolus and basal regimen.
[0037] The segmentation can be controlled by a set of time parameters and a set of time measurements, wherein an initial dispensing event in the series of dispensing events starts a session and clears a timer, and subsequent dispensings are automatically included in the session until a session time window has passed, and wherein subsequent dispensings are included if the following expressions are true: (i) the ratio between the resulting session length and the resulting inter-session length on either side of the session is less than the session length ratio, and (ii) the resulting session length is less than a session window maximum, wherein the series of dispensing events in the session defines a set of dispensing events, and wherein each dispensing event includes a corresponding dispensing size, i.e., the amount of medication dispensed, and wherein in response to the expression no longer being true, a new session is started.
[0038] In a specific aspect of the present invention, a computing system for improving the data quality of querying a distributed data set is provided. The system includes: one or more processors; and a memory, wherein the memory stores instructions, and when the instructions are executed by the one or more processors, a method for improving the distributed data quality of distributed data in response to receiving a client request is performed, and the method includes the following steps:
[0039] A dispensing data set is obtained from one or more injection devices used to administer a treatment regimen to a subject, the dispensing data set comprising a plurality of dispensing records taken over a time course, each respective dispensing record of the plurality of dispensing records comprising: (i) a respective dispensing event, the respective dispensing event comprising an automatically obtained amount of a medicament dispensed by the subject using a respective injection device of the one or more injection devices, wherein the dispensing event is one of a priming event of an injection event, wherein a priming event is any dispensing event in preparation for an injection event, and an injection event is a dispensing event in which the medicament is assumed to be injected into the subject; and (ii) a corresponding automatically obtained dispensing event timestamp over a time course, the timestamp being automatically generated by the respective injection device when the respective medicament dispensing event occurs,
[0040] dividing the allocated data set into a plurality of segments, wherein each segment includes a session,
[0041] wherein each respective session comprises a series of dispensing events of the dispensing data set clustered in time, during which the user intended to perform one or more injection events, and wherein one or more dispensing events in the series of dispensing events can be interpreted as injection events,
[0042] For the current session:
[0043] Obtaining (i) expected doses and corresponding variances based on previous sessions and by setting time weights, wherein the time weights are related to the similarity of time of day, inter-session time, and session age, or
[0044] (ii) the guided dose and the corresponding variance based on the dose guidance are obtained, thereby:
[0045] Provides a probability distribution for the session dose based on previous doses,
[0046] a set of allowed dispensing patterns is listed, wherein a dispensing pattern is a specific sequence of priming events and injection events, and whereby each dispensing pattern is an interpretation of the dispensing events in the current session, which together with the amount of medicament dispensed can provide an estimate of the session injection dose,
[0047] calculating a pattern weight based on a pre-announced probability of a previous session or an intra-session time length between dispensing events in the set of dispensing events of the current session,
[0048] calculating a pattern probability based on the size of the partition, where the larger the partition size, the more likely it is an injection event and the less likely it is a priming event,
[0049] calculating a combined mode probability based on the mode weights and a mode probability based on the allocation size,
[0050] Based on the dispensing size, a possible dose is listed, where a possible dose is a combination of one or more dispensing events (assuming an injection event),
[0051] for each of the possible doses, identifying the one or more possible patterns and corresponding combined pattern probabilities, and calculating a sum of the one or more corresponding combined pattern probabilities to provide a sum of the combined pattern probabilities,
[0052] for each of said possible doses, calculating the combined probability of the possible doses based on the sum of the combined pattern probabilities and the corresponding doses obtained from previous doses based on the probability distribution,
[0053] Among the possible doses that give rise to the maximum possible dose combination probability is the most likely session dose designated as the maximum likelihood dose, wherein the provision of the most likely session dose for each session improves the quality of the allocation dataset and enables reliable automated decision support.
[0054] In this way, technical information including pattern probabilities based on allocation size can be used to automatically improve the quality of the allocation data set. The technical information related to the pattern probabilities can be combined with different pattern weights and then converted into session dose probabilities, which can be combined with a prior probability distribution of session doses. The improved data quality of the allocation data set - including maximum likelihood estimates of dose sessions - can be used as input in further steps of a decision support system, wherein the quality improved data set provides an improved quality of the final data output of the decision support system compared to an output based on non-enhanced allocation data.
[0055] The segmentation may be controlled by a set of time parameters and a set of time metrics, wherein an initial allocation event in the series of allocation events starts a session and clears a timer, and subsequent allocations are automatically included in the session until a session time window has elapsed, and wherein subsequent allocations are included if the following expressions are true: (i) the ratio between the resulting session length and the resulting inter-session length on either side of the session is less than the session length ratio, and (ii) the resulting session length is less than a session window maximum,
[0056] wherein the series of dispensing events in the session defines a set of dispensing events, and wherein each dispensing event includes a corresponding dispensing size, i.e., an amount of medication dispensed, and
[0057] wherein in response to the expression no longer being true, a new session is started.
[0058] In another aspect, the method further comprises: calculating a set of confidence scores for the maximum likelihood dose; evaluating whether the minimum confidence score is greater than a confidence threshold; and automatically marking the session in response to the confidence evaluation being true.
[0059] In another aspect, the marking includes assigning an allocation mode to the current session, wherein the assigned allocation mode is a most likely allocation mode of the one or more allocation modes that results in the maximum likelihood dose.
[0060] In another aspect, the method further comprises: in response to the confidence evaluation being false, requesting the user to confirm the marking step of the unmarked conversation.
[0061] In another aspect, the method further comprises automatically providing a recommended dose based on one or more of the estimated maximum likelihood doses. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The following embodiments of the present invention will be described with reference to the accompanying drawings, wherein
[0063] Figure 1A shows a pen device,
[0064] Figure 1B Shown with the pen cap removed Figure 1B The pen device,
[0065] Figure 1C and Figure 1D A schematic diagram showing an additional device for collecting dose dispensing data from a drug delivery device, which is also shown in the accompanying drawings,
[0066] Figures 2A to 2G together illustrate an example of a method for improving the quality of assigned data based on a basic session of a basic research dataset from a patient,
[0067] FIG. 3A to FIG. 3D together illustrate an example of a method for improving dispensing data quality based on a bolus session of a bolus study dataset from a patient,
[0068] Figure 4A A flowchart showing an exemplary algorithm is shown,
[0069] Figure 4B shows the potential patterns of different allocations per conversation,
[0070] Figure 4C shows an example of a weight factor versus allocation size function,
[0071] Figure 4D Potential dose size results for different session patterns are shown.
[0072] Figure 5A An exemplary system topology according to an embodiment of the present disclosure is shown, the system topology including a decision support system for processing a data stream collected from a data collection device; as shown, the data collection device can collect data from one or more injection devices, and in some embodiments, it can also collect blood glucose data from one or more glucose sensors measuring glucose data from a subject, the one or more injection devices are used by the subject to inject a blood glucose regulating agent according to a treatment regimen, wherein the above components are optionally interconnected via a communication network,
[0073] Figure 5B A decision support system according to an embodiment of the present disclosure is shown, the decision support system comprising a processor and a memory, wherein the system is adapted to improve data quality of dispensing data obtained from one or more injection devices,
[0074] Figure 5C A method for improving the data quality of allocation data obtained from a data collection device according to the present disclosure is shown, wherein the data with the improved data quality is configured for use by a decision support system,
[0075] Figures 6 to 17 In general, a method for improving the quality of distribution data is shown. Figure 5C It is shown in
[0076] Figure 6 and Figure 7 The steps of segmenting data in the method for improving the quality of distribution data are shown together. Figure 5C It is shown in
[0077] Fig. 8A , Figure 8B , Figure 8C and Fig.8D together show the steps of determining the expected dose based on information from previous sessions,
[0078] Fig.9A and Fig. 9B collectively showing the steps of obtaining a dose probability based on time data from a previous session,
[0079] Fig.10 The steps of obtaining the allowed allocation data based on the allocation quantity and the selection rule are shown,
[0080] Fig.11A and Fig. 11B together show the steps of setting mode weights for allowed modes,
[0081] Fig. 12A and Fig. 12B together show the steps of calculating the pattern probabilities of allowed patterns based on the allocation sizes,
[0082] Fig.13 shows another step of updating the pattern probabilities,
[0083] Fig.14 Another step to convert the pattern probabilities to dose probabilities is shown,
[0084] Fig.15 Another step of updating the dose probability with the dose probability based on the time data from the previous session is shown,
[0085] Fig.16 Another step of calculating a confidence score based on the confidence measure is shown,
[0086] Fig.17 Another step in deciding whether to mark a session is shown.
[0087] Fig.18 shows a patient survey diagram including multiple assigned sessions, and
[0088] FIG. 19A to FIG. 19K Together, we show that based on Fig.18 Examples of ways to improve the quality of distribution data.
[0089] In the drawings, similar structures are mainly identified by similar reference numerals. DETAILED DESCRIPTION
[0090] When the following terms such as "upper" and "lower", "right" and "left", "horizontal" and "vertical" or similar relative expressions are used, these terms are only with reference to the drawings and not necessarily to the actual context of use. The drawings shown are schematic representations and therefore the configuration of the different structures as well as their relative sizes are for illustrative purposes only. When the term "member" is used for a given component, it can be used to define a single component or a part of a component having one or more functions.
[0091] In the detailed description below, more specific details are set forth to provide a more thorough understanding of the present disclosure. However, it will be apparent to one of ordinary skill in the art that the present disclosure may be practiced without these specific details. In other cases, well-known methods, processes, components, circuits, and networks are not described in detail to avoid unnecessarily obscuring aspects of the embodiments.
[0092] It should also be understood that, although the terms first, second, etc. can be used in this article to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, without departing from the scope of the present disclosure, the first subject can be referred to as the second subject, and similarly, the second subject can be referred to as the first subject. The first subject and the second subject are both subjects, but they are not the same subject. In addition, the terms "subject", "user" and "patient" are used interchangeably in this article.
[0093] As used herein, the term "if" may be interpreted to mean "when" or "after" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [stated condition or event] is detected" may be interpreted to mean "after determining" or "in response to determining" or "after detecting [stated condition or event]" or "in response to detecting [stated condition or event]," depending on the context.
[0094] Before turning to the embodiments of the present invention itself, an example of a pre-filled drug delivery device will be described, which provides the basis for the exemplary embodiments of the present invention. Although the pen-shaped drug delivery device 100 shown in Figures 1 to 3 may represent a "generic" drug delivery device, the device actually shown is a Danish NovoNordisk A / S manufactures and sells Prefilled drug delivery pens.
[0095] The pen device 100 comprises a cover portion 107 and a main body portion having a proximal main body or drive assembly portion having a housing 101 in which a drug expelling mechanism is arranged or integrated; and a distal cartridge holder portion in which a drug filled transparent cartridge 113 having a distal needle penetrable septum is arranged and held in place by a non-removable cartridge holder attached to the distal portion, the cartridge holder having an opening that allows inspection of a portion of the cartridge; and a distal coupling device 115 that allows releasable mounting of the needle assembly. The cartridge is provided with a piston driven by a piston rod forming part of the expelling mechanism and can, for example, contain insulin, GLP-1 or growth hormone formulations. A proximal rotatable dose setting member 180 having a plurality of axially oriented slots 182 is used to manually set the desired drug dose displayed in the display window 102, which can then be expelled when the button 190 is actuated. The window is in the form of an opening in the housing, surrounded by a chamfered edge portion 109 and a dose indicator 109P, which allows viewing of a portion of a helically rotatable indicator member 170 (scale drum). Depending on the type of expulsion mechanism embodied in the drug delivery device, the expulsion mechanism may comprise a spring as in the embodiment shown, which is tensioned during dose setting and then released to drive the piston rod when a release button is actuated. Alternatively, the expulsion mechanism may be fully manual, in which case the dose member and actuation button are moved proximally during dose setting, corresponding to the set dose size, and then moved distally by the user to expel the set dose, for example as manufactured and sold by Novo Nordisk A / S.
[0096] although Figure 1A and Figure 1BA pre-filled type of drug delivery device is shown, i.e., it is supplied with a pre-installed cartridge and is to be discarded when the cartridge has been emptied, but in alternative embodiments the drug delivery device may be designed to allow replacement of the loaded cartridge, for example in the form of a "rear-loading" drug delivery device in which the cartridge holder is adapted to be removed from the main body of the device; or in the form of a "front-loading" device in which the cartridge is inserted through a distal opening in a cartridge holder which is non-removably attached to the main part of the device.
[0097] Figure 1C and Figure 1D A schematic diagram of an assembly of a prefilled pen-shaped drug delivery device 200 and an additional dose recording device 300 adapted thereto is shown. The additional device is adapted to be mounted on the proximal portion of the housing of the pen device and is provided with a dose setting and dose releasing device 380 which covers the corresponding device on the pen device in the mounted state, such as Figure 1D As shown. In the illustrated embodiment, the additional device includes a coupling portion 385 adapted to be axially mounted and rotationally locked on the drug delivery housing. The additional device includes a rotatable dose setting member 380, which is directly or indirectly connected to the pen dose setting member 280 during dose setting, so that rotational movement of the additional dose setting member in either direction is transmitted to the pen dose setting member. In order to reduce external influences during dose expulsion and dose size determination, the external additional dose setting member 380 can be rotationally detached from the pen dose setting member 280 during dose expulsion. The additional device also includes a dose release member 390, which can be moved distally to actuate the pen release member 290. The additional dose setting member 390, which is held and rotated by the user, can be directly attached to the pen housing in a rotationally engaged manner. WO / 2019 / 162235 discloses an exemplary additional dose recording device. An example of a drug delivery pen device with integrated dose recording circuitry and wireless communication is manufactured and sold by Novo Nordisk A / S. 6.
[0098] Before giving a general description of the algorithms that provide the initially described functionality for the data quality improvement system, two walkthrough examples covering a basal bolus session of insulin dispensing are given, respectively.
[0099] Example 1: Basic Exercise
[0100] The basic walkthrough covers seven sessions of user #8511 from the Insulin Basic Research dataset (in project "Mustang"). The walkthrough ends with session 11 because it shows several important features of the algorithm. This embodiment makes use of previous data as well as confidence values and additional pattern weights.
[0101] The embodiment starts with session 5, since sessions 1-4 and the associated computations are similar to session 5. Furthermore, in the embodiment shown, sessions 1-4 are not marked corresponding to the ignoreFirstSessions parameter, see below.
[0102] Session 5– Figure 2A
[0103] The session includes two insulin dose records {2,30}. As shown in the upper left corner, the session was recorded at 01:04 (i.e., in the evening) on Tuesday and lasted 30 seconds. The time since the previous session is 23h42m, and the time to the next session (in the base study set) is 24h 31m. According to the rules of "Pattern Enumeration", there are only two possible interpretations (patterns): pi and ii. These possibilities are evaluated by various criteria summarized in the "Pattern Weight" subgraph:
[0104] Pattern pi involves prime-beaming, while ii does not. This user prefers prime-beaming (pProb=0.76 in the upper right text box), so the prime-beaming weight factor for pi is >1, and the prime-beaming weight factor for ii is <1 (shaded downward bar, primeProb).
[0105] Judging from the size of the allocation, pi is a more likely pattern than ii, because a 2-unit allocation is very small for an injection, but is exactly what we expect for a priming. The size-based analysis is shown in the curves in the bottom row, which plot the weight factor versus allocation size, with bubbles representing sampling points on these curves for allocation sizes of 2 and 30. The generation rules for these curves depend on several configurable parameters, which are detailed below in the description of the exemplary algorithm. Note that in the case of ii, although the score of the 2-unit "candidate injection" is still low, its curve (dashed line) rises much faster than the 30-unit candidate injection (solid line). This is to correctly account for the two separate doses of different injection sizes. The product of the bubbles (pi is approximately 4 and ii is approximately 0.4) constitutes the size-based weight factor (circular pattern bar, DispSize).
[0106] The difference weight factor (shaded upward bar, Disparity) is not used for basal insulin. The within-session interval analysis (dashed bar, DispItvl) is used for basal insulin, but only for three or more allocated sessions. Therefore, the overall pattern weight (solid bar, Overall) is simply the product of the size weight and the priming weight.
[0107] Note that there is no expected dose for this session, as indicated by the empty history subgraph and the "exp--u" in the overall graph title. There is no expected dose because there is not enough history to compute one: the expected dose is a weighted average of doses from past labeled sessions that meet some similarity criteria, and the algorithm will not declare an expected dose until the sum of these weights reaches some minimum threshold (a configurable parameter, 3.0 in this case). The sum of the history weights here is 0.0 because there are no previous labeled sessions.
[0108] The plot with the dark grey bar at the top shows the final probability (the "posterior distribution") of the dose size for this session. This is just the pattern weights, converted to dose sizes (pi would be a dose of 30, and ii would be a dose of 32), and normalized so that they sum to one. If there was an expected dose for this session, it would appear as a Gaussian "prior distribution" centered on the expected dose, with the variance based on an estimate of the variance of the expected dose, which would be plotted as a dashed curve on top of the dark grey bar. If a prior existed, it is multiplied by the pattern weight result before normalization. Because there is no expected dose in this case, the prior is treated as a uniform distribution, and therefore has no effect on the dark grey bar (which we call the posterior).
[0109] The estimated dose is 30 units. The algorithm will formally flag the session because its confidence in the outcome is greater than the confidence threshold (a configurable parameter, here 70%). Confidence is the minimum of the four metrics, as shown in the text box to the right of the dark grey bar graph. Data Confidence is a measure of the overall plausibility of the winning pattern (here pi), and is equal to the green bar of the winning pattern, normalized by the number of dispenses in the session. Expected-Dose Confidence depends on the difference between the expected and estimated doses (not applicable for this session as there is no expected dose). Ambiguity Confidence, which depends on the “peakiness” of the peak in the posterior distribution, is considered high if the probability of the maximum value of this distribution, i.e. the estimated dose (here 30), is too close to one of the other doses (here 32), and the ambiguity confidence is compromised. Pre-injection Confidence measures the consistency between the pre-injection behavior in the winning pattern and the pre-injection probability calculated based on past behavior (here 0.76). All four metrics have configurable weights, and in this simulation the pre-announcement confidence is turned off so it will always read 100%.
[0110] Session 6- Figure 2B
[0111] The session analysis is almost identical to session 5. Note that the pre-injection probability is rising (now 0.81), which makes the downward-shaded pre-injection probability bar in the pattern weights slightly higher (for pi) and slightly lower (for ii) than before. This makes the overall pattern weights slightly more different, causing a slightly larger difference in probability between 30 units and 32 units in the posterior distribution. (Note that the ambiguity confidence is 96% vs. 95% in session 5, and the data score is also higher.) There is still no expected dose, but history begins to accumulate (sum of weights = 0.8).
[0112] Sessions 7 to 9 – FIG. 2C to FIG. 2E
[0113] These sessions continued the trend from session 6. The user behaved exactly the same, so by session 9 the pre-injection probability had risen to 0.89 and the history weight had reached 2.9—almost the 3.0 required for the expected dose. Confidence also rose, but more slowly, as saturation levels were approached.
[0114] The curves in the history weights subgraph show the similarity criteria used in the (final) weighted average of past sessions: Age is a simple exponential decay that weights recent sessions more than older ones; TOD represents time of day, which preferentially weights past sessions that occurred at a similar time of day to the current session; and Gap refers to the time since the last session (“previous gap”), which preferentially weights past sessions with a previous gap similar to the previous gap of the current session.
[0115] Session 10- Figure 2F
[0116] The user behavior is still the same, and there is now enough history to declare an expected dose: 30 units. There is now a Gaussian prior (dashed curve) centered at 30 units, which will tend to suppress dose possibilities that are far from the expected 30 units. This makes the algorithm more robust when session assignments are not as clear as this, which will become apparent in the next session. The variance of the Gaussian prior is constrained to be at least the "minimum variance" (configurable parameter), which is necessary because even if the user may be 100% consistent at one dose as here, the user may titrate to a different dose size at any time, and the algorithm needs to adapt to these gradual changes.
[0117] The historical weights are as follows (including sessions 5 to 9 since they are all tagged):
[0118] Age: [0.706, 0.758, 0.813, 0.869, 0.934]
[0119] Time of day: [0.972, 1.000, 0.998, 0.968, 0.997]
[0120] Gap from previous session: [0.999, 0.944, 0.982, 0.957, 0.892]
[0121] Total (product): [0.685, 0.715, 0.796, 0.805, 0.831] (sum = 3.83)
[0122] Session 11 – Figure 2G
[0123] The dispensing pattern {2,15,10,15} is a classic split dose with a twist: Is the third dispensing a priming or an injectable? The algorithm considers multiple criteria that work together to arrive at an answer.
[0124] The pattern enumeration gives rise to seven different patterns to consider. (Aspects of the pattern enumeration are configurable parameters.) At first glance, the solid lines in the pattern weight subgraph show that piii has the highest weight, followed by pipi, and then pppi. The other possibilities have much lower weights. Note that there is only room to show four size-based weight curves at the bottom, so the top four patterns are shown.
[0125] The top patterns all score high when primed (shaded down bars, primeProb) because the user has a prime probability of 0.92 and all of these patterns involve primes.
[0126] Pattern piii gets the highest size-based weight because the third allocation (when a candidate injection) has the [dashed-gray] curve, which has increased by a maximum of 10 units. (Note that the gray curve covers the solid line because they are both candidate injections of 15 units.) Pattern pipi has a much lower size-based weight, but note that the intersection between the curves for candidate injections and candidate pre-injections is about eight units. This intersection is adaptive, depending on the size of the allocations in the session, and means that the 10-unit candidate pre-injection has at least a chance.
[0127] For the basis, the intersection point of the flow check S curve (performed by using an error function, commonly used in probability and statistics, and abbreviated as erf(), see below) is calculated according to a specific formula based on the suspected dose, the number of injections in the session, and the historical average flow check size. The suspected dose is based on the expected dose from the historical composition, the historical average injection size, and the maximum dispensed value in the current session. All of these factors allow the intersection point of the S curve to change for a specific user based on the history of that specific user.
[0128] The within-session interval analysis (dashed line, DispItvl) comes into play because this session has more than two dispenses. This analysis is based on the statistical observation that the time delay when switching from a series of one or more priming injections to an injection is generally longer than the time delay between priming injections. Although both pipi and piii have DispItvl weight factors greater than one on this basis, pipi has the highest weight factor, which mitigates somewhat from its low size-based weight factor. Pattern pppi receives a DispItvl weight factor less than one, which further reduces its overall pattern weight. (Note that pppi and pipi have roughly similar priming and size-based weight factors.)
[0129] The history weights are as follows (including sessions 5 to 10 since they are all tagged):
[0130] Age: [0.660, 0.708, 0.759, 0.812, 0.872, 0.935]
[0131] Time of day: [1.000, 0.981, 0.960, 1.000, 0.957, 0.975]
[0132] Gap from previous session: [0.987, 0.861, 0.923, 0.996, 0.791, 0.979]
[0133] Total (product): [0.651, 0.598, 0.673, 0.808, 0.661, 0.892] (sum = 4.28)
[0134] The winning pattern based on pattern weights alone is still piii, which is incorrect, with pipi a close second. Without an expected dose, the ambiguity confidence would be low due to the close probabilities between the 30 (pipi) and 40 (piii) unit doses. Fortunately, there is such an expected dose that reduces the probability of the 40 unit dose to almost zero and makes 30 (pipi) the winner. Note that the limiting factor in the confidence score is the 89% data confidence, which is still good, but is weighted lower due to pipi’s overall medium pattern weight. As shown here, this is a protective feature that prevents the algorithm from being too confident in cases where it is “saved” by the expected dose, but the pattern is not inherently plausible. For example, if the third allocation was 15 units instead of 10 units, pipi’s pattern weight would be much lower (the bubble on the dashed gray size curve changes from 10 to 15 under pipi). In this case, the algorithm would fail the data confidence test and not label the session. This illustrates the design goal of the exemplary algorithm, which is to not attempt to label a session if an experienced human translator is not confident.
[0135] Example 2: Push Drill
[0136] This walkthrough covers four sessions (102-105) of user #3821 in the Insulin Bolus Study dataset. Because bolus drug analysis is slightly more complex than basic analysis, this walkthrough builds on the basic walkthrough for user #8511 above. This walkthrough, as well as the detailed description of the exemplary "full" algorithm below, may be necessary to fully understand this embodiment.
[0137] Session 102– Figure 3A
[0138] The session is {2,6.5}, the user in the study reported the session as a priming, then the injection was given, and the algorithm came to the same conclusion with high confidence (91%), so it has been labeled as such. The 6.5 unit injection is actually on the high side of what we typically encounter in bolus data, and it is not uncommon for injections of one or two units to be roughly the same size as the priming dispense (flow check). The inability to easily distinguish based on dispense size is what causes most of the differences between the base and bolus versions of the algorithm.
[0139] The allowed modes are the same as the base mode, so for two allocations, the possibilities are pi and ii. The mode weight is the product of all four weighting factors for the bolus (pre-betting difference, within-session allocation spacing, pre-betting probability, and allocation size), but the pre-betting difference does not make sense unless there is more than one possible bolus in a mode, so for this session its weight factor is one, so you don't see any bars in the mode weight subplot. Likewise, within-allocation spacing does not make sense unless there are at least three allocations in the session, so the weight is also one. From the other two weighting factors:
[0140] 1) Pattern pi involves pre-annotation, but ii does not; this user is a very consistent pre-annotator (pProb=1.00), so pi gets a pre-annotation weight factor > 1, and ii gets a pre-annotation weight factor < 1 (shaded down, PrimeProb). This is the same as the base algorithm.
[0141] 2) Mode pi also yields the highest size-based weighting factor (DispSize, circular mode bar), which is approximately 4 (1.9*1.9~=4) judging from the circle in the lower left corner of the "pi" plot. Alternative ii yields a size-based weighting factor of exactly one. The weighting factor is still calculated as the product of the samples indicated by the hollow circles on the size curve in the bottom row of the plot. However, the curves themselves differ in terms of bolus.
[0142] As a rule, as shown by the solid curve in the "pi" graph, candidate injections never receive a weight less than one. This is because, while it is still true that large allocations are more likely to be injections, it is *not* true that small allocations are more likely to be pre-injections; therefore, we cannot downweight a pattern simply because its injections correspond to small allocations. Recall that a weight greater than one means "very likely," and a weight less than one means "unlikely," with a weight of exactly one being neutral.
[0143] The candidate injection size curve will also shift based on the average size of candidate primings in the pattern (see the detailed description of the exemplary algorithm below for details). The idea is to have the injection curve start rising early, but only after the size allocated for the priming.
[0144] When there are no candidate pre-injections in a pattern (which is the case for pattern ii in this session), all size weights are left at one. We could use the default injection size curve instead, increasing the weight of the pattern when the allocation is large, but this would risk giving an unfair advantage to patterns without pre-injections, since the injection curve cannot be less than one. In this case, it was found to be more reliable to simply keep the size weights equal to one.
[0145] Note that the Gaussian dose prior distribution (dashed curve in the upper subplot) is very broad. This is a property of bolus data, since it turns out that historical doses are not good future predictors. Typically, when combining all historical doses as their weighted average (where the weights depend on the similarity of time of day, the similarity of the gap to the previous dose, and the age of the session), the estimated variance is high, and thus the Gaussian dose prior is broad. In this case, the prior distribution actually favors the wrong mode (ii), but the effect is small and insufficient, preventing the algorithm from obtaining the correct answer with high confidence.
[0146] Session 103 - Figure 3B
[0147] The session analysis is almost identical to session 102, but this time the expected dose is different and closer to the actual dose. This session occurred at a completely different time of day (12:18 vs. 00:59) and also had a different gap from the previous session (11:18 vs. 03:58), so the weighted average in the expected dose calculation emphasizes a different set of past sessions. Whether this makes the expected dose more accurate is generally debatable. However, in the absence of external dosing guidance information, going by history is a valid approach.
[0148] The more accurate previous dose, especially the previous peak (5.4 units) - which is on the opposite side of the correct dose from the next most likely dose (8.5 units from mode ii) - indicates that the previous dose emphasized the correct dose at the expense of the incorrect dose. This reduced the ambiguity between the two, which is reflected in the 97% ambiguity confidence score - compared to session 102.
[0149] Session 104– Figure 3C
[0150] This is again similar to sessions 102 and 103, with even better expected doses (6.7 units vs. actual 7 units). The set of past sessions used in the expected dose weighted average is again different due to the different time of day (16:20 vs. 00:59 and 12:18). As evidence of this, notice that the sum of the history weights has suddenly almost doubled to 19.2. This simply means that there are more "similar" sessions available for the average (based on time of day, gap since previous session, and age). This user may have a higher dosing frequency around 16:00 than around 00:00 or 12:00.
[0151] Session 105– Figure 3D
[0152] The dispensing pattern {2,7,2,2,4} appears as split doses, probably due to cartridge changes. The large number of dispensings makes it a good case study in pattern weighting.
[0153] The algorithmic analysis allows for ten different modes to be used, making the mode weight graph difficult to read. First, note that all five bars are used - the four weight factors and their product (the total weight). Furthermore, while there are ten possible modes, there is only room to show the size-based weight curves for four of them, so only the first four are shown (corresponding to the highest four solid bars, ordered from highest to lowest total weight).
[0154] 1) A "pre-annotation variance" (shaded upward bar, Disparity) is designed to penalize patterns where candidate pre-annotations are inconsistent. In theory, a given user has a preferred pre-annotation allocation size, which in this case is presented as two units. If the candidate pre-annotations in a pattern are not all the same size, the pre-annotation variance weight factor is set to <1 (penalty) depending on the amount of variance. (Bad patterns will naturally have high variance, such as ppppi, which helps to reduce their weight.) There is only one highest possible variance weight, i.e., this weight never increases, only incurs penalties.
[0155] 2) The intra-session distribution timing (dashed line, DispItvl) helps somewhat. The most likely patterns based on timing alone are pipii and piipi, which are incorrect, but pippi scores closely behind, and the other patterns are mostly penalized (weight factors less than one).
[0156] 3) Most patterns score well on pre-injection (shaded down bars, PrimeProb). Since the user's pre-injection probability is high (1.0), only patterns that start with an injection (without a leading pre-injection) are penalized.
[0157] 4) The correct pattern gets the highest size-based weight (circular pattern bar, DispSize) because both the 4-unit and 7-unit allocations score higher than the scores on the candidate injection curve. (This curve is the large dotted gray in the leftmost figure on the bottom row; note that a new pattern is automatically assigned for each allocation, no matter how many there are, but the large dotted gray is not present in the legend because there is only room for the first four allocations. The large dotted gray curve covers the solid i curve.) The other three higher-ranked patterns have lower scores, but the difference is not large. This is a result of never weighting a candidate injection less than one; therefore, it is possible to "take" any two-unit pre-injection at the minimum cost of the size-based weight.
[0158] The three top-ranked patterns (pippi, pipii, and piipi) have an overall pattern weight just slightly lower than the weight of the correct pattern. In this case, the answer is “saved” by two things: first, the expected dose (the previous peak of the Gaussian dose, the dashed curve in the top plot) is on the low side of the correct dose, while the incorrect dose is on the high side; this penalizes the incorrect dose relative to the correct dose. Second, all of the top-ranked incorrect patterns lead to 13 units of [incorrect] dose, equivalent to treating each two-unit priming as an injection. This increases the probability of a 13-unit dose (posterior distribution, dark gray bars), but in cases like this—where more than one pattern leads to the same dose—only the most heavily weighted likelihood in that dose bin is used to compute the ambiguity. Therefore, the ambiguity confidence score (76%) is higher than what would be expected based on the posterior probabilities alone.
[0159] Handling split doses in bolus data is a challenging topic. To further improve identification, additional cues can be used, such as the user's typical priming dispense size. The likelihood of a split dose pattern can also be inferred based on the known capacity of the pen / cartridge and the total amount dispensed since the last split dose was indicated.
[0160] Next, a detailed description of an exemplary, comprehensive "complete" version of the algorithm incorporating all the different aspects and options of the invention will be given.
[0161] 1. Introduction
[0162] This algorithm is used to classify dispenses from drug delivery devices (such as insulin pens) as flow check (flow check and priming are synonymous) or injections. It accomplishes this task using only the raw dispense data from the device - dispense size and timestamp.
[0163] The algorithm consists of interrelated segmentation, history, and session analysis components that divide the incoming data stream into logical chunks (sessions), estimate the total dose per session, and track historical dosing behavior. The following sections describe these components.
[0164] The data flow through the flow check prediction algorithm can be summarized as follows: the data is first segmented into sessions, and then two parallel analyses are performed: one analyzing the patient's past behavior and the other analyzing the current session. The data is then combined to calculate an estimated dose, which then undergoes a series of confidence tests before a final determination is made about the session (i.e., the session output).
[0165] The complete version of the algorithm is Figure 4A As shown, the “Current Session Evidence” flowchart represents the core part of the algorithm, while the “User’s Past Behavior” flowchart represents optional refinements to the core algorithm to further improve accuracy and reliability.
[0166] 2. Split components
[0167] The main input to the algorithm is a sequence of allocation records with timestamps. The partitioning module is responsible for:
[0168] Grouping assignments into sessions, which are stored as session objects,
[0169] After the session is complete (no more allocations can be added to it), request that the session object perform a dose estimate on itself, and
[0170] • After dose estimation, the session summary (dose, classified dispenses, confidence, etc.) is sent to the History module for storage.
[0171] ·
[0172] The split module can be thought of as a "session factory" because it is responsible for creating session objects as needed to hold allocations, and destroying session objects when they are no longer needed. Each new session object is initialized with: its list of allocations, the time that has passed since the last allocation of the previous session (called the "gap before"), and a sequence number starting from one for the user's first session.
[0173] The life cycle of the segmentation module is equal to the life cycle of the user in the system, so it is part of the algorithm that interfaces with a higher-level API (Application Programming Interface).
[0174] The segmentation module provides an "add assignment" method that clients can use to notify it of new assignments. Depending on the nature of the connected pen or other drug delivery device, these notifications may occur in real time or in batches at some later time. The only timing requirement is that assignments must be added to the segmentation module in the same order in which they occur. Out-of-order assignments will confuse the segmentation logic.
[0175] When the session is complete (as determined by the segmentation algorithm), the segmentation module requires the session object to perform a dose estimate on itself, pass the result back to the client, and save the session summary in the history module.
[0176] 2.1 Segmentation Algorithm
[0177] The algorithm groups assignments into sessions with simple clustering criteria using only three configurable parameters. Two time periods, window and windowMax (>= window), are counted from the first assignment of the session, and the ratio gapRatio controls the required degree of clustering.
[0178] Without loss of generality, consider session S k , which starts with only a single assignment at time . The last assignment of the previous session S k-1 is denoted as and occurs at time . The first assignment of the next session S k+1 will be called and occurs at time
[0179] The current session starts with assignment Subsequent assignments are added to the session if:
[0180] A) The session timer < window - i.e., is included if
[0181] or
[0182] B) The session timer < windowMax and, when is assumed to be the resulting session S k will satisfy
[0183] and
[0184] In other words, allocations are always included in the current session until window time after the session starts. Allocations can be included up to windowMax time, but only if the gap between that session and the previous / following sessions is longer than gapRatio times the length of that session. As described below, allocations that fall between window and windowMax are tested only at some time after windowMax has passed.
[0185] 2.2 Causality and Real-time Operations
[0186] The gapRatio test shows that when there are temporary allocations, it is not known that the session is complete until some time after the fact. Allocations that arrive between window and windowMax may or may not become S k part of.
[0187] Their membership is uncertain, and S k Remain open until any of the following occurs:
[0188] 1) After enough time has passed, it is guaranteed that the next allocation will meet the above conditions (B)
[0189] (In this case, the temporary allocations all stay in S k If we assume that the previous session gap test satisfies condition (B), the variable “new session threshold” can be calculated as:
[0190]
[0191] If a new allocation occurs after this new session threshold, then is included in the current session, and the new allocation defines the first allocation in the new session.
[0192] or
[0193] 2) Another allocation arrives after windowMax but before the new session threshold defined above. Once this happens, the session membership of all potential allocations in the current session is resolved, and some of them become part of the current session or become S k+1 part of.
[0194] First, assume that all allocations before windowMax belong to S k , and the new allocation is For the next new session S k+1 Condition (B) will fail (because the new session threshold has not been reached), so From S k Push out and push in S k+1 and make it the new first allocation for the new session, and retest condition (B) as above. Continue in this way until (1) is satisfied in S k and S k+1 A demarcation point that satisfies condition (B) is found between S and S, or (2) all temporary allocations have been removed from S k was taken out.
[0195] At this point, all removed allocations and new allocations (allocations outside windowMax) should be processed as S k+1 , where the session timer now starts at d k+1 1. (Note that in rare cases it is conceivable to place such a list of allocations itself in S k+1 and S k+2 etc. are separated recursively. )
[0196] In some usage scenarios, the pen transmits dispenses to the algorithm in near real-time, and the client software may expect user feedback after dose estimation. For example, the user may be asked to manually classify dispenses as flow checks or injections when confidence is low and the algorithm chooses not to mark a session. In such cases, the worst-case latency of the segmentation algorithm needs to be considered. By definition, the duration of the longest possible session is equal to windowMax, so condition (B) will always be satisfied after at most windowMax×gapRatio has passed since the last dispense. This is the worst-case waiting time until S is known. k is complete and dose estimation can be performed.For the current values of these parameters for the basal and bolus insulin datasets, the worst case waiting time from the last dispense is: 2-1 / 2 hours for basal and 35 minutes for bolus.
[0197] If the application cannot tolerate such long wait times, one can set windowMax=win-down, which simplifies the algorithm for condition (A) only, possibly at the expense of segmentation accuracy. Note, however, that it is relatively rare for a partition to occur between window and windowMax, so in practice the typical latency is windowMax from the start of the session, which is much lower than the worst case. (windowMax is currently: 30 minutes for basal and 7 minutes for bolus.)
[0198] 2.3 Segmentation component parameters
[0199]
[0200] 3. Historical Component
[0201] The history module maintains a list of all past sessions for the current user and tracks statistics to improve the classification accuracy of the overall algorithm. After each session is completed and a labeling decision is made, the segmentation module provides the following summary data to the history module for storage:
[0202] Session timestamp (used as the timestamp of the last allocation in the session)
[0203] Inter-session gap (time from the last allocation of the previous session to the first allocation of this session)
[0204] Estimated dose
[0205] Is the session tagged? (true / false)
[0206] Did the user perform traffic inspection? (true / false, defined as at least one traffic inspection during the session)
[0207] A list of allocations for the session in the form of (x, y) pairs, where x is the allocation size and y is a Boolean variable that is true for injection and false for flow checking
[0208] The history module provides a method for the segmentation module to make a call to provide this information. Upon request, the history module provides the following statistics to the client: the average size of flow checks and injection allocations, the user's "primeProb", and the mean and variance of the expected dose.
[0209] 3.1 Flow Test and Average Size of Injected Dispenses
[0210] These are averages of all dispenses recorded by the user (over all past sessions). The average size of flow checks is taken from all dispenses classified as flow checks, and the average size of injections is taken from all dispenses classified as injections. Only dispenses from sessions that were flagged are counted.
[0211] Both averages are weighted with a decay factor exp(-tln(2) / sizeTimeHalf) so that recent allocations are weighted more strongly. sizeTimeHalf is a configurable parameter and the age t is calculated from the session timestamp stored in the history module, so all allocations in a session end up with the same t. The formula for the average is:
[0212]
[0213] where {d k} is the allocation size (tagged sessions only).
[0214] If the sum of the weights (the denominator in the above formula) is less than the configurable parameter minWeightSum, then the default values for the two averages are returned instead of the actual average. These default values are also configurable parameters.
[0215] 3.2 User's "Pre-injection Probability"
[0216] This is a measure of the user's likelihood of being pre-annotated (defined as having performed at least one flow check in a session) and ranges between 0 and 1. It is calculated as the average of all past sessions (including unmarked sessions). The sum of two weights is calculated as follows: "pre-annotation weight" and "non-pre-annotation weight":
[0217]
[0218] where primeTimeHalf is a configurable decay constant, and {t k} is the age of the session with pre-injection (for pre-injection weighted sum) or the session without pre-injection (for non-pre-injection weighted sum). The pre-injection probability is then calculated as:
[0219]
[0220] If the denominator (the sum of the two weights) is less than the configurable parameter minWeightSum, a value of 0.5 is returned instead, representing the maximum uncertainty.
[0221] 3.3 Expected dose mean and variance
[0222] The history module will generate expected dose values represented by a Gaussian probability distribution function (pdf) that represents the user's average dose size and dose variability based on the user's previous dose history. Only marked sessions (sessions with sufficiently high confidence scores) will be used when calculating the expected dose mean and variance. The mean is the expected dose, while the variance is inversely proportional to the consistency of the user's past doses.
[0223] This calculation is similar to the calculation for the average allocation size, but in addition to the weighted average, it also produces a weighted sample variance, and the weighting factors are more complex. Each weight is actually the product of three factors: time (age), time of day similarity, and inter-session gap similarity. The goal is to weight past sessions in proportion to their relevance to the current session, i.e., recent sessions are more relevant than older sessions, sessions that occur at the same time of day are more relevant, and sessions that are followed by a session gap that is similar in duration to the gap between the current session and its immediately preceding session are more relevant. The weight formula is:
[0224]
[0225]
[0226]
[0227] historyWeights = ageWeights * timeOfDayWeights * gapWeights
[0228] where for each past session, k, t k is the session age, TOD diff,k is the difference in the time of day between that session and the current session, and gap diff,k is the difference in the inter - session gap between that session and the current session. Note that TOD diff must be calculated correctly in a cyclic manner such that, for example, the TOD difference between 01.00 and 23.00 is two hours, not twenty - two hours. For two variables in "epoch seconds" format, one way to ensure this is:
[0229] TOD diff = min((time1 – time2) mod 86400, (time1 – time2) mod 86400)
[0230] The decay factor timeHalf and the tightness factors TODHalf and gapHalf are separately configurable parameters with the same time units as the time quantities in the exponential exponent.
[0231] If ∑historyWeights < minWeightSum, the history is insufficient for a good calculation, and the history module will refuse to provide the expected dose parameters. Instead, it will set the mean to zero and the variance to minVariance (see below). Otherwise, the mean and variance of the expected dose are calculated as:
[0232]
[0233]
[0234] where {d k} are the session doses of all past tagged sessions, each session dose having its corresponding history weight. The variance (σ 2 ) is constrained to always ≥ minVariance (a configurable parameter). In practice, this prevents the algorithm from being too certain about the expected dose when the user is highly consistent with a past dose.
[0235] 3.4 Historical component parameters
[0236]
[0237]
[0238]
[0239] 4. Conversation Analysis Algorithm
[0240] The Session object is a container for dispenses, which are grouped here by the Segmentation module. Each Session object also contains the methods (code) needed to analyze its dispenses, determine the most likely session dose, and assess its confidence in the result. The methods of the Session module can be divided into three groups.
[0241] 4.1 Adding and Removing Allocations
[0242] The session module provides methods for appending allocations to the end of a session, or removing allocations from the end of a session and returning them to the caller. The split module uses both methods.
[0243] 4.2 Assistant
[0244] The session module provides utility methods to report
[0245] • Session duration (difference in timestamp between first and last allocation of a session).
[0246] Whether the session is marked. (A session is marked if and only if it has ended and all confidence scores are greater than confidenceThreshold.)
[0247] Regardless of whether the session is labeled or not, the confidence measurement will result in the lowest confidence score.
[0248] The pre-injection and injection pattern that best describes the session (known as the “winning pattern”).
[0249] 4.3 Session analysis and dose estimation
[0250] Dose estimation is the core functionality of the session module. The analysis can be divided into four stages, as shown in the figure below: The algorithm first enumerates all pre-injection (flow check) and injection patterns that may be used to explain the session allocation, then weights these patterns according to various criteria, then converts the weighted patterns into weighted dose estimates and combines them with the dose prior (based on the user's dosing history) using the Bayesian rule to obtain the dose posterior and the most likely session dose. Finally, the algorithm applies a confidence check to determine whether the session will be marked.
[0251] These phases correspond to the methods in the reference embodiment: enumerate_mode, weight_mode, estimate_dose and evaluate_result. Each method will now be described in detail.
[0252] 4.3.1 Mode Enumeration
[0253] Given a disp For a distributed session, the dose estimation problem is exactly equivalent to the pattern selection problem: after each distribution is classified as either a flow check (often called a "prime" for brevity) or an injection, the resulting pattern will imply the session dose. Using p and i as shorthand, a session with distributions {2,1,2,4} will have a dose of 4 if the pattern is pppi, 5 if the pattern is pipi, or 6 if the pattern is ppii.
[0254] Pattern enumeration is the task of listing all potential patterns16 given some simple rules and configurable parameters ( Figure 4B ):
[0255] ·The last dispensing of a session must be an injection.
[0256] At least minPrimes flow checks must be done before each injection. This is usually set to zero so that flow checks are not strictly required, otherwise the marking rate will be very low.
[0257] The number of injections in a session is limited to maxInjectsSimple plus a larger dose limit as detailed in the context.
[0258] The following pseudocode will perform mode enumeration:
[0259] Given N disp (number of dispenses in a session), dialMax (the maximum amount of dispenses that can be dialed on the drug delivery device), and the configurable parameters maxInjectsSimple and minPrimes,
[0260]
[0261] (Note the "floor" operator)
[0262] Initialize P to the empty list of patterns.
[0263] For N inj = 1 to min(maxlnjects,N disp –minPrimes)
[0264] P append mode, which has N disp –N inj After the pre-injection is N inj injection
[0265] For N inj =2 to maxInjects
[0266] For N inj_before =1 to N inj -1
[0267] For N leading_primes =minPrimes to N disp –N inj
[0268] If N disp –N inj –N leading_primes ≥minPrimes
[0269] P append mode, which has N leading_primes Pre-Injection
[0270] Then N inj_before injection
[0271] After N disp –N inj –N leading_primes Pre-Injection
[0272] Then N inj -N inj_before injection
[0273] Scan P and remove all copy patterns.
[0274] 4.3.2 Mode Weighting
[0275] Each mode receives a weight which is the product of a number of individual weight factors:
[0276] patternWeight[pattern]=ПweightFactor[pattern]
[0277] The larger the weight, the more likely that the pattern is the correct pattern. Weighting factors are derived from the timing and size of the dispenses, the user's priming behavior, and other criteria. Some apply only to certain drug types, and some apply only to sessions that dispense a certain minimum number of dispenses. The following subsections describe specific examples of how each weighting factor might be determined.
[0278] Note that each weight factor is computed multiple times, once for each mode in P. In this context, it is often necessary to refer to the assignment as a flow check or injection, where these classifications refer to the mode being evaluated, rather than the actual situation.
[0279] 4.3.2.1 Intra-session allocation interval
[0280] Statistical analysis showed that the time between two consecutive dispenses was longer when users switched from priming to injection compared with a series of flow checks.
[0281] In the dataset studied, the critical interval is about 3.5 seconds - larger than this, and the two dispenses are likely to be pi (flow check followed by injection), shorter, and the dispenses are likely to be pp (two flow checks). The weighting factor that adopts this trend is applied to N disp ≥3 sessions. (When N disp = 2, the second allocation is always an injection, so this has no predictive power.)
[0282] pseudocode:
[0283] As N disp ≥3
[0284] N pp,short = # of pp occurrences, where the time interval <criticalDispenselnterval
[0285] N pi,long = # of occurrences of pi where the time interval ≥ criticalDispenselnterval
[0286] N pi,short = # of occurrences of pi, where the time interval <criticalDispenselnterval
[0287] N pp,long = # of pp occurrences where the time interval ≥ criticalDispenselnterval
[0288] weightFactor=dispenselintervalFactor (Npp,short+Npi,long-Npi,short-Npp,long)
[0289] otherwise
[0290] weightFactor=1
[0291] For example, if N disp = 4 where the distribution timestamps are 0, 2, 7 and 10 seconds, the configurable parameters criticalDispenselnterval = 3.5 seconds and dispenservalFactor = 2, the weighting factors for modes pppi, ppii and pipi will be:
[0292] pppi:2 (1+0-1-1) =0.5
[0293] ppii:2(1+1-0-0) =4.0
[0294] pipi:2 (0+1-1-0) =1.0
[0295] 4.3.2.2 Pre-injection probability
[0296] If the user has regularly performed flow checks in the past, the patterns being evaluated in the current session should be weighted to favor consistency, that is, patterns with primes should be weighted higher than patterns without primes. Conversely, if the user has not consistently performed flow checks in the past, patterns should be weighted in the opposite direction, so that patterns without primes are considered more likely. The "prime probability" primeProb provided by the history module ranges between 0 (never primed) and 1 (always primed). The configurable parameter primeProbFactotr controls the relative strength of this weighting factor.
[0297] For the purposes of this calculation, a "mode with priming" is actually defined as a mode that starts with a priming, so pi is a mode with priming, ii is a mode without priming, and ipi is considered neither. (Modes with priming between injections are associated with cartridge changes. Priming a new cartridge is a bit different than priming before a regular injection, so the weighting factor is not affected by this. Note, however, that pipi (also a possible cartridge change) is still considered a "mode with priming" due to its leading priming.)
[0298] pseudocode:
[0299] If the first assignment of the pattern is pre-filled
[0300] weightFactor=primeProbFactotr (2*primeProb-1)
[0301] Otherwise if all assignments in the pattern are injections
[0302] weightFactor=primeProbFactotr (1-2,primeProb)
[0303] otherwise
[0304] weightFactor=1
[0305] 4.3.2.3 Priming Differences (Push Drugs Only)
[0306] This can be helpful for down-weighting patterns where the priming dispense size is inconsistent when trying to distinguish priming from the small injections commonly seen in patients taking bolus medications. This is the idea behind priming disparity, where the configurable parameter bolusPrimeDisparityFactor:
[0307] Given a list named primes that lists the allocation sizes of all primes in the pattern being evaluated,
[0308] If N disp ≥3 and N primes ≥2, for this mode
[0309] disparity=max(primes)–min(primes)disparity
[0310] weightFactor=bolusPrimeDisparityFactor disparity
[0311] otherwise
[0312] weightFactor=1
[0313] 4.3.2.4 Dispense size (bolus medication)
[0314] Dispense size is perhaps the most obvious difference between priming and injection: the simplified view is that priming is small and injections are large. However, this does not translate well to patients treated with an MDI (basal / bolus) because a typical bolus dose can easily be as small as the recommended priming dose of two units. The priming size distribution is expected to peak around two units, but the injection size distribution does not provide much insight, except that very large dispensations are likely to be injections.
[0315] For both basal and bolus sessions, the size-based weight factor is the product of a series of "size factors" for each dispense in the pattern. The size factor is a sample from a shifted and scaled copy of the cumulative Gaussian function 70,
[0316]
[0317] There is no deep reason why erf() is used, it is just a convenient and widely used S-shaped function. The smooth S-curve simulates threshold behavior (e.g. "y units above is probably an injection, y units below is probably a pre-injection") without introducing discontinuities in the algorithm's behavior at particular allocation sizes, see Figure X X. By scaling the operands, the transition region can be narrowed or enlarged as needed, and the asymptotic value of the function is also easy to modify. In current use, the 1+erf(...) and 1-erf(...) expressions produce outputs ranging from 0 to 2, which is convenient for constructing weight factors. At the center of the S-curve, the output will be 1, which is neutral in the weight factor, see Figure 4C .
[0318] pseudocode:
[0319] Given two lists - primes and injects - which list the allocation sizes for flow checks and injections in the pattern being evaluated, and the configurable parameters bolusPrimeSizeSlope, bolusPrimeCrossoverSize, bolusInjectSizeSlope, and bolusInjectSizeOffset,
[0320] weightFactor=1
[0321] If N primes >0
[0322]
[0323] For x in primes
[0324] weightFactor=weightFactor*
[0325] (1-erf(bolusPrimeSizeSlope*√π*(x-bolusPrimeCrossoverSize)))
[0326] For x in injects
[0327] weightFactor=weightFactor*
[0328] max(1,1+erf(boluslnjectSizeSlope*√π*(x-avgPrime-boluslnjectSizeOff-set)))
[0329] illustrate:
[0330] As mentioned earlier, the weight factor is the product of the individual size factors, which are samples of the S-curve after scaling and shifting. (The weight factors are initialized to one so that the order of calculations can be rearranged as needed, shown here as separate loops in the flow check and injection lists because the size factors are different for each.) For priming, the S-curve goes from 2 to 0, touching 1 at bolusPrimeCrossoverSize. For injections, the S-curve goes from 0 to 2, but with two modifications: First, it never goes below 1. This reflects the fact that bolus injections can be arbitrarily small, and it doesn't make sense to score them lower just because they overlap the area of a typical priming. Second, instead of a fixed crossing size, the curve has a data-dependent crossing at avgPrime + bolusInjectSizeOffset. (bolusInjectSizeOffset is typically 1.) This adaptability both allows candidate injections to score higher when the priming size is small, but also works to corrupt the score of a candidate injection when evaluating the wrong pattern (because avgPrime—which is the average of the candidate primings for that pattern—can be larger when some candidate primings are actually injections).
[0331] 4.3.2.5 Allocation size (basic drugs)
[0332] For basal medication sessions, the distinction between priming and injections based on size is a bit easier because injections tend to be larger. To maximize the effectiveness of this distinction, the algorithm uses historical average priming and injection sizes and attempts to set the optimal intersection point on the S-curve (a size with a weight of one, i.e., neutral).
[0333] pseudocode:
[0334] Given two lists - primes and injects - where allocation sizes are used for flow checking and injection in the evaluated mode, history - or guidance-based expectedDose (zero if history is insufficient), historical average allocation sizes historicalPrime and historicalInject, a small amount ∈ to prevent division by zero, and configurable parameters basalSizeSlopeMin, basalSizeSlopeMax, and basalSplitDoseRatioMin,
[0335] weightFactor=1
[0336] If expectedDose>0
[0337] expDose=expectedDose
[0338] otherwise
[0339] expDose=max(historicalInject,max(all dispenses in session))
[0340]
[0341]
[0342] For x in primes
[0343] weightFactor=weightFactor*(1-erf(injectSlope*√π*(x–injectCenter)))
[0344] For x in injects
[0345]
[0346]
[0347] weightFactor=weightFactor*(1+erf(injectSlope*√π*(x–injectCenter)))
[0348] illustrate:
[0349] The basic structure of these calculations is similar to that of bolus medications, in that the size factors are still samples of a shifted and scaled S-curve. However, the bolus formulas carefully try to place the crossover size, primeCenter, and injectCenter somewhere in the middle between the possible priming and injection sizes. Note that expectedDose is an alias for the historically based expected dose expectedDose if one exists, otherwise the surrogate is used.
[0350] The possible priming size is simply the user's historical average priming. The possible injection size must take into account split doses. If the pattern being evaluated has more than one injection, Approximates the injection size under the assumption of equal distribution. This (primeCenter) is good enough to evaluate candidate prime injections, but when the doses are not evenly divided, it may cause the candidate injections to score too low. Therefore, the calculation of injectCenter uses the amount Will Replace with This way, when a smaller allocation x is evaluated as a possible injection, the "likely injection size" is lowered, keeping its score high even if the doses are not evenly split. This must be limited to prevent, for example, priming from scoring high in candidate injections, so the parameter basalSplitDoseRatioMin sets a limit on how wide the split can be. (A typical value is 0.2.) Note the placement of the injectCenter and injectSlope calculations within the loop, as they depend on the size x of each candidate injection in the pattern.
[0351] The primeSlope and injectionSlope calculations look more complicated, but they are built on the same expressions already described. The slope of the S-curve should be steeper when the possible prime size and the possible injection size are close, and more gradual when they are farther apart. The slope is simply the inverse of the difference between these sizes, not the average of these sizes as used in the centroid calculation. They are also constrained within upper and lower limits by two other parameters, basalSizeSlopeMin and basalSizeSlopeMax.
[0352] 4.3.3 Dose estimation and session interpretation
[0353] After calculating the modality weights, the algorithm converts them from modality weights to dose weights. The mapping from modality to dose is many-to-one: each modality contributes to one dose, but multiple modalities26 may contribute to the same dose, see Figure 4D .
[0354] pseudocode:
[0355] For each dose (0 to capacityAvg in steps of dialInc), initialize doseWeight[dose] = 0
[0356] For each pattern in P
[0357] dose=∑pattern injection distribution
[0358] doseWeight[dose]=doseWeight[dose]+patternWeight[pattern]
[0359] If normalized to sum to one, then doseWeight is the probability distribution of dose.
[0360] Another probability distribution for dose is based on the mean and variance of the expected dose from the history module. (The expected dose is calculated based on the user's dosing history.) This is called the dose prior distribution. It is Gaussian (normal) with mean and variance equal to the expected dose mean μ and variance σ 2 , or, if there is not enough history to calculate the expected dose, a uniform distribution:
[0361] Given the expected dose with mean μ and variance σ 2 ,
[0362] If μ>0
[0363] For dose = 0 to capacityAvg (in steps of dialInc)
[0364]
[0365] otherwise
[0366] For dose = 0 to capacityAvg (in steps of dialInc)
[0367]
[0368] Now, the dose prior distribution and the dose weights can be combined using Bayes' rule to obtain the doseposterior distribution:
[0369] For dose = 0 to the capacity of the drug delivery device, in steps of the smallest dial increment
[0370] The most likely dose (often called the estimated dose, not to be confused with the expected dose) is the dose with the highest probability in dosePosterior:
[0371] estimatedDose=arg max dosePosterior dose
[0372] (arg max dosePosterior dose
[0373] mean to find the value of dose that maximizes f(dose) and returns that value of dose. Thus, we are finding the dose size that corresponds to the peak of dosePosterior. This is the algorithm's best guess at the true injected dose for the current session. )
[0374] Working backwards from the estimated dose, this implies that there is a "winning mode" - the mode of flow inspection and injection that produces a dose equal to the estimated dose. (This is not necessarily the mode with the highest weight, as dose may have previously skewed the results.) If only one mode produces the estimated dose, it is the winning mode. If more than one mode produces the estimated dose, the winner is the one with the highest mode weight. If more than one of these modes has the same [highest] weight, and that weight is the highest, then the choice is arbitrary.
[0375] 4.3.4 Confidence Check and Result Evaluation
[0376] The algorithm produces an estimated dose for each session, regardless of whether the session was "easy" or "hard." However, in the envisioned application, it is usually best not to label a session (provide an official dose estimate) unless there is reasonable confidence in the result. The fourth and final purpose of this session module is to quantify the algorithm's confidence in the estimated dose.
[0377] The algorithm has five separate confidence measures ranging from 0 (no confidence) to 1 (100% confidence), each of which has a configurable weight between 0 and 1:
[0378] 4.3.4.1 Data Confidence
[0379] This depends on a "data score", which is just the dose weight of the most likely dose, normalized for different session lengths:
[0380]
[0381] dataConfidence=1–(dataConfidenceWeight×(1–min(1,dataScore)))
[0382] Low data confidence indicates that the winning pattern does not explain the observed sessions well and was chosen only because other patterns were even worse.
[0383] 4.3.4.2 Confidence level of expected dose
[0384] This is another way to use expected doses based on history as a cross-check on estimated doses. (Another way is through a dose prior distribution.) It measures how much the estimated dose differs from the expected dose in terms of standard deviation:
[0385] Given the expected dose with mean μ and variance σ 2 ,
[0386] If μ>0
[0387]
[0388] otherwise
[0389] expectedDoseConfidence=1
[0390] 4.3.4.3 Ambiguity Confidence
[0391] If the second, third, etc. choices are not dominated by sufficient margin, the estimated dose is penalized:
[0392]
[0393] where ∈ is a small number that prevents division by zero.
[0394] 4.3.4.4 Pre-injection confidence
[0395] This measures the user's past pre-announcement history - using the consistency between the flow check (as given by primeProb, provided by the history module) and the current session. A lower pre-announcement confidence could mean that the user usually pre-announces but did not this time, or rarely pre-announces but did this time:
[0396] If the winning pattern contains at least one pre-bet
[0397]
[0398] otherwise
[0399]
[0400] 4.3.4.5 Training Confidence
[0401] Regardless of the other confidence measures, the algorithm refuses to label the first ignoreFifstSessions sessions, based on the theory that the first few sessions are what the user is trained on and are not "normal" otherwise. This is achieved with a fifth, very simple confidence measure:
[0402] if sessionSerial>ignoreFifstSessions
[0403] trainingConfidence=1
[0404] otherwise
[0405] trainingConfidence=0
[0406] Where sessionSerial is the serial number of the session, which is provided by the segmentation module when the session object is created.
[0407] After all confidence metrics are calculated, the overall session confidence is calculated as the minimum of the individual metrics. This overall confidence is compared with the configurable parameter confidenceThreshold to determine whether the session is marked.
[0408] confidence=min(dataConfidence,expectedDoseConfidence,ambiguityConfidence,primingConfidence,trainingConfidence)
[0409] If confidence ≥ confidenceThreshold
[0410] Session is marked
[0411] otherwise
[0412] The session is not tagged
[0413] 4.4 Conversation Analysis Algorithm Parameters
[0414]
[0415]
[0416]
[0417]
[0418] 5. Definitions and Terminology
[0419] This list contains definitions of abbreviations and terms used in this document.
[0420]
[0421]
[0422] Having shown aspects of the invention in a first example, and having exemplified aspects of the invention by detailed descriptions of specific algorithm components, a second example will now be described in which reference is made to aspects of the disclosed algorithm components.
[0423] Figure 5AAn example of an integrated medical system 802 for collecting dispensing data from one or more infusion devices 404 is shown. The illustrated embodiment also shows that the system can optionally also be adapted to collect blood glucose data from one or more glucose sensors 402. The medical system 802 also includes a processor, although in Figure 5A Not shown in FIG.
[0424] Using the integrated system 802, data from the one or more connected injection devices 404 (for applying a treatment regimen to a subject) is obtained as a collection 522 of medicament distribution records in a plurality of distribution data 520 or distribution data sets 520. Each distribution record includes a time-stamped event that specifies the amount of the distributed blood glucose regulating medicament received by the subject as part of the treatment regimen. In the sense that the subject or user of the injection device is not required to perform active steps to obtain an electronic or digital timestamp and / or an electronic or digital timestamp of the blood glucose regulating medicament, the time-stamped event of the specified blood glucose regulating medicament amount is automatically obtained. These data are automatically generated by the injection device when the injection is applied, that is, the injection is applied by the subject or user to discharge a certain amount of medicament, but no matter what the user's intention is, whenever he or she uses the device, the generation of data is provided. Similarly, in some embodiments, the autonomous time-stamped glucose measurement value of the subject is obtained. In such an embodiment, the autonomous glucose measurement value is filtered and stored in a non-transitory memory. Multiple dispensing records for a subject acquired over the course of time are used to provide input to a decision support system (DSS) 550 adapted to improve the quality of the raw data stream and transform it into a data structure to reliably enable predictions of injected medications.
[0425] Combination Figure 5A and Figure 5B A medical system 48 is described in detail for collecting raw dispensing data from one or more injection devices and improving the quality of the raw data stream and converting it into a data structure to reliably achieve prediction of injected medications. Figure 5A and Figure 5B 500 , and one or more glucose sensors 402 optionally associated with the subject. Figure 5AAs shown, the disclosed functionality of the data collection device 500 and the disclosed functionality of the dose history communication device 550 are included in separate devices. However, it should be understood that in practice, in some embodiments, the disclosed functionality of the data collection device 500 and the disclosed functionality of the decision support system 550 are included in a single device. In some embodiments, the disclosed functionality of the decision support system is included in a smartphone or cloud service. In some embodiments, the data quality improvement functionality may be in a separate device, such as in a quality improvement device, which is different from the device that includes the decision support system 550. The data quality improvement device can then communicate with the decision support device that includes the decision support system 550. In some embodiments, the data collection device is such as Figure 1C and Figure 1D In the illustrated supplemental device 300 , and in other embodiments, the data collection device is an integrated device of the one or more injection devices 404 .
[0426] refer to Figure 5B In some embodiments, the treatment regimen 506 includes a bolus insulin medicament dosage regimen with a short-acting insulin medicament or a basal insulin medicament dosage regimen with a long-acting insulin medicament. In some embodiments, the treatment regimen may also include a dosage regimen with a medicament comprising a GLP-1 receptor agonist, such as liraglutide or semaglutide.
[0427] refer to Figure 5A, the decision support system 550 improves the data quality of the distribution data so that reliable decision support can be provided to the subject following the treatment plan 506. To this end, the data collection device 500 electrically connected to the decision support system 550 receives multiple blood glucose regulating agent distribution records over time, each distribution record 522 including: (i) a blood glucose regulating agent distribution event 524, including a certain amount of insulin agent 526 distributed by the subject using the corresponding injection device 404 of the one or more injection devices, and (ii) a corresponding electronic distribution event timestamp 528, which is generated by the corresponding injection device when the blood glucose regulating agent injection event occurs. If more than one agent is applied, then (iii) a corresponding type of blood glucose regulating agent 529 distributed by the subject from one of the short-acting and long-acting insulin agents. In some embodiments, the data collection device 500 also receives glucose measurements from one or more glucose sensors (e.g., continuous glucose monitors / sensors) 502 used by the subject to measure glucose levels. In some embodiments, the data collection device 500 receives such data directly from the injection device 404 and / or glucose sensor 502 used by the subject. For example, in some embodiments, the data collection device 400 receives the data wirelessly via a radio frequency signal. In some embodiments, such signals conform to 802.11 (WiFi), Bluetooth, or ZigBee standards. In some embodiments, the data collection device 200 directly receives such data, analyzes the data, and transmits the analyzed data to the dose history communication device 250. In some embodiments, the injection device 404, which may be an insulin pen, and / or the glucose sensor 402 include an RFID tag and communicate with the data collection device 500 and / or the decision support system 550 using RFID communication.
[0428] In some embodiments, the data collection device 500 and / or decision support system is not proximate to the subject and / or does not have wireless capabilities, or such wireless capabilities are not used to obtain medicament dispensing data, autonomous glucose data, and / or lifestyle-related measurement data. In such embodiments, the communication network 406 can be used to transmit insulin medicament dispensing data from one or more injection devices 404 to the data collection device 500 and / or decision support system, and / or autonomous glucose measurements from the glucose sensor 402 to the glucose collection device 500 and / or decision support system 550.
[0429] Examples of network 406 include, but are not limited to, the World Wide Web (WWW), an intranet and / or a wireless network such as a cellular telephone network, a wireless local area network (LAN) and / or a metropolitan area network (MAN), and other means of communication via wireless communications. Wireless communications optionally use any of a variety of communication standards, protocols, and technologies, including, but not limited to, Global System for Mobile Communications (GSM), Enhanced Data GSM Environment (EDGE), High Speed Downlink Packet Access (HSDPA), High Speed Uplink Packet Access (HSUPA), Data Optimized Evolution (EV-DO), HSPA, HSPA+, Dual Cell HSPA (DC-HSPDA), Long Term Evolution (LTE), Near Field Communication (NFC), Wideband Code Division Multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Bluetooth, Wireless Fidelity (Wi-Fi) (e.g., IEEE 802.11a, IEEE 802.11ac, IEEE 802.11ax, IEEE 802.11b, IEEE802.11g, and / or IEEE 802.11n), Voice over Internet Protocol (VoIP), Wi-MAX, email protocols (e.g., Internet Message Access Protocol (IMAP) and / or Post Office Protocol (POP)), instant messaging (e.g., Extensible Messaging and Presence Protocol (XMPP), Session Initiation Protocol for Instant Messaging and Presence Utilizing Extensions (SIMPLE), Instant Messaging and Presence Services (IMPS)) and / or Short Message Service (SMS), or any other suitable communication protocol, including communication protocols that have not been developed as of the date of filing of this disclosure.
[0430] In some embodiments, the data collection device 500 and / or the decision support device 550 is part of an insulin pen. That is, in some embodiments, the data collection device 500 and / or the decision support system 550 and the injection device 404 are a single device.
[0431] Of course, other topologies of the system 48 are possible. For example, the one or more injection devices 404 and the optional one or more glucose sensors 402 do not rely on the communication network 106, but can transmit information directly to the data collection device 500 and / or the decision support system wirelessly. In addition, the data collection device 500 and / or the decision support device can constitute a portable electronic device, a server computer, or indeed a number of computers linked together in a network, or a virtual machine in the context of cloud computing. Therefore, the exemplary topology shown in Figure 1 is only used to describe the features of the embodiments of the present disclosure in a manner that will be readily understood by those skilled in the art.
[0432] refer to Figure 5B In a typical embodiment, the decision support system 550 includes one or more computers. Figure 5B , decision support system 550 is represented as a single computer that includes all the functionality for improving the data quality of raw allocation data so that reliable decision support can be provided to a subject following treatment regimen 506. However, the present disclosure is not limited thereto. In some embodiments, the functionality for improving the data quality of allocation data is distributed across any number of networked computers and / or resides on each of a number of networked computers and / or is hosted on one or more virtual machines that can be accessed at a remote location over communication network 406. Those skilled in the art will appreciate that any of a variety of different computer topologies may be used for the application, and all such topologies are within the scope of the present disclosure.
[0433] Steering Figure 5B In view of the foregoing, an exemplary decision support system 550 for improving the data quality of raw allocation data includes: one or more processing units (CPUs) 574, a network or other communication interface 584, a memory 492 (e.g., random access memory), one or more disk storage devices and / or persistent devices 590 (optionally accessed by one or more controllers 588), one or more communication buses 513 for interconnecting the aforementioned components, a user interface 578, the user interface 578 including a display 582 and an input device 580 (e.g., a keyboard, a keypad, a touch screen), and a power supply 576 for powering the aforementioned components. In some embodiments, data in the memory 492 is seamlessly shared with the non-volatile memory 590 using known computing techniques such as caching. In some embodiments, the memory 492 and / or the storage 590 includes a mass storage device located remotely relative to the central processing unit 574. In other words, some of the data stored in memory 492 and / or memory 590 may actually be hosted on a computer that is external to the decision support system 550 but that may be electronically accessed by the decision support system 550 using network interface 584 via the Internet, an intranet, or other form of network or electronic cable (shown as element 406 in FIG. 3 ).
[0434] In some embodiments, the memory 492 of the decision support system 550 for improving the data quality of the raw allocation data from the data collection device 500 stores:
[0435] An operating system 502, which includes programs for handling various basic system services,
[0436] Decision support module 504,
[0437] · The treatment regimen in which the subject participated 206,
[0438] a dispensing data set 520 automatically obtained from one or more injection devices used by a subject to apply a treatment regimen, the dispensing data set comprising a collection of dispensing records over a time course, each respective dispensing record 522 in the collection of dispensing records comprising: (i) a respective dispensing event 524 comprising an amount of a medicament 526 dispensed by the subject using a respective injection device 104 of the one or more injection devices, (ii) a corresponding electronic dispensing event timestamp 228 within the time course, which is automatically generated by the respective injection device 104 when the respective dispensing event occurs, (iii) a type of medicament 529, if more than one type of medicament is dispensed,
[0439] A collection 530 of allocation sessions over a time course, where
[0440] Each corresponding session 523 includes: (i) a maximum likelihood dose 534 indicating the dose injected for the session, (ii) a time of day 536 record indicating the time of day that the session occurred, (iii) an inter-session time 537 indicating the time since the last session, (iv) a most likely dispensing pattern 537, and (v) a label indicator 538, which is a Boolean indicating whether the most likely pattern for the session can be labeled,
[0441] • Determine a confidence threshold 539 for the binary value of the label indicator.
[0442] In some embodiments, the decision support module 504 is accessible within any browser (phone, tablet, laptop / desktop). In some embodiments, the decision support module 504 runs on a local device framework and is available for download to a device including a decision support system 550 running an operating system 502 such as Android or iOS.
[0443] In some embodiments, one or more of the above-mentioned data elements or modules of the decision support system 550 for improving the data quality of the original allocation data are stored in one or more previously described storage devices, and correspond to the set of instructions for performing the above-mentioned functions. The data, modules or programs (e.g., instruction sets) identified above do not need to be implemented as separate software programs, processes or modules, and therefore, the various subsets of these modules can be combined or otherwise rearranged in various embodiments. In some embodiments, memory 492 and / or 590 optionally stores a subset of the modules and data structures identified above. In addition, in some embodiments, memory 492 and / or 590 stores additional modules and data structures not described above.
[0444] In some embodiments, the decision support system 550 for improving the data quality of the raw allocation data is a smart phone (e.g., iPhone), a laptop, a tablet computer, a desktop computer, or other form of electronic device (e.g., a gaming console). In some embodiments, the decision support system 550 is not mobile, and in some embodiments is mobile.
[0445] Figure 5C A method for improving the quality of allocation data from a data collection device 200 according to the present disclosure is shown, and for the purpose of describing the method, the following terminology is used.
[0446] A dispense or dispensing event is a pen activation, whether insulin comes out of the needle or is injected into the body.
[0447] A priming or priming event is any dispensing that is prepared for injection. This includes priming a new cartridge and also includes performing routine flow checks before each injection.
[0448] An injection or injection event is a dispensing event in which a medication is supposedly injected into the body.
[0449] A session is a time-clustered sequence of "prime" and "injection" dispensing during which the user intends to take a single target dose of insulin. Multiple injections may be taken in a single session due to dose splitting, dial limits, or cartridge changes.
[0450] A pattern is a specific sequence of priming and injections, often expressed in shorthand form, such as "ppi" (priming, priming, and injection) or "pii" (priming, injection, and injection). Each pattern is an interpretation of the dispensing that comprises a session. Because we know the amount of each dispensed dose 526, identifying the correct pattern is equivalent to determining the session injection dose 534.
[0451] The session injection dose is how much insulin the user intends to inject during a session.
[0452] The maximum likelihood dose is the optimal estimate of the session injection dose by a rule-based algorithm.
[0453] The marking rate is the fraction of sessions for which the maximum likelihood dose is communicated back to the decision support system to dispatch the session injection dose with the maximum likelihood dose value and mark the session in estimation mode. The user will be asked to mark the remaining sessions manually. The decision to mark a session is based on the confidence score. The confidence score will be evaluated against a confidence threshold, which affects the marking rate. The marking rate can be set to any value between 0% and 100% by selecting the algorithm parameters, i.e. selecting the confidence threshold.
[0454] refer to Figure 5C, reference numeral 701 indicates an index number used to number the various steps in the process. For processing step 710, index number 701-1=1, for processing step 712, index number 701-2=2, and so on. Rectangle 702 indicates a process related to determining a priori probability distribution of dose based on estimates from previous sessions. Rectangle 703 indicates a process related to determining the probability of dose based on information from the current session.
[0455] Split data into sessions
[0456] Block 710. The solution for connecting the injection device provides a time-stamped distribution record stream. Figure 5C Step 710 in Figure 6 and Figure 7 As shown, before dose estimation can be performed, these must be segmented into logical sessions. A session corresponds to a user deciding to take some insulin and completing that task.
[0457] The split is controlled by three parameters. The initial allocation starts a new session and resets the timer to zero, and the next allocation will be automatically included in the session until the session window of 761 seconds has passed, such as Figure 6 As shown. Later allocations can still be included, provided that the ratio between the resulting session length and the gap on each side is less than the session length ratio, and the timer is still less than the session window maximum. Once this is no longer true, the next allocation will start a new session, and the process repeats.
[0458] In the following example, and if Figure 6 As shown, where a,b,c,d,e,f,
[0459] {a,b} includes a session, because t b -t a <Session Window (761). Assign event c to start a new session, because t c -t a >Session window is maximum (762). The allocation event {c, d, e} includes the following sessions:
[0460] Session Window(761) <t e -t c <Session window maximum (762), the condition is
[0461] (t e -t c ) / (t f -t e )<session length ratio, and
[0462] (t e -t c ) / (t c-t b )<Session Length Ratio.
[0463] Assign f to start a new session, because t f -t c >Session window maximum (762).
[0464] Determine the expected dose
[0465] Block 712. The step of determining the expected dose is performed in step 712 and is performed while still FIG. 8A to FIG. 8D . Even if there is no data for the current session, it may be possible to determine that certain doses are more likely than others. Information about the likelihood of a dose may be obtained through dose guidance given by a decision support system or similar past or previous session 713. An expected dose based on the history of previous sessions is selected by setting the expected dose method = 'history' and adjusting the dose history parameter. Similarly, if the expected dose method = "dose guidance" is set, dose guidance is used. The dose history parameter controls a weighted average, with weights set by the time similarity of the day, the time similarity since the last session, and the age of the data, with more recent doses having stronger weights. The reduction in the weighting function can be Gaussian, exponential, or linear, depending on the nature of the data. Fig. 8A The construction of a data structure comprising the setup sessions created in the segmentation step 710 is shown. The session set 530 comprises a plurality of sessions L, and each session comprises a session injection dose 534, a time of day 535 and an inter-session time 536 estimated by the described algorithm.
[0466] It is worth noting that all three of these weight contributors are fully adjustable in the code and will need to be tuned for the application. The exponential decay rate of the discount weights over time can be set to a half-life of 28 days in the bolus regimen and 10 days in the basal regimen. For similarity in time, for example a Gaussian decay factor might be used where the weight is 50% at + / - 3 hours. In the case of inter-session time length, the Gaussian decay factor in the bolus regimen could be, for example, 50% at + / - 2.5 hours and 1e20 for the bolus, which would effectively invalidate the inter-session time weight in the basal regimen. For basal insulin applications, injections should be more regular.
[0467] Thus, for each previous session record 532, there is associated the session injection dose 524, the time of day 535, and the inter-session time assigned to the time of the previous session, as shown in FIG. Fig. 8A For each session i in the set from 1 to L, and the session Figure 8B , the corresponding weighted time of day 543, weighted inter-session time 544, and session age 545 are calculated, which are shown as a data structure in Figure 8C The corresponding data structure is shown in . The three weights 543, 543, 545 can be combined into a combined time weight 546. The weight is calculated from a certain time in the past until the session (i-1) before the current session i.
[0468] The value of the combined temporal weighted sum of previous sessions 548 can be used to determine whether there is sufficient data to continue determining the prior probability distribution. The value of the sum 548 is compared to an empirically estimated threshold.
[0469] If there is enough similar prior data, the combined weights can be multiplied by the session injection dose for each session to provide a contribution to the mean of the distribution, which is called the input to the mean 555. By summing the inputs 555 from all the means from each session prior to the current session, a weighted mean of the prior probability distribution can be derived, which can also be called the expected dose 558. In the same way, the input to the variance (w i 2 σ i 2 )556 and add all inputs from sessions preceding the current session to compute the weighted variance. i represents the weight, and σ i 2 Represents variance.
[0470] Fig.8D The current session is shown, which is associated with a set of inputs 550 of prior probabilities, and each input 552 of the prior distribution includes a session injection dose 553. The session injection dose 553 is numerically the same as the session injection dose 534, but is given a new reference numeral to illustrate that it is used here to calculate the prior distribution. The inputs to the prior distribution also include a combined time weight 554, an input 555 for the mean, and an input for the variance. The inputs 555 and 556 are added to provide the sum of the mean value inputs associated with session i (558), and the sum of the variance inputs 559 for the session. The session injection dose 553 is numerically the same as the session injection dose 534, but is given a new reference numeral to illustrate that it is used here to calculate the prior distribution. Similarly, the combined time weight 554 is numerically the same as the combined time weight 546, but is given a new reference numeral to illustrate that it is used here to calculate the prior distribution.
[0471] Setting Dose Probability
[0472] Block 714. The weighted mean 558 and weighted variance 559 are used to calculate the prior dose probability for integer doses, as Fig.9A The data structure shown and Fig. 9BThis step is indicated in FIG5 by box 714. If there is not enough prior knowledge or dosage guidance, the prior distribution can be uniform, i.e., constant. This is common when there is no decision support and the user is too new in the system to have accumulated a meaningful dosing history.
[0473] Fig.9A An example of a data structure that may be used in step 714 is shown, where, assuming the session injection dose is an integer, a set of integer doses 560 is created to evaluate the dose probability. If the session dose is a real number including dose fractions, a set of real doses corresponding to possible session doses should be created. The possible session doses are determined by the properties of the injection device. In this example, a dose prior 563 is evaluated for each integer dose 562. The dose prior is evaluated based on a prior distribution with a mean and variance corresponding to the expected dose 558 and a weighted variance 559. The expected dose 558 is also calculated in Fig. 9B The dose is shown together with the previous 563.
[0474] Thereafter, the method proceeds to evaluating the information based on the current session, which is represented in step 716 in FIG. 5 .
[0475] List of allowed patterns
[0476] Block 716. Using N allocated sessions, up to 2 N There are many ways to explain this, for example, in the case of N=2, the number of modes is 4, and where the symbol "p" represents priming, i represents injection, and the modes can be "pp", "pi", "ip", or "ii". However, not all of these are reasonable, and for the above examples, it is assumed that (1) each session will result in an injection, and (2) priming will not occur after an injection unless there is another injection in the session. If the cartridge is replaced with a durable pen or a new prefilled pen is used, priming may occur in a session after an injection.
[0477] Cartridge replacement is a particular challenge for reusable pens that do not have an automatic detection mechanism. The current algorithm assumes that we are always notified about cartridge replacement or when a new pen is used. This can be achieved, for example, by tracking the usage of the current cartridge and once it approaches the end of its useful life, "nagging" the user through the UI to confirm / deny whether to replace it. If a new pen is used, the new pen will identify itself with a unique identification code.
[0478] The number of injections allowed also depends on the possibility of split doses and the configurable parameter Maximum Injection Simplicity. Thus, by excluding cartridge changes and setting Maximum Injection Simplicity = 2, the allowed patterns for up to 4 dispensings are shown in the table below.
[0479] N Allow Mode 1 "I” 2 "pi", "ii" 3 "ppi", "pii" 4 "pppi", "ppii"
[0480] This table can be extended to any number of dispensings. In this example, the number of primings is unlimited, but the number of injections is limited. If the expected dose is greater than the toggle limit of the pen, a second injection will be allowed, allowing "iii" when N=3 and "piii" when N=4. If the session includes a cartridge change, the modes "ipi", "ippi", "pipi" will also become possible.
[0481] Fig.10 An example of a possible data structure used in the method is shown, where the data structure shows an allocation quantity 569 for constructing session I and a set of allowable allocation patterns 570 including O pattern 572.
[0482] Set mode weight (mode previous)
[0483] Box 718. Regardless of the size of the dispensing, some patterns are more likely than others. This is similar to step 714, where a prior probability of a possible session dose is found. The inputs to the prior distribution of patterns are: (i) the user's past priming behavior, if they have not primed in the past, they are unlikely to start doing so now, and vice versa. (ii) the time interval between two dispensings in the current session. Specifically, intervals longer than 3.5 seconds are more likely to precede an injection, while intervals shorter than 3.5 seconds are more likely to precede a priming. However, intervals close to 3.5 seconds may also be determined, such as 3 seconds and 4 seconds.
[0484] Fig.11A A data structure is shown for session i, which includes a set of pre-announcement indicators 680, including pre-announcement indicators 682 for all previous sessions. Each pre-announcement indicator 682 is binary, e.g., 1 or 0, and can be used to calculate a pre-announcement weight 684 for the current session, which is then the fraction of sessions with pre-announcements. Other linear or exponential weight functions using pre-announcement indicators as independent variables are contemplated.
[0485] Fig. 11B A split dispensing event 592 in session i is shown. There are 3 dispensing events 592 in this section, which result in 2 in-session times 681, because the in-session time 681 defines the time before a dispensing event is considered. Therefore, the first dispensing event 592~i~1 cannot have an in-session time 681. The lower limit in-session time 769 indicates a parameter that determines the preference for priming or injection. The lower limit in-session time 769 can be, for example, 3.5 seconds. In the example shown, the in-session time 681~i~2 is less than the lower limit in-session time 769, which means that the dispensing event 592~i~2 is likely to be a priming event. The dispensing event 592~i~2 is most likely an injection because it is greater than the lower limit in-session time 769.
[0486] After determining which modes are allowed, each mode has an equal probability of starting. In the described embodiment, these probabilities are adjusted based on two factors: (1) the user's "pre-injection probability" (based on how often we have observed them perform traffic checks in the past), and (2) the timing between allocations within that session (intra-session timing).
[0487] For item (1), a "pre-annotation probability" is maintained between 0 and 1. The pre-annotation weight can be understood as a fraction of past sessions in which the user performed at least one flow check or pre-annotation allocation. In another embodiment, an exponential "forgetting factor" is applied so that long-standing sessions do not count as recent sessions, otherwise if the user changes their behavior, the algorithm will be too slow to adapt. The way to influence the weight of a pattern is as follows: Initially, each weight is 1.0. For each pattern with a pre-annotation, the weight is modified to:
[0488] patternWeight=patternWeight*2 (2*primeProb-1)
[0489] And for each mode without pre-annotation, we modify the weight to
[0490] patternWeight=patternWeight*2 (1-2*primeProb)
[0491] Note that if the user does not show either tendency (primeProb=0.5), the weights are multiplied by one and remain unchanged. If the user tends to pre-annotate, the pattern with pre-annotation has a larger weight, while the pattern without pre-annotation has a smaller weight, and vice versa if the user tends not to pre-annotate.
[0492] For item (2), research suggests that a 3.5 second gap between dispenses is a good cutoff, with longer gaps often associated with "pi" (a flow check followed by an injection), and shorter gaps often associated with "pp" (two flow checks). Note that if there are only two dispenses in a session, this has no effect at all, since the pattern "pp" is not allowed anyway. There must be at least one injection. But for sessions with three or more dispenses, information about the intra-session times can be used.
[0493] In an exemplary embodiment, the weight calculation may be calculated in the following manner:
[0494] patternWeight=patternWeight*
[0495] 1.2 (length(shortPPs)+length(longPIs)) / 1.2 (length(longPPs)+length(shortPIs)) ,
[0496] Where in this example, "length(longPPs)" is a count of the number of "pp" assignment pairs, "length(longPIs)" is a count of the number of "pi" assignment pairs in a pattern where the actual time interval is long, e.g., t>3.5 seconds. "length(shortPPs)" is a count of the number of "pp" assignment pairs, and "length(shortPIs)" is a count of the number of "pi" assignment pairs in a pattern where the actual time interval is short, e.g., t<3.5 seconds.
[0497] So for example if the current session is 3 allocations, consider the interval between allocations 1 and 2 to be 2 seconds, and the interval between allocations 2 and 3 to be 5 seconds. Allowed modes are: ppi, pii.
[0498] For mode ppi, the allocation pairs are calculated as:
[0499] length(longPPs)=0, length(shortPIs)=0 and (length(longPPs)+length(shortPIs))=0 and
[0500] length(shortPPs)=1, length(longPIs)=1 and (length(shortPPs)+length(longPIs))=2.
[0501] The corresponding mode weight can then be calculated as:
[0502] patternWeight(“ppi”)=patternWeight(“ppi”)*1.2 2 / 1.2 0 =pattern-Weight("ppi")*1.2 2
[0503] For pattern pii, the pattern pair count is:
[0504] length(longPPs)=0, length(shortPIs)=1 and (length(longPPs)+length(shortPIs))=1 and
[0505] length(shortPPs)=0, length(longPIs)=1 and (length(shortPPs)+length(longPIs))=1.
[0506] The corresponding mode weight can then be calculated as:
[0507] patternWeight(“pii”)=patternWeight(“pii”)*1.2 1 / 1.2 1 =patternWeight,
[0508] Thus, pattern weight (“ppi”) > pattern weight (“pii”), and in this example, when we multiply the pattern probability by the pattern weight and normalize to 1, the pattern will previously increase the probability of marking the session as “ppi” as will be described with respect to box 722.
[0509] Calculating pattern probabilities
[0510] Block 720. For each dispensing in a session, a probability curve is used to represent the probability of a dispensing being an injection or a priming based on dose size, i.e., a P(injection)-versus-dispensing-size curve or a P(priming)-versus-dispensing-size curve. The larger the dispensing size, the more likely it is an injection and the less likely it is a priming. The dispensing sizes dispensed in each session are input 721 to calculate the mode probability.
[0511] The actual curve used can be, for example, erf(x) (Gaussian integral) with a nice S-shape. The scaling depends on the type of medication: for basal insulin, the average priming / injection size tracked for the current user is used, which makes the algorithm less likely to reject larger priming allocations (3 to 4 units or more), given that injections are typically much larger (e.g., 20 units). For bolus insulin, the injection doses are less consistent and are typically smaller, so in this example, erf(x) is adopted as a fixed S-curve with a 50 / 50 crossover between priming / injections at 4 units. In addition, if all allocations in a session are <= 4 units, we automatically assume that the candidate injection is actually an injection. This avoids rejecting very small doses. Once the erf(x) curve is determined, the probability of each pattern becomes a simple product of P(injection) and a factor of P(priming) = 1-P(injection). For example, in a session with allocations {3,8}, the probability of pattern "pi" is [1-P(3 is an injection)]*P(8 is an injection).
[0512] Fig. 12AThe probability curve erf(x) for 2 bolus dispenses is shown. The probability of pattern "pi" is shown in the left graph 770-1. The dashed curve shows the probability that the dispense is a priming, and if the dispense size is less than 4 units, the dispense event is most likely a priming. Similarly, the solid curve shows the probability that the dispense is an injection based on the dispense size. The right graph 770-2 shows the probability of pattern ii. The circle represents the actual dispense size for the current session. Fig. 12B A data structure of pattern probabilities 607 associated with the current session i is shown.
[0513] Update mode probabilities (using previous)
[0514] Block 722. After obtaining the size-based probabilities for each allowed pattern, Bayes' theorem is applied to the factors in the pattern weights of step 718. The size-based probabilities are multiplied by the pattern weights (prior distribution) and the results are normalized so the overall pattern probabilities sum to 1.
[0515] Fig.13 A data structure is shown that illustrates constructing a split allocation event 592 and allowed modes 572 for the current session i. The allowed modes are associated with mode weights 674 including pre-injection weights 684 and intra-session time weights 676, and mode probabilities based on allocation size 607. As described above, a combined mode probability 688 can be calculated based on the mode weights 674 and the mode probabilities based on allocation size 607.
[0516] Converting pattern probabilities to dose probabilities
[0517] Block 724. The mapping from mode to dose is "many-to-one." That is, multiple modes may result in the same session dose, but there is no ambiguity from mode to dose.
[0518] Example: Session {1,2,1,7}. Allowed patterns are "pppi", "ppii", "pipi", "ippi".
[0519] Possible doses are:
[0520] 7 units ("pppi")
[0521] 8 units ("ppii", "ippi")
[0522] 9 units ("pipi")
[0523] therefore,
[0524] P(dose=7)=P(mode is "pppi")
[0525] P(dose=8)=P(mode is "ppii")+P(mode is "ippi")
[0526] P(dose=9)=P(mode is "pipi")
[0527] P(dose<7)=P(dose>9)=0
[0528] Fig.14 A data structure is shown illustrating constructing a set of possible doses 610 comprising a plurality of possible doses 612. Each possible dose comprises one or more corresponding possible patterns 614, and each pattern comprises a combined pattern probability 688. If a possible dose comprises more than 1 possible pattern, the likelihood of each pattern is summed to provide a sum of the combined pattern probabilities for the possible dose in question 617. The pattern probability sum 617 is calculated for each possible dose.
[0529] Update dose probability
[0530] Block 726. The dose probabilities obtained in step 724 are multiplied by the prior distribution in step 714 and then renormalized so that they sum to 1, which is called the Bayesian role. The resulting distribution is called the "posterior" distribution over the session doses.
[0531] The most likely session dose is the dose with the highest probability, i.e., the largest independent variable (posterior distribution). The independent variable that produces the largest value. This is probably the best guess, although it may or may not be a "good" guess. Determining the adequacy of the estimate is the goal of the confidence scores and evaluations described in step 728. The most likely dose in the posterior distribution is the maximum likelihood estimate.
[0532] Fig.15 A data structure is shown that shows the construction of possible doses using the corresponding sum of pattern probabilities 617 and the corresponding integer dose 624 and previous dose 626. Both of these probabilities are related to the session dose size and can therefore be combined into a combined probability of a possible dose 627. Again, this dose 627 can be normalized to 1.
[0533] Calculating confidence scores
[0534] Block 728. Intuitively, there are several ways to assess the confidence in the maximum likelihood of the session dose estimate:
[0535] (i) Data probabilities. How large (or small) are the probabilities in step 720 before normalization?
[0536] (ii) Expected dose match. If there is an expected dose for this session, how far does it differ from the maximum likelihood dose estimate?
[0537] (iii) Ambiguity. Does the maximum likelihood dose estimate dominate the posterior session dose distribution, or are there other peaks not far below it?
[0538] (iv) Pre-injection consistency. Tracking the maximum likelihood dose estimate to a winning pattern, such as “pi” or “ii”, does this match the user’s historical pre-injection tendencies?
[0539] These four example confidence metrics (more can be added) can be converted to confidence scores and can be configured individually using the ConfidenceWeight parameter. The overall confidence score is the minimum (configuration score 1, configuration score 2, ...)
[0540] You can choose various confidence measures and adjust the score by setting the corresponding ConfidenceWeight variable. By convention, when the corresponding weight of a confidence measure is zero, it has no effect.
[0541] The overall confidence is the minimum (of all confidence measures). The overall confidence is compared to a threshold (confidenceThreshold) to determine whether to mark the session injection dose or to input it back to the user interface for manual marking by the user.
[0542] Using the observed session data, the probability
[0543] The confidence score formula is:
[0544] pDataConfidence=1-(pDataConfidenceWeight*(1-pData))pDatapDataConfidencepDatapDataConfidencepDataConfidenceWeightpData,
[0545] Therefore, when the weight is 1.0, pDatapDataConfidence=pData. pDatapDataConfidencepDataConfidenceWeight=1.0,
[0546] metric, the difference between the expected dose and the maximum likelihood dose
[0547] As a confidence measure? The confidence score follows the formula:
[0548] expDoseConfidence=1-expDoseConfidenceWeight*(MLDose-
[0549] ExpDose) / sqrt(Variance),
[0550] expDoseConfidenceWeight = 0.15. If the confidence threshold is 0.7, then at most 2 standard deviations.
[0551] Metrics, instruments in the output of posterior session injection dose probabilities. The confidence score formula is:
[0552] ambigConfidence=max(0,1-(ambigConfidenceWeight*(1-max(pDoseOut)) / max(pDoseOut))),
[0553] When the weight is 1, ambigConfidence drops to zero when the maximum likelihood dose probability drops to 0.5 (implying that the sum of other dose probabilities is also 0.5). ambigConfidenceWeight = 0.75.
[0554] Metrics, pre-annotation / non-pre-annotation consistency as a confidence measure? The score determines at what value of primeProb or 1-primeProb the confidence starts to decrease towards zero. For example, 0 means consistencyConfidence will always be 1, 1 means consistencyConfidence = 1 only if its pre-annotation or non-pre-annotation history is perfect, and 0.5 means consistencyConfidence = 1 as long as its pre-annotation history is between 50 / 50 and perfect. consistencyConfidenceWeight = 0.5.
[0555] Fig.16 A data structure for constructing a confidence metric is shown, which includes a set of confidence metrics 630 and corresponding confidence scores in a set of confidence scores 640. All confidence scores 642, 643, 644, 645 are evaluated and the minimum confidence score is evaluated against a confidence threshold 539.
[0556] If confidence > confidence threshold, then mark the session
[0557] Box 730. The minimum confidence score is compared to a confidence threshold 539, which may be, for example, 0.7. If the minimum confidence score is greater than the confidence threshold, the session is “flagged” and the user does not need to be asked for confirmation. If the confidence score is less than the confidence threshold, the user interphase will need to ask the user to confirm the injected dose. Depending on the reason for the low confidence, the smart feedback may be adapted to the following requirements, e.g., asking if it is priming consistency, asking the user “Did you forget to prime?”, etc. It is important to remember that the labeling rate on a given dataset is not an inherent property of the algorithm. Depending on the confidence threshold, the labeling rate may be easily selected between 0-100%. It is recommended to select a target labeling rate based on a trade-off between dose estimation accuracy and user acceptance.
[0558] Fig.17 An unlabeled session 772 in the session detail diagram is schematically shown, where the mode of two allocations is unknown. The diagram also shows a labeled session 773, where the allocations have been labeled with the most likely mode that provides the maximum likelihood dose. The label indicator 538 can indicate whether the session is labeled depending on the result of the confidence score evaluation.
[0559] Embodiment 3:
[0560] Time division
[0561] Fig.18 A patient survey graph is shown. The survey graph shows up to the first 144 sessions and 144 session detail graphs. The first 5 sessions 774a are unmarked, the next 5 sessions 774b are marked, session 774c is unmarked, and 774d is marked. The rectangles between the session detail graphs indicate the time between sessions. Due to grayscale scaling, it is not possible to identify the color indication, which would otherwise indicate "marked", "unmarked", "injection", "priming". The numbers below the session detail graphs indicate the size of the dose dispensed. Fig.18 A step 710 involves dividing the dispense into a plurality of portions.
[0562] Determine the expected dose
[0563] Fig.19AStep 712 is involved, and the previous information is shown in the "Historical Weight" graph for the 144 sessions shown in the survey graph. The historical weight graph summarizes the suitability of past sessions to the current session from newest to oldest. The solid line 778 shown in the middle graph is the weight due to the age of the session, which is always a decreasing curve due to the sorting. The long dashed line 777b in the left graph and the corresponding solid point 777a in the middle graph are the weights due to the similarity of the gap lengths between sessions. The short dashed line 776b in the right graph and the corresponding solid point 776a in the middle graph are the weights due to the similarity of the time of day. The more points are close to 1.0, the more applicable the past sessions are in estimating the "expected dose".
[0564] The sum of all combined weights 548 (here: 8.6) relative to the current session must exceed a threshold before the expected dose can be calculated. The sum of weights 548 in Fig.19B The data structure is shown in the left figure.
[0565] Setting Dose Probability
[0566] In this example, there is enough history (8.6 is above the empirical threshold) to calculate a weighted average, the "expected dose" 558. In this case, the expected dose is 7.9 U. The previous dose probability is Gaussian, Fig.19B The prior distribution is calculated in connection with step 714 as shown by dots and a solid line in curve 767 in FIG. The mean is at the expected dose 558 and the variance is proportional to the variance of the past doses in the weighted average.
[0567] Allowed modes
[0568] Fig.19C A data structure is shown with an allocation quantity 569 and the allowed mode 570 set including the allowed mode 570.
[0569] Setting the Mode Weight
[0570] Fig.19D The data structure with pattern weights is shown. Since there are only two allocations in the session, only pattern weights related to pre-injection can be used. Each pattern is given a weight based on past pre-injection behavior. In this case, the patient is a very consistent pre-injector, so we strongly favor "pi" before considering allocation size. Fig.19D shows that in this case the pre-annotation weight 684 is 0.79, but if we consider the weight as a score, then exponential decay of the consideration weight with this score as the independent variable is also possible, depending on how easy it is to change the pre-annotation habit.
[0571] Calculating pattern probabilities
[0572] The allocation in the session has allocation size {2, 9}. By applying the rules discussed, pattern 572 has only two possible interpretations, namely "pi" and "ii". Fig.19E Each pattern is shown in a probability graph. The probability of pattern "pi" is about 1, and the probability of pattern ii is about 0. This is Fig.19E is shown as pattern probability 607 in the data structure.
[0573] Pattern probabilities can be evaluated based on allocation size. Separate from pattern weights, each pattern is given a probability based on allocation size. Larger allocations are more likely to be injections. Fig.19E The probability plots in show P(pre-injection) or P(injection) versus dose size for each allocation. For bolus medications, the curves are fixed and have a 50 / 50 probability of crossing at 4u. The bubbles are the points where the curves are evaluated, 2u and 9u. P(2 is pre-injection)*P(9 is injection) is close to 1, so the probability of "pi" is high. P(2 is injection) is very small, so the probability of ii is low.
[0574] Update mode probability
[0575] Fig.19F A step 722 of updating pattern probabilities is shown. The set 590 of allocation events for the current session i is shown on the left, along with the corresponding allocation sizes 592. The set 570 of allowed allocation patterns for the current session i is shown on the right. The allocation size-based pattern probabilities are updated using the pattern weights to yield an overall pattern probability, with "pi" being substantially 100% and "ii" being substantially 0%. Weights based on time within a session are not applicable for sessions with only two allocations.
[0576] Converting pattern probabilities to dose probabilities
[0577] Figure 19G A data structure is shown that includes a set 610 of possible doses, where each possible dose 612 includes a possible mode. Figure 19G This involves converting the pattern probabilities to dose probabilities in step 724. If P("pi") = x and P("ii") = y, then P(dose is 9) = x, P(dose is 11) = y, and P(dose is neither 9 nor 11) = 0.
[0578] Update dose probability
[0579] Next, we update these dose probabilities by multiplying by the dose prior and renormalizing (Bayes' rule). The result is the final ("posterior") dose probability distribution 617. The largest a posteriori dose likelihood is called the "maximum likelihood" dose.
[0580] Fig.19H A data structure including a set of possible doses 610 for the current session 532~i is shown, where each possible dose 612 includes the sum of the combined mode probability 617 obtained in step 714, the corresponding integer dose 624, and the dose previous 626. The probabilities 617, 626 are then combined into a combined probability of a possible dose 627. The combined probabilities of the possible doses 627 are normalized to sum to 1 to obtain the normalized combined probabilities of the possible doses. Note that the normalized combined probability of the possible dose 628 for the possible dose 612 of 9 is 1, that is, the maximum likelihood dose is 9U.
[0581] Calculating confidence scores
[0582] Confidence Scores. Now, we have a dose estimate (9U), but how likely is it to be correct? This is the realm of confidence scores. There are currently four types of confidence scores, all of which can be adjusted: How close is the estimate to the expected dose? How likely is it given the pattern and dose probabilities (pData numbers) selected prior to normalization? How ambiguous is the final (posterior) probability? i.e. is there >1 answer with a non-trivial probability? Is the selected pattern consistent with the prior injection history for this patient? The overall confidence is the smallest of these scores, in this case "ExpDose" (matched expected dose). An overall confidence of 0.96 is greater than the threshold of 0.7, and the session is labeled and a value of 9U is assigned for the session dose. Even though the session is not labeled, it can still be used in the evaluation of future dose estimates in later sessions.
[0583] Summarize
[0584] Session {2, 9} can only be interpreted in two ways. Because 2 is small for an injection but typical for priming, and because this patient has been priming, "pi" is more likely than ii. The estimated dose is very close to the average dose for this time of day and the inter-session gap, the probability is high, the final probability is unambiguous, and the priming behavior is consistent, so the confidence is high. Since the confidence is above our threshold (70% in the simulation), this session is formally labeled.
Claims
1. A computing system (502) for improving data quality of a query medication dispensing dataset, wherein the system comprises: one or more processors; and a memory, the memory comprising: - instructions which, when executed by the one or more processors, perform a method in response to receiving a query request for improving the quality of allocated data, the instructions comprising the steps of: a) obtaining a query allocation data set (520), the query allocation data set comprising a plurality of allocation records created during time, each corresponding allocation record representing an allocation event, the allocation event comprising: (i) a dispensed amount of a medicament, wherein the dispensed amount is one of a priming amount [p] or an injection amount [i], each amount corresponding to a certain size, (ii) the corresponding allocation timestamp, b) partitioning (710) the query allocation data set into one or more current sessions (530), each current session comprising a series of allocation events clustered in time according to a set of clustering criteria, For each current session (523): c) creating a list of possible dispensing patterns according to a set of pattern rules (16, 716), wherein a dispensing pattern is a series of dispensing amounts, the dispensing amounts being priming amounts or injection amounts, and wherein the set of pattern rules comprises: The last allocation of the session must be an injection, Each injection must be preceded by a flow check of quantity ≥ 0, The upper limit of the number of injections, d) for each pattern, calculating a combined pattern weight, the combined pattern weight being the product of weight factors for each dispense in the pattern, wherein for a given dispense type and dispense size, each weight factor is determined according to a weight factor versus dispense size function (70, 770), wherein larger dispense sizes are more likely to represent an injection event and less likely to represent a priming event, e) identifying the winning pattern as the pattern having the highest combined pattern weight; and f) Storing a corresponding dispensing event in a memory, the corresponding dispensing event being marked as a priming or injection event corresponding to the winning pattern.
2. The computing system of claim 1, wherein the instructions include the following additional steps: - Obtaining a historical allocation data set, the historical allocation data set comprising a plurality of previous allocation records created during a previous time.
3. The computing system of claim 2, the instructions comprising the following additional steps for each current session: - generating mean and variance values (555, 556) for an expected total injection volume distribution based on historical dispensing data, - Comparing the highest and second highest combined pattern weights, and if the pattern weights are within a given range of being close to each other, identifying the updated winning pattern as the pattern with the highest probability according to the generated distribution.
4. The computing system of claim 3, the instructions comprising the following additional steps for each current session: - a historical weighting of the historical dispensing data upon which the expected total injection volume value is calculated, the historical weighting being based on a relevance criterion comprising one or more of the following: - data age, - similarity of time of day, and -Inter-session gap similarity, Unless the historical weight reaches a given minimum threshold, the expected total injection volume value is not generated.
5. The computing system of any one of claims 1 to 4, the instructions comprising the following additional steps for each current session: - determining a combined confidence value based on one or more confidence measures from a group of confidence values, the group of confidence values comprising: - a data confidence value based on the value of said highest combined mode weight, - an expected amount confidence value based on the difference between the estimated total injection amount and the expected total injection amount, if calculated, - an ambiguity confidence value based on the probability proximity of the highest and second highest combined pattern weights according to the generated distribution, if any; as well as - a pre-bet confidence value based on the consistency between the pre-betting behaviors of the winning pattern, and Wherein, when the confidence value of the combination is higher than a given threshold, then: - Calculate the estimated total shot amount as the sum of all shot amounts in said winning pattern.
6. The computing system of claim 3, the instructions comprising the following additional steps for each current session: - determining a combined confidence value based on one or more confidence measures from a group of confidence values, the group of confidence values comprising: - a data confidence value based on the value of said highest combined mode weight, - an expected amount confidence value based on the difference between the estimated total injection amount and the expected total injection amount, if calculated, - an ambiguity confidence value based on the probability proximity of the highest and second highest combined pattern weights according to the generated distribution, if any; as well as - a pre-bet confidence value based on the consistency between the pre-betting behaviors of the winning pattern, and Wherein, when the confidence value of the combination is higher than a given threshold, then: - Calculate the estimated total shot amount as the sum of all shot amounts in said winning pattern; When the confidence value of the combination is higher than a given threshold, then: - Flagging sessions corresponding to the winning pattern, wherein the mean and variance values of the expected total injection volume distribution are based solely on historical dispensing data from the flagged sessions.
7. The computing system of any one of claims 2-4 and 6, wherein the combined mode weight is a product of one or more additional factors, the factors comprising: - Pre-announcement probability factors based on historical allocation data, - Pre-injection variance factor, and - Intra-session allocation spacing factor for sessions with more than two allocations.
8. The computing system of claim 1, the instructions comprising the following additional steps for each current session: - Calculate the estimated total shot amount as the sum of all shot amounts in said winning pattern.
9. The computing system of any one of claims 1-4, 6 and 8, wherein: - the obtained dispensing record includes an identifier for identifying a given dispensing event as a bolus event or a base event, and - The rules and parameters of the method are adapted for use with allocation data generated with a bolus-only regimen, a basal-only regimen, or a bolus and basal regimen.
10. The computing system of any one of claims 1-4, 6 and 8, wherein: - the segmentation is controlled by a set of time parameters and a set of time measurements, wherein an initial allocation event in the series of allocation events starts a session and clears a timer, and subsequent allocations are automatically included in this session until a session time window has elapsed, and wherein subsequent allocations are included if the following expressions are true: (i) the ratio between the resulting session length and the resulting inter-session length (763, 765) on either side of the session is less than the session length ratio, and (ii) the resulting session length is less than a session window maximum, - wherein the series of dispensing events in the session defines a set of dispensing events, and wherein each dispensing event comprises a corresponding dispensing size, i.e. an amount of medicament dispensed, and - wherein in response to the expression no longer being true, a new session is started.
11. The computing system of any of claims 1-4, 6 and 8, wherein a given event or session tag is changeable by a user.
