@quesmed/types-rn 2.6.21 → 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 +52 -28
- package/resolvers/query/restricted/marksheet.js +26 -14
- package/resolvers/query/restricted/question.js +13 -7
- 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
|
@@ -584,27 +584,33 @@ exports.BUILD_QUESTION_MARKSHEET = (0, client_1.gql) `
|
|
|
584
584
|
prescribeAnswer: answer {
|
|
585
585
|
dose {
|
|
586
586
|
value
|
|
587
|
-
|
|
587
|
+
label
|
|
588
|
+
visible
|
|
588
589
|
}
|
|
589
590
|
drug {
|
|
590
591
|
value
|
|
591
|
-
|
|
592
|
+
label
|
|
593
|
+
visible
|
|
592
594
|
}
|
|
593
595
|
route {
|
|
594
596
|
value
|
|
595
|
-
|
|
597
|
+
label
|
|
598
|
+
visible
|
|
596
599
|
}
|
|
597
600
|
frequency {
|
|
598
|
-
display
|
|
599
601
|
value
|
|
602
|
+
label
|
|
603
|
+
visible
|
|
600
604
|
}
|
|
601
605
|
duration {
|
|
602
|
-
display
|
|
603
606
|
value
|
|
607
|
+
label
|
|
608
|
+
visible
|
|
604
609
|
}
|
|
605
|
-
|
|
606
|
-
display
|
|
610
|
+
unit {
|
|
607
611
|
value
|
|
612
|
+
label
|
|
613
|
+
visible
|
|
608
614
|
}
|
|
609
615
|
}
|
|
610
616
|
}
|
|
@@ -1602,27 +1608,33 @@ exports.BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
1602
1608
|
prescribeAnswer: answer {
|
|
1603
1609
|
dose {
|
|
1604
1610
|
value
|
|
1605
|
-
|
|
1611
|
+
label
|
|
1612
|
+
visible
|
|
1606
1613
|
}
|
|
1607
1614
|
drug {
|
|
1608
1615
|
value
|
|
1609
|
-
|
|
1616
|
+
label
|
|
1617
|
+
visible
|
|
1610
1618
|
}
|
|
1611
1619
|
route {
|
|
1612
1620
|
value
|
|
1613
|
-
|
|
1621
|
+
label
|
|
1622
|
+
visible
|
|
1614
1623
|
}
|
|
1615
1624
|
frequency {
|
|
1616
|
-
display
|
|
1617
1625
|
value
|
|
1626
|
+
label
|
|
1627
|
+
visible
|
|
1618
1628
|
}
|
|
1619
1629
|
duration {
|
|
1620
|
-
display
|
|
1621
1630
|
value
|
|
1631
|
+
label
|
|
1632
|
+
visible
|
|
1622
1633
|
}
|
|
1623
|
-
|
|
1624
|
-
display
|
|
1634
|
+
unit {
|
|
1625
1635
|
value
|
|
1636
|
+
label
|
|
1637
|
+
visible
|
|
1626
1638
|
}
|
|
1627
1639
|
}
|
|
1628
1640
|
}
|
|
@@ -2625,27 +2637,33 @@ exports.RE_BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
2625
2637
|
prescribeAnswer: answer {
|
|
2626
2638
|
dose {
|
|
2627
2639
|
value
|
|
2628
|
-
|
|
2640
|
+
label
|
|
2641
|
+
visible
|
|
2629
2642
|
}
|
|
2630
2643
|
drug {
|
|
2631
2644
|
value
|
|
2632
|
-
|
|
2645
|
+
label
|
|
2646
|
+
visible
|
|
2633
2647
|
}
|
|
2634
2648
|
route {
|
|
2635
2649
|
value
|
|
2636
|
-
|
|
2650
|
+
label
|
|
2651
|
+
visible
|
|
2637
2652
|
}
|
|
2638
2653
|
frequency {
|
|
2639
|
-
display
|
|
2640
2654
|
value
|
|
2655
|
+
label
|
|
2656
|
+
visible
|
|
2641
2657
|
}
|
|
2642
2658
|
duration {
|
|
2643
|
-
display
|
|
2644
2659
|
value
|
|
2660
|
+
label
|
|
2661
|
+
visible
|
|
2645
2662
|
}
|
|
2646
|
-
|
|
2647
|
-
display
|
|
2663
|
+
unit {
|
|
2648
2664
|
value
|
|
2665
|
+
label
|
|
2666
|
+
visible
|
|
2649
2667
|
}
|
|
2650
2668
|
}
|
|
2651
2669
|
}
|
|
@@ -3626,27 +3644,33 @@ exports.QUICK_BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
3626
3644
|
prescribeAnswer: answer {
|
|
3627
3645
|
dose {
|
|
3628
3646
|
value
|
|
3629
|
-
|
|
3647
|
+
label
|
|
3648
|
+
visible
|
|
3630
3649
|
}
|
|
3631
3650
|
drug {
|
|
3632
3651
|
value
|
|
3633
|
-
|
|
3652
|
+
label
|
|
3653
|
+
visible
|
|
3634
3654
|
}
|
|
3635
3655
|
route {
|
|
3636
3656
|
value
|
|
3637
|
-
|
|
3657
|
+
label
|
|
3658
|
+
visible
|
|
3638
3659
|
}
|
|
3639
3660
|
frequency {
|
|
3640
|
-
display
|
|
3641
3661
|
value
|
|
3662
|
+
label
|
|
3663
|
+
visible
|
|
3642
3664
|
}
|
|
3643
3665
|
duration {
|
|
3644
|
-
display
|
|
3645
3666
|
value
|
|
3667
|
+
label
|
|
3668
|
+
visible
|
|
3646
3669
|
}
|
|
3647
|
-
|
|
3648
|
-
display
|
|
3670
|
+
unit {
|
|
3649
3671
|
value
|
|
3672
|
+
label
|
|
3673
|
+
visible
|
|
3650
3674
|
}
|
|
3651
3675
|
}
|
|
3652
3676
|
}
|
|
@@ -586,27 +586,33 @@ exports.MARKSHEET = (0, client_1.gql) `
|
|
|
586
586
|
prescribeAnswer: answer {
|
|
587
587
|
dose {
|
|
588
588
|
value
|
|
589
|
-
|
|
589
|
+
label
|
|
590
|
+
visible
|
|
590
591
|
}
|
|
591
592
|
drug {
|
|
592
593
|
value
|
|
593
|
-
|
|
594
|
+
label
|
|
595
|
+
visible
|
|
594
596
|
}
|
|
595
597
|
route {
|
|
596
598
|
value
|
|
597
|
-
|
|
599
|
+
label
|
|
600
|
+
visible
|
|
598
601
|
}
|
|
599
602
|
frequency {
|
|
600
|
-
display
|
|
601
603
|
value
|
|
604
|
+
label
|
|
605
|
+
visible
|
|
602
606
|
}
|
|
603
607
|
duration {
|
|
604
|
-
display
|
|
605
608
|
value
|
|
609
|
+
label
|
|
610
|
+
visible
|
|
606
611
|
}
|
|
607
|
-
|
|
608
|
-
display
|
|
612
|
+
unit {
|
|
609
613
|
value
|
|
614
|
+
label
|
|
615
|
+
visible
|
|
610
616
|
}
|
|
611
617
|
}
|
|
612
618
|
}
|
|
@@ -1705,27 +1711,33 @@ exports.FLAGGED_QUESTIONS_MARKSHEET = (0, client_1.gql) `
|
|
|
1705
1711
|
prescribeAnswer: answer {
|
|
1706
1712
|
dose {
|
|
1707
1713
|
value
|
|
1708
|
-
|
|
1714
|
+
label
|
|
1715
|
+
visible
|
|
1709
1716
|
}
|
|
1710
1717
|
drug {
|
|
1711
1718
|
value
|
|
1712
|
-
|
|
1719
|
+
label
|
|
1720
|
+
visible
|
|
1713
1721
|
}
|
|
1714
1722
|
route {
|
|
1715
1723
|
value
|
|
1716
|
-
|
|
1724
|
+
label
|
|
1725
|
+
visible
|
|
1717
1726
|
}
|
|
1718
1727
|
frequency {
|
|
1719
|
-
display
|
|
1720
1728
|
value
|
|
1729
|
+
label
|
|
1730
|
+
visible
|
|
1721
1731
|
}
|
|
1722
1732
|
duration {
|
|
1723
|
-
display
|
|
1724
1733
|
value
|
|
1734
|
+
label
|
|
1735
|
+
visible
|
|
1725
1736
|
}
|
|
1726
|
-
|
|
1727
|
-
display
|
|
1737
|
+
unit {
|
|
1728
1738
|
value
|
|
1739
|
+
label
|
|
1740
|
+
visible
|
|
1729
1741
|
}
|
|
1730
1742
|
}
|
|
1731
1743
|
}
|
|
@@ -514,27 +514,33 @@ exports.QUESTION = (0, client_1.gql) `
|
|
|
514
514
|
prescribeAnswer: answer {
|
|
515
515
|
dose {
|
|
516
516
|
value
|
|
517
|
-
|
|
517
|
+
label
|
|
518
|
+
visible
|
|
518
519
|
}
|
|
519
520
|
drug {
|
|
520
521
|
value
|
|
521
|
-
|
|
522
|
+
label
|
|
523
|
+
visible
|
|
522
524
|
}
|
|
523
525
|
route {
|
|
524
526
|
value
|
|
525
|
-
|
|
527
|
+
label
|
|
528
|
+
visible
|
|
526
529
|
}
|
|
527
530
|
frequency {
|
|
528
|
-
display
|
|
529
531
|
value
|
|
532
|
+
label
|
|
533
|
+
visible
|
|
530
534
|
}
|
|
531
535
|
duration {
|
|
532
|
-
display
|
|
533
536
|
value
|
|
537
|
+
label
|
|
538
|
+
visible
|
|
534
539
|
}
|
|
535
|
-
|
|
536
|
-
display
|
|
540
|
+
unit {
|
|
537
541
|
value
|
|
542
|
+
label
|
|
543
|
+
visible
|
|
538
544
|
}
|
|
539
545
|
}
|
|
540
546
|
}
|
|
@@ -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,
|