e-mergency/site — Issue #16: Sorting of hospitals in the back-end
Author: PeterHamilton
Created: 2012-01-25 22:34:40+00:00
State: open

We need to augment the function self.find_hospitals_near_latlon(lat, lon, max_distance) so we can apply different sorting methods.

One needs to sort by distance, one by 'agony' and one by waiting time. For now we don't necessarily need the agony one so have a method call which just calls the distance one.

The method signature/style we want is(feel free to optimise):

```
self.find_hospitals_near_latlon(lat, lon, max_distance, sort)
case sort
when 'distance'
return self.find_hospitals_by_distance(lat, lon, max_distance)
when 'agony'
return self.find_hospitals_by_agony(lat, lon, max_distance)
when 'wait_time'
return self.find_hospitals_by_wait_time(lat, lon, max_distance)
end
end
```