Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
6
Добавлен:
04.09.2023
Размер:
938.97 Кб
Скачать

ВЫВОД

Средствами Xcode 14.2 был разработан модуль помощи принятия диетических решений для приложения iOS приложения ДиаКомпаньон. В

работе рассмотрено информационное, методическое, программно-

алгоритмическое и метрологическое обеспечение программы. Модуль реализует личный кабинет врача, карточку пациента, в которой содержится вся необходимая информация по приему пищи: КБЖУ, гликемическая нагрузка (ГН), усредненный гликемический индекс (ГИ), прогнозируемый уровень сахара в крови (УСК), автоматически сгенерированные рекомендации. Физическая активность и сон также оказывают существенное влияние на постпрандиальный гликемический ответ (ППГО), поэтому врачу предоставляется история предшествовавших приему пищи периодов активности пациента. При необходимости специалист может назначить или скорректировать вводимую дозу инсулина. Двусторонний канал связи между пациентом и врачом реализован посредством системы личных сообщений в приложении.

21

СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ

1.Диабет. - URL: https://www.who.int/ru/news-room/fact- sheets/detail/diabetes (дата обращения: 18.12.2021).

2.Reece E.A. The fetal and maternal consequences of gestational diabetes mellitus//Journal of Maternal-Fetal and Neonatal Medicine, 2010, Vol. 23, No. 3, P. 199-203.

3.Eidem I., Vangen S., Hanssen K.F., Vollset S.E., Henriksen T., Joner G., Stene L.C. Perinatal and infant mortality in term and preterm births among women

with type 1 diabetes//Diabetologia, 2011, Vol. 54, No. 11, P. 2771-2778.

4. Sunjaya A.P., Sunjaya A.F. Diabetes in pregnancy and infant mortality: Link with glycemic control//Diabetes and Metabolic Syndrome: Clinical Research and Reviews, 2018, Vol. 12, No. 6, P. 1031-1037.

5. O’Sullivan J.B. Diabetes Mellitus After GDM//Diabetes, 1991, Vol. 40,

No. Supplement 2, P. 131-135.

6.Ginsberg B.H. The role of technology in diabetes therapy.//Diabetes Care, 1994, Vol. 17 Suppl 1, No. SUPPL. 1, P. 50-55.

7.Садыкова Е.В. Методология синтеза биотехнической системы дифференциальной диагностики и лечения хронических заболеваний. М.: Изд-

во СПбГЭТУ "ЛЭТИ", 2020. 239 с.

8. Классификация, регрессия и другие алгоритмы Data Mining. - URL: https://ranalytics.github.io/data-mining/044-Ensembles.html (дата обращения:

13.05.2021).

9. Tkachuk A.S., Vasukova E.A., Anopova A.D., Kokina M.A., Gorelova I. V, Pervunina T.M., Grineva E.N., Pustozerov E.A., Popova P. V Machine Learning Approach for Postprandial Blood Glucose Prediction in Gestational Diabetes Mellitus//IEEE, 2020, Vol. 8, P. 219308-219321.

22

ПРИЛОЖЕНИЕ А ПРОГРАММНЫЙ КОД СИСТЕМЫ ПРИНЯТИЯ РЕШЕНИЯ

func getMessage(highGI: Bool, manyCarbo: Bool, highBGBefore: Bool, lowPV: Bool, bg_pred: Double, isTrue: inout Bool) -> String {

var txt = ""

if (highGI && bg_pred > 6.8) {

txt = "Рекомендуется исключить из рациона или уменьшить количество " +

"продуктов с высоким гликемическим индексом (более 55)"

} else if (manyCarbo && bg_pred > 6.8) {

txt = "Рекомендовано уменьшить количество углеводов в приеме

пищи"

} else if (highBGBefore && bg_pred > 6.8) {

txt = "Высокий уровень глюкозы до еды. " +

"Рекомендовано уменьшить количество углеводов во время перекусов."

} else if (lowPV && bg_pred > 6.8) {

txt = "В последнее время в Вашем рационе было недостаточно пищевых волокон. " +

"Добавьте в рацион разрешённые овощи, фрукты, злаковые, отруби

" +

"(см. обучающие материалы)."

} else if (bg_pred > 6.8) {

txt = "Вероятно, уровень глюкозы после еды будет высоким, " + "рекомендована прогулка после приема пищи."

}

if txt != "" { isTrue = true

}

23

return txt

}

