Contents

1. Pepper Objects and Communication

This section documents the Pepper Objects used to communicate data between the Pepper Mobile Application (PMA) and Pepper Server Application (PSA). This includes which participant creates, reads or writes each Pepper Object, where it is stored, the internal structure of the Objects and other important notes such as how and when they are sent or accessed.

1.1 Summary of Object Communication

This section summarises the communication between the PEPPER objects, also depicted in Figure 1.

The remaining Objects are all effectively sent from the PMA to the PSA via the Pepper remote database.

The object descriptions below use an enhanced JSON Type system. The JSON standard (IETF RFC 8259, 2017) says that a JSON value must be an object, array, number, string, or one of the three literal names true, false, null. However for the purposes of the descriptions presented here and to provide additional clarity, the type number is replaced by Double and Integer. Some string values are expressed as datetimes, dd-MMM-YY HH:mm:ss Z.

Pepper Remote Database PSA Handset Patient BGValue Meal PhysicalActivity Alcohol Alarm BasalProfile Medication InsulinInjection CaseBase SafetySystemResponse Notes Patient BGValue Meal PhysicalActivity Alcohol Alarm BasalProfile Medication InsulinInjection CaseBase SafetySystemResponse Notes
Figure 1. Pepper objects

1.2 Patient Object

Description: The patient Object stores demographic and patient specific therapy details.
Created by: PSA
Edited by: PSA
Stored: Pepper Database
Participants: PSA. PMA and Safety System.
Notes:
  • All changes to the Patient Object are carried out on the PSA.
  • The PMA queries the Pepper Database on launch and periodically.
  • The PSA queries the Pepper Database when patient details are needed.
  • The PMA passes the Patient Object to the Safety System to change its behaviour / configuration.
  • At present the PMA should be rebooted after the Patient Object is edited and saved on the PSA to ensure that the Safety System correctly reinitializes its internal modules.
Details:
Attribute Json Type Used by
PMA PSA
Core Safety System CBR
Id String (UUID) Y
PatientCode String
EmailAddressForTrial String Y
DateEnrolled Datetime dd-MMM-YY HH:mm:ss Z
Password String Y
ConfirmPassword String
Gender Integer (0 = Male | 1 = Female)
HbA1c Double
HbA1cPercent Double
GlucoseInTargetIntervalMin Double Y
GlucoseInTargetIntervalMax Double Y
GlucoseSetPoint Double Y Y
CHOmean Double Y
Weight Double Y Y
Country Integer (0 = UK | 1 = Spain)
Language Integer (0 = English | 1 = Spanish | 2= Catalan)
Clinic Integer (0 = ICL | 1 = IDIBIGI | 2= Catalqn)
CellnovoPMASerialNo String
BgMu Integer (0 = mg/dL | 1 = mmol/L) Y
CarerPhoneNumber String Y
LastRevisionDate Datetime dd-MMM-YY HH:mm:ss Z
TherapyType Integer (0 =CSII |1 = MDI)
SmartphoneSerialNo String
BloodGlucoseMeterSerialNo String
CBROrStandardCalculation String (CBR | Standard calculation) Y
StartTimeMinimumPostprandialBG Integer Y
EndTimeMinimumPostprandialBG Integer Y
SynchronizationDate Datetime dd-MMM-YY HH:mm:ss Z
InsulinSensitivity Double Y
InsulinAbsorptionTime Integer Y
CarbohydrateAbsorptionTime Integer Y
FastingBloodGlucose Integer Y
IcrSafety Comma separated list of Doubles Y
TimeIcrSafety Comma separated list of Integers Y
IsfSafety Comma separated list of Double Y
TimeIsfSafety Comma separated list of Integers Y
SafetySystemActive Integer (1= On | 0 = Off) Y

Example Patient Json


{ 
"Id": "C0FA95EC-13D6-4CE7-8983-14221BFBE970", 
"PatientCode": "P_020", 
"EmailAddressForTrial": "pepperusability@gmail.com", 
"DateEnrolled": "06-Jul-17 12:00:00 AM", 
"Password": "", 
"ConfirmPassword": "", 
"Gender": 0, 
"HbA1c": 0, 
"HbA1cPercent": 0, 
"GlucoseInTargetIntervalMin": 70, 
"GlucoseInTargetIntervalMax": 171, 
"GlucoseSetPoint": 106, 
"CHOmean": 30, 
"Weight": 65, 
"Country": 0, 
"Language": 0, 
"Clinic": 0, 
"CellnovoPMASerialNo": "", 
"BgMu": 0, 
"CarerPhoneNumber": "07590719843", 
"LastRevisionDate": "01-Jan-00 12:00:00 AM", 
"TherapyType": 1, 
"SmartphoneSerialNo": "0257e12ce1933b90", 
"BloodGlucoseMeterSerialNo": "12345", 
"CBROrStandardCalculation": "Standard calculation", 
"StartTimeMinimumPostprandialBG": "1", 
"EndTimeMinimumPostprandialBG": "3", 
"SynchronizationDate": "01-Jan-70 01:00:00 AM", 
"InsulinSensitivity": 0.00255, 
"InsulinAbsorptionTime": 75, 
"CarbohydrateAbsorptionTime": 89, 
"FastingBloodGlucose": 108, 
"IcrSafety": "7.00,5.00,8.00,7.00", 
"TimeIcrSafety": "00,06,14,20", 
"IsfSafety": "50.00,40.00,50.00", 
"TimeIsfSafety": "00,06,18", 
"SafetySystemActive": 1 
}

