Giter Site home page Giter Site logo

fhir-react's Introduction

CircleCI Storybook

fhir-react

A React component library for displaying FHIR data.

Installation

npm install --save fhir-react

Usage

This package has two exports: a FhirResource React component and fhirVersions object.

import { FhirResource, fhirVersions } from 'fhir-react';

Render the component providing the FHIR data as a JavaScript object:

const MyComponent = () => {
  const fhirResource = JSON.parse(fhirResourceAsJsonString);
  return (
    <FhirResource
      fhirResource={fhirResource}
      fhirVersion={fhirVersions.R4}
      withCarinBBProfile
    />
  );
};

FhirResource component props

Prop Type Default Description
fhirResource* Object - The FHIR resource to be rendered
fhirVersion* fhirVersions.DSTU2, fhirVersions.STU3, fhirVersions.R4 - FHIR resource version
withCarinBBProfile Boolean false Use Carin BB profile extension on top of the HL7 default FHIR specification https://build.fhir.org/ig/HL7/carin-bb/index.html
withDaVinciPDex Boolean false Use DaVinci Payer Data Exchange (PDex) profile extension on top of the HL7 default FHIR specification https://hl7.org/fhir/us/davinci-drug-formulary/index.html
thorough Boolean false If this is set to true, or if it is absent, all array items and supported attributes will be displayed. Otherwise if this is false then only the first or otherwise important items will be displayed

* required props

Available fhirVersions

Available resources

Resource DSTU2 STU3 R4 Carin BB Profile DaVinci PDex
AdverseEvent N/A
AllergyIntolerance
AdverseEvent N/A
AllergyIntolerance
Appointment
Bundle
CarePlan
CareTeam N/A
Claim
ClaimResponse
Condition
Coverage
Device
DiagnosticReport
DocumentReference
Encounter
ExplanationOfBenefit
Goal
Immunization
List
Location
Medication
MedicationAdministration
MedicationDispense
MedicationKnowledge N/A N/A
MedicationRequest N/A
MedicationStatement
Observation
Organization
Patient
Practitioner
PractitionerRole N/A
Procedure
Questionnaire
QuestionnaireResponse
ReferralRequest N/A
ResearchStudy N/A

Styles

Optional CSS styles are provided with this library. They are split into two files:

  • style.css with basic styling of the components
  • bootstrap-reboot.min.css further enhancing those styles

To use provided styles include them in the React component:

import 'fhir-react/build/style.css';
import 'fhir-react/build/bootstrap-reboot.min.css';

The working demo example with styles included can be viewed here.

Storybook

Run storybook local server with:

npm run storybook

Now you can check how a component graphically presents information based on raw data at http://localhost:63653 .

There's also an online version available at http://storybook-fhir-react-lib.s3-website-us-east-1.amazonaws.com .

Development

  1. run npm link in this folder to create the npm package locally
  2. in the folder where you are using the package (some other project) run npm link fhir-react
  3. in that other project import this package as you would normally with import FhirReact from 'fhir-react'
  4. Finally, in this fhir-react folder run the watch command via npm start and start developing.

Test

npm run test

Lint

npm run lint
npm run stylelint

Build

npm run build

Publish to NPM Registry

npm publish

Storybook for the changes

When creating a new PR, changes will be available in the storybook at:
http://storybook-fhir-react-lib.s3-website-us-east-1.amazonaws.com/dev/{branch-name}/

fhir-react's People

Contributors

alseeley1uphealth avatar ctomasz avatar ishan1uphealth avatar konradnojman avatar liam1uphealth avatar ricky1uphealth avatar tp1uphealth avatar vikas1uphealth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.