PHPackages                             omakei/laravel-nhif - 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. omakei/laravel-nhif

ActiveLibrary[API Development](/categories/api)

omakei/laravel-nhif
===================

A Laravel package to integrate NHIF Tanzania with hospital management systems.

2.0.0(3y ago)10134[2 PRs](https://github.com/omakei/laravel-nhif/pulls)MITPHPPHP ^8.1

Since Jul 27Pushed 3y ago3 watchersCompare

[ Source](https://github.com/omakei/laravel-nhif)[ Packagist](https://packagist.org/packages/omakei/laravel-nhif)[ Docs](https://github.com/omakei/laravel-nhif)[ RSS](/packages/omakei-laravel-nhif/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (6)Used By (0)

 [![NextSMS Logo](/art/nhif-logo.png "NHIF Logo")](/art/nhif-logo.png)

Laravel NHIF
============

[](#laravel-nhif)

A Laravel package to integrate NHIF Tanzania with hospital management systems.

[![Latest Version on Packagist](https://camo.githubusercontent.com/52cfa0952b00f2c202f3f603ca8b5f308122493dd175f5cc1b6b11c1e42dd48c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6d616b65692f6c61726176656c2d6e6869662e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/omakei/laravel-nhif)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f3bb90bb933af7ac9d68a0eec959adfde372d0464990826464dd19b0b0f4e190/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6f6d616b65692f6c61726176656c2d6e6869662f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/omakei/laravel-nhif/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/16cc1bfc0c0c3a4c476de7c758ef158aba870adcd76681ec274425f5fd7a9411/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6f6d616b65692f6c61726176656c2d6e6869662f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/omakei/laravel-nhif/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/9dee50a0592e9206506a143eb0f4311078194ae4d9b78bd1e78f85b564f0a468/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6d616b65692f6c61726176656c2d6e6869662e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/omakei/laravel-nhif)

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

[](#installation)

You can install the package via composer:

```
composer require omakei/laravel-nhif
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-nhif-config"
```

The following keys must be available in your `.env` file:

```
NHIF_USERNAME=
NHIF_PASSWORD=
```

This is the contents of the published config file:

```
return [

    'credentials' => [
        'username' => env('NHIF_USERNAME', ''),
        'password' => env('NHIF_PASSWORD', ''),
    ],
    'mode' => 'test', //it maybe test or production
    'url' => [
        'test' => 'http://196.13.105.15/nhifservice/breeze/',
        'production' => 'https://verification.nhif.or.tz/nhifservice/breeze/',
        'token' => 'https://verification.nhif.or.tz/nhifservice/Token/',
        'tariffs' => 'https://verification.nhif.or.tz/claimsserver/api/v1/Packages/',
        'claim' => 'https://verification.nhif.or.tz/claimsserver/api/v1/claims/SubmitFolios',
        'claim_submitted' => 'https://verification.nhif.or.tz/claimsServer/api/v1/claims/getSubmittedClaims',
        'referral' => 'https://verification.nhif.or.tz/nhifservice/breeze/verification/AddReferral',
        'pre_approved' => 'https://verification.nhif.or.tz/nhifservice/breeze/verification/GetReferenceNoStatus',
    ],
];
```

Usage
-----

[](#usage)

### verify member to NHIF

[](#verify-member-to-nhif)

```
$response = LaravelNHIF::verifyMember(card_number:'12344554', visit_type_id:1, referral_number:'', remarks:'verification');
// response payload structure
{
    "CardNo": "01-nhif241",
    "CardStatus": "Active",
    "FirstName": "Amour",
    "MiddleName": "R",
    "LastName": "Hamad",
    "FullName": "Amour R Hamad",
    "Gender": "Male",
    "DateOfBirth": "1974- 03 - 18",
    "ExpiryDate": "",
    "AuthorizationStatus": "ACCEPTED",
    "AuthorizationNo": "720002",
    "EmployerNo": "7000885",
    "SchemeID": " 1001 ",
    "ProductCode": "NH001",
    "Remarks": "Verified OK"
}
```

### get card details

[](#get-card-details)

```
$response = LaravelNHIF::getCardDetails(card_number:'12344554');
// response payload structure
{
    "CardNo": "01-nhif241",
    "CardStatus": "Active",
    "FirstName": "Amour",
    "MiddleName": "R",
    "LastName": "Hamad",
    "FullName": "Amour R Hamad",
    "Gender": "Male",
    "DateOfBirth": "1974- 03 - 18",
    "ExpiryDate": "",
    "AuthorizationStatus": "ACCEPTED",
    "AuthorizationNo": "720002",
    "EmployerNo": "7000885",
    "SchemeID": " 1001 ",
    "ProductCode": "NH001",
    "Remarks": "Verified OK"
}
```

### download tariffs without excluded services

[](#download-tariffs-without-excluded-services)

```
$response = LaravelNHIF::downloadTariffsWithoutExcludedService(facility_code:'12344554');
// response payload structure
{
    "FacilityCode": " 01099 ",
    "PricePackage": [
        {
            "ItemCode": "10001",
            "ItemName": "General Practitioner Consultation",
            "PackageID": 102,
            "SchemeID": 1001,
            "UnitPrice": 10000.0,
            "IsRestricted": false
        },
        {
            "ItemCode": "10001",
            "ItemName": "General Practitioner Consultation",
            " PackageID": 201,
            "SchemeID": 1002,
            "UnitPrice": 25000.0,
            "IsRestricted": false
        }
    ],
    "ExcludedServices": [
        {
            "ItemCode": "10001",
            "SchemeID": 1001,
            "ExcludedForProducts": "NH003,NH004"
        },
        {
            "ItemCode": "10002",
            "SchemeID": 1003,
            "ExcludedForProducts": "NH001,NH002"
        }
    ]
}
```

### download tariffs with excluded services

[](#download-tariffs-with-excluded-services)

```
$response = LaravelNHIF::downloadTariffsWithExcludedService(facility_code:'12344554');
// response payload structure

{
    [
        {
            "ItemCode": "10001",
            "ItemName": "General Practitioner Consultation",
            "PackageID": 102,
            "UnitPrice": 10000.0,
            "IsRestricted": false
        },
        {
            "ItemCode": "10001",
            "ItemName": "General Practitioner Consultation",
            "PackageID": 201,
            "UnitPrice": 25000.0,
            "IsRestricted": false
        }
    ]
}
```

### submit claim to NHIF

[](#submit-claim-to-nhif)

```
$data = {
    "entities": [
        {
            "FolioID": "817d6e75-3bef-4d25-a2e1-a3bc009530ab",
            "ClaimYear": 2016,
            "ClaimMonth": 7,
            "FolioNo": 1,
            "SerialNo": "SN00 099",
            "CardNo": "308900035308",
            "FirstName": "Flora",
            "LastName": "Mataba",
            "Gender": "Female",
            "DateOfBirth": "1974- 01 -23T16:56:20.287",
            "Age": 30.0,
            "TelephoneNo": "0686155255",
            "PatientFileNo": null,
            "PatientFile": "GQ8XQAYFAiEMfN0qD0COTgMX......",
            "AuthorizationNo": null,
            "AttendanceDate": "2014- 09 -01T00:00:00",
            "PatientTypeCode": "OUT",
            "DateAdmitted": null,
            "DateDischarged": null,
            "PractitionerNo": "12345",
            "CreatedBy": "Administrator",
            "DateCreated": "2015- 01 -23T16:56:20.223",
            "LastModifiedBy": "Administrator",
            "LastModified": "2015-01 - 2 6T12:31:25.097",
            "FolioDiseases": [
                {
                    "FolioDiseaseID": "e9429e1c-f892-40ae-8c0a-a3bc0095681f",
                    "DiseaseCode": "084",
                    "FolioID": "817d6e75-3bef-4d25-a2e1-a3bc009530ab",
                    "Remarks": null,
                    "CreatedBy": "Administrator",
                    "DateCreated": "2015 - 01 -23T16:56:20.287",
                    "LastModifiedBy": "Administrator",
                    "LastModified": "2015-01 - 23T16:56:20.287"
                }
            ],
            "FolioItems": [
                {
                    "FolioItemID": "e0d30408- 1863 - 4eb4-8cce-a3bc00957501",
                    "FolioID": "817d6e75-3bef-4d25-a2e1-a3bc009530ab",
                    "ItemCode": "11",
                    "OtherDetails": null,
                    "ItemQuantity": 1,
                    "UnitPrice": 2000.0,
                    "AmountClaimed": 2000.0,
                    "ApprovalRefNo": "NHIF/REF/201000024",
                    "CreatedBy": "Administrator",
                    "DateCreated": "2015- 01 -23T16:56:20.35",
                    "LastModifiedBy": "Administrator",
                    "LastModified": "2015-01 - 23T16:56:20.35"
                },
                {
                    "FolioItemID": "84ae41a0-514c-489d-8e6f-a3bc00958289",
                    "FolioID": "817d6e75-3bef-4d25-a2e1-a3bc009530ab",
                    "ItemCode": "11533",
                    "OtherDetails": null,
                    "ItemQuantity": 1,
                    "UnitPrice": 1950.0,
                    "AmountClaimed": 1950.0,
                    "ApprovalRefNo": "null",
                    "CreatedBy": "Administrator",
                    "DateCreated": "2015- 01 -23T16:56:20.37",
                    "LastModifiedBy": "Administrator",
                    "LastModified": "2015-01 - 23T16:56:20.37"
                },
                {
                    "FolioItemID": "3c5b814c-7fbf-454b-9c9e-a3bc00985ba5",
                    "FolioID": "817d6e75-3bef-4d25-a2e1-a3bc009530ab",
                    "ItemCode": "11004",
                    "OtherDetails": null,
                    "ItemQuantity": 3,
                    "UnitPrice": 100.0,
                    "AmountClaimed": 300.0,
                    "ApprovalRefNo": "null",
                    "CreatedBy": "Administrator",
                    "DateCreated": "2015- 01 -23T16:56:20.39",
                    "LastModifiedBy": "Administrator",
                    "LastModified": "2015-01 - 23T16:56:20.39"
                },
                {
                    "FolioItemID": "338ce17c- 1655 - 417f-80e3-a3ca01019326",
                    "FolioID": "817d6e75-3bef-4d25-a2e1-a3bc009530ab",
                    "ItemCode": "5039",
                    "OtherDetails": null,
                    "ItemQuantity": 2,
                    "UnitPrice": 3000.0,
                    "AmountClaimed": 6000.0,
                    "ApprovalRefNo": "null",
                    "CreatedBy": "Administrator",
                    "DateCreated": "2015- 01 -23T16:56:20.41",
                    "LastModifiedBy": "Administrator",
                    "LastModified": "2 015 -01 - 23T16:56:20.41"
                },
                {
                    "FolioItemID": "ae3e912a-137b-48e7- 9853 -a3ca01058118",
                    "FolioID": "817d6e75-3bef-4d25-a2e1-a3bc009530ab",
                    "ItemCode": "7402",
                    "OtherDetails": null,
                    "ItemQuantity": 1,
                    "UnitPrice": 20000.0,
                    "AmountClaimed": 20000.0,
                    "ApprovalRefNo": "null",
                    "CreatedBy": "Administrator",
                    "DateCreated": "2015- 01 -23T16:56:20.47",
                    "LastModifiedBy": "Administrator",
                    "LastModified": "2015-01 - 23T16:56:20.47"
                }
            ]
        },
        {
            "FolioID": "d3d7656b-7c3b- 4392 - b75f-a3ca01048e2b",
            "ClaimYear": 2016,
            "ClaimMonth": 7,
            "FolioNo": 2,
            "SerialNo": "13/109998777",
            "CardNo": "109900035308",
            "FirstName": "Amour",
            "LastName": "Rashid",
            "Gender": "Male",
            "DateOfBirth": "1974- 01 -23T16:56:20.287",
            "Age": 40.0,
            "TelephoneNo": "0686155255",
            "PatientFileNo": null,
            "AuthorizationNo": null,
            "AttendanceDate": "2014- 09 -01T00:00:00",
            "PatientTypeCode": "OUT",
            "DateAdmitted": null,
            "DateDischarged": null,
            "PractitionerNo": null,
            "CreatedBy": "Administrator",
            "DateCreated": "2015- 01 -23T16:56:20.247",
            "LastModifiedBy": "Administrator",
            "LastModified": "2015-01 - 28T13:31:09.297",
            "FolioDiseases": [
                {
                    "FolioDiseaseID": "c4f56a4c- 6217 - 475d-b3de-a3ca0104c9dc",
                    "DiseaseCode": "084",
                    "FolioID": "d3d7656b-7c3b- 4392 - b75f-a3ca01048e2b",
                    "Remarks": null,
                    "CreatedBy": "Administrator",
                    "DateCreated": "2015 - 01 -23T16:56:20.307",
                    "LastModifiedBy": "Administrator",
                    "LastModified": "2015-01 - 23T16:56:20.307"
                }
            ],
            "FolioItems": [
                {
                    "FolioItemID": "248fa65b-dab8-4ca2- 9905 -a3ca0104cfc7",
                    "FolioID": "d3d7656b-7c3b- 4392 - b75f-a3ca01048e2b",
                    "ItemCode": "5036",
                    "OtherDetails": null,
                    "ItemQuantity": 1,
                    "UnitPrice": 3200.0,
                    "AmountClaimed": 3200.0,
                    "ApprovalRefNo": "null",
                    "CreatedBy": "Administrator",
                    "DateCreated": "2015- 01 -23T16:56:20.43",
                    "LastModifiedBy": "Administrator",
                    "LastModified": "2015-01 - 23T16:56:20.43"
                }
            ]
        }
    ]
}

$response = LaravelNHIF::submitClaimToNHIF(claim_data:$data);
// response payload structure

```

### get submitted claims

[](#get-submitted-claims)

```
$response = LaravelNHIF::getSubmittedClaims(facility_code:'1232',claim_year: 2017,claim_month: 9);
// response payload structure
```

### submit referral

[](#submit-referral)

```
$data = {
    "CardNo": "01-NHIF45",
    "AuthorizationNo": "623456789",
    "PatientFullName": "Said Juma",
    "PhysicianMobileNo": "0655232365",
    "Gender": "Male",
    "PhysicianName": "Amour Rashid",
    "PhysicianQualificationID": 2,
    "ServiceIssuingFacilityCode": "01099",
    "ReferringDiagnosis": "084,085",
    "ReasonsForReferral": "Fractured hand needs attention from Orthopaedician at MOI"
}

$response = LaravelNHIF::submitReferralToNHIF(referral_data:$data);
// response payload structure

{
    "$id": "1",
    "$type": "NHIFService.Models.PatientReferral, NHIFService",
    "ReferralID": "838ba4f0-8a80- 4658 - bba5-e61ff602ca1d",
    "CardNo": "01-NHIF45",
    "AuthorizationNo": "623456789",
    "PatientFullName": "Said Juma",
    "Gender": "Male",
    "ReferringDate": "2018- 01 - 29T10:27:31.637",
    "PhysicianName": "Amour Rashid",
    "PhysicianMobileNo": null,
    "ReferralNo": "21081000019",
    "ServiceIssuingFacilityCode": "01099",
    "SourceFacilityCode": "06697",
    "PhysicianQualificationID": 2,
    "ReferringDiagnosis": "084,085",
    "ReasonsForReferral": "Fractured hand needs attention from Orthopaedician at MOI",
    "CreatedBy": "arashid",
    "DateCreated": "2018- 01 - 29T10:27:31.637",
    "LastModifiedBy": "arashid",
    "LastModified": "2018- 01 - 29T10:27:31.637"
}
```

### verify pre approved services

[](#verify-pre-approved-services)

```
$response = LaravelNHIF::verifyPreApprovedService(card_number:'12344', reference_number:'12342', item_code:'5625426');
// response payload structure

VALID or INVALID
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/omakei/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [omakei](https://github.com/omakei)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Every ~118 days

Total

3

Last Release

1148d ago

Major Versions

1.0.1 → 2.0.02023-03-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ee68680c808759d6c194f584ed624a7d2cea359d0b96f02c2182db0aa06ea16?d=identicon)[omakei](/maintainers/omakei)

---

Top Contributors

[![omakei](https://avatars.githubusercontent.com/u/48096457?v=4)](https://github.com/omakei "omakei (10 commits)")[![asantaelly](https://avatars.githubusercontent.com/u/42144545?v=4)](https://github.com/asantaelly "asantaelly (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelOmakeilaravel-nhif

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/omakei-laravel-nhif/health.svg)

```
[![Health](https://phpackages.com/badges/omakei-laravel-nhif/health.svg)](https://phpackages.com/packages/omakei-laravel-nhif)
```

###  Alternatives

[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)

PHPackages © 2026

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