{"id":13454517,"url":"https://github.com/Vermonster/fhir-kit-client","last_synced_at":"2025-03-24T05:34:02.394Z","repository":{"id":41211690,"uuid":"127456865","full_name":"Vermonster/fhir-kit-client","owner":"Vermonster","description":"Node.js FHIR client library","archived":false,"fork":false,"pushed_at":"2023-11-10T16:01:58.000Z","size":2281,"stargazers_count":166,"open_issues_count":8,"forks_count":35,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-26T10:45:16.651Z","etag":null,"topics":["cds-hooks","fhir","hl7","javascript","nodejs","smart","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vermonster.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-30T17:49:08.000Z","updated_at":"2024-04-24T09:07:11.000Z","dependencies_parsed_at":"2024-01-18T17:44:11.440Z","dependency_job_id":"be399183-bc19-474b-a900-e92e490d573e","html_url":"https://github.com/Vermonster/fhir-kit-client","commit_stats":{"total_commits":209,"total_committers":17,"mean_commits":"12.294117647058824","dds":0.3971291866028708,"last_synced_commit":"e906ddef188a5cd7f933fbf553cd65a9e5c2c5fd"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vermonster%2Ffhir-kit-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vermonster%2Ffhir-kit-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vermonster%2Ffhir-kit-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vermonster%2Ffhir-kit-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vermonster","download_url":"https://codeload.github.com/Vermonster/fhir-kit-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217433,"owners_count":20579291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cds-hooks","fhir","hl7","javascript","nodejs","smart","typescript"],"created_at":"2024-07-31T08:00:54.899Z","updated_at":"2025-03-24T05:34:01.827Z","avatar_url":"https://github.com/Vermonster.png","language":"JavaScript","funding_links":[],"categories":["Clients"],"sub_categories":[],"readme":"# FHIRKit Client\n[![npm version](https://badge.fury.io/js/fhir-kit-client.svg)](https://badge.fury.io/js/fhir-kit-client)\n[![Build Status](https://github.com/Vermonster/fhir-kit-client/actions/workflows/node.js.yml/badge.svg)](https://github.com/Vermonster/fhir-kit-client/actions/workflows/node.js.yml)\n[![Coverage Status](https://coveralls.io/repos/github/Vermonster/fhir-kit-client/badge.svg?branch=master)](https://coveralls.io/github/Vermonster/fhir-kit-client?branch=master)\n[![GitHub license](https://img.shields.io/github/license/Vermonster/fhir-kit-client.svg)](https://github.com/Vermonster/fhir-kit-client/blob/master/LICENSE)\n\nNode FHIR client library\n\n## Features\n\n* Support for R4 (4.0.1, 4.0.0, 3.5.0, 3.3.0, 3.2.0), STU3 (3.0.1, 1.8.0, 1.6.0, 1.4.0, 1.1.0) and DSTU2 (1.0.2)\n* Support for all FHIR REST actions\n* Support for FHIR operations\n* Typescript support\n* Pagination support for search results\n* Batch and transaction support\n* Support for absolute, in-bundle, and contained references\n* Metadata caching on client instance\n* SMART security support\n* Capability-checking tool based on server capability statements\n* Minimal dependencies\n* Contemporary async/await structure\n* Modern ES6 Classes\n* TDD with Mocha\n* URL polyfill (so it works in client-only apps without much trouble)\n* Support optional parameters for the request, such as TLS key and cert\n\n## Roadmap\n\nProject roadmap uses [Github Projects](https://github.com/Vermonster/fhir-kit-client/projects/1).\n\n## Typescript Support\n\nThere is now early Typescript support for this library. This library is\nintended to be agnostic to the version of FHIR, but there is a WIP pattern to\nuse with @types/fhir.\n\nAssume a project where you did the following setup:\n```\n\u003e npm install fhir-kit-client\n\u003e npm install -D @types/fhir\n```\n\nNow in your code, you can:\n\n```typescript\nimport Client from 'fhir-kit-client'\n\nconst client = new Client({ baseUrl: 'http://foo.com' })\n\nconst isPatient = (resource: fhir4.Resource): resource is fhir4.Patient =\u003e {\n  return resource.resourceType === 'Patient'\n}\n\nclient\n  .read({resourceType: 'Patient', id: '12'})\n  .then(res =\u003e {\n    if (isPatient(res)) {\n      console.dir(res.name, { depth: 4})\n    }\n  })\n```\n\nThis example uses a type guard for R4 Patient. If you are building an app that\nconnects to systems with different versions, you could write a wrapper for each\nfhir version in your app.\n\n## Examples\n\nExamples using promises...\n\n```javascript\nconst Client = require('fhir-kit-client');\nconst fhirClient = new Client({\n  baseUrl: 'https://sb-fhir-stu3.smarthealthit.org/smartstu3/open'\n  });\n\n// Get SMART URLs for OAuth\nfhirClient.smartAuthMetadata().then((response) =\u003e {\n  console.log(response);\n  });\n\n\n// Direct request\nfhirClient.request('Patient/123')\n  .then(response =\u003e console.log(response));\n\nfhirClient.request('Patient/123', { method: 'DELETE' })\n  .then(response =\u003e console.log(response));\n\n// Read a patient\nfhirClient\n  .read({ resourceType: 'Patient', id: '2e27c71e-30c8-4ceb-8c1c-5641e066c0a4' })\n  .then((response) =\u003e {\n    console.log(response);\n  });\n\n\n// Search for patients, and page through results\nfhirClient\n  .search({ resourceType: 'Patient', searchParams: { _count: '3', gender: 'female' } })\n  .then((response) =\u003e {\n    console.log(response);\n    return response;\n  })\n  .then((response) =\u003e {\n    console.log(response);\n    return fhirClient.nextPage(response);\n  })\n  .then((response) =\u003e {\n    console.log(response);\n    return fhirClient.prevPage(response);\n  })\n  .catch((error) =\u003e {\n    console.error(error);\n  });\n```\n\nExamples using async/await...\n\n```javascript\nconst Client = require('fhir-kit-client');\nconst fhirClient = new Client({\n  baseUrl: 'https://sb-fhir-stu3.smarthealthit.org/smartstu3/open'\n  });\n\nasync function asyncExamples() {\n  // Get SMART URLs for OAuth\n  let response = await fhirClient.smartAuthMetadata();\n  console.log(response);\n\n\n  // Read a patient\n  response = await fhirClient\n    .read({ resourceType: 'Patient', id: '2e27c71e-30c8-4ceb-8c1c-5641e066c0a4' });\n  console.log(response);\n\n\n  // Search for a patient with name matching abbott, then paging\n  let searchResponse = await fhirClient\n    .search({ resourceType: 'Patient', searchParams: { name: 'abbott ' } })\n  console.log(searchResponse);\n\n  searchResponse = await fhirClient.nextPage(searchResponse);\n  console.log(searchResponse);\n\n  searchResponse = await fhirClient.prevPage(searchResponse);\n  console.log(searchResponse);\n}\n\nasyncExamples();\n```\n\nFor more examples see the JS Docs and Launch Examples below.\n\n## Documentation\n\n[JSDoc-generated documentation with plenty of examples](https://vermonster.github.io/fhir-kit-client/fhir-kit-client/1.9.2/index.html)\n\n## Launch Examples (SMART, CDS Hooks)\n\nTo see how to follow launch and authorization workflows for FHIR applications,\nsee the [examples directory](./examples/) and [examples README](./examples/README.md).\n\n## Example React App\n\n[FHIRKit Create React App](https://github.com/Vermonster/fhir-kit-create-react)\nprovides a [create-react-app](https://github.com/facebook/create-react-app)\ntemplate that can be used to create a sample React app using FHIRKit Client.\n\n## Even more Examples (client-side ones)\n\nSee https://github.com/Vermonster/fhir-kit-client-examples for examples in React,\nAngular, and React Native.\n\n## Logging\n\nThe [debug library](https://www.npmjs.com/package/debug) can provide logging\nduring development. Two different logging namespaces are provided, `fhir-kit-\nclient:info` logs each request and response, and `fhir-kit-client:error` logs\nerrors. To enable logging during development, add one of the namespaces to the\nDEBUG environment variable, or use `fhir-kit-client:*` to enable both.\n\n```\n$ DEBUG=fhir-kit-client:* node smart-launch.js\n```\n\n## Contributing\n\nFHIRKit Client is an open source Node.js FHIR client library that welcomes\ncommunity contributions with enthusiasm.\n\nAll are welcome to participate. By participating in this project, you agree to\nfollow the [Code of\nConduct](https://github.com/Vermonster/fhir-kit-client/blob/master/CODE_OF_CONDUCT.md).\n\nPlease see our\n[Contributing](https://github.com/Vermonster/fhir-kit-client/blob/master/CONTRIBUTING.md)\ndocument for more details on how to get started.\n\n## License\n\nMIT\n\nCopyright (c) 2018 Vermonster LLC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVermonster%2Ffhir-kit-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVermonster%2Ffhir-kit-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVermonster%2Ffhir-kit-client/lists"}