-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rfc80/sample treatment endpoint (#10927)
* Add Sample Count Report Endpoint * Push counting logic to sql * Remove unused methods * Update PatientTreatments to pass int from db for totalPatientTreatmentCount * Fix tests * Add unit test for sample Treatments * Remove unused import * Fix indentation
- Loading branch information
Showing
17 changed files
with
322 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.cbioportal.model; | ||
|
||
public record SampleTreatment(String treatment, int preSampleCount, int postSampleCount) { | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/org/cbioportal/model/SampleTreatmentReport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.cbioportal.model; | ||
|
||
import java.util.Collection; | ||
|
||
public record SampleTreatmentReport(int totalSampleCount, Collection<SampleTreatment> treatments) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/org/cbioportal/persistence/model/SampleAcquisitionEventRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.cbioportal.persistence.model; | ||
|
||
public record SampleAcquisitionEventRecord(String sampleId, String patientUniqueId, String cancerStudyId, int timeTaken) { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/org/cbioportal/persistence/model/TreatmentRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.cbioportal.persistence.model; | ||
|
||
public record TreatmentRecord(String patientUniqueId, String treatment, int startTime, int stopTime) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/org/cbioportal/service/treatment/TreatmentCountReportService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.cbioportal.service.treatment; | ||
|
||
import org.cbioportal.model.PatientTreatmentReport; | ||
import org.cbioportal.model.SampleTreatmentReport; | ||
import org.cbioportal.web.parameter.StudyViewFilter; | ||
|
||
public interface TreatmentCountReportService { | ||
PatientTreatmentReport getPatientTreatmentReport(StudyViewFilter studyViewFilter); | ||
SampleTreatmentReport getSampleTreatmentReport(StudyViewFilter studyViewFilter); | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/org/cbioportal/service/treatment/TreatmentCountReportServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.cbioportal.service.treatment; | ||
|
||
import org.cbioportal.model.PatientTreatmentReport; | ||
import org.cbioportal.model.SampleTreatmentReport; | ||
import org.cbioportal.persistence.StudyViewRepository; | ||
import org.cbioportal.web.parameter.StudyViewFilter; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class TreatmentCountReportServiceImpl implements TreatmentCountReportService { | ||
|
||
private final StudyViewRepository studyViewRepository; | ||
|
||
@Autowired | ||
public TreatmentCountReportServiceImpl(StudyViewRepository studyViewRepository) { | ||
this.studyViewRepository = studyViewRepository; | ||
} | ||
|
||
@Override | ||
public PatientTreatmentReport getPatientTreatmentReport(StudyViewFilter studyViewFilter) { | ||
var patientTreatments = studyViewRepository.getPatientTreatments(studyViewFilter); | ||
var totalPatientTreatmentCount = studyViewRepository.getTotalPatientTreatmentCount(studyViewFilter); | ||
return new PatientTreatmentReport(totalPatientTreatmentCount, 0, patientTreatments); | ||
} | ||
|
||
@Override | ||
public SampleTreatmentReport getSampleTreatmentReport(StudyViewFilter studyViewFilter) { | ||
var sampleTreatments = studyViewRepository.getSampleTreatments(studyViewFilter); | ||
var totalSampleTreatmentCount = studyViewRepository.getTotalSampleTreatmentCount(studyViewFilter); | ||
return new SampleTreatmentReport(totalSampleTreatmentCount, sampleTreatments); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.