0.0.7 • Published 2 years ago

plasma-fhir-backend-utils v0.0.7

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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);
    });

Development

Build

  • yarn build
    • or tsc if that doesn't work

Unit Tests

  • yarn test

Publish/Deploy

  • yarn build
  • yarn test
    • Windows: npx mocha -r ts-node/register tests/**/*.spec.ts
  • Login as plasmafhir
  • Increment version
  • npm publish