/** * Terminology API Client * * HTTP client for terminology server operations ($expand, $validate-code). * Extracted from valueset-validator.ts for modularity. */ import type { TerminologyResolutionConfig, TerminologyServerOverride } from './valueset-types'; import { ValueSetCache } from './valueset-cache'; import type { CodeSystemValidationResult, SubsumptionOutcome } from './terminology-api-types'; export type { CodeSystemValidationIssue, CodeSystemValidationResult, SubsumptionOutcome, } from './terminology-api-types'; export { clearSubsumesCache, clearCodeSystemValidateCodeCache, clearValidateCodeCache, getCachedSubsumesOutcome, getSubsumesCacheSize, getValidateCodeCacheSize, } from './terminology-api-cache'; export { isSnomedNationalExtensionCode } from './terminology-code-system-result'; export declare class TerminologyApiClient { private config; private cache; private readonly requestConfigBuilder; private readonly remoteCodeSystemBudget; constructor(config: TerminologyResolutionConfig, cache?: ValueSetCache); /** * Update the configuration. Also invalidates the cached OAuth2 * token so a changed auth config takes effect on the next call. */ setConfig(config: TerminologyResolutionConfig): void; /** * Expand a ValueSet using a remote terminology server ($expand operation) * Returns null if server is unavailable or expansion fails */ expandValueSet(valueSetUrl: string, override?: TerminologyServerOverride): Promise | null>; /** * Validate a code against a ValueSet using $validate-code * @param bindingStrength - If 'required', fail closed on server errors (422/404) */ validateCode(code: string, system: string | undefined, valueSetUrl: string, bindingStrength?: 'required' | 'extensible' | 'preferred' | 'example', override?: TerminologyServerOverride): Promise; /** * Validate a code directly against a CodeSystem using tx.fhir.org $validate-code * Used for large external CodeSystems like LOINC and SNOMED * * Uses circuit breaker to prevent flooding failing servers with requests. */ validateCodeInCodeSystem(code: string, system: string, display?: string, override?: TerminologyServerOverride): Promise; private executeCodeSystemValidateCodeRequest; private handleCodeSystemValidationError; /** * Ask the terminology server whether codeA subsumes codeB in a CodeSystem. * Used as a targeted fallback for filtered ValueSets such as * `concept is-a ` when a local CodeSystem tree is unavailable. */ subsumes(system: string, codeA: string, codeB: string, override?: TerminologyServerOverride): Promise; private executeValidateCodeRequest; private executeSubsumesRequest; /** * Convenience: returns true when `child` is `codeB` and `parent` is * `codeA` and the server reports `subsumes` or `equivalent`. The * terminology server's argument order (codeA subsumes codeB) is easy * to reverse — this helper makes the intent at the call site obvious. */ isSubsumedBy(system: string, child: string, parent: string, override?: TerminologyServerOverride): Promise; } //# sourceMappingURL=terminology-api-client.d.ts.map