Skip to main content

The GNU Health FHIR Server

Project description


The GNU Health Fast Healthcare Interoperability Resources (FHIR) server allows to query different resources from a running GNU Health HMIS node, returning HL7 FHIR messages.


In March 2014 I started the initial alpha FHIR project for Python with the idea to be used in GNUHealth HMIS (server and client) and other EMRs. (

Soon after, our colleague Dr. Chris Zimmerman joined the project and did an phenomenal job continuing and leading for years the development of HL7 FHIR server for GNUHealth.

For several years, the FHIR development was part of the GNU Health HMIS “backend”. Although at the beginning was convenient, we felt that the GNU Health FHIR component deserved its own reporitory. In 2020, we created the health-fhir-server mercurial repository in GNU Savannah. This allows to have a team dedicated to the FHIR resources.

In 2020, we created the GNU Health FHIR server package at Pypi (

The GNU Health FHIR server is work in progress. We are happy to work with the HL7 FHIR community, adding new resources and functionality.

The development, as other GNU Health components, is at GNU Savannah.


The GNU Health FHIR server is pip installable

The server requires Flask and a few of its addons. And, of course, a working GNU Health HMIS instance.

$ pip3 install –upgrade –user gnuhealth-fhir-server


The server ships with a simple production config file (server/ However, it needs to be edited.:

TRYTON_DATABASE = ''    # GNU Health database
SERVER_NAME = ''        # Domain name of the server (e.g.,
SECRET_KEY = ''         # Set this value to a long and random string


Use TLS. Sensitive medical information must be protected and confidential.

By default, all FHIR endpoints except the Conformance statement require user authentication. The user authentication and access follows Tryton’s model, respecting model and field access rights.

The same credentials used to sign into GNU Health are used to access the FHIR REST server.

Running the server

For development, you can just run:

python ./

For production environments, you should run it from a WSGI container, such as gunicorn, uWSGI or Tornado.

  • uwsgi server_uwsgi.ini

You can change the port (default 8020) and sockets in the server_uwsgi.ini

Current resources / endpoints

Currently the following resources are implemented (read-only):

The FHIR standard defines a REST API, a set of interactions with each resource. Each resource handles different types of information. Currently, the GNU Health FHIR server supports 12 resources:

  • Conformance: Describes the server’s FHIR capabilities.

  • Patient: Patient information, like email, address, SSN, etc.

  • DiagnosticReport: Completed lab tests, but not the data

  • Observation: Lab data, like Uric Acid values

  • Practitioner: Health professionals and their information

  • Procedure: Surgeries/operations

  • Condition: Diseases/diagnoses

  • FamilyHistory: Family histories of patients

  • Medication: Medications (not prescriptions!)

  • MedicationStatement: Medications taken by a patient

  • Immunization: Immunizations

  • Organization: Institutions, departments, companies, etc.

Each resource has its own endpoint. For example, the Patient endpoint is found at /Patient, the DiagnosticReport endpoint at /DiagnosticReport, and so on. The only exception to this naming schema is the Conformance endpoint which is found at / and /metadata.

Querying the GNU Health FHIR Server

If we enter the resource name as the endpoint, GNU Health will bring back all the results.

For instance:

Will retrieve the patients in the current database.

To search a resource, simply add arguments to the endpoint to refine the search. For example, /Patient?name=ana will return all the patients with Ana in their name

The log file will be stored at the user’s home directory, with the name “fhir_server.log”. You can also add the corresponging log when running the server behind uwsgi.


The GNU Health HMIS FHIR server is built on Flask technology ( .

More information about Flask and its addons used in GNU Health FHIR server:


The development of GNU Health is on GNU Savannah, using the Mercurial repository.

Tasks, bugs and mailing lists will be on , for development.

General discussion is done at mailing list.



The GNU Health FHIR server documentation will be at the corresponding chapter in the GNU Health Wikibook

Support GNU Health

GNU Health is a project of GNU Solidario. GNU Solidario is an Non-profit Non-goverment-Organization (NGO) that works globally, focused on Social Medicine.

Health and education are the basis for the development and dignity of societies.

You can also donate to our project via :

In addition, you can show your long time commitment to GNU Health by becoming a member of GNU Solidario, so together we can further deliver Freedom and Equity in Healthcare around the World.

GNU Solidario hosts IWEEE and GnuHealthCon:

The International Workshop on e-Health in Emerging Economies- a good way to support GNU Solidario and to get the latest on e-Health is to assist to the conferences.

Need help to implement GNU Health ?

We are committed to do our best in helping out projects that can improve the health of your country or region. We want the project to be a success, and since our resources are limited, we need to work together to make a great and sustainable project.

In order to be elegible, we need the following information from you, your NGO or government:

  • An introduction of the current needs

  • The project will only use Libre software technology

  • There will be a local designated person that will be in charge of the project and the know-how transfer to the rest of the community.This person must be committed to be from the beginning of the project until two years after its completion.

  • There must be a commitment of knowledge transfer to the rest of the team.

We will do our best to help you out with the implementation and training for the local team, to build local capacity and make your project sustainable.

Please contect us and we’ll back to you as soon as possible:

Thank you !
Dr. Luis Falcón, MD, MSc
Author and project leader


Twitter: @gnuhealth


GNU Health, the Libre Digital Health ecosystem, is licensed under GPL v3+:

Copyright (C) 2008-2023 Luis Falcon <>
Copyright (C) 2011-2023 GNU Solidario <>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <>.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gnuhealth-fhir-server-0.9b7.tar.gz (284.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page