@quesmed/types-rn 2.6.22 → 2.6.23
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/models/Question.d.ts +10 -10
- package/package.json +1 -1
- package/resolvers/mutation/restricted/marksheet.js +120 -24
- package/resolvers/query/restricted/marksheet.js +60 -12
- package/resolvers/query/restricted/question.js +30 -6
- package/utils/commonFunctions.d.ts +3 -2
- package/utils/commonFunctions.js +15 -1
package/models/Question.d.ts
CHANGED
|
@@ -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
|
|
202
|
-
value:
|
|
203
|
-
|
|
200
|
+
export type IPrescribeAnswerData = {
|
|
201
|
+
value: number;
|
|
202
|
+
visible: boolean;
|
|
203
|
+
label: string;
|
|
204
204
|
};
|
|
205
205
|
export interface IPrescribeAnswer {
|
|
206
|
-
drug: IPrescribeAnswerData
|
|
207
|
-
dose: IPrescribeAnswerData
|
|
208
|
-
|
|
209
|
-
route: IPrescribeAnswerData
|
|
210
|
-
frequency: IPrescribeAnswerData
|
|
211
|
-
duration: IPrescribeAnswerData
|
|
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/package.json
CHANGED
|
@@ -582,12 +582,36 @@ exports.BUILD_QUESTION_MARKSHEET = (0, client_1.gql) `
|
|
|
582
582
|
dislikes
|
|
583
583
|
isLikedByMe
|
|
584
584
|
prescribeAnswer: answer {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
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
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
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
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
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
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
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 {
|
|
@@ -584,12 +584,36 @@ exports.MARKSHEET = (0, client_1.gql) `
|
|
|
584
584
|
dislikes
|
|
585
585
|
isLikedByMe
|
|
586
586
|
prescribeAnswer: answer {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
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
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
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 {
|
|
@@ -512,12 +512,36 @@ exports.QUESTION = (0, client_1.gql) `
|
|
|
512
512
|
dislikes
|
|
513
513
|
isLikedByMe
|
|
514
514
|
prescribeAnswer: answer {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
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 {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { IMarksheetMark,
|
|
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
|
|
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;
|
package/utils/commonFunctions.js
CHANGED
|
@@ -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,
|