package org.pdxfinder.services;

import org.pdxfinder.repositories.TreatmentSummaryRepository;
import org.springframework.stereotype.Service;

/*
 * Created by csaba on 29/03/2018.
 */
@Service
public class DrugService {

    private TreatmentSummaryRepository treatmentSummaryRepository;

    public DrugService(TreatmentSummaryRepository treatmentSummaryRepository) {
        this.treatmentSummaryRepository = treatmentSummaryRepository;
    }


    public int getDosingStudiesNumberByDataSource(String dataSource){

        return treatmentSummaryRepository.findStudyNumberByDataSource(dataSource);
    }


    public String getPlatformUrlByDataSource(String dataSource){

        return treatmentSummaryRepository.findPlatformUrlByDataSource(dataSource);
    }
}

@@ -26,16 +26,133 @@
 vices;%0A%0A
+import org.pdxfinder.repositories.ResponseRepository;%0Aimport org.pdxfinder.repositories.TreatmentProtocolRepository;%0A
 import o
@@ -253,16 +253,40 @@
 rvice;%0A%0A
+import java.util.List;%0A%0A
 /*%0A * Cr
@@ -427,75 +427,337 @@
 ry;%0A
-%0A    public DrugService(TreatmentSummaryRepository treatmentSummary
+    private TreatmentProtocolRepository treatmentProtocolRepository;%0A    private ResponseRepository responseRepository;%0A%0A    public DrugService(TreatmentSummaryRepository treatmentSummaryRepository,%0A                       TreatmentProtocolRepository treatmentProtocolRepository,%0A                       ResponseRepository response
 Repo
@@ -766,16 +766,17 @@
 tory) %7B%0A
+%0A
         
@@ -833,24 +833,150 @@
 Repository;%0A
+        this.treatmentProtocolRepository = treatmentProtocolRepository;%0A        this.responseRepository = responseRepository;%0A
     %7D%0A%0A%0A    
@@ -1288,10 +1288,227 @@
 ;%0A    %7D%0A
+%0A    public List%3CString%3E getDrugNames()%7B%0A%0A        return treatmentProtocolRepository.findDrugNames();%0A    %7D%0A%0A    public List%3CString%3E getResponseOptions()%7B%0A%0A        return responseRepository.findAllResponses();%0A    %7D%0A%0A
 %7D%0A

Add drug names and responses to service