Skip to content

A simple fhir form with a local fhir server

License

Notifications You must be signed in to change notification settings

grongierisc/fhir-form

 
 

Repository files navigation

1. App for FHIR forms using a local fhir server

This is an app mainly based on this repo that can be used to display
FHIR
SDC
Questionnaire
and collect data as FHIR QuestionnaireResponse resources.
By building it using docker-compose up -d you will have access to a local FHIR server that can then be used to test the app.

2. Requirements

The app relies on the LHC-Forms rendering widget for displaying forms. It has partial support for FHIR Questionnaires (versions STU3 and R4) and the Structured Data Capture Implementation Guide.
This widget will be installed with the dependencies.

For some sample forms to try, this repository comes with some forms under e2e-test/data/R4 that are automatically loaded into the local FHIR server at build.

2.1. Add Node.js and npm to your path

The file bashrc.lforms-fhir-app specifies the version of Node.js we are using for development. Download that version of Node.js, and add its bin directory to your path.

You can do on mac os :

brew update
brew install nvm
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
nvm install 14
nvm use 14

To install and use node version 14.

2.2. Install Dependencies

By running this command you will be able to install everything needed for the app to work.

npm ci

3. Local FHIR server

If you don't have a FHIR server to try this app out, you can start and use a local FHIR server powered by InterSystems technologies by doing inside the fhir-form folder :

docker-compose up -d

After some wait, your local FHIR server is up and you can access it by using http://localhost:32783/fhir/r4
Note that this link is already registered in the app.

4. Using the app

To use the app you have to build it then start it.
You can now access any FHIR server of your choice using the menu of the app but if you want you can use this local FHIR server

4.1. Build the application

npm run build

This will create files for production in a "dist" directory, but will also copy some needed files into place from node_modules.

4.2. Run the Application

npm run start

will start an http server running at port 8000.

Now browse to the app at localhost:8000/lforms-fhir-app/.

Here you can choose a server to connect to.
If you want to use the local FHIR server, start the local FHIR server then, on the app select the first choice http://localhost:32783/fhir/r4

5. FHIR form / questionnaire

5.1. Creating your own FHIR form

By using this online tool you can easily build your own form from scratch or using an already existing one.
We advise you to import one of the existing one in the e2e-tests/data/R4 folder and start from here to understand how the tool works.

5.2. Importing your FHIR form

Using the app, you can easily import your local forms and use them right away using the upload button.


If you are using the formbuilder tool, you can, if you have a FHIR server supporting the Content-Type 'application/json', export the form you are creating directly to the fhir server using the export button.

If your server doesn't support the Content-Type 'application/json' but only the Content-Type 'application/json+fhir' for example, as our local FHIR server you must export the form to a file, then on the app, upload the file to the server as the app communicate in Content-Type 'application/json+fhir'.

About

A simple fhir form with a local fhir server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • JavaScript 82.3%
  • HTML 11.6%
  • CSS 5.6%
  • Other 0.5%