transformcore / hay-local-health-authority-bundle
Exposes the local health authority data via an api
Installs: 1 501
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 1
Requires
- php: >=5.5.0
- doctrine/doctrine-bundle: ~1.4
- doctrine/orm: ^2.4.8
- friendsofsymfony/rest-bundle: ^1.7
- friendsofsymfony/user-bundle: ^1.3
- jms/serializer-bundle: ^1.0
- nelmio/api-doc-bundle: ^2.9
- symfony/framework-bundle: ~2.3
- symfony/http-kernel: ~2.3,>=2.3.24
Requires (Dev)
- mockery/mockery: ^0.9.4
- phpunit/phpunit: 4.8.*
- psr/log: 1.0.0
- satooshi/php-coveralls: ^0.6.0@dev
- sensio/framework-extra-bundle: ~3.0
This package is not auto-updated.
Last update: 2019-10-22 18:51:52 UTC
README
##Requirements
- php 5.5 or higher
- mysql if you want to use the scaffolding
- a working symfony2 installation
##Installation
$ composer require transformcore/hay-local-health-authority-bundle
Enable it in your app/AppKernel.php
$bundles = array( // ... other bundles new TransformCore\PHE\LocalHealthAuthorityBundle\TransformCorePHELocalHealthAuthorityBundle(), );
Edit the app/config/routing.yml file and and the following
transform_core_phe_local_health_authority: resource: "@TransformCorePHELocalHealthAuthorityBundle/Resources/config/routing.yml" prefix: /lha/
Create/update the schema
$ app/console doctrine:schema:update --force
##Import from the raw data set
Extract the data set to the a directory you will remember directory, then run the following commands in order,
remember to replace the *
with the date information of the file you wish to import
###For Counties
$ php app/console haytool:lha-counties <path/to/>Documents/County names and codes EN as at *.txt`
###For District Councils
$ php app/console haytool:lha-district-councils <path/to/>Documents/LA_UA names and code UK as at *.txt`
###For Local Health Authorities
$ php app/console haytool:lha-lha <path/to/>Documents/CCG names and code *.txt // UK $ php app/console haytool:lha-lha <path/to/>Documents/LHB names and code *.txt // Wales $ php app/console haytool:lha-lha <path/to/>Documents/CHP names and code *.txt // Scotland $ php app/console haytool:ha-lha <path/to/>Documents/LCG names and code *.txt // Northern Ireland
###For Electoral Wards
$ php app/console haytool:lha-electoral-wards <path/to/>Documents/Ward names and codes UK as at *.txt
###For Parish Councils
$ php app/console haytool:lha-parish-councils <path/to/>Documents/Parish LAD names and codes EW as at *.txt $ php app/console haytool:lha-parish-councils<path/to/>Documents/Unparished areas names and codes EN as at *.txt
###For authority data
Copy the ONSPD_*.csv
from the <extractionPath>/Data
directory to the Data
directory of the bundle. Then run the following
sh Scripts/import_authorities.sh
Make some tea, this will take a while.
To update any of the files, run the same commands as above
##Import from fixtures
The fixtures contain the data set that was present in the ONSPD_AUG_2015_UK release of the postcode data, this may be out of date but can serve as a good baseline for testing
#Extract the contents of the fixtures archive
$ cd Data/Fixtures
$ tar -xf hay_api.sql.tar.gz
$ mysql -u <yourusername> -p<yourpassword> <your_database_name> < hay_api.sql
#Extract the contents of the postcode to district update set
$ tar -xf lha_websites.sql.tar.gz
$ mysql -u <yourusername> -p<yourpassword> <your_database_name> < lha_websites.sql