@atomic-ehr/codegen 0.0.1-canary.20250925150012.6169b6d → 0.0.1-canary.20250929141928.699688c
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.
|
@@ -25,7 +25,8 @@ export class TypeSchemaGenerator {
|
|
|
25
25
|
logger;
|
|
26
26
|
constructor(options = {}, cacheConfig) {
|
|
27
27
|
this.options = { verbose: false, ...options };
|
|
28
|
-
this.manager =
|
|
28
|
+
this.manager = options.manager ||
|
|
29
|
+
CanonicalManager({ packages: [], workingDir: "tmp/fhir" });
|
|
29
30
|
this.cacheConfig = cacheConfig;
|
|
30
31
|
this.logger =
|
|
31
32
|
options.logger ||
|
|
@@ -42,11 +43,7 @@ export class TypeSchemaGenerator {
|
|
|
42
43
|
}
|
|
43
44
|
async fetchPackage(packageName, packageVersion) {
|
|
44
45
|
this.logger.step(`Loading FHIR package: ${packageName}${packageVersion ? `@${packageVersion}` : ""}`);
|
|
45
|
-
this.manager
|
|
46
|
-
packages: [`${packageName}${packageVersion ? `@${packageVersion}` : ""}`],
|
|
47
|
-
workingDir: "tmp/fhir",
|
|
48
|
-
});
|
|
49
|
-
await this.manager.init();
|
|
46
|
+
await this.manager.addPackages(`${packageName}${packageVersion ? `@${packageVersion}` : ""}`);
|
|
50
47
|
const allResources = await this.manager.search({});
|
|
51
48
|
const structureDefinitions = allResources.filter((resource) => resource.resourceType === "StructureDefinition");
|
|
52
49
|
const valueSets = allResources.filter((resource) => resource.resourceType === "ValueSet");
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* FHIR Schema designed to simplify SDK resource classes/types generation.
|
|
4
4
|
*/
|
|
5
5
|
import type * as FS from "@atomic-ehr/fhirschema";
|
|
6
|
+
import type { CanonicalManager } from "@atomic-ehr/fhir-canonical-manager";
|
|
6
7
|
export interface PackageInfo {
|
|
7
8
|
name: string;
|
|
8
9
|
version: string;
|
|
@@ -179,6 +180,7 @@ export interface TypeschemaGeneratorOptions {
|
|
|
179
180
|
verbose?: boolean;
|
|
180
181
|
logger?: import("../utils/codegen-logger").CodegenLogger;
|
|
181
182
|
treeshake?: string[];
|
|
183
|
+
manager?: ReturnType<typeof CanonicalManager> | null;
|
|
182
184
|
}
|
|
183
185
|
export declare function isBindingSchema(schema: TypeSchema): schema is TypeSchemaForBinding;
|
|
184
186
|
export {};
|
package/dist/typeschema/types.js
CHANGED
|
@@ -6,8 +6,8 @@ export const enrichFHIRSchema = (schema) => {
|
|
|
6
6
|
return {
|
|
7
7
|
...schema,
|
|
8
8
|
package_meta: {
|
|
9
|
-
name: schema.package_name || schema.package_meta
|
|
10
|
-
version: schema.package_version || schema.package_meta
|
|
9
|
+
name: schema.package_name || schema.package_meta?.name || "undefined",
|
|
10
|
+
version: schema.package_version || schema.package_meta?.version || "undefined",
|
|
11
11
|
},
|
|
12
12
|
};
|
|
13
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomic-ehr/codegen",
|
|
3
|
-
"version": "0.0.1-canary.
|
|
3
|
+
"version": "0.0.1-canary.20250929141928.699688c",
|
|
4
4
|
"description": "Code generation tools for FHIR resources and TypeSchema definitions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fhir",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"typescript": "^5.9.2"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@atomic-ehr/fhir-canonical-manager": "
|
|
74
|
+
"@atomic-ehr/fhir-canonical-manager": "0.0.11-canary.355d62d.20250926143544",
|
|
75
75
|
"@atomic-ehr/fhirschema": "^0.0.2",
|
|
76
76
|
"@inquirer/prompts": "^7.8.1",
|
|
77
77
|
"ajv": "^8.17.1",
|