@quesmed/types-rn 2.5.106 → 2.5.107
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.
package/models/OsceStation.d.ts
CHANGED
package/package.json
CHANGED
package/utils/commonFunctions.js
CHANGED
|
@@ -55,7 +55,9 @@ function formatPrescribeAnswer(baseAnswer) {
|
|
|
55
55
|
value: baseAnswer.duration?.value ?? '',
|
|
56
56
|
}),
|
|
57
57
|
});
|
|
58
|
+
// DRUG
|
|
58
59
|
obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
|
|
60
|
+
// ROUTE
|
|
59
61
|
obj.route.value = obj.route.value
|
|
60
62
|
.toLowerCase()
|
|
61
63
|
.replace(/\s/g, '')
|
|
@@ -84,20 +86,26 @@ function formatPrescribeAnswer(baseAnswer) {
|
|
|
84
86
|
else if (obj.route.value.includes('rectal')) {
|
|
85
87
|
obj.route.value = 'pr';
|
|
86
88
|
}
|
|
89
|
+
// UNITS
|
|
87
90
|
obj.units.value = obj.units.value.toLowerCase().replace(/\s/g, '');
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
switch (obj.units.value) {
|
|
92
|
+
case 'milligram':
|
|
93
|
+
case 'milligrams':
|
|
94
|
+
obj.units.value = 'mg';
|
|
95
|
+
break;
|
|
96
|
+
case 'microgram':
|
|
97
|
+
case 'micrograms':
|
|
98
|
+
obj.units.value = 'mcg';
|
|
99
|
+
break;
|
|
100
|
+
case 'gram':
|
|
101
|
+
case 'grams':
|
|
102
|
+
obj.units.value = 'g';
|
|
103
|
+
break;
|
|
104
|
+
case 'unit':
|
|
105
|
+
obj.units.value = 'units';
|
|
106
|
+
break;
|
|
100
107
|
}
|
|
108
|
+
// DURATION
|
|
101
109
|
let m;
|
|
102
110
|
const durationMatches = new Set();
|
|
103
111
|
while ((m = floatRegex.exec(obj.duration.value)) !== null) {
|
|
@@ -111,6 +119,7 @@ function formatPrescribeAnswer(baseAnswer) {
|
|
|
111
119
|
durationMatches.add(durationWords.toString());
|
|
112
120
|
}
|
|
113
121
|
obj.duration.value = [...durationMatches].filter((x) => !!x).join(',');
|
|
122
|
+
// FREQUENCY
|
|
114
123
|
const orgFrequencyValue = obj.frequency.value.toLowerCase();
|
|
115
124
|
const timesPerDay = obj.frequency.value.includes('times per day') ||
|
|
116
125
|
obj.frequency.value.includes('times a day');
|
|
@@ -242,7 +251,8 @@ function correctMark(mark) {
|
|
|
242
251
|
const doseCorrect = answer.dose.display || answer.dose.value === attempt.dose.value;
|
|
243
252
|
const drugCorrect = answer.drug.display || answer.drug.value === attempt.drug.value;
|
|
244
253
|
const durationCorrect = answer.duration.display ||
|
|
245
|
-
answer.duration.value.split(',').includes(attempt.duration.value)
|
|
254
|
+
answer.duration.value.split(',').includes(attempt.duration.value) ||
|
|
255
|
+
answer.duration.value === attempt.duration.value;
|
|
246
256
|
const frequencyCorrect = answer.frequency.display ||
|
|
247
257
|
answer.frequency.value === attempt.frequency.value;
|
|
248
258
|
const routeCorrect = answer.route.display || answer.route.value === attempt.route.value;
|