declare const SUPPORTED_RESOURCE_TYPES: readonly ["Patient", "Practitioner", "PractitionerRole", "Organization", "Observation", "Condition", "AllergyIntolerance", "MedicationStatement", "Encounter", "DiagnosticReport", "Bundle"]; type SupportedResourceType = (typeof SUPPORTED_RESOURCE_TYPES)[number]; declare const SUPPORTED_FHIR_VERSIONS: readonly ["R4", "R4B", "R5"]; type FhirVersion = (typeof SUPPORTED_FHIR_VERSIONS)[number]; declare const SUPPORTED_LOCALES: readonly ["us", "uk", "au", "ca", "de", "fr", "nl", "in", "jp", "kr", "sg", "br", "mx", "za"]; type Locale = (typeof SUPPORTED_LOCALES)[number]; interface FhirMeta { versionId?: string; lastUpdated?: string; profile?: string[]; [key: string]: unknown; } /** Minimal FHIR resource shape. Index signature allows arbitrary FHIR fields. */ interface FhirResource { resourceType: string; id?: string; meta?: FhirMeta; [key: string]: unknown; } interface BuilderOptions { locale: Locale; count: number; /** Seed for deterministic random generation. Same seed = same output. */ seed?: number; /** FHIR version to target. Defaults to 'R4'. */ fhirVersion?: FhirVersion; /** Partial overrides to merge into every generated resource. */ overrides?: Record; } interface ResourceBuilder { locale(locale: Locale): this; count(count: number): this; seed(seed: number): this; overrides(overrides: Record): this; build(): T[]; } /** A deterministic random number generator function. Returns [0, 1). */ type RandomFn = () => number; /** * Optional context passed from a resource builder to an identifier generator. * Identifiers that encode demographic data (e.g. Korean RRN) use this to stay * internally consistent with the generated resource. All other generators ignore it. */ interface IdentifierContext { gender?: "male" | "female" | "other" | "unknown"; birthYear?: number; } interface IdentifierDefinition { /** FHIR system URI (e.g., "https://fhir.nhs.uk/Id/nhs-number") */ system: string; /** Human-readable name (e.g., "NHS Number") */ name: string; /** * Check-digit algorithm name, if applicable (e.g., "Modulus 11", "Luhn", "Verhoeff"). * Omitted for identifiers validated by format/range only. */ algorithm?: string; /** * Generate a valid identifier value. * `context` is provided by the patient builder when demographic data is * available. Implementations that don't need it can safely ignore the * second parameter — TypeScript function arity compatibility allows this. */ generate: (rng: RandomFn, context?: IdentifierContext) => string; /** Validate an identifier value */ validate: (value: string) => boolean; } /** A single human-readable note explaining a field in a generated resource. */ interface AnnotationNote { /** JSONPath-style field reference (e.g., "identifier[0].value") */ path: string; /** Plain-language explanation of the field and its value */ note: string; } /** A generated FHIR resource paired with human-readable field explanations. */ interface AnnotatedResource { resource: FhirResource; notes: AnnotationNote[]; } interface CityDefinition { name: string; state?: string; district?: string; } interface AddressTemplate { /** Street name + number patterns */ streets: string[]; /** City definitions with matching state/postcode data */ cities: CityDefinition[]; /** Generate a valid postal code for the given state/region */ generatePostalCode: (rng: RandomFn, state?: string) => string; /** * Format a street address line. Defaults to "{number} {street}" if omitted. * Override for locales that use "{street} {number}" order (DE, NL, FR). */ formatLine?: (number: number, street: string) => string; /** ISO 3166-1 alpha-2 country code */ country: string; } interface NamePool { given: { male: string[]; female: string[]; }; family: string[]; /** Optional prefixes (e.g., "van", "de" for Dutch names) */ prefixes?: string[]; } interface LocaleDefinition { code: Locale; /** Display name (e.g., "United Kingdom") */ name: string; /** Patient identifier definitions for this locale */ patientIdentifiers: IdentifierDefinition[]; /** Practitioner identifier definitions for this locale */ practitionerIdentifiers: IdentifierDefinition[]; /** Organization identifier definitions for this locale */ organizationIdentifiers: IdentifierDefinition[]; /** Address generation data */ address: AddressTemplate; /** Name pools */ names: NamePool; } interface GeneratedFixture { resource: T; /** Which locale was used to generate this resource */ locale: Locale; /** The seed that produced this resource (for reproducibility) */ seed: number; } export { type AddressTemplate as A, type BuilderOptions as B, type CityDefinition as C, type FhirMeta as F, type GeneratedFixture as G, type IdentifierContext as I, type Locale as L, type NamePool as N, type RandomFn as R, SUPPORTED_FHIR_VERSIONS as S, type AnnotatedResource as a, type AnnotationNote as b, type FhirResource as c, type FhirVersion as d, type IdentifierDefinition as e, type LocaleDefinition as f, type ResourceBuilder as g, SUPPORTED_LOCALES as h, SUPPORTED_RESOURCE_TYPES as i, type SupportedResourceType as j };