PHPackages                             libre-ehr/fhir - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. libre-ehr/fhir

ActiveLibrary[API Development](/categories/api)

libre-ehr/fhir
==============

:package\_description

1216[14 issues](https://github.com/LibreEHR/fhir/issues)[4 PRs](https://github.com/LibreEHR/fhir/pulls)PHP

Since Sep 6Pushed 9y ago5 watchersCompare

[ Source](https://github.com/LibreEHR/fhir)[ Packagist](https://packagist.org/packages/libre-ehr/fhir)[ RSS](/packages/libre-ehr-fhir/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

fhir
====

[](#fhir)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b4733e253e5b6c9191a3e361981a0c1f81d79b2f55361b19b58c60098886798d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4c696272654548522f666869722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/LibreEHR/fhir)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/cb5f6e12f447f95780198038311110d145785b2bcd8ed9abea1c772521857513/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4c696272654548522f666869722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/LibreEHR/fhir)[![Coverage Status](https://camo.githubusercontent.com/e8f6263c347690afefe9bf2eb317fae3a2dd8fb456314eb63678214424d31271/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f4c696272654548522f666869722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/LibreEHR/fhir/code-structure)[![Quality Score](https://camo.githubusercontent.com/3595e35f1258d7f779134c6baf5028fcfaf7b207e1872be4b5079db25968a05e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4c696272654548522f666869722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/LibreEHR/fhir)[![Total Downloads](https://camo.githubusercontent.com/bb41076d4d3d668c9a3f1b37980cb43ce6f41ffa835d02fb29d42f3f8c9e8d3a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4c696272654548522f666869722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/LibreEHR/fhir)

This is a Laravel package for talking to a LibreEHR database via FHIR API

Installation
------------

[](#installation)

Via Composer

Get composer

getcomposer.com

Create a Laravel 5.3 project

```
$ composer create-project --prefer-dist laravel/laravel=5.3.* libre-ehr-laravel-5-3
```

Require the fhir package which includes LibreEHR/core for as an interface to the LibreEHR database, for now it is in development and should be grabbed by developers via github.

Add the following to the root libre-ehr-laravel/composer.json after the "type"

```
...

"repositories": [
      {
        "type": "vcs",
        "url": "https://github.com/LibreEHR/fhir.git"
      },
      {
        "type": "vcs",
        "url": "https://github.com/LibreEHR/core.git"
      }
    ],

...
```

Then add the following to the "require" section of the libre-ehr-laravel/composer.json file which will specify the requirement of the development version of libre-ehr/fhir.

```
...

"libre-ehr/fhir": "dev-master"

...
```

Then add the following to the bottom of the libre-ehr-laravel/composer.json file, which will allow you to pull the development version.

```
    ...,
    "minimum-stability": "dev",
    "prefer-stable": true
...
```

Then from the root of libre-ehr-laravel, run the following to pull in the LibreEHR packages

```
$ composer update
```

Install Stripe for payment

```
composer require stripe/stripe-php

```

Install the Passport Auth package.

```
$ composer require laravel/passport
```

Place your database credentials in the file libre-ehr-laravel/config/database.php in the mysql section

Create a new section for 'auth' and make auth the default in config/database.php like this:

```
...

    'default' => 'auth',

...

    'auth' => [
        'driver' => 'mysql',
        'host' => '127.0.0.1',
        'port' => '3336',
        'database' => 'libreehr_api',
        'username' => 'libreehr_api',
        'password' => 'libreehr_api',
        'charset' => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix' => '',
        'strict' => false,
    ],

...
```

Point a vhost to libre-ehr-laravel/public.

Make sure to enable mod\_rewrite on Apache.

Usage
-----

[](#usage)

To integrate with Laravel, there is a service provider you can make use of to automatically prepare the bindings and such.

Add the following to the end of the "providers" array in libre-ehr-laravel/config/app.php

```
// config/app.php

'providers' => [
    '...',
    LibreEHR\FHIR\Utilities\Providers\FHIRServiceProvider::class,
    LibreEHR\FHIR\Utilities\Providers\CustomPassportServiceProvider::class,
];
```

run 'php artisan migrate' to install the users table and oauth tables

run 'php artisan passport:install' to generate auth keys keys

run "php artisan passport:client --password" to create a new client if needed (a password grant client is automatically created from passport:install command)

Change driver in guards =&gt; api section of auth.php to 'passport'

```
'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'passport',
            'provider' => 'users',
        ],
    ],

```

change user model in providers =&gt; users in auth.php to our custom user model, default user model missing hasPITokens

```
'model' => LibreEHR\FHIR\Http\Controllers\Auth\AuthModel\User::class,

```

You will then be able to browse to the FHIR endpoint like so:

```
http://[my vhost]/fhir/Patients

```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Ken Chapple](https://github.com/kchapple)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba6dbdcaff93ae6fff1129df42b245297dbfe3ed5d5115dd1dbe25c0458eb162?d=identicon)[kchapple](/maintainers/kchapple)

---

Top Contributors

[![kchapple](https://avatars.githubusercontent.com/u/271809?v=4)](https://github.com/kchapple "kchapple (141 commits)")[![Leo24](https://avatars.githubusercontent.com/u/5683856?v=4)](https://github.com/Leo24 "Leo24 (59 commits)")

### Embed Badge

![Health badge](/badges/libre-ehr-fhir/health.svg)

```
[![Health](https://phpackages.com/badges/libre-ehr-fhir/health.svg)](https://phpackages.com/packages/libre-ehr-fhir)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
