@quesmed/types 1.4.27 → 1.4.31

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/index.d.ts CHANGED
@@ -18,3 +18,5 @@ export declare enum EPlatformId {
18
18
  OSCE = 1
19
19
  }
20
20
  export declare const termsAndConditions = "# Group Study Conduct Policy\n\nAs future clinicians, we expect that you treat your colleagues fairly and with respect.\nAs a result, we will not tolerate the following actions during use of the Quesmed platform:\n\n- Violent threats\n- Wishing, hoping or calling for serious harm on a person or group of people\n- Incitement against individuals or groups\n- Slurs, racist and sexist tropes\n- Degrading others\n- Unwanted sexual advances\n\nWhen determining the penalty for violating our conduct policy, we consider a number of factors including the severity of the violation and the individual's record of violations. We reserve the right to immediately de-activate any account that violates our conduct policy. We may also consider raising concerns to the individual's licensing body (e.g. GMC) on a case-by-case basis.\n\nBy using the platform, you agree to be bound by our conduct policy as described above.";
21
+ export declare const medicalWords: string[][];
22
+ export declare function generateDisplayName(firstName: string, lastName: string): string;
package/index.js CHANGED
@@ -22,7 +22,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
22
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.termsAndConditions = exports.EPlatformId = exports.FCM_TOPICS = exports.ERRORS = exports.utils = exports.Models = void 0;
25
+ exports.generateDisplayName = exports.medicalWords = exports.termsAndConditions = exports.EPlatformId = exports.FCM_TOPICS = exports.ERRORS = exports.utils = exports.Models = void 0;
26
+ const random_1 = require("./utils/random");
26
27
  exports.Models = __importStar(require("./models"));
27
28
  __exportStar(require("./resolvers"), exports);
28
29
  exports.utils = __importStar(require("./utils"));
@@ -58,3 +59,66 @@ As a result, we will not tolerate the following actions during use of the Quesme
58
59
  When determining the penalty for violating our conduct policy, we consider a number of factors including the severity of the violation and the individual's record of violations. We reserve the right to immediately de-activate any account that violates our conduct policy. We may also consider raising concerns to the individual's licensing body (e.g. GMC) on a case-by-case basis.
59
60
 
