@hedia/recommendation-screen 1.4.4 → 1.5.1

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 (91) hide show
  1. package/.idea/workspace.xml +38 -137
  2. package/android/app/src/main/assets/fonts/AntDesign.ttf +0 -0
  3. package/android/app/src/main/assets/fonts/Entypo.ttf +0 -0
  4. package/android/app/src/main/assets/fonts/EvilIcons.ttf +0 -0
  5. package/android/app/src/main/assets/fonts/Feather.ttf +0 -0
  6. package/android/app/src/main/assets/fonts/FontAwesome.ttf +0 -0
  7. package/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf +0 -0
  8. package/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf +0 -0
  9. package/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf +0 -0
  10. package/android/app/src/main/assets/fonts/Fontisto.ttf +0 -0
  11. package/android/app/src/main/assets/fonts/Foundation.ttf +0 -0
  12. package/android/app/src/main/assets/fonts/Ionicons.ttf +0 -0
  13. package/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf +0 -0
  14. package/android/app/src/main/assets/fonts/MaterialIcons.ttf +0 -0
  15. package/android/app/src/main/assets/fonts/Octicons.ttf +0 -0
  16. package/android/app/src/main/assets/fonts/Roboto-Black.ttf +0 -0
  17. package/android/app/src/main/assets/fonts/Roboto-BlackItalic.ttf +0 -0
  18. package/android/app/src/main/assets/fonts/Roboto-Bold.ttf +0 -0
  19. package/android/app/src/main/assets/fonts/Roboto-BoldItalic.ttf +0 -0
  20. package/android/app/src/main/assets/fonts/Roboto-Italic.ttf +0 -0
  21. package/android/app/src/main/assets/fonts/Roboto-Light.ttf +0 -0
  22. package/android/app/src/main/assets/fonts/Roboto-LightItalic.ttf +0 -0
  23. package/android/app/src/main/assets/fonts/Roboto-Medium.ttf +0 -0
  24. package/android/app/src/main/assets/fonts/Roboto-MediumItalic.ttf +0 -0
  25. package/android/app/src/main/assets/fonts/Roboto-Regular.ttf +0 -0
  26. package/android/app/src/main/assets/fonts/Roboto-Thin.ttf +0 -0
  27. package/android/app/src/main/assets/fonts/Roboto-ThinItalic.ttf +0 -0
  28. package/android/app/src/main/assets/fonts/SimpleLineIcons.ttf +0 -0
  29. package/android/app/src/main/assets/fonts/Zocial.ttf +0 -0
  30. package/assets/fonts/Roboto/LICENSE.txt +202 -0
  31. package/assets/fonts/Roboto/Roboto-Black.ttf +0 -0
  32. package/assets/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  33. package/assets/fonts/Roboto/Roboto-Bold.ttf +0 -0
  34. package/assets/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  35. package/assets/fonts/Roboto/Roboto-Italic.ttf +0 -0
  36. package/assets/fonts/Roboto/Roboto-Light.ttf +0 -0
  37. package/assets/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  38. package/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
  39. package/assets/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  40. package/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
  41. package/assets/fonts/Roboto/Roboto-Thin.ttf +0 -0
  42. package/assets/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  43. package/ios/HediaRecommendationScreen/Info.plist +18 -6
  44. package/ios/HediaRecommendationScreen.xcodeproj/project.pbxproj +48 -0
  45. package/package.json +1 -1
  46. package/react-native.config.js +7 -0
  47. package/src/RecommendationScreen.d.ts +11 -4
  48. package/src/RecommendationScreen.jsx +47 -24
  49. package/src/RecommendationScreen.tsx +94 -34
  50. package/src/components/InfoBars.d.ts +2 -4
  51. package/src/components/InfoBars.jsx +8 -8
  52. package/src/components/InfoBars.tsx +9 -10
  53. package/src/components/LimitationMessage.d.ts +10 -0
  54. package/src/components/LimitationMessage.jsx +50 -0
  55. package/src/components/LimitationMessage.tsx +42 -0
  56. package/src/components/LineSeparator.d.ts +8 -0
  57. package/src/components/LineSeparator.jsx +22 -0
  58. package/src/components/LineSeparator.tsx +24 -0
  59. package/src/components/RecommendationModal.d.ts +5 -1
  60. package/src/components/RecommendationModal.jsx +15 -24
  61. package/src/components/RecommendationModal.tsx +26 -36
  62. package/src/components/RecommendedCarbs.d.ts +0 -1
  63. package/src/components/RecommendedCarbs.jsx +44 -45
  64. package/src/components/RecommendedCarbs.tsx +45 -47
  65. package/src/components/RecommendedInsulin.jsx +2 -2
  66. package/src/components/RecommendedInsulin.tsx +2 -2
  67. package/src/components/Remeasure.jsx +1 -0
  68. package/src/components/Remeasure.tsx +1 -0
  69. package/src/components/TwoOptionModal.d.ts +130 -0
  70. package/src/components/TwoOptionModal.jsx +135 -0
  71. package/src/components/TwoOptionModal.tsx +144 -0
  72. package/src/components/activity/Activity.jsx +1 -0
  73. package/src/components/activity/Activity.tsx +1 -0
  74. package/src/locale/da/messages.js +1 -1
  75. package/src/locale/da/messages.po +112 -76
  76. package/src/locale/en/messages.js +1 -1
  77. package/src/locale/en/messages.po +91 -55
  78. package/src/types/enum.d.ts +1 -2
  79. package/src/types/enum.js +0 -1
  80. package/src/types/enum.ts +0 -1
  81. package/src/utils/AttentionMessages.d.ts +6 -1
  82. package/src/utils/AttentionMessages.jsx +22 -5
  83. package/src/utils/AttentionMessages.tsx +24 -3
  84. package/src/utils/RecommendationError.d.ts +0 -1
  85. package/src/utils/RecommendationError.jsx +1 -2
  86. package/src/utils/RecommendationError.tsx +0 -8
  87. package/src/utils/RecommendationUtils.js +1 -1
  88. package/src/utils/RecommendationUtils.ts +2 -2
  89. package/src/components/ExitModal.d.ts +0 -11
  90. package/src/components/ExitModal.jsx +0 -87
  91. package/src/components/ExitModal.tsx +0 -85
