@hedia/recommendation-screen 2.1.75 → 2.2.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/dist/index.d.ts +5 -0
  2. package/dist/index.js +5 -0
  3. package/{lib/typescript → dist/src}/RecommendationScreen.d.ts +68 -82
  4. package/dist/src/RecommendationScreen.js +522 -0
  5. package/dist/src/assets/assets/activity/Cyclist.png +0 -0
  6. package/dist/src/assets/assets/activity/Other.png +0 -0
  7. package/dist/src/assets/assets/activity/Runner.png +0 -0
  8. package/dist/src/assets/assets/activity/Swimmer.png +0 -0
  9. package/dist/src/assets/assets/activity/Walk.png +0 -0
  10. package/dist/src/assets/assets/fonts/Poppins-Bold.ttf +0 -0
  11. package/dist/src/assets/assets/fonts/Poppins-SemiBold.ttf +0 -0
  12. package/dist/src/assets/assets/icons/Edit.tsx +22 -0
  13. package/dist/src/assets/assets/icons/X.tsx +14 -0
  14. package/dist/src/assets/assets/mood/happy.png +0 -0
  15. package/dist/src/assets/assets/mood/happy_active.png +0 -0
  16. package/dist/src/assets/assets/mood/neutral.png +0 -0
  17. package/dist/src/assets/assets/mood/neutral_active.png +0 -0
  18. package/dist/src/assets/assets/mood/sad.png +0 -0
  19. package/dist/src/assets/assets/mood/sad_active.png +0 -0
  20. package/dist/src/assets/assets/mood/semi_happy.png +0 -0
  21. package/dist/src/assets/assets/mood/semi_happy_active.png +0 -0
  22. package/dist/src/assets/assets/mood/semi_sad.png +0 -0
  23. package/dist/src/assets/assets/mood/semi_sad_active.png +0 -0
  24. package/dist/src/assets/icons/Edit.d.ts +4 -0
  25. package/dist/src/assets/icons/Edit.js +7 -0
  26. package/dist/src/assets/icons/X.d.ts +4 -0
  27. package/dist/src/assets/icons/X.js +6 -0
  28. package/dist/src/components/ForecastInfoBar.d.ts +109 -0
  29. package/dist/src/components/ForecastInfoBar.js +138 -0
  30. package/dist/src/components/Header.d.ts +8 -0
  31. package/dist/src/components/Header.js +54 -0
  32. package/dist/src/components/Icon.d.ts +20 -0
  33. package/dist/src/components/Icon.js +43 -0
  34. package/{lib/typescript → dist/src}/components/InfoBars.d.ts +28 -14
  35. package/dist/src/components/InfoBars.js +128 -0
  36. package/{lib/typescript → dist/src}/components/InvisibleNumberInput.d.ts +3 -9
  37. package/dist/src/components/InvisibleNumberInput.js +121 -0
  38. package/dist/src/components/LimitationMessage.d.ts +14 -0
  39. package/dist/src/components/LimitationMessage.js +30 -0
  40. package/{lib/typescript → dist/src}/components/LineSeparator.d.ts +1 -6
  41. package/dist/src/components/LineSeparator.js +18 -0
  42. package/{lib/typescript → dist/src}/components/RecentInsulin.d.ts +1 -3
  43. package/dist/src/components/RecentInsulin.js +73 -0
  44. package/{lib/typescript → dist/src}/components/RecommendationModal.d.ts +63 -63
  45. package/dist/src/components/RecommendationModal.js +226 -0
  46. package/{lib/typescript → dist/src}/components/RecommendedCarbs.d.ts +0 -3
  47. package/dist/src/components/RecommendedCarbs.js +251 -0
  48. package/{lib/typescript → dist/src}/components/RecommendedInsulin.d.ts +1 -2
  49. package/dist/src/components/RecommendedInsulin.js +180 -0
  50. package/{lib/typescript → dist/src}/components/Remeasure.d.ts +15 -6
  51. package/dist/src/components/Remeasure.js +130 -0
  52. package/{lib/typescript/components/TransferToLogbook.d.ts → dist/src/components/SaveButton.d.ts} +2 -3
  53. package/dist/src/components/SaveButton.js +71 -0
  54. package/dist/src/components/TwoOptionModal.d.ts +136 -0
  55. package/dist/src/components/TwoOptionModal.js +141 -0
  56. package/{lib/typescript → dist/src}/components/activity/Activity.d.ts +2 -3
  57. package/dist/src/components/activity/Activity.js +84 -0
  58. package/{lib/typescript → dist/src}/components/activity/ActivityIcon.d.ts +7 -8
  59. package/dist/src/components/activity/ActivityIcon.js +58 -0
  60. package/{lib/typescript → dist/src}/components/activity/ActivityIntensity.d.ts +1 -2
  61. package/dist/src/components/activity/ActivityIntensity.js +58 -0
  62. package/{lib/typescript → dist/src}/components/mood/Emotion.d.ts +1 -2
  63. package/dist/src/components/mood/Emotion.js +64 -0
  64. package/{lib/typescript → dist/src}/components/mood/MoodIcon.d.ts +5 -5
  65. package/dist/src/components/mood/MoodIcon.js +63 -0
  66. package/dist/src/components/text/TextBold.d.ts +8 -0
  67. package/dist/src/components/text/TextBold.js +12 -0
  68. package/dist/src/components/text/TextRegular.d.ts +8 -0
  69. package/dist/src/components/text/TextRegular.js +12 -0
  70. package/dist/src/locale/da/messages.js +1 -0
  71. package/dist/src/locale/da/messages.po +349 -0
  72. package/dist/src/locale/de/messages.js +1 -0
  73. package/dist/src/locale/de/messages.po +349 -0
  74. package/dist/src/locale/en/messages.js +1 -0
  75. package/dist/src/locale/en/messages.po +349 -0
  76. package/dist/src/locale/es/messages.js +1 -0
  77. package/dist/src/locale/es/messages.po +349 -0
  78. package/dist/src/locale/fr/messages.js +1 -0
  79. package/dist/src/locale/fr/messages.po +349 -0
  80. package/dist/src/locale/i18nUtils.d.ts +18 -0
  81. package/dist/src/locale/i18nUtils.js +39 -0
  82. package/dist/src/locale/it/messages.js +1 -0
  83. package/dist/src/locale/it/messages.po +349 -0
  84. package/{lib/typescript → dist/src}/types/enum.d.ts +15 -22
  85. package/dist/src/types/enum.js +145 -0
  86. package/{lib/typescript → dist/src}/types/types.d.ts +0 -1
  87. package/dist/src/types/types.js +1 -0
  88. package/{lib/typescript → dist/src}/utils/AttentionMessages.d.ts +0 -1
  89. package/dist/src/utils/AttentionMessages.js +118 -0
  90. package/{lib/typescript → dist/src}/utils/Constants.d.ts +3 -18
  91. package/{lib/module → dist/src}/utils/Constants.js +21 -79
  92. package/{lib/typescript → dist/src}/utils/RecommendationError.d.ts +0 -1
  93. package/dist/src/utils/RecommendationError.js +63 -0
  94. package/{lib/typescript → dist/src}/utils/RecommendationUtils.d.ts +0 -1
  95. package/{lib/module → dist/src}/utils/RecommendationUtils.js +88 -90
  96. package/{lib/typescript → dist/src}/utils/Translations.d.ts +0 -1
  97. package/{lib/module → dist/src}/utils/Translations.js +5 -7
  98. package/{lib/typescript → dist/src}/utils/Utils.d.ts +1 -2
  99. package/dist/src/utils/Utils.js +141 -0
  100. package/{lib/typescript → dist/src}/utils/Validations.d.ts +1 -2
  101. package/{lib/module → dist/src}/utils/Validations.js +128 -156
  102. package/package.json +96 -109
  103. package/lib/commonjs/RecommendationScreen.js +0 -778
  104. package/lib/commonjs/RecommendationScreen.js.map +0 -1
  105. package/lib/commonjs/assets/IconsSVG/Close.js +0 -20
  106. package/lib/commonjs/assets/IconsSVG/Close.js.map +0 -1
  107. package/lib/commonjs/assets/IconsSVG/CloseOutlined.js +0 -28
  108. package/lib/commonjs/assets/IconsSVG/CloseOutlined.js.map +0 -1
  109. package/lib/commonjs/assets/IconsSVG/Edit.js +0 -23
  110. package/lib/commonjs/assets/IconsSVG/Edit.js.map +0 -1
  111. package/lib/commonjs/assets/IconsSVG/activity/Cycling.js +0 -43
  112. package/lib/commonjs/assets/IconsSVG/activity/Cycling.js.map +0 -1
  113. package/lib/commonjs/assets/IconsSVG/activity/Running.js +0 -33
  114. package/lib/commonjs/assets/IconsSVG/activity/Running.js.map +0 -1
  115. package/lib/commonjs/assets/IconsSVG/activity/Stretching.js +0 -33
  116. package/lib/commonjs/assets/IconsSVG/activity/Stretching.js.map +0 -1
  117. package/lib/commonjs/assets/IconsSVG/activity/Swimming.js +0 -48
  118. package/lib/commonjs/assets/IconsSVG/activity/Swimming.js.map +0 -1
  119. package/lib/commonjs/assets/IconsSVG/activity/Walking.js +0 -38
  120. package/lib/commonjs/assets/IconsSVG/activity/Walking.js.map +0 -1
  121. package/lib/commonjs/assets/IconsSVG/mood/Happy.js +0 -34
  122. package/lib/commonjs/assets/IconsSVG/mood/Happy.js.map +0 -1
  123. package/lib/commonjs/assets/IconsSVG/mood/Neutral.js +0 -34
  124. package/lib/commonjs/assets/IconsSVG/mood/Neutral.js.map +0 -1
  125. package/lib/commonjs/assets/IconsSVG/mood/Sad.js +0 -34
  126. package/lib/commonjs/assets/IconsSVG/mood/Sad.js.map +0 -1
  127. package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js +0 -34
  128. package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
  129. package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js +0 -34
  130. package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js.map +0 -1
  131. package/lib/commonjs/components/ExitModal.js +0 -124
  132. package/lib/commonjs/components/ExitModal.js.map +0 -1
  133. package/lib/commonjs/components/InfoBars.js +0 -123
  134. package/lib/commonjs/components/InfoBars.js.map +0 -1
  135. package/lib/commonjs/components/InvisibleNumberInput.js +0 -150
  136. package/lib/commonjs/components/InvisibleNumberInput.js.map +0 -1
  137. package/lib/commonjs/components/LineSeparator.js +0 -27
  138. package/lib/commonjs/components/LineSeparator.js.map +0 -1
  139. package/lib/commonjs/components/RecentInsulin.js +0 -105
  140. package/lib/commonjs/components/RecentInsulin.js.map +0 -1
  141. package/lib/commonjs/components/RecommendationModal.js +0 -302
  142. package/lib/commonjs/components/RecommendationModal.js.map +0 -1
  143. package/lib/commonjs/components/RecommendedCarbs.js +0 -289
  144. package/lib/commonjs/components/RecommendedCarbs.js.map +0 -1
  145. package/lib/commonjs/components/RecommendedInsulin.js +0 -209
  146. package/lib/commonjs/components/RecommendedInsulin.js.map +0 -1
  147. package/lib/commonjs/components/Remeasure.js +0 -131
  148. package/lib/commonjs/components/Remeasure.js.map +0 -1
  149. package/lib/commonjs/components/Text.js +0 -25
  150. package/lib/commonjs/components/Text.js.map +0 -1
  151. package/lib/commonjs/components/TimeoutModal.js +0 -113
  152. package/lib/commonjs/components/TimeoutModal.js.map +0 -1
  153. package/lib/commonjs/components/TransferToLogbook.js +0 -83
  154. package/lib/commonjs/components/TransferToLogbook.js.map +0 -1
  155. package/lib/commonjs/components/activity/Activity.js +0 -112
  156. package/lib/commonjs/components/activity/Activity.js.map +0 -1
  157. package/lib/commonjs/components/activity/ActivityIcon.js +0 -86
  158. package/lib/commonjs/components/activity/ActivityIcon.js.map +0 -1
  159. package/lib/commonjs/components/activity/ActivityIntensity.js +0 -65
  160. package/lib/commonjs/components/activity/ActivityIntensity.js.map +0 -1
  161. package/lib/commonjs/components/mood/Emotion.js +0 -86
  162. package/lib/commonjs/components/mood/Emotion.js.map +0 -1
  163. package/lib/commonjs/components/mood/MoodIcon.js +0 -107
  164. package/lib/commonjs/components/mood/MoodIcon.js.map +0 -1
  165. package/lib/commonjs/components/styles/fonts.js +0 -160
  166. package/lib/commonjs/components/styles/fonts.js.map +0 -1
  167. package/lib/commonjs/index.js +0 -21
  168. package/lib/commonjs/index.js.map +0 -1
  169. package/lib/commonjs/locales/da/translations.json +0 -82
  170. package/lib/commonjs/locales/de/translations.json +0 -81
  171. package/lib/commonjs/locales/en/translations.json +0 -84
  172. package/lib/commonjs/locales/es/translations.json +0 -81
  173. package/lib/commonjs/locales/fr/translations.json +0 -81
  174. package/lib/commonjs/locales/it/translations.json +0 -81
  175. package/lib/commonjs/locales/translate.js +0 -63
  176. package/lib/commonjs/locales/translate.js.map +0 -1
  177. package/lib/commonjs/types/enum.js +0 -179
  178. package/lib/commonjs/types/enum.js.map +0 -1
  179. package/lib/commonjs/types/types.js +0 -6
  180. package/lib/commonjs/types/types.js.map +0 -1
  181. package/lib/commonjs/utils/AttentionMessages.js +0 -141
  182. package/lib/commonjs/utils/AttentionMessages.js.map +0 -1
  183. package/lib/commonjs/utils/Constants.js +0 -138
  184. package/lib/commonjs/utils/Constants.js.map +0 -1
  185. package/lib/commonjs/utils/RecommendationError.js +0 -116
  186. package/lib/commonjs/utils/RecommendationError.js.map +0 -1
  187. package/lib/commonjs/utils/RecommendationUtils.js +0 -212
  188. package/lib/commonjs/utils/RecommendationUtils.js.map +0 -1
  189. package/lib/commonjs/utils/Translations.js +0 -22
  190. package/lib/commonjs/utils/Translations.js.map +0 -1
  191. package/lib/commonjs/utils/Utils.js +0 -162
  192. package/lib/commonjs/utils/Utils.js.map +0 -1
  193. package/lib/commonjs/utils/Validations.js +0 -468
  194. package/lib/commonjs/utils/Validations.js.map +0 -1
  195. package/lib/module/RecommendationScreen.js +0 -768
  196. package/lib/module/RecommendationScreen.js.map +0 -1
  197. package/lib/module/assets/IconsSVG/Close.js +0 -11
  198. package/lib/module/assets/IconsSVG/Close.js.map +0 -1
  199. package/lib/module/assets/IconsSVG/CloseOutlined.js +0 -19
  200. package/lib/module/assets/IconsSVG/CloseOutlined.js.map +0 -1
  201. package/lib/module/assets/IconsSVG/Edit.js +0 -14
  202. package/lib/module/assets/IconsSVG/Edit.js.map +0 -1
  203. package/lib/module/assets/IconsSVG/activity/Cycling.js +0 -34
  204. package/lib/module/assets/IconsSVG/activity/Cycling.js.map +0 -1
  205. package/lib/module/assets/IconsSVG/activity/Running.js +0 -24
  206. package/lib/module/assets/IconsSVG/activity/Running.js.map +0 -1
  207. package/lib/module/assets/IconsSVG/activity/Stretching.js +0 -24
  208. package/lib/module/assets/IconsSVG/activity/Stretching.js.map +0 -1
  209. package/lib/module/assets/IconsSVG/activity/Swimming.js +0 -39
  210. package/lib/module/assets/IconsSVG/activity/Swimming.js.map +0 -1
  211. package/lib/module/assets/IconsSVG/activity/Walking.js +0 -29
  212. package/lib/module/assets/IconsSVG/activity/Walking.js.map +0 -1
  213. package/lib/module/assets/IconsSVG/mood/Happy.js +0 -25
  214. package/lib/module/assets/IconsSVG/mood/Happy.js.map +0 -1
  215. package/lib/module/assets/IconsSVG/mood/Neutral.js +0 -25
  216. package/lib/module/assets/IconsSVG/mood/Neutral.js.map +0 -1
  217. package/lib/module/assets/IconsSVG/mood/Sad.js +0 -25
  218. package/lib/module/assets/IconsSVG/mood/Sad.js.map +0 -1
  219. package/lib/module/assets/IconsSVG/mood/SemiHappy.js +0 -25
  220. package/lib/module/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
  221. package/lib/module/assets/IconsSVG/mood/SemiSad.js +0 -25
  222. package/lib/module/assets/IconsSVG/mood/SemiSad.js.map +0 -1
  223. package/lib/module/components/ExitModal.js +0 -114
  224. package/lib/module/components/ExitModal.js.map +0 -1
  225. package/lib/module/components/InfoBars.js +0 -114
  226. package/lib/module/components/InfoBars.js.map +0 -1
  227. package/lib/module/components/InvisibleNumberInput.js +0 -142
  228. package/lib/module/components/InvisibleNumberInput.js.map +0 -1
  229. package/lib/module/components/LineSeparator.js +0 -19
  230. package/lib/module/components/LineSeparator.js.map +0 -1
  231. package/lib/module/components/RecentInsulin.js +0 -97
  232. package/lib/module/components/RecentInsulin.js.map +0 -1
  233. package/lib/module/components/RecommendationModal.js +0 -291
  234. package/lib/module/components/RecommendationModal.js.map +0 -1
  235. package/lib/module/components/RecommendedCarbs.js +0 -281
  236. package/lib/module/components/RecommendedCarbs.js.map +0 -1
  237. package/lib/module/components/RecommendedInsulin.js +0 -201
  238. package/lib/module/components/RecommendedInsulin.js.map +0 -1
  239. package/lib/module/components/Remeasure.js +0 -123
  240. package/lib/module/components/Remeasure.js.map +0 -1
  241. package/lib/module/components/Text.js +0 -16
  242. package/lib/module/components/Text.js.map +0 -1
  243. package/lib/module/components/TimeoutModal.js +0 -103
  244. package/lib/module/components/TimeoutModal.js.map +0 -1
  245. package/lib/module/components/TransferToLogbook.js +0 -75
  246. package/lib/module/components/TransferToLogbook.js.map +0 -1
  247. package/lib/module/components/activity/Activity.js +0 -104
  248. package/lib/module/components/activity/Activity.js.map +0 -1
  249. package/lib/module/components/activity/ActivityIcon.js +0 -78
  250. package/lib/module/components/activity/ActivityIcon.js.map +0 -1
  251. package/lib/module/components/activity/ActivityIntensity.js +0 -57
  252. package/lib/module/components/activity/ActivityIntensity.js.map +0 -1
  253. package/lib/module/components/mood/Emotion.js +0 -78
  254. package/lib/module/components/mood/Emotion.js.map +0 -1
  255. package/lib/module/components/mood/MoodIcon.js +0 -97
  256. package/lib/module/components/mood/MoodIcon.js.map +0 -1
  257. package/lib/module/components/styles/fonts.js +0 -152
  258. package/lib/module/components/styles/fonts.js.map +0 -1
  259. package/lib/module/index.js +0 -5
  260. package/lib/module/index.js.map +0 -1
  261. package/lib/module/locales/da/translations.json +0 -82
  262. package/lib/module/locales/de/translations.json +0 -81
  263. package/lib/module/locales/en/translations.json +0 -84
  264. package/lib/module/locales/es/translations.json +0 -81
  265. package/lib/module/locales/fr/translations.json +0 -81
  266. package/lib/module/locales/it/translations.json +0 -81
  267. package/lib/module/locales/translate.js +0 -55
  268. package/lib/module/locales/translate.js.map +0 -1
  269. package/lib/module/types/enum.js +0 -170
  270. package/lib/module/types/enum.js.map +0 -1
  271. package/lib/module/types/types.js +0 -2
  272. package/lib/module/types/types.js.map +0 -1
  273. package/lib/module/utils/AttentionMessages.js +0 -131
  274. package/lib/module/utils/AttentionMessages.js.map +0 -1
  275. package/lib/module/utils/Constants.js.map +0 -1
  276. package/lib/module/utils/RecommendationError.js +0 -87
  277. package/lib/module/utils/RecommendationError.js.map +0 -1
  278. package/lib/module/utils/RecommendationUtils.js.map +0 -1
  279. package/lib/module/utils/Translations.js.map +0 -1
  280. package/lib/module/utils/Utils.js +0 -155
  281. package/lib/module/utils/Utils.js.map +0 -1
  282. package/lib/module/utils/Validations.js.map +0 -1
  283. package/lib/typescript/RecommendationScreen.d.ts.map +0 -1
  284. package/lib/typescript/assets/IconsSVG/Close.d.ts +0 -5
  285. package/lib/typescript/assets/IconsSVG/Close.d.ts.map +0 -1
  286. package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts +0 -5
  287. package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts.map +0 -1
  288. package/lib/typescript/assets/IconsSVG/Edit.d.ts +0 -5
  289. package/lib/typescript/assets/IconsSVG/Edit.d.ts.map +0 -1
  290. package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts +0 -5
  291. package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts.map +0 -1
  292. package/lib/typescript/assets/IconsSVG/activity/Running.d.ts +0 -5
  293. package/lib/typescript/assets/IconsSVG/activity/Running.d.ts.map +0 -1
  294. package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts +0 -5
  295. package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts.map +0 -1
  296. package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts +0 -5
  297. package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts.map +0 -1
  298. package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts +0 -5
  299. package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts.map +0 -1
  300. package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts +0 -5
  301. package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts.map +0 -1
  302. package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts +0 -5
  303. package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts.map +0 -1
  304. package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts +0 -5
  305. package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts.map +0 -1
  306. package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts +0 -5
  307. package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts.map +0 -1
  308. package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts +0 -5
  309. package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts.map +0 -1
  310. package/lib/typescript/components/ExitModal.d.ts +0 -26
  311. package/lib/typescript/components/ExitModal.d.ts.map +0 -1
  312. package/lib/typescript/components/InfoBars.d.ts.map +0 -1
  313. package/lib/typescript/components/InvisibleNumberInput.d.ts.map +0 -1
  314. package/lib/typescript/components/LineSeparator.d.ts.map +0 -1
  315. package/lib/typescript/components/RecentInsulin.d.ts.map +0 -1
  316. package/lib/typescript/components/RecommendationModal.d.ts.map +0 -1
  317. package/lib/typescript/components/RecommendedCarbs.d.ts.map +0 -1
  318. package/lib/typescript/components/RecommendedInsulin.d.ts.map +0 -1
  319. package/lib/typescript/components/Remeasure.d.ts.map +0 -1
  320. package/lib/typescript/components/Text.d.ts +0 -14
  321. package/lib/typescript/components/Text.d.ts.map +0 -1
  322. package/lib/typescript/components/TimeoutModal.d.ts +0 -25
  323. package/lib/typescript/components/TimeoutModal.d.ts.map +0 -1
  324. package/lib/typescript/components/TransferToLogbook.d.ts.map +0 -1
  325. package/lib/typescript/components/activity/Activity.d.ts.map +0 -1
  326. package/lib/typescript/components/activity/ActivityIcon.d.ts.map +0 -1
  327. package/lib/typescript/components/activity/ActivityIntensity.d.ts.map +0 -1
  328. package/lib/typescript/components/mood/Emotion.d.ts.map +0 -1
  329. package/lib/typescript/components/mood/MoodIcon.d.ts.map +0 -1
  330. package/lib/typescript/components/styles/fonts.d.ts +0 -151
  331. package/lib/typescript/components/styles/fonts.d.ts.map +0 -1
  332. package/lib/typescript/index.d.ts +0 -5
  333. package/lib/typescript/index.d.ts.map +0 -1
  334. package/lib/typescript/locales/translate.d.ts +0 -20
  335. package/lib/typescript/locales/translate.d.ts.map +0 -1
  336. package/lib/typescript/types/enum.d.ts.map +0 -1
  337. package/lib/typescript/types/types.d.ts.map +0 -1
  338. package/lib/typescript/utils/AttentionMessages.d.ts.map +0 -1
  339. package/lib/typescript/utils/Constants.d.ts.map +0 -1
  340. package/lib/typescript/utils/RecommendationError.d.ts.map +0 -1
  341. package/lib/typescript/utils/RecommendationUtils.d.ts.map +0 -1
  342. package/lib/typescript/utils/Translations.d.ts.map +0 -1
  343. package/lib/typescript/utils/Utils.d.ts.map +0 -1
  344. package/lib/typescript/utils/Validations.d.ts.map +0 -1
  345. package/src/RecommendationScreen.tsx +0 -854
  346. package/src/assets/IconsSVG/Close.tsx +0 -13
  347. package/src/assets/IconsSVG/CloseOutlined.tsx +0 -23
  348. package/src/assets/IconsSVG/Edit.tsx +0 -16
  349. package/src/assets/IconsSVG/activity/Cycling.tsx +0 -41
  350. package/src/assets/IconsSVG/activity/Running.tsx +0 -29
  351. package/src/assets/IconsSVG/activity/Stretching.tsx +0 -29
  352. package/src/assets/IconsSVG/activity/Swimming.tsx +0 -47
  353. package/src/assets/IconsSVG/activity/Walking.tsx +0 -35
  354. package/src/assets/IconsSVG/mood/Happy.tsx +0 -30
  355. package/src/assets/IconsSVG/mood/Neutral.tsx +0 -30
  356. package/src/assets/IconsSVG/mood/Sad.tsx +0 -30
  357. package/src/assets/IconsSVG/mood/SemiHappy.tsx +0 -30
  358. package/src/assets/IconsSVG/mood/SemiSad.tsx +0 -30
  359. package/src/components/ExitModal.tsx +0 -134
  360. package/src/components/InfoBars.tsx +0 -122
  361. package/src/components/InvisibleNumberInput.tsx +0 -170
  362. package/src/components/LineSeparator.tsx +0 -29
  363. package/src/components/RecentInsulin.tsx +0 -109
  364. package/src/components/RecommendationModal.tsx +0 -319
  365. package/src/components/RecommendedCarbs.tsx +0 -303
  366. package/src/components/RecommendedInsulin.tsx +0 -220
  367. package/src/components/Remeasure.tsx +0 -135
  368. package/src/components/Text.tsx +0 -27
  369. package/src/components/TimeoutModal.tsx +0 -121
  370. package/src/components/TransferToLogbook.tsx +0 -92
  371. package/src/components/activity/Activity.tsx +0 -107
  372. package/src/components/activity/ActivityIcon.tsx +0 -77
  373. package/src/components/activity/ActivityIntensity.tsx +0 -67
  374. package/src/components/mood/Emotion.tsx +0 -97
  375. package/src/components/mood/MoodIcon.tsx +0 -91
  376. package/src/components/styles/fonts.ts +0 -151
  377. package/src/index.ts +0 -5
  378. package/src/locales/da/translations.json +0 -82
  379. package/src/locales/de/translations.json +0 -81
  380. package/src/locales/en/translations.json +0 -84
  381. package/src/locales/es/translations.json +0 -81
  382. package/src/locales/fr/translations.json +0 -81
  383. package/src/locales/it/translations.json +0 -81
  384. package/src/locales/translate.ts +0 -62
  385. package/src/types/enum.ts +0 -164
  386. package/src/types/types.ts +0 -19
  387. package/src/utils/AttentionMessages.ts +0 -167
  388. package/src/utils/Constants.ts +0 -77
  389. package/src/utils/RecommendationError.ts +0 -182
  390. package/src/utils/RecommendationUtils.ts +0 -232
  391. package/src/utils/Translations.ts +0 -17
  392. package/src/utils/Utils.ts +0 -156
  393. package/src/utils/Validations.ts +0 -490
