PHPackages                             atiweb/edss-in-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. atiweb/edss-in-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

atiweb/edss-in-php
==================

PHP implementation of the Expanded Disability Status Scale (EDSS) calculator based on the Kurtzke/Kappos scoring table

v1.0.1(4mo ago)211MITPHPPHP &gt;=8.1CI failing

Since Feb 6Pushed 4mo agoCompare

[ Source](https://github.com/atiweb/edss-in-php)[ Packagist](https://packagist.org/packages/atiweb/edss-in-php)[ Docs](https://github.com/atiweb/edss-in-php)[ RSS](/packages/atiweb-edss-in-php/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

EDSS Calculator for PHP
=======================

[](#edss-calculator-for-php)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

PHP implementation of the **Expanded Disability Status Scale (EDSS)** calculator, based on the scoring table by Ludwig Kappos, MD (University Hospital Basel) and the Neurostatus-EDSS™ standard (Kurtzke, 1983).

This library calculates the EDSS score from 7 Functional System (FS) scores and an Ambulation score, used in the clinical assessment of Multiple Sclerosis.

Based on the [JavaScript reference implementation](https://github.com/atiweb/edss) (forked from [adobrasinovic/edss](https://github.com/adobrasinovic/edss)).

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

[](#installation)

```
composer require atiweb/edss-in-php
```

Usage
-----

[](#usage)

### Direct calculation with individual scores

[](#direct-calculation-with-individual-scores)

Parameter names match the [JS reference](https://github.com/atiweb/edss): `calculateEDSS(visualFunctionsScore, brainstemFunctionsScore, pyramidalFunctionsScore, cerebellarFunctionsScore, sensoryFunctionsScore, bowelAndBladderFunctionsScore, cerebralFunctionsScore, ambulationScore)`

```
use Atiweb\Edss\EdssCalculator;

$calculator = new EdssCalculator();

$edss = $calculator->calculate(
    visualFunctionsScore: 1,          // Visual (Optic) — raw 0-6
    brainstemFunctionsScore: 2,       // Brainstem — 0-5
    pyramidalFunctionsScore: 1,       // Pyramidal — 0-6
    cerebellarFunctionsScore: 3,      // Cerebellar — 0-5
    sensoryFunctionsScore: 1,         // Sensory — 0-6
    bowelAndBladderFunctionsScore: 4, // Bowel & Bladder — raw 0-6
    cerebralFunctionsScore: 2,        // Cerebral (Mental) — 0-5
    ambulationScore: 1,               // Ambulation — 0-16
);

echo $edss; // "4"
```

### From an associative array

[](#from-an-associative-array)

By default, `calculateFromArray()` expects English field names:

```
$data = [
    'visual_functions_score' => '1',
    'brainstem_functions_score' => '2',
    'pyramidal_functions_score' => '1',
    'cerebellar_functions_score' => '3',
    'sensory_functions_score' => '1',
    'bowel_and_bladder_functions_score' => '4',
    'cerebral_functions_score' => '2',
    'ambulation_score' => '1',
];

$edss = $calculator->calculateFromArray($data);
echo $edss; // "4"
```

### With REDCap Portuguese field names

[](#with-redcap-portuguese-field-names)

If your data uses the Portuguese field names from REDCap/REDONE.br, pass the built-in `FIELDS_REDCAP_PT` mapping:

```
$redcapData = [
    'edss_func_visuais' => '1',                       // Visual Functions Score
    'edss_cap_func_tronco_cereb' => '2',              // Brainstem Functions Score
    'edss_cap_func_pirad' => '1',                     // Pyramidal Functions Score
    'edss_cap_func_cereb' => '3',                     // Cerebellar Functions Score
    'edss_cap_func_sensitivas' => '1',                // Sensory Functions Score
    'edss_func_vesicais_e_instestinais' => '4',       // Bowel & Bladder Functions Score
    'edss_func_cerebrais' => '2',                     // Cerebral Functions Score
    'edss_func_demabulacao_incapacidade' => '1',      // Ambulation Score
];

$edss = $calculator->calculateFromArray($redcapData, EdssCalculator::FIELDS_REDCAP_PT);
echo $edss; // "4"

// Longitudinal data with suffix
$edss = $calculator->calculateFromArray($longitudinalData, EdssCalculator::FIELDS_REDCAP_PT, '_long');
```

### Custom field mapping

[](#custom-field-mapping)

You can define your own field name mapping for any data source:

```
$myFields = [
    'visual'       => 'my_visual_field',
    'brainstem'    => 'my_brainstem_field',
    'pyramidal'    => 'my_pyramidal_field',
    'cerebellar'   => 'my_cerebellar_field',
    'sensory'      => 'my_sensory_field',
    'bowelBladder' => 'my_bowel_bladder_field',
    'cerebral'     => 'my_cerebral_field',
    'ambulation'   => 'my_ambulation_field',
];

$edss = $calculator->calculateFromArray($myData, $myFields);
```

### Score conversions

[](#score-conversions)

The Visual and Bowel &amp; Bladder Functional Systems use a wider raw scale that is compressed for EDSS calculation:

```
// Visual: raw 0-6 → converted 0-4
//   0→0, 1→1, 2-3→2, 4-5→3, 6→4
EdssCalculator::convertVisualScore(3);  // 2
EdssCalculator::convertVisualScore(5);  // 3

// Bowel & Bladder: raw 0-6 → converted 0-5
//   0→0, 1→1, 2→2, 3-4→3, 5→4, 6→5
EdssCalculator::convertBowelAndBladderScore(4);  // 3
EdssCalculator::convertBowelAndBladderScore(6);  // 5
```

Functional Systems
------------------

[](#functional-systems)

\#Functional SystemRaw ScaleConverted ScaleJS Parameter Name1Visual (Optic)0-60-4`visualFunctionsScore`2Brainstem0-5—`brainstemFunctionsScore`3Pyramidal0-6—`pyramidalFunctionsScore`4Cerebellar0-5—`cerebellarFunctionsScore`5Sensory0-6—`sensoryFunctionsScore`6Bowel &amp; Bladder0-60-5`bowelAndBladderFunctionsScore`7Cerebral (Mental)0-5—`cerebralFunctionsScore`8Ambulation0-16—`ambulationScore`> **Note:** The Ambulation score (≥3) directly determines the EDSS score (≥5.0). When Ambulation is 0-2, the EDSS is determined by the combination of FS scores.

Algorithm
---------

[](#algorithm)

The EDSS calculation follows a two-phase approach:

### Phase 1: Ambulation-driven (EDSS ≥ 5.0)

[](#phase-1-ambulation-driven-edss--50)

When the Ambulation score is ≥ 3, it directly maps to an EDSS value:

AmbulationEDSSDescription35.0Walks 200-300m without help45.5Walks 100-200m without help5-76.0Assistance needed for walking8-96.5Bilateral/limited assistance107.0Wheelchair without help117.5Wheelchair with help128.0Restricted to bed/chair138.5Restricted to bed149.0Helpless bed patient159.5Totally helpless1610.0Death due to MS### Phase 2: FS-driven (EDSS 0 – 5.0)

[](#phase-2-fs-driven-edss-0--50)

When Ambulation is 0-2, the EDSS is calculated from the combination of the 7 FS scores based on the Kappos scoring table, considering:

- The maximum FS score and how many systems have that score
- The second-highest FS score and its frequency
- The Ambulation score (0, 1, or 2)

Field Name Mappings
-------------------

[](#field-name-mappings)

The library includes built-in constants for field name mappings:

ConstantDescriptionExample field`FIELDS_DEFAULT`English names (default)`visual_functions_score``FIELDS_REDCAP_PT`Portuguese REDCap names`edss_func_visuais`You can also pass your own `array` mapping to `calculateFromArray()`.

Other implementations
---------------------

[](#other-implementations)

LanguageRepositoryJavaScript[atiweb/edss](https://github.com/atiweb/edss)Kotlin[atiweb/edss-in-kotlin](https://github.com/atiweb/edss-in-kotlin)Flutter/Dart[atiweb/edss-in-flutter](https://github.com/atiweb/edss-in-flutter)Testing
-------

[](#testing)

```
composer install
composer test
```

The test suite includes 70+ test cases covering:

- All EDSS ranges from 0 to 10
- Visual and Bowel/Bladder score conversions
- All ambulation-driven scores
- Edge cases for FS combinations
- The reference example from the JavaScript implementation
- Custom field mapping support

References
----------

[](#references)

- Kurtzke JF. Rating neurologic impairment in multiple sclerosis: an expanded disability status scale (EDSS). *Neurology*. 1983;33(11):1444-1452.
- [Neurostatus-EDSS™](https://www.neurostatus.net/)
- [JavaScript reference implementation](https://github.com/atiweb/edss)

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance74

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

144d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11332210?v=4)[Adalberto Garcia Garces](/maintainers/atiweb)[@atiweb](https://github.com/atiweb)

---

Top Contributors

[![atiweb](https://avatars.githubusercontent.com/u/11332210?v=4)](https://github.com/atiweb "atiweb (6 commits)")

---

Tags

edssmultiple-sclerosisneurologykurtzkedisability-scaleclinical-assessmentfunctional-systems

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/atiweb-edss-in-php/health.svg)

```
[![Health](https://phpackages.com/badges/atiweb-edss-in-php/health.svg)](https://phpackages.com/packages/atiweb-edss-in-php)
```

PHPackages © 2026

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