UNPKG

@oystehr/sdk

Version:

Oystehr SDK

48 lines (47 loc) 3.65 kB
import { Address as AddressR4B, HumanName as HumanNameR4B } from 'fhir/r4b'; import { Address as AddressR5, HumanName as HumanNameR5 } from 'fhir/r5'; import { BatchInput, Bundle, FhirCreateParams, FhirDeleteParams, FhirGetParams, FhirHistoryGetParams, FhirHistorySearchParams, FhirPatchParams, FhirResource, FhirSearchParams, FhirUpdateParams } from '../..'; import { FhirFetcherResponse, OystehrClientRequest, SDKResource } from '../../client/client'; /** * Optional parameter that can be passed to the client methods. It allows * overriding the access token or project ID, and setting various headers, * such as 'Content-Type'. Also support enabling optimistic locking. */ export interface OystehrFHIRUpdateClientRequest extends OystehrClientRequest { /** * Enable optimistic locking for the request. If set to a version ID, the request will * include the 'If-Match' header with that value in the FHIR optimistic-locking format. * If the resource has been updated since the version provided, the request * will fail with a 412 Precondition Failed error. */ optimisticLockingVersionId?: string; } /** * Performs a FHIR search and returns the results as a Bundle resource * * @param options FHIR resource type and FHIR search parameters * @param request optional OystehrClientRequest object * @returns FHIR Bundle resource */ export declare function search<T extends FhirResource>(this: SDKResource, params: FhirSearchParams<T>, request?: OystehrClientRequest): Promise<FhirFetcherResponse<Bundle<T>>>; export declare function create<T extends FhirResource>(this: SDKResource, params: FhirCreateParams<T>, request?: OystehrClientRequest): Promise<FhirFetcherResponse<T>>; export declare function get<T extends FhirResource>(this: SDKResource, { resourceType, id }: FhirGetParams<T>, request?: OystehrClientRequest): Promise<FhirFetcherResponse<T>>; export declare function update<T extends FhirResource>(this: SDKResource, params: FhirUpdateParams<T>, request?: OystehrFHIRUpdateClientRequest): Promise<FhirFetcherResponse<T>>; export declare function patch<T extends FhirResource>(this: SDKResource, { resourceType, id, operations }: FhirPatchParams<T>, request?: OystehrFHIRUpdateClientRequest): Promise<FhirFetcherResponse<T>>; declare function del<T extends FhirResource>(this: SDKResource, { resourceType, id }: FhirDeleteParams<T>, request?: OystehrClientRequest): Promise<FhirFetcherResponse<T>>; export { del as delete }; export declare function history<T extends FhirResource>(this: SDKResource, { resourceType, id }: FhirHistorySearchParams<T>, request?: OystehrClientRequest): Promise<FhirFetcherResponse<Bundle<T>>>; export declare function history<T extends FhirResource>(this: SDKResource, { resourceType, id, versionId }: FhirHistoryGetParams<T>, request?: OystehrClientRequest): Promise<FhirFetcherResponse<T>>; export declare const batch: <BundleContentType extends FhirResource>(this: SDKResource, input: BatchInput<BundleContentType>, request?: OystehrClientRequest) => Promise<FhirFetcherResponse<Bundle<BundleContentType>>>; export declare const transaction: <BundleContentType extends FhirResource>(this: SDKResource, input: BatchInput<BundleContentType>, request?: OystehrClientRequest) => Promise<FhirFetcherResponse<Bundle<BundleContentType>>>; export declare function formatAddress(address: AddressR4B | AddressR5, options?: { all?: boolean; use?: boolean; lineSeparator?: string; }): string; export declare function formatHumanName(name: HumanNameR4B | HumanNameR5, options?: { all?: boolean; prefix?: boolean; suffix?: boolean; use?: boolean; }): string;