npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zus-health/ctw-component-library

v4.0.2

Published

A component library supporting care team workflows.

Downloads

7,835

Readme

A component library supporting care team workflows.

Library maintained by Zus Health.

Install & Setup

npm i @zus-health/ctw-component-library

Include CSS Stylesheet.

Include the CSS file:

import ctwStyles from "@zus-health/ctw-component-library/dist/style.css";

Setup CTWProvider

The CTWProvider component provides authentication details needed for other components to make API requests to Zus.

  1. Add <CTWProvider> wrapper at a high level within your application.
  2. Pass in the desired environment, either env="sandbox" or env="production".
  3. Setup authTokenURL to point to an endpoint that will return {access_token: TOKEN}. This is how we provide seamless logins for your users to access Zus APIs.
  4. Optioally pass in a theme to overwrite styles across all of the components.
  5. Optioally pass in a locals to overwrite different words in our glossary or different copy throughout the components.
  6. Optioally pass in a enableTelemetry to enable telemetry, see details below.

Example:

import { CTWProvider } from "@zus-health/ctw-component-library";

function App() {
  return (
    <CTWProvider env="sandbox" authToken={AUTH_TOKEN}>
      <Routes>
        <Route path="/" element={<Layout />}>
          <Route index element={<Home />} />
        </Route>
      </Routes>
    </CTWProvider>
  );
}

Setup PatientProvider

The PatientProvider component provides patient details needed by other components to fetch patient specific records from Zus.

  1. Add <PatientProvider> wrapper at a high level within your patient portal (or wherever you have selected down to a single patient).
  2. Pass in identifier information for this patient via patientID and systemURL.
  3. <PatientProvider> also has an onPatientSave prop which can be used to override the behavior when saving patient information. onPatientSave should be an async function.

An example onPatientSave function could be as follows:

const onPatientSave = async (data: PatientFormData) => {
/*
  type PatientFormData = {
    lastName: string;
    firstName: string;
    gender: fhir4.Patient["gender"];
    dateOfBirth: Date;
    email: string;
    phone: string;
    address: string;
    city: string;
    state: string;
    zipCode: string;
};
*/

// Do whatever you want with data (eg, send to server)

  return response
}

Example:

import { PatientProvider, Conditions } from "@zus-health/ctw-component-library";

function PatientPortal({ patientID }: PatientPortalProps) {
  return (
    <PatientProvider patientID={patientID} systemURL="https://www.example.com">
      // Any nested components can now use any patient specific components.
      <Conditions />
    </PatientProvider>
  );
}

Telemetry

Telemetry is sent to DataDog from CTW components. This telemetry tracks usage so that Zus can continually improve the ctw-component-library and fix issues that might otherwise go unnoticed.

Opting out of telemetry

Zus has a BAA with DataDog and we understand that your applications need to meet HIPAA regulations the same as ours. We take this into account when choosing which telemetry data can be tracked, but we also respect the choice to not opt-in to telemetry collection. We encourage you to reach out to the team to discuss which telemetry we collect. However, if choose not to opt-in, there is no action required on your part, as long as the property enableTelemetry is not passed to the CTWProvider component used in your React app, no telemetry will be logged.

// Telemetry off:
<CTWProvider>{/** Application **/}</CTWProvider>

// Telemetry on:
<CTWProvider enableTelemetry>{/** Application **/}</CTWProvider>

Contributing

Changesets

In order to run changeset in the project run npx changeset and follow the prompts. More information on adding a changeset can be found in changeset docs.

Pushing a PR with a changeset will trigger a github action which will create a PR that if merged will automatically:

  • Upgrade our package.json accordingly
  • Delete changesets that are no longer needed
  • Update our changelog
  • Publish our npm package