@quesmed/types-rn 2.6.268 → 2.6.270
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.
|
@@ -26,6 +26,8 @@ export interface IOsceMarksheetMark {
|
|
|
26
26
|
osceMarksheet?: IOsceMarksheet;
|
|
27
27
|
osceStationMarkId: Id;
|
|
28
28
|
osceStationMark?: IOsceStationMark;
|
|
29
|
+
secondaryMark: number | null;
|
|
30
|
+
score: number | null;
|
|
29
31
|
}
|
|
30
32
|
export declare enum EOsceRoles {
|
|
31
33
|
ALL = 0,
|
|
@@ -63,7 +65,8 @@ export declare enum EOsceMarksheetMode {
|
|
|
63
65
|
}
|
|
64
66
|
export declare enum EOsceStationPhase {
|
|
65
67
|
PATIENT = "PATIENT",
|
|
66
|
-
EXAMINER = "EXAMINER"
|
|
68
|
+
EXAMINER = "EXAMINER",
|
|
69
|
+
EXAMINATION = "EXAMINATION"
|
|
67
70
|
}
|
|
68
71
|
export interface IOsceMarksheetMessage {
|
|
69
72
|
id: Id;
|
package/models/OsceMarksheet.js
CHANGED
|
@@ -44,6 +44,7 @@ var EOsceStationPhase;
|
|
|
44
44
|
(function (EOsceStationPhase) {
|
|
45
45
|
EOsceStationPhase["PATIENT"] = "PATIENT";
|
|
46
46
|
EOsceStationPhase["EXAMINER"] = "EXAMINER";
|
|
47
|
+
EOsceStationPhase["EXAMINATION"] = "EXAMINATION";
|
|
47
48
|
})(EOsceStationPhase = exports.EOsceStationPhase || (exports.EOsceStationPhase = {}));
|
|
48
49
|
var EOsceTimerState;
|
|
49
50
|
(function (EOsceTimerState) {
|
package/package.json
CHANGED
|
@@ -45,6 +45,7 @@ export declare const MARK_OSCE_MARKSHEET_MARK: import("@apollo/client").Document
|
|
|
45
45
|
export interface IMarkOsceMarksheetMarkVar {
|
|
46
46
|
osceMarksheetMarkId: Id;
|
|
47
47
|
mark: number | EPaceMarkType;
|
|
48
|
+
secondaryMark?: number;
|
|
48
49
|
corrected?: Boolean;
|
|
49
50
|
}
|
|
50
51
|
export type IMarkOsceMarksheetMarkData = RestrictedData<graphqlNormalize & Partial<IOsceMarksheetMark>, 'markOsceMarksheetMark'>;
|
|
@@ -84,16 +84,19 @@ exports.CHANGE_OSCE_ROLE = (0, client_1.gql) `
|
|
|
84
84
|
}
|
|
85
85
|
`;
|
|
86
86
|
exports.MARK_OSCE_MARKSHEET_MARK = (0, client_1.gql) `
|
|
87
|
-
mutation MarkOsceMarksheetMark($osceMarksheetMarkId: Int!, $mark: Int!, $corrected: Boolean) {
|
|
87
|
+
mutation MarkOsceMarksheetMark($osceMarksheetMarkId: Int!, $mark: Int!, $secondaryMark: Int, $corrected: Boolean) {
|
|
88
88
|
restricted {
|
|
89
89
|
markOsceMarksheetMark(
|
|
90
90
|
osceMarksheetMarkId: $osceMarksheetMarkId
|
|
91
91
|
mark: $mark
|
|
92
|
+
secondaryMark: $secondaryMark
|
|
92
93
|
corrected: $corrected
|
|
93
94
|
) {
|
|
94
95
|
id
|
|
95
96
|
selectedChoice
|
|
96
97
|
mark
|
|
98
|
+
score
|
|
99
|
+
secondaryMark
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
}
|
|
@@ -103,10 +106,13 @@ const optimisticMarkOsceMarksheetMark = (variables, productType) => {
|
|
|
103
106
|
if (productType === models_1.EProductType.PACES) {
|
|
104
107
|
data.selectedChoice = variables.mark;
|
|
105
108
|
data.mark = null;
|
|
109
|
+
data.secondaryMark = variables.secondaryMark;
|
|
110
|
+
data.score = null;
|
|
106
111
|
}
|
|
107
112
|
else {
|
|
108
113
|
data.mark = variables.mark;
|
|
109
114
|
data.selectedChoice = null;
|
|
115
|
+
data.score = variables.mark;
|
|
110
116
|
}
|
|
111
117
|
return {
|
|
112
118
|
restricted: {
|
|
@@ -133,6 +139,8 @@ const updateCacheOnMarkOsceMarksheetMark = (cache, result, options) => {
|
|
|
133
139
|
fields: {
|
|
134
140
|
selectedChoice: () => markOsceMarksheetMark.selectedChoice,
|
|
135
141
|
mark: () => markOsceMarksheetMark.mark,
|
|
142
|
+
secondaryMark: () => markOsceMarksheetMark.secondaryMark,
|
|
143
|
+
score: () => markOsceMarksheetMark.score,
|
|
136
144
|
},
|
|
137
145
|
});
|
|
138
146
|
if (!variables.corrected) {
|
|
@@ -159,6 +167,8 @@ const updateCacheOnMarkOsceMarksheetMark = (cache, result, options) => {
|
|
|
159
167
|
fragment OsceMarksheetMarksForScore on OsceMarksheet {
|
|
160
168
|
marks {
|
|
161
169
|
mark
|
|
170
|
+
score
|
|
171
|
+
secondaryMark
|
|
162
172
|
}
|
|
163
173
|
}
|
|
164
174
|
`,
|
|
@@ -166,12 +176,14 @@ const updateCacheOnMarkOsceMarksheetMark = (cache, result, options) => {
|
|
|
166
176
|
if (!marksheet?.marks?.length) {
|
|
167
177
|
return;
|
|
168
178
|
}
|
|
169
|
-
const
|
|
170
|
-
const
|
|
179
|
+
const hasSecondaryMarks = marksheet.marks.some((m) => m.secondaryMark);
|
|
180
|
+
const total = hasSecondaryMarks ? 2 * marksheet.marks.length : marksheet.marks.length;
|
|
181
|
+
// const scored = marksheet.marks.filter(({ mark }) => Boolean(mark)).length;
|
|
182
|
+
const userScore = marksheet.marks.reduce((sum, m) => sum + Number(m.score), 0);
|
|
171
183
|
cache.modify({
|
|
172
184
|
id: cache.identify({ id: marksheetId, __typename: 'OsceMarksheet' }),
|
|
173
185
|
fields: {
|
|
174
|
-
score: () =>
|
|
186
|
+
score: () => userScore / total,
|
|
175
187
|
},
|
|
176
188
|
});
|
|
177
189
|
};
|