0.0.7 • Published 3 years ago
plasma-fhir-backend-utils v0.0.7
plasma-fhir-backend-utils
Utility functions and APIs to help with building backend apps for NodeJS.
Installation
yarn add plasma-fhir-backend-utils
Usage
Create a PlasmaFHIRApi instance:
import { plasmaForBackend } from "plasma-fhir-backend-utils";
import { PlasmaFHIRApi, Resources } from "plasma-fhir-app-utils";
const plasma: PlasmaFHIRApi = await plasmaForBackend(iss, privateKey, clientId, tokenUrl);
plasma.readResource<Resources.Immunization>("Immunization", { "patient": patientId })
.then((immunizations: Resources.Immunization[]) => {
console.log("Immunizations", immunizations);
});iss: URL to the FHIR server you are connecting toprivateKey: The text of the private key- See here for details on generating one: https://fhir.epic.com/Documentation?docId=oauth2§ion=Creating-Key-Pair
clientId: Client ID of your apptokenUrl: URL of the token endpoint for your FHIR server- This can be found at:
- /.well-known/smart-configuration
- /metadata
- This can be found at:
Development
Build
yarn build- or
tscif that doesn't work
- or
Unit Tests
yarn test
Publish/Deploy
yarn buildyarn test- Windows:
npx mocha -r ts-node/register tests/**/*.spec.ts
- Windows:
- Login as
plasmafhir - Increment version
npm publish