package com.yihu.jw.entity.patient;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.iot.gateway.IdEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 患者信息
 *
 * @author George
 */

@Entity
@Table(name = "wlyy_patient")
public class Patient extends IdEntity implements Serializable {


    /**
     *
     */
    private static final long serialVersionUID = 8358924836164389434L;

    // 业务主键
    private String code;
    // 身份证号
    private String idcard;
    // 登录密码
    private String password;
    private String salt;
    // 姓名
    private String name;
    // 生日
    private Date birthday;
    // 性別，1男，2女
    private Integer sex;
    // 手機號
    private String mobile;
    // （基卫）手機號
    private String mobileRemarks;
    // 聯繫電話
    private String phone;
    // 社保卡號
    private String ssc;
    // 頭像HTTP地址
    private String photo;
    // 省代碼
    private String province;
    // 城市代碼
    private String city;
    // 區縣代碼
    private String town;
    // 街道代码
    private String street;
    // 省名
    private String provinceName;
    // 市名
    private String cityName;
    // 區縣名
    private String townName;
    // 街道名称
    private String streetName;
    // 地址
    private String address;
    // 疾病类型，0健康，1高血压，2糖尿病，3高血压+糖尿病
    private Integer disease;
    // 病情：0绿标，1黄标，2红标
    private Integer diseaseCondition;
    // 病历记录总数
    private Integer recordAmount;
    // 總積分
    private Integer points;
    // 更新時間
    private Date czrq;
    // 微信编号
    private String openid;
    //微信时间
    private Date openidTime;
    // 用户状态：1正常，0禁用，-1恶意注册，2审核中
    private Integer status;
    // 居委会字段id
    private String sickVillage;
    // 居委会字段名称
    private String sickVillageName;
    //	绑定电子社保卡主体（本人为本人code，共济为操作人code）
    private String principalCode;
    //	是否绑定电子社保卡
    private Integer sicardStatus;
    //	绑定电子社保卡时间
    private Date sicardTime;
    //是否分配过微信标签  1分配过 0或者空没有
    private Integer isWxtag;
    //微信iagId
    private Integer wxtagid;
    //居民预警状态：0为标准，1为预警状态
    private Integer standardStatus;
    //医疗保险号
    private String medicareNumber;
    //微信开发平台唯一标识
    private String unionid;
    //统一身份认证状态
    private Integer isCertified;//0否，1 是
    //档案状态（-2冻结 1未管理 2死亡3 正常4 高危）
    private Integer archiveStatus;

    private String shopUserId;
    //是否为游客 1是，0否
    private Integer isVisitor;
    //外部数据-年龄数据
    private Integer age;

    private Integer isRehabilition;//

    @Transient
    public Integer getAge() {
        return age;
    }

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

    public String getPrincipalCode() {
        return principalCode;
    }

    public void setPrincipalCode(String principalCode) {
        this.principalCode = principalCode;
    }

    public Integer getSicardStatus() {
        return sicardStatus;
    }

    public void setSicardStatus(Integer sicardStatus) {
        this.sicardStatus = sicardStatus;
    }

    public Date getSicardTime() {
        return sicardTime;
    }

    public void setSicardTime(Date sicardTime) {
        this.sicardTime = sicardTime;
    }

//    private List<SignPatientLabelInfo> labelInfos = new ArrayList<>();//患者的疾病标签list

    public Patient() {
    }

