These Python and Postgres SQL scripts are used to parse the dm+d releases in XML format into a Postgres database. Relational fields are referenced together using foreign keys, and the description of the columns are stored in their comments.
You can download the official releases of dm+d for free from https://isd.digital.nhs.uk.
- Ensure you have latest
xtools - Ensure you have dotenv plugin installed
poetry self add poetry-dotenv-plugin - Ensure you have export plugin installed
poetry self add poetry-plugin-export
Run following script to generate requirements.txt
poetry export --without-hashes -f requirements.txt --output requirements.txt
Run following script to run a test in local
poetry run python -m tests.test_run
Run following script to run a test in local
poetry run functions-framework --target=dmd_postgres_parser --port=8080
which will open an endpoint as:
curl --location 'http://localhost:8080' \
--header 'Content-Type: application/json' \
--data '{
"key": "",
"api_key": ""
}'
Run following script to properly format the code
poetry run black .
see Makefile for implementation details
