@atomic-ehr/codegen 0.0.1-canary.20251106144955.d906520 → 0.0.1-canary.20251106152808.f4530b9
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/dist/cli/index.js +23 -23
- package/dist/index.d.ts +31 -3
- package/dist/index.js +244 -233
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -291,6 +291,16 @@ type ValueSetCompose = {
|
|
|
291
291
|
filter?: {}[];
|
|
292
292
|
}[];
|
|
293
293
|
};
|
|
294
|
+
type CodeSystem = {
|
|
295
|
+
resourceType: "CodeSystem";
|
|
296
|
+
url: CanonicalUrl;
|
|
297
|
+
concept: CodeSystemConcept[];
|
|
298
|
+
};
|
|
299
|
+
type CodeSystemConcept = {
|
|
300
|
+
concept: CodeSystemConcept[];
|
|
301
|
+
code: string;
|
|
302
|
+
display: string;
|
|
303
|
+
};
|
|
294
304
|
type RichValueSet = Omit<ValueSet, "name" | "url"> & {
|
|
295
305
|
package_meta: PackageMeta;
|
|
296
306
|
name: Name;
|
|
@@ -304,8 +314,8 @@ interface TypeschemaGeneratorOptions {
|
|
|
304
314
|
}
|
|
305
315
|
|
|
306
316
|
type Register = {
|
|
307
|
-
|
|
308
|
-
ensureSpecializationCanonicalUrl(
|
|
317
|
+
testAppendFs(fs: FHIRSchema): void;
|
|
318
|
+
ensureSpecializationCanonicalUrl(name: string | Name | CanonicalUrl): CanonicalUrl;
|
|
309
319
|
resolveSd(pkg: PackageMeta, canonicalUrl: CanonicalUrl): StructureDefinition | undefined;
|
|
310
320
|
resolveFs(pkg: PackageMeta, canonicalUrl: CanonicalUrl): RichFHIRSchema | undefined;
|
|
311
321
|
resolveFsGenealogy(pkg: PackageMeta, canonicalUrl: CanonicalUrl): RichFHIRSchema[];
|
|
@@ -316,7 +326,23 @@ type Register = {
|
|
|
316
326
|
resolveAny(canonicalUrl: CanonicalUrl): any | undefined;
|
|
317
327
|
resolveElementSnapshot(fhirSchema: RichFHIRSchema, path: string[]): FHIRSchemaElement;
|
|
318
328
|
getAllElementKeys(elems: Record<string, FHIRSchemaElement>): string[];
|
|
329
|
+
resolver: PackageAwareResolver;
|
|
319
330
|
} & ReturnType<typeof CanonicalManager>;
|
|
331
|
+
type PkgId = string;
|
|
332
|
+
type FocusedResource = StructureDefinition | ValueSet | CodeSystem;
|
|
333
|
+
type CanonicalResolution<T> = {
|
|
334
|
+
deep: number;
|
|
335
|
+
pkg: PackageMeta;
|
|
336
|
+
pkgId: PkgId;
|
|
337
|
+
resource: T;
|
|
338
|
+
};
|
|
339
|
+
type PackageIndex = {
|
|
340
|
+
pkg: PackageMeta;
|
|
341
|
+
canonicalResolution: Record<CanonicalUrl, CanonicalResolution<FocusedResource>[]>;
|
|
342
|
+
fhirSchemas: Record<CanonicalUrl, RichFHIRSchema>;
|
|
343
|
+
valueSets: Record<CanonicalUrl, RichValueSet>;
|
|
344
|
+
};
|
|
345
|
+
type PackageAwareResolver = Record<PkgId, PackageIndex>;
|
|
320
346
|
|
|
321
347
|
/**
|
|
322
348
|
* New Config Schema for High-Level API
|
|
@@ -736,6 +762,7 @@ interface WriterOptions {
|
|
|
736
762
|
tabSize: number;
|
|
737
763
|
withDebugComment?: boolean;
|
|
738
764
|
commentLinePrefix: string;
|
|
765
|
+
writeTypeTree?: string;
|
|
739
766
|
logger?: CodegenLogger;
|
|
740
767
|
}
|
|
741
768
|
|
|
@@ -760,6 +787,7 @@ interface APIBuilderOptions {
|
|
|
760
787
|
manager?: ReturnType<typeof CanonicalManager> | null;
|
|
761
788
|
typeSchemaOutputDir?: string /** if .ndjson -- put in one file, else -- split into separated files*/;
|
|
762
789
|
throwException?: boolean;
|
|
790
|
+
exportTypeTree?: string;
|
|
763
791
|
}
|
|
764
792
|
/**
|
|
765
793
|
* Progress callback for long-running operations
|
|
@@ -829,8 +857,8 @@ declare class APIBuilder {
|
|
|
829
857
|
verbose(enabled?: boolean): APIBuilder;
|
|
830
858
|
throwException(enabled?: boolean): APIBuilder;
|
|
831
859
|
cleanOutput(enabled?: boolean): APIBuilder;
|
|
860
|
+
writeTypeTree(filename: string): this;
|
|
832
861
|
writeTypeSchemas(target: string): this;
|
|
833
|
-
private static isIdenticalTo;
|
|
834
862
|
private writeTypeSchemasToSeparateFiles;
|
|
835
863
|
private writeTypeSchemasToSingleFile;
|
|
836
864
|
private tryWriteTypeSchema;
|