package org.pdxfinder.dao;

import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;

import java.util.Set;

/**
 * TreatmentSummary represents a summary of the application of a treatment protocol to a sample (either Human or Xenograft)
 */

@NodeEntity
public class TreatmentSummary {

    @GraphId
    Long id;

    @Relationship(type = "TREATMENT_PROTOCOL")
    Set<TreatmentProtocol> treatmentProtocols;

    @Relationship(type = "SUMMARY_OF_TREATMENT")
    ModelCreation modelCreation;

    @Relationship(type = "SUMMARY_OF_TREATMENT")
    PatientSnapshot patientSnapshot;

    public TreatmentSummary() {
    }

    public Set<TreatmentProtocol> getTreatmentProtocols() {
        return treatmentProtocols;
    }

    public void setTreatmentProtocols(Set<TreatmentProtocol> treatmentProtocols) {
        this.treatmentProtocols = treatmentProtocols;
    }

    public ModelCreation getModelCreation() {
        return modelCreation;
    }

    public void setModelCreation(ModelCreation modelCreation) {
        this.modelCreation = modelCreation;
    }

    public PatientSnapshot getPatientSnapshot() {
        return patientSnapshot;
    }

    public void setPatientSnapshot(PatientSnapshot patientSnapshot) {
        this.patientSnapshot = patientSnapshot;
    }
}

@@ -153,16 +153,42 @@
 nship;%0A%0A
+import java.util.HashSet;%0A
 import j
@@ -1368,10 +1368,229 @@
 ;%0A    %7D%0A
+%0A    public void addTreatmentProtocol(TreatmentProtocol tp)%7B%0A        if(this.treatmentProtocols == null)%7B%0A            this.treatmentProtocols = new HashSet%3C%3E();%0A        %7D%0A        this.treatmentProtocols.add(tp);%0A    %7D%0A%0A
 %7D%0A

Implement add method for TreatmentProtocols