Giter VIP home page Giter VIP logo

fhir-ui's Introduction

npm package npm peer dependency version npm peer dependency version npm peer dependency version npm peer dependency version npm peer dependency version npm peer dependency version npm peer dependency version npm peer dependency version npm peer dependency version

fhir-ui React components are used in conjunction with the Material UI component library to display HL7 FHIR Resources using Google's Material Design specification.

Prerequisites

Installation

fhir-ui is available as an npm package.

npm install --save fhir-ui

or

yarn add fhir-ui

Theming

fhir-ui components require a theme to be provided. The quickest way to get up and running is by using the Material-UI ThemeProvider to inject the theme into your application context. Following that, you can to use any of the components as demonstrated in the documentation. Here is a quick example to get you started:

import React from 'react'
import ReactDOM from 'react-dom'
import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles'
import { MuiPickersUtilsProvider } from '@material-ui/pickers'
import lightBlue from '@material-ui/core/colors/lightBlue'

import { PatientCard } from 'fhir-ui'

// Create a theme instance.
const theme = createMuiTheme({
  palette: {
    primary: {
      light: lightBlue[300],
      main: lightBlue[500],
      dark: lightBlue[900],
      contrastText: '#FFF',
    },
    secondary: {
      light: lightBlue[300],
      main: lightBlue[500],
      dark: lightBlue[900],
      contrastText: '#FFF',
    },
    background: {
      default: '#f9f9f9',
    },
  },
})

const App = () => (
  <ThemeProvider theme={theme}>
    <MuiPickersUtilsProvider utils={MomentUtils}>
      <PatientCard patient={patient} />
    </MuiPickersUtilsProvider>
  </ThemeProvider>
)

ReactDOM.render(<App />, document.getElementById('app'))

Patient Table Example

import React from 'react'
import { PatientTable } from 'fhir-ui'

const MyFhirComponent = () => (
  <div>
    <PatientTable
      patients={patientList}
      onRowClick={patientId => console.log('Selected Patient ID: ', patientId)}
    />
    <hr />
    <PatientDetail
      patient={patient}
      patientId={patient.id}
      onDelete={patientId => console.log('Removed Patient ID: ', patientId)}
    />
  </div>
)

export default MyFhirComponent

Please refer to each component's CodeSandbox.io example for an example on how to use them.

CodeSandbox.io Examples

License

This project is licensed under the terms of the MIT license

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.