@quesmed/types 1.4.26 → 1.4.30
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 +2 -0
- package/index.js +65 -1
- package/index.mjs +63 -0
- package/package.json +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/index.mjs +1 -0
- package/utils/random.d.ts +1 -0
- package/utils/random.js +20 -0
- package/utils/random.mjs +16 -0
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
|
+
}
|
package/package.json
CHANGED
package/utils/index.d.ts
CHANGED
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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getRandom<T>(arr: T[], n?: number): T[];
|
package/utils/random.js
ADDED
|
@@ -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;
|
package/utils/random.mjs
ADDED
|
@@ -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
|
+
}
|