@quesmed/types 2.6.22 → 2.6.24

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.
@@ -86,7 +86,6 @@ export interface IQuestion {
86
86
  difficulty: EDifficultyType;
87
87
  elo: number;
88
88
  psaSectionId: EPsaSectionType;
89
- prescriptions?: IQuestionPrescription[];
90
89
  likes?: number;
91
90
  dislikes?: number;
92
91
  isLikedByMe?: EQuestionLike;
@@ -198,17 +197,18 @@ export interface IQuestionPrescribe extends IQuestion {
198
197
  answer: IPrescribeMark[];
199
198
  prescribeAnswer: IQuestionPrescription[];
200
199
  }
201
- export type IPrescribeAnswerData<T> = {
202
- value: T;
203
- display: boolean;
200
+ export type IPrescribeAnswerData = {
201
+ value: number;
202
+ visible: boolean;
203
+ label: string;
204
204
  };
205
205
  export interface IPrescribeAnswer {
206
- drug: IPrescribeAnswerData<string>;
207
- dose: IPrescribeAnswerData<number>;
208
- units: IPrescribeAnswerData<string>;
209
- route: IPrescribeAnswerData<string>;
210
- frequency: IPrescribeAnswerData<string>;
211
- duration: IPrescribeAnswerData<string>;
206
+ drug: IPrescribeAnswerData;
207
+ dose: IPrescribeAnswerData;
208
+ unit: IPrescribeAnswerData;
209
+ route: IPrescribeAnswerData;
210
+ frequency: IPrescribeAnswerData;
211
+ duration: IPrescribeAnswerData;
212
212
  }
213
213
  export interface IPrescribeMark {
214
214
  drugId: number;
@@ -36,7 +36,7 @@ export interface ITopic {
36
36
  deletedAt: number | Date;
37
37
  name: string;
38
38
  demo?: boolean;
39
- entitlement?: IConcept[];
39
+ entitlement: EProductType;
40
40
  typeId: ETopicType | null;
41
41
  productId: EProductType | null;
42
42
  type?: ITopicType | null;
@@ -582,12 +582,36 @@ exports.BUILD_QUESTION_MARKSHEET = (0, client_1.gql) `
582
582
  dislikes
583
583
  isLikedByMe
584
584
  prescribeAnswer: answer {
585
- doseId
586
- durationId
587
- drugId
588
- routeId
589
- unitId
590
- frequencyId
585
+ dose {
586
+ value
587
+ label
588
+ visible
589
+ }
590
+ drug {
591
+ value
592
+ label
593
+ visible
594
+ }
595
+ route {
596
+ value
597
+ label
598
+ visible
599
+ }
600
+ frequency {
601
+ value
602
+ label
603
+ visible
604
+ }
605
+ duration {
606
+ value
607
+ label
608
+ visible
609
+ }
610
+ unit {
611
+ value
612
+ label
613
+ visible
614
+ }
591
615
  }
592
616
  }
593
617
  ... on QuestionEMQ {
@@ -1582,12 +1606,36 @@ exports.BUILD_MARKSHEET = (0, client_1.gql) `
1582
1606
  dislikes
1583
1607
  isLikedByMe
1584
1608
  prescribeAnswer: answer {
1585
- doseId
1586
- durationId
1587
- drugId
1588
- routeId
1589
- unitId
1590
- frequencyId
1609
+ dose {
1610
+ value
1611
+ label
1612
+ visible
1613
+ }
1614
+ drug {
1615
+ value
1616
+ label
1617
+ visible
1618
+ }
1619
+ route {
1620
+ value
1621
+ label
1622
+ visible
1623
+ }
1624
+ frequency {
1625
+ value
1626
+ label
1627
+ visible
1628
+ }
1629
+ duration {
1630
+ value
1631
+ label
1632
+ visible
1633
+ }
1634
+ unit {
1635
+ value
1636
+ label
1637
+ visible
1638
+ }
1591
1639
  }
1592
1640
  }
1593
1641
  ... on QuestionEMQ {
@@ -2587,12 +2635,36 @@ exports.RE_BUILD_MARKSHEET = (0, client_1.gql) `
2587
2635
  dislikes
2588
2636
  isLikedByMe
2589
2637
  prescribeAnswer: answer {
2590
- doseId
2591
- durationId
2592
- drugId
2593
- routeId
2594
- unitId
2595
- frequencyId
2638
+ dose {
2639
+ value
2640
+ label
2641
+ visible
2642
+ }
2643
+ drug {
2644
+ value
2645
+ label
2646
+ visible
2647
+ }
2648
+ route {
2649
+ value
2650
+ label
2651
+ visible
2652
+ }
2653
+ frequency {
2654
+ value
2655
+ label
2656
+ visible
2657
+ }
2658
+ duration {
2659
+ value
2660
+ label
2661
+ visible
2662
+ }
2663
+ unit {
2664
+ value
2665
+ label
2666
+ visible
2667
+ }
2596
2668
  }
2597
2669
  }
2598
2670
  ... on QuestionEMQ {
@@ -3570,12 +3642,36 @@ exports.QUICK_BUILD_MARKSHEET = (0, client_1.gql) `
3570
3642
  dislikes
3571
3643
  isLikedByMe
3572
3644
  prescribeAnswer: answer {
3573
- doseId
3574
- durationId
3575
- drugId
3576
- routeId
3577
- unitId
3578
- frequencyId
3645
+ dose {
3646
+ value
3647
+ label
3648
+ visible
3649
+ }
3650
+ drug {
3651
+ value
3652
+ label
3653
+ visible
3654
+ }
3655
+ route {
3656
+ value
3657
+ label
3658
+ visible
3659
+ }
3660
+ frequency {
3661
+ value
3662
+ label
3663
+ visible
3664
+ }
3665
+ duration {
3666
+ value
3667
+ label
3668
+ visible
3669
+ }
3670
+ unit {
3671
+ value
3672
+ label
3673
+ visible
3674
+ }
3579
3675
  }
3580
3676
  }
3581
3677
  ... on QuestionEMQ {
@@ -7,8 +7,8 @@ exports.LOGOUT_USER = (0, client_1.gql) `
7
7
  mutation LogoutUser($all: Boolean!) {
8
8
  restricted {
9
9
  logoutUser(all: $all)
10
- }
11
10
  }
11
+ }
12
12
  `;
13
13
  exports.RESET_PROGRESS = (0, client_1.gql) `
14
14
  mutation ResetProgress($questions: Boolean, $cards: Boolean) {
@@ -12,6 +12,7 @@ exports.PRODUCTS = (0, client_1.gql) `
12
12
  name
13
13
  price
14
14
  stripePriceId
15
+ subscription
15
16
  duration
16
17
  public
17
18
  typeId
@@ -584,12 +584,36 @@ exports.MARKSHEET = (0, client_1.gql) `
584
584
  dislikes
585
585
  isLikedByMe
586
586
  prescribeAnswer: answer {
587
- doseId
588
- durationId
589
- drugId
590
- routeId
591
- unitId
592
- frequencyId
587
+ dose {
588
+ value
589
+ label
590
+ visible
591
+ }
592
+ drug {
593
+ value
594
+ label
595
+ visible
596
+ }
597
+ route {
598
+ value
599
+ label
600
+ visible
601
+ }
602
+ frequency {
603
+ value
604
+ label
605
+ visible
606
+ }
607
+ duration {
608
+ value
609
+ label
610
+ visible
611
+ }
612
+ unit {
613
+ value
614
+ label
615
+ visible
616
+ }
593
617
  }
594
618
  }
595
619
  ... on QuestionEMQ {
@@ -1685,12 +1709,36 @@ exports.FLAGGED_QUESTIONS_MARKSHEET = (0, client_1.gql) `
1685
1709
  dislikes
1686
1710
  isLikedByMe
1687
1711
  prescribeAnswer: answer {
1688
- doseId
1689
- durationId
1690
- drugId
1691
- routeId
1692
- unitId
1693
- frequencyId
1712
+ dose {
1713
+ value
1714
+ label
1715
+ visible
1716
+ }
1717
+ drug {
1718
+ value
1719
+ label
1720
+ visible
1721
+ }
1722
+ route {
1723
+ value
1724
+ label
1725
+ visible
1726
+ }
1727
+ frequency {
1728
+ value
1729
+ label
1730
+ visible
1731
+ }
1732
+ duration {
1733
+ value
1734
+ label
1735
+ visible
1736
+ }
1737
+ unit {
1738
+ value
1739
+ label
1740
+ visible
1741
+ }
1694
1742
  }
1695
1743
  }
1696
1744
  ... on QuestionEMQ {
@@ -102,6 +102,7 @@ exports.DASHBOARD_QBANK = (0, client_1.gql) `
102
102
  topics(filter: 0) {
103
103
  id
104
104
  name
105
+ entitlement
105
106
  totalQuestions
106
107
  correctQuestions
107
108
  incorrectQuestions
@@ -10,6 +10,7 @@ exports.QBANK_KNOWLEDGE_VIDEO_LIBRARY = (0, client_1.gql) `
10
10
  id
11
11
  name
12
12
  typeId
13
+ entitlement
13
14
  demo
14
15
  unreadConcepts
15
16
  completedConcepts
@@ -70,6 +71,7 @@ exports.PUBLIC_QBANK_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
70
71
  id
71
72
  name
72
73
  typeId
74
+ entitlement
73
75
  demo
74
76
  unreadConcepts
75
77
  completedConcepts
@@ -136,59 +138,59 @@ exports.OSCE_KNOWLEDGE_VIDEO_LIBRARY = (0, client_1.gql) `
136
138
  }
137
139
  `;
138
140
  exports.PACE_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
139
- query PaceKnowledgeLibrary {
140
- restricted {
141
- paceBook {
142
- id
143
- name
144
- demo
145
- status
146
- typeId
147
- chapter {
141
+ query PaceKnowledgeLibrary {
142
+ restricted {
143
+ paceBook {
148
144
  id
145
+ name
146
+ demo
147
+ status
149
148
  typeId
150
- explanation
151
- pictures {
149
+ chapter {
152
150
  id
153
- createdAt
154
- updatedAt
155
- name
156
- caption
157
- path
158
- path512
159
- path256
160
- index
151
+ typeId
152
+ explanation
153
+ pictures {
154
+ id
155
+ createdAt
156
+ updatedAt
157
+ name
158
+ caption
159
+ path
160
+ path512
161
+ path256
162
+ index
163
+ }
161
164
  }
162
- }
163
- topicId
164
- videos {
165
- id
166
- demo
167
- status
168
- title
169
- museId
170
- thumbnail
171
- concepts {
165
+ topicId
166
+ videos {
172
167
  id
173
- name
168
+ demo
169
+ status
170
+ title
171
+ museId
172
+ thumbnail
173
+ concepts {
174
+ id
175
+ name
176
+ }
177
+ live
178
+ description
179
+ duration
174
180
  }
175
- live
176
- description
177
- duration
178
181
  }
179
182
  }
180
183
  }
181
- }
182
184
  `;
183
185
  exports.PACE_VIDEO_LIBRARY = (0, client_1.gql) `
184
- ${osce_1.OSCE_STATION_FIELDS}
185
- query PaceVideoLibrary($videosOnly: Boolean) {
186
- restricted {
187
- osceBook(videosOnly: $videosOnly) {
188
- ...OsceStationFields
189
- lastOsceMarksheetId
190
- score
186
+ ${osce_1.OSCE_STATION_FIELDS}
187
+ query PaceVideoLibrary($videosOnly: Boolean) {
188
+ restricted {
189
+ osceBook(videosOnly: $videosOnly) {
190
+ ...OsceStationFields
191
+ lastOsceMarksheetId
192
+ score
193
+ }
191
194
  }
192
195
  }
193
- }
194
196
  `;
@@ -512,12 +512,36 @@ exports.QUESTION = (0, client_1.gql) `
512
512
  dislikes
513
513
  isLikedByMe
514
514
  prescribeAnswer: answer {
515
- doseId
516
- durationId
517
- drugId
518
- routeId
519
- unitId
520
- frequencyId
515
+ dose {
516
+ value
517
+ label
518
+ visible
519
+ }
520
+ drug {
521
+ value
522
+ label
523
+ visible
524
+ }
525
+ route {
526
+ value
527
+ label
528
+ visible
529
+ }
530
+ frequency {
531
+ value
532
+ label
533
+ visible
534
+ }
535
+ duration {
536
+ value
537
+ label
538
+ visible
539
+ }
540
+ unit {
541
+ value
542
+ label
543
+ visible
544
+ }
521
545
  }
522
546
  }
523
547
  ... on QuestionEMQ {
@@ -36,6 +36,7 @@ exports.TOPICS = (0, client_1.gql) `
36
36
  yellowCards
37
37
  redCards
38
38
  typeId
39
+ entitlement
39
40
  concepts {
40
41
  id
41
42
  name
@@ -57,6 +58,7 @@ exports.QUESTION_TOPICS = (0, client_1.gql) `
57
58
  correctQuestions
58
59
  incorrectQuestions
59
60
  typeId
61
+ entitlement
60
62
  concepts {
61
63
  id
62
64
  name
@@ -80,6 +82,7 @@ exports.FLASHCARDS_TOPICS = (0, client_1.gql) `
80
82
  yellowCards
81
83
  redCards
82
84
  typeId
85
+ entitlement
83
86
  concepts {
84
87
  id
85
88
  name
@@ -1,8 +1,9 @@
1
- import { IMarksheetMark, IPrescribeMark, IQuestionPrescription } from '../models';
1
+ import { IMarksheetMark, IPrescribeAnswer, IPrescribeMark } from '../models';
2
2
  export interface ICorrectMarkData {
3
3
  correct: boolean;
4
4
  incorrect: boolean;
5
5
  correctIndex: number;
6
6
  }
7
- export declare function mapPrescribeMarkToAnswer(obj: IQuestionPrescription | IPrescribeMark): IPrescribeMark;
7
+ export declare function isPrescribeAnswer(data: IPrescribeAnswer | IPrescribeMark): data is IPrescribeAnswer;
8
+ export declare function mapPrescribeMarkToAnswer(obj: IPrescribeAnswer | IPrescribeMark): IPrescribeMark;
8
9
  export declare function correctMark(mark: IMarksheetMark): ICorrectMarkData;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.correctMark = exports.mapPrescribeMarkToAnswer = void 0;
3
+ exports.correctMark = exports.mapPrescribeMarkToAnswer = exports.isPrescribeAnswer = void 0;
4
4
  const models_1 = require("../models");
5
5
  const object_1 = require("./object");
6
6
  function createHashMap(arr) {
@@ -12,7 +12,21 @@ function createHashMap(arr) {
12
12
  }
13
13
  return map;
14
14
  }
15
+ function isPrescribeAnswer(data) {
16
+ return Object(data).hasOwnProperty('dose');
17
+ }
18
+ exports.isPrescribeAnswer = isPrescribeAnswer;
15
19
  function mapPrescribeMarkToAnswer(obj) {
20
+ if (isPrescribeAnswer(obj)) {
21
+ return {
22
+ drugId: obj.drug.value,
23
+ doseId: obj.dose.value,
24
+ durationId: obj.duration.value,
25
+ frequencyId: obj.frequency.value,
26
+ unitId: obj.unit.value,
27
+ routeId: obj.route.value,
28
+ };
29
+ }
16
30
  return {
17
31
  drugId: obj.drugId,
18
32
  doseId: obj.doseId,
@@ -86,7 +86,6 @@ export interface IQuestion {
86
86
  difficulty: EDifficultyType;
87
87
  elo: number;
88
88
  psaSectionId: EPsaSectionType;
89
- prescriptions?: IQuestionPrescription[];
90
89
  likes?: number;
91
90
  dislikes?: number;
92
91
  isLikedByMe?: EQuestionLike;
@@ -198,17 +197,18 @@ export interface IQuestionPrescribe extends IQuestion {
198
197
  answer: IPrescribeMark[];
199
198
  prescribeAnswer: IQuestionPrescription[];
200
199
  }
201
- export type IPrescribeAnswerData<T> = {
202
- value: T;
203
- display: boolean;
200
+ export type IPrescribeAnswerData = {
201
+ value: number;
202
+ visible: boolean;
203
+ label: string;
204
204
  };
205
205
  export interface IPrescribeAnswer {
206
- drug: IPrescribeAnswerData<string>;
207
- dose: IPrescribeAnswerData<number>;
208
- units: IPrescribeAnswerData<string>;
209
- route: IPrescribeAnswerData<string>;
210
- frequency: IPrescribeAnswerData<string>;
211
- duration: IPrescribeAnswerData<string>;
206
+ drug: IPrescribeAnswerData;
207
+ dose: IPrescribeAnswerData;
208
+ unit: IPrescribeAnswerData;
209
+ route: IPrescribeAnswerData;
210
+ frequency: IPrescribeAnswerData;
211
+ duration: IPrescribeAnswerData;
212
212
  }
213
213
  export interface IPrescribeMark {
214
214
  drugId: number;
@@ -36,7 +36,7 @@ export interface ITopic {
36
36
  deletedAt: number | Date;
37
37
  name: string;
38
38
  demo?: boolean;
39
- entitlement?: IConcept[];
39
+ entitlement: EProductType;
40
40
  typeId: ETopicType | null;
41
41
  productId: EProductType | null;
42
42
  type?: ITopicType | null;
@@ -579,12 +579,36 @@ export const BUILD_QUESTION_MARKSHEET = gql `
579
579
  dislikes
580
580
  isLikedByMe
581
581
  prescribeAnswer: answer {
582
- doseId
583
- durationId
584
- drugId
585
- routeId
586
- unitId
587
- frequencyId
582
+ dose {
583
+ value
584
+ label
585
+ visible
586
+ }
587
+ drug {
588
+ value
589
+ label
590
+ visible
591
+ }
592
+ route {
593
+ value
594
+ label
595
+ visible
596
+ }
597
+ frequency {
598
+ value
599
+ label
600
+ visible
601
+ }
602
+ duration {
603
+ value
604
+ label
605
+ visible
606
+ }
607
+ unit {
608
+ value
609
+ label
610
+ visible
611
+ }
588
612
  }
589
613
  }
590
614
  ... on QuestionEMQ {
@@ -1579,12 +1603,36 @@ export const BUILD_MARKSHEET = gql `
1579
1603
  dislikes
1580
1604
  isLikedByMe
1581
1605
  prescribeAnswer: answer {
1582
- doseId
1583
- durationId
1584
- drugId
1585
- routeId
1586
- unitId
1587
- frequencyId
1606
+ dose {
1607
+ value
1608
+ label
1609
+ visible
1610
+ }
1611
+ drug {
1612
+ value
1613
+ label
1614
+ visible
1615
+ }
1616
+ route {
1617
+ value
1618
+ label
1619
+ visible
1620
+ }
1621
+ frequency {
1622
+ value
1623
+ label
1624
+ visible
1625
+ }
1626
+ duration {
1627
+ value
1628
+ label
1629
+ visible
1630
+ }
1631
+ unit {
1632
+ value
1633
+ label
1634
+ visible
1635
+ }
1588
1636
  }
1589
1637
  }
1590
1638
  ... on QuestionEMQ {
@@ -2584,12 +2632,36 @@ export const RE_BUILD_MARKSHEET = gql `
2584
2632
  dislikes
2585
2633
  isLikedByMe
2586
2634
  prescribeAnswer: answer {
2587
- doseId
2588
- durationId
2589
- drugId
2590
- routeId
2591
- unitId
2592
- frequencyId
2635
+ dose {
2636
+ value
2637
+ label
2638
+ visible
2639
+ }
2640
+ drug {
2641
+ value
2642
+ label
2643
+ visible
2644
+ }
2645
+ route {
2646
+ value
2647
+ label
2648
+ visible
2649
+ }
2650
+ frequency {
2651
+ value
2652
+ label
2653
+ visible
2654
+ }
2655
+ duration {
2656
+ value
2657
+ label
2658
+ visible
2659
+ }
2660
+ unit {
2661
+ value
2662
+ label
2663
+ visible
2664
+ }
2593
2665
  }
2594
2666
  }
2595
2667
  ... on QuestionEMQ {
@@ -3567,12 +3639,36 @@ export const QUICK_BUILD_MARKSHEET = gql `
3567
3639
  dislikes
3568
3640
  isLikedByMe
3569
3641
  prescribeAnswer: answer {
3570
- doseId
3571
- durationId
3572
- drugId
3573
- routeId
3574
- unitId
3575
- frequencyId
3642
+ dose {
3643
+ value
3644
+ label
3645
+ visible
3646
+ }
3647
+ drug {
3648
+ value
3649
+ label
3650
+ visible
3651
+ }
3652
+ route {
3653
+ value
3654
+ label
3655
+ visible
3656
+ }
3657
+ frequency {
3658
+ value
3659
+ label
3660
+ visible
3661
+ }
3662
+ duration {
3663
+ value
3664
+ label
3665
+ visible
3666
+ }
3667
+ unit {
3668
+ value
3669
+ label
3670
+ visible
3671
+ }
3576
3672
  }
3577
3673
  }
3578
3674
  ... on QuestionEMQ {
@@ -4,8 +4,8 @@ export const LOGOUT_USER = gql `
4
4
  mutation LogoutUser($all: Boolean!) {
5
5
  restricted {
6
6
  logoutUser(all: $all)
7
- }
8
7
  }
8
+ }
9
9
  `;
10
10
  export const RESET_PROGRESS = gql `
11
11
  mutation ResetProgress($questions: Boolean, $cards: Boolean) {
@@ -9,6 +9,7 @@ export const PRODUCTS = gql `
9
9
  name
10
10
  price
11
11
  stripePriceId
12
+ subscription
12
13
  duration
13
14
  public
14
15
  typeId
@@ -581,12 +581,36 @@ export const MARKSHEET = gql `
581
581
  dislikes
582
582
  isLikedByMe
583
583
  prescribeAnswer: answer {
584
- doseId
585
- durationId
586
- drugId
587
- routeId
588
- unitId
589
- frequencyId
584
+ dose {
585
+ value
586
+ label
587
+ visible
588
+ }
589
+ drug {
590
+ value
591
+ label
592
+ visible
593
+ }
594
+ route {
595
+ value
596
+ label
597
+ visible
598
+ }
599
+ frequency {
600
+ value
601
+ label
602
+ visible
603
+ }
604
+ duration {
605
+ value
606
+ label
607
+ visible
608
+ }
609
+ unit {
610
+ value
611
+ label
612
+ visible
613
+ }
590
614
  }
591
615
  }
592
616
  ... on QuestionEMQ {
@@ -1682,12 +1706,36 @@ export const FLAGGED_QUESTIONS_MARKSHEET = gql `
1682
1706
  dislikes
1683
1707
  isLikedByMe
1684
1708
  prescribeAnswer: answer {
1685
- doseId
1686
- durationId
1687
- drugId
1688
- routeId
1689
- unitId
1690
- frequencyId
1709
+ dose {
1710
+ value
1711
+ label
1712
+ visible
1713
+ }
1714
+ drug {
1715
+ value
1716
+ label
1717
+ visible
1718
+ }
1719
+ route {
1720
+ value
1721
+ label
1722
+ visible
1723
+ }
1724
+ frequency {
1725
+ value
1726
+ label
1727
+ visible
1728
+ }
1729
+ duration {
1730
+ value
1731
+ label
1732
+ visible
1733
+ }
1734
+ unit {
1735
+ value
1736
+ label
1737
+ visible
1738
+ }
1691
1739
  }
1692
1740
  }
1693
1741
  ... on QuestionEMQ {
@@ -99,6 +99,7 @@ export const DASHBOARD_QBANK = gql `
99
99
  topics(filter: 0) {
100
100
  id
101
101
  name
102
+ entitlement
102
103
  totalQuestions
103
104
  correctQuestions
104
105
  incorrectQuestions
@@ -7,6 +7,7 @@ export const QBANK_KNOWLEDGE_VIDEO_LIBRARY = gql `
7
7
  id
8
8
  name
9
9
  typeId
10
+ entitlement
10
11
  demo
11
12
  unreadConcepts
12
13
  completedConcepts
@@ -67,6 +68,7 @@ export const PUBLIC_QBANK_KNOWLEDGE_LIBRARY = gql `
67
68
  id
68
69
  name
69
70
  typeId
71
+ entitlement
70
72
  demo
71
73
  unreadConcepts
72
74
  completedConcepts
@@ -133,59 +135,59 @@ export const OSCE_KNOWLEDGE_VIDEO_LIBRARY = gql `
133
135
  }
134
136
  `;
135
137
  export const PACE_KNOWLEDGE_LIBRARY = gql `
136
- query PaceKnowledgeLibrary {
137
- restricted {
138
- paceBook {
139
- id
140
- name
141
- demo
142
- status
143
- typeId
144
- chapter {
138
+ query PaceKnowledgeLibrary {
139
+ restricted {
140
+ paceBook {
145
141
  id
142
+ name
143
+ demo
144
+ status
146
145
  typeId
147
- explanation
148
- pictures {
146
+ chapter {
149
147
  id
150
- createdAt
151
- updatedAt
152
- name
153
- caption
154
- path
155
- path512
156
- path256
157
- index
148
+ typeId
149
+ explanation
150
+ pictures {
151
+ id
152
+ createdAt
153
+ updatedAt
154
+ name
155
+ caption
156
+ path
157
+ path512
158
+ path256
159
+ index
160
+ }
158
161
  }
159
- }
160
- topicId
161
- videos {
162
- id
163
- demo
164
- status
165
- title
166
- museId
167
- thumbnail
168
- concepts {
162
+ topicId
163
+ videos {
169
164
  id
170
- name
165
+ demo
166
+ status
167
+ title
168
+ museId
169
+ thumbnail
170
+ concepts {
171
+ id
172
+ name
173
+ }
174
+ live
175
+ description
176
+ duration
171
177
  }
172
- live
173
- description
174
- duration
175
178
  }
176
179
  }
177
180
  }
178
- }
179
181
  `;
180
182
  export const PACE_VIDEO_LIBRARY = gql `
181
- ${OSCE_STATION_FIELDS}
182
- query PaceVideoLibrary($videosOnly: Boolean) {
183
- restricted {
184
- osceBook(videosOnly: $videosOnly) {
185
- ...OsceStationFields
186
- lastOsceMarksheetId
187
- score
183
+ ${OSCE_STATION_FIELDS}
184
+ query PaceVideoLibrary($videosOnly: Boolean) {
185
+ restricted {
186
+ osceBook(videosOnly: $videosOnly) {
187
+ ...OsceStationFields
188
+ lastOsceMarksheetId
189
+ score
190
+ }
188
191
  }
189
192
  }
190
- }
191
193
  `;
@@ -509,12 +509,36 @@ export const QUESTION = gql `
509
509
  dislikes
510
510
  isLikedByMe
511
511
  prescribeAnswer: answer {
512
- doseId
513
- durationId
514
- drugId
515
- routeId
516
- unitId
517
- frequencyId
512
+ dose {
513
+ value
514
+ label
515
+ visible
516
+ }
517
+ drug {
518
+ value
519
+ label
520
+ visible
521
+ }
522
+ route {
523
+ value
524
+ label
525
+ visible
526
+ }
527
+ frequency {
528
+ value
529
+ label
530
+ visible
531
+ }
532
+ duration {
533
+ value
534
+ label
535
+ visible
536
+ }
537
+ unit {
538
+ value
539
+ label
540
+ visible
541
+ }
518
542
  }
519
543
  }
520
544
  ... on QuestionEMQ {
@@ -33,6 +33,7 @@ export const TOPICS = gql `
33
33
  yellowCards
34
34
  redCards
35
35
  typeId
36
+ entitlement
36
37
  concepts {
37
38
  id
38
39
  name
@@ -54,6 +55,7 @@ export const QUESTION_TOPICS = gql `
54
55
  correctQuestions
55
56
  incorrectQuestions
56
57
  typeId
58
+ entitlement
57
59
  concepts {
58
60
  id
59
61
  name
@@ -77,6 +79,7 @@ export const FLASHCARDS_TOPICS = gql `
77
79
  yellowCards
78
80
  redCards
79
81
  typeId
82
+ entitlement
80
83
  concepts {
81
84
  id
82
85
  name
@@ -1,8 +1,9 @@
1
- import { IMarksheetMark, IPrescribeMark, IQuestionPrescription } from '../models';
1
+ import { IMarksheetMark, IPrescribeAnswer, IPrescribeMark } from '../models';
2
2
  export interface ICorrectMarkData {
3
3
  correct: boolean;
4
4
  incorrect: boolean;
5
5
  correctIndex: number;
6
6
  }
7
- export declare function mapPrescribeMarkToAnswer(obj: IQuestionPrescription | IPrescribeMark): IPrescribeMark;
7
+ export declare function isPrescribeAnswer(data: IPrescribeAnswer | IPrescribeMark): data is IPrescribeAnswer;
8
+ export declare function mapPrescribeMarkToAnswer(obj: IPrescribeAnswer | IPrescribeMark): IPrescribeMark;
8
9
  export declare function correctMark(mark: IMarksheetMark): ICorrectMarkData;
@@ -9,7 +9,20 @@ function createHashMap(arr) {
9
9
  }
10
10
  return map;
11
11
  }
12
+ export function isPrescribeAnswer(data) {
13
+ return Object(data).hasOwnProperty('dose');
14
+ }
12
15
  export function mapPrescribeMarkToAnswer(obj) {
16
+ if (isPrescribeAnswer(obj)) {
17
+ return {
18
+ drugId: obj.drug.value,
19
+ doseId: obj.dose.value,
20
+ durationId: obj.duration.value,
21
+ frequencyId: obj.frequency.value,
22
+ unitId: obj.unit.value,
23
+ routeId: obj.route.value,
24
+ };
25
+ }
13
26
  return {
14
27
  drugId: obj.drugId,
15
28
  doseId: obj.doseId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.22",
3
+ "version": "2.6.24",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",