fhir-snapshot-generator
Version:
Generate snapshots for FHIR Profiles
38 lines • 1.94 kB
TypeScript
/**
* © Copyright Outburn Ltd. 2022-2025 All Rights Reserved
* Project name: fhir-snapshot-generator
*/
import { FhirPackageExplorer, PackageIdentifier } from 'fhir-package-explorer';
import { ElementDefinition, SnapshotFetcher } from '../../../types';
/**
* A class dedicated to fetching FHIR definitions in the correct context for a specific snapshot generation process.
* We use a class to encapsulate the context and expose methods that need fewer arguments/injections.
*/
export declare class DefinitionFetcher {
private sourcePackage;
private corePackage;
private fpe;
private elementCache;
private snapshotFetcher;
constructor(sourcePackage: PackageIdentifier, corePackage: PackageIdentifier, fpe: FhirPackageExplorer, snapshotFetcher: SnapshotFetcher);
/**
* Get the definition for one of the base FHIR types.
* @param type The type ID (e.g., "CodeableConcept", "Quantity", etc.).
*/
getBaseType(type: string): Promise<ElementDefinition[]>;
/**
* Get the structure of a contentReference element.
* @param identifier The identifier of the contentReference (e.g., "#Observation.referenceRange").
*/
getContentReference(identifier: string): Promise<ElementDefinition[]>;
/**
* When a profile references a type using a URL, the target may be either a profile or a base type.
* This method resolves the URL, and if it is a base type (derivation=specialization), returns its snapshot.
* If it is a profile, it returns the snapshot of the profile using the injected snapshotFetcher().
* The snapshotFetcher is expected to return a pre-generated snapshot from the cache or generate a new one.
* @param url Canonical URL of the type or profile.
* @returns The snapshot elements of the resolved type or profile.
*/
getByUrl(url: string): Promise<ElementDefinition[]>;
}
//# sourceMappingURL=definitionFetcher.d.ts.map