/**
 * FPT University Capstone Project 2015.
 * Program: HSTS.
 * Program manager: Kieu Trong Khanh.
 * Author: dangquantran.
 * Date: 9/23/2015.
 */
package vn.edu.fpt.hsts.persistence.entity;

import vn.edu.fpt.hsts.common.jpa.AbstractKeyEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import java.util.Date;
import java.util.List;

/**
 * The Appointment entity.
 */
@Entity
public class Appointment extends AbstractKeyEntity {

    /**
     * The medical record.
     */
    @ManyToOne
    @JoinColumn(name ="medicalRecordId", nullable = false)
    private MedicalRecord medicalRecord;

    /**
     * The meeting date.
     */
    @Column(name = "appointmentDateTime")
    private Date meetingDate;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "appointment")
    private List<Treatment> treatmentList;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "appointment")
    private List<PreventionCheck> preventionCheckList;
    /**
     *
     */
    @OneToOne
    @JoinColumn(name = "nextAppointment")
    private Appointment nextAppointment;

    /**
     * The status.
     */
    private byte status;

    /**
     *
     */
    private int bloodPressure;

    /**
     *
     */
    private int heartBeat;

    /**
     *
     */
    private int waists;

    public Appointment() {
    }

    public List<PreventionCheck> getPreventionCheckList() {
        return preventionCheckList;
    }

    public void setPreventionCheckList(List<PreventionCheck> preventionCheckList) {
        this.preventionCheckList = preventionCheckList;
    }

    public Date getMeetingDate() {
        return meetingDate;
    }

    public void setMeetingDate(final Date meetingDate) {
        this.meetingDate = meetingDate;
    }

    public byte getStatus() {
        return status;
    }

    public void setStatus(final byte status) {
        this.status = status;
    }

    public MedicalRecord getMedicalRecord() {
        return medicalRecord;
    }

    public void setMedicalRecord(final MedicalRecord medicalRecord) {
        this.medicalRecord = medicalRecord;
    }

    public Appointment getNextAppointment() {
        return nextAppointment;
    }

    public void setNextAppointment(final Appointment nextAppointment) {
        this.nextAppointment = nextAppointment;
    }

    public List<Treatment> getTreatmentList() {
        return treatmentList;
    }

    public void setTreatmentList(final List<Treatment> treatmentList) {
        this.treatmentList = treatmentList;
    }

    public int getBloodPressure() {
        return bloodPressure;
    }

    public void setBloodPressure(final int bloodPressure) {
        this.bloodPressure = bloodPressure;
    }

    public int getHeartBeat() {
        return heartBeat;
    }

    public void setHeartBeat(final int heartBeat) {
        this.heartBeat = heartBeat;
    }

    public int getWaists() {
        return waists;
    }

    public void setWaists(final int waists) {
        this.waists = waists;
    }
}

@@ -1018,128 +1018,8 @@
 t;%0A%0A
-    @OneToMany(fetch = FetchType.LAZY, mappedBy = %22appointment%22)%0A    private List%3CPreventionCheck%3E preventionCheckList;%0A
     
@@ -1151,24 +1151,30 @@
     
- 
 * The 
-status
+patient height
 .%0A
- 
     
@@ -1188,27 +1188,29 @@
 private 
-byte status
+double height
 ;%0A%0A    /
@@ -1210,32 +1210,52 @@
 %0A%0A    /**%0A     *
+ The patient weight.
 %0A     */%0A    pri
@@ -1259,33 +1259,29 @@
 private 
-int bloodPressure
+double weight
 ;%0A%0A    /
@@ -1281,32 +1281,44 @@
 %0A%0A    /**%0A     *
+ The status.
 %0A     */%0A    pri
@@ -1322,29 +1322,27 @@
 private 
-int heartBeat
+byte status
 ;%0A%0A    /
@@ -1379,293 +1379,149 @@
 int 
-waists;%0A%0A    public Appointment() %7B
+bloodPressure;%0A%0A    /**%0A     *
 %0A    
-%7D%0A
+ */
 %0A    p
-ublic List%3CPreventionCheck%3E getPreventionCheckList() %7B%0A        return preventionCheckList;
+rivate int heartBeat;%0A%0A    /**%0A     *
 %0A    
-%7D%0A
+ */
 %0A    p
-ublic void setPreventionCheckList(List%3CPreventionCheck%3E preventionCheckList) %7B%0A        this.preventionCheckList = preventionCheckList;
+rivate int waists;%0A%0A    public Appointment() %7B
 %0A   
@@ -2950,11 +2950,295 @@
 s;%0A    %7D
+%0A%0A    public double getHeight() %7B%0A        return height;%0A    %7D%0A%0A    public void setHeight(double height) %7B%0A        this.height = height;%0A    %7D%0A%0A    public double getWeight() %7B%0A        return weight;%0A    %7D%0A%0A    public void setWeight(double weight) %7B%0A        this.weight = weight;%0A    %7D
 %0A%7D%0A

update entity