Utility functions and APIs to help with building backend apps for NodeJS.
yarn add plasma-fhir-backend-utils
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 to -
privateKey
: 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 app -
tokenUrl
: URL of the token endpoint for your FHIR server- This can be found at:
- /.well-known/smart-configuration
- /metadata
- This can be found at:
-
yarn build
- or
tsc
if that doesn't work
- or
yarn test
yarn build
-
yarn test
- Windows:
npx mocha -r ts-node/register tests/**/*.spec.ts
- Windows:
- Login as
plasmafhir
- Increment version
npm publish