This is a service to provide information previously made available over NHS24, via an RESTful API, in json, that can be filtered by:
You can filter based on the service you need: do you need a GP? Pharmacy? Minor injuries unit? etc.)
All the services listed that have postcodes have been geo-encoded, which means that your query can only show services within n kilomters from you.
First you'll need the correct data to import. Once the licensing is clear, it'll be linked here somehow, otherwise, you'll need to send an email to the list below to have it shared with you via dropbox. Sorry about this faff.
Still with us?
This is a sinatra app, using Mongoid to speak to a mongodb server, so pull down your gems:
bundle
We're running a mongodb app, so we'll need a service running somewhere. Best to install mongodb the best way you feel comfortable doing so. This has been build on mongodb 2.2 so far.
Assuming you have the data, you'd run a command a bit like this, to import the file from the csv file that woul d have been shared with you:
mongoimport --db mongoid --collection services --type csv --headerline --file data/all_data.csv
There are a couple of rake tasks to clean up the data and make sure there are indexes present:
rake setup:fixed_phone_format
rake setup:service_location_indexes
These should be called if you just run rake
, but check the other tasks too - they'll help when checking the data later.
Run your sinatra app which ever way you like:
ruby nhs_scot_geo.rb
Or with rackup:
rackup
Or, in development:
shotgun
If you have any issues, please email [email protected].