From 76fcd50b73ba1809658ca6c47134ac8dab1b7c07 Mon Sep 17 00:00:00 2001 From: Player256 Date: Mon, 24 Apr 2023 15:17:38 +0530 Subject: [PATCH 1/9] fixes #10122 --- src/pages/studyView/StudyViewPageStore.ts | 14 ++++++++++++++ src/pages/studyView/tabs/SummaryTab.tsx | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/pages/studyView/StudyViewPageStore.ts b/src/pages/studyView/StudyViewPageStore.ts index 04559aa38e8..20a90e6ef08 100644 --- a/src/pages/studyView/StudyViewPageStore.ts +++ b/src/pages/studyView/StudyViewPageStore.ts @@ -8555,6 +8555,20 @@ export class StudyViewPageStore return data.join('\n'); } else return ''; } + public async getPatientTreatmentDownloadData(): Promise { + if (this.patientTreatments.result) { + let header = ['Treatment', '#']; + let data = [header.join('\t')]; + _.each( + this.patientTreatments.result, + (record: PatientTreatmentRow) => { + let rowData = [record.treatment, record.count]; + data.push(rowData.join('\n')); + } + ); + return data.join('\n'); + } else return ''; + } readonly survivalEntryMonths = remoteData< { [uniquePatientKey: string]: number } | undefined diff --git a/src/pages/studyView/tabs/SummaryTab.tsx b/src/pages/studyView/tabs/SummaryTab.tsx index 16a3ba93043..9d514cfddd7 100644 --- a/src/pages/studyView/tabs/SummaryTab.tsx +++ b/src/pages/studyView/tabs/SummaryTab.tsx @@ -649,6 +649,9 @@ export class StudySummaryTab extends React.Component< props.filters = this.store.patientTreatmentFiltersAsStrings; props.promise = this.store.patientTreatments; props.onValueSelection = this.store.onTreatmentSelection; + props.getData = () => + this.store.getPatientTreatmentDownloadData(); + props.downloadTypes = ['Full Data', 'Summary Data']; props.onResetSelection = () => { this.store.clearPatientTreatmentFilters(); }; From 79e358d17983e3a128946aa4f03d4c0958a1ecb2 Mon Sep 17 00:00:00 2001 From: Player256 <92082372+Player256@users.noreply.github.com> Date: Mon, 24 Apr 2023 20:40:12 +0530 Subject: [PATCH 2/9] Update src/pages/studyView/StudyViewPageStore.ts Co-authored-by: Gaofei Zhao <15748980+dippindots@users.noreply.github.com> --- src/pages/studyView/StudyViewPageStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/studyView/StudyViewPageStore.ts b/src/pages/studyView/StudyViewPageStore.ts index 20a90e6ef08..e647a60dbed 100644 --- a/src/pages/studyView/StudyViewPageStore.ts +++ b/src/pages/studyView/StudyViewPageStore.ts @@ -8563,7 +8563,7 @@ export class StudyViewPageStore this.patientTreatments.result, (record: PatientTreatmentRow) => { let rowData = [record.treatment, record.count]; - data.push(rowData.join('\n')); + data.push(rowData.join('\t')); } ); return data.join('\n'); From 3a6765a4ced0589eacba5d6c4cbe708f5c9f2a1f Mon Sep 17 00:00:00 2001 From: Player256 <92082372+Player256@users.noreply.github.com> Date: Mon, 24 Apr 2023 22:27:47 +0530 Subject: [PATCH 3/9] Update SummaryTab.tsx --- src/pages/studyView/tabs/SummaryTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/studyView/tabs/SummaryTab.tsx b/src/pages/studyView/tabs/SummaryTab.tsx index 9d514cfddd7..7c1287b7739 100644 --- a/src/pages/studyView/tabs/SummaryTab.tsx +++ b/src/pages/studyView/tabs/SummaryTab.tsx @@ -651,7 +651,7 @@ export class StudySummaryTab extends React.Component< props.onValueSelection = this.store.onTreatmentSelection; props.getData = () => this.store.getPatientTreatmentDownloadData(); - props.downloadTypes = ['Full Data', 'Summary Data']; + props.downloadTypes = ['Data']; props.onResetSelection = () => { this.store.clearPatientTreatmentFilters(); }; From 9c2edd939394dcefab46ba33e49ee1f4392e636d Mon Sep 17 00:00:00 2001 From: Player256 <92082372+Player256@users.noreply.github.com> Date: Mon, 24 Apr 2023 22:59:34 +0530 Subject: [PATCH 4/9] Update StudyViewPageStore.ts --- src/pages/studyView/StudyViewPageStore.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pages/studyView/StudyViewPageStore.ts b/src/pages/studyView/StudyViewPageStore.ts index e647a60dbed..da6fa9fc8b9 100644 --- a/src/pages/studyView/StudyViewPageStore.ts +++ b/src/pages/studyView/StudyViewPageStore.ts @@ -8569,6 +8569,19 @@ export class StudyViewPageStore return data.join('\n'); } else return ''; } +public async getSampleTreatmentDownloadData(): Promise { + if (this.sampleTreatments.result) { + const header = ['Treatment', 'Pre/Post', '#']; + let data = [header.join('\t')]; + _.each( + this.sampleTreatments.result, + (record: SampleTreatmentRow) => { + let rowData = [record.treatment, record.time, record.count]; + data.push(rowData.join('\t')); + } + ); + return data.join('\n'); + } else return ''; readonly survivalEntryMonths = remoteData< { [uniquePatientKey: string]: number } | undefined From 93491f44949403ef53c5bb6ca12198542aa3c675 Mon Sep 17 00:00:00 2001 From: Player256 <92082372+Player256@users.noreply.github.com> Date: Mon, 24 Apr 2023 23:00:26 +0530 Subject: [PATCH 5/9] Update SummaryTab.tsx --- src/pages/studyView/tabs/SummaryTab.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/studyView/tabs/SummaryTab.tsx b/src/pages/studyView/tabs/SummaryTab.tsx index 7c1287b7739..1b63e5f752e 100644 --- a/src/pages/studyView/tabs/SummaryTab.tsx +++ b/src/pages/studyView/tabs/SummaryTab.tsx @@ -622,6 +622,8 @@ export class StudySummaryTab extends React.Component< props.filters = this.store.sampleTreatmentFiltersAsStrings; props.promise = this.store.sampleTreatments; props.onValueSelection = this.store.onTreatmentSelection; + props.getData = () => this.store.getSampleTreatmentDownloadData(); + props.downloadTypes = ['Data']; props.onResetSelection = () => { this.store.clearSampleTreatmentFilters(); }; From 5b29a646372b09ac12ae8b093c23abcff0e44ffe Mon Sep 17 00:00:00 2001 From: Player256 <92082372+Player256@users.noreply.github.com> Date: Tue, 25 Apr 2023 10:16:56 +0530 Subject: [PATCH 6/9] Update SummaryTab.tsx --- src/pages/studyView/tabs/SummaryTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/studyView/tabs/SummaryTab.tsx b/src/pages/studyView/tabs/SummaryTab.tsx index 1b63e5f752e..824c6e7b991 100644 --- a/src/pages/studyView/tabs/SummaryTab.tsx +++ b/src/pages/studyView/tabs/SummaryTab.tsx @@ -622,7 +622,7 @@ export class StudySummaryTab extends React.Component< props.filters = this.store.sampleTreatmentFiltersAsStrings; props.promise = this.store.sampleTreatments; props.onValueSelection = this.store.onTreatmentSelection; - props.getData = () => this.store.getSampleTreatmentDownloadData(); + props.getData = () => this.store.getSampleTreatmentDownloadData(); props.downloadTypes = ['Data']; props.onResetSelection = () => { this.store.clearSampleTreatmentFilters(); From ed4335ad3714d948922b47146bcb129300af4618 Mon Sep 17 00:00:00 2001 From: Player256 <92082372+Player256@users.noreply.github.com> Date: Tue, 25 Apr 2023 10:18:23 +0530 Subject: [PATCH 7/9] Update StudyViewPageStore.ts --- src/pages/studyView/StudyViewPageStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/studyView/StudyViewPageStore.ts b/src/pages/studyView/StudyViewPageStore.ts index da6fa9fc8b9..21dd2158bab 100644 --- a/src/pages/studyView/StudyViewPageStore.ts +++ b/src/pages/studyView/StudyViewPageStore.ts @@ -8557,7 +8557,7 @@ export class StudyViewPageStore } public async getPatientTreatmentDownloadData(): Promise { if (this.patientTreatments.result) { - let header = ['Treatment', '#']; + const header = ['Treatment', '#']; let data = [header.join('\t')]; _.each( this.patientTreatments.result, From 4338984b7e172ae83b13501436052ece3bda7301 Mon Sep 17 00:00:00 2001 From: Player256 Date: Tue, 25 Apr 2023 10:35:39 +0530 Subject: [PATCH 8/9] missed a bracket --- src/pages/studyView/StudyViewPageStore.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/studyView/StudyViewPageStore.ts b/src/pages/studyView/StudyViewPageStore.ts index 21dd2158bab..4248047a0c0 100644 --- a/src/pages/studyView/StudyViewPageStore.ts +++ b/src/pages/studyView/StudyViewPageStore.ts @@ -8569,7 +8569,7 @@ export class StudyViewPageStore return data.join('\n'); } else return ''; } -public async getSampleTreatmentDownloadData(): Promise { + public async getSampleTreatmentDownloadData(): Promise { if (this.sampleTreatments.result) { const header = ['Treatment', 'Pre/Post', '#']; let data = [header.join('\t')]; @@ -8582,6 +8582,7 @@ public async getSampleTreatmentDownloadData(): Promise { ); return data.join('\n'); } else return ''; + } readonly survivalEntryMonths = remoteData< { [uniquePatientKey: string]: number } | undefined From 00c43e09582530bcf700497c5130bb41041d17c0 Mon Sep 17 00:00:00 2001 From: Player256 Date: Tue, 25 Apr 2023 22:00:04 +0530 Subject: [PATCH 9/9] ran prettier --- src/pages/studyView/tabs/SummaryTab.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/studyView/tabs/SummaryTab.tsx b/src/pages/studyView/tabs/SummaryTab.tsx index 824c6e7b991..0f4bd5f9b13 100644 --- a/src/pages/studyView/tabs/SummaryTab.tsx +++ b/src/pages/studyView/tabs/SummaryTab.tsx @@ -622,7 +622,8 @@ export class StudySummaryTab extends React.Component< props.filters = this.store.sampleTreatmentFiltersAsStrings; props.promise = this.store.sampleTreatments; props.onValueSelection = this.store.onTreatmentSelection; - props.getData = () => this.store.getSampleTreatmentDownloadData(); + props.getData = () => + this.store.getSampleTreatmentDownloadData(); props.downloadTypes = ['Data']; props.onResetSelection = () => { this.store.clearSampleTreatmentFilters();