@quesmed/types 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.
@@ -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;
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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;
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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.23",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",