package org.pdxfinder.dao;

import java.util.HashSet;

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

import java.util.Set;

/**
 * Created by jmason on 16/03/2017.
 */
@NodeEntity
public class PatientSnapshot {

    @GraphId
    private Long id;

    private Patient patient;
    private String age;
    private String dateAtCollection;

    @Relationship(type = "SAMPLED_FROM")
    private Set<Sample> samples;

    @Relationship(type = "TREATED_WITH", direction = Relationship.INCOMING)
    private Set<Treatment> treatments;

    public PatientSnapshot() {
    }

    public PatientSnapshot(Patient patient, String age) {
        this.patient = patient;
        this.age = age;
    }

    public PatientSnapshot(Patient patient, String age, Set<Sample> samples) {
        this.patient = patient;
        this.age = age;
        this.samples = samples;
    }

    public PatientSnapshot(Patient patient, String age, Set<Sample> samples, Set<Treatment> treatments) {
        this.patient = patient;
        this.age = age;
        this.samples = samples;
        this.treatments = treatments;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public Set<Sample> getSamples() {
        return samples;
    }

    public void setSamples(Set<Sample> samples) {
        this.samples = samples;
    }
    
    public void addSample(Sample sample){
        if(this.samples == null){
            this.samples = new HashSet<>();
        }
        this.samples.add(sample);
    }

    public Patient getPatient() {
        return patient;
    }

    public void setPatient(Patient patient) {
        this.patient = patient;
    }

    public Set<Treatment> getTreatments() {
        return treatments;
    }

    public void setTreatments(Set<Treatment> treatments) {
        this.treatments = treatments;
    }

    public String getDateAtCollection() {
        return dateAtCollection;
    }

    public void setDateAtCollection(String dateAtCollection) {
        this.dateAtCollection = dateAtCollection;
    }
}

@@ -415,16 +415,52 @@
 lection;
+%0A    private Boolean treatmentNaive;
 %0A%0A    @R
@@ -2205,11 +2205,203 @@
 n;%0A    %7D
+%0A%0A    public Boolean getTreatmentNaive() %7B%0A        return treatmentNaive;%0A    %7D%0A%0A    public void setTreatmentNaive(Boolean treatmentNaive) %7B%0A        this.treatmentNaive = treatmentNaive;%0A    %7D
 %0A%7D%0A

Add treatmentNaive attribute