Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc BDC fixes #36

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,34 @@ public List<Map<String, String>> 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
dataset
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());
Expand Down