package com.phlx.anchorcollect_p.entity;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.databinding.BaseObservable;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

/**
 * 诊疗记录对象 zxgl_medicalrecords
 *
 * @author phlx
 * @date 2022-01-10
 */
@Entity
public class MedicalRecordEntity extends BaseObservable implements Parcelable {

    /**
     * 自增列
     */
    @Id(autoincrement = false)
    private Long unid;

    /**
     * 基本信息ID
     */
    private Long cattleresumeId;

    /**
     * 诊疗日期
     */
    private String treatDate;

    /**
     * 治疗人员
     */
    private String treatPersonnel;

    /**
     * 病因
     */
    private String causeOf;

    /**
     * 用药名称
     */
    private String drugName;

    /**
     * 规格
     */
    private String specifications;

    /**
     * 用药方法
     */
    private String drugMethods;

    /**
     * 用药数量
     */
    private Double drugNumber;

    /**
     * 诊疗结果
     */
    private String results;

    /** 是否上传 0未上传，1已上传 */
    private String uploadStatus;

    /**
     * 部门id
     */
    private Long deptId;

    /** 搜索值 */
    private String searchValue;

    /** 创建者 */
    private String createBy;

    /** 创建时间 */
    private String createTime;

    /** 更新者 */
    private String updateBy;

    /** 更新时间 */
    private String updateTime;

    /** 备注 */
    private String remark;

    public MedicalRecordEntity() {
    }

    protected MedicalRecordEntity(Parcel in) {
        if (in.readByte() == 0) {
            unid = null;
        } else {
            unid = in.readLong();
        }
        if (in.readByte() == 0) {
            cattleresumeId = null;
        } else {
            cattleresumeId = in.readLong();
        }
        treatDate = in.readString();
        treatPersonnel = in.readString();
        causeOf = in.readString();
        drugName = in.readString();
        specifications = in.readString();
        drugMethods = in.readString();
        if (in.readByte() == 0) {
            drugNumber = null;
        } else {
            drugNumber = in.readDouble();
        }
        results = in.readString();
        uploadStatus = in.readString();
        if (in.readByte() == 0) {
            deptId = null;
        } else {
            deptId = in.readLong();
        }
        searchValue = in.readString();
        createBy = in.readString();
        createTime = in.readString();
        updateBy = in.readString();
        updateTime = in.readString();
        remark = in.readString();
    }

    @Generated(hash = 119879249)
    public MedicalRecordEntity(Long unid, Long cattleresumeId, String treatDate, String treatPersonnel,
            String causeOf, String drugName, String specifications, String drugMethods,
            Double drugNumber, String results, String uploadStatus, Long deptId, String searchValue,
            String createBy, String createTime, String updateBy, String updateTime, String remark) {
        this.unid = unid;
        this.cattleresumeId = cattleresumeId;
        this.treatDate = treatDate;
        this.treatPersonnel = treatPersonnel;
        this.causeOf = causeOf;
        this.drugName = drugName;
        this.specifications = specifications;
        this.drugMethods = drugMethods;
        this.drugNumber = drugNumber;
        this.results = results;
        this.uploadStatus = uploadStatus;
        this.deptId = deptId;
        this.searchValue = searchValue;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
        this.remark = remark;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (unid == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(unid);
        }
        if (cattleresumeId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(cattleresumeId);
        }
        dest.writeString(treatDate);
        dest.writeString(treatPersonnel);
        dest.writeString(causeOf);
        dest.writeString(drugName);
        dest.writeString(specifications);
        dest.writeString(drugMethods);
        if (drugNumber == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeDouble(drugNumber);
        }
        dest.writeString(results);
        dest.writeString(uploadStatus);
        if (deptId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(deptId);
        }
        dest.writeString(searchValue);
        dest.writeString(createBy);
        dest.writeString(createTime);
        dest.writeString(updateBy);
        dest.writeString(updateTime);
        dest.writeString(remark);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<MedicalRecordEntity> CREATOR = new Creator<MedicalRecordEntity>() {
        @Override
        public MedicalRecordEntity createFromParcel(Parcel in) {
            return new MedicalRecordEntity(in);
        }

        @Override
        public MedicalRecordEntity[] newArray(int size) {
            return new MedicalRecordEntity[size];
        }
    };

    public Long getUnid() {
        return unid;
    }

    public void setUnid(Long unid) {
        this.unid = unid;
    }

    public Long getCattleresumeId() {
        return cattleresumeId;
    }

    public void setCattleresumeId(Long cattleresumeId) {
        this.cattleresumeId = cattleresumeId;
    }

    public String getTreatDate() {
        return treatDate;
    }

    public void setTreatDate(String treatDate) {
        this.treatDate = treatDate;
    }

    public String getTreatPersonnel() {
        return treatPersonnel;
    }

    public void setTreatPersonnel(String treatPersonnel) {
        this.treatPersonnel = treatPersonnel;
    }

    public String getCauseOf() {
        return causeOf;
    }

    public void setCauseOf(String causeOf) {
        this.causeOf = causeOf;
    }

    public String getDrugName() {
        return drugName;
    }

    public void setDrugName(String drugName) {
        this.drugName = drugName;
    }

    public String getSpecifications() {
        return specifications;
    }

    public void setSpecifications(String specifications) {
        this.specifications = specifications;
    }

    public String getDrugMethods() {
        return drugMethods;
    }

    public void setDrugMethods(String drugMethods) {
        this.drugMethods = drugMethods;
    }

    public Double getDrugNumber() {
        return drugNumber;
    }

    public void setDrugNumber(Double drugNumber) {
        this.drugNumber = drugNumber;
    }

    public String getResults() {
        return results;
    }

    public void setResults(String results) {
        this.results = results;
    }

    public String getUploadStatus() {
        return uploadStatus;
    }

    public void setUploadStatus(String uploadStatus) {
        this.uploadStatus = uploadStatus;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getSearchValue() {
        return searchValue;
    }

    public void setSearchValue(String searchValue) {
        this.searchValue = searchValue;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "MedicalRecordEntity{" +
                "unid='" + unid + '\'' +
                ", cattleresumeId='" + cattleresumeId + '\'' +
                ", treatDate='" + treatDate + '\'' +
                ", treatPersonnel='" + treatPersonnel + '\'' +
                ", causeOf='" + causeOf + '\'' +
                ", drugName='" + drugName + '\'' +
                ", specifications='" + specifications + '\'' +
                ", drugMethods='" + drugMethods + '\'' +
                ", drugNumber='" + drugNumber + '\'' +
                ", results='" + results + '\'' +
                ", uploadStatus='" + uploadStatus + '\'' +
                ", deptId='" + deptId + '\'' +
                ", searchValue='" + searchValue + '\'' +
                ", createBy='" + createBy + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateBy='" + updateBy + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", remark='" + remark + '\'' +
                '}';
    }
}
