package net.heartshield.data;

import net.heartshield.util.JsonUtil;

/**
 * Detail notes of doctors regarding a Measurement.
 *
 * @author David Madl (git@abanbytes.eu)
 * @date 2017-06-05
 */
public class DoctorDetails {
    /** change time in UTC seconds since the Unix epoch (Unix timestamp) */
    public long time;

    public boolean smoker;
    public boolean diabetes;
    public boolean hypertension;
    public boolean cvd;
    public boolean no_cvd;
    public boolean no_afib;
    public boolean afib_sin;
    public boolean afib_now;
    public boolean no_cad;
    public boolean cad_lt70;
    public boolean cad_gt70;
    public boolean betablocker;
    public boolean antiarrhythmic;
    public boolean antihypertensive;

    public String bp_sys;
    public String bp_dia;
    public String chol_hdl;
    public String chol_total;
    public String other_med;
    public String other_diag;

    /** happiness rating on a 0-100 scale slider. 0 is invalid. */
    public Integer happiness;
    /** sleep quality rating on a 0-100 scale slider. 0 is invalid. */
    public Integer sleep_quality;

    public String serialize() {
        return JsonUtil.getGson().toJson(this);
    }

    public static DoctorDetails deserialize(String json) {
        return JsonUtil.getGson().fromJson(json, DoctorDetails.class);
    }

}
