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