Nerve

Getting started with Nerve

Learn how to integrate Nerve API into your healthcare application

Introduction

Nerve is a unified API for healthtech developers to easily integrate with provider's EHR systems, and build using sandbox data. We support major platforms like Epic, Cerner, and AthenaHealth and many more!

Nerve is built on top of the FHIR data model, and offers developers consistent abstractions for reading and writing data to EHR systems.

Quick Setup for Sandbox

Install SDK

npm install @nerve-js/client @nerve-js/next

Create Provider Wrapper

Create a new file app/providers.tsx:

'use client';
 
import { NerveProvider } from '@nerve-js/next';
import type React from 'react';
 
export default function Providers({ children }: { children: React.ReactNode }) {
  return (
    <NerveProvider
      redirectUrl="http://localhost:3000/callback/"
      signInUrl="http://localhost:3000/signin/"
      afterRedirectUrl="http://localhost:3000/"
    >
      {children}
    </NerveProvider>
  );
}

Then wrap your app with the provider in app/layout.tsx:

import Providers from './providers';
 
export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html>
      <body>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}

Basic Usage

import { useNerveClient } from '@nerve-js/next';
 
// Get the client instance
const client = useNerveClient();
 
// Set provider to sandbox before making any requests
await client.setProvider('sandbox');
 
// Now you can make requests
const patients = await client.patient.search({
  given: 'John',
  family: 'Doe',
  birthdate: '',
});
 
const data = await client.carePlan.search({
  patient: patients[0].id || '',
});

That's it! You can now use useNerveClient() in any client component to start querying healthcare data from our sandbox. The client provides type-safe access to all FHIR resources and operations.

See framework integrations for more specific instructions on how to include the Auth component for actual integrations.

On this page