@atomic-ehr/codegen 0.0.9 → 0.0.10-canary.20260330084405.5054c4a

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/index.d.ts CHANGED
@@ -42,16 +42,16 @@ interface Quantity extends Element {
42
42
  interface Age extends Quantity {
43
43
  }
44
44
 
45
- interface Coding extends Element {
46
- code?: string;
45
+ interface Coding<T extends string = string> extends Element {
46
+ code?: T;
47
47
  display?: string;
48
48
  system?: string;
49
49
  userSelected?: boolean;
50
50
  version?: string;
51
51
  }
52
52
 
53
- interface CodeableConcept extends Element {
54
- coding?: Coding[];
53
+ interface CodeableConcept<T extends string = string> extends Element {
54
+ coding?: Coding<T>[];
55
55
  text?: string;
56
56
  }
57
57
 
@@ -59,7 +59,7 @@ interface Identifier extends Element {
59
59
  assigner?: Reference<"Organization">;
60
60
  period?: Period;
61
61
  system?: string;
62
- type?: CodeableConcept;
62
+ type?: CodeableConcept<("DL" | "PPN" | "BRN" | "MR" | "MCN" | "EN" | "TAX" | "NIIP" | "PRN" | "MD" | "DR" | "ACSN" | "UDI" | "SNO" | "SB" | "PLAC" | "FILL" | "JHN" | string)>;
63
63
  use?: ("usual" | "official" | "temp" | "secondary" | "old");
64
64
  value?: string;
65
65
  }
@@ -83,7 +83,7 @@ interface Attachment extends Element {
83
83
  creation?: string;
84
84
  data?: string;
85
85
  hash?: string;
86
- language?: string;
86
+ language?: ("ar" | "bn" | "cs" | "da" | "de" | "de-AT" | "de-CH" | "de-DE" | "el" | "en" | "en-AU" | "en-CA" | "en-GB" | "en-IN" | "en-NZ" | "en-SG" | "en-US" | "es" | "es-AR" | "es-ES" | "es-UY" | "fi" | "fr" | "fr-BE" | "fr-CH" | "fr-FR" | "fy" | "fy-NL" | "hi" | "hr" | "it" | "it-CH" | "it-IT" | "ja" | "ko" | "nl" | "nl-BE" | "nl-NL" | "no" | "no-NO" | "pa" | "pl" | "pt" | "pt-BR" | "ru" | "ru-RU" | "sr" | "sr-RS" | "sv" | "sv-SE" | "te" | "zh" | "zh-CN" | "zh-HK" | "zh-SG" | "zh-TW" | string);
87
87
  size?: number;
88
88
  title?: string;
89
89
  url?: string;
@@ -124,13 +124,13 @@ interface Resource {
124
124
  resourceType: "CodeSystem" | "DomainResource" | "Resource" | "StructureDefinition" | "ValueSet";
125
125
  id?: string;
126
126
  implicitRules?: string;
127
- language?: string;
127
+ language?: ("ar" | "bn" | "cs" | "da" | "de" | "de-AT" | "de-CH" | "de-DE" | "el" | "en" | "en-AU" | "en-CA" | "en-GB" | "en-IN" | "en-NZ" | "en-SG" | "en-US" | "es" | "es-AR" | "es-ES" | "es-UY" | "fi" | "fr" | "fr-BE" | "fr-CH" | "fr-FR" | "fy" | "fy-NL" | "hi" | "hr" | "it" | "it-CH" | "it-IT" | "ja" | "ko" | "nl" | "nl-BE" | "nl-NL" | "no" | "no-NO" | "pa" | "pl" | "pt" | "pt-BR" | "ru" | "ru-RU" | "sr" | "sr-RS" | "sv" | "sv-SE" | "te" | "zh" | "zh-CN" | "zh-HK" | "zh-SG" | "zh-TW" | string);
128
128
  meta?: Meta;
129
129
  }
130
130
 
131
- interface DomainResource extends Resource {
131
+ interface DomainResource<T extends Resource = Resource> extends Resource {
132
132
  resourceType: "CodeSystem" | "DomainResource" | "StructureDefinition" | "ValueSet";
133
- contained?: Resource[];
133
+ contained?: T[];
134
134
  extension?: Extension[];
135
135
  modifierExtension?: Extension[];
136
136
  text?: Narrative;
@@ -142,7 +142,7 @@ interface Range extends Element {
142
142
  }
143
143
 
144
144
  interface UsageContext extends Element {
145
- code: Coding;
145
+ code: Coding<("gender" | "age" | "focus" | "user" | "workflow" | "task" | "venue" | "species" | "program" | string)>;
146
146
  valueCodeableConcept?: CodeableConcept;
147
147
  valueQuantity?: Quantity;
148
148
  valueRange?: Range;
@@ -158,8 +158,8 @@ interface CodeSystemConcept extends BackboneElement {
158
158
  property?: CodeSystemConceptProperty[];
159
159
  }
160
160
  interface CodeSystemConceptDesignation extends BackboneElement {
161
- language?: string;
162
- use?: Coding;
161
+ language?: ("ar" | "bn" | "cs" | "da" | "de" | "de-AT" | "de-CH" | "de-DE" | "el" | "en" | "en-AU" | "en-CA" | "en-GB" | "en-IN" | "en-NZ" | "en-SG" | "en-US" | "es" | "es-AR" | "es-ES" | "es-UY" | "fi" | "fr" | "fr-BE" | "fr-CH" | "fr-FR" | "fy" | "fy-NL" | "hi" | "hr" | "it" | "it-CH" | "it-IT" | "ja" | "ko" | "nl" | "nl-BE" | "nl-NL" | "no" | "no-NO" | "pa" | "pl" | "pt" | "pt-BR" | "ru" | "ru-RU" | "sr" | "sr-RS" | "sv" | "sv-SE" | "te" | "zh" | "zh-CN" | "zh-HK" | "zh-SG" | "zh-TW" | string);
162
+ use?: Coding<("900000000000003001" | "900000000000013009" | string)>;
163
163
  value: string;
164
164
  }
165
165
  interface CodeSystemConceptProperty extends BackboneElement {
@@ -226,13 +226,30 @@ interface Count extends Quantity {
226
226
  interface Duration extends Quantity {
227
227
  }
228
228
 
229
+ interface DataRequirementCodeFilter extends Element {
230
+ code?: Coding[];
231
+ path?: string;
232
+ searchParam?: string;
233
+ valueSet?: string;
234
+ }
235
+ interface DataRequirementDateFilter extends Element {
236
+ path?: string;
237
+ searchParam?: string;
238
+ valueDateTime?: string;
239
+ valueDuration?: Duration;
240
+ valuePeriod?: Period;
241
+ }
242
+ interface DataRequirementSort extends Element {
243
+ direction: ("ascending" | "descending");
244
+ path: string;
245
+ }
229
246
  interface DataRequirement extends Element {
230
- codeFilter?: Element[];
231
- dateFilter?: Element[];
247
+ codeFilter?: DataRequirementCodeFilter[];
248
+ dateFilter?: DataRequirementDateFilter[];
232
249
  limit?: number;
233
250
  mustSupport?: string[];
234
251
  profile?: string[];
235
- sort?: Element[];
252
+ sort?: DataRequirementSort[];
236
253
  subjectCodeableConcept?: CodeableConcept;
237
254
  subjectReference?: Reference<"Group">;
238
255
  type: string;
@@ -246,17 +263,44 @@ interface Ratio extends Element {
246
263
  numerator?: Quantity;
247
264
  }
248
265
 
266
+ interface TimingRepeat extends Element {
267
+ boundsDuration?: Duration;
268
+ boundsPeriod?: Period;
269
+ boundsRange?: Range;
270
+ count?: number;
271
+ countMax?: number;
272
+ dayOfWeek?: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
273
+ duration?: number;
274
+ durationMax?: number;
275
+ durationUnit?: ("s" | "min" | "h" | "d" | "wk" | "mo" | "a");
276
+ frequency?: number;
277
+ frequencyMax?: number;
278
+ offset?: number;
279
+ period?: number;
280
+ periodMax?: number;
281
+ periodUnit?: ("s" | "min" | "h" | "d" | "wk" | "mo" | "a");
282
+ timeOfDay?: string[];
283
+ when?: ("MORN" | "MORN.early" | "MORN.late" | "NOON" | "AFT" | "AFT.early" | "AFT.late" | "EVE" | "EVE.early" | "EVE.late" | "NIGHT" | "PHS" | "HS" | "WAKE" | "C" | "CM" | "CD" | "CV" | "AC" | "ACM" | "ACD" | "ACV" | "PC" | "PCM" | "PCD" | "PCV")[];
284
+ }
249
285
  interface Timing extends BackboneElement {
250
- code?: CodeableConcept;
286
+ code?: CodeableConcept<("BID" | "TID" | "QID" | "AM" | "PM" | "QD" | "QOD" | "Q1H" | "Q2H" | "Q3H" | "Q4H" | "Q6H" | "Q8H" | "BED" | "WK" | "MO" | string)>;
251
287
  event?: string[];
252
- repeat?: Element;
288
+ repeat?: TimingRepeat;
253
289
  }
254
290
 
291
+ interface DosageDoseAndRate extends Element {
292
+ doseQuantity?: Quantity;
293
+ doseRange?: Range;
294
+ rateQuantity?: Quantity;
295
+ rateRange?: Range;
296
+ rateRatio?: Ratio;
297
+ type?: CodeableConcept;
298
+ }
255
299
  interface Dosage extends BackboneElement {
256
300
  additionalInstruction?: CodeableConcept[];
257
301
  asNeededBoolean?: boolean;
258
302
  asNeededCodeableConcept?: CodeableConcept;
259
- doseAndRate?: Element[];
303
+ doseAndRate?: DosageDoseAndRate[];
260
304
  maxDosePerAdministration?: Quantity;
261
305
  maxDosePerLifetime?: Quantity;
262
306
  maxDosePerPeriod?: Ratio;
@@ -272,7 +316,7 @@ interface Dosage extends BackboneElement {
272
316
  interface Expression extends Element {
273
317
  description?: string;
274
318
  expression?: string;
275
- language: string;
319
+ language: ("text/cql" | "text/fhirpath" | "application/x-fhir-query" | string);
276
320
  name?: string;
277
321
  reference?: string;
278
322
  }
@@ -327,7 +371,7 @@ interface Signature extends Element {
327
371
  onBehalfOf?: Reference<"Device" | "Organization" | "Patient" | "Practitioner" | "PractitionerRole" | "RelatedPerson">;
328
372
  sigFormat?: string;
329
373
  targetFormat?: string;
330
- type: Coding[];
374
+ type: Coding<("1.2.840.10065.1.12.1.1" | "1.2.840.10065.1.12.1.2" | "1.2.840.10065.1.12.1.3" | "1.2.840.10065.1.12.1.4" | "1.2.840.10065.1.12.1.5" | "1.2.840.10065.1.12.1.6" | "1.2.840.10065.1.12.1.7" | "1.2.840.10065.1.12.1.8" | "1.2.840.10065.1.12.1.9" | "1.2.840.10065.1.12.1.10" | "1.2.840.10065.1.12.1.11" | "1.2.840.10065.1.12.1.12" | "1.2.840.10065.1.12.1.13" | "1.2.840.10065.1.12.1.14" | "1.2.840.10065.1.12.1.15" | "1.2.840.10065.1.12.1.16" | "1.2.840.10065.1.12.1.17" | "1.2.840.10065.1.12.1.18" | string)>[];
331
375
  when: string;
332
376
  who: Reference<"Device" | "Organization" | "Patient" | "Practitioner" | "PractitionerRole" | "RelatedPerson">;
333
377
  }
@@ -343,14 +387,109 @@ interface TriggerDefinition extends Element {
343
387
  type: ("named-event" | "periodic" | "data-changed" | "data-added" | "data-modified" | "data-removed" | "data-accessed" | "data-access-ended");
344
388
  }
345
389
 
390
+ interface ElementDefinitionBase extends Element {
391
+ max: string;
392
+ min: number;
393
+ path: string;
394
+ }
395
+ interface ElementDefinitionBinding extends Element {
396
+ description?: string;
397
+ strength: ("required" | "extensible" | "preferred" | "example");
398
+ valueSet?: string;
399
+ }
400
+ interface ElementDefinitionConstraint extends Element {
401
+ expression?: string;
402
+ human: string;
403
+ key: string;
404
+ requirements?: string;
405
+ severity: ("error" | "warning");
406
+ source?: string;
407
+ xpath?: string;
408
+ }
409
+ interface ElementDefinitionExample extends Element {
410
+ label: string;
411
+ valueAddress?: Address;
412
+ valueAge?: Age;
413
+ valueAnnotation?: Annotation;
414
+ valueAttachment?: Attachment;
415
+ valueBase64Binary?: string;
416
+ valueBoolean?: boolean;
417
+ valueCanonical?: string;
418
+ valueCode?: string;
419
+ valueCodeableConcept?: CodeableConcept;
420
+ valueCoding?: Coding;
421
+ valueContactDetail?: ContactDetail;
422
+ valueContactPoint?: ContactPoint;
423
+ valueContributor?: Contributor;
424
+ valueCount?: Count;
425
+ valueDataRequirement?: DataRequirement;
426
+ valueDate?: string;
427
+ valueDateTime?: string;
428
+ valueDecimal?: number;
429
+ valueDistance?: Distance;
430
+ valueDosage?: Dosage;
431
+ valueDuration?: Duration;
432
+ valueExpression?: Expression;
433
+ valueHumanName?: HumanName;
434
+ valueId?: string;
435
+ valueIdentifier?: Identifier;
436
+ valueInstant?: string;
437
+ valueInteger?: number;
438
+ valueMarkdown?: string;
439
+ valueMeta?: Meta;
440
+ valueMoney?: Money;
441
+ valueOid?: string;
442
+ valueParameterDefinition?: ParameterDefinition;
443
+ valuePeriod?: Period;
444
+ valuePositiveInt?: number;
445
+ valueQuantity?: Quantity;
446
+ valueRange?: Range;
447
+ valueRatio?: Ratio;
448
+ valueReference?: Reference;
449
+ valueRelatedArtifact?: RelatedArtifact;
450
+ valueSampledData?: SampledData;
451
+ valueSignature?: Signature;
452
+ valueString?: string;
453
+ valueTime?: string;
454
+ valueTiming?: Timing;
455
+ valueTriggerDefinition?: TriggerDefinition;
456
+ valueUnsignedInt?: number;
457
+ valueUri?: string;
458
+ valueUrl?: string;
459
+ valueUsageContext?: UsageContext;
460
+ valueUuid?: string;
461
+ }
462
+ interface ElementDefinitionMapping extends Element {
463
+ comment?: string;
464
+ identity: string;
465
+ language?: string;
466
+ map: string;
467
+ }
468
+ interface ElementDefinitionSlicing extends Element {
469
+ description?: string;
470
+ discriminator?: ElementDefinitionSlicingDiscriminator[];
471
+ ordered?: boolean;
472
+ rules: ("closed" | "open" | "openAtEnd");
473
+ }
474
+ interface ElementDefinitionSlicingDiscriminator extends Element {
475
+ path: string;
476
+ type: ("value" | "exists" | "pattern" | "type" | "profile");
477
+ }
478
+ interface ElementDefinitionType extends Element {
479
+ aggregation?: ("contained" | "referenced" | "bundled")[];
480
+ code: string;
481
+ profile?: string[];
482
+ targetProfile?: string[];
483
+ versioning?: ("either" | "independent" | "specific");
484
+ }
346
485
  interface ElementDefinition extends BackboneElement {
347
486
  alias?: string[];
348
- base?: Element;
349
- binding?: Element;
487
+ base?: ElementDefinitionBase;
488
+ binding?: ElementDefinitionBinding;
350
489
  code?: Coding[];
351
490
  comment?: string;
352
491
  condition?: string[];
353
- constraint?: Element[];
492
+ constraint?: ElementDefinitionConstraint[];
354
493
  contentReference?: string;
355
494
  defaultValueAddress?: Address;
356
495
  defaultValueAge?: Age;
@@ -403,7 +542,7 @@ interface ElementDefinition extends BackboneElement {
403
542
  defaultValueUsageContext?: UsageContext;
404
543
  defaultValueUuid?: string;
405
544
  definition?: string;
406
- example?: Element[];
545
+ example?: ElementDefinitionExample[];
407
546
  fixedAddress?: Address;
408
547
  fixedAge?: Age;
409
548
  fixedAnnotation?: Annotation;
@@ -458,7 +597,7 @@ interface ElementDefinition extends BackboneElement {
458
597
  isModifierReason?: string;
459
598
  isSummary?: boolean;
460
599
  label?: string;
461
- mapping?: Element[];
600
+ mapping?: ElementDefinitionMapping[];
462
601
  max?: string;
463
602
  maxLength?: number;
464
603
  maxValueDate?: string;
@@ -539,8 +678,8 @@ interface ElementDefinition extends BackboneElement {
539
678
  short?: string;
540
679
  sliceIsConstraining?: boolean;
541
680
  sliceName?: string;
542
- slicing?: Element;
543
- type?: Element[];
681
+ slicing?: ElementDefinitionSlicing;
682
+ type?: ElementDefinitionType[];
544
683
  }
545
684
 
546
685
  interface StructureDefinitionContext extends BackboneElement {
@@ -575,7 +714,7 @@ interface StructureDefinition extends DomainResource {
575
714
  fhirVersion?: ("0.01" | "0.05" | "0.06" | "0.11" | "0.0.80" | "0.0.81" | "0.0.82" | "0.4.0" | "0.5.0" | "1.0.0" | "1.0.1" | "1.0.2" | "1.1.0" | "1.4.0" | "1.6.0" | "1.8.0" | "3.0.0" | "3.0.1" | "3.3.0" | "3.5.0" | "4.0.0" | "4.0.1");
576
715
  identifier?: Identifier[];
577
716
  jurisdiction?: CodeableConcept[];
578
- keyword?: Coding[];
717
+ keyword?: Coding<("fhir-structure" | "custom-resource" | "dam" | "wire-format" | "archetype" | "template" | string)>[];
579
718
  kind: ("primitive-type" | "complex-type" | "resource" | "logical");
580
719
  mapping?: StructureDefinitionMapping[];
581
720
  name: string;
@@ -609,8 +748,8 @@ interface ValueSetComposeIncludeConcept extends BackboneElement {
609
748
  display?: string;
610
749
  }
611
750
  interface ValueSetComposeIncludeConceptDesignation extends BackboneElement {
612
- language?: string;
613
- use?: Coding;
751
+ language?: ("ar" | "bn" | "cs" | "da" | "de" | "de-AT" | "de-CH" | "de-DE" | "el" | "en" | "en-AU" | "en-CA" | "en-GB" | "en-IN" | "en-NZ" | "en-SG" | "en-US" | "es" | "es-AR" | "es-ES" | "es-UY" | "fi" | "fr" | "fr-BE" | "fr-CH" | "fr-FR" | "fy" | "fy-NL" | "hi" | "hr" | "it" | "it-CH" | "it-IT" | "ja" | "ko" | "nl" | "nl-BE" | "nl-NL" | "no" | "no-NO" | "pa" | "pl" | "pt" | "pt-BR" | "ru" | "ru-RU" | "sr" | "sr-RS" | "sv" | "sv-SE" | "te" | "zh" | "zh-CN" | "zh-HK" | "zh-SG" | "zh-TW" | string);
752
+ use?: Coding<("900000000000003001" | "900000000000013009" | string)>;
614
753
  value: string;
615
754
  }
616
755
  interface ValueSetComposeIncludeFilter extends BackboneElement {
@@ -668,42 +807,6 @@ interface ValueSet extends DomainResource {
668
807
  version?: string;
669
808
  }
670
809
 
671
- type LogLevel = "DEBUG" | "INFO" | "WARN" | "ERROR" | "SILENT";
672
- type LogEntry<T extends string = string> = {
673
- level: LogLevel;
674
- tag?: T;
675
- message: string;
676
- suppressed: boolean;
677
- prefix: string;
678
- timestamp: number;
679
- };
680
- type Log<T extends string = string> = {
681
- warn: TaggedLogFn<T>;
682
- dryWarn: TaggedLogFn<T>;
683
- info: TaggedLogFn<T>;
684
- error: TaggedLogFn<T>;
685
- debug: TaggedLogFn<T>;
686
- };
687
- type LogManager<T extends string = string> = Log<T> & {
688
- fork(prefix: string, opts?: Partial<LoggerOptions<T>>): LogManager<T>;
689
- as<Narrower extends string>(): LogManager<Narrower>;
690
- tagCounts(): Readonly<Record<string, number>>;
691
- printTagSummary(): void;
692
- buffer(): readonly LogEntry<T>[];
693
- bufferClear(): void;
694
- };
695
- type TaggedLogFn<T extends string> = (...args: [string] | [T, string]) => void;
696
- type LoggerOptions<T extends string> = {
697
- prefix?: string;
698
- suppressTags?: T[];
699
- level?: LogLevel;
700
- };
701
-
702
- type CodegenTag = "#binding" | "#largeValueSet" | "#fieldTypeNotFound" | "#skipCanonical" | "#duplicateSchema" | "#duplicateCanonical" | "#resolveBase";
703
- type CodegenLog = Log<CodegenTag>;
704
- type CodegenLogManager = LogManager<CodegenTag>;
705
- declare const mkCodegenLogger: (opts?: LoggerOptions<CodegenTag>) => LogManager<CodegenTag>;
706
-
707
810
  /**
708
811
  * A code generation friendly representation of FHIR StructureDefinition and
709
812
  * FHIR Schema designed to simplify SDK resource classes/types generation.
@@ -726,28 +829,94 @@ type RichStructureDefinition = Omit<StructureDefinition, "url"> & {
726
829
  package_version: PkgVersion;
727
830
  url: CanonicalUrl;
728
831
  };
729
- type RichFHIRSchema = Omit<FS.FHIRSchema, "package_meta" | "base" | "name" | "url"> & {
832
+ type FHIRSchemaKind = "primitive-type" | "complex-type" | "resource" | "logical";
833
+ type RichFHIRSchemaBase = Omit<FS.FHIRSchema, "package_meta" | "base" | "name" | "url" | "derivation" | "kind"> & {
730
834
  package_meta: PackageMeta;
731
835
  name: Name;
732
836
  url: CanonicalUrl;
733
837
  base: CanonicalUrl;
838
+ kind: FHIRSchemaKind;
839
+ };
840
+ type RichProfileFHIRSchema = RichFHIRSchemaBase & {
841
+ derivation: "constraint";
842
+ };
843
+ type RichPrimitiveFHIRSchema = RichFHIRSchemaBase & {
844
+ derivation: "specialization";
845
+ kind: "primitive-type";
846
+ };
847
+ type RichComplexTypeFHIRSchema = RichFHIRSchemaBase & {
848
+ derivation: "specialization";
849
+ kind: "complex-type";
734
850
  };
851
+ type RichResourceFHIRSchema = RichFHIRSchemaBase & {
852
+ derivation: "specialization";
853
+ kind: "resource";
854
+ };
855
+ type RichLogicalFHIRSchema = RichFHIRSchemaBase & {
856
+ derivation: "specialization";
857
+ kind: "logical";
858
+ };
859
+ type RichSpecializationFHIRSchema = RichPrimitiveFHIRSchema | RichComplexTypeFHIRSchema | RichResourceFHIRSchema | RichLogicalFHIRSchema;
860
+ type RichFHIRSchema = RichProfileFHIRSchema | RichSpecializationFHIRSchema;
735
861
  type RichValueSet = Omit<ValueSet, "name" | "url"> & {
736
862
  package_meta: PackageMeta;
737
863
  name: Name;
738
864
  url: CanonicalUrl;
739
865
  };
740
866
 
867
+ type CollisionResolution = {
868
+ package: string;
869
+ canonical: string;
870
+ };
871
+ type ResolveCollisionsConf = Record<string, CollisionResolution>;
741
872
  type IrConf = {
742
873
  treeShake?: TreeShakeConf;
743
874
  promoteLogical?: LogicalPromotionConf;
875
+ resolveCollisions?: ResolveCollisionsConf;
744
876
  };
745
877
  type LogicalPromotionConf = Record<PkgName$1, CanonicalUrl[]>;
746
878
  type TreeShakeConf = Record<string, Record<string, TreeShakeRule>>;
747
879
  type TreeShakeRule = {
748
880
  ignoreFields?: string[];
749
881
  selectFields?: string[];
882
+ ignoreExtensions?: string[];
883
+ };
884
+
885
+ type LogLevel = "DEBUG" | "INFO" | "WARN" | "ERROR" | "SILENT";
886
+ type LogEntry<T extends string = string> = {
887
+ level: LogLevel;
888
+ tag?: T;
889
+ message: string;
890
+ suppressed: boolean;
891
+ prefix: string;
892
+ timestamp: number;
893
+ };
894
+ type Log<T extends string = string> = {
895
+ warn: TaggedLogFn<T>;
896
+ dryWarn: TaggedLogFn<T>;
897
+ info: TaggedLogFn<T>;
898
+ error: TaggedLogFn<T>;
899
+ debug: TaggedLogFn<T>;
750
900
  };
901
+ type LogManager<T extends string = string> = Log<T> & {
902
+ fork(prefix: string, opts?: Partial<LoggerOptions<T>>): LogManager<T>;
903
+ as<Narrower extends string>(): LogManager<Narrower>;
904
+ tagCounts(): Readonly<Record<string, number>>;
905
+ printTagSummary(): void;
906
+ buffer(): readonly LogEntry<T>[];
907
+ bufferClear(): void;
908
+ };
909
+ type TaggedLogFn<T extends string> = (...args: [string] | [T, string]) => void;
910
+ type LoggerOptions<T extends string> = {
911
+ prefix?: string;
912
+ suppressTags?: T[];
913
+ level?: LogLevel;
914
+ };
915
+
916
+ type CodegenTag = "#binding" | "#largeValueSet" | "#fieldTypeNotFound" | "#skipCanonical" | "#duplicateSchema" | "#duplicateCanonical" | "#resolveBase" | "#resolveCollisionMiss";
917
+ type CodegenLog = Log<CodegenTag>;
918
+ type CodegenLogManager = LogManager<CodegenTag>;
919
+ declare const mkCodegenLogger: (opts?: LoggerOptions<CodegenTag>) => LogManager<CodegenTag>;
751
920
 
752
921
  type Register = {
753
922
  testAppendFs(fs: FHIRSchema): void;
@@ -912,8 +1081,7 @@ interface APIBuilderOptions {
912
1081
  outputDir: string;
913
1082
  cleanOutput: boolean;
914
1083
  throwException: boolean;
915
- treeShake: TreeShakeConf | undefined;
916
- promoteLogical: LogicalPromotionConf | undefined;
1084
+ typeSchema?: IrConf;
917
1085
  /** Custom FHIR package registry URL (default: https://fs.get-ig.org/pkgs/) */
918
1086
  registry: string | undefined;
919
1087
  /** Drop the canonical manager cache */