diff --git a/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json b/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json index 31052fbd0ac..4b857f37010 100644 --- a/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json +++ b/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json @@ -628,6 +628,93 @@ "operationId": "fetchCNAGenesUsingPOST" } }, + "/api/column-store/treatments/patient-counts/fetch": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "default": "Agent", + "enum": [ + "Agent", + "AgentClass", + "AgentTarget" + ], + "in": "query", + "name": "tier", + "required": false, + "type": "string" + }, + { + "in": "body", + "name": "studyViewFilter", + "schema": { + "$ref": "#/definitions/StudyViewFilter" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/PatientTreatmentReport" + } + } + }, + "tags": [ + "study-view-column-store-controller" + ], + "description": "Get all patient level treatments", + "operationId": "fetchPatientTreatmentCountsUsingPOST" + } + }, + "/api/column-store/treatments/sample-counts/fetch": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "default": "Agent", + "enum": [ + "Agent", + "AgentClass", + "AgentTarget" + ], + "in": "query", + "name": "tier", + "required": false, + "type": "string" + }, + { + "in": "body", + "name": "studyViewFilter", + "schema": { + "$ref": "#/definitions/StudyViewFilter" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SampleTreatmentReport" + } + } + }, + "tags": [ + "study-view-column-store-controller" + ], + "operationId": "fetchSampleTreatmentCountsUsingPOST" + } + }, "/api/cosmic-counts/fetch": { "post": { "consumes": [ @@ -5704,6 +5791,18 @@ }, "type": "object" }, + "PatientTreatment": { + "properties": { + "count": { + "format": "int32", + "type": "integer" + }, + "treatment": { + "type": "string" + } + }, + "type": "object" + }, "PatientTreatmentFilter": { "properties": { "treatment": { @@ -5712,6 +5811,25 @@ }, "type": "object" }, + "PatientTreatmentReport": { + "properties": { + "patientTreatments": { + "items": { + "$ref": "#/definitions/PatientTreatment" + }, + "type": "array" + }, + "totalPatients": { + "format": "int32", + "type": "integer" + }, + "totalSamples": { + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, "PatientTreatmentRow": { "properties": { "count": { @@ -5930,6 +6048,21 @@ }, "type": "object" }, + "SampleTreatmentReport": { + "properties": { + "totalSamples": { + "format": "int32", + "type": "integer" + }, + "treatments": { + "items": { + "$ref": "#/definitions/SampleTreatmentRow" + }, + "type": "array" + } + }, + "type": "object" + }, "SampleTreatmentRow": { "properties": { "count": { diff --git a/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal.ts b/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal.ts index 7db0e3b4e3f..7abb932cccc 100644 --- a/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal.ts +++ b/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal.ts @@ -920,10 +920,24 @@ export type PatientIdentifier = { 'studyId': string +}; +export type PatientTreatment = { + 'count': number + + 'treatment': string + }; export type PatientTreatmentFilter = { 'treatment': string +}; +export type PatientTreatmentReport = { + 'patientTreatments': Array < PatientTreatment > + + 'totalPatients': number + + 'totalSamples': number + }; export type PatientTreatmentRow = { 'count': number @@ -1022,6 +1036,12 @@ export type SampleTreatmentFilter = { 'treatment': string +}; +export type SampleTreatmentReport = { + 'totalSamples': number + + 'treatments': Array < SampleTreatmentRow > + }; export type SampleTreatmentRow = { 'count': number @@ -2519,6 +2539,172 @@ export default class CBioPortalAPIInternal { return response.body; }); }; + fetchPatientTreatmentCountsUsingPOSTURL(parameters: { + 'tier' ? : "Agent" | "AgentClass" | "AgentTarget", + 'studyViewFilter' ? : StudyViewFilter, + $queryParameters ? : any + }): string { + let queryParameters: any = {}; + let path = '/api/column-store/treatments/patient-counts/fetch'; + if (parameters['tier'] !== undefined) { + queryParameters['tier'] = parameters['tier']; + } + + if (parameters.$queryParameters) { + Object.keys(parameters.$queryParameters).forEach(function(parameterName) { + var parameter = parameters.$queryParameters[parameterName]; + queryParameters[parameterName] = parameter; + }); + } + let keys = Object.keys(queryParameters); + return this.domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : ''); + }; + + /** + * Get all patient level treatments + * @method + * @name CBioPortalAPIInternal#fetchPatientTreatmentCountsUsingPOST + * @param {string} tier - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change. + * @param {} studyViewFilter - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change. + */ + fetchPatientTreatmentCountsUsingPOSTWithHttpInfo(parameters: { + 'tier' ? : "Agent" | "AgentClass" | "AgentTarget", + 'studyViewFilter' ? : StudyViewFilter, + $queryParameters ? : any, + $domain ? : string + }): Promise < request.Response > { + const domain = parameters.$domain ? parameters.$domain : this.domain; + const errorHandlers = this.errorHandlers; + const request = this.request; + let path = '/api/column-store/treatments/patient-counts/fetch'; + let body: any; + let queryParameters: any = {}; + let headers: any = {}; + let form: any = {}; + return new Promise(function(resolve, reject) { + headers['Accept'] = 'application/json'; + headers['Content-Type'] = 'application/json'; + + if (parameters['tier'] !== undefined) { + queryParameters['tier'] = parameters['tier']; + } + + if (parameters['studyViewFilter'] !== undefined) { + body = parameters['studyViewFilter']; + } + + if (parameters.$queryParameters) { + Object.keys(parameters.$queryParameters).forEach(function(parameterName) { + var parameter = parameters.$queryParameters[parameterName]; + queryParameters[parameterName] = parameter; + }); + } + + request('POST', domain + path, body, headers, queryParameters, form, reject, resolve, errorHandlers); + + }); + }; + + /** + * Get all patient level treatments + * @method + * @name CBioPortalAPIInternal#fetchPatientTreatmentCountsUsingPOST + * @param {string} tier - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change. + * @param {} studyViewFilter - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change. + */ + fetchPatientTreatmentCountsUsingPOST(parameters: { + 'tier' ? : "Agent" | "AgentClass" | "AgentTarget", + 'studyViewFilter' ? : StudyViewFilter, + $queryParameters ? : any, + $domain ? : string + }): Promise < PatientTreatmentReport > { + return this.fetchPatientTreatmentCountsUsingPOSTWithHttpInfo(parameters).then(function(response: request.Response) { + return response.body; + }); + }; + fetchSampleTreatmentCountsUsingPOSTURL(parameters: { + 'tier' ? : "Agent" | "AgentClass" | "AgentTarget", + 'studyViewFilter' ? : StudyViewFilter, + $queryParameters ? : any + }): string { + let queryParameters: any = {}; + let path = '/api/column-store/treatments/sample-counts/fetch'; + if (parameters['tier'] !== undefined) { + queryParameters['tier'] = parameters['tier']; + } + + if (parameters.$queryParameters) { + Object.keys(parameters.$queryParameters).forEach(function(parameterName) { + var parameter = parameters.$queryParameters[parameterName]; + queryParameters[parameterName] = parameter; + }); + } + let keys = Object.keys(queryParameters); + return this.domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : ''); + }; + + /** + * + * @method + * @name CBioPortalAPIInternal#fetchSampleTreatmentCountsUsingPOST + * @param {string} tier - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change. + * @param {} studyViewFilter - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change. + */ + fetchSampleTreatmentCountsUsingPOSTWithHttpInfo(parameters: { + 'tier' ? : "Agent" | "AgentClass" | "AgentTarget", + 'studyViewFilter' ? : StudyViewFilter, + $queryParameters ? : any, + $domain ? : string + }): Promise < request.Response > { + const domain = parameters.$domain ? parameters.$domain : this.domain; + const errorHandlers = this.errorHandlers; + const request = this.request; + let path = '/api/column-store/treatments/sample-counts/fetch'; + let body: any; + let queryParameters: any = {}; + let headers: any = {}; + let form: any = {}; + return new Promise(function(resolve, reject) { + headers['Accept'] = 'application/json'; + headers['Content-Type'] = 'application/json'; + + if (parameters['tier'] !== undefined) { + queryParameters['tier'] = parameters['tier']; + } + + if (parameters['studyViewFilter'] !== undefined) { + body = parameters['studyViewFilter']; + } + + if (parameters.$queryParameters) { + Object.keys(parameters.$queryParameters).forEach(function(parameterName) { + var parameter = parameters.$queryParameters[parameterName]; + queryParameters[parameterName] = parameter; + }); + } + + request('POST', domain + path, body, headers, queryParameters, form, reject, resolve, errorHandlers); + + }); + }; + + /** + * + * @method + * @name CBioPortalAPIInternal#fetchSampleTreatmentCountsUsingPOST + * @param {string} tier - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change. + * @param {} studyViewFilter - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change. + */ + fetchSampleTreatmentCountsUsingPOST(parameters: { + 'tier' ? : "Agent" | "AgentClass" | "AgentTarget", + 'studyViewFilter' ? : StudyViewFilter, + $queryParameters ? : any, + $domain ? : string + }): Promise < SampleTreatmentReport > { + return this.fetchSampleTreatmentCountsUsingPOSTWithHttpInfo(parameters).then(function(response: request.Response) { + return response.body; + }); + }; fetchCosmicCountsUsingPOSTURL(parameters: { 'keywords': Array < string > , $queryParameters ? : any diff --git a/src/pages/studyView/StudyViewPageStore.ts b/src/pages/studyView/StudyViewPageStore.ts index 90223674981..c6ea86798ac 100644 --- a/src/pages/studyView/StudyViewPageStore.ts +++ b/src/pages/studyView/StudyViewPageStore.ts @@ -5826,7 +5826,7 @@ export class StudyViewPageStore const res = _(this.samples.result!) .map(sample => sampleResourceDefinitions.map(resource => - internalClient.getAllResourceDataOfSampleInStudyUsingGET( + this.internalClient.getAllResourceDataOfSampleInStudyUsingGET( { sampleId: sample.sampleId, studyId: sample.studyId, @@ -10462,7 +10462,7 @@ export class StudyViewPageStore invoke: async () => { if (this.shouldDisplaySampleTreatments.result) { if (isClickhouseMode()) { - return await this.internalClient.fetchSampleTreatmentCountsUsing( + return await this.internalClient.fetchSampleTreatmentCountsUsingPOST( { studyViewFilter: this.filters, } @@ -10515,7 +10515,7 @@ export class StudyViewPageStore invoke: async () => { if (this.shouldDisplayPatientTreatments.result) { if (isClickhouseMode()) { - return await this.internalClient.fetchPatientTreatmentCountsUsing( + return await this.internalClient.fetchPatientTreatmentCountsUsingPOST( { studyViewFilter: this.filters, } @@ -10590,10 +10590,12 @@ export class StudyViewPageStore await: () => [this.shouldDisplayPatientTreatmentGroups], invoke: () => { if (this.shouldDisplayPatientTreatmentGroups.result) { - return this.internalClient.fetchPatientTreatmentCountsUsing({ - studyViewFilter: this.filters, - tier: 'AgentClass', - }); + return this.internalClient.fetchPatientTreatmentCountsUsingPOST( + { + studyViewFilter: this.filters, + tier: 'AgentClass', + } + ); } return Promise.resolve(undefined); }, @@ -10643,7 +10645,7 @@ export class StudyViewPageStore public readonly patientTreatmentTarget = remoteData({ await: () => [this.shouldDisplayPatientTreatmentTarget], invoke: () => { - return this.internalClient.fetchPatientTreatmentCountsUsing({ + return this.internalClient.fetchPatientTreatmentCountsUsingPOST({ studyViewFilter: this.filters, tier: 'AgentTarget', });