@quesmed/types 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/dist/cjs/models/OsceStation.d.ts +9 -0
- package/dist/cjs/models/OsceStation.js +9 -1
- package/dist/cjs/models/Picture.d.ts +2 -11
- package/dist/cjs/resolvers/fragments/osce.js +2 -0
- package/dist/cjs/utils/commonFunctions.js +23 -13
- package/dist/mjs/models/OsceStation.d.ts +9 -0
- package/dist/mjs/models/OsceStation.js +8 -0
- package/dist/mjs/models/Picture.d.ts +2 -11
- package/dist/mjs/resolvers/fragments/osce.js +2 -0
- package/dist/mjs/utils/commonFunctions.js +23 -13
- package/package.json +1 -1
|
@@ -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[];
|
|
@@ -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
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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[];
|
|
@@ -8,6 +8,14 @@ export var EOsceType;
|
|
|
8
8
|
EOsceType[EOsceType["INTERPRETATION"] = 5] = "INTERPRETATION";
|
|
9
9
|
EOsceType[EOsceType["ABCDE"] = 6] = "ABCDE";
|
|
10
10
|
})(EOsceType || (EOsceType = {}));
|
|
11
|
+
export var EStationPictureType;
|
|
12
|
+
(function (EStationPictureType) {
|
|
13
|
+
EStationPictureType[EStationPictureType["ALL"] = 0] = "ALL";
|
|
14
|
+
EStationPictureType[EStationPictureType["ACTOR"] = 1] = "ACTOR";
|
|
15
|
+
EStationPictureType[EStationPictureType["CANDIDATE"] = 2] = "CANDIDATE";
|
|
16
|
+
EStationPictureType[EStationPictureType["EXAMINER"] = 3] = "EXAMINER";
|
|
17
|
+
EStationPictureType[EStationPictureType["WALKTHROUGH"] = 4] = "WALKTHROUGH";
|
|
18
|
+
})(EStationPictureType || (EStationPictureType = {}));
|
|
11
19
|
export const OSCE_GLOBAL_RATING = {
|
|
12
20
|
[EOsceType.ABCDE]: `1. Fail - The candidate did not perform large parts of the scenario to the required standard
|
|
13
21
|
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
|
|
@@ -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;
|
|
@@ -51,7 +51,9 @@ export function formatPrescribeAnswer(baseAnswer) {
|
|
|
51
51
|
value: baseAnswer.duration?.value ?? '',
|
|
52
52
|
}),
|
|
53
53
|
});
|
|
54
|
+
// DRUG
|
|
54
55
|
obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
|
|
56
|
+
// ROUTE
|
|
55
57
|
obj.route.value = obj.route.value
|
|
56
58
|
.toLowerCase()
|
|
57
59
|
.replace(/\s/g, '')
|
|
@@ -80,20 +82,26 @@ export function formatPrescribeAnswer(baseAnswer) {
|
|
|
80
82
|
else if (obj.route.value.includes('rectal')) {
|
|
81
83
|
obj.route.value = 'pr';
|
|
82
84
|
}
|
|
85
|
+
// UNITS
|
|
83
86
|
obj.units.value = obj.units.value.toLowerCase().replace(/\s/g, '');
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
switch (obj.units.value) {
|
|
88
|
+
case 'milligram':
|
|
89
|
+
case 'milligrams':
|
|
90
|
+
obj.units.value = 'mg';
|
|
91
|
+
break;
|
|
92
|
+
case 'microgram':
|
|
93
|
+
case 'micrograms':
|
|
94
|
+
obj.units.value = 'mcg';
|
|
95
|
+
break;
|
|
96
|
+
case 'gram':
|
|
97
|
+
case 'grams':
|
|
98
|
+
obj.units.value = 'g';
|
|
99
|
+
break;
|
|
100
|
+
case 'unit':
|
|
101
|
+
obj.units.value = 'units';
|
|
102
|
+
break;
|
|
96
103
|
}
|
|
104
|
+
// DURATION
|
|
97
105
|
let m;
|
|
98
106
|
const durationMatches = new Set();
|
|
99
107
|
while ((m = floatRegex.exec(obj.duration.value)) !== null) {
|
|
@@ -107,6 +115,7 @@ export function formatPrescribeAnswer(baseAnswer) {
|
|
|
107
115
|
durationMatches.add(durationWords.toString());
|
|
108
116
|
}
|
|
109
117
|
obj.duration.value = [...durationMatches].filter((x) => !!x).join(',');
|
|
118
|
+
// FREQUENCY
|
|
110
119
|
const orgFrequencyValue = obj.frequency.value.toLowerCase();
|
|
111
120
|
const timesPerDay = obj.frequency.value.includes('times per day') ||
|
|
112
121
|
obj.frequency.value.includes('times a day');
|
|
@@ -237,7 +246,8 @@ export function correctMark(mark) {
|
|
|
237
246
|
const doseCorrect = answer.dose.display || answer.dose.value === attempt.dose.value;
|
|
238
247
|
const drugCorrect = answer.drug.display || answer.drug.value === attempt.drug.value;
|
|
239
248
|
const durationCorrect = answer.duration.display ||
|
|
240
|
-
answer.duration.value.split(',').includes(attempt.duration.value)
|
|
249
|
+
answer.duration.value.split(',').includes(attempt.duration.value) ||
|
|
250
|
+
answer.duration.value === attempt.duration.value;
|
|
241
251
|
const frequencyCorrect = answer.frequency.display ||
|
|
242
252
|
answer.frequency.value === attempt.frequency.value;
|
|
243
253
|
const routeCorrect = answer.route.display || answer.route.value === attempt.route.value;
|