@quesmed/types-rn 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;
package/models/Topic.d.ts CHANGED
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.22",
3
+ "version": "2.6.24",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -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,