diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/dashboard/DashboardRepository.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/dashboard/DashboardRepository.java index 7abda17..14b4f40 100644 --- a/src/main/java/edu/harvard/dbmi/avillach/dictionary/dashboard/DashboardRepository.java +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/dashboard/DashboardRepository.java @@ -55,14 +55,26 @@ public List> getHackyBDCRows() { SELECT dataset.abbreviation AS abbreviation, dataset.full_name AS name, - consent.variable_count AS clinvars, - consent.participant_count AS participants, - consent.sample_count AS samples, CASE - WHEN consent.consent_code <> NULL THEN concat(study_accession_meta.value, '.', consent.consent_code) + WHEN consent.variable_count > -1 THEN consent.variable_count + ELSE 'N/A' + END + AS clinvars, + CASE + WHEN consent.participant_count > -1 THEN consent.participant_count + ELSE 'N/A' + END + AS participants, + CASE + WHEN consent.sample_count > -1 THEN consent.sample_count + ELSE 'N/A' + END + AS samples, + CASE + WHEN consent.consent_code IS NOT NULL THEN concat(study_accession_meta.value, '.', consent.consent_code) ELSE study_accession_meta.value END - AS accession, + AS accession, study_focus_meta.value AS study_focus, additional_info_meta.value AS additional_info_link FROM @@ -70,7 +82,7 @@ WHEN consent.consent_code <> NULL THEN concat(study_accession_meta.value, '.', c LEFT JOIN consent ON consent.dataset_id = dataset.dataset_id LEFT JOIN dataset_meta AS study_focus_meta ON study_focus_meta.dataset_id = dataset.dataset_id AND study_focus_meta.KEY = 'study_focus' LEFT JOIN dataset_meta AS study_accession_meta ON study_accession_meta.dataset_id = dataset.dataset_id AND study_accession_meta.KEY = 'study_accession' - LEFT JOIN dataset_meta AS additional_info_meta ON additional_info_meta.dataset_id = dataset.dataset_id AND additional_info_meta.KEY = 'additional_info_link' + LEFT JOIN dataset_meta AS additional_info_meta ON additional_info_meta.dataset_id = dataset.dataset_id AND additional_info_meta.KEY = 'study_link' ORDER BY name ASC, abbreviation ASC """; return template.query(sql, new ListMapExtractor());