@quesmed/types 1.0.21 → 1.0.25

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.
@@ -5,6 +5,7 @@ export interface IMockTest {
5
5
  title: string;
6
6
  clinical: boolean;
7
7
  passingMark: number;
8
+ public: boolean;
8
9
  questions: IQuestion[];
9
10
  }
10
11
  export interface IUserMockTest {
@@ -1,6 +1,16 @@
1
1
  import { IConcept } from './Concept';
2
2
  import { IQuestionPicture } from './Picture';
3
3
  import { Id } from './Type';
4
+ export declare enum EPsaSectionType {
5
+ PRESCRIBING = 1,
6
+ PRESCRIPTION_REVIEW = 2,
7
+ PLANNING_MANAGEMENT = 3,
8
+ PROVIDING_INFORMATION = 4,
9
+ CALCULATION_SKILLS = 5,
10
+ ADVERSE_DRUG_REACTION = 6,
11
+ DRUG_MONITORING = 7,
12
+ DATA_INTERPRETATION = 8
13
+ }
4
14
  export declare enum EQuestionType {
5
15
  SINGLE_BEST_ANSWER = 1,
6
16
  QUESTION_ANSWER = 2,
@@ -20,6 +30,9 @@ export interface IQuestion {
20
30
  totalVotes: number;
21
31
  choices: IQuestionChoice[];
22
32
  pictures: IQuestionPicture[];
33
+ difficulty: number;
34
+ elo: number;
35
+ psaSectionId: EPsaSectionType;
23
36
  }
24
37
  export interface IQuestionChoice {
25
38
  id: Id;
@@ -46,10 +59,10 @@ export interface IQuestionPrescribe extends IQuestion {
46
59
  prescribeAnswer: IPrescribeAnswer[];
47
60
  }
48
61
  export interface IPrescribeAnswer {
49
- dose: number;
50
62
  drug: string;
51
- route: string;
63
+ dose: number;
52
64
  units: string;
53
- duration: string;
65
+ route: string;
54
66
  frequency: string;
67
+ duration: string;
55
68
  }
@@ -1,6 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EQuestionType = void 0;
3
+ exports.EQuestionType = exports.EPsaSectionType = void 0;
4
+ var EPsaSectionType;
5
+ (function (EPsaSectionType) {
6
+ EPsaSectionType[EPsaSectionType["PRESCRIBING"] = 1] = "PRESCRIBING";
7
+ EPsaSectionType[EPsaSectionType["PRESCRIPTION_REVIEW"] = 2] = "PRESCRIPTION_REVIEW";
8
+ EPsaSectionType[EPsaSectionType["PLANNING_MANAGEMENT"] = 3] = "PLANNING_MANAGEMENT";
9
+ EPsaSectionType[EPsaSectionType["PROVIDING_INFORMATION"] = 4] = "PROVIDING_INFORMATION";
10
+ EPsaSectionType[EPsaSectionType["CALCULATION_SKILLS"] = 5] = "CALCULATION_SKILLS";
11
+ EPsaSectionType[EPsaSectionType["ADVERSE_DRUG_REACTION"] = 6] = "ADVERSE_DRUG_REACTION";
12
+ EPsaSectionType[EPsaSectionType["DRUG_MONITORING"] = 7] = "DRUG_MONITORING";
13
+ EPsaSectionType[EPsaSectionType["DATA_INTERPRETATION"] = 8] = "DATA_INTERPRETATION";
14
+ })(EPsaSectionType = exports.EPsaSectionType || (exports.EPsaSectionType = {}));
4
15
  var EQuestionType;
5
16
  (function (EQuestionType) {
6
17
  EQuestionType[EQuestionType["SINGLE_BEST_ANSWER"] = 1] = "SINGLE_BEST_ANSWER";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "1.0.21",
3
+ "version": "1.0.25",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "main": "index.js",
6
6
  "types": "dist/index.d.ts",
@@ -45,7 +45,6 @@ export interface ISaveOsceMarksheetVar {
45
45
  export declare type ISaveOsceMarksheetData = number;
46
46
  export interface IOsceMarksheetActionsVar {
47
47
  osceMarksheetId: Id;
48
- userId: Id;
49
48
  timeRemaining?: number;
50
49
  action: EOsceMarksheetAction;
51
50
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.correctMark = void 0;
4
4
  const models_1 = require("../models");
5
+ const floatRegex = /([0-9]*[.])?[0-9]+/gm;
5
6
  function formatPrescribeAnswer(obj) {
6
7
  obj.drug = obj.drug.toLowerCase().replace(/\s/g, '');
7
8
  obj.route = obj.route.toLowerCase().replace(/\s/g, '');
@@ -23,6 +24,9 @@ function formatPrescribeAnswer(obj) {
23
24
  else if (obj.route.includes('nebuli')) {
24
25
  obj.route = 'neb';
25
26
  }
27
+ else if (obj.route.includes('topical')) {
28
+ obj.route = 'top';
29
+ }
26
30
  obj.units = obj.units.toLowerCase().replace(/\s/g, '');
27
31
  if (obj.units === 'milligram' || obj.units === 'milligrams') {
28
32
  obj.units = 'mg';
@@ -37,11 +41,10 @@ function formatPrescribeAnswer(obj) {
37
41
  obj.units = 'units';
38
42
  }
39
43
  let m;
40
- const regex = /\d/gm;
41
44
  const durationMatches = [];
42
- while ((m = regex.exec(obj.duration)) !== null) {
43
- if (m.index === regex.lastIndex) {
44
- regex.lastIndex++;
45
+ while ((m = floatRegex.exec(obj.duration)) !== null) {
46
+ if (m.index === floatRegex.lastIndex) {
47
+ floatRegex.lastIndex++;
45
48
  }
46
49
  m.forEach((match) => durationMatches.push(match));
47
50
  }
@@ -51,7 +54,10 @@ function formatPrescribeAnswer(obj) {
51
54
  obj.frequency = 'stat';
52
55
  }
53
56
  else if (obj.frequency.includes('once')) {
54
- obj.frequency = 'po';
57
+ obj.frequency = 'od';
58
+ }
59
+ else if (obj.frequency.includes('nightly')) {
60
+ obj.frequency = 'od';
55
61
  }
56
62
  else if (obj.frequency.includes('twice')) {
57
63
  obj.frequency = 'bd';