GithubHelp home page GithubHelp logo

sbsrnt / fhirformjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dermatologist/fhirformjs

0.0 0.0 0.0 793 KB

NPM module to convert FHIR Questionnaire JSON to JSON Schema for form rendering.

Home Page: https://canehealth.com

License: MIT License

TypeScript 100.00%

fhirformjs's Introduction

fhirformjs

npm version npm Build Project dependencies overview(Beta) Known Vulnerabilities Documentation

About

Creating, maintaining and using forms for health data capture is vital, and FHIRForm is a framework for that. FHIRFormJS is one of its components (an npm module) that helps create input forms corresponding to a FHIR questionnaire. FHIRFormJS does not render forms but converts FHIR questionnaire into a schema and lets other libraries (such as react-jsonschema-form ) do the heavy lifting. An output mapper that maps the output from a react-jsonschema-form to a QuestionnaireResponse is also available. Checkout this example React app to see how it is used. This is a modern alternative to LHC-Forms

FHIRFormJS is WIP (not production ready). Pull requests are welcome (See CONTRIBUTING.md) and add issues and feature requests by clicking on the 'issues' tab. ☝️

Installation

npm i --save fhirformjs

Usage example (In a React component)

  • FHIRFormJS is framework independent and can be used with other frameworks such as Vue / Angular.
  • Testq1 is a FHIR Questionnaire object
import { FhirJsonForm, FhirJsonResp } from 'fhirformjs'
import Form from "@rjsf/core"
  const resp = FhirJsonForm(Testq1)
  let formData = {}
  let respData = {}
  function handleSubmit(data){
    respData = FhirJsonResp(resp.model, data, resp.schema)
    console.log(JSON.stringify(respData))
  }
  return (
    <div className="App">
      <header className="App-header">
        <Form schema={resp.schema}
        uiSchema={resp.uiSchema}
        formData={formData}
        onSubmit={e => handleSubmit(e.formData)}
        />
      </header>
    </div>
  );

Update

since v0.8.0: Backend API

import { FhirBackend } from 'fhirformjs'
const backend = new FhirBackend('http://hapi.fhir.org/baseR4');
console.log(backend.getTableOfContents())
console.log(backend.getQuestionnaire('2050148'))

Give us a star ⭐️

If you find this project useful, give us a star. It helps others discover the project.

Author

Contributor(s)

fhirformjs's People

Contributors

dependabot[bot] avatar dermatologist avatar mfferreira 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.