@quesmed/types-rn 2.5.106 → 2.5.108
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 +9 -0
- package/models/OsceStation.js +9 -1
- package/models/Picture.d.ts +2 -11
- package/package.json +1 -1
- package/resolvers/fragments/osce.js +2 -0
- package/utils/commonFunctions.js +23 -13
package/models/OsceStation.d.ts
CHANGED
|
@@ -31,6 +31,13 @@ export declare enum EOsceType {
|
|
|
31
31
|
INTERPRETATION = 5,
|
|
32
32
|
ABCDE = 6
|
|
33
33
|
}
|
|
34
|
+
export declare enum EStationPictureType {
|
|
35
|
+
ALL = 0,
|
|
36
|
+
ACTOR = 1,
|
|
37
|
+
CANDIDATE = 2,
|
|
38
|
+
EXAMINER = 3,
|
|
39
|
+
WALKTHROUGH = 4
|
|
40
|
+
}
|
|
34
41
|
export interface IOsceStation {
|
|
35
42
|
id: Id;
|
|
36
43
|
createdAt: number | Date;
|
|
@@ -45,6 +52,8 @@ export interface IOsceStation {
|
|
|
45
52
|
actorBrief: string;
|
|
46
53
|
explanation: string;
|
|
47
54
|
marks: IOsceStationMark[];
|
|
55
|
+
totalMarks: number;
|
|
56
|
+
completedMarks: number;
|
|
48
57
|
topics?: ITopic[];
|
|
49
58
|
candidatePictures?: IPicture[];
|
|
50
59
|
actorPictures?: IPicture[];
|
package/models/OsceStation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OSCE_GLOBAL_RATING = exports.EOsceType = void 0;
|
|
3
|
+
exports.OSCE_GLOBAL_RATING = exports.EStationPictureType = exports.EOsceType = void 0;
|
|
4
4
|
var EOsceType;
|
|
5
5
|
(function (EOsceType) {
|
|
6
6
|
EOsceType[EOsceType["ALL"] = 0] = "ALL";
|
|
@@ -11,6 +11,14 @@ var EOsceType;
|
|
|
11
11
|
EOsceType[EOsceType["INTERPRETATION"] = 5] = "INTERPRETATION";
|
|
12
12
|
EOsceType[EOsceType["ABCDE"] = 6] = "ABCDE";
|
|
13
13
|
})(EOsceType = exports.EOsceType || (exports.EOsceType = {}));
|
|
14
|
+
var EStationPictureType;
|
|
15
|
+
(function (EStationPictureType) {
|
|
16
|
+
EStationPictureType[EStationPictureType["ALL"] = 0] = "ALL";
|
|
17
|
+
EStationPictureType[EStationPictureType["ACTOR"] = 1] = "ACTOR";
|
|
18
|
+
EStationPictureType[EStationPictureType["CANDIDATE"] = 2] = "CANDIDATE";
|
|
19
|
+
EStationPictureType[EStationPictureType["EXAMINER"] = 3] = "EXAMINER";
|
|
20
|
+
EStationPictureType[EStationPictureType["WALKTHROUGH"] = 4] = "WALKTHROUGH";
|
|
21
|
+
})(EStationPictureType = exports.EStationPictureType || (exports.EStationPictureType = {}));
|
|
14
22
|
exports.OSCE_GLOBAL_RATING = {
|
|
15
23
|
[EOsceType.ABCDE]: `1. Fail - The candidate did not perform large parts of the scenario to the required standard
|
|
16
24
|
2. Borderline - It is not clear whether the candidate demonstrated acceptable performance: either the whole task was performed slightly below passing level or there were some key errors or omissions
|
package/models/Picture.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EStationPictureType } from './OsceStation';
|
|
1
2
|
import { ITopic } from './Topic';
|
|
2
3
|
import { Id } from './Type';
|
|
3
4
|
export interface IPicture {
|
|
@@ -33,18 +34,8 @@ export interface IStationPicture {
|
|
|
33
34
|
pictureId: Id;
|
|
34
35
|
picture: IPicture;
|
|
35
36
|
pictureIdx: number;
|
|
36
|
-
}
|
|
37
|
-
export interface IOsceActorPicture extends IStationPicture {
|
|
38
|
-
osceStationId: Id;
|
|
39
|
-
}
|
|
40
|
-
export interface IOsceCandidatePicture extends IStationPicture {
|
|
41
|
-
osceStationId: Id;
|
|
42
|
-
}
|
|
43
|
-
export interface IOsceExaminerPicture extends IStationPicture {
|
|
44
|
-
osceStationId: Id;
|
|
45
|
-
}
|
|
46
|
-
export interface IOsceWalkthroughPicture extends IStationPicture {
|
|
47
37
|
osceStationId: Id;
|
|
38
|
+
type: EStationPictureType;
|
|
48
39
|
}
|
|
49
40
|
export interface IQuestionPicture {
|
|
50
41
|
id: Id;
|
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;
|