1.0.0 • Published 1 year ago

@antsa/react v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 year ago

Antsa React Component Library

The Antsa React Component Library provides many helpful components to quickly build your healthcare web app.

The Antsa SDK can be used with any compliant FHIR server. However, some advanced features are only available when paired with a Antsa server.

Check out a live demo: https://storybook.antsa.com/

Key Features

  • SmartText - Detect clinical concepts, tag with SNOMED and ICD codes
  • Chat - FHIR-based chat with real time push events
  • Data Table - For a FHIR search, show the results as a live table
  • SSE for server side push
  • Evaluation of FhirPath
  • No external dependencies

Installation

Add as a dependency:

npm install @antsa/react

Note the following peer dependencies:

Basic Usage

import { AntsaClient } from '@antsa/core';
import { AntsaProvider } from '@antsa/react';

const antsa = new AntsaClient();

export function App() {
  return (
    <AntsaProvider antsa={antsa}>
      <MyPage1 />
      <MyPage2 />
      <Etc />
    </AntsaProvider>
  );
}

For more details on how to setup AntsaClient, refer to the docs for antsa.

Sign In

export function SignInPage() {
  const auth = useAntsaContext();
  return (
    <Document>
      {auth.user ? (
        <div>
          <pre>User: {JSON.stringify(auth.user)}</pre>
          <Button onClick={() => auth.antsa.signOut().then(() => alert('Signed out!'))}>Sign out</Button>
        </div>
      ) : (
        <SignInForm onSuccess={() => alert('Signed in!')} />
      )}
    </Document>
  );
}

Chat

export function ChatPage() {
  return (
    <Document>
      <ChatControl criteria="Communication?encounter=123" {...args} />
    </Document>
  );
}

About Antsa

Antsa is a healthcare platform that helps you quickly develop high-quality compliant applications. Antsa includes a FHIR server, React component library, and developer app.

License

Apache 2.0. Copyright © Antsa 2023