@@ -13,7 +13,7 @@ msgstr ""
13
13
  "Language-Team: \n"
14
14
  "Plural-Forms: \n"
15
15
 
16
- #: src/RecommendationScreen.tsx:154
16
+ #: src/RecommendationScreen.tsx:169
17
17
  msgid "Active Insulin"
18
18
  msgstr "Active Insulin"
19
19
 
@@ -21,12 +21,14 @@ msgstr "Active Insulin"
21
21
  msgid "Activity"
22
22
  msgstr "Activity"
23
23
 
24
- #: src/components/RecommendedCarbs.tsx:51
24
+ #: src/components/RecommendedCarbs.tsx:55
25
25
  msgid "Additional"
26
26
  msgstr "Additional"
27
27
 
28
- #: src/components/RecommendationModal.tsx:60
29
- #: src/components/RecommendationModal.tsx:74
28
+ #: src/components/LimitationMessage.tsx:14
29
+ #: src/components/RecommendationModal.tsx:66
30
+ #: src/components/RecommendedCarbs.tsx:30
31
+ #: src/components/RecommendedInsulin.tsx:34
30
32
  msgid "Attention"
31
33
  msgstr "Attention"
32
34
 
@@ -34,23 +36,31 @@ msgstr "Attention"
34
36
  msgid "Based on the selected activity your insulin recommendation is reduced by:"
35
37
  msgstr "Based on the selected activity your insulin recommendation is reduced by:"
36
38
 
37
- #: src/RecommendationScreen.tsx:155
39
+ #: src/RecommendationScreen.tsx:170
38
40
  msgid "Blood Glucose Level"
39
41
  msgstr "Blood Glucose Level"
40
42
 
41
- #: src/components/ExitModal.tsx:27
43
+ #: src/components/RecommendedCarbs.tsx:105
44
+ msgid "Carbohydrates"
45
+ msgstr "Carbohydrates"
46
+
47
+ #: src/RecommendationScreen.tsx:192
42
48
  msgid "Close calculation"
43
49
  msgstr "Close calculation"
44
50
 
45
- #: src/components/RecommendedCarbs.tsx:104
51
+ #: src/utils/AttentionMessages.tsx:29
52
+ msgid "Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity."
53
+ msgstr "Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity."
54
+
55
+ #: src/components/RecommendedCarbs.tsx:108
46
56
  msgid "Entered"
47
57
  msgstr "Entered"
48
58
 
49
- #: src/utils/RecommendationError.tsx:21
59
+ #: src/utils/RecommendationError.tsx:22
50
60
  msgid "Error. Hedia Calculator does not support an insulin dose greater than {0} units"
51
61
  msgstr "Error. Hedia Calculator does not support an insulin dose greater than {0} units"
52
62
 
53
- #: src/utils/RecommendationError.tsx:22
63
+ #: src/utils/RecommendationError.tsx:23
54
64
  msgid "Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours"
55
65
  msgstr "Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours"
56
66
 
@@ -58,19 +68,23 @@ msgstr "Error. Hedia Calculator does not support insulin recommendations with bo
58
68
  msgid "Error. Hedia Calculator does not support your activity intensity value"
59
69
  msgstr "Error. Hedia Calculator does not support your activity intensity value"
60
70
 
61
- #: src/utils/RecommendationError.tsx:19
71
+ #: src/utils/RecommendationError.tsx:15
72
+ msgid "Error. Hedia Calculator does not support your activity type value"
73
+ msgstr "Error. Hedia Calculator does not support your activity type value"
74
+
75
+ #: src/utils/RecommendationError.tsx:20
62
76
  msgid "Error. Hedia Calculator does not support your current blood glucose level."
63
77
  msgstr "Error. Hedia Calculator does not support your current blood glucose level."
64
78
 
65
- #: src/utils/RecommendationError.tsx:26
79
+ #: src/utils/RecommendationError.tsx:27
66
80
  msgid "Error. Hedia Calculator does not support your current blood glucose unit."
67
81
  msgstr "Error. Hedia Calculator does not support your current blood glucose unit."
68
82
 
