Planning trips for multiple patients

Product Used: Distance Matrix API

Background

A specialized NEMT provider often serves dialysis patients who need recurring transportation to dialysis centers multiple times a week. Dialysis treatments are often scheduled at regular intervals, with many patients arriving at the clinic within a narrow time window. The scheduling and routing of these trips become challenging when the provider must accommodate multiple patients who require pickup from different locations and drop-off at a given dialysis center (or vice versa) within strict time windows.

Problem Statements

The NEMT provider wants to

  1. Efficiently plan onwards and return journeys: Plan for the trip to medical centers and back to patients’ home with multi-pickups and multiple drop-offs in the respective legs.

Solution

A Distance Matrix API is highly valuable in the NEMT (Non-Emergency Medical Transportation) industry for solving complex routing and scheduling problems. It provides distance and travel time information between multiple locations, enabling NEMT providers to optimize route planning, optimize costs, and improve service efficiency.

Plan onward journey with multiple pick-ups

Provide the pickup locations of the patients as origins and the dialysis center’s location as destinations while building the Direction Matrix request. As an example,

1
“origins”: ”34.06173622,-118.32402555 |34.06266790,-118.33873187 | 34.06871599,-118.33873626 | 34.06186820,-118.31180940”
2
“destinations”: ”34.05725176,-118.33967735”

This configuration indicates there are 4 pickup locations and a single drop-off location. Once the API returns the ETAs the pickups can be planned well in advance using multiple vehicles.

Plan return journey with multiple drop-offs

Provide the center’s locations of the patients as origins and the dialysis center’s location as destinations while building the Direction Matrix request. As an example,

1
“origins”: ”34.05725176,-118.33967735”
2
“destinations”: ”34.06173622,-118.32402555 |34.06266790,-118.33873187 | 34.06871599,-118.33873626 | 34.06186820,-118.31180940”

Above configuration indicates there is a single pickup location and 4 drop-off locations. Once the API returns the ETAs the pickup and drop-offs can be planned well in advance using multiple vehicles.

Sample API request and solution

Here is complete sample JSON request that we built for this case and the corresponding response:

API Request

1
curl --location 'https://api.nextbillion.io/distancematrix/json?key=<your_api_key>'
2
--header 'Content-Type: application/json'
3
--data '{
4
"origins": "34.06173622,-118.32402555 |34.06266790,-118.33873187 | 34.06871599,-118.33873626 | 34.06186820,-118.31180940",
5
"destinations": "34.05725176,-118.33967735",
6
"mode":"car"
7
}'

API Response

1
{
2
"status": "Ok",
3
"rows": [
4
{
5
"elements": [
6
{
7
"duration": {
8
"value": 190
9
},
10
"distance": {
11
"value": 1852
12
}
13
}
14
]
15
},
16
{
17
"elements": [
18
{
19
"duration": {
20
"value": 110
21
},
22
"distance": {
23
"value": 676
24
}
25
}
26
]
27
},
28
{
29
"elements": [
30
{
31
"duration": {
32
"value": 175
33
},
34
"distance": {
35
"value": 1347
36
}
37
}
38
]
39
},
40
{
41
"elements": [
42
{
43
"duration": {
44
"value": 264
45
},
46
"distance": {
47
"value": 3121
48
}
49
}
50
]
51
}
52
]
53
}

In the solution, we can see that the Distance Matrix response returns accurate ETAs and responses that can be achieved by taking the best routes. The NEMT operators can base their schedules and communications based on the suggested distances and ETAs. Further, in order to actually generate the best routes they can refer to NextBillion.ai Directions API.

© 2024 NextBillion.ai all rights reserved.