From f9f2b48689f2cd0506be4d76e18e55afd70e080e Mon Sep 17 00:00:00 2001 From: Samuel ORTION Date: Sat, 17 Sep 2022 22:45:10 +0200 Subject: [PATCH] Created bulk medicaments database downloader --- api/data/bdpm/.gitkeep | 0 api/data/database.links.txt | 8 ++++++++ api/utils/get_database.sh | 12 ++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 api/data/bdpm/.gitkeep create mode 100644 api/data/database.links.txt create mode 100755 api/utils/get_database.sh diff --git a/api/data/bdpm/.gitkeep b/api/data/bdpm/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/api/data/database.links.txt b/api/data/database.links.txt new file mode 100644 index 0000000..5fd8d04 --- /dev/null +++ b/api/data/database.links.txt @@ -0,0 +1,8 @@ +CIS_bdpm.txt +CIS_CIP_bdpm.txt +CIS_COMPO_bdpm.txt +CIS_HAS_SMR_bdpm.txt +CIS_HAS_ASMR_bdpm.txt +HAS_LiensPageCT_bdpm.txt +CIS_CPD_bdpm.txt +CIS_InfoImportantes.txt \ No newline at end of file diff --git a/api/utils/get_database.sh b/api/utils/get_database.sh new file mode 100755 index 0000000..78ab85d --- /dev/null +++ b/api/utils/get_database.sh @@ -0,0 +1,12 @@ +#! /usr/bin/env bash +set -e + +DATABASE_DOWNLOAD_ENDPOINT="https://base-donnees-publique.medicaments.gouv.fr/telechargement.php?fichier=" + +for file in $(cat ./data/database.links.txt); do + if [[ -z "$file" ]]; then + continue + fi + echo "Downloading $file" + wget -O "./data/bdpm/${file}" "${DATABASE_DOWNLOAD_ENDPOINT}${file}" +done \ No newline at end of file