    public Patient(Long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getIdcard() {
        return idcard;
    }

    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getSsc() {
        return ssc;
    }

    public void setSsc(String ssc) {
        this.ssc = ssc;
    }

    @Column(name = "photo", insertable = false)
    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getTown() {
        return town;
    }

    public void setTown(String town) {
        this.town = town;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    @Column(name = "province_name")
    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    @Column(name = "city_name")
    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    @Column(name = "town_name")
    public String getTownName() {
        return townName;
    }

    public void setTownName(String townName) {
        this.townName = townName;
    }

    @Column(name = "street_name")
    public String getStreetName() {
        return streetName;
    }

    public void setStreetName(String streetName) {
        this.streetName = streetName;
    }

    public static long getSerialversionuid() {
        return serialVersionUID;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getDisease() {
        return disease;
    }

    public void setDisease(Integer disease) {
        this.disease = disease;
    }

    @Column(name = "disease_condition")
    public Integer getDiseaseCondition() {
        return diseaseCondition;
    }

    public void setDiseaseCondition(Integer diseaseCondition) {
        this.diseaseCondition = diseaseCondition;
    }

    @Column(name = "record_amount")
    public Integer getRecordAmount() {
        return recordAmount;
    }

    public void setRecordAmount(Integer recordAmount) {
        this.recordAmount = recordAmount;
    }

    public Integer getPoints() {
        return points;
    }

    public void setPoints(Integer points) {
        this.points = points;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCzrq() {
        return czrq;
    }

    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }


    public Integer getStatus() {
        return status;
    }

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

//    @Transient
//    public List<SignPatientLabelInfo> getLabelInfos() {
//        return labelInfos;
//    }
//
//    public void setLabelInfos(List<SignPatientLabelInfo> labelInfos) {
//        this.labelInfos = labelInfos;
//    }

    public String getMobileRemarks() {
        return mobileRemarks;
    }

    public void setMobileRemarks(String mobileRemarks) {
        this.mobileRemarks = mobileRemarks;
    }

    public Date getOpenidTime() {
        return openidTime;
    }

    public void setOpenidTime(Date openidTime) {
        this.openidTime = openidTime;
    }

    public String getSickVillage() {
        return sickVillage;
    }

    public void setSickVillage(String sickVillage) {
        this.sickVillage = sickVillage;
    }

    public String getSickVillageName() {
        return sickVillageName;
    }

    public void setSickVillageName(String sickVillageName) {
        this.sickVillageName = sickVillageName;
    }

    public Integer getIsWxtag() {
        return isWxtag;
    }

    public void setIsWxtag(Integer isWxtag) {
        this.isWxtag = isWxtag;
    }

    public Integer getWxtagid() {
        return wxtagid;
    }

    public void setWxtagid(Integer wxtagid) {
        this.wxtagid = wxtagid;
    }

    @Column(name = "is_visitor")
    public Integer getIsVisitor() {
        return isVisitor;
    }

    public void setIsVisitor(Integer isVisitor) {
        this.isVisitor = isVisitor;
    }

    public Integer getIsRehabilition() {
        return isRehabilition;
    }

    public void setIsRehabilition(Integer isRehabilition) {
        this.isRehabilition = isRehabilition;
    }

    //---------------------------常量----------------------------
    public enum isWchatTage {
        yes(1), no(0);

        isWchatTage(Integer value) {
            this.value = value;
        }

        private Integer value;

        public Integer getValue() {
            return value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }
    }

    public Integer getStandardStatus() {
        return standardStatus;
    }

    public void setStandardStatus(Integer standardStatus) {
        this.standardStatus = standardStatus;
    }

    public Patient(String code, String name) {
        this.code = code;
        this.name = name;
    }
    public Patient(String code) {
        this.code = code;
    }

    public String getMedicareNumber() {
        return medicareNumber;
    }

    public void setMedicareNumber(String medicareNumber) {
        this.medicareNumber = medicareNumber;
    }

    public String getUnionid() {
        return unionid;
    }

    public void setUnionid(String unionid) {
        this.unionid = unionid;
    }

    public Integer getIsCertified() {
        return isCertified;
    }

    public void setIsCertified(Integer isCertified) {
        this.isCertified = isCertified;
    }

    public Integer getArchiveStatus() {
        return archiveStatus;
    }

    public void setArchiveStatus(Integer archiveStatus) {
        this.archiveStatus = archiveStatus;
    }

    public String getShopUserId() {
        return shopUserId;
    }

    public void setShopUserId(String shopUserId) {
        this.shopUserId = shopUserId;
    }
}