Download the PHP package beziworld/laravel-nfz without Composer
On this page you can find all versions of the php package beziworld/laravel-nfz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beziworld/laravel-nfz
More information about beziworld/laravel-nfz
Files in beziworld/laravel-nfz
Package laravel-nfz
Short Description Laravel integration with the Polish National Health Fund (NFZ): waiting times, contracts and statistics open APIs plus eWUS patient insurance verification, without ext-soap.
License MIT
Homepage https://github.com/beziworld/laravel-nfz
Informations about the package laravel-nfz
Laravel NFZ
Laravel integration with the Polish National Health Fund (Narodowy Fundusz Zdrowia, NFZ):
- Waiting times ("Terminy leczenia", API 1.4): search waiting lists by benefit, voivodeship, locality, county, provider, urgent or stable case and children age groups, with the predicted waiting time (PCUS), waiting list statistics, contact details and accessibility of the place
- Contracts ("Umowy NFZ", API 1.2): contracts of providers with values and plans per product and month, providers, service types, contract products, orthopaedic supplies
- Statistics: generic read-only access to the benefit, pharmacy refund, chemotherapy and drug programme APIs
- eWUS: verification of a patient's entitlement to publicly funded health care by PESEL, login with session caching and automatic re-login, MFA (TOTP) support, password change, many operator accounts, the signed NFZ confirmation document kept for archiving
InsuredInNfzvalidation rule,nfz:check-insuranceandnfz:waiting-timesArtisan commands- typed
final readonlyDTOs, lazy pagination withLazyCollection, caching, retries of read-only calls, SOAP withoutext-soap, every HTTP call fakeable withHttp::fake()
Polska wersja dokumentacji
Why this package
| this package | gilek/ewus |
dartui/ewus |
nextgen-tech/ewus-laravel |
|
|---|---|---|---|---|
| Laravel 12 / 13 | yes | no Laravel integration | Laravel 5 only (2018) | Laravel 6 to 8 (2020) |
| eWUS check, password change | yes | yes | via gilek 2.0-alpha | yes |
| MFA (TOTP) login, query block codes | yes | no | no | no |
| session cache, re-login, daily result cache | yes | no | no | no |
| NFZ open data APIs (waiting times, contracts) | yes | no | no | no |
No other Packagist package covers the NFZ open data APIs.
Installation
The open data APIs work without configuration. eWUS needs the operator account of the provider portal of your NFZ branch:
Waiting times
Since version 1.4 of the API (July 2026) NFZ publishes the predicted waiting time (PCUS) instead of the former "first available date"; the package follows the current version.
Dictionaries (v2, with province, county, locality and street):
The terms of the API require citing the source of the data: https://api.nfz.gov.pl/.
Contracts
Statistics
The statistical APIs expose many report-like resources, so results are returned as arrays. Resource names and parameters follow the Swagger documentation of each API.
eWUS
The client logs in on the first call and reuses the session (NFZ_EWUS_SESSION_TTL). When eWUS reports an expired
session or token, it logs in again and repeats the check once. Logins are never retried after an authentication
error. NFZ allows checking only patients served on the given day and at most once per patient per day, so results
are cached until midnight under a keyed hash of the PESEL (NFZ_EWUS_CACHE_RESULTS=false disables it).
Many accounts
Test environment
NFZ publishes a test environment with shared accounts (domain 15, login TEST1, password qwerty!@#; MFA
variants TEST1_MFA with the TOTP secret from the interface specification). In the test environment any even PESEL
is insured and any odd one is not; 01010153201 is not in the register, 19323197971 has the DN mark,
00060958187 is annulled and 50323199945 triggers the daily query block.
Validation
The PESEL format (checksum and date of birth) is validated before any request. Rejected credentials and an expired password are configuration errors and are thrown.
Artisan
Errors
| Exception | When |
|---|---|
InvalidConfiguration |
missing or invalid option, unknown connection; names the environment variable |
InvalidPesel |
malformed PESEL, raised before sending; the message holds the masked number only |
ApiException |
open data API error: httpStatus, errorCode (e.g. 1200007), reason, solution |
RateLimited |
HTTP 429 (limit of 10 requests per second per IP), never retried; retryAfter |
AuthenticationFailed |
eWUS rejected the credentials; wait at least 15 minutes after a temporary lock |
PasswordExpired |
the operator password has expired; use changeExpiredPassword() |
SessionExpired |
session or token expired (handled automatically during checks) |
AccessDenied |
authorisation refused; blockCode -100 to -105 for query blocks, blockDetail, isAdministrativeBlock() |
InvalidInput |
eWUS rejected the input |
EwusException |
other SOAP faults and transport errors: faultType, faultCode, operation |
All exceptions extend Beziworld\Nfz\Exceptions\NfzException. eWUS messages never contain a PESEL.
Development
Tests use responses captured from the live open data APIs and from the eWUS test environment (tests/Fixtures);
no request leaves the test suite.
Author
Created and maintained by Kamil Ćwiertnia, beziworld.eu.
- E-mail: [email protected]
- Issues: GitHub issues
Need an integration? Get in touch through beziworld.eu.
Other packages by the author
laravel-polish-validation · laravel-teryt · laravel-krs · laravel-ceidg
License
MIT. See https://api.nfz.gov.pl/ and eWUS is operated by the National Health Fund (Narodowy Fundusz Zdrowia). This package is not affiliated with or endorsed by NFZ.
All versions of laravel-nfz with dependencies
ext-dom Version *
ext-json Version *
ext-libxml Version *
guzzlehttp/guzzle Version ^7.8
illuminate/cache Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/validation Version ^12.0|^13.0