package com.example.bean;

import java.sql.Timestamp;

public class DailyReport {

    private int dailyreportid;
    private String uid;
    private int age;
    private double height;
    private double weight;
    private double temperature;
    private int lowpressure;
    private int highpressure;
    private int error;
    private int heartRate;
    private Timestamp date;
    private boolean covidTest;

    public boolean errorCheck()//检查报告是否异常
    {
        if(highpressure > 140 || highpressure < 90 ||
                lowpressure > 90 || lowpressure < 60 ||
                heartRate > 100 || heartRate < 60 ||
                temperature > 37.3 ||
                covidTest == true)
            error = 1;
        else
            error = 0;
        return false;//false表示没有错，true表示有错
    }

    public int getDailyreportid() {
        return dailyreportid;
    }

    public void setDailyreportid(int dailyreportid) {
        this.dailyreportid = dailyreportid;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public int getAge() {
        return age;
    }

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

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public double getTemperature() {
        return temperature;
    }

    public void setTemperature(double temperature) {
        this.temperature = temperature;
    }

    public int getLowpressure() {
        return lowpressure;
    }

    public void setLowpressure(int lowpressure) {
        this.lowpressure = lowpressure;
    }

    public int getHighpressure() {
        return highpressure;
    }

    public void setHighpressure(int highpressure) {
        this.highpressure = highpressure;
    }

    public int getError() {
        return error;
    }

    public void setError(int error) {
        this.error = error;
    }

    public int getHeartRate() {
        return heartRate;
    }

    public void setHeartRate(int heartRate) {
        this.heartRate = heartRate;
    }

    public Timestamp getDate() {
        return date;
    }

    public void setDate(Timestamp date) {
        this.date = date;
    }

    public boolean isCovidTest() {
        return covidTest;
    }

    public void setCovidTest(boolean covidTest) {
        this.covidTest = covidTest;
    }

    @Override
    public String toString() {
        return "DailyReport{" +
                "dailyreportid=" + dailyreportid +
                ", uid='" + uid + '\'' +
                ", age=" + age +
                ", height=" + height +
                ", weight=" + weight +
                ", temperature=" + temperature +
                ", lowpressure=" + lowpressure +
                ", highpressure=" + highpressure +
                ", error=" + error +
                ", heartRate=" + heartRate +
                ", date=" + date +
                ", covidTest=" + covidTest +
                '}';
    }
}