69
- #: src/utils/RecommendationError.tsx:25
83
+ #: src/utils/RecommendationError.tsx:26
70
84
  msgid "Error. Hedia Calculator does not support your current language."
71
85
  msgstr "Error. Hedia Calculator does not support your current language."
72
86
 
73
- #: src/utils/RecommendationError.tsx:24
87
+ #: src/utils/RecommendationError.tsx:25
74
88
  msgid "Error. Hedia Calculator does not support your injection method."
75
89
  msgstr "Error. Hedia Calculator does not support your injection method."
76
90
 
@@ -82,27 +96,27 @@ msgstr "Error. Hedia Calculator only supports activities with a duration of maxi
82
96
  msgid "Error. Please verify that your activity settings are set up correctly."
83
97
  msgstr "Error. Please verify that your activity settings are set up correctly."
84
98
 
85
- #: src/utils/RecommendationError.tsx:15
99
+ #: src/utils/RecommendationError.tsx:16
86
100
  msgid "Error. Please verify that your activity target blood glucose value is correct."
87
101
  msgstr "Error. Please verify that your activity target blood glucose value is correct."
88
102
 
89
- #: src/utils/RecommendationError.tsx:17
103
+ #: src/utils/RecommendationError.tsx:18
90
104
  msgid "Error. Please verify that your insulin sensitivity value is correct."
91
105
  msgstr "Error. Please verify that your insulin sensitivity value is correct."
92
106
 
93
- #: src/utils/RecommendationError.tsx:18
107
+ #: src/utils/RecommendationError.tsx:19
94
108
  msgid "Error. Please verify that your insulin to carb ratio value is correct."
95
109
  msgstr "Error. Please verify that your insulin to carb ratio value is correct."
96
110
 
97
- #: src/utils/RecommendationError.tsx:20
111
+ #: src/utils/RecommendationError.tsx:21
98
112
  msgid "Error. Please verify that your target blood glucose value is correct."
99
113
  msgstr "Error. Please verify that your target blood glucose value is correct."
100
114
 
101
- #: src/utils/RecommendationError.tsx:23
115
+ #: src/utils/RecommendationError.tsx:24
102
116
  msgid "Error. Please verify your notifications settings."
103
117
  msgstr "Error. Please verify your notifications settings."
104
118
 
105
- #: src/components/RecommendedCarbs.tsx:103
119
+ #: src/components/RecommendedCarbs.tsx:104
106
120
  msgid "Food"
107
121
  msgstr "Food"
108
122
 
@@ -118,15 +132,15 @@ msgstr "Have you taken insulin within the last 4 hours?"
118
132
  msgid "Hedia Calculator does not support activities that finished more than 4 hours ago."
119
133
  msgstr "Hedia Calculator does not support activities that finished more than 4 hours ago."
120
134
 
121
- #: src/utils/RecommendationError.tsx:16
135
+ #: src/utils/RecommendationError.tsx:17
122
136
  msgid "Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present."
123
137
  msgstr "Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present."
124
138
 
125
- #: src/utils/AttentionMessages.tsx:38
139
+ #: src/utils/AttentionMessages.tsx:43
126
140
  msgid "Hedia does not support more than {0} units of insulin per calculation."
127
141
  msgstr "Hedia does not support more than {0} units of insulin per calculation."
128
142
 
129
- #: src/utils/AttentionMessages.tsx:36
143
+ #: src/utils/AttentionMessages.tsx:41
130
144
  msgid "Hedia doesn't support more than {0} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {1}% to {2} units for this calculation."
131
145
  msgstr "Hedia doesn't support more than {0} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {1}% to {2} units for this calculation."
132
146
 
@@ -138,11 +152,11 @@ msgstr "How are you feeling?"
138
152
  msgid "INSULIN{0}RECOMMENDATION"
139
153
  msgstr "INSULIN{0}RECOMMENDATION"
140
154
 
141
- #: src/utils/AttentionMessages.tsx:24
155
+ #: src/utils/AttentionMessages.tsx:28
142
156
  msgid "If it is possible, postpone your planned exercise."
143
157
  msgstr "If it is possible, postpone your planned exercise."
144
158
 
145
- #: src/components/RecommendationModal.tsx:41
159
+ #: src/components/RecommendationModal.tsx:42
146
160
  msgid "Instead of taking insulin"
147
161
  msgstr "Instead of taking insulin"
148
162
 
@@ -154,11 +168,11 @@ msgstr "Light"
154
168
  msgid "Moderate"
155
169
  msgstr "Moderate"
156
170
 
157
- #: src/utils/RecommendationError.tsx:27
158
- msgid "More than 15 minutes has passed since this calculation was started.{0}Please go through the calculation steps with new measurements to ensure a safe recommendation."
159
- msgstr "More than 15 minutes has passed since this calculation was started.{0}Please go through the calculation steps with new measurements to ensure a safe recommendation."
171
+ #: src/utils/AttentionMessages.tsx:44
172
+ msgid "More than 15 minutes has passed since this calculation was started."
173
+ msgstr "More than 15 minutes has passed since this calculation was started."
160
174
 
161
- #: src/components/RecommendationModal.tsx:21
175
+ #: src/components/RecommendationModal.tsx:22
162
176
  msgid "NO"
