diff --git a/README.md b/README.md index f39d452..c239844 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ ![license](https://img.shields.io/github/license/dataesr/bso-clinical-trials) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/dataesr/bso-clinical-trials) ![Production release](https://github.com/dataesr/bso-clinical-trials/actions/workflows/build.yml/badge.svg) +[![SWH](https://archive.softwareheritage.org/badge/origin/https://github.com/dataesr/bso-clinical-trials)](https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/dataesr/bso-clinical-trials) ## Release diff --git a/bsoclinicaltrials/server/main/ctis.py b/bsoclinicaltrials/server/main/ctis.py index d4fa235..c1938eb 100644 --- a/bsoclinicaltrials/server/main/ctis.py +++ b/bsoclinicaltrials/server/main/ctis.py @@ -36,11 +36,11 @@ def harvest(): cts += data if len(data) < per_page: break - # 2. For each French clinical trial, find details metadata + # 2. For each French clinical trial, find detailed metadata cts_fr = [] for ct in cts: # Filter on French clinical trials - if "fr:" in ct.get("trialCountries").lower(): + if "fr:" in [country.lower() for country in ct.get("trialCountries")]: r = requests.get( f"https://euclinicaltrials.eu/ctis-public-api/retrieve/{ct.get('ctNumber')}", verify=False) cts_fr.append(r.json()) diff --git a/bsoclinicaltrials/server/main/tasks.py b/bsoclinicaltrials/server/main/tasks.py index 43b4fa1..f8335a4 100644 --- a/bsoclinicaltrials/server/main/tasks.py +++ b/bsoclinicaltrials/server/main/tasks.py @@ -37,7 +37,7 @@ def create_task_transform_load(args: dict) -> dict: harvest_parse_ctis(to_harvest=to_harvest, to_parse=to_parse, harvest_date=harvest_date_ctis) merged_ct = merge_all(harvest_date_ct, harvest_date_euctr, harvest_date_ctis) data = enrich(merged_ct) - current_date = today.isoformat() + current_date = today.strftime('%Y%m%d') index = args.get('index', f'bso-clinical-trials-{current_date}') reset_index(index=index) load_in_es(data=data, index=index)