@quesmed/types 1.4.9 → 1.4.13
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/package.json +1 -1
- package/resolvers/fragments/osce.js +0 -4
- package/resolvers/fragments/osce.mjs +0 -4
- package/resolvers/mutation/restricted/osce.js +17 -0
- package/resolvers/mutation/restricted/osce.mjs +17 -0
- package/resolvers/query/restricted/osce.js +12 -0
- package/resolvers/query/restricted/osce.mjs +12 -0
- package/utils/commonFunctions.d.ts +1 -1
- package/utils/commonFunctions.js +2 -1
- package/utils/commonFunctions.mjs +2 -1
- package/utils/uuid4.js +3 -8
- package/utils/uuid4.mjs +3 -8
package/package.json
CHANGED
|
@@ -98,7 +98,6 @@ exports.OSCE_MARKSHEET_MARK_FIELDS = (0, client_1.gql) `
|
|
|
98
98
|
}
|
|
99
99
|
`;
|
|
100
100
|
exports.OSCE_MARKSHEET_FIELDS = (0, client_1.gql) `
|
|
101
|
-
${exports.OSCE_STATION_FIELDS}
|
|
102
101
|
${exports.OSCE_MARKSHEET_MARK_FIELDS}
|
|
103
102
|
${exports.OSCE_MARKSHEET_USER_FIELDS}
|
|
104
103
|
fragment OsceMarksheetFields on OsceMarksheet {
|
|
@@ -107,9 +106,6 @@ exports.OSCE_MARKSHEET_FIELDS = (0, client_1.gql) `
|
|
|
107
106
|
updatedAt
|
|
108
107
|
timeTaken
|
|
109
108
|
osceStationId
|
|
110
|
-
osceStation {
|
|
111
|
-
...OsceStationFields
|
|
112
|
-
}
|
|
113
109
|
userId
|
|
114
110
|
solo
|
|
115
111
|
role
|
|
@@ -95,7 +95,6 @@ export const OSCE_MARKSHEET_MARK_FIELDS = gql `
|
|
|
95
95
|
}
|
|
96
96
|
`;
|
|
97
97
|
export const OSCE_MARKSHEET_FIELDS = gql `
|
|
98
|
-
${OSCE_STATION_FIELDS}
|
|
99
98
|
${OSCE_MARKSHEET_MARK_FIELDS}
|
|
100
99
|
${OSCE_MARKSHEET_USER_FIELDS}
|
|
101
100
|
fragment OsceMarksheetFields on OsceMarksheet {
|
|
@@ -104,9 +103,6 @@ export const OSCE_MARKSHEET_FIELDS = gql `
|
|
|
104
103
|
updatedAt
|
|
105
104
|
timeTaken
|
|
106
105
|
osceStationId
|
|
107
|
-
osceStation {
|
|
108
|
-
...OsceStationFields
|
|
109
|
-
}
|
|
110
106
|
userId
|
|
111
107
|
solo
|
|
112
108
|
role
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LEAVE_OSCE_MARKSHEET = exports.END_OSCE_MARKSHEET = exports.OSCE_MARKSHEET_ACTIONS = exports.SAVE_OSCE_MARKSHEET = exports.PRESTART_OSCE_MARKSHEET = exports.START_OSCE_MARKSHEET = exports.SELECT_OSCE_STATION = exports.optimisticMarkOsceMarksheetMark = exports.MARK_OSCE_MARKSHEET_MARK = exports.CHANGE_OSCE_ROLE = exports.BUILD_OSCE_MARKSHEET = exports.CANCEL_OSCE_MATCHMAKING = exports.CHECK_OSCE_MATCHMAKING = exports.ACCEPT_OSCE_MATCHMAKING = exports.START_OSCE_MATCHMAKING = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const osce_1 = require("../../fragments/osce");
|
|
6
|
+
const osce_2 = require("./../../fragments/osce");
|
|
6
7
|
exports.START_OSCE_MATCHMAKING = (0, client_1.gql) `
|
|
7
8
|
mutation StartOsceMatchmaking($agoraId: String!) {
|
|
8
9
|
restricted {
|
|
@@ -35,6 +36,7 @@ exports.CANCEL_OSCE_MATCHMAKING = (0, client_1.gql) `
|
|
|
35
36
|
}
|
|
36
37
|
`;
|
|
37
38
|
exports.BUILD_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
39
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
38
40
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
39
41
|
mutation BuildOsceMarksheet(
|
|
40
42
|
$osceStationId: Int
|
|
@@ -48,6 +50,9 @@ exports.BUILD_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
|
48
50
|
solo: $solo
|
|
49
51
|
) {
|
|
50
52
|
...OsceMarksheetFields
|
|
53
|
+
osceStation {
|
|
54
|
+
...OsceStationFields
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
}
|
|
@@ -88,6 +93,7 @@ const optimisticMarkOsceMarksheetMark = (variables) => {
|
|
|
88
93
|
};
|
|
89
94
|
exports.optimisticMarkOsceMarksheetMark = optimisticMarkOsceMarksheetMark;
|
|
90
95
|
exports.SELECT_OSCE_STATION = (0, client_1.gql) `
|
|
96
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
91
97
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
92
98
|
mutation SelectOsceMarksheetStation(
|
|
93
99
|
$osceMarksheetId: Int!
|
|
@@ -99,21 +105,29 @@ exports.SELECT_OSCE_STATION = (0, client_1.gql) `
|
|
|
99
105
|
osceStationId: $osceStationId
|
|
100
106
|
) {
|
|
101
107
|
...OsceMarksheetFields
|
|
108
|
+
osceStation {
|
|
109
|
+
...OsceStationFields
|
|
110
|
+
}
|
|
102
111
|
}
|
|
103
112
|
}
|
|
104
113
|
}
|
|
105
114
|
`;
|
|
106
115
|
exports.START_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
116
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
107
117
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
108
118
|
mutation StartOsceMarksheet($osceMarksheetId: Int!) {
|
|
109
119
|
restricted {
|
|
110
120
|
startOsceMarksheet(osceMarksheetId: $osceMarksheetId) {
|
|
111
121
|
...OsceMarksheetFields
|
|
122
|
+
osceStation {
|
|
123
|
+
...OsceStationFields
|
|
124
|
+
}
|
|
112
125
|
}
|
|
113
126
|
}
|
|
114
127
|
}
|
|
115
128
|
`;
|
|
116
129
|
exports.PRESTART_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
130
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
117
131
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
118
132
|
mutation PrestartOsceMarksheet(
|
|
119
133
|
$osceMarksheetId: Int!
|
|
@@ -129,6 +143,9 @@ exports.PRESTART_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
|
129
143
|
feedbackTime: $feedbackTime
|
|
130
144
|
) {
|
|
131
145
|
...OsceMarksheetFields
|
|
146
|
+
osceStation {
|
|
147
|
+
...OsceStationFields
|
|
148
|
+
}
|
|
132
149
|
}
|
|
133
150
|
}
|
|
134
151
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { gql } from '@apollo/client';
|
|
2
2
|
import { OSCE_MARKSHEET_FIELDS, OSCE_MATCHMAKING_ACTION_FIELDS, } from '../../fragments/osce';
|
|
3
|
+
import { OSCE_STATION_FIELDS } from './../../fragments/osce';
|
|
3
4
|
export const START_OSCE_MATCHMAKING = gql `
|
|
4
5
|
mutation StartOsceMatchmaking($agoraId: String!) {
|
|
5
6
|
restricted {
|
|
@@ -32,6 +33,7 @@ export const CANCEL_OSCE_MATCHMAKING = gql `
|
|
|
32
33
|
}
|
|
33
34
|
`;
|
|
34
35
|
export const BUILD_OSCE_MARKSHEET = gql `
|
|
36
|
+
${OSCE_STATION_FIELDS}
|
|
35
37
|
${OSCE_MARKSHEET_FIELDS}
|
|
36
38
|
mutation BuildOsceMarksheet(
|
|
37
39
|
$osceStationId: Int
|
|
@@ -45,6 +47,9 @@ export const BUILD_OSCE_MARKSHEET = gql `
|
|
|
45
47
|
solo: $solo
|
|
46
48
|
) {
|
|
47
49
|
...OsceMarksheetFields
|
|
50
|
+
osceStation {
|
|
51
|
+
...OsceStationFields
|
|
52
|
+
}
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
}
|
|
@@ -84,6 +89,7 @@ export const optimisticMarkOsceMarksheetMark = (variables) => {
|
|
|
84
89
|
};
|
|
85
90
|
};
|
|
86
91
|
export const SELECT_OSCE_STATION = gql `
|
|
92
|
+
${OSCE_STATION_FIELDS}
|
|
87
93
|
${OSCE_MARKSHEET_FIELDS}
|
|
88
94
|
mutation SelectOsceMarksheetStation(
|
|
89
95
|
$osceMarksheetId: Int!
|
|
@@ -95,21 +101,29 @@ export const SELECT_OSCE_STATION = gql `
|
|
|
95
101
|
osceStationId: $osceStationId
|
|
96
102
|
) {
|
|
97
103
|
...OsceMarksheetFields
|
|
104
|
+
osceStation {
|
|
105
|
+
...OsceStationFields
|
|
106
|
+
}
|
|
98
107
|
}
|
|
99
108
|
}
|
|
100
109
|
}
|
|
101
110
|
`;
|
|
102
111
|
export const START_OSCE_MARKSHEET = gql `
|
|
112
|
+
${OSCE_STATION_FIELDS}
|
|
103
113
|
${OSCE_MARKSHEET_FIELDS}
|
|
104
114
|
mutation StartOsceMarksheet($osceMarksheetId: Int!) {
|
|
105
115
|
restricted {
|
|
106
116
|
startOsceMarksheet(osceMarksheetId: $osceMarksheetId) {
|
|
107
117
|
...OsceMarksheetFields
|
|
118
|
+
osceStation {
|
|
119
|
+
...OsceStationFields
|
|
120
|
+
}
|
|
108
121
|
}
|
|
109
122
|
}
|
|
110
123
|
}
|
|
111
124
|
`;
|
|
112
125
|
export const PRESTART_OSCE_MARKSHEET = gql `
|
|
126
|
+
${OSCE_STATION_FIELDS}
|
|
113
127
|
${OSCE_MARKSHEET_FIELDS}
|
|
114
128
|
mutation PrestartOsceMarksheet(
|
|
115
129
|
$osceMarksheetId: Int!
|
|
@@ -125,6 +139,9 @@ export const PRESTART_OSCE_MARKSHEET = gql `
|
|
|
125
139
|
feedbackTime: $feedbackTime
|
|
126
140
|
) {
|
|
127
141
|
...OsceMarksheetFields
|
|
142
|
+
osceStation {
|
|
143
|
+
...OsceStationFields
|
|
144
|
+
}
|
|
128
145
|
}
|
|
129
146
|
}
|
|
130
147
|
}
|
|
@@ -25,21 +25,29 @@ exports.DASHBOARD_OSCE = (0, client_1.gql) `
|
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
27
|
exports.OSCE_MARKSHEETS = (0, client_1.gql) `
|
|
28
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
28
29
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
29
30
|
query OsceMarksheets($solo: Boolean!) {
|
|
30
31
|
restricted {
|
|
31
32
|
osceMarksheets(solo: $solo) {
|
|
32
33
|
...OsceMarksheetFields
|
|
34
|
+
osceStation {
|
|
35
|
+
...OsceStationFields
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
`;
|
|
37
41
|
exports.OSCE_MARKSHEET = (0, client_1.gql) `
|
|
42
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
38
43
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
39
44
|
query OsceMarksheet($id: Int!) {
|
|
40
45
|
restricted {
|
|
41
46
|
osceMarksheet(id: $id) {
|
|
42
47
|
...OsceMarksheetFields
|
|
48
|
+
osceStation {
|
|
49
|
+
...OsceStationFields
|
|
50
|
+
}
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
53
|
}
|
|
@@ -62,6 +70,8 @@ exports.OSCE_STATIONS = (0, client_1.gql) `
|
|
|
62
70
|
topicIds: $topicIds
|
|
63
71
|
) {
|
|
64
72
|
...OsceStationFields
|
|
73
|
+
attempted
|
|
74
|
+
score
|
|
65
75
|
}
|
|
66
76
|
}
|
|
67
77
|
}
|
|
@@ -92,6 +102,8 @@ exports.SEARCH_OSCE_STATIONS = (0, client_1.gql) `
|
|
|
92
102
|
restricted {
|
|
93
103
|
searchOsceStations(search: $search) {
|
|
94
104
|
...OsceStationFields
|
|
105
|
+
attempted
|
|
106
|
+
score
|
|
95
107
|
}
|
|
96
108
|
}
|
|
97
109
|
}
|
|
@@ -22,21 +22,29 @@ export const DASHBOARD_OSCE = gql `
|
|
|
22
22
|
}
|
|
23
23
|
`;
|
|
24
24
|
export const OSCE_MARKSHEETS = gql `
|
|
25
|
+
${OSCE_STATION_FIELDS}
|
|
25
26
|
${OSCE_MARKSHEET_FIELDS}
|
|
26
27
|
query OsceMarksheets($solo: Boolean!) {
|
|
27
28
|
restricted {
|
|
28
29
|
osceMarksheets(solo: $solo) {
|
|
29
30
|
...OsceMarksheetFields
|
|
31
|
+
osceStation {
|
|
32
|
+
...OsceStationFields
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
`;
|
|
34
38
|
export const OSCE_MARKSHEET = gql `
|
|
39
|
+
${OSCE_STATION_FIELDS}
|
|
35
40
|
${OSCE_MARKSHEET_FIELDS}
|
|
36
41
|
query OsceMarksheet($id: Int!) {
|
|
37
42
|
restricted {
|
|
38
43
|
osceMarksheet(id: $id) {
|
|
39
44
|
...OsceMarksheetFields
|
|
45
|
+
osceStation {
|
|
46
|
+
...OsceStationFields
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
50
|
}
|
|
@@ -59,6 +67,8 @@ export const OSCE_STATIONS = gql `
|
|
|
59
67
|
topicIds: $topicIds
|
|
60
68
|
) {
|
|
61
69
|
...OsceStationFields
|
|
70
|
+
attempted
|
|
71
|
+
score
|
|
62
72
|
}
|
|
63
73
|
}
|
|
64
74
|
}
|
|
@@ -89,6 +99,8 @@ export const SEARCH_OSCE_STATIONS = gql `
|
|
|
89
99
|
restricted {
|
|
90
100
|
searchOsceStations(search: $search) {
|
|
91
101
|
...OsceStationFields
|
|
102
|
+
attempted
|
|
103
|
+
score
|
|
92
104
|
}
|
|
93
105
|
}
|
|
94
106
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMarksheetMark, IPrescribeAnswer, IPrescribeMark } from '../models';
|
|
2
2
|
export declare function mapPrescribeMarkToAnswer(obj: IPrescribeMark): IPrescribeAnswer;
|
|
3
|
-
export declare function formatPrescribeAnswer(
|
|
3
|
+
export declare function formatPrescribeAnswer(baseAnswer: IPrescribeAnswer): IPrescribeAnswer;
|
|
4
4
|
export interface ICorrectMarkData {
|
|
5
5
|
correct: boolean;
|
|
6
6
|
incorrect: boolean;
|
package/utils/commonFunctions.js
CHANGED
|
@@ -34,7 +34,8 @@ function mapPrescribeMarkToAnswer(obj) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
exports.mapPrescribeMarkToAnswer = mapPrescribeMarkToAnswer;
|
|
37
|
-
function formatPrescribeAnswer(
|
|
37
|
+
function formatPrescribeAnswer(baseAnswer) {
|
|
38
|
+
const obj = Object.assign(Object.assign({}, baseAnswer), { drug: Object.assign({}, baseAnswer.drug), dose: Object.assign({}, baseAnswer.dose), units: Object.assign({}, baseAnswer.units), route: Object.assign({}, baseAnswer.route), frequency: Object.assign({}, baseAnswer.frequency), duration: Object.assign({}, baseAnswer.duration) });
|
|
38
39
|
obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
|
|
39
40
|
obj.route.value = obj.route.value
|
|
40
41
|
.toLowerCase()
|
|
@@ -30,7 +30,8 @@ export function mapPrescribeMarkToAnswer(obj) {
|
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
export function formatPrescribeAnswer(
|
|
33
|
+
export function formatPrescribeAnswer(baseAnswer) {
|
|
34
|
+
const obj = Object.assign(Object.assign({}, baseAnswer), { drug: Object.assign({}, baseAnswer.drug), dose: Object.assign({}, baseAnswer.dose), units: Object.assign({}, baseAnswer.units), route: Object.assign({}, baseAnswer.route), frequency: Object.assign({}, baseAnswer.frequency), duration: Object.assign({}, baseAnswer.duration) });
|
|
34
35
|
obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
|
|
35
36
|
obj.route.value = obj.route.value
|
|
36
37
|
.toLowerCase()
|
package/utils/uuid4.js
CHANGED
|
@@ -202,14 +202,9 @@ class Uuid4 {
|
|
|
202
202
|
* @private
|
|
203
203
|
*/
|
|
204
204
|
static _getRandomArray() {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
// `result` is modified in place.
|
|
210
|
-
let result = new Uint8Array(16);
|
|
211
|
-
window.crypto.getRandomValues(result);
|
|
212
|
-
return result;
|
|
205
|
+
return Uint8Array.from(Array(16)
|
|
206
|
+
.fill(0)
|
|
207
|
+
.map(() => Math.round(Math.random() * 255)));
|
|
213
208
|
}
|
|
214
209
|
}
|
|
215
210
|
/**
|
package/utils/uuid4.mjs
CHANGED
|
@@ -200,14 +200,9 @@ class Uuid4 {
|
|
|
200
200
|
* @private
|
|
201
201
|
*/
|
|
202
202
|
static _getRandomArray() {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
// `result` is modified in place.
|
|
208
|
-
let result = new Uint8Array(16);
|
|
209
|
-
window.crypto.getRandomValues(result);
|
|
210
|
-
return result;
|
|
203
|
+
return Uint8Array.from(Array(16)
|
|
204
|
+
.fill(0)
|
|
205
|
+
.map(() => Math.round(Math.random() * 255)));
|
|
211
206
|
}
|
|
212
207
|
}
|
|
213
208
|
/**
|