163
177
  msgstr "NO"
164
178
 
@@ -166,21 +180,31 @@ msgstr "NO"
166
180
  msgid "No"
167
181
  msgstr "No"
168
182
 
183
+ #: src/RecommendationScreen.tsx:196
184
+ msgid "No, return to dashboard"
185
+ msgstr "No, return to dashboard"
186
+
169
187
  #: src/components/Remeasure.tsx:35
170
188
  msgid "OFF"
171
189
  msgstr "OFF"
172
190
 
173
- #: src/components/RecommendationModal.tsx:18
174
- #: src/components/RecommendationModal.tsx:88
175
- #: src/components/RecommendationModal.tsx:92
191
+ #: src/components/LimitationMessage.tsx:21
192
+ #: src/components/RecommendationModal.tsx:19
193
+ #: src/components/RecommendationModal.tsx:73
194
+ #: src/components/RecommendedCarbs.tsx:32
195
+ #: src/components/RecommendedInsulin.tsx:36
176
196
  msgid "OK"
177
197
  msgstr "OK"
178
198
 
179
- #: src/components/activity/ActivityIntensity.tsx:10
180
- msgid "Post"
181
- msgstr "Post"
199
+ #: src/utils/AttentionMessages.tsx:45
200
+ msgid "Please go through the calculation steps with new measurements to ensure a safe recommendation."
201
+ msgstr "Please go through the calculation steps with new measurements to ensure a safe recommendation."
182
202
 
183
- #: src/components/RecommendedCarbs.tsx:48
203
+ #: src/utils/AttentionMessages.tsx:51
204
+ msgid "Recommendation from {day} at {time} was not transfered to your logbook.{0}Did you use the recommendation?"
205
+ msgstr "Recommendation from {day} at {time} was not transfered to your logbook.{0}Did you use the recommendation?"
206
+
207
+ #: src/components/RecommendedCarbs.tsx:50
184
208
  msgid "Recommended"
185
209
  msgstr "Recommended"
186
210
 
@@ -193,15 +217,23 @@ msgstr "Recommended amount of insulin"
193
217
  msgid "Remind me to remeasure in"
194
218
  msgstr "Remind me to remeasure in"
195
219
 
196
- #: src/components/ExitModal.tsx:17
220
+ #: src/RecommendationScreen.tsx:196
221
+ msgid "Return to dashboard"
222
+ msgstr "Return to dashboard"
223
+
224
+ #: src/RecommendationScreen.tsx:192
197
225
  msgid "Save data before closing?"
198
226
  msgstr "Save data before closing?"
199
227
 
200
- #: src/components/ExitModal.tsx:24
228
+ #: src/RecommendationScreen.tsx:192
201
229
  msgid "Save to logbook"
202
230
  msgstr "Save to logbook"
203
231
 
204
- #: src/components/RecommendedCarbs.tsx:73
232
+ #: src/RecommendationScreen.tsx:196
233
+ msgid "Start new calculation"
234
+ msgstr "Start new calculation"
235
+
236
+ #: src/components/RecommendedCarbs.tsx:77
205
237
  msgid "Total"
206
238
  msgstr "Total"
207
239
 
@@ -221,11 +253,11 @@ msgstr "Units"
221
253
  msgid "Untitled Activity"
222
254
  msgstr "Untitled Activity"
223
255
 
224
- #: src/components/RecommendationModal.tsx:31
256
+ #: src/components/RecommendationModal.tsx:32
225
257
  msgid "We recommend eating an additional:"
226
258
  msgstr "We recommend eating an additional:"
227
259
 
228
- #: src/components/RecommendationModal.tsx:47
260
+ #: src/components/RecommendationModal.tsx:48
229
261
  msgid "Would you like to add this to your current calculation?"
230
262
  msgstr "Would you like to add this to your current calculation?"
231
263
 
@@ -233,45 +265,49 @@ msgstr "Would you like to add this to your current calculation?"
233
265
  msgid "Yes"
234
266
  msgstr "Yes"
235
267
 
236
- #: src/utils/AttentionMessages.tsx:25
268
+ #: src/RecommendationScreen.tsx:196
269
+ msgid "Yes, save to logbook"
270
+ msgstr "Yes, save to logbook"
271
+
272
+ #: src/utils/AttentionMessages.tsx:30
237
273
  msgid "You have a high blood glucose level."
238
274
  msgstr "You have a high blood glucose level."
239
275
 
240
- #: src/utils/AttentionMessages.tsx:26
276
+ #: src/utils/AttentionMessages.tsx:31
241
277
  msgid "You should take rapid-acting insulin and measure ketones."
242
278
  msgstr "You should take rapid-acting insulin and measure ketones."
243
279
 
244
- #: src/utils/AttentionMessages.tsx:23
280
+ #: src/utils/AttentionMessages.tsx:27
245
281
  msgid "You will be reminded to measure your blood glucose level in 15 min."
246
282
  msgstr "You will be reminded to measure your blood glucose level in 15 min."
247
283
 
248
- #: src/utils/AttentionMessages.tsx:22
284
+ #: src/utils/AttentionMessages.tsx:26
249
285
  msgid "Your blood glucose level is very low."