60
61
  By using the platform, you agree to be bound by our conduct policy as described above.`;
62
+ exports.medicalWords = [
63
+ ['Abrasion', 'Abscess', 'Acute', 'Amnesia', 'Anterior', 'Axillary'],
64
+ ['Benign', 'Biopsy', 'Botox', 'Bladder', 'Body', 'Bradykinin'],
65
+ ['Chronic', 'Contusion', 'Cystic', 'Complement', 'CT'],
66
+ ['Defibrillator', 'Dermis', 'DNA', 'Dorsal', 'Dominant'],
67
+ ['Edema', 'Embolism', 'Epidermis', 'Endoscope'],
68
+ ['Fracture', 'Fibrillation', 'Flutter', 'Fever', 'Fungal', 'Fibrosis'],
69
+ ['Gland', 'Gastro', 'Gas', 'Gallbladder'],
70
+ ['Hypertension', 'Hematoma', 'Haemophilus', 'Hallux', 'Hereditary'],
71
+ ['Inpatient', 'Intravenous', 'Intubation'],
72
+ ['JAK', 'Juice', 'Jargon', 'Jaundice'],
73
+ ['Kinin', 'Ketone', 'Kawasaki', 'Kinase'],
74
+ ['Lung', 'Liver', 'Lymph', 'Loose', 'Lumbar', 'Lateral'],
75
+ ['Malignant', 'Monoclonal', 'Myopathy', 'Myotonia', 'Metabolism'],
76
+ ['Neoplasia', 'NICU', 'Nightshift'],
77
+ ['Outpatient', 'Osteoporosis', 'Otitis', 'Odor'],
78
+ ['Prognosis', 'Power', 'Poisoning', 'Pudendal', 'Polyps', 'Prone'],
79
+ ['QRS', 'Qwave', 'Quaternary'],
80
+ ['Relapse', 'Rhinoplasty', 'Retrograde', 'RNA', 'Recessive'],
81
+ [
82
+ 'Suture',
83
+ 'Serotonin',
84
+ 'Sclerosis',
85
+ 'Stasis',
86
+ 'Serpiginous',
87
+ 'Syndrome',
88
+ 'Supine',
89
+ ],
90
+ [
91
+ 'Transplant',
92
+ 'Thermoregulator',
93
+ 'Tyrosine',
94
+ 'Tachycardia',
95
+ 'Tazocin',
96
+ 'Tanoy',
97
+ ],
98
+ ['Uveitis', 'Uremic', 'Urology', 'Upright', 'Uwave'],
99
+ ['Viral', 'Vaccine', 'Vitamin', 'Versicolor', 'Ventral'],
100
+ ['Wilsons', 'WBC', 'Womb'],
101
+ ['X-ray', 'Xeno', 'X-linked'],
102
+ ['Yellow', 'Yersinia', 'Yeast'],
103
+ ['Zika', 'Zebras', 'Zygomatic', 'Z-line'],
104
+ ];
105
+ function generateDisplayName(firstName, lastName) {
106
+ let firstNameChar = firstName.toLowerCase().charCodeAt(0) - 97;
107
+ if (isNaN(firstNameChar) || firstNameChar > 25 || firstNameChar < 0) {
108
+ firstNameChar = Math.round(Math.random() * 25);
109
+ }
110
+ let lastNameChar = lastName.toLowerCase().charCodeAt(0) - 97 || Math.round(Math.random() * 25);
111
+ if (isNaN(lastNameChar) || lastNameChar > 25 || lastNameChar < 0) {
112
+ lastNameChar = Math.round(Math.random() * 25);
113
+ }
114
+ let displayName;
115
+ const medWordsFirstName = (0, random_1.getRandom)(exports.medicalWords[firstNameChar], 2);
116
+ if (firstNameChar === lastNameChar) {
117
+ displayName = `${medWordsFirstName[0]} ${medWordsFirstName[1]}`;
118
+ }
119
+ else {
120
+ displayName = `${medWordsFirstName[0]} ${(0, random_1.getRandom)(exports.medicalWords[lastNameChar], 1)[0]}`;
121
+ }
122
+ return displayName;
123
+ }
124
+ exports.generateDisplayName = generateDisplayName;
package/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { getRandom } from './utils/random';
1
2
  export * as Models from './models';
2
3
  export * from './resolvers';
3
4
  export * as utils from './utils';
@@ -33,3 +34,65 @@ As a result, we will not tolerate the following actions during use of the Quesme
33
34
  When determining the penalty for violating our conduct policy, we consider a number of factors including the severity of the violation and the individual's record of violations. We reserve the right to immediately de-activate any account that violates our conduct policy. We may also consider raising concerns to the individual's licensing body (e.g. GMC) on a case-by-case basis.
34
35
 
35
36
  By using the platform, you agree to be bound by our conduct policy as described above.`;
