#!/bin/bash
set -e

download_and_unzip () {

    curl "$1" > out.zip
    unzip ./out.zip
    rm ./out.zip
}

#date on market data
download_and_unzip "https://download.open.fda.gov/other/nsde/other-nsde-0001-of-0003.json.zip"
download_and_unzip "https://download.open.fda.gov/other/nsde/other-nsde-0002-of-0003.json.zip"
download_and_unzip "https://download.open.fda.gov/other/nsde/other-nsde-0003-of-0003.json.zip"

#rxnorm data
download_and_unzip "https://dailymed-data.nlm.nih.gov/public-release-files/rxnorm_mappings.zip"
