@babelfhir-ts/client-r4b
v0.2.3
Published
Typed FHIR R4B client with read/write/search methods for all 140 base resource types, SMART on FHIR auth, and bundle parsing
Downloads
508
Maintainers
Readme
@babelfhir-ts/client-r4b
Typed FHIR R4B client with read/write/search methods for all 140 base resource types, SMART on FHIR auth, and bundle parsing.
Installation
npm install @babelfhir-ts/client-r4bPeer dependency: @types/fhir
Usage
import { FhirClient } from '@babelfhir-ts/client-r4b';
const client = new FhirClient('https://hapi.fhir.org/baseR4B');
// Typed read — returns fhir4b.Patient
const patient = await client.patient().read('example');
// Search with parameters
const results = await client.observation().search({ subject: 'Patient/example' });SMART on FHIR
import { SmartFhirClient } from '@babelfhir-ts/client-r4b';
const client = new SmartFhirClient({
clientId: 'my-app',
redirectUri: 'http://localhost:3000/callback',
scope: 'openid fhirUser patient/*.read',
fhirBaseUrl: 'https://launch.smarthealthit.org/v/r4b/fhir',
});
await client.authorize();API
| Export | Description |
|---|---|
| FhirReadClient | 140 typed read/search accessors |
| FhirWriteClient | 140 typed create/update/delete accessors |
| FhirClient | Combined read + write client |
| SmartFhirClient | SMART-authenticated FHIR client |
| BundleParser | Static bundle extraction helpers |
| SmartAuth | SMART on FHIR v2 authorization (re-exported from @babelfhir-ts/smart-auth) |
Part of BabelFHIR-TS
This is the R4B variant of the base client from BabelFHIR-TS. See @babelfhir-ts/client-r4 for the R4 version with full usage examples.
License
MIT