37
+ export const medicalWords = [
38
+ ['Abrasion', 'Abscess', 'Acute', 'Amnesia', 'Anterior', 'Axillary'],
39
+ ['Benign', 'Biopsy', 'Botox', 'Bladder', 'Body', 'Bradykinin'],
40
+ ['Chronic', 'Contusion', 'Cystic', 'Complement', 'CT'],
41
+ ['Defibrillator', 'Dermis', 'DNA', 'Dorsal', 'Dominant'],
42
+ ['Edema', 'Embolism', 'Epidermis', 'Endoscope'],
43
+ ['Fracture', 'Fibrillation', 'Flutter', 'Fever', 'Fungal', 'Fibrosis'],
44
+ ['Gland', 'Gastro', 'Gas', 'Gallbladder'],
45
+ ['Hypertension', 'Hematoma', 'Haemophilus', 'Hallux', 'Hereditary'],
46
+ ['Inpatient', 'Intravenous', 'Intubation'],
47
+ ['JAK', 'Juice', 'Jargon', 'Jaundice'],
48
+ ['Kinin', 'Ketone', 'Kawasaki', 'Kinase'],
49
+ ['Lung', 'Liver', 'Lymph', 'Loose', 'Lumbar', 'Lateral'],
50
+ ['Malignant', 'Monoclonal', 'Myopathy', 'Myotonia', 'Metabolism'],
51
+ ['Neoplasia', 'NICU', 'Nightshift'],
52
+ ['Outpatient', 'Osteoporosis', 'Otitis', 'Odor'],
53
+ ['Prognosis', 'Power', 'Poisoning', 'Pudendal', 'Polyps', 'Prone'],
54
+ ['QRS', 'Qwave', 'Quaternary'],
55
+ ['Relapse', 'Rhinoplasty', 'Retrograde', 'RNA', 'Recessive'],
56
+ [
57
+ 'Suture',
58
+ 'Serotonin',
59
+ 'Sclerosis',
60
+ 'Stasis',
61
+ 'Serpiginous',
62
+ 'Syndrome',
63
+ 'Supine',
64
+ ],
65
+ [
66
+ 'Transplant',
67
+ 'Thermoregulator',
68
+ 'Tyrosine',
69
+ 'Tachycardia',
70
+ 'Tazocin',
71
+ 'Tanoy',
72
+ ],
73
+ ['Uveitis', 'Uremic', 'Urology', 'Upright', 'Uwave'],
74
+ ['Viral', 'Vaccine', 'Vitamin', 'Versicolor', 'Ventral'],
75
+ ['Wilsons', 'WBC', 'Womb'],
76
+ ['X-ray', 'Xeno', 'X-linked'],
77
+ ['Yellow', 'Yersinia', 'Yeast'],
78
+ ['Zika', 'Zebras', 'Zygomatic', 'Z-line'],
79
+ ];
80
+ export function generateDisplayName(firstName, lastName) {
81
+ let firstNameChar = firstName.toLowerCase().charCodeAt(0) - 97;
82
+ if (isNaN(firstNameChar) || firstNameChar > 25 || firstNameChar < 0) {
83
+ firstNameChar = Math.round(Math.random() * 25);
84
+ }
85
+ let lastNameChar = lastName.toLowerCase().charCodeAt(0) - 97 || Math.round(Math.random() * 25);
86
+ if (isNaN(lastNameChar) || lastNameChar > 25 || lastNameChar < 0) {
87
+ lastNameChar = Math.round(Math.random() * 25);
88
+ }
89
+ let displayName;
90
+ const medWordsFirstName = getRandom(medicalWords[firstNameChar], 2);
91
+ if (firstNameChar === lastNameChar) {
92
+ displayName = `${medWordsFirstName[0]} ${medWordsFirstName[1]}`;
93
+ }
94
+ else {
95
+ displayName = `${medWordsFirstName[0]} ${getRandom(medicalWords[lastNameChar], 1)[0]}`;
96
+ }
97
+ return displayName;
98
+ }
@@ -34,7 +34,8 @@ export declare enum EOsceMarksheetAction {
34
34
  CONNECT = 5,
35
35
  DISCONNECT = 6,
36
36
  SELECT = 7,
37
- LEFT = 8
37
+ LEFT = 8,
38
+ KICK = 9
38
39
  }
39
40
  export interface IOsceMarksheet {
40
41
  id: Id;
@@ -20,4 +20,5 @@ var EOsceMarksheetAction;
20
20
  EOsceMarksheetAction[EOsceMarksheetAction["DISCONNECT"] = 6] = "DISCONNECT";
21
21
  EOsceMarksheetAction[EOsceMarksheetAction["SELECT"] = 7] = "SELECT";
22
22
  EOsceMarksheetAction[EOsceMarksheetAction["LEFT"] = 8] = "LEFT";
23
+ EOsceMarksheetAction[EOsceMarksheetAction["KICK"] = 9] = "KICK";
23
24
  })(EOsceMarksheetAction = exports.EOsceMarksheetAction || (exports.EOsceMarksheetAction = {}));
@@ -17,4 +17,5 @@ export var EOsceMarksheetAction;
17
17
  EOsceMarksheetAction[EOsceMarksheetAction["DISCONNECT"] = 6] = "DISCONNECT";
