ezmedicationinput 0.1.1 → 0.1.3
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/README.md +60 -20
- package/dist/context.js +10 -5
- package/dist/fhir.d.ts +1 -1
- package/dist/fhir.js +40 -32
- package/dist/format.d.ts +3 -2
- package/dist/format.js +371 -86
- package/dist/i18n.d.ts +31 -0
- package/dist/i18n.js +664 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +53 -19
- package/dist/internal-types.d.ts +33 -0
- package/dist/internal-types.js +2 -0
- package/dist/maps.d.ts +2 -0
- package/dist/maps.js +543 -350
- package/dist/package.json +3 -0
- package/dist/parser.d.ts +2 -31
- package/dist/parser.js +809 -142
- package/dist/safety.js +7 -4
- package/dist/schedule.js +148 -76
- package/dist/suggest.js +391 -79
- package/dist/types.d.ts +26 -8
- package/dist/types.js +12 -9
- package/dist/utils/array.d.ts +1 -0
- package/dist/utils/array.js +11 -0
- package/dist/utils/enum.d.ts +2 -0
- package/dist/utils/enum.js +7 -0
- package/dist/utils/object.d.ts +7 -0
- package/dist/utils/object.js +34 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function arrayIncludes<T>(values: ReadonlyArray<T>, target: T): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.arrayIncludes = arrayIncludes;
|
|
4
|
+
function arrayIncludes(values, target) {
|
|
5
|
+
for (let index = 0; index < values.length; index += 1) {
|
|
6
|
+
if (values[index] === target) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type ObjectEntries<T extends Record<string, unknown>> = Array<[
|
|
2
|
+
keyof T,
|
|
3
|
+
T[keyof T]
|
|
4
|
+
]>;
|
|
5
|
+
export declare function objectEntries<T extends Record<string, unknown>>(value: T): ObjectEntries<T>;
|
|
6
|
+
export declare function objectValues<T extends Record<string, unknown>>(value: T): Array<T[keyof T]>;
|
|
7
|
+
export declare function objectFromEntries<K extends string, V>(entries: Array<[K, V]>): Record<K, V>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.objectEntries = objectEntries;
|
|
4
|
+
exports.objectValues = objectValues;
|
|
5
|
+
exports.objectFromEntries = objectFromEntries;
|
|
6
|
+
function objectEntries(value) {
|
|
7
|
+
const entries = [];
|
|
8
|
+
for (const key in value) {
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
10
|
+
const typedKey = key;
|
|
11
|
+
entries.push([typedKey, value[typedKey]]);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return entries;
|
|
15
|
+
}
|
|
16
|
+
function objectValues(value) {
|
|
17
|
+
const values = [];
|
|
18
|
+
for (const key in value) {
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
20
|
+
values.push(value[key]);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return values;
|
|
24
|
+
}
|
|
25
|
+
function objectFromEntries(entries) {
|
|
26
|
+
const result = {};
|
|
27
|
+
for (let index = 0; index < entries.length; index += 1) {
|
|
28
|
+
const entry = entries[index];
|
|
29
|
+
const key = entry[0];
|
|
30
|
+
const value = entry[1];
|
|
31
|
+
result[key] = value;
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ezmedicationinput",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Parse concise medication sigs into FHIR R5 Dosage JSON",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "tsc -p tsconfig.json",
|
|
9
|
+
"build": "tsc -p tsconfig.json && node scripts/postbuild.cjs",
|
|
10
10
|
"test": "vitest run"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|