Skip to content

Commit

Permalink
fix(ctis): Correct the filter on French clinical trials /2
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Jan 6, 2025
1 parent 8d67799 commit cc84c3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bsoclinicaltrials/server/main/ctis.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def harvest():
cts_fr = []
for ct in cts:
# Filter on French clinical trials
if "france:" in [country.lower() for country in ct.get("trialCountries")]:
if "france" in [country.lower().split(":")[0] 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
6 changes: 3 additions & 3 deletions bsoclinicaltrials/server/main/merge_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def merge_all(date_ct, date_euctr, date_ctis):
matches = update_matches(matches, raw_trials["NCTId"], "NCTId", ["eudraCT"])
matches = update_matches(matches, raw_trials["eudraCT"], "eudraCT", ["NCTId"])
matches = update_matches(matches, raw_trials["CTIS"], "CTIS", ["NCTId"])
known_ids = set([])
known_ids = set()
all_ct = []
for current_id_type in ["NCTId", "eudraCT", "CTIS"]:
for ct in raw_trials[current_id_type]:
Expand Down Expand Up @@ -112,10 +112,10 @@ def update_matches(matches, new_trials, id1_type, other_ids):
id2 = ct[id2_type]
if id1 not in matches:
matches[id1] = []
matches[id1].append({id2_type: id2})
matches[id1].append({ id2_type: id2 })
if id2 not in matches:
matches[id2] = []
matches[id2].append({id1_type: id1})
matches[id2].append({ id1_type: id1 })
return matches


Expand Down

0 comments on commit cc84c3d

Please sign in to comment.