Skip to content

Tulip-Tech/dmd-postgres-parser

 
 

Repository files navigation

NHS Dictionary of medicines and devices (dm+d) Postgres SQL parser

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.

Prerequiste

  1. Ensure you have latest xtools
  2. Ensure you have dotenv plugin installed
    poetry self add poetry-dotenv-plugin
  3. Ensure you have export plugin installed
    poetry self add poetry-plugin-export

New package installation

Run following script to generate requirements.txt poetry export --without-hashes -f requirements.txt --output requirements.txt

Run test

Run following script to run a test in local poetry run python -m tests.test_run

Run locally

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": ""
}'

Ready to commit

Run following script to properly format the code poetry run black .

Deployment

see Makefile for implementation details

Database ERD

Database ERD

About

dm+d NHS TRUD release as relational database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.7%
  • Makefile 4.3%