Skip to content

Commit

Permalink
feat(ct): Add new source CTIS in staging only
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Jul 15, 2024
1 parent 0c4a5a2 commit b8c74c3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ES_INDEX_ORCID=bso-orcid
ES_INDEX_PUBLICATIONS=bso-publications
ES_INDEX_STUDIES=bso-clinical-trials
REACT_APP_ENV=production
REACT_APP_ES_API_SOURCES_STUDIES=["clinical_trials", "euctr"]
REACT_APP_ES_API_URL_DATACITE=https://cluster-production.elasticsearch.dataesr.ovh/$ES_INDEX_DATACITE/_search
REACT_APP_ES_API_URL_ORCID=https://cluster-production.elasticsearch.dataesr.ovh/$ES_INDEX_ORCID/_search
REACT_APP_ES_API_URL_PUBLICATIONS=https://cluster-production.elasticsearch.dataesr.ovh/$ES_INDEX_PUBLICATIONS/_search
Expand Down
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ES_INDEX_ORCID=bso-orcid-staging
ES_INDEX_PUBLICATIONS=bso-publications-staging
ES_INDEX_STUDIES=bso-clinical-trials-staging
REACT_APP_ENV=development
REACT_APP_ES_API_SOURCES_STUDIES=["clinical_trials", "ctis", "euctr"]
REACT_APP_LAST_OBSERVATION=2023Q4
REACT_APP_LAST_OBSERVATION_THESIS=2023Q4
REACT_APP_PIWIK_SITE=44
1 change: 1 addition & 0 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ ES_INDEX_ORCID=bso-orcid-staging
ES_INDEX_PUBLICATIONS=bso-publications-staging
ES_INDEX_STUDIES=bso-clinical-trials-staging
REACT_APP_ENV=staging
REACT_APP_ES_API_SOURCES_STUDIES=["clinical_trials", "ctis", "euctr"]
REACT_APP_PIWIK_SITE=2
REACT_APP_PIWIK_URL=https://matomo.staging.dataesr.ovh/
7 changes: 5 additions & 2 deletions src/config/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
export const ES_API_URL = process.env.REACT_APP_ES_API_URL_PUBLICATIONS;
export const ES_STUDIES_API_URL = process.env.REACT_APP_ES_API_URL_STUDIES;
export const ES_ORCID_API_URL = process.env.REACT_APP_ES_API_URL_ORCID;
export const ES_DATACITE_API_URL = process.env.REACT_APP_ES_API_URL_DATACITE;
export const ES_ORCID_API_URL = process.env.REACT_APP_ES_API_URL_ORCID;
export const ES_STUDIES_API_SOURCES = JSON.parse(
process.env.REACT_APP_ES_API_SOURCES_STUDIES,
);
export const ES_STUDIES_API_URL = process.env.REACT_APP_ES_API_URL_STUDIES;

export const HEADERS = {
headers: {
Expand Down
5 changes: 5 additions & 0 deletions src/utils/chartFetchOptions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ES_STUDIES_API_SOURCES } from '../config/config';
import {
getPublicationYearFromObservationSnap,
getURLSearchParams,
Expand Down Expand Up @@ -2470,6 +2471,10 @@ export default function getFetchOptions({
// On graphs about interventional trials and observational studies, no filter on country is needed because it is only about France
// TODO to remove once the data is in the index
useBsoCountry = false;
// Filter on chosen sources (ClinicalTrials, eudrCTR and / or CTIS)
queryResponse.query.bool.filter.push({
terms: { 'all_sources.keyword': ES_STUDIES_API_SOURCES },
});
}
if (bsoCountry && useBsoCountry) {
queryResponse.query.bool.filter.push({
Expand Down

0 comments on commit b8c74c3

Please sign in to comment.