@haste-health/artifacts 0.11.1
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 +30 -0
- package/lib/generateIndexFile.d.ts +7 -0
- package/lib/generateIndexFile.js +63 -0
- package/lib/generateIndexFile.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -0
- package/lib/loadArtifacts.d.ts +15 -0
- package/lib/loadArtifacts.js +91 -0
- package/lib/loadArtifacts.js.map +1 -0
- package/lib/types.d.ts +19 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Artifacts
|
|
2
|
+
|
|
3
|
+
Loads FHIR artifacts based around fhirVersion on package.json and .index.json file.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
/**
|
|
9
|
+
* Interface used to search dependencies for .index.json files and load their contents.
|
|
10
|
+
* @param options Artifact Load options
|
|
11
|
+
* @returns A list of resources of type T
|
|
12
|
+
*/
|
|
13
|
+
export default function loadArtifacts<
|
|
14
|
+
Version extends FHIR_VERSION,
|
|
15
|
+
T extends ResourceType<Version>,
|
|
16
|
+
>({
|
|
17
|
+
fhirVersion,
|
|
18
|
+
resourceType,
|
|
19
|
+
silence,
|
|
20
|
+
currentDirectory,
|
|
21
|
+
onlyPackages,
|
|
22
|
+
}: {
|
|
23
|
+
// Only support R4 and R4B for now.
|
|
24
|
+
fhirVersion: Version;
|
|
25
|
+
resourceType: T;
|
|
26
|
+
silence?: boolean;
|
|
27
|
+
currentDirectory: string;
|
|
28
|
+
onlyPackages?: string[];
|
|
29
|
+
}): Resource<Version, T>[];
|
|
30
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
function getAllFiles(directory) {
|
|
4
|
+
const files = [];
|
|
5
|
+
const filesInDirectory = fs.readdirSync(directory);
|
|
6
|
+
for (const file of filesInDirectory) {
|
|
7
|
+
const absolute = path.join(directory, file);
|
|
8
|
+
if (fs.statSync(absolute).isDirectory()) {
|
|
9
|
+
files.push(...getAllFiles(absolute));
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
files.push(absolute);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return files;
|
|
16
|
+
}
|
|
17
|
+
function getRegexForIgnore(urlPattern) {
|
|
18
|
+
const regex = new RegExp(urlPattern.replaceAll("*", "(.+)"));
|
|
19
|
+
return regex;
|
|
20
|
+
}
|
|
21
|
+
export default function generateIndexFile({ root, artifactLocations, ignore = [], extension = ".json", }) {
|
|
22
|
+
// Read artifactLocation and recursively walk the directory tree reading all files from root
|
|
23
|
+
// For each file, read the contents and parse the JSON
|
|
24
|
+
// If the JSON has a "resourceType" property, add it to the index
|
|
25
|
+
const index = { "index-version": "1", files: [] };
|
|
26
|
+
const files = artifactLocations
|
|
27
|
+
.map((loc) => path.join(root, loc))
|
|
28
|
+
.map(getAllFiles)
|
|
29
|
+
.flat()
|
|
30
|
+
.filter((f) => f.endsWith(extension))
|
|
31
|
+
.filter((f) => ignore.find((i) => getRegexForIgnore(i).test(f)) === undefined)
|
|
32
|
+
.sort((a, b) => a.localeCompare(b));
|
|
33
|
+
for (const file of files) {
|
|
34
|
+
try {
|
|
35
|
+
const fileContents = fs.readFileSync(file);
|
|
36
|
+
const json = JSON.parse(fileContents.toString("utf8"));
|
|
37
|
+
if (json.resourceType === "Bundle") {
|
|
38
|
+
const bundle = json;
|
|
39
|
+
// Add to index
|
|
40
|
+
const resourceTypes = new Set(bundle.entry?.map((entry) => entry.resource?.resourceType));
|
|
41
|
+
index.files = (index.files || []).concat([...resourceTypes].map((resourceType) => ({
|
|
42
|
+
filename: file,
|
|
43
|
+
resourceType,
|
|
44
|
+
})));
|
|
45
|
+
}
|
|
46
|
+
else if (json.resourceType) {
|
|
47
|
+
// Add to index
|
|
48
|
+
index.files = (index.files || []).concat([
|
|
49
|
+
{
|
|
50
|
+
filename: file,
|
|
51
|
+
resourceType: json.resourceType,
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
console.error("Failed to parse file ", file);
|
|
58
|
+
throw e;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return index;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=generateIndexFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateIndexFile.js","sourceRoot":"","sources":["../src/generateIndexFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,MAAM,CAAC;AAMxB,SAAS,WAAW,CAAC,SAAiB;IACpC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,gBAAgB,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACnD,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5C,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YACxC,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,iBAAiB,CAAC,UAAkB;IAC3C,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,OA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AC,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAC3D,CAAC;gBAEF,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CACtC,CAAC,GAAG,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;oBACxC,QAAQ,EAAE,IAAI;oBACd,YAAY;iBACb,CAAC,CAAC,CACJ,CAAC;YACJ,CAAC;iBAAM,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC7B,eAAe;gBACf,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;oBACvC;wBACE,QAAQ,EAAE,IAAI;wBACd,YAAY,EAAE,IAAI,CAAC,YAAY;qBAChC;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;YAC7C,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FHIR_VERSION, Resource, ResourceType } from "@haste-health/fhir-types/versions";
|
|
2
|
+
export declare function findPackageLocation(startDir: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Interface used to search dependencies for .index.json files and load their contents.
|
|
5
|
+
* @param options Artifact Load options
|
|
6
|
+
* @returns A list of resources of type T
|
|
7
|
+
*/
|
|
8
|
+
export default function loadArtifacts<Version extends FHIR_VERSION, T extends ResourceType<Version>>({ fhirVersion, resourceType, silence, loadDevelopmentPackages, onlyPackages, currentDirectory, }: {
|
|
9
|
+
fhirVersion: Version;
|
|
10
|
+
resourceType: T;
|
|
11
|
+
silence?: boolean;
|
|
12
|
+
loadDevelopmentPackages?: boolean;
|
|
13
|
+
onlyPackages?: string[];
|
|
14
|
+
currentDirectory: string;
|
|
15
|
+
}): Resource<Version, T>[];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
function isBundle(r) {
|
|
5
|
+
return r?.resourceType === "Bundle";
|
|
6
|
+
}
|
|
7
|
+
function isType(_fhirVersion, type, r) {
|
|
8
|
+
return (r !== undefined && r?.resourceType === type);
|
|
9
|
+
}
|
|
10
|
+
function flattenOrInclude(fhirVersion, type, resource) {
|
|
11
|
+
if (isBundle(resource)) {
|
|
12
|
+
const resources = (resource.entry || [])?.map((entry) => entry.resource);
|
|
13
|
+
return resources.filter((r) => isType(fhirVersion, type, r));
|
|
14
|
+
}
|
|
15
|
+
if (isType(fhirVersion, type, resource)) {
|
|
16
|
+
return [resource];
|
|
17
|
+
}
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
export function findPackageLocation(startDir) {
|
|
21
|
+
let dir = startDir, prevDir;
|
|
22
|
+
do {
|
|
23
|
+
try {
|
|
24
|
+
const currentPath = path.join(dir, "package.json");
|
|
25
|
+
const content = readFileSync(currentPath, { encoding: "utf8" });
|
|
26
|
+
JSON.parse(content);
|
|
27
|
+
return currentPath;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
if (error.code !== "ENOENT" && error.code !== "ENOTDIR")
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
prevDir = dir;
|
|
35
|
+
dir = path.resolve(dir, "..");
|
|
36
|
+
} while (dir !== prevDir);
|
|
37
|
+
throw new Error("Could not find package.json");
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Interface used to search dependencies for .index.json files and load their contents.
|
|
41
|
+
* @param options Artifact Load options
|
|
42
|
+
* @returns A list of resources of type T
|
|
43
|
+
*/
|
|
44
|
+
export default function loadArtifacts({ fhirVersion, resourceType, silence, loadDevelopmentPackages, onlyPackages, currentDirectory, }) {
|
|
45
|
+
const packageLocation = findPackageLocation(currentDirectory);
|
|
46
|
+
const requirer = createRequire(packageLocation);
|
|
47
|
+
const packageJSON = requirer("./package.json");
|
|
48
|
+
let deps = { ...packageJSON.dependencies };
|
|
49
|
+
if (loadDevelopmentPackages) {
|
|
50
|
+
deps = { ...packageJSON.devDependencies, ...deps };
|
|
51
|
+
}
|
|
52
|
+
return Object.keys(deps || {})
|
|
53
|
+
.filter((d) => {
|
|
54
|
+
try {
|
|
55
|
+
const depPackage = requirer(`${d}/package.json`);
|
|
56
|
+
// Filter according to onlyPackages if provided.
|
|
57
|
+
if (onlyPackages && !onlyPackages.includes(d)) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
// Filter out for packages that contain a fhirVersion specified by parameter.
|
|
61
|
+
return depPackage.fhirVersions?.some((version) => version.startsWith(fhirVersion));
|
|
62
|
+
}
|
|
63
|
+
catch (_e) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
.map((d) => {
|
|
68
|
+
if (!silence)
|
|
69
|
+
console.log(` '${d}' Loading package contents from .index.json for resourceType '${resourceType}'`);
|
|
70
|
+
const indexFile = requirer(`${d}/.index.json`);
|
|
71
|
+
if (indexFile?.files) {
|
|
72
|
+
const fileInfos = resourceType
|
|
73
|
+
? indexFile.files.filter((metaInfo) => metaInfo.resourceType && resourceType === metaInfo.resourceType)
|
|
74
|
+
: indexFile.files;
|
|
75
|
+
const result = fileInfos
|
|
76
|
+
.map((r) => {
|
|
77
|
+
const fileLoc = requirer.resolve(`${d}/${r.filename}`);
|
|
78
|
+
const fileContent = new TextDecoder("utf-8", {
|
|
79
|
+
fatal: true,
|
|
80
|
+
}).decode(readFileSync(fileLoc));
|
|
81
|
+
const result = flattenOrInclude(fhirVersion, resourceType, JSON.parse(fileContent));
|
|
82
|
+
return result;
|
|
83
|
+
})
|
|
84
|
+
.flat();
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
return [];
|
|
88
|
+
})
|
|
89
|
+
.flat();
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=loadArtifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadArtifacts.js","sourceRoot":"","sources":["../src/loadArtifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAY7B,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAQ,CAA6B,EAAE,YAAY,KAAK,QAAQ,CAAC;AACnE,CAAC;AAED,SAAS,MAAM,CACb,YAAqB,EACrB,IAAO,EACP,CAAU;IAEV,OAAO,CACL,CAAC,KAAK,SAAS,IAAK,CAA6B,EAAE,YAAY,KAAK,IAAI,CACzE,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAGvB,WAAoB,EAAE,IAAO,EAAE,QAAiB;IAChD,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvB,MAAM,SAAS,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAA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AQ,CAAC,YAAY,IAAI,YAAY,KAAK,QAAQ,CAAC,YAAY,CAClE;gBACH,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC;YAEpB,MAAM,MAAM,GAAG,SAAS;iBACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACT,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACvD,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE;oBAC3C,KAAK,EAAE,IAAI;iBACZ,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;gBAEjC,MAAM,MAAM,GAAG,gBAAgB,CAC7B,WAAW,EACX,YAAY,EACZ,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CACxB,CAAC;gBAEF,OAAO,MAAM,CAAC;YAChB,CAAC,CAAC;iBACD,IAAI,EAAE,CAAC;YAEV,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface PackageJSON {
|
|
2
|
+
dependencies?: Record<string, string>;
|
|
3
|
+
devDependencies?: Record<string, string>;
|
|
4
|
+
}
|
|
5
|
+
export type IndexedFiles = {
|
|
6
|
+
filename?: string;
|
|
7
|
+
resourceType?: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
kind?: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
supplements?: string;
|
|
14
|
+
content?: string;
|
|
15
|
+
};
|
|
16
|
+
export type IndexFile = {
|
|
17
|
+
"index-version"?: string;
|
|
18
|
+
files?: Array<IndexedFiles>;
|
|
19
|
+
};
|
package/lib/types.js
ADDED
package/lib/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@haste-health/artifacts",
|
|
3
|
+
"version": "0.11.1",
|
|
4
|
+
"homepage": "https://haste.health",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/HasteHealth/HasteHealth.git"
|
|
8
|
+
},
|
|
9
|
+
"description": "",
|
|
10
|
+
"main": "lib/index.js",
|
|
11
|
+
"types": "lib/index.d.ts",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"test": "echo \"Error: no test specified\"",
|
|
16
|
+
"publish": "pnpm build && pnpm npm publish --access public --tolerate-republish"
|
|
17
|
+
},
|
|
18
|
+
"fhirVersion": [
|
|
19
|
+
"r4"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [],
|
|
22
|
+
"author": "",
|
|
23
|
+
"license": "ISC",
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@haste-health/fhir-types": "workspace:^",
|
|
26
|
+
"@types/node": "^22.15.17",
|
|
27
|
+
"typescript": "5.9.2"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"lib/**",
|
|
31
|
+
"r4/**",
|
|
32
|
+
".index.json"
|
|
33
|
+
]
|
|
34
|
+
}
|