func checkGI(listOfFood: [foodToSave]) -> Bool {

var highGI = false

do {

var sum = 0.0

var listOfGI: [Double] = []

let documents = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask,

true).first!

let path = documents + "/diacompanion.db"

let sourcePath = Bundle.main.path(forResource: "diacompanion", ofType: "db")!

_=copyDatabaseIfNeeded(sourcePath: sourcePath) let db = try Connection(path)

let food = Table("food")

let name = Expression<String>("name") let gi = Expression<Double?>("gi")

for i in listOfFood {

for i1 in try db.prepare(food.select(gi).filter(name == i.name).limit(1)){

listOfGI.append(i1[gi] ?? 0.0)

}

}

sum = listOfGI.reduce(0, +) if sum > 55 {

highGI = true

}

}

24

catch {

print(error)

}

return highGI

}

func checkCarbo(foodType: String, listOfFood: [foodToSave]) -> Bool {

var manyCarbo = false

do {

var sum = 0.0

var listOfCarbo: [Double] = []

let documents = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask,

true).first!

let path = documents + "/diacompanion.db"

let sourcePath = Bundle.main.path(forResource: "diacompanion", ofType: "db")!

_=copyDatabaseIfNeeded(sourcePath: sourcePath) let db = try Connection(path)

let food = Table("food")

let name = Expression<String>("name") let carbo = Expression<Double?>("carbo") for i in listOfFood {

for i1 in try db.prepare(food.select(carbo).filter(name == i.name).limit(1)){

listOfCarbo.append(i1[carbo] ?? 0.0)

}

}

sum = listOfCarbo.reduce(0, +)

if foodType == "Завтрак" && sum > 30 {

25

manyCarbo = true

}else if foodType != "" && sum > 60 { manyCarbo = true

}

}

catch {

print(error)

}

return manyCarbo

}

func checkBGBefore(BG0: Double) -> Bool { if BG0 > 6.7 {

return true

}else { return false

}

}

func checkPV(listOfFood: [foodToSave], date: Date) -> Bool { var lowPV = false

do {

var sum = 0.0

var sumToday = 0.0 var sumYest = 0.0

var listOfPV: [Double] = []

let documents = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask,

true).first!

let path = documents + "/diacompanion.db"

26

let sourcePath = Bundle.main.path(forResource: "diacompanion", ofType: "db")!

_=copyDatabaseIfNeeded(sourcePath: sourcePath) let db = try Connection(path)

let food = Table("food")

let name = Expression<String>("name") let pv = Expression<Double?>("pv") for i in listOfFood {

for i1 in try db.prepare(food.select(pv).filter(name == i.name).limit(1)){

listOfPV.append(i1[pv] ?? 0.0)

}

}

sum = listOfPV.reduce(0,+) listOfPV.removeAll()

let diary = Table("diary")

let foodName = Expression<String>("foodName")

let dateTime = Expression<String>("dateTime")

let dateFormatter = DateFormatter()

dateFormatter.dateFormat = "dd.MM.yyyy"

for i in try db.prepare(diary.select(foodName).filter(dateTime ==

dateFormatter.string(from: date))){

for i1 in try db.prepare(food.select(pv).filter(name == i[foodName]).limit(1)){

listOfPV.append(i1[pv] ?? 0.0)

}

}

sumToday = listOfPV.reduce(0,+) listOfPV.removeAll()

let yest = date.addingTimeInterval(-60*60*24)

27

for i in try db.prepare(diary.select(foodName).filter(dateTime ==

dateFormatter.string(from: yest))){

for i1 in try db.prepare(food.select(pv).filter(name == i[foodName]).limit(1)){

listOfPV.append(i1[pv] ?? 0.0)

}

}

sumYest = listOfPV.reduce(0,+) listOfPV.removeAll()

if sum < 8 { lowPV = true

}else if sum + sumToday < 20 { lowPV = true

}else if sum + sumYest < 28 {

lowPV = true

}

}

catch {

print(error)

}

return lowPV

}

28

Соседние файлы в папке МДП (Садыкова ФИБС БТС 11 семестр)