1.3 CaseBase Object

Description: The CaseBase Object stores information for a CBR case. Each patient has an array of CaseBase Objects stored on the Pepper remote database.
Created by: PSA (for new patient) and PMA (new case on PMA)
Edited by: PMA, PSA and Safety System
Stored: Pepper Database
Participants: PSA. PMA and Safety System.
Notes:
  • Initial CaseBase Objects are generated by the PSA with State 2 and saved to the Pepper remote database
  • PMA retrieves all CaseBase Objects with State 2 from the Pepper remote database for the required patient (based on the PatientObject)
  • PMA creates and populates a new CaseBase Object during ‘Get Bolus Advice’
  • PMA passes the CaseBase Object to the Safety System after retrieve and reuse actions have been run by the CBR.
  • Safety System constrains and populates relevant fields on the CaseBase Object
  • PMA populates post prandial during the time frame obtained from the Patient Object
  • PMA sends the completed case to the Pepper remote database when the next case is requested with a State of 0
  • PSA updates the State to 1 when retrieved from the Pepper remote database.
  • PSA sends the updated CaseBase Object to the Pepper remote database with a State of 2 when the revision process is completed.
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
Test JsonArray of JsonElements (see Table below)
DateTime String
Attributes JsonArray of JsonObjects (see Table below)
State Integer (0 = NewPMA | 1 = SentToPSA | 2 = ReviewedPSA

Test JsonArray

Attribute Json Type
Id String (UUID)
attributes JsonObject (see Table below)

Test > attributes JsonObject

Attribute Json Type Notes
PatientId String (UUID) Obtained from Patient Object
CaseId String (UUID) Generated by PMA, must be the same as Id in the Test JsonArray
datetime String yyyy-MM-dd hh:mm:ss Obtained from PMA
timeofday String (Integer 0 – 23 inclusive) Obtained from PMA
typeofday String (Values = Holidays | workday) Input by user
PremealBloodGlucose String Obtained from CGM
UserPastPhysicalActivityIntensity String (Values = none | low | mild | intense) Input by user
UserPastPhysicalActivityType String (Values = aerobic | nonaerobic) Input by user
PastPhysicalActivityIntensity String (Values = none | low | mild | intense) Quantified from the last 10 hours
PastPhysicalActivityType String (Values = aerobic | nonaerobic) Always aerobic (currently)
FuturePhysicalActivityIntensity String (Values = none | low | mild | intense) Input by user
FuturePhysicalActivityType String (Values = aerobic | nonaerobic) Input by user
BasalDose String (Real Number #.####) Calculated from basal profile (CSII)
InsulinOnBoard String (Real Number #.####) Obtained from Safety System
CarbsOnBoard String (Real Number #.####) Obtained from Safety System
Carbohydrates String (Real Number #.#) Input by user
Fats String (Values = LOW | MEDIUM | HIGH)
MealAbsorptionRate String (Values = SLOW | MEDIUM | FAST) Input by user
AlcoholType String (Values = Soft | High) Input by user
AlcoholQuantity String (Values = None | Moderate | High) Input by user
HoursOfSleep String (Real Number #.#) Input by user
PsychologicalStress String (Values = Yes | No) Input by user
Happiness String (Values = Happy | Neutral | Sad) Input by user
Tiredness String (Values = Yes | No) Input by user
HormoneCycle String (Values = Default | Premenstruation | Menstruation) Input by user
Fever String (Values = Yes | No) Input by user
DigestiveIllness String (Values = Yes | No) Input by user
Medication String (Comma separated list of medication names) Input by user
AmbientTemperature String (Integer) Input by user
ICRreuse String (Real Number #.####) Calculated by CBR
ISFreuse String (Real Number #.####) Calculated by CBR
BolusReuse String (Real Number #.####) Calculated by CBR
TypeOfBolus String (Integer)
ReusedCases String (Comma separated list of reused CaseId) Calculated by CBR
ICRsafety String (Real Number #.####) Calculated by CBR
ISFsafety String (Real Number #.####) Calculated by CBR
BolusSafety String (Real Number #.####) Calculated by Safety System
ICRuser String (Real Number #.####) Calculated by CBR
ISFuser String (Real Number #.####) Calculated by CBR
BolusUser String (Real Number #.####) Input by user if recommendation is rejected, otherwise the same as BolusSafety if accepted)
PostprandialMinGlucose String (Real Number #.####) Obtained from CGM
ICRrevise String (Real Number #.####) Calculated by CBR on PSA
ISFrevise String (Real Number #.####) Calculated by CBR on PSA
BolusRevise String (Real Number #.####) Calculated by CBR on PSA
ExpertValidation String (Values = OK | KO | MAN) Input by user on PSA
RejectCase String
PendingToBeSendToServer String (Values = YES | NO) Calculated by PMA
PendingToBeRetained String (Values = YES | NO) Calculated by PSA

Attributes JsonArray

Attributes contains a JsonObject for each of the attributes listed in Test > attributes above. Each JsonObject has the following format:

Attribute Json Type
id String (Value = attribute name, e.g. patientid)
description String (Value = attribute name, e.g. PatientId)
type Integer
weight Double

Example CaseBase Json




{ 
"Id": "4418333E-D45C-5061-E71D-06EE20F5696B",
"PatientId": "C0FA95EC-13D6-4CE7-8983-14221BFBE970",
"Test":
"[{\"attributes\":{\"PatientId\":\"C0FA95EC-13D6-4CE7-8983-14221BFBE970\",\"
CaseId\":\"9f82b034-dd38-47de-8ed6-c82e32f595dd\",\"dateTime\":\"09-Jan-18
04:37:33 PM\",\"timeofday\":\"16\",\"typeofday
\":\"1\",\"PremealBloodGlucose\":\"119.74644310774195\",\"
UserPastPhysicalActivityIntensity\":\"aerobic\",\"
UserPastPhysicalActivityType\":\"none\",\"PastPhysicalActivityIntensity\":\"0
\",\"PastPhysicalActivityType\":\"0\",\"FuturePhysicalActivityIntensity\":\"0
\",\"FuturePhysicalActivityType\":\"0\",\"BasalDose\":\"1.0\",\"
InsulinOnBoard\":\"14.584875\",\"CarbsOnBoard\":\"119.30279539692404\",\"
Carbohydrates\":\"10.0\",\"Fats\":\"0\",\"MealAbsorptionRate\":\"medium\",\"
AlcoholType\":\"0\",\"AlcoholQuantity\":\"0\",\"HoursOfSleep\":\"0.0\",\"
PhysiologicalStress\":\"0\",\"Happiness\":\"0.5\",\"Tiredness\":\"0\",\"
HormoneCycle\":\"0\",\"Fever
\":\"0\",\"DigestiveIllnesses\":\"0\",\"Medication\":null,\"
AmbientTemperature\":\"0.0\",\"ICRreuse\":\"19.1\",\"ISFreuse\":\"100.4774\",
\"BolusReuse\":\"0.0\",\"TypeOfBolus\":\"1\",\"ICRsafety\":\"8.0\",\"
ISFsafety\":\"40.0\",\"BolusSafety\":\"0.0\",\"ICRuser\":null,\"ISFuser\":
null,\"BolusUser\":\"0.0\",\"PostprandialMinGlucose\":\"0.0\",\"ICRrevise\":\
"12\",\"ISFrevise\":null,\"BolusRevise\":null,\"ExpertValidation\":\"KO\",\"
RejectCase\":\"NO\",\"PendingToBeSendToServer\":\"yes\",\"PendingToBeRetained
\":\"no\"},\"id\":\"9f82b034-dd38-47de-8ed6-c82e32f595dd\"}]", 
"DateTime": "09-Jan-18 04:37:33 PM",
"Attributes":
"[\r\n{\r\n\t\"id\":\"patientid\",\r\n\t\"description\":\"PatientId\",\r\n\t\
"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"caseid\",\r\n\t\"
description\":\"caseID\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\
n\t\"id\":\"datetime\",\r\n\t\"description\":\"datetime\",\r\n\t\"type\":2,\r
\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"timeofday\",\r\n\t\"description\"
:\"timeofday\",\r\n\t\"type\":2,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\
"typeofday\",\r\n\t\"description\":\"typeofday\",\r\n\t\"type\":0,\r\n\t\"
weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"premealbloodglucose\",\r\n\t\"
description\":\"premealBloodGlucose\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\
r\n},\r\n{\r\n\t\"id\":\"userpastphysicalactivityintensity\",\r\n\t\"
description\":\"UserPastPhysicalActivityIntensity\",\r\n\t\"type\":0,\r\n\t\"
weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"userpastphysicalactivitytype\",\r\n\t\"
description\":\"UserPastPhysicalActivityType\",\r\n\t\"type\":0,\r\n\t\"
weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"pastphysicalactivityintensity\",\r\n\t\
"description\":\"userPhysicalActivityIntensity\",\r\n\t\"type\":0,\r\n\t\"
weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"pastphysicalactivitytype\",\r\n\t\"
description\":\"userPhysicalActivityType\",\r\n\t\"type\":0,\r\n\t\"weight\":
1.0\r\n},\r\n{\r\n\t\"id\":\"futurephysicalactivityintensity\",\r\n\t\"
description\":\"futurePhysicalActivityIntensity\",\r\n\t\"type\":0,\r\n\t\"
weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"futurephysicalactivitytype\",\r\n\t\"
description\":\"futurePhysicalActivityType\",\r\n\t\"type\":0,\r\n\t\"weight\
":1.0\r\n},\r\n{\r\n\t\"id\":\"basaldose\",\r\n\t\"description\":\"basalDose\
",\r\n\t\"type\":1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"
insulinonboard\",\r\n\t\"description\":\"insulinOnBoard\",\r\n\t\"type\":1,\r
\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"carbsonboard\",\r\n\t\"
description\":\"carbsOnBoard\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r
\n{\r\n\t\"id\":\"carbohydrates\",\r\n\t\"description\":\"carbohydrates\",\r\
n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"fats\",\r\n\t\"
description\":\"fats\",\r\n\t\"type\":0,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t
\"id\":\"mealabsorptionrate\",\r\n\t\"description\":\"mealAbsorptionRate\",\r
\n\t\"type\":0,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"alcoholtype\",\r
\n\t\"description\":\"alcoholType\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\
n},\r\n{\r\n\t\"id\":\"alcoholquantity\",\r\n\t\"description\":\"
alcoholQuantity\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id
\":\"hoursofsleep\",\r\n\t\"description\":\"hoursOfSleep\",\r\n\t\"type\":1,\
r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"psychologicalstress\",\r\n\t\"
description\":\"psychologicalStress\",\r\n\t\"type\":0,\r\n\t\"weight\":1.0\r
\n},\r\n{\r\n\t\"id\":\"happiness\",\r\n\t\"description\":\"happiness\",\r\n\
t\"type\":0,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"tiredness\",\r\n\t\
"description\":\"tiredness\",\r\n\t\"type\":0,\r\n\t\"weight\":1.0\r\n},\r\n{
\r\n\t\"id\":\"hormonecycle\",\r\n\t\"description\":\"hormoneCycle\",\r\n\t\"
type\":0,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"fever\",\r\n\t\"
description\":\"fever\",\r\n\t\"type\":0,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\
t\"id\":\"digestiveillness\",\r\n\t\"description\":\"digestiveIllness\",\r\n\
t\"type\":0,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"medication\",\r\n\t
\"description\":\"medication\",\r\n\t\"type\":2,\r\n\t\"weight\":1.0\r\n},\r\
n{\r\n\t\"id\":\"ambienttemperature\",\r\n\t\"description\":\"
ambientTemperature\",\r\n\t\"type\":1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"
id\":\"icrreuse\",\r\n\t\"description\":\"ICRreuse\",\r\n\t\"type\":-1,\r\n\t
\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"isfreuse\",\r\n\t\"description\":\"
ISFreuse\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"
bolusreuse\",\r\n\t\"description\":\"bolusReuse\",\r\n\t\"type\":-1,\r\n\t\"
weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"typeofbolus\",\r\n\t\"description\":\"
typeOfBolus\",\r\n\t\"type\":0,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"
icrsafety\",\r\n\t\"description\":\"ICRsafety\",\r\n\t\"type\":-1,\r\n\t\"
weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"isfsafety\",\r\n\t\"description\":\"
ISFsafety\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"
bolussafety\",\r\n\t\"description\":\"bolusSafety\",\r\n\t\"type\":-1,\r\n\t\
"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"bolususer\",\r\n\t\"description\":\"
bolusUser\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"
isfuser\",\r\n\t\"description\":\"ISFuser\",\r\n\t\"type\":-1,\r\n\t\"weight\
":1.0\r\n},\r\n{\r\n\t\"id\":\"icruser\",\r\n\t\"description\":\"ICRuser\",\r
\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"
postprandialminglucose\",\r\n\t\"description\":\"postprandialMinGlucose\",\r\
n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"bolusrevise\",\r
\n\t\"description\":\"BolusRevise\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\
n},\r\n{\r\n\t\"id\":\"icrrevise\",\r\n\t\"description\":\"ICRrevise\",\r\n\t
\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"isfrevise\",\r\n\t\
"description\":\"ISFrevise\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n
{\r\n\t\"id\":\"expertvalidation\",\r\n\t\"description\":\"ExpertValidation\"
,\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r\n\t\"id\":\"rejectcase\"
,\r\n\t\"description\":\"rejectCase\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\
r\n},\r\n{\r\n\t\"id\":\"pendingtobesendtoserver\",\r\n\t\"description\":\"
PendingToBeSendToServer\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n},\r\n{\r
\n\t\"id\":\"pendingtoberetained\",\r\n\t\"description\":\"
PendingToBeRetained\",\r\n\t\"type\":-1,\r\n\t\"weight\":1.0\r\n}\r\n]",
"State": 1
}

1.4 SafetySystemResponse Object

Description: The SafetySystemResponse Object stores all safety system data for analysis.
Created by: SafetySystem through PMA
Edited by: None
Stored: Pepper Database
Participants: PSA. PMA and Safety System
Notes:
  • The data is obtained via an action on the Safety System which will produce a Json Object consisting of all the data in the Safety System’s local database.
  • Sent once per day overnight
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
DateTime String dd-MMM-YY HH:mm:ss Z
SafetyJson String (Json Object)

1.5 BGValue Object

Description: The BGValue Object stores blood glucose data recorded by the PMA. The PSA will use this information widely for statistical calculations and numerous graphical representations of the CGM data.
Created by: PMA
Edited by: None
Stored: Pepper Database
Participants: PSA and PMA
Notes:
  • Sent from the PMA to the Pepper remote database whenever a BG value is received from the CGM.
  • If there is no internet connectivity or communication fails the object will be resent when internet connectivity is established.
  • The PSA will query the Pepper remote database for BGValue Objects as required.
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
TimeStamp String dd-MMM-YY HH:mm:ss Z
BGType Integer (Value 0 = CGM | 1 = Capillary Blood Glucose Meter | 2 = Laboratory Meter)
BG_MU Integer (Value 0 = mg/dL | 1 = mmol/L)
Value Double

Example BGValue Json


{ 
"Id": "7C05D3CE-B46F-4EB5-AF75-DC261BBB553B", 
"BGType": 0, 
"BG_MU": 1, 
"TimeStamp": "09-Jan-18 06:26:35 AM", 
"Value": 102.68306, 
"PatientID": "C0FA95EC-13D6-4CE7-8983-14221BFBE970" 
}

1.6 Meal Object

Description: The Meal Object stores carbohydrate information recorded by the Add Carbohydrates and Get Bolus Advice interfaces on the PMA. The PSA will display this information on the Patient Data and CBR Case Details interfaces.
Created by: PMA
Edited by: None
Stored: Pepper Database
Participants: PSA and PMA
Notes:
  • Sent from the PMA to the Pepper remote database whenever meal information is recorded by the Add Carbohydrates and Get Bolus Advice interfaces on the PMA.
  • If there is no internet connectivity or communication fails the object will be resent when internet connectivity is established.
  • The PSA will query the Pepper remote database for Meal Objects as required.
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
MealType Integer (0 = Snack | 1 = Breakfast | 2 = Lunch | 3 = Dinner
DateTime String dd-MMM-YY HH:mm:ss Z
CarbsMg Double
imei String

Example Meal Json


{ 
"Id": "C09C2AB0-5E6C-4E64-8903-27B1AB7D3626",
"PatientId": "C0FA95EC-13D6-4CE7-8983-14221BFBE970",
"MealType": 3, 
"DateTime": "09-Jan-18 05:07:53 PM",
"CarbsMg": 10,  
"imei": "353627079643469" 
}

1.7 PhysicalActivity Object

Description: The PhysicalActivity Object stores step count recorded by the PMA and the quantified physical activity. This will be displayed on the PSA Patient Data and CBR Case Detail GUIs.
Created by: PMA
Edited by: None
Stored: Pepper Database
Participants: PSA and PMA
Notes:
  • Sent from the PMA to the Pepper remote database periodically.
  • If there is no internet connectivity or communication fails the object will be resent when internet connectivity is established.
  • The PSA will query the Pepper remote database for PhysicalActivity Objects as required.
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
StartTime String dd-MMM-YY HH:mm:ss Z
EndTime String dd-MMM-YY HH:mm:ss Z
PhysicalActivityIntensity Integer (Value 0 = None | 1 = Low | 2 = Mild | 3 = Intense)
PhysicalActivityType Integer (Value 1 = Aerobic | 2 = NonAerobic)
StepsNumber Integer

Example PhysicalActivity Json


{ 
"Id": "BAFBBB35-82A1-4635-956C-00630168F586", 
"PatientID": "C0FA95EC-13D6-4CE7-8983-14221BFBE970", 
"PhysicalActivityIntensity": 1, 
"PhysicalActivityType": 2, 
"StartTime": "10-Jan-18 08:43:30 PM", 
"EndTime": "10-Jan-18 09:43:30 PM", 
"StepsNumber": 4265 
}

1.8 Alcohol Object

Description: The Alcohol Object stores alcohol intake information recorded by the PMA. This will be displayed on the PSA Hypo and Hyper event GUIs.
Created by: PMA
Edited by: None
Stored: Pepper Database
Participants: PSA and PMA
Notes:
  • Sent from the PMA to the Pepper remote database whenever meal information is input into the PMA.
  • If there is no internet connectivity or communication fails the object will be resent when internet connectivity is established.
  • The PSA will query the Pepper remote database for Alcohol Objects as required.
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
Time String dd-MMM-YY HH:mm:ss Z
AlcoholQuantity Integer (Values 0 = None | 1 = Mild | 2 = High)
AlcoholType Integer (Value 0 = Soft | 1 = High)

Example Alcohol Json


{ 
"Id": "41DD6460-BAE6-471E-B9FA-029D4FDD3BEB", 
"PatientID": "C0FA95EC-13D6-4CE7-8983-14221BFBE970", 
"Time": "10-Jan-18 10:02:32 AM", 
"AlcoholQuantity": 0, 
"AlcoholType": 0 
}

1.9 Alarm Object

Description: The Alarm Object stores alarm information triggered by the Safety System. This will be used to send SMS alerts to the Patient’s Carer as per the details registered in the Patient Object.
Created by: PMA after alarm returned by the Safety System
Edited by: None
Stored: Pepper Database
Participants: PSA, Pepper web service, PMA and Safety System
Notes:
  • Sent from the PMA to the Pepper remote database periodically
  • Upon receiving an Alarm Object the Pepper web service will trigger an SMS to the Carer specified in the Patient Object.
  • The PSA will query the Pepper remote database for Alarm Objects as required.
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
PatientCode String
DateTime String dd-MMM-YY HH:mm:ss Z
AlarmNumber Integer (Values 0 = Hypo | 1= Hyper | 2 = Fault)
AlarmType String (Values = HYPO_ALARM | HYPER_ALARM | FAULT)
AlarmMessage String
AlarmResolution String
TelephoneNumber String

Example Alarm Json


{ 
"Id": "DD99BC36-E99F-48E6-A989-1F2ECE27F9FD", 
"DateTime": "08-Nov-17 03:40:42 PM", 
"AlarmType": "HYPO_ALARM", 
"AlarmNumber": 1, 
"PatientId": "C0FA95EC-13D6-4CE7-8983-14221BFBE970", 
"PatientCode": "P_020",  
"AlarmMessage": "Hypo Alarm", 
"AlarmResolution": "alarm resolution", 
"TelephoneNumber": "07590719843" 
}

1.10 BasalProfile Object

Description: The BasalProfile Object stored basal information recorded by the PMA. This information will be referenced by clinicians and displayed on the PSA via the Patient Data and CBR Case Details GUIs.
Created by: PMA
Edited by: None
Stored: Pepper Database
Participants: PSA and PMA.
Notes:
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
Time String dd-MMM-YY HH:mm:ss Z
BaselRate Double

Example BasalProfile Json


{ 
"Id": "770C5C99-1606-4F44-8E5A-B7AC7B32B89E", 
"PatientId": "B45FDA38-5730-4015-8A15-C0766BB53186", 
"Time": "20-Oct-16 11:38:00 PM" ,
"Value": 102.68306
}

1.11 Medication Object

Description: The Medication Object stores medication details input during the PMA Get Bolus Advice process.
Created by: PMA
Edited by: None
Stored: Pepper Database
Participants: PSA and PMA.
Notes:
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
Date String dd-MMM-YY HH:mm:ss Z
MedicationCodeId String (UUID)

Example Medication Json


{ 
"Id": "770C5C99-1606-4F44-8E5A-B7AC7B32B89E", 
"MedicationCodeId": "CEFD9EFF-011D-4F3E-8F57-30FFDC28F298", 
"PatientId": "B45FDA38-5730-4015-8A15-C0766BB53186", 
"Date": "20-Oct-16 11:38:00 PM" 
}

1.12 InsulinInjection Object

Description: The InsulinInjection Object stores bolus injections recorded by the Add Bolus and Get Bolus Advice interfaces. The PSA will display this information on the Patient Data and CBR Case Details interfaces.
Created by: PMA
Edited by: None
Stored: Pepper Database
Participants: PSA and PMA.
Notes:
  • Sent from the PMA to the Pepper remote database whenever bolus information is recorded by the Add Bolus and Get Bolus Advice interfaces into the PMA.
  • If there is no internet connectivity or communication fails the object will be resent when internet connectivity is established.
  • The PSA will query the Pepper remote database for InsulinInjection Objects as required.
Details:
Attribute Json Type
Id String
PatientId String (UUID)
TimeStamp String dd-MMM-YY HH:mm:ss Z
imei String
Units Double (The insulin value)
InsulinType Integer (Value 1 = Basal | 2 = Bolus)

Example InsulinInjection Json


{ 
"Id": 126, 
"InsulinType": 2, 
"Units": ".00", 
"PatientID": "C0FA95EC-13D6-4CE7-8983-14221BFBE970", 
"TimeStamp": "04-Nov-17 10:36:41 PM", 
"imei": "353627079643469" 
}

1.13 Notes Object

Description: The Notes Object stores short text notes recorded on the PMA by the patient for viewing on the PSA.
Created by: PMA
Edited by: None
Stored: Pepper Database
Participants: PSA and PMA.
Notes:
Details:
Attribute Json Type
Id String (UUID)
PatientId String (UUID)
PatientCode String
TimeStamp String dd-MMM-YY HH:mm:ss Z
Text String

Example Notes Json


{ 
"Id": "C2651022-EC40-4739-B29B-7F7A41AD53FF", 
"PatientID": "5CA3B8EF-18D4-E611-B05D-00155DF29222", 
"PatientCode": null, 
"Text": "text note", 
"TimeStamp": "01-Jan-70 01:00:00 AM"
}

2. Pepper Processes

2.1 PMA Initialisation Process

Preconditions

  1. The patient has been registered on the PSA and stored in the Pepper remove database with the correct imei / serial number details.
  2. The PMA has internet availability
  3. The Patient Object is a well formed Json

Postcondition

  1. The PMA and Safety System are initialised

Process

  1. The PMA queries the Pepper remote database for the relevant patient object based on the PMA imei / serial number
  2. The PMA retains relevant Patient Object data
  3. The PMA passes the Patient Object to the Safety System for initialization
  4. The PMA retrieves CaseBase Objects with State 2 from the Pepper remove database in advance of possible ‘Get Bolus Advice’ process’

2.2 Overview of Primary Case-base Processes and Interactions

The first two steps of the case-based reasoning (CBR) cycle (retrieve and reuse) are executed on the PMA, and the second two (revise and retain) on the PSA. The cases themselves are created by the Get Bolus Advice Process (See Section 2.2.1). The subsequent case validation workflow is described in Sections 2.2.2 and 2.2.3.

2.2.1 Get Bolus Advice Process

Preconditions

  1. The PMA has been initialised

Postconditions

  1. The Get Bolus Advice process will return:
    1. The constrained CBR recommendation bolus if the CBR and Safety System are both enabled
    2. The CBR recommendation bolus if the CBR is enabled and Safety System disabled
    3. Other the standard bolus calculator recommendation
  2. The resulting CaseBase Object will appear in the Pepper remote database with a State of 0

Process

  1. User inputs data using the GUI
  2. PMA requests automated data (e.g. blood glucose, time, insulin on board, carbs on board)
  3. PMA creates a new Pepper Case using the data acquired
  4. PMA requests CaseBase Objects with State 2 from the Pepper remote database
  5. PMA creates CBR object using the CaseBase Objects acquired from the Pepper remote database and the new Pepper Case
  6. PMA invokes retrieve action on the CBR object
  7. PMA invokes reuse action on the CBR object, passing in weight and glucose set point data from the Patient Object
  8. PMA passes the Pepper Case to the Safety System’s insulin constraint action
  9. Safety System populates the Pepper Case object with the required data (attribute : BolusSafety) and also returns this value. The internal process will produce different results:
    1. The constrained CBR recommendation bolus if the CBR and Safety System are both enabled
    2. The CBR recommendation bolus if the CBR is enabled and Safety System disabled
    3. Other the standard bolus calculator recommendation
  10. The user accepts or rejects the Get Bolus Advice
    1. If accepted, the BolusSafety is used as BolusUser in the Pepper Case
    2. If rejected, the user inputs the desired bolus, and BolusUser is populated with this value
  11. The Pepper Case is passed to the Safety System to update the models with meal and bolus information
  12. The PMA enters its postprandial phase
  13. The PMA sends the CaseBase Object to the Pepper remote database with State 0 after the postprandial phase or when another ‘Get Bolus Advice’ process is completed.

2.2.2 Case-base-validation workflow

The case-base validation is a complex process which starts on PMA, goes through the PEPPER database, is completed on PSA and then goes back to PMA (see Figure 2).

Image sysArch
Figure 2: CBR workflow
  1. Each new CaseBase object generated by the PMA as described in Section 2.2 is saved to the PEPPER database (PSA) in State 0.
  2. The PSA checks the case for eligibility (e.g. the case contains CGM values and other signals used for validation)
  3. The eligible cases are revised by the CBR algorithm on the PSA (see Section 2.2.3) and converted to an automatically revised state. The cases with errors are rejected by this algorithm and the state is set to show that they were automatically rejected on revise.
  4. The remaining cases are manually validated/invalidated by the clinician. For each patient in the database, the clinician views the list of pending cases, and then has the option to drill down into the data before deciding whether to approve or reject the case. This process has two steps:
    1. Temporary validation: The clinician can commit or undo the temporary cases.
    2. Commit: the clinician clicks a button and all temporary validated/rejected cases change state to indicate that they have been either manually validated or rejected.
  5. The CBR algorithm takes the cases which were validated by clinician and runs the Review step.
  6. All cases which passed the Review step change to a state to reflect this.
  7. The PMA periodically checks for cases which are in this state and replaces the old population with the new one for a given patient.

2.2.3 Revise and Retain Steps

The revise and retain steps of the CBR algorithm are executed on the PSA server. The steps are as follows:

  1. Verify if the cases are eligible for automatic validation (for example, if CGM data is missing for longer than 45 minutes, that case is rejected).
  2. Start automatic validation of each case:
    1. Determine the patient identified in the case.
    2. Query the database to select the CBR population and attributes objects given by the CBR algorithm during the last validation for that patient. If no other cases were found for that patient, then the population and attributes objects are read from default files.
    3. Call the CBR algorithm in order to validate the case.
    4. Save the CBR results into the database.

This process is running underground periodically and can also be initiated manually by pressing a button.

2.3 Overview of Primary Safety System Initialisation and Interaction

2.3.1 Initialisation

A flowchart of the Safety System flow is shown below in figure 3.

Image sysArch
Figure 3: Safety System workflow

The Safety System requires the Patient Object for initialisation as described in Section 2.1 for a fresh install of the PMA. This initialisation process is the most optimal and should be conducted with each fresh launch of the PMA.

If no internet connectivity is available and the PMA has been initialised successfully before, the Safety System will revert to a local copy of the last Patient Object used. As a result the PMA and Safety System will still function even if internet connectivity is not available as long as it has been initialised once before.

The Safety System uses the following attributes from the Patient Object:

Attribute Json Type
Id String (UUID)
GlucoseSetPoint Double
Weight Double
InsulinSensitivity Double
InsulinAbsorptionTime Integer
CarbohydrateAbsorptionTime Integer
FastingBloodGlucose Integer
IcrSafety Comma separated list of Doubles
TimeIcrSafety Comma separated list of Integers
IsfSafety Comma separated list of Doubles
SafetySystemActive Integer (1= Safety System On | 0 = Safety System Off)

All the attributes and values in the table above must be present and correct with the expected data types otherwise a JSONException will occur. Furthermore, the IcrSafety, TimeIcrSafety, IsfSafety and TimeIsfSafety must comply with the following rules otherwise an IllegalArguementException will be thrown and the Safety System will not be initialised:

Safety System Active

If the value of SafetySystemActive is 0 in the initialisation process, the following features will be disabled:

2.3.2 Main Safety System Update Loop

The Safety System is updated whenever the PMA receives a blood glucose reading from the CGM. This will trigger and update in the Safety System’s internal modules.

The PMA will query the Safety System for the following information after each update:

2.3.3 Pump Suspension (CSII Only)

The Safety System will use the forecasted blood glucose level based on CGM updates to decide whether the pump requires total, partial or no suspension.

Partial suspension will occur when the Safety System predicts the blood glucose level will drop below 4.5 mmol/L. This will last for at most 90 minutes or until a blood glucose forecast predicts that the pump suspension state should be changed. Re-resuspension will not occur for 30 minutes.

Total suspension will occur when the Safety System predicts the blood glucose level will drop below 3.9 mmol/L. This will last for at most 90 minutes or until a blood glucose forecast predicts that the pump suspension state should be changed. Re-resuspension will not occur for 30 minutes.

The PMA provides the ability to tell the Safety System to stop the suspension as required. Note that the time limits for automatically cancelling suspension are dependent upon regular updates of the Safety System through the main Safety System Update Loop (Section 2.3.2). The Safety System does not internally update itself, it requires interactions from the PMA.

2.3.4 Bolus Constraint

The PMA will use the Bolus Constraint feature of the Safety System whenever the Get Bolus Advice feature is used. Please refer to Section 2.2 for details.

2.3.5 Safety System Data Export

The PMA will query the Safety System for its data every night and send it as a SafetySystemResponse to the Pepper remote database as detailed in Section 1.4.