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

💥 SKFP-1033 clean legacy stuff #121

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions .env schema
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ KEYCLOAK_URL=
KEYCLOAK_REALM=
KEYCLOAK_CLIENT=

# Riff
RIFF_URL=

# Users-API
USERS_API_URL=

Expand Down
1 change: 0 additions & 1 deletion src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ export const KEYCLOAK_URL = process.env.KEYCLOAK_URL || 'https://kf-keycloak-qa.
export const KEYCLOAK_REALM = process.env.KEYCLOAK_REALM || 'kidsfirstdrc';
export const KEYCLOAK_CLIENT = process.env.KEYCLOAK_CLIENT || 'kidsfirst-apis';

export const RIFF_URL = process.env.RIFF_URL || 'https://riff-qa.kf-strides.org';
export const USERS_API_URL = process.env.USERS_API_URL || 'https://users-api-qa.373997854230.d3b.io';
66 changes: 33 additions & 33 deletions src/reports/biospecimen-data/configKf.ts
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
import { esBiospecimenIndex } from '../../env';
import { QueryConfig, ReportConfig, SheetConfig } from '../types';

const biospecimens: SheetConfig = {
sheetName: 'Biospecimens',
root: 'biospecimens',
root: null,
columns: [
{ field: 'kf_id' },
{ field: 'external_id' },
{ field: 'biospecimens.kf_id' },
{ field: 'biospecimens.external_sample_id' },
{ field: 'biospecimens.external_aliquot_id' },
{ field: 'biospecimens.age_at_event_days' },
{ field: 'biospecimens.composition' },
{ field: 'biospecimens.analyte_type' },
{ field: 'biospecimens.concentration_mg_per_ml' },
{ field: 'biospecimens.volume_ul' },
{ field: 'biospecimens.shipment_date' },
{ field: 'biospecimens.shipment_origin' },
{ field: 'biospecimens.sequencing_center_id' },
{ field: 'biospecimens.consent_type' },
{ field: 'biospecimens.dbgap_consent_code' },
{ field: 'biospecimens.method_of_sample_procurement' },
{ field: 'biospecimens.source_text_tumor_descriptor' },
{ field: 'biospecimens.ncit_id_anatomical_site' },
{ field: 'biospecimens.ncit_id_tissue_type' },
{ field: 'biospecimens.source_text_anatomical_site' },
{ field: 'biospecimens.source_text_tissue_type' },
{ field: 'biospecimens.uberon_id_anatomical_site' },
{ field: 'biospecimens.spatial_descriptor' },
{ field: 'participant.participant_id', header: 'Participant ID' },
{ field: 'participant.external_id', header: 'External Participant ID' },
{ field: 'collection_sample_id', header: 'Collection ID' },
{ field: 'external_collection_sample_id', header: 'External Collection ID' },
{ field: 'collection_sample_type', header: 'Collection Sample Type' },
{ field: 'sample_id', header: 'Sample ID' },
{ field: 'external_sample_id', header: 'External Sample ID' },
{ field: 'sample_type', header: 'Sample Type' },
{ field: 'parent_sample_id', header: 'Parent Sample ID' },
{ field: 'parent_sample_type', header: 'Parent Sample Type' },
{ field: 'study.study_code', header: 'Study Code' },
{ field: 'age_at_biospecimen_collection', header: 'Age at Biospecimen Collection (Days)' },
{ field: 'status', header: 'Sample Availability' },
{ field: 'volume', header: 'Volume' },
{ field: 'volume_unit', header: 'Volume Unit' },
{ field: 'collection_method_of_sample_procurement', header: 'Method of Sample Procurement' },
{ field: 'diagnoses.mondo_display_term', header: 'Histological Diagnosis (MONDO)' },
{ field: 'diagnoses.diagnosis_ncit', header: 'Histological Diagnosis (NCIT)' },
{ field: 'diagnoses.source_text', header: 'Histological Diagnosis (Source Text)' },
{ field: 'diagnoses.source_text_tumor_location', header: 'Tumor Location (Source Text)' },
//FIXME { field: '', header: 'Tumor Descriptor (Source Text)' },
{ field: 'collection_ncit_anatomy_site_id', header: 'Anatomical Site (NCIT)' },
{ field: 'collection_anatomy_site', header: 'Anatomical Site (Source Text)' },
// TODO: Add this back when it's ready { field: 'ncit_id_tissue_type', header: 'Tissue Type (NCIT)' },
// TODO: Add this back when it's ready { field: 'tissue_type_source_text', header: 'Tissue Type (Source Text)' },
{ field: 'consent_type', header: 'Consent Type' },
{ field: 'dbgap_consent_code', header: 'dbGaP Consent Code' },
{ field: 'files.sequencing_experiment.sequencing_center_id', header: 'Sequencing Center ID' },
],
sort: [
// TODO : SORT BY biospecimens.kf_id
{
'biospecimens.kf_id': {
order: 'asc',
},
},
{
kf_id: {
'participant.participant_id': {
order: 'asc',
},
},
],
};

const queryConfigs: QueryConfig = {
indexName: 'participant',
alias: 'participant_centric',
indexName: 'biospecimen',
alias: esBiospecimenIndex,
};

const sheetConfigs: SheetConfig[] = [biospecimens];
Expand Down
55 changes: 0 additions & 55 deletions src/reports/biospecimen-data/configKfNext.ts

This file was deleted.

7 changes: 2 additions & 5 deletions src/reports/biospecimen-data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ import generateReport from '../generateReport';
import { ProjectType } from '../types';
import configInclude from './configInclude';
import configKf from './configKf';
import configKfNext from './configKfNext';

const biospecimenDataReport = async (req: Request, res: Response): Promise<void> => {
console.time('biospecimen-data');

const { sqon, projectId, filename = null, isKfNext = false } = req.body;
const { sqon, projectId, filename = null } = req.body;
const userId = req['kauth']?.grant?.access_token?.content?.sub;
const accessToken = req.headers.authorization;

const p = PROJECT.toLowerCase().trim();
let reportConfig;
if (isKfNext) {
reportConfig = configKfNext;
} else if (p === ProjectType.include) {
if (p === ProjectType.include) {
reportConfig = configInclude;
} else if (p === ProjectType.kidsFirst) {
reportConfig = configKf;
Expand Down
Loading
Loading