250
286
  msgstr "Your blood glucose level is very low."
251
287
 
252
- #: src/utils/AttentionMessages.tsx:21
288
+ #: src/utils/AttentionMessages.tsx:25
253
289
  msgid "Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention."
254
290
  msgstr "Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention."
255
291
 
256
- #: src/utils/AttentionMessages.tsx:27
292
+ #: src/utils/AttentionMessages.tsx:32
257
293
  msgid "Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons. Hedia never recommends more than {1} units of insulin per calculation."
258
294
  msgstr "Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons. Hedia never recommends more than {1} units of insulin per calculation."
259
295
 
260
- #: src/utils/AttentionMessages.tsx:29
296
+ #: src/utils/AttentionMessages.tsx:34
261
297
  msgid "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 {2} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {3}% to {4}."
262
298
  msgstr "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 {2} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {3}% to {4}."
263
299
 
264
- #: src/components/ExitModal.tsx:19
300
+ #: src/RecommendationScreen.tsx:192
265
301
  msgid "Your saved data will be used for future calculations."
266
302
  msgstr "Your saved data will be used for future calculations."
267
303
 
268
- #: src/components/RecommendedCarbs.tsx:65
269
- #: src/components/RecommendedCarbs.tsx:75
270
- #: src/components/RecommendedCarbs.tsx:106
271
- msgid "g carbs"
272
- msgstr "g carbs"
304
+ #: src/components/RecommendedCarbs.tsx:69
305
+ #: src/components/RecommendedCarbs.tsx:79
306
+ #: src/components/RecommendedCarbs.tsx:110
307
+ msgid "grams"
308
+ msgstr "grams"
273
309
 
274
- #: src/components/RecommendationModal.tsx:37
310
+ #: src/components/RecommendationModal.tsx:38
275
311
  msgid "grams of carbohydrates"
276
312
  msgstr "grams of carbohydrates"
277
313
 
@@ -283,6 +319,6 @@ msgstr "hours"
283
319
  msgid "min"
284
320
  msgstr "min"
285
321
 
286
- #: src/RecommendationScreen.tsx:154
322
+ #: src/RecommendationScreen.tsx:169
287
323
  msgid "units"
288
324
  msgstr "units"
@@ -47,8 +47,7 @@ export declare enum RecommendationErrorEnum {
47
47
  UserReminder = 13,
48
48
  Language = 14,
49
49
  InjectionMethod = 15,
50
- Unit = 16,
51
- TimeoutLimit = 17
50
+ Unit = 16
52
51
  }
53
52
  export declare enum Milliseconds {
54
53
  Second = 1000,
package/src/types/enum.js CHANGED
@@ -58,7 +58,6 @@ var RecommendationErrorEnum;
58
58
  RecommendationErrorEnum[RecommendationErrorEnum["Language"] = 14] = "Language";
59
59
  RecommendationErrorEnum[RecommendationErrorEnum["InjectionMethod"] = 15] = "InjectionMethod";
60
60
  RecommendationErrorEnum[RecommendationErrorEnum["Unit"] = 16] = "Unit";
61
- RecommendationErrorEnum[RecommendationErrorEnum["TimeoutLimit"] = 17] = "TimeoutLimit";
62
61
  })(RecommendationErrorEnum = exports.RecommendationErrorEnum || (exports.RecommendationErrorEnum = {}));
63
62
  var Milliseconds;
