Skip to content

Commit

Permalink
fix(ctis): comprehension list to lower countries
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Dec 16, 2024
1 parent 0f70846 commit c72dea4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bsoclinicaltrials/server/main/ctis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion bsoclinicaltrials/server/main/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c72dea4

Please sign in to comment.