@quesmed/types 2.6.16 → 2.6.18
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 +7 -0
- package/dist/cjs/models/Product.d.ts +18 -3
- package/dist/cjs/models/Product.js +16 -0
- package/dist/cjs/models/Topic.d.ts +0 -13
- package/dist/cjs/resolvers/mutation/restricted/questionDiscussion.js +12 -2
- package/dist/cjs/resolvers/query/restricted/osce.d.ts +1 -3
- package/dist/cjs/resolvers/query/restricted/osce.js +2 -4
- package/dist/cjs/resolvers/query/restricted/products.js +1 -2
- package/dist/cjs/resolvers/query/restricted/quesBook.d.ts +2 -6
- package/dist/cjs/resolvers/query/restricted/quesBook.js +6 -6
- package/dist/mjs/models/OsceStation.d.ts +7 -0
- package/dist/mjs/models/Product.d.ts +18 -3
- package/dist/mjs/models/Product.js +16 -0
- package/dist/mjs/models/Topic.d.ts +0 -13
- package/dist/mjs/resolvers/mutation/restricted/questionDiscussion.js +12 -2
- package/dist/mjs/resolvers/query/restricted/osce.d.ts +1 -3
- package/dist/mjs/resolvers/query/restricted/osce.js +2 -4
- package/dist/mjs/resolvers/query/restricted/products.js +1 -2
- package/dist/mjs/resolvers/query/restricted/quesBook.d.ts +2 -6
- package/dist/mjs/resolvers/query/restricted/quesBook.js +6 -6
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { IConcept } from './Concept';
|
|
|
2
2
|
import { EDifficultyType } from './Difficulty';
|
|
3
3
|
import { IPaceScore } from './Paces';
|
|
4
4
|
import { IPicture } from './Picture';
|
|
5
|
+
import { EProductType } from './Product';
|
|
5
6
|
import { ITopic } from './Topic';
|
|
6
7
|
import { Id } from './Type';
|
|
7
8
|
import { EUserLearningStatus } from './User';
|
|
@@ -48,6 +49,7 @@ export interface IOsceStation {
|
|
|
48
49
|
name: string;
|
|
49
50
|
hiddenName: string;
|
|
50
51
|
osceTypeId: Id;
|
|
52
|
+
productId: EProductType;
|
|
51
53
|
osceType?: IOsceType;
|
|
52
54
|
difficulty: EDifficultyType;
|
|
53
55
|
candidateBrief: string;
|
|
@@ -75,6 +77,11 @@ export interface IOsceStationTopic {
|
|
|
75
77
|
concept?: IConcept;
|
|
76
78
|
osceStation?: IOsceStation;
|
|
77
79
|
}
|
|
80
|
+
export interface IOsceStationProduct {
|
|
81
|
+
id: Id;
|
|
82
|
+
productId: Id;
|
|
83
|
+
stationId: Id;
|
|
84
|
+
}
|
|
78
85
|
export declare const OSCE_GLOBAL_RATING: {
|
|
79
86
|
[key: number]: string;
|
|
80
87
|
};
|
|
@@ -19,7 +19,23 @@ export declare enum EProductType {
|
|
|
19
19
|
DATA_INTERPRETATION = 16,
|
|
20
20
|
CLINICAL_SUBSET = 17,
|
|
21
21
|
CLINICAL_PROBLEM_SOLVING = 18,
|
|
22
|
-
PROFESSIONAL_DILEMMA = 19
|
|
22
|
+
PROFESSIONAL_DILEMMA = 19,
|
|
23
|
+
HISTORY_TAKING = 20,
|
|
24
|
+
COMMUNICATION_SKILLS = 21,
|
|
25
|
+
EXAMINATION = 22,
|
|
26
|
+
PROCEDURE = 23,
|
|
27
|
+
INTERPRETATION = 24,
|
|
28
|
+
ABCDE = 25,
|
|
29
|
+
PRESCRIBING = 26,
|
|
30
|
+
MIXED = 27,
|
|
31
|
+
ABDOMINAL = 28,
|
|
32
|
+
CARDIOVASCULAR = 29,
|
|
33
|
+
COMMUNICATION = 30,
|
|
34
|
+
CONSULTATION = 31,
|
|
35
|
+
NEUROLOGY = 32,
|
|
36
|
+
RESPIRATORY = 33,
|
|
37
|
+
PLAB_QBANK = 34,
|
|
38
|
+
PLAB_OSCE = 35
|
|
23
39
|
}
|
|
24
40
|
export interface IProduct {
|
|
25
41
|
id: Id;
|
|
@@ -36,7 +52,6 @@ export interface IProduct {
|
|
|
36
52
|
export interface IProductType {
|
|
37
53
|
id: Id;
|
|
38
54
|
name: string;
|
|
39
|
-
displayName: string;
|
|
40
55
|
}
|
|
41
56
|
export declare enum EAppType {
|
|
42
57
|
AMS = 1,
|
|
@@ -70,5 +85,5 @@ export interface IProductStats {
|
|
|
70
85
|
yellowCards?: number | null;
|
|
71
86
|
redCards?: number | null;
|
|
72
87
|
dailyFeedCards?: number | null;
|
|
73
|
-
|
|
88
|
+
types?: IEntitlementType[];
|
|
74
89
|
}
|
|
@@ -23,6 +23,22 @@ var EProductType;
|
|
|
23
23
|
EProductType[EProductType["CLINICAL_SUBSET"] = 17] = "CLINICAL_SUBSET";
|
|
24
24
|
EProductType[EProductType["CLINICAL_PROBLEM_SOLVING"] = 18] = "CLINICAL_PROBLEM_SOLVING";
|
|
25
25
|
EProductType[EProductType["PROFESSIONAL_DILEMMA"] = 19] = "PROFESSIONAL_DILEMMA";
|
|
26
|
+
EProductType[EProductType["HISTORY_TAKING"] = 20] = "HISTORY_TAKING";
|
|
27
|
+
EProductType[EProductType["COMMUNICATION_SKILLS"] = 21] = "COMMUNICATION_SKILLS";
|
|
28
|
+
EProductType[EProductType["EXAMINATION"] = 22] = "EXAMINATION";
|
|
29
|
+
EProductType[EProductType["PROCEDURE"] = 23] = "PROCEDURE";
|
|
30
|
+
EProductType[EProductType["INTERPRETATION"] = 24] = "INTERPRETATION";
|
|
31
|
+
EProductType[EProductType["ABCDE"] = 25] = "ABCDE";
|
|
32
|
+
EProductType[EProductType["PRESCRIBING"] = 26] = "PRESCRIBING";
|
|
33
|
+
EProductType[EProductType["MIXED"] = 27] = "MIXED";
|
|
34
|
+
EProductType[EProductType["ABDOMINAL"] = 28] = "ABDOMINAL";
|
|
35
|
+
EProductType[EProductType["CARDIOVASCULAR"] = 29] = "CARDIOVASCULAR";
|
|
36
|
+
EProductType[EProductType["COMMUNICATION"] = 30] = "COMMUNICATION";
|
|
37
|
+
EProductType[EProductType["CONSULTATION"] = 31] = "CONSULTATION";
|
|
38
|
+
EProductType[EProductType["NEUROLOGY"] = 32] = "NEUROLOGY";
|
|
39
|
+
EProductType[EProductType["RESPIRATORY"] = 33] = "RESPIRATORY";
|
|
40
|
+
EProductType[EProductType["PLAB_QBANK"] = 34] = "PLAB_QBANK";
|
|
41
|
+
EProductType[EProductType["PLAB_OSCE"] = 35] = "PLAB_OSCE";
|
|
26
42
|
})(EProductType = exports.EProductType || (exports.EProductType = {}));
|
|
27
43
|
var EAppType;
|
|
28
44
|
(function (EAppType) {
|
|
@@ -29,19 +29,6 @@ export interface ITopicType {
|
|
|
29
29
|
redCards?: number | null;
|
|
30
30
|
dailyFeedCards?: number | null;
|
|
31
31
|
}
|
|
32
|
-
export interface ITopicStats {
|
|
33
|
-
userId: number;
|
|
34
|
-
totalQuestions?: number | null;
|
|
35
|
-
completedQuestions?: number | null;
|
|
36
|
-
correctQuestions?: number | null;
|
|
37
|
-
incorrectQuestions?: number | null;
|
|
38
|
-
totalCards?: number | null;
|
|
39
|
-
greenCards?: number | null;
|
|
40
|
-
yellowCards?: number | null;
|
|
41
|
-
redCards?: number | null;
|
|
42
|
-
dailyFeedCards?: number | null;
|
|
43
|
-
types?: ITopicType[];
|
|
44
|
-
}
|
|
45
32
|
export interface ITopic {
|
|
46
33
|
id: Id;
|
|
47
34
|
createdAt: number | Date;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateQuestionHighlights = exports.ADD_QUESTION_HIGHLIGHT = exports.optimisticQuestionCommentRemove = exports.updateQuestionCommentsRemove = exports.QUESTION_COMMENT_REMOVE = exports.optimisticCommentLike = exports.QUESTION_COMMENT_LIKE = exports.optimisticQuestionComment = exports.updateQuestionComments = exports.QUESTION_COMMENTS = exports.optimisticQuestionLike = exports.QUESTION_LIKE = exports.getQuestionTypeName = exports.getQuestionHighlightsFragment = exports.getLikeData = exports.QUESTION_PRESCRIPTION_COMMENT_FIELDS = exports.QUESTION_MULTIA_COMMENT_FIELDS = exports.QUESTION_RANKING_HIGHLIGHT_FIELDS = exports.QUESTION_SELECT3_HIGHLIGHT_FIELDS = exports.QUESTION_EMQ_HIGHLIGHT_FIELDS = exports.QUESTION_PRESCRIPTION_HIGHLIGHT_FIELDS = exports.QUESTION_MULTIA_HIGHLIGHT_FIELDS = exports.QUESTION_SBA_HIGHLIGHT_FIELDS = exports.QUESTION_QA_HIGHLIGHT_FIELDS = exports.QUESTION_RANKING_COMMENT_FIELDS = exports.QUESTION_SELECT3_COMMENT_FIELDS = exports.QUESTION_EMQ_COMMENT_FIELDS = exports.QUESTION_QA_COMMENT_FIELDS = exports.QUESTION_SBA_COMMENT_FIELDS = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
|
+
const luxon_1 = require("luxon");
|
|
5
6
|
const models_1 = require("../../../models");
|
|
6
7
|
exports.QUESTION_SBA_COMMENT_FIELDS = (0, client_1.gql) `
|
|
7
8
|
fragment QuestionSBAComments on QuestionSBA {
|
|
@@ -779,7 +780,7 @@ const updateQuestionCommentsRemove = (typeId) => (cache, result, options) => {
|
|
|
779
780
|
if (!variables || !questionCommentRemove) {
|
|
780
781
|
return;
|
|
781
782
|
}
|
|
782
|
-
const { questionId, id: commentId, parentId, userId, user, } = questionCommentRemove;
|
|
783
|
+
const { questionId, id: commentId, parentId, userId, user, createdAt, } = questionCommentRemove;
|
|
783
784
|
try {
|
|
784
785
|
const dataFragment = cache.readFragment({
|
|
785
786
|
id: cache.identify({
|
|
@@ -790,6 +791,15 @@ const updateQuestionCommentsRemove = (typeId) => (cache, result, options) => {
|
|
|
790
791
|
});
|
|
791
792
|
if (dataFragment) {
|
|
792
793
|
const { comments = [] } = dataFragment;
|
|
794
|
+
const createdAtDate = luxon_1.DateTime.fromJSDate(createdAt);
|
|
795
|
+
const diffInHours = luxon_1.DateTime.now().diff(createdAtDate, 'hours').hours;
|
|
796
|
+
let updatedComments = [];
|
|
797
|
+
if (diffInHours >= 24) {
|
|
798
|
+
updatedComments = updateCommentFromDiscussion(comments, commentId, { userId, user }, parentId);
|
|
799
|
+
}
|
|
800
|
+
else {
|
|
801
|
+
updatedComments = removeCommnetFromDiscussion(comments, commentId, parentId);
|
|
802
|
+
}
|
|
793
803
|
cache.writeFragment({
|
|
794
804
|
id: cache.identify({
|
|
795
805
|
id: questionId,
|
|
@@ -797,7 +807,7 @@ const updateQuestionCommentsRemove = (typeId) => (cache, result, options) => {
|
|
|
797
807
|
}),
|
|
798
808
|
data: {
|
|
799
809
|
...dataFragment,
|
|
800
|
-
comments:
|
|
810
|
+
comments: updatedComments,
|
|
801
811
|
},
|
|
802
812
|
fragment: getQuestionFragment(typeId),
|
|
803
813
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { EDifficultyType,
|
|
1
|
+
import { EDifficultyType, Id, IDashboardOsce, IOsceMarksheet, IOsceStation, IOsceStats, IUser } from '../../../models';
|
|
2
2
|
import { ESortOrder } from '../../enums';
|
|
3
3
|
import { graphqlNormalize, RestrictedData } from '../../types';
|
|
4
4
|
import { ITopic } from './../../../models/Topic';
|
|
5
5
|
export interface IOsceStatsVar {
|
|
6
|
-
typeId?: EOsceType[] | EPaceType[];
|
|
7
6
|
solo: boolean;
|
|
8
7
|
}
|
|
9
8
|
export type IOsceStatsData = RestrictedData<graphqlNormalize & IOsceStats, 'osceStats'>;
|
|
@@ -52,7 +51,6 @@ export interface IOsceMarksheetVar {
|
|
|
52
51
|
export type IOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'osceMarksheet'>;
|
|
53
52
|
export declare const OSCE_STATIONS: import("@apollo/client").DocumentNode;
|
|
54
53
|
export interface IOsceStationsVar {
|
|
55
|
-
osceTypeId?: Id;
|
|
56
54
|
solo: boolean;
|
|
57
55
|
attempted?: boolean;
|
|
58
56
|
difficulty?: EDifficultyType[];
|
|
@@ -5,9 +5,9 @@ const client_1 = require("@apollo/client");
|
|
|
5
5
|
const osce_1 = require("../../fragments/osce");
|
|
6
6
|
const osce_2 = require("./../../fragments/osce");
|
|
7
7
|
exports.OSCE_STATS = (0, client_1.gql) `
|
|
8
|
-
query OsceStats($solo: Boolean
|
|
8
|
+
query OsceStats($solo: Boolean!) {
|
|
9
9
|
restricted {
|
|
10
|
-
osceStats(solo: $solo
|
|
10
|
+
osceStats(solo: $solo) {
|
|
11
11
|
avgScore
|
|
12
12
|
completed
|
|
13
13
|
total
|
|
@@ -107,7 +107,6 @@ exports.OSCE_MARKSHEET = (0, client_1.gql) `
|
|
|
107
107
|
exports.OSCE_STATIONS = (0, client_1.gql) `
|
|
108
108
|
${osce_2.OSCE_STATION_FIELDS}
|
|
109
109
|
query OsceStations(
|
|
110
|
-
$osceTypeId: Int
|
|
111
110
|
$solo: Boolean!
|
|
112
111
|
$attempted: Boolean
|
|
113
112
|
$difficulty: [Int!]
|
|
@@ -115,7 +114,6 @@ exports.OSCE_STATIONS = (0, client_1.gql) `
|
|
|
115
114
|
) {
|
|
116
115
|
restricted {
|
|
117
116
|
osceStations(
|
|
118
|
-
osceTypeId: $osceTypeId
|
|
119
117
|
solo: $solo
|
|
120
118
|
attempted: $attempted
|
|
121
119
|
difficulty: $difficulty
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ETopicType, IConcept, IOsceStation, ITopic } from '../../../models';
|
|
2
2
|
import { RestrictedData, graphqlNormalize } from '../../types';
|
|
3
3
|
export type IQuesBookVar = {
|
|
4
4
|
/**TODO: make it mandatory once frontend changes are completed */
|
|
@@ -9,15 +9,11 @@ export type IQuesBookData = RestrictedData<(graphqlNormalize & ITopic)[], 'quesB
|
|
|
9
9
|
export declare const QBANK_KNOWLEDGE_VIDEO_LIBRARY: import("@apollo/client").DocumentNode;
|
|
10
10
|
export declare const PUBLIC_QBANK_KNOWLEDGE_LIBRARY: import("@apollo/client").DocumentNode;
|
|
11
11
|
export type IOsceBookVar = {
|
|
12
|
-
/**TODO: make it mandatory once frontend changes are completed */
|
|
13
|
-
typeId?: EOsceType[] | EPaceType[];
|
|
14
12
|
videosOnly?: boolean;
|
|
15
13
|
};
|
|
16
14
|
export type IOsceBookData = RestrictedData<(graphqlNormalize & IOsceStation)[], 'osceBook'>;
|
|
17
15
|
export declare const OSCE_KNOWLEDGE_VIDEO_LIBRARY: import("@apollo/client").DocumentNode;
|
|
18
|
-
export type IPaceBookVar =
|
|
19
|
-
typeId?: EPaceType[];
|
|
20
|
-
};
|
|
16
|
+
export type IPaceBookVar = null;
|
|
21
17
|
export type IPaceBookData = RestrictedData<(graphqlNormalize & IConcept)[], 'paceBook'>;
|
|
22
18
|
export declare const PACE_KNOWLEDGE_LIBRARY: import("@apollo/client").DocumentNode;
|
|
23
19
|
export declare const PACE_VIDEO_LIBRARY: import("@apollo/client").DocumentNode;
|
|
@@ -125,9 +125,9 @@ exports.PUBLIC_QBANK_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
|
|
|
125
125
|
`;
|
|
126
126
|
exports.OSCE_KNOWLEDGE_VIDEO_LIBRARY = (0, client_1.gql) `
|
|
127
127
|
${osce_1.OSCE_STATION_FIELDS}
|
|
128
|
-
query OsceKnowledgeVideoLibrary($
|
|
128
|
+
query OsceKnowledgeVideoLibrary($videosOnly: Boolean) {
|
|
129
129
|
restricted {
|
|
130
|
-
osceBook(
|
|
130
|
+
osceBook(videosOnly: $videosOnly) {
|
|
131
131
|
...OsceStationFields
|
|
132
132
|
lastOsceMarksheetId
|
|
133
133
|
score
|
|
@@ -136,9 +136,9 @@ exports.OSCE_KNOWLEDGE_VIDEO_LIBRARY = (0, client_1.gql) `
|
|
|
136
136
|
}
|
|
137
137
|
`;
|
|
138
138
|
exports.PACE_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
|
|
139
|
-
query PaceKnowledgeLibrary
|
|
139
|
+
query PaceKnowledgeLibrary {
|
|
140
140
|
restricted {
|
|
141
|
-
paceBook
|
|
141
|
+
paceBook {
|
|
142
142
|
id
|
|
143
143
|
name
|
|
144
144
|
demo
|
|
@@ -182,9 +182,9 @@ query PaceKnowledgeLibrary($typeId: [Int]) {
|
|
|
182
182
|
`;
|
|
183
183
|
exports.PACE_VIDEO_LIBRARY = (0, client_1.gql) `
|
|
184
184
|
${osce_1.OSCE_STATION_FIELDS}
|
|
185
|
-
query PaceVideoLibrary($
|
|
185
|
+
query PaceVideoLibrary($videosOnly: Boolean) {
|
|
186
186
|
restricted {
|
|
187
|
-
osceBook(
|
|
187
|
+
osceBook(videosOnly: $videosOnly) {
|
|
188
188
|
...OsceStationFields
|
|
189
189
|
lastOsceMarksheetId
|
|
190
190
|
score
|
|
@@ -2,6 +2,7 @@ import { IConcept } from './Concept';
|
|
|
2
2
|
import { EDifficultyType } from './Difficulty';
|
|
3
3
|
import { IPaceScore } from './Paces';
|
|
4
4
|
import { IPicture } from './Picture';
|
|
5
|
+
import { EProductType } from './Product';
|
|
5
6
|
import { ITopic } from './Topic';
|
|
6
7
|
import { Id } from './Type';
|
|
7
8
|
import { EUserLearningStatus } from './User';
|
|
@@ -48,6 +49,7 @@ export interface IOsceStation {
|
|
|
48
49
|
name: string;
|
|
49
50
|
hiddenName: string;
|
|
50
51
|
osceTypeId: Id;
|
|
52
|
+
productId: EProductType;
|
|
51
53
|
osceType?: IOsceType;
|
|
52
54
|
difficulty: EDifficultyType;
|
|
53
55
|
candidateBrief: string;
|
|
@@ -75,6 +77,11 @@ export interface IOsceStationTopic {
|
|
|
75
77
|
concept?: IConcept;
|
|
76
78
|
osceStation?: IOsceStation;
|
|
77
79
|
}
|
|
80
|
+
export interface IOsceStationProduct {
|
|
81
|
+
id: Id;
|
|
82
|
+
productId: Id;
|
|
83
|
+
stationId: Id;
|
|
84
|
+
}
|
|
78
85
|
export declare const OSCE_GLOBAL_RATING: {
|
|
79
86
|
[key: number]: string;
|
|
80
87
|
};
|
|
@@ -19,7 +19,23 @@ export declare enum EProductType {
|
|
|
19
19
|
DATA_INTERPRETATION = 16,
|
|
20
20
|
CLINICAL_SUBSET = 17,
|
|
21
21
|
CLINICAL_PROBLEM_SOLVING = 18,
|
|
22
|
-
PROFESSIONAL_DILEMMA = 19
|
|
22
|
+
PROFESSIONAL_DILEMMA = 19,
|
|
23
|
+
HISTORY_TAKING = 20,
|
|
24
|
+
COMMUNICATION_SKILLS = 21,
|
|
25
|
+
EXAMINATION = 22,
|
|
26
|
+
PROCEDURE = 23,
|
|
27
|
+
INTERPRETATION = 24,
|
|
28
|
+
ABCDE = 25,
|
|
29
|
+
PRESCRIBING = 26,
|
|
30
|
+
MIXED = 27,
|
|
31
|
+
ABDOMINAL = 28,
|
|
32
|
+
CARDIOVASCULAR = 29,
|
|
33
|
+
COMMUNICATION = 30,
|
|
34
|
+
CONSULTATION = 31,
|
|
35
|
+
NEUROLOGY = 32,
|
|
36
|
+
RESPIRATORY = 33,
|
|
37
|
+
PLAB_QBANK = 34,
|
|
38
|
+
PLAB_OSCE = 35
|
|
23
39
|
}
|
|
24
40
|
export interface IProduct {
|
|
25
41
|
id: Id;
|
|
@@ -36,7 +52,6 @@ export interface IProduct {
|
|
|
36
52
|
export interface IProductType {
|
|
37
53
|
id: Id;
|
|
38
54
|
name: string;
|
|
39
|
-
displayName: string;
|
|
40
55
|
}
|
|
41
56
|
export declare enum EAppType {
|
|
42
57
|
AMS = 1,
|
|
@@ -70,5 +85,5 @@ export interface IProductStats {
|
|
|
70
85
|
yellowCards?: number | null;
|
|
71
86
|
redCards?: number | null;
|
|
72
87
|
dailyFeedCards?: number | null;
|
|
73
|
-
|
|
88
|
+
types?: IEntitlementType[];
|
|
74
89
|
}
|
|
@@ -20,6 +20,22 @@ export var EProductType;
|
|
|
20
20
|
EProductType[EProductType["CLINICAL_SUBSET"] = 17] = "CLINICAL_SUBSET";
|
|
21
21
|
EProductType[EProductType["CLINICAL_PROBLEM_SOLVING"] = 18] = "CLINICAL_PROBLEM_SOLVING";
|
|
22
22
|
EProductType[EProductType["PROFESSIONAL_DILEMMA"] = 19] = "PROFESSIONAL_DILEMMA";
|
|
23
|
+
EProductType[EProductType["HISTORY_TAKING"] = 20] = "HISTORY_TAKING";
|
|
24
|
+
EProductType[EProductType["COMMUNICATION_SKILLS"] = 21] = "COMMUNICATION_SKILLS";
|
|
25
|
+
EProductType[EProductType["EXAMINATION"] = 22] = "EXAMINATION";
|
|
26
|
+
EProductType[EProductType["PROCEDURE"] = 23] = "PROCEDURE";
|
|
27
|
+
EProductType[EProductType["INTERPRETATION"] = 24] = "INTERPRETATION";
|
|
28
|
+
EProductType[EProductType["ABCDE"] = 25] = "ABCDE";
|
|
29
|
+
EProductType[EProductType["PRESCRIBING"] = 26] = "PRESCRIBING";
|
|
30
|
+
EProductType[EProductType["MIXED"] = 27] = "MIXED";
|
|
31
|
+
EProductType[EProductType["ABDOMINAL"] = 28] = "ABDOMINAL";
|
|
32
|
+
EProductType[EProductType["CARDIOVASCULAR"] = 29] = "CARDIOVASCULAR";
|
|
33
|
+
EProductType[EProductType["COMMUNICATION"] = 30] = "COMMUNICATION";
|
|
34
|
+
EProductType[EProductType["CONSULTATION"] = 31] = "CONSULTATION";
|
|
35
|
+
EProductType[EProductType["NEUROLOGY"] = 32] = "NEUROLOGY";
|
|
36
|
+
EProductType[EProductType["RESPIRATORY"] = 33] = "RESPIRATORY";
|
|
37
|
+
EProductType[EProductType["PLAB_QBANK"] = 34] = "PLAB_QBANK";
|
|
38
|
+
EProductType[EProductType["PLAB_OSCE"] = 35] = "PLAB_OSCE";
|
|
23
39
|
})(EProductType || (EProductType = {}));
|
|
24
40
|
export var EAppType;
|
|
25
41
|
(function (EAppType) {
|
|
@@ -29,19 +29,6 @@ export interface ITopicType {
|
|
|
29
29
|
redCards?: number | null;
|
|
30
30
|
dailyFeedCards?: number | null;
|
|
31
31
|
}
|
|
32
|
-
export interface ITopicStats {
|
|
33
|
-
userId: number;
|
|
34
|
-
totalQuestions?: number | null;
|
|
35
|
-
completedQuestions?: number | null;
|
|
36
|
-
correctQuestions?: number | null;
|
|
37
|
-
incorrectQuestions?: number | null;
|
|
38
|
-
totalCards?: number | null;
|
|
39
|
-
greenCards?: number | null;
|
|
40
|
-
yellowCards?: number | null;
|
|
41
|
-
redCards?: number | null;
|
|
42
|
-
dailyFeedCards?: number | null;
|
|
43
|
-
types?: ITopicType[];
|
|
44
|
-
}
|
|
45
32
|
export interface ITopic {
|
|
46
33
|
id: Id;
|
|
47
34
|
createdAt: number | Date;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { gql } from '@apollo/client';
|
|
2
|
+
import { DateTime } from 'luxon';
|
|
2
3
|
import { EQuestionLike, EQuestionType, } from '../../../models';
|
|
3
4
|
export const QUESTION_SBA_COMMENT_FIELDS = gql `
|
|
4
5
|
fragment QuestionSBAComments on QuestionSBA {
|
|
@@ -769,7 +770,7 @@ export const updateQuestionCommentsRemove = (typeId) => (cache, result, options)
|
|
|
769
770
|
if (!variables || !questionCommentRemove) {
|
|
770
771
|
return;
|
|
771
772
|
}
|
|
772
|
-
const { questionId, id: commentId, parentId, userId, user, } = questionCommentRemove;
|
|
773
|
+
const { questionId, id: commentId, parentId, userId, user, createdAt, } = questionCommentRemove;
|
|
773
774
|
try {
|
|
774
775
|
const dataFragment = cache.readFragment({
|
|
775
776
|
id: cache.identify({
|
|
@@ -780,6 +781,15 @@ export const updateQuestionCommentsRemove = (typeId) => (cache, result, options)
|
|
|
780
781
|
});
|
|
781
782
|
if (dataFragment) {
|
|
782
783
|
const { comments = [] } = dataFragment;
|
|
784
|
+
const createdAtDate = DateTime.fromJSDate(createdAt);
|
|
785
|
+
const diffInHours = DateTime.now().diff(createdAtDate, 'hours').hours;
|
|
786
|
+
let updatedComments = [];
|
|
787
|
+
if (diffInHours >= 24) {
|
|
788
|
+
updatedComments = updateCommentFromDiscussion(comments, commentId, { userId, user }, parentId);
|
|
789
|
+
}
|
|
790
|
+
else {
|
|
791
|
+
updatedComments = removeCommnetFromDiscussion(comments, commentId, parentId);
|
|
792
|
+
}
|
|
783
793
|
cache.writeFragment({
|
|
784
794
|
id: cache.identify({
|
|
785
795
|
id: questionId,
|
|
@@ -787,7 +797,7 @@ export const updateQuestionCommentsRemove = (typeId) => (cache, result, options)
|
|
|
787
797
|
}),
|
|
788
798
|
data: {
|
|
789
799
|
...dataFragment,
|
|
790
|
-
comments:
|
|
800
|
+
comments: updatedComments,
|
|
791
801
|
},
|
|
792
802
|
fragment: getQuestionFragment(typeId),
|
|
793
803
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { EDifficultyType,
|
|
1
|
+
import { EDifficultyType, Id, IDashboardOsce, IOsceMarksheet, IOsceStation, IOsceStats, IUser } from '../../../models';
|
|
2
2
|
import { ESortOrder } from '../../enums';
|
|
3
3
|
import { graphqlNormalize, RestrictedData } from '../../types';
|
|
4
4
|
import { ITopic } from './../../../models/Topic';
|
|
5
5
|
export interface IOsceStatsVar {
|
|
6
|
-
typeId?: EOsceType[] | EPaceType[];
|
|
7
6
|
solo: boolean;
|
|
8
7
|
}
|
|
9
8
|
export type IOsceStatsData = RestrictedData<graphqlNormalize & IOsceStats, 'osceStats'>;
|
|
@@ -52,7 +51,6 @@ export interface IOsceMarksheetVar {
|
|
|
52
51
|
export type IOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'osceMarksheet'>;
|
|
53
52
|
export declare const OSCE_STATIONS: import("@apollo/client").DocumentNode;
|
|
54
53
|
export interface IOsceStationsVar {
|
|
55
|
-
osceTypeId?: Id;
|
|
56
54
|
solo: boolean;
|
|
57
55
|
attempted?: boolean;
|
|
58
56
|
difficulty?: EDifficultyType[];
|
|
@@ -2,9 +2,9 @@ import { gql } from '@apollo/client';
|
|
|
2
2
|
import { OSCE_MARKSHEET_FIELDS } from '../../fragments/osce';
|
|
3
3
|
import { OSCE_STATION_FIELDS } from './../../fragments/osce';
|
|
4
4
|
export const OSCE_STATS = gql `
|
|
5
|
-
query OsceStats($solo: Boolean
|
|
5
|
+
query OsceStats($solo: Boolean!) {
|
|
6
6
|
restricted {
|
|
7
|
-
osceStats(solo: $solo
|
|
7
|
+
osceStats(solo: $solo) {
|
|
8
8
|
avgScore
|
|
9
9
|
completed
|
|
10
10
|
total
|
|
@@ -104,7 +104,6 @@ export const OSCE_MARKSHEET = gql `
|
|
|
104
104
|
export const OSCE_STATIONS = gql `
|
|
105
105
|
${OSCE_STATION_FIELDS}
|
|
106
106
|
query OsceStations(
|
|
107
|
-
$osceTypeId: Int
|
|
108
107
|
$solo: Boolean!
|
|
109
108
|
$attempted: Boolean
|
|
110
109
|
$difficulty: [Int!]
|
|
@@ -112,7 +111,6 @@ export const OSCE_STATIONS = gql `
|
|
|
112
111
|
) {
|
|
113
112
|
restricted {
|
|
114
113
|
osceStations(
|
|
115
|
-
osceTypeId: $osceTypeId
|
|
116
114
|
solo: $solo
|
|
117
115
|
attempted: $attempted
|
|
118
116
|
difficulty: $difficulty
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ETopicType, IConcept, IOsceStation, ITopic } from '../../../models';
|
|
2
2
|
import { RestrictedData, graphqlNormalize } from '../../types';
|
|
3
3
|
export type IQuesBookVar = {
|
|
4
4
|
/**TODO: make it mandatory once frontend changes are completed */
|
|
@@ -9,15 +9,11 @@ export type IQuesBookData = RestrictedData<(graphqlNormalize & ITopic)[], 'quesB
|
|
|
9
9
|
export declare const QBANK_KNOWLEDGE_VIDEO_LIBRARY: import("@apollo/client").DocumentNode;
|
|
10
10
|
export declare const PUBLIC_QBANK_KNOWLEDGE_LIBRARY: import("@apollo/client").DocumentNode;
|
|
11
11
|
export type IOsceBookVar = {
|
|
12
|
-
/**TODO: make it mandatory once frontend changes are completed */
|
|
13
|
-
typeId?: EOsceType[] | EPaceType[];
|
|
14
12
|
videosOnly?: boolean;
|
|
15
13
|
};
|
|
16
14
|
export type IOsceBookData = RestrictedData<(graphqlNormalize & IOsceStation)[], 'osceBook'>;
|
|
17
15
|
export declare const OSCE_KNOWLEDGE_VIDEO_LIBRARY: import("@apollo/client").DocumentNode;
|
|
18
|
-
export type IPaceBookVar =
|
|
19
|
-
typeId?: EPaceType[];
|
|
20
|
-
};
|
|
16
|
+
export type IPaceBookVar = null;
|
|
21
17
|
export type IPaceBookData = RestrictedData<(graphqlNormalize & IConcept)[], 'paceBook'>;
|
|
22
18
|
export declare const PACE_KNOWLEDGE_LIBRARY: import("@apollo/client").DocumentNode;
|
|
23
19
|
export declare const PACE_VIDEO_LIBRARY: import("@apollo/client").DocumentNode;
|
|
@@ -122,9 +122,9 @@ export const PUBLIC_QBANK_KNOWLEDGE_LIBRARY = gql `
|
|
|
122
122
|
`;
|
|
123
123
|
export const OSCE_KNOWLEDGE_VIDEO_LIBRARY = gql `
|
|
124
124
|
${OSCE_STATION_FIELDS}
|
|
125
|
-
query OsceKnowledgeVideoLibrary($
|
|
125
|
+
query OsceKnowledgeVideoLibrary($videosOnly: Boolean) {
|
|
126
126
|
restricted {
|
|
127
|
-
osceBook(
|
|
127
|
+
osceBook(videosOnly: $videosOnly) {
|
|
128
128
|
...OsceStationFields
|
|
129
129
|
lastOsceMarksheetId
|
|
130
130
|
score
|
|
@@ -133,9 +133,9 @@ export const OSCE_KNOWLEDGE_VIDEO_LIBRARY = gql `
|
|
|
133
133
|
}
|
|
134
134
|
`;
|
|
135
135
|
export const PACE_KNOWLEDGE_LIBRARY = gql `
|
|
136
|
-
query PaceKnowledgeLibrary
|
|
136
|
+
query PaceKnowledgeLibrary {
|
|
137
137
|
restricted {
|
|
138
|
-
paceBook
|
|
138
|
+
paceBook {
|
|
139
139
|
id
|
|
140
140
|
name
|
|
141
141
|
demo
|
|
@@ -179,9 +179,9 @@ query PaceKnowledgeLibrary($typeId: [Int]) {
|
|
|
179
179
|
`;
|
|
180
180
|
export const PACE_VIDEO_LIBRARY = gql `
|
|
181
181
|
${OSCE_STATION_FIELDS}
|
|
182
|
-
query PaceVideoLibrary($
|
|
182
|
+
query PaceVideoLibrary($videosOnly: Boolean) {
|
|
183
183
|
restricted {
|
|
184
|
-
osceBook(
|
|
184
|
+
osceBook(videosOnly: $videosOnly) {
|
|
185
185
|
...OsceStationFields
|
|
186
186
|
lastOsceMarksheetId
|
|
187
187
|
score
|