@@ -1,141 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Messages = exports.AttentionMessage = void 0;
7
- exports.addPostponeActivityMessageUnder5MMOL = addPostponeActivityMessageUnder5MMOL;
8
- exports.getLimitedValue = getLimitedValue;
9
- var _moment = _interopRequireDefault(require("moment"));
10
- var _types = require("@hedia/types");
11
- var _translate = require("../locales/translate");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- /** Provides methods for getting variants of attention messages */
14
- const AttentionMessage = {
15
- /**
16
- * @return Concatenation of:
17
- * {@link Messages.VeryLowBGL} +
18
- * {@link Messages.Reminder15Minutes}
19
- */
20
- SevereHypoglycemia: () => `${Messages.VeryLowBGL()}${`\n`}${Messages.Reminder15Minutes()}`,
21
- /**
22
- * @return Concatenation of:
23
- * {@link Messages.LowBGL} +
24
- * {@link Messages.Reminder15Minutes}
25
- */
26
- Hypoglycemia: () => `${Messages.LowBGL()}${`\n`}${Messages.Reminder15Minutes()}`,
27
- /** @return The value of: {@link Messages.Reminder15Minutes} */
28
- MildHypoglycemia: () => Messages.Reminder15Minutes(),
29
- /** @return The value of: {@link Messages.PostponePhysicalActivityUnder5MMOL} */
30
- NormoglycemiaActivityUnder5MMOL: () => Messages.PostponePhysicalActivityUnder5MMOL(),
31
- /**
32
- * @return Concatenation of:
33
- * {@link Messages.HighBGL} +
34
- * {@link Messages.InsulinKetones} +
35
- * {@link Messages.Reminder15Minutes} +
36
- * {@link Messages.PostponePhysicalActivity}
37
- */
38
- HyperglycemiaActivity: () => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}${Messages.Reminder15Minutes()}${`\n`}${Messages.PostponePhysicalActivity()}`,
39
- /**
40
- * @return Concatenation of:
41
- * {@link Messages.HighBGL} +
42
- * {@link Messages.InsulinKetones}
43
- */
44
- SevereHyperglycemia: () => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}`,
45
- /**
46
- * @return Concatenation of:
47
- * {@link Messages.HighBGL} +
48
- * {@link Messages.InsulinKetones} +
49
- * {@link Messages.Reminder15Minutes} +
50
- * {@link Messages.PostponePhysicalActivity}
51
- */
52
- SevereHyperglycemiaActivity: () => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}${Messages.Reminder15Minutes()}${`\n`}${Messages.PostponePhysicalActivity()}`,
53
- /** no message provided for this level */
54
- BGLevelNotProvided: null,
55
- /** no message provided for this level*/
56
- Hyperglycemia: null,
57
- /** no message provided for this level */
58
- MildHyperglycemia: null,
59
- /** no message provided for this level */
60
- Normoglycemia: null,
61
- /** no message provided for this level */
62
- NormoglycemiaUnder5MMOL: null,
63
- /** no message provided for this level */
64
- UnsupportedBGLevel: null
65
- };
66
-
67
- /**
68
- * @param message The message to append the {@link Messages.PostponePhysicalActivityUnder5MMOL} to
69
- * @returns The initial messaged concatenated with the {@link Messages.PostponePhysicalActivityUnder5MMOL}
70
- */
71
- exports.AttentionMessage = AttentionMessage;
72
- function addPostponeActivityMessageUnder5MMOL(message) {
73
- return `${message}${`\n`}${Messages.PostponePhysicalActivityUnder5MMOL()}`;
74
- }
75
- const SAFETY_INSULIN_LIMIT = _types.BolusCalculator.Constants.SAFETY_INSULIN_LIMIT;
76
-
77
- /**
78
- * Calculate the limited insulin value based on the physical activity reduction value
79
- * @param reduction The reduction percentage an activity reduce the total insulin intake
80
- * @returns The limited insulin value.
81
- */
82
- function getLimitedValue(reduction) {
83
- return SAFETY_INSULIN_LIMIT - SAFETY_INSULIN_LIMIT * reduction;
84
- }
85
-
86
- /** Provides methods for getting strings for composing attention messages and other important communications to the user. */
87
- class Messages {
88
- /** Inform the user that their BGL is very low and what they should do about it. */
89
- static VeryLowBGL = () => (0, _translate.t)(`Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.`);
90
- /** Inform the user that their BGL is very low. */
91
- static LowBGL = () => (0, _translate.t)(`Your blood glucose level is very low.`);
92
- /** Inform the user that they will be reminded to remeasure their BGL soon. */
93
- static Reminder15Minutes = () => (0, _translate.t)(`You will be reminded to measure your blood glucose level in 15 min.`);
94
- /** Encourages the user to postpone exercise. Specifically when their BGL is high. */
95
- static PostponePhysicalActivity = () => (0, _translate.t)(`If it is possible, postpone your planned exercise.`);
96
- /** Encourages the user to postpone exercise. Specifically when their BGL is low. */
97
- static PostponePhysicalActivityUnder5MMOL = () => (0, _translate.t)(`Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity.`);
98
- /** Inform about high BGL. */
99
- static HighBGL = () => (0, _translate.t)(`You have a high blood glucose level.`);
100
- /** Encourage user to measure ketones. */
101
- static InsulinKetones = () => (0, _translate.t)(`You should take rapid-acting insulin and measure ketones.`);
102
- /** Inform the user that their insulin recommendation was limited for safety. */
103
- static RecommendationWasLimited = () => (0, _translate.t)(`Your recommendation would have been higher than {SAFETY_INSULIN_LIMIT} units of insulin, but it has been limited for safety reasons. Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.`, {
104
- SAFETY_INSULIN_LIMIT
105
- });
106
- /** Inform the user that their insulin recommendation was limited for safety in combination with an activity. */
107
- static RecommendationWasLimitedActivity = activityReduction => (0, _translate.t)(`Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons.{1} Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {2}% to {3}.`, {
108
- 0: getLimitedValue(activityReduction),
109
- 1: `\n\n`,
110
- SAFETY_INSULIN_LIMIT,
111
- 2: (activityReduction * 100).toFixed(0),
112
- 3: getLimitedValue(activityReduction)
113
- });
114
- /** Inform the user that the insulin amount they entered is above HDA’s safety limit. */
115
- static InsulinInputWasLimited = activityReduction => activityReduction ? (0, _translate.t)(`Hedia doesn't support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {0}% to {1} units for this calculation.`, {
116
- SAFETY_INSULIN_LIMIT,
117
- 0: (activityReduction * 100).toFixed(0),
118
- 1: getLimitedValue(activityReduction)
119
- }) : (0, _translate.t)(`Hedia does not support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.`, {
120
- SAFETY_INSULIN_LIMIT
121
- });
122
- /** Title for the modal that informs the user that their calculation is too old. */
123
- static TimeoutPrompTitle = () => (0, _translate.t)(`More than 15 minutes has passed since this calculation was started.`);
124
- /**
125
- * Inform the user that their recommendation calculation is too old.
126
- * Variant to show when they didn’t see the actual insulin recommendation because they didn’t tell whether they injected insulin recently.
127
- */
128
- static TimeoutRecommendationNotVisible = () => (0, _translate.t)(`Please go through the calculation steps with new measurements to ensure a safe recommendation.`);
129
- /** Inform the user that their recommendation calculation is too old. */
130
- static TimeoutRecommendationVisible = date => {
131
- const day = (0, _moment.default)(date).format(`LL`);
132
- const time = (0, _moment.default)(date).format(`HH:mm`);
133
- return (0, _translate.t)(`Recommendation from {day} at {time} was not transfered to your logbook.{0}Did you use the recommendation?`, {
134
- day,
135
- time,
136
- 0: `\n`
137
- });
138
- };
139
- }
140
- exports.Messages = Messages;
141
- //# sourceMappingURL=AttentionMessages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_moment","_interopRequireDefault","require","_types","_translate","obj","__esModule","default","AttentionMessage","SevereHypoglycemia","Messages","VeryLowBGL","Reminder15Minutes","Hypoglycemia","LowBGL","MildHypoglycemia","NormoglycemiaActivityUnder5MMOL","PostponePhysicalActivityUnder5MMOL","HyperglycemiaActivity","HighBGL","InsulinKetones","PostponePhysicalActivity","SevereHyperglycemia","SevereHyperglycemiaActivity","BGLevelNotProvided","Hyperglycemia","MildHyperglycemia","Normoglycemia","NormoglycemiaUnder5MMOL","UnsupportedBGLevel","exports","addPostponeActivityMessageUnder5MMOL","message","SAFETY_INSULIN_LIMIT","BolusCalculator","Constants","getLimitedValue","reduction","t","RecommendationWasLimited","RecommendationWasLimitedActivity","activityReduction","toFixed","InsulinInputWasLimited","TimeoutPrompTitle","TimeoutRecommendationNotVisible","TimeoutRecommendationVisible","date","day","moment","format","time"],"sourceRoot":"../../../src","sources":["utils/AttentionMessages.ts"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAAyC,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEzC;AACO,MAAMG,gBAAgB,GAAG;EAC/B;AACD;AACA;AACA;AACA;EACCC,kBAAkB,EAAEA,CAAA,KAAe,GAAEC,QAAQ,CAACC,UAAU,CAAC,CAAE,GAAG,IAAI,GAAED,QAAQ,CAACE,iBAAiB,CAAC,CAAE,EAAC;EAElG;AACD;AACA;AACA;AACA;EACCC,YAAY,EAAEA,CAAA,KAAe,GAAEH,QAAQ,CAACI,MAAM,CAAC,CAAE,GAAG,IAAI,GAAEJ,QAAQ,CAACE,iBAAiB,CAAC,CAAE,EAAC;EAExF;EACAG,gBAAgB,EAAEA,CAAA,KAAcL,QAAQ,CAACE,iBAAiB,CAAC,CAAC;EAE5D;EACAI,+BAA+B,EAAEA,CAAA,KAAcN,QAAQ,CAACO,kCAAkC,CAAC,CAAC;EAE5F;AACD;AACA;AACA;AACA;AACA;AACA;EACCC,qBAAqB,EAAEA,CAAA,KACrB,GAAER,QAAQ,CAACS,OAAO,CAAC,CAAE,GAAG,IAAI,GAAET,QAAQ,CAACU,cAAc,CAAC,CAAE,GAAG,IAAI,GAAEV,QAAQ,CAACE,iBAAiB,CAAC,CAAE,GAAG,IAAI,GAAEF,QAAQ,CAACW,wBAAwB,CAAC,CAAE,EAAC;EAE9I;AACD;AACA;AACA;AACA;EACCC,mBAAmB,EAAEA,CAAA,KAAe,GAAEZ,QAAQ,CAACS,OAAO,CAAC,CAAE,GAAG,IAAI,GAAET,QAAQ,CAACU,cAAc,CAAC,CAAE,GAAG,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AAE,IAAG,CAAC;IACrC,MAAMC,IAAI,GAAG,IAAAF,eAAM,EAACF,IAAI,CAAC,CAACG,MAAM,CAAE,OAAM,CAAC;IACzC,OAAO,IAAAZ,YAAC,EACN,2GAA0G,EAC3G;MAAEU,GAAG;MAAEG,IAAI;MAAE,CAAC,EAAG;IAAI,CACtB,CAAC;EACF,CAAC;AACF;AAACrB,OAAA,CAAApB,QAAA,GAAAA,QAAA"}
@@ -1,138 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.colors = exports.TARGET_BGL_MMOL_LIMITS = exports.SEVERE_HYPERGLYCEMIA_START_MMOL = exports.REMINDER_HOURS_LIMITS = exports.ONE_HOUR_MINUTES = exports.MMOLL_PER_MGDL_BKL = exports.MMOLL_PER_MGDL_BGL = exports.MGDL_PER_MMOLL_BKL = exports.MGDL_PER_MMOLL_BGL = exports.INSULIN_TO_CARBS_RATIO_LIMITS = exports.INSULIN_SENSITIVITY_MMOL_LIMITS = exports.INSULIN_DOSE_LIMITS = exports.FOUR_HOURS_SECONDS = exports.CURRENT_BKL_MMOL_LIMITS = exports.CURRENT_BGL_MMOL_LIMITS = exports.CARBOHYDRATES_LIMTS = exports.BOLUS_SECONDS_PASSED_LIMITS = exports.ACTIVITY_TARGET_BGL_MMOL_LIMITS = exports.ACTIVITY_SETTINGS_INTERVAL_LIMITS = exports.ACTIVITY_DURATION_MINUTES_LIMITS = exports.ACTIVITY_BUFFER_MINUTES = void 0;
7
- var _types = require("@hedia/types");
8
- /** Reusable color definitions. */
9
- const colors = {
10
- blue: `#578aff`,
11
- darkBlue: `#0F1231`,
12
- darkBlueX: `#1B1F48`,
13
- semiDarkBlue: `#1B1F48`,
14
- dustyBlue: `#C5D0E7`,
15
- dustyDarkBlue: `#353A71`,
16
- fadeBlue: `#8388C8`,
17
- lightBlue: `#C8CCFA`,
18
- mistBlue: `#4A5B86`,
19
- purple: `#a200ff`,
20
- deepPurple: `#571BD8`,
21
- teal: `#01FFFC`,
22
- gradientMain: [`#8B38F5`, `#D593E5`],
23
- gradientPurple: [`#a200ff`, `#578aff`],
24
- white: `#FFFFFF`,
25
- black: `#000000`,
26
- transparentWhite: `#FFFFFF00`,
27
- transparentBlack: `#000000E6`,
28
- transparentDarkBlue: `#0F123120`,
29
- transparentLightBlue: `#578AFF1A`,
30
- activityGreen: `#A5D871`,
31
- activityOrange: `#F9BD5A`,
32
- activityRed: `#EC5466`
33
- };
34
-
35
- /** The threshold above which hyperglycemia is considered to be severe in mmol/L */
36
- exports.colors = colors;
37
- const SEVERE_HYPERGLYCEMIA_START_MMOL = 15;
38
-
39
- /** The number of seconds in four hours. */
40
- exports.SEVERE_HYPERGLYCEMIA_START_MMOL = SEVERE_HYPERGLYCEMIA_START_MMOL;
41
- const FOUR_HOURS_SECONDS = 14400;
42
- /** The number of minutes in one hour. */
43
- exports.FOUR_HOURS_SECONDS = FOUR_HOURS_SECONDS;
44
- const ONE_HOUR_MINUTES = 60;
45
- /** Extra time before an activity starts or stops. */
46
- exports.ONE_HOUR_MINUTES = ONE_HOUR_MINUTES;
47
- const ACTIVITY_BUFFER_MINUTES = 10;
48
-
49
- /** The lower and upper limits for the amount of carbohydrates in grams. */
50
- exports.ACTIVITY_BUFFER_MINUTES = ACTIVITY_BUFFER_MINUTES;
51
- const CARBOHYDRATES_LIMTS = {
52
- min: 0,
53
- max: 300
54
- };
55
- /** The lower and upper limits for the insulin dose in units. The upper limit is represented by the SAFETY_INSULIN_LIMIT constant while the lower limit is 0. */
56
- exports.CARBOHYDRATES_LIMTS = CARBOHYDRATES_LIMTS;
57
- const INSULIN_DOSE_LIMITS = {
58
- min: 0,
59
- max: _types.BolusCalculator.Constants.SAFETY_INSULIN_LIMIT
60
- };
61
- /** The lower and upper limits for the age of boluses that gets taken into account for calculating insulin on board. */
62
- exports.INSULIN_DOSE_LIMITS = INSULIN_DOSE_LIMITS;
63
- const BOLUS_SECONDS_PASSED_LIMITS = {
64
- min: 0,
65
- max: FOUR_HOURS_SECONDS
66
- };
67
-
68
- /** The lower and upper limits for the duration of an activity in minutes. */
69
- exports.BOLUS_SECONDS_PASSED_LIMITS = BOLUS_SECONDS_PASSED_LIMITS;
70
- const ACTIVITY_DURATION_MINUTES_LIMITS = {
71
- min: 1,
72
- max: ONE_HOUR_MINUTES
73
- };
74
- /** The lower and upper limits of insulin sensitivity settings. */
75
- exports.ACTIVITY_DURATION_MINUTES_LIMITS = ACTIVITY_DURATION_MINUTES_LIMITS;
76
- const INSULIN_SENSITIVITY_MMOL_LIMITS = {
77
- min: 0.3,
78
- max: 10
79
- };
80
- /** The lower and upper limits of insulin-to-carbs ratio settings. */
81
- exports.INSULIN_SENSITIVITY_MMOL_LIMITS = INSULIN_SENSITIVITY_MMOL_LIMITS;
82
- const INSULIN_TO_CARBS_RATIO_LIMITS = {
83
- min: 1,
84
- max: 50
85
- };
86
-
87
- /** The lower and upper limits of the entered blood glucose level value in mmol/L. */
88
- exports.INSULIN_TO_CARBS_RATIO_LIMITS = INSULIN_TO_CARBS_RATIO_LIMITS;
89
- const CURRENT_BGL_MMOL_LIMITS = {
90
- min: 1.1,
91
- max: 33.3
92
- };
93
- /** The conversion factor to multiply a blood glucose value with to go from mmol/L to mg/dL. */
94
- exports.CURRENT_BGL_MMOL_LIMITS = CURRENT_BGL_MMOL_LIMITS;
95
- const MMOLL_PER_MGDL_BGL = 0.0555;
96
- /** The conversion factor to multiply a blood glucose value with to go from mg/dL to mmol/L. */
97
- exports.MMOLL_PER_MGDL_BGL = MMOLL_PER_MGDL_BGL;
98
- const MGDL_PER_MMOLL_BGL = 1 / MMOLL_PER_MGDL_BGL;
99
-
100
- /** The lower and upper limits of the entered blood ketones value in mmol/L. */
101
- exports.MGDL_PER_MMOLL_BGL = MGDL_PER_MMOLL_BGL;
102
- const CURRENT_BKL_MMOL_LIMITS = {
103
- min: 0,
104
- max: 8
105
- };
106
- /** The conversion factor to multiply a blood ketones value with to go from mmol/L to mg/dL. */
107
- exports.CURRENT_BKL_MMOL_LIMITS = CURRENT_BKL_MMOL_LIMITS;
108
- const MMOLL_PER_MGDL_BKL = 0.096;
109
- /** The conversion factor to multiply a blood ketones value with to go from mg/dL to mmol/L. */
110
- exports.MMOLL_PER_MGDL_BKL = MMOLL_PER_MGDL_BKL;
111
- const MGDL_PER_MMOLL_BKL = 1 / MMOLL_PER_MGDL_BKL;
112
-
113
- /** The lower and upper limits for a valid BGL target in mmol/L. */
114
- exports.MGDL_PER_MMOLL_BKL = MGDL_PER_MMOLL_BKL;
115
- const TARGET_BGL_MMOL_LIMITS = {
116
- min: 5,
117
- max: 13.9
118
- };
119
- /** The lower and upper limits for a valid activity BGL target in mmol/L. */
120
- exports.TARGET_BGL_MMOL_LIMITS = TARGET_BGL_MMOL_LIMITS;
121
- const ACTIVITY_TARGET_BGL_MMOL_LIMITS = {
122
- min: 5,
123
- max: 13.9
124
- };
125
- /** The lower and upper limits for how long the reminder notification timer may be. */
126
- exports.ACTIVITY_TARGET_BGL_MMOL_LIMITS = ACTIVITY_TARGET_BGL_MMOL_LIMITS;
127
- const REMINDER_HOURS_LIMITS = {
128
- min: 0,
129
- max: 6
130
- };
131
- /** The lower and upper limits for activity reduction. */
132
- exports.REMINDER_HOURS_LIMITS = REMINDER_HOURS_LIMITS;
133
- const ACTIVITY_SETTINGS_INTERVAL_LIMITS = {
134
- min: 0,
135
- max: 1
136
- };
137
- exports.ACTIVITY_SETTINGS_INTERVAL_LIMITS = ACTIVITY_SETTINGS_INTERVAL_LIMITS;
138
- //# sourceMappingURL=Constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_types","require","colors","blue","darkBlue","darkBlueX","semiDarkBlue","dustyBlue","dustyDarkBlue","fadeBlue","lightBlue","mistBlue","purple","deepPurple","teal","gradientMain","gradientPurple","white","black","transparentWhite","transparentBlack","transparentDarkBlue","transparentLightBlue","activityGreen","activityOrange","activityRed","exports","SEVERE_HYPERGLYCEMIA_START_MMOL","FOUR_HOURS_SECONDS","ONE_HOUR_MINUTES","ACTIVITY_BUFFER_MINUTES","CARBOHYDRATES_LIMTS","min","max","INSULIN_DOSE_LIMITS","BolusCalculator","Constants","SAFETY_INSULIN_LIMIT","BOLUS_SECONDS_PASSED_LIMITS","ACTIVITY_DURATION_MINUTES_LIMITS","INSULIN_SENSITIVITY_MMOL_LIMITS","INSULIN_TO_CARBS_RATIO_LIMITS","CURRENT_BGL_MMOL_LIMITS","MMOLL_PER_MGDL_BGL","MGDL_PER_MMOLL_BGL","CURRENT_BKL_MMOL_LIMITS","MMOLL_PER_MGDL_BKL","MGDL_PER_MMOLL_BKL","TARGET_BGL_MMOL_LIMITS","ACTIVITY_TARGET_BGL_MMOL_LIMITS","REMINDER_HOURS_LIMITS","ACTIVITY_SETTINGS_INTERVAL_LIMITS"],"sourceRoot":"../../../src","sources":["utils/Constants.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA;AACO,MAAMC,MAAM,GAAG;EACrBC,IAAI,EAAG,SAAQ;EACfC,QAAQ,EAAG,SAAQ;EACnBC,SAAS,EAAG,SAAQ;EACpBC,YAAY,EAAG,SAAQ;EACvBC,SAAS,EAAG,SAAQ;EACpBC,aAAa,EAAG,SAAQ;EACxBC,QAAQ,EAAG,SAAQ;EACnBC,SAAS,EAAG,SAAQ;EACpBC,QAAQ,EAAG,SAAQ;EACnBC,MAAM,EAAG,SAAQ;EACjBC,UAAU,EAAG,SAAQ;EACrBC,IAAI,EAAG,SAAQ;EACfC,YAAY,EAAE,CAAE,SAAQ,EAAG,SAAQ,CAAC;EACpCC,cAAc,EAAE,CAAE,SAAQ,EAAG,SAAQ,CAAC;EACtCC,KAAK,EAAG,SAAQ;EAChBC,KAAK,EAAG,SAAQ;EAChBC,gBAAgB,EAAG,WAAU;EAC7BC,gBAAgB,EAAG,WAAU;EAC7BC,mBAAmB,EAAG,WAAU;EAChCC,oBAAoB,EAAG,WAAU;EACjCC,aAAa,EAAG,SAAQ;EACxB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(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UserReminderError = exports.TargetBGLError = exports.RecommendationError = exports.RecentBolusError = exports.LatestLogbook6HoursBGLError = exports.LanguageError = exports.InsulinToCarbsRatioError = exports.InsulinSensitivityError = exports.InjectionMethodError = exports.CurrentBKLError = exports.CurrentBGLError = exports.CarbohydrateLimitError = exports.BolusInsulinSecondsPassedError = exports.BolusInsulinDoseError = exports.BloodKetoneUnitError = exports.BloodKetonePropsError = exports.BloodGlucoseUnitError = exports.ActivityTypeError = exports.ActivityTargetBGLError = exports.ActivitySettingsError = exports.ActivityIntensityError = exports.ActivityDurationError = exports.ActivityDateError = void 0;
7
- var _types = require("@hedia/types");
8
- var _translate = require("../locales/translate");
9
- var _enum = require("../types/enum");
10
- const SAFETY_INSULIN_LIMIT = _types.BolusCalculator.Constants.SAFETY_INSULIN_LIMIT;
11
-
12
- /**
13
- * Defines a set of human readable error messages.
14
- * Each of them is defined as a function that returns the required translatable error message.
15
- * The app should generally prevent the user from entering invalid values at the time of entry, so in almost all of these cases,
16
- * the use of any of these errors indicate that something might have gone really wrong, and the user will be prevented
17
- * from getting a recommendation until the problem is solved.
18
- */
19
- class RecommendationError extends Error {
20
- constructor(message, type) {
21
- super(message);
22
- this.type = type;
23
- }
24
- }
25
-
26
- /** The given activity settings are corrupt. */
27
- exports.RecommendationError = RecommendationError;
28
- const ActivitySettingsError = () => new RecommendationError((0, _translate.t)(`Error. Please verify that your activity settings are set up correctly.`), _enum.RecommendationErrorEnum.ActivitySettings);
29
-
30
- /** The duration of the given activity is invalid. */
31
- exports.ActivitySettingsError = ActivitySettingsError;
32
- const ActivityDurationError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.`), _enum.RecommendationErrorEnum.ActivityDuration);
33
-
34
- /** The start date of the given activity is invalid. */
35
- exports.ActivityDurationError = ActivityDurationError;
36
- const ActivityDateError = () => new RecommendationError((0, _translate.t)(`Hedia Calculator does not support activities that finished more than 4 hours ago.`), _enum.RecommendationErrorEnum.ActivityDate);
37
-
38
- /** The intensity of the given activity is invalid. */
39
- exports.ActivityDateError = ActivityDateError;
40
- const ActivityIntensityError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support your activity intensity value`), _enum.RecommendationErrorEnum.ActivityIntensity);
41
-
42
- /** Type of the given activity is invalid. */
43
- exports.ActivityIntensityError = ActivityIntensityError;
44
- const ActivityTypeError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support your activity type value`), _enum.RecommendationErrorEnum.ActivityType);
45
-
46
- /** The user’s activity target BGL setting is invalid. */
47
- exports.ActivityTypeError = ActivityTypeError;
48
- const ActivityTargetBGLError = () => new RecommendationError((0, _translate.t)(`Error. Please verify that your activity target blood glucose value is correct.`), _enum.RecommendationErrorEnum.ActivityTargetBGL);
49
-
50
- /** More than 300 g carbohydrates entered. */
51
- exports.ActivityTargetBGLError = ActivityTargetBGLError;
52
- const CarbohydrateLimitError = () => new RecommendationError((0, _translate.t)(`Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.`), _enum.RecommendationErrorEnum.CarbohydrateLimit);
53
-
54
- /** The user’s insulin sensitivity setting is outside of the valid range. */
55
- exports.CarbohydrateLimitError = CarbohydrateLimitError;
56
- const InsulinSensitivityError = () => new RecommendationError((0, _translate.t)(`Error. Please verify that your insulin sensitivity value is correct.`), _enum.RecommendationErrorEnum.InsulinSensitivity);
57
-
58
- /** The user’s insulin-to-carbs ratio setting is outside of the valid range. */
59
- exports.InsulinSensitivityError = InsulinSensitivityError;
60
- const InsulinToCarbsRatioError = () => new RecommendationError((0, _translate.t)(`Error. Please verify that your insulin to carb ratio value is correct.`), _enum.RecommendationErrorEnum.InsulinToCarbsRatio);
61
-
62
- /** The entered current blood glucose level is outside of the valid range. */
63
- exports.InsulinToCarbsRatioError = InsulinToCarbsRatioError;
64
- const CurrentBGLError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support your current blood glucose level.`), _enum.RecommendationErrorEnum.CurrentBGL);
65
-
66
- /** The blood glucose level of the latest logbook entry from the last 6 hours is outside of the valid range. */
67
- exports.CurrentBGLError = CurrentBGLError;
68
- const LatestLogbook6HoursBGLError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support the blood glucose level of your latest logbook entry from the last 6 hours.`), _enum.RecommendationErrorEnum.LatestLogbook6HoursBGL);
69
-
70
- /** The entered current blood ketones concentration is outside of the valid range. */
71
- exports.LatestLogbook6HoursBGLError = LatestLogbook6HoursBGLError;
72
- const CurrentBKLError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support your current blood ketone level.`), _enum.RecommendationErrorEnum.CurrentBKL);
73
-
74
- /** The user’s target BGL setting is outside of the valid range. */
75
- exports.CurrentBKLError = CurrentBKLError;
76
- const TargetBGLError = () => new RecommendationError((0, _translate.t)(`Error. Please verify that your target blood glucose value is correct.`), _enum.RecommendationErrorEnum.TargetBGL);
77
-
78
- /** At least one of the recent (within the previous 4 hours) logbook entries has an insulin amount that exceeds the safety insulin threshold. */
79
- exports.TargetBGLError = TargetBGLError;
80
- const BolusInsulinDoseError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support an insulin dose greater than {SAFETY_INSULIN_LIMIT} units`, {
81
- SAFETY_INSULIN_LIMIT
82
- }), _enum.RecommendationErrorEnum.BolusInsulinDose);
83
-
84
- /** At least one entry from the list of recent logbook entries is older than 4 hours. */
85
- exports.BolusInsulinDoseError = BolusInsulinDoseError;
86
- const BolusInsulinSecondsPassedError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours`), _enum.RecommendationErrorEnum.BolusInsulinSecondsPassed);
87
-
88
- /** The user’s recent boluses entries are not in the allowed format. */
89
- exports.BolusInsulinSecondsPassedError = BolusInsulinSecondsPassedError;
90
- const RecentBolusError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator could not find your recent boluses`), _enum.RecommendationErrorEnum.RecentBolus);
91
-
92
- /** The user’s setting for initial reminder time is outside of the valid range. */
93
- exports.RecentBolusError = RecentBolusError;
94
- const UserReminderError = () => new RecommendationError((0, _translate.t)(`Error. Please verify your notifications settings.`), _enum.RecommendationErrorEnum.UserReminder);
95
-
96
- /** The user’s insulin injection method setting is invalid. */
97
- exports.UserReminderError = UserReminderError;
98
- const InjectionMethodError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support your injection method.`), _enum.RecommendationErrorEnum.InjectionMethod);
99
-
100
- /**The user’s language setting is not supported by the bolus calculator or it is in the wrong format */
101
- exports.InjectionMethodError = InjectionMethodError;
102
- const LanguageError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support your current language.`), _enum.RecommendationErrorEnum.Language);
103
-
104
- /** The user’s blood ketones unit setting is invalid. */
105
- exports.LanguageError = LanguageError;
106
- const BloodKetoneUnitError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support your current blood ketone unit.`), _enum.RecommendationErrorEnum.BloodKetoneUnit);
107
-
108
- /** The user’s blood glucose level measuring unit setting is invalid. */
109
- exports.BloodKetoneUnitError = BloodKetoneUnitError;
110
- const BloodGlucoseUnitError = () => new RecommendationError((0, _translate.t)(`Error. Hedia Calculator does not support your current blood glucose unit.`), _enum.RecommendationErrorEnum.BloodGlucoseUnit);
111
-
112
- /** The user has provided a blood ketone level but the blood ketone measuring unit is not defined. */
113
- exports.BloodGlucoseUnitError = BloodGlucoseUnitError;
114
- const BloodKetonePropsError = () => new RecommendationError((0, _translate.t)(`Error. Your blood ketone settings are invalid.`), _enum.RecommendationErrorEnum.BloodKetoneProps);
115
- exports.BloodKetonePropsError = BloodKetonePropsError;
116
- //# sourceMappingURL=RecommendationError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_types","require","_translate","_enum","SAFETY_INSULIN_LIMIT","BolusCalculator","Constants","RecommendationError","Error","constructor","message","type","exports","ActivitySettingsError","t","RecommendationErrorEnum","ActivitySettings","ActivityDurationError","ActivityDuration","ActivityDateError","ActivityDate","ActivityIntensityError","ActivityIntensity","ActivityTypeError","ActivityType","ActivityTargetBGLError","ActivityTargetBGL","CarbohydrateLimitError","CarbohydrateLimit","InsulinSensitivityError","InsulinSensitivity","InsulinToCarbsRatioError","InsulinToCarbsRatio","CurrentBGLError","CurrentBGL","LatestLogbook6HoursBGLError","LatestLogbook6HoursBGL","CurrentBKLError","CurrentBKL","TargetBGLError","TargetBGL","BolusInsulinDoseError","BolusInsulinDose","BolusInsulinSecondsPassedError","BolusInsulinSecondsPassed","RecentBolusError","RecentBolus","UserReminderError","UserReminder","InjectionMethodError","InjectionMethod","LanguageError","Language","BloodKetoneUnitError","BloodKetoneUnit","BloodGlucoseUnitError","BloodGlucoseUnit","BloodKetonePropsError","BloodKetoneProps"],"sourceRoot":"../../../src","sources":["utils/RecommendationError.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,MAAMG,oBAAoB,GAAGC,sBAAe,CAACC,SAAS,CAACF,oBAAoB;;AAE3E;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,mBAAmB,SAASC,KAAK,CAAC;EAG9CC,WAAWA,CAACC,OAAe,EAAEC,IAA6B,EAAE;IAC3D,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAGA,IAAI;EACjB;AACD;;AAEA;AAAAC,OAAA,CAAAL,mBAAA,GAAAA,mBAAA;AACO,MAAMM,qBAAqB,GAAGA,CAAA,KACpC,IAAIN,mBAAmB,CACtB,IAAAO,YAAC,EAAE,wEAAuE,CAAC,EAC3EC,6BAAuB,CAACC,gBACzB,CAAC;;AAEF;AAAAJ,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AACO,MAAMI,qBAAqB,GAAGA,CAAA,KACpC,IAAIV,mBAAmB,CACtB,IAAAO,YAAC,EAAE,yFAAwF,CA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C,qBAAA,GAAAA,qBAAA"}
@@ -1,212 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getAttentionMessage = getAttentionMessage;
7
- exports.getBGLevel = getBGLevel;
8
- exports.getLimitationMessage = getLimitationMessage;
9
- exports.getReminder = getReminder;
10
- exports.isActivityWithin15Minutes = isActivityWithin15Minutes;
11
- exports.isSevereHyperglycemia = isSevereHyperglycemia;
12
- var _moment = _interopRequireDefault(require("moment"));
13
- var _enum = require("../types/enum");
14
- var _AttentionMessages = require("./AttentionMessages");
15
- var _Constants = require("./Constants");
16
- var _RecommendationError = require("./RecommendationError");
17
- var _Utils = require("./Utils");
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
- /**
20
- * Helper functions for processing and categorising user inputs for determining which warnings and messages to display.
21
- * @module
22
- */
23
-
24
- /**
25
- * Determine the category of the blood glucose level based on the numerical value of the BGL itself and potentially the most recent previously entered BGL.
26
- *
27
- * Steps:
28
- * 1. If currentBGL is null return BgLevel.BGLevelNotProvided.
29
- * 2. If currentBGL is in the interval [1.1; 2] return BgLevel.SevereHypoglycemia.
30
- * 3. If currentBGL is in the interval ]2; 3.5] return BgLevel.Hypoglycemia.
31
- * 4. If currentBGL is in the interval ]3.5; 4] return BgLevel.MildHypoglycemia.
32
- * 5. If currentBGL is in the interval ]4; 5[ return BgLevel.NormoglycemiaUnder5MMOL.
33
- * 6. If currentBGL is in the interval [5; 7] return BgLevel.Normoglycemia.
34
- * 7. If currentBGL is in the interval ]7; 15[ return BgLevel.MildHyperglycemia.
35
- * 8. If currentBGL is in the interval ]15; 33.3] and calling isSevereHyperglycemia() with latestLogbookFrom6Hours returns true then return BgLevel.SevereHyperglycemia.
36
- * 9. If currentBGL is in the interval [15; 33.3] return BgLevel.Hyperglycemia.
37
- * @param currentBGL The blood glucose level entered by the user or null if they didn’t enter it.
38
- * @param latestLogbookFrom6Hours The latest saved logbook entry if one was logged within the last 6 hours. Otherwise null.
39
- * @returns Indication of the category that the blood glucose level belongs to {@link BgLevel}.
40
- */
41
- function getBGLevel(currentBGL, latestLogbookFrom6Hours) {
42
- if (currentBGL === null) {
43
- return _enum.BgLevel.BGLevelNotProvided;
44
- }
45
- if (currentBGL >= 1.1 && currentBGL <= 2) {
46
- return _enum.BgLevel.SevereHypoglycemia;
47
- }
48
- if (currentBGL > 2 && currentBGL <= 3.5) {
49
- return _enum.BgLevel.Hypoglycemia;
50
- }
51
- if (currentBGL > 3.5 && currentBGL <= 4) {
52
- return _enum.BgLevel.MildHypoglycemia;
53
- }
54
- if (currentBGL > 4 && currentBGL < 5) {
55
- return _enum.BgLevel.NormoglycemiaUnder5MMOL;
56
- }
57
- if (currentBGL >= 5 && currentBGL <= 7) {
58
- return _enum.BgLevel.Normoglycemia;
59
- }
60
- if (currentBGL > 7 && currentBGL < 15) {
61
- return _enum.BgLevel.MildHyperglycemia;
62
- }
63
- if (currentBGL > 15 && currentBGL <= 33.3 && latestLogbookFrom6Hours ? isSevereHyperglycemia(latestLogbookFrom6Hours) : false) {
64
- return _enum.BgLevel.SevereHyperglycemia;
65
- }
66
- if (currentBGL >= 15 && currentBGL <= 33.3) {
67
- return _enum.BgLevel.Hyperglycemia;
68
- }
69
- return _enum.BgLevel.UnsupportedBGLevel;
70
- }
71
-
72
- /**
73
- * Calculate the initial value for the calibration reminder time slider.
74
- *
75
- * Steps:
76
- * 1. Set reminder to be the user’s preferred reminder time if it is defined or to the default reminder time of 1.5 (hours) otherwise.
77
- * 2. Use a switch statement on {@link BgLevel} to determine the appropriate reminder value to return:
78
- * - If it is SevereHypoglycemia, Hypoglycemia, or MildHypoglycemia then return Reminder15Minutes.
79
- * - If it is NormoglycemiaUnder5MMOL, Normoglycemia, MildHyperglycemia, or BGLevelNotProvided then return the value of reminder
80
- * if the user entered carbohydrates or an activity, or ReminderOff otherwise.
81
- * - If it is Hyperglycemia, or SevereHyperglycemia then return Reminder15Minutes if isActivityWithin15Minutes() given the activity
82
- * is true and return Reminder60Minutes otherwise.
83
- * - If none of the above conditions were triggered, throw a CurrentBGLError().
84
- * @param bgLevel The severity category that the user’s current BGL belongs to.
85
- * @param carbohydrates The amount of carbohydrates that the user is ingesting.
86
- * @param userReminder The user’s preferred initial reminder time interval in hours.
87
- * @param activity The activity that the user entered.
88
- * @returns The initial value of the remeasurement reminder timer slider in hours {@link RecommendationReminders}.
89
- */
90
- function getReminder(bgLevel, carbohydrates, userReminder, activity) {
91
- const reminder = userReminder === undefined ? _enum.RecommendationReminders.HediaReminderDefault : userReminder;
92
- switch (bgLevel) {
93
- case _enum.BgLevel.SevereHypoglycemia:
94
- case _enum.BgLevel.Hypoglycemia:
95
- case _enum.BgLevel.MildHypoglycemia:
96
- return _enum.RecommendationReminders.Reminder15Minutes;
97
- case _enum.BgLevel.NormoglycemiaUnder5MMOL:
98
- case _enum.BgLevel.Normoglycemia:
99
- case _enum.BgLevel.MildHyperglycemia:
100
- case _enum.BgLevel.BGLevelNotProvided:
101
- return carbohydrates || activity ? reminder : _enum.RecommendationReminders.ReminderOff;
102
- case _enum.BgLevel.Hyperglycemia:
103
- case _enum.BgLevel.SevereHyperglycemia:
104
- return isActivityWithin15Minutes(activity) ? _enum.RecommendationReminders.Reminder15Minutes : _enum.RecommendationReminders.Reminder60Minutes;
105
- default:
106
- throw (0, _RecommendationError.CurrentBGLError)();
107
- }
108
- }
109
-
110
- /**
111
- * Get the attention message that fits with the user’s entered blood glucose level and activity.
112
- *
113
- * Steps:
114
- * 1. Use at switch statement on bgLevel to determine the appropriate action to take:
115
- * - If it is BGLevelNotProvided, Normoglycemia, or MildHyperglycemia then return null.
116
- * - If it is NormoglycemiaUnder5MMOL then do the following:
117
- * - If an activity is going to start within 15 minuts as determined by isActivityWithin15Minutes() then return AttentionMessage.NormoglycemiaActivityUnder5MMOL().
118
- * Otherwise return null.
119
- * - If it is SevereHypoglycemia, Hypoglycemia, or MildHypoglycemia then do the following:
120
- * - If an activity is going to start within 15 minuts as determined by isActivityWithin15Minutes() then
121
- * return the AttentionMessage that corresponds to the bgLevel and append a message about postponing the activity using addPostponeActivityMessage().
122
- * Otherwise return the AttentionMessage that corresponds to the {@link BgLevel} without further modification.
123
- * - If it is Hyperglycemia then do the following:
124
- * - If an activity is going to start within 15 minuts as determined by isActivityWithin15Minutes() then return AttentionMessage.HyperglycemiaActivity().
125
- * Otherwise return null.
126
- * - If it is SevereHyperglycemia then do the following:
127
- * - If an activity is going to start within 15 minuts as determined by isActivityWithin15Minutes() then return AttentionMessage.SevereHyperglycemiaActivity().
128
- * Otherwise return AttentionMessage.SevereHyperglycemia().
129
- * - If none of the above conditions were triggered, throw a CurrentBGLError() {@link RecommendationError}.
130
- * @param bgLevel The category of the user’s blood glucose level.
131
- * @param activity The activity that the user entered
132
- * @returns The appropriate attention message {@link AttentionMessage} to display to the user or null if there is no message to be displayed.
133
- */
134
- function getAttentionMessage(bgLevel, activity) {
135
- const key = _Utils.Utils.getKeyFromValue(_enum.BgLevel, bgLevel);
136
- const isAttentionMessageNull = _AttentionMessages.AttentionMessage[key] === null;
137
- const isWithin15Minutes = isActivityWithin15Minutes(activity);
138
- switch (bgLevel) {
139
- case _enum.BgLevel.BGLevelNotProvided:
140
- case _enum.BgLevel.Normoglycemia:
141
- case _enum.BgLevel.MildHyperglycemia:
142
- return null;
143
- case _enum.BgLevel.NormoglycemiaUnder5MMOL:
144
- return isWithin15Minutes ? _AttentionMessages.AttentionMessage.NormoglycemiaActivityUnder5MMOL() : null;
145
- case _enum.BgLevel.SevereHypoglycemia:
146
- case _enum.BgLevel.Hypoglycemia:
147
- case _enum.BgLevel.MildHypoglycemia:
148
- return isWithin15Minutes && !isAttentionMessageNull ?
149
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
150
- (0, _AttentionMessages.addPostponeActivityMessageUnder5MMOL)(_AttentionMessages.AttentionMessage[key]()) :
151
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
152
- _AttentionMessages.AttentionMessage[key]();
153
- case _enum.BgLevel.Hyperglycemia:
154
- return isWithin15Minutes ? _AttentionMessages.AttentionMessage.HyperglycemiaActivity() : null;
155
- case _enum.BgLevel.SevereHyperglycemia:
156
- return isWithin15Minutes ? _AttentionMessages.AttentionMessage.SevereHyperglycemiaActivity() : _AttentionMessages.AttentionMessage.SevereHyperglycemia();
157
- default:
158
- throw (0, _RecommendationError.CurrentBGLError)();
159
- }
160
- }
161
-
162
- /**
163
- * Determine based on on the previously measured BGL if the hyperglycemia should be categorized as severe.
164
- *
165
- * Steps:
166
- * 1. If the logbook is not null or undefined, return the result of comparing if the blood_glucose_millimolar property of latestLogbookFrom6Hours
167
- * is strictly larger than the threshold for severe hyperglycemia (15) {@link Constants}.
168
- * @param logbook The latest previous logbook entry - if any - from the past 6 hours.
169
- * @returns True if the BGL from the previous logbook entry is above the threshold for severe hyperglycemia. False otherwise.
170
- */
171
- function isSevereHyperglycemia(logbook) {
172
- if (logbook !== null && logbook !== undefined) {
173
- const {
174
- blood_glucose_millimolar
175
- } = logbook;
176
- if (blood_glucose_millimolar !== null) {
177
- return blood_glucose_millimolar > _Constants.SEVERE_HYPERGLYCEMIA_START_MMOL;
178
- }
179
- }
180
- return false;
181
- }
182
-
183
- /**
184
- * Determine whether an activity is either ongoing or is starting within 15 minutes from now.
185
- *
186
- * Steps:
187
- * 1. Extract the duration from the activity.
188
- * 2. Check if the start date of the activity was between duration minutes in the past or 15 minutes in the future and return the result.
189
- * @param activity The activity whose start time should be checked.
190
- * @returns Indication of whether the activity is ongoing or imminent.
191
- */
192
- function isActivityWithin15Minutes(activity) {
193
- const minutes = activity?.activityDuration;
194
- return _moment.default.utc(activity?.activityDate).isBetween(_moment.default.utc().subtract(minutes, `minutes`), _moment.default.utc().add(15, `minutes`));
195
- }
196
-
197
- /**
198
- * The appropriate message for informing the user if the insulin recommendation was limited.
199
- *
200
- * Steps:
201
- * 1. Set message to the return value of RecommendationWasLimitedActivity() if activityReduction is truthy or to the return value of RecommendationWasLimited() otherwise.
202
- * 2. Return message if wasLimited is true or undefined otherwise.
203
- * @param wasLimited Indicator of whether or not the user’s insulin recommendation was limited.
204
- * @param activityReduction The fraction by which the insulin recommendation and the safety insulin limit has been reduced due to physical activity.
205
- * @returns Callable that returns the appropriate message {@link Messages} for informing the user about the limitation.
206
- * If no limitation message should be displayed to the user then null is returned.
207
- */
208
- function getLimitationMessage(wasLimited, activityReduction) {
209
- const message = activityReduction ? _AttentionMessages.Messages.RecommendationWasLimitedActivity(activityReduction) : _AttentionMessages.Messages.RecommendationWasLimited();
210
- return wasLimited ? message : null;
211
- }
212
- //# sourceMappingURL=RecommendationUtils.js.map