json covid snomed codes from "COVID-19 Vaccination Codes" https://hscic.kahootz.com/connect.ti/t_c_home/view?objectId=16878800
ensure to use curl -L
to follow redirects
curl -sL $(curl -s https://api.github.com/repos/NHSDigital/c19terms/releases/latest \
| jq -r '.assets[] | select(.name="terms.json") | .browser_download_url')
wget $(curl -s https://api.github.com/repos/NHSDigital/c19terms/releases/latest \
| jq -r '.assets[] | select(.name="terms.json") | .browser_download_url')
import requests
terms_asset = next(
filter(
(lambda asset: asset['name'] == 'terms.json'),
requests.get(url="https://api.github.com/repos/NHSDigital/c19terms/releases/latest").json()['assets']
)
)
terms = requests.get(url=terms_asset['browser_download_url']).json()
make dist products-as-dict
curl -sL $(curl -s https://api.github.com/repos/NHSDigital/c19terms/releases/latest \
| jq -r '.assets[] | select(.name="terms.json") | .browser_download_url') \
| jq '[.products | to_entries[] | {key: .key, value: .value.term}] | from_entries'