Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

New JRC API #4

Merged
merged 8 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions source-update/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# EU eHealthNetwork Digitial COVID Certificate RAT list update script

This repository contains scripts that are used to update the value set for the common list of rapid antigen tests (RATs) referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema).

Release: 2.0.0

Script `update-rat.sh` extracts information on all RAT test products and their manufacturers which are present on-so called "HSC common list" from a [COVID-19 In Vitro Diagnostic Devices and Test Methods Database](https://covid-19-diagnostics.jrc.ec.europa.eu/devices) maintained by JRC.

Script extracts all items which are or have been included on the HSC common list and forms a JSON file according to the value set schema. Information about current status of each item is stored in the element `"active"`. Element `"version"` includes date of last update of the entry in the JRC database or date of removal from the HSC common list (in such case element `"active" == false`).
24 changes: 14 additions & 10 deletions source-update/update-rat.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/bash
curl --silent --show-error https://covid-19-diagnostics.jrc.ec.europa.eu/devices/hsc-common-recognition-rat |
jq '.extracted_on as $version | .deviceList | reduce .[] as $i
({};
.[$i.id_device] =
{ "display": ($i.manufacturer.name + ", " + $i.commercial_name),
"lang":"en",
"active": true,
"system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices",
"version": $i.last_updated
}) | {"valueSetId": "covid-19-lab-test-manufacturer-and-name", "valueSetDate":$version[0:10], "valueSetValues": .}'
curl --silent --show-error https://covid-19-diagnostics.jrc.ec.europa.eu/devices/hsc-common-recognition-rat | jq \
'{
"valueSetId": "covid-19-lab-test-manufacturer-and-name",
"valueSetDate": .extracted_on[0:10],
"valueSetValues":
(reduce .deviceList[] as $i ({}; .[$i.id_device] =
($i.hsc_list_history | sort_by(.list_date)[-1]) as $latest |
{
"display": ($i.manufacturer.name + ", " + $i.commercial_name),
"lang": "en",
"active": $latest.in_common_list,
"system": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices",
"version": (if $latest.in_common_list then $i.last_updated else $latest.list_date end)[0:10] }))
}'
Loading