64
63
  (function (Milliseconds) {
package/src/types/enum.ts CHANGED
@@ -53,7 +53,6 @@ export enum RecommendationErrorEnum {
53
53
  Language,
54
54
  InjectionMethod,
55
55
  Unit,
56
- TimeoutLimit,
57
56
  }
58
57
 
59
58
  export enum Milliseconds {
@@ -1,3 +1,4 @@
1
+ import "moment/locale/da";
1
2
  export declare class AttentionMessage {
2
3
  static SevereHypoglycemia: () => string;
3
4
  static Hypoglycemia: () => string;
@@ -7,15 +8,19 @@ export declare class AttentionMessage {
7
8
  static SevereHyperglycemia: () => string;
8
9
  static SevereHyperglycemiaActivity: () => string;
9
10
  }
10
- export declare function addPostponeActivityMessage(message: AttentionMessage): string;
11
+ export declare function addPostponeActivityMessageUnder5MMOL(message: AttentionMessage): string;
11
12
  export declare class Messages {
12
13
  static VeryLowBGL: () => string;
13
14
  static LowBGL: () => string;
14
15
  static Reminder15Minutes: () => string;
15
16
  static PostponePhysicalActivity: () => string;
17
+ static PostponePhysicalActivityUnder5MMOL: () => string;
16
18
  static HighBGL: () => string;
17
19
  static InsulinKetones: () => string;
18
20
  static RecommendationWasLimited: () => string;
19
21
  static RecommendationWasLimitedActivity: (activityReduction: number) => string;
20
22
  static InsulinInputWasLimited: (activityReduction?: number) => string;
23
+ static TimeoutPrompTitle: () => string;
24
+ static TimeoutRecommendationNotVisible: () => string;
25
+ static TimeoutRecommendationVisible: (date: Date) => string;
21
26
  }
@@ -18,25 +18,32 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
21
24
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.Messages = exports.addPostponeActivityMessage = exports.AttentionMessage = void 0;
25
+ exports.Messages = exports.addPostponeActivityMessageUnder5MMOL = exports.AttentionMessage = void 0;
23
26
  const Calculator = __importStar(require("@hedia/recommendation-calculator"));
24
27
  const macro_1 = require("@lingui/macro");
28
+ const moment_1 = __importDefault(require("moment"));
29
+ // tslint:disable-next-line: no-import-side-effect
30
+ require("moment/locale/da");
25
31
  const i18nUtils_1 = require("../locale/i18nUtils");
32
+ const enum_1 = require("../types/enum");
26
33
  class AttentionMessage {
27
34
  }
28
35
  exports.AttentionMessage = AttentionMessage;
29
36
  AttentionMessage.SevereHypoglycemia = () => `${Messages.VeryLowBGL()}${`\n`}${Messages.Reminder15Minutes()}`;
30
37
  AttentionMessage.Hypoglycemia = () => `${Messages.LowBGL()}${`\n`}${Messages.Reminder15Minutes()}`;
31
38
  AttentionMessage.MildHypoglycemia = () => Messages.Reminder15Minutes();
32
- AttentionMessage.NormoglycemiaActivityUnder5MMOL = () => Messages.PostponePhysicalActivity();
39
+ AttentionMessage.NormoglycemiaActivityUnder5MMOL = () => Messages.PostponePhysicalActivityUnder5MMOL();
33
40
  AttentionMessage.HyperglycemiaActivity = () => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}${Messages.Reminder15Minutes()}${`\n`}${Messages.PostponePhysicalActivity()}`;
34
41
  AttentionMessage.SevereHyperglycemia = () => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}`;
35
42
  AttentionMessage.SevereHyperglycemiaActivity = () => AttentionMessage.HyperglycemiaActivity();
36
- function addPostponeActivityMessage(message) {
37
- return `${message}${`\n`}${Messages.PostponePhysicalActivity()}`;
43
+ function addPostponeActivityMessageUnder5MMOL(message) {
44
+ return `${message}${`\n`}${Messages.PostponePhysicalActivityUnder5MMOL()}`;
38
45
  }
39
- exports.addPostponeActivityMessage = addPostponeActivityMessage;
46
+ exports.addPostponeActivityMessageUnder5MMOL = addPostponeActivityMessageUnder5MMOL;
40
47
  function getLimitedValue(reduction) {
41
48
  return Calculator.SAFETY_INSULIN_LIMIT - Calculator.SAFETY_INSULIN_LIMIT * reduction;
42
49
  }
@@ -47,6 +54,7 @@ Messages.VeryLowBGL = () => i18nUtils_1.i18n._(macro_1.t `Your blood glucose lev
47
54
  Messages.LowBGL = () => i18nUtils_1.i18n._(macro_1.t `Your blood glucose level is very low.`);
48
55
  Messages.Reminder15Minutes = () => i18nUtils_1.i18n._(macro_1.t `You will be reminded to measure your blood glucose level in 15 min.`);
49
56
  Messages.PostponePhysicalActivity = () => i18nUtils_1.i18n._(macro_1.t `If it is possible, postpone your planned exercise.`);
57
+ Messages.PostponePhysicalActivityUnder5MMOL = () => i18nUtils_1.i18n._(macro_1.t `Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity.`);
50
58
  Messages.HighBGL = () => i18nUtils_1.i18n._(macro_1.t `You have a high blood glucose level.`);
51
59
  Messages.InsulinKetones = () => i18nUtils_1.i18n._(macro_1.t `You should take rapid-acting insulin and measure ketones.`);
52
60
  Messages.RecommendationWasLimited = () => i18nUtils_1.i18n._(macro_1.t `Your recommendation would have been higher than ${Calculator.SAFETY_INSULIN_LIMIT} units of insulin, but it has been limited for safety reasons.
@@ -61,3 +69,12 @@ Messages.InsulinInputWasLimited = (activityReduction) => activityReduction
61
69
  ? i18nUtils_1.i18n._(macro_1.t `Hedia doesn't support more than ${Calculator.SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by
62
70
  ${(activityReduction * 100).toFixed(0)}% to ${getLimitedValue(activityReduction)} units for this calculation.`)
63
71
  : i18nUtils_1.i18n._(macro_1.t `Hedia does not support more than ${Calculator.SAFETY_INSULIN_LIMIT} units of insulin per calculation.`);
72
+ Messages.TimeoutPrompTitle = () => i18nUtils_1.i18n._(macro_1.t `More than 15 minutes has passed since this calculation was started.`);
73
+ Messages.TimeoutRecommendationNotVisible = () => i18nUtils_1.i18n._(macro_1.t `Please go through the calculation steps with new measurements to ensure a safe recommendation.`);
74
+ Messages.TimeoutRecommendationVisible = (date) => {
75
+ moment_1.default.locale(i18nUtils_1.i18n.language);
76
+ const format = moment_1.default.locale() === enum_1.Language.da ? `Do MMMM` : `MMMM Do`;
77
+ const day = moment_1.default(date).format(format);
78
+ const time = moment_1.default(date).format(`HH:mm`);
79
+ return i18nUtils_1.i18n._(macro_1.t `Recommendation from ${day} at ${time} was not transfered to your logbook.${`\n`}Did you use the recommendation?`);
80
+ };
@@ -1,20 +1,24 @@
1
1
  import * as Calculator from "@hedia/recommendation-calculator";
2
2
  import { t } from "@lingui/macro";
3
+ import moment from "moment";
4
+ // tslint:disable-next-line: no-import-side-effect
5
+ import "moment/locale/da";
3
6
  import { i18n } from "../locale/i18nUtils";
7
+ import { Language } from "../types/enum";
4
8
 
5
9
  export class AttentionMessage {
6
10
  public static SevereHypoglycemia = (): string => `${Messages.VeryLowBGL()}${`\n`}${Messages.Reminder15Minutes()}`;
7
11
  public static Hypoglycemia = (): string => `${Messages.LowBGL()}${`\n`}${Messages.Reminder15Minutes()}`;
8
12
  public static MildHypoglycemia = (): string => Messages.Reminder15Minutes();
9
- public static NormoglycemiaActivityUnder5MMOL = (): string => Messages.PostponePhysicalActivity();
13
+ public static NormoglycemiaActivityUnder5MMOL = (): string => Messages.PostponePhysicalActivityUnder5MMOL();
10
14
  public static HyperglycemiaActivity = (): string =>
11
15
  `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}${Messages.Reminder15Minutes()}${`\n`}${Messages.PostponePhysicalActivity()}`;
12
16
  public static SevereHyperglycemia = (): string => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}`;
13
17
  public static SevereHyperglycemiaActivity = (): string => AttentionMessage.HyperglycemiaActivity();
14
18
  }
15
19
 
16
- export function addPostponeActivityMessage(message: AttentionMessage): string {
17
- return `${message}${`\n`}${Messages.PostponePhysicalActivity()}`;
20
+ export function addPostponeActivityMessageUnder5MMOL(message: AttentionMessage): string {
21
+ return `${message}${`\n`}${Messages.PostponePhysicalActivityUnder5MMOL()}`;
18
22
  }
19
23
  function getLimitedValue(reduction: number): number {
20
24
  return Calculator.SAFETY_INSULIN_LIMIT - Calculator.SAFETY_INSULIN_LIMIT * reduction;
@@ -30,6 +34,10 @@ export class Messages {
30
34
  i18n._(t`You will be reminded to measure your blood glucose level in 15 min.`);
31
35
  public static PostponePhysicalActivity = (): string =>
32
36
  i18n._(t`If it is possible, postpone your planned exercise.`);
37
+ public static PostponePhysicalActivityUnder5MMOL = (): string =>
38
+ i18n._(
39
+ t`Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity.`,
40
+ );
33
41
  public static HighBGL = (): string => i18n._(t`You have a high blood glucose level.`);
34
42
  public static InsulinKetones = (): string => i18n._(t`You should take rapid-acting insulin and measure ketones.`);
35
43
  public static RecommendationWasLimited = (): string =>
@@ -57,4 +65,17 @@ export class Messages {
57
65
  : i18n._(
58
66
  t`Hedia does not support more than ${Calculator.SAFETY_INSULIN_LIMIT} units of insulin per calculation.`,
59
67
  );
68
+ public static TimeoutPrompTitle = (): string =>
69
+ i18n._(t`More than 15 minutes has passed since this calculation was started.`);
70
+ public static TimeoutRecommendationNotVisible = (): string =>
71
+ i18n._(t`Please go through the calculation steps with new measurements to ensure a safe recommendation.`);
72
+ public static TimeoutRecommendationVisible = (date: Date): string => {
73
+ moment.locale(i18n.language);
74
+ const format = moment.locale() === Language.da ? `Do MMMM` : `MMMM Do`;
75
+ const day = moment(date).format(format);
76
+ const time = moment(date).format(`HH:mm`);
77
+ return i18n._(
78
+ t`Recommendation from ${day} at ${time} was not transfered to your logbook.${`\n`}Did you use the recommendation?`,
79
+ );
80
+ };
60
81
  }
@@ -20,4 +20,3 @@ export declare const UserReminderError: () => RecommendationError;
20
20
  export declare const InjectionMethodError: () => RecommendationError;
21
21
  export declare const LanguageError: () => RecommendationError;
22
22
  export declare const UnitError: () => RecommendationError;
23
- export declare const TimeoutLimitError: () => RecommendationError;
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.TimeoutLimitError = exports.UnitError = exports.LanguageError = exports.InjectionMethodError = exports.UserReminderError = exports.BolusInsulinSecondsPassedError = exports.BolusInsulinDoseError = exports.TargetBGLError = exports.CurrentBGLError = exports.InsulinToCarbsRatioError = exports.InsulinSensitivityError = exports.CarbohydrateLimitError = exports.ActivityTargetBGLError = exports.ActivityTypeError = exports.ActivityIntensityError = exports.ActivityDateError = exports.ActivityDurationError = exports.ActivitySettingsError = exports.RecommendationError = void 0;
22
+ exports.UnitError = exports.LanguageError = exports.InjectionMethodError = exports.UserReminderError = exports.BolusInsulinSecondsPassedError = exports.BolusInsulinDoseError = exports.TargetBGLError = exports.CurrentBGLError = exports.InsulinToCarbsRatioError = exports.InsulinSensitivityError = exports.CarbohydrateLimitError = exports.ActivityTargetBGLError = exports.ActivityTypeError = exports.ActivityIntensityError = exports.ActivityDateError = exports.ActivityDurationError = exports.ActivitySettingsError = exports.RecommendationError = void 0;
23
23
  const Calculator = __importStar(require("@hedia/recommendation-calculator"));
24
24
  const macro_1 = require("@lingui/macro");
25
25
  const i18nUtils_1 = require("../locale/i18nUtils");
@@ -48,4 +48,3 @@ exports.UserReminderError = () => new RecommendationError(i18nUtils_1.i18n._(mac
48
48
  exports.InjectionMethodError = () => new RecommendationError(i18nUtils_1.i18n._(macro_1.t `Error. Hedia Calculator does not support your injection method.`), enum_1.RecommendationErrorEnum.InjectionMethod);
49
49
  exports.LanguageError = () => new RecommendationError(i18nUtils_1.i18n._(macro_1.t `Error. Hedia Calculator does not support your current language.`), enum_1.RecommendationErrorEnum.Language);
50
50
  exports.UnitError = () => new RecommendationError(i18nUtils_1.i18n._(macro_1.t `Error. Hedia Calculator does not support your current blood glucose unit.`), enum_1.RecommendationErrorEnum.Unit);
51
- exports.TimeoutLimitError = () => new RecommendationError(i18nUtils_1.i18n._(macro_1.t `More than 15 minutes has passed since this calculation was started.${`\n`}Please go through the calculation steps with new measurements to ensure a safe recommendation.`), enum_1.RecommendationErrorEnum.TimeoutLimit);
@@ -115,11 +115,3 @@ export const UnitError = (): RecommendationError =>
115
115
  i18n._(t`Error. Hedia Calculator does not support your current blood glucose unit.`),
116
116
  RecommendationErrorEnum.Unit,
117
117
  );
118
-
119
- export const TimeoutLimitError = (): RecommendationError =>
120
- new RecommendationError(
121
- i18n._(
122
- t`More than 15 minutes has passed since this calculation was started.${`\n`}Please go through the calculation steps with new measurements to ensure a safe recommendation.`,
123
- ),
124
- RecommendationErrorEnum.TimeoutLimit,
125
- );
@@ -74,7 +74,7 @@ function getAttentionMessage(bgLevel, activity) {
74
74
  case enum_1.BgLevel.Hypoglycemia:
75
75
  case enum_1.BgLevel.MildHypoglycemia:
76
76
  return isActivityWithin15Minutes(activity)
77
- ? AttentionMessages_1.addPostponeActivityMessage(AttentionMessages_1.AttentionMessage[enum_1.BgLevel[bgLevel]]())
77
+ ? AttentionMessages_1.addPostponeActivityMessageUnder5MMOL(AttentionMessages_1.AttentionMessage[enum_1.BgLevel[bgLevel]]())
78
78
  : AttentionMessages_1.AttentionMessage[enum_1.BgLevel[bgLevel]]();
79
79
  case enum_1.BgLevel.Hyperglycemia:
80
80
  return isActivityWithin15Minutes(activity) ? AttentionMessages_1.AttentionMessage.HyperglycemiaActivity() : undefined;
@@ -2,7 +2,7 @@ import { IActivityParams } from "@hedia/recommendation-calculator/src/Recommenda
2
2
  import moment from "moment";
3
3
  import { BgLevel, RecommendationReminders } from "../types/enum";
4
4
  import { logbookEntry } from "../types/types";
5
- import { addPostponeActivityMessage, AttentionMessage, Messages } from "./AttentionMessages";
5
+ import { addPostponeActivityMessageUnder5MMOL, AttentionMessage, Messages } from "./AttentionMessages";
6
6
  import { SEVERE_HYPERGLYCEMIA_START_MMOL } from "./Constants";
7
7
  import { CurrentBGLError } from "./RecommendationError";
8
8
 
@@ -81,7 +81,7 @@ export function getAttentionMessage(bgLevel: BgLevel, activity: IActivityParams)
81
81
  case BgLevel.Hypoglycemia:
82
82
  case BgLevel.MildHypoglycemia:
83
83
  return isActivityWithin15Minutes(activity)
84
- ? addPostponeActivityMessage(AttentionMessage[BgLevel[bgLevel]]())
84
+ ? addPostponeActivityMessageUnder5MMOL(AttentionMessage[BgLevel[bgLevel]]())
85
85
  : AttentionMessage[BgLevel[bgLevel]]();
86
86
 
87
87
  case BgLevel.Hyperglycemia:
@@ -1,11 +0,0 @@
1
- import * as React from "react";
2
- interface IModalProps {
3
- onSave(): void;
4
- onCloseCalculation(): void;
5
- onClose(): void;
6
- }
7
- export default class ExitModal extends React.Component<IModalProps> {
8
- constructor(props: IModalProps);
9
- render(): JSX.Element;
10
- }
11
- export {};