18
18
  EOsceMarksheetAction[EOsceMarksheetAction["SELECT"] = 7] = "SELECT";
19
19
  EOsceMarksheetAction[EOsceMarksheetAction["LEFT"] = 8] = "LEFT";
20
+ EOsceMarksheetAction[EOsceMarksheetAction["KICK"] = 9] = "KICK";
20
21
  })(EOsceMarksheetAction || (EOsceMarksheetAction = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "1.4.27",
3
+ "version": "1.4.31",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -1,5 +1,6 @@
1
1
  import { EOsceMarksheetAction, EOsceRoles, IClassYear, Id, IOsceMarksheetUser, IUser } from '../../models';
2
2
  import { RootData } from '../types';
3
+ import { EClassYearGroup } from './../../models/User';
3
4
  export declare const OSCE_ROLE_CHANGE_KEY = "OSCE_ROLE_CHANGE";
4
5
  export declare const OSCE_MARKSHEET_ACTION_KEY = "OSCE_MARKSHEET_ACTION";
5
6
  export declare const OSCE_MATCHMAKING_KEY = "OSCE_MATCHMAKING";
@@ -40,6 +41,7 @@ export interface IOsceMatchmakingAction {
40
41
  matchedUsers: number;
41
42
  userId: Id;
42
43
  classYear: IClassYear;
44
+ classYearGroup: EClassYearGroup;
43
45
  lastSyncAt: number;
44
46
  startedAt: number;
45
47
  grouped: boolean;
package/utils/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './commonFunctions';
2
2
  export * from './lightgallery';
3
3
  export * from './offlineLink';
4
+ export * from './random';
4
5
  export * from './webSocketLink';
5
6
  export * from './wordsToNumber';
6
7
  import uuid from './uuid4';
package/utils/index.js CHANGED
@@ -17,6 +17,7 @@ exports.Uuid4 = void 0;
17
17
  __exportStar(require("./commonFunctions"), exports);
18
18
  __exportStar(require("./lightgallery"), exports);
19
19
  __exportStar(require("./offlineLink"), exports);
20
+ __exportStar(require("./random"), exports);
20
21
  __exportStar(require("./webSocketLink"), exports);
21
22
  __exportStar(require("./wordsToNumber"), exports);
22
23
  const uuid4_1 = __importDefault(require("./uuid4"));
package/utils/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './commonFunctions';
2
2
  export * from './lightgallery';
3
3
  export * from './offlineLink';
4
+ export * from './random';
4
5
  export * from './webSocketLink';
5
6
  export * from './wordsToNumber';
6
7
  import uuid from './uuid4';
@@ -0,0 +1 @@
1
+ export declare function getRandom<T>(arr: T[], n?: number): T[];
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRandom = void 0;
4
+ function getRandom(arr, n) {
5
+ if (n === undefined || n === null) {
6
+ n = arr.length;
7
+ }
8
+ const result = new Array(n);
9
+ let len = arr.length;
10
+ const taken = new Array(len);
11
+ if (n > len)
12
+ throw new RangeError('getRandom: more elements taken than available');
13
+ while (n--) {
14
+ const x = Math.floor(Math.random() * len);
15
+ result[n] = arr[x in taken ? taken[x] : x];
16
+ taken[x] = --len in taken ? taken[len] : len;
17
+ }
18
+ return result;
19
+ }
20
+ exports.getRandom = getRandom;
@@ -0,0 +1,16 @@
1
+ export function getRandom(arr, n) {
2
+ if (n === undefined || n === null) {
3
+ n = arr.length;
4
+ }
5
+ const result = new Array(n);
6
+ let len = arr.length;
7
+ const taken = new Array(len);
8
+ if (n > len)
9
+ throw new RangeError('getRandom: more elements taken than available');
10
+ while (n--) {
11
+ const x = Math.floor(Math.random() * len);
12
+ result[n] = arr[x in taken ? taken[x] : x];
13
+ taken[x] = --len in taken ? taken[len] : len;
14
+ }
15
+ return result;
16
+ }