package cn.iocoder.yudao.module.system.dal.dataobject.biz;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

/**
 * 长者信息表
 *
 * @author Administrator
 */
@Data
@TableName("elderly_info")
public class ElderlyInfoDO implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private String elderImage;
    /**
     * 封面图
     */
    private String elderCover;
    private String elderName;
    private Integer elderSex;
    private Integer elderAge;
    private BigDecimal elderHeight;
    private BigDecimal elderWeight;
    private String elderBlood;
    private String region;
    private String address;
    private Long salesUserId;
    private String userSign;
    private String createBy;
    private Date createTime;
    private String updateBy;
    private Date updateTime;
    private String contractNumber;
    private String censusRegister;
    private String idCard;
    private String bloodType;
    private String nationId;
    private String political;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date birthday;
    private String telPhone;
    private String economySource;
    private String religiousBelief;
    private String homeTel;
    private String mediaChannels;
    private String businessType;
    private String medicalInsurance;
    private Integer degreeEducation;
    private Integer maritalStatus;
    private Integer elderType;
    private Integer formSupply;
    private String retirementUnit;
    private Integer paymentMethod;
    private String refereeName;
    private Long refereeId;
    private Long refereePay;
    private String allergicDrug;
    /**
     * 能力评估
     */
    private String ocac;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date checkInTime;


    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date checkOutTime;

    private LocalDateTime settleDate;
    /**
     * 入住状态：0未住,1已入住,2.退住
     */
    private Integer inStatus;
    private Long nurseLevelId;
    private String nurseLevelName;
    private Long nurseGroupId;
    private String nurseGroupName;
    private Long buildId;

    private String buildName;
    private Long floorId;

    private String floorName;
    private Long roomId;
    private String roomName;
    private Long bedId;
    private String bedName;
    /**
     * 残疾情况
     */
    private String disability;
    /**
     * 过敏药物
     */
    private String drugAllergy;


    private BigDecimal inDeposit;
    /**
     * 可进入设备
     */
    private String machineIds;

    /**
     * 档案号
     */
    private String fileNumber;
    /**
     * 所属类型,1.机构 2.家庭 3.旅居等等
     */
    private Integer sourceType;
    /**
     * 入住类别 1.入住  2.试住 3.短住
     */
    private Integer inStatusType;

    /**
     * 身份证类型
     */
    private Integer papersType;
    /**
     * 身份证地址
     */
    private String papersAddress;
    /**
     * 语言
     */
    private String language;
    /**
     * 社会保障卡号
     */
    private String socialSecurityCardNumber;

    /**
     * 参保地
     */
    private String insuredPlace;

    /**
     * 是否残疾
     */
    private Integer whetherDisabled;

    /**
     * 退休金
     */
    private BigDecimal pension;

    /**
     * 退休时间
     */
    private Date retirementTime;

    /**
     * 长者文件
     */
    private String elderFiles;

    /**
     * 托养人文件
     */
    private String custodianFiles;

    /**
     * 其他文件
     */
    private String otherFiles;

    /**
     * 是否包房
     */
    private Integer isPrivateRoom;

    /**
     * 特殊护理备注
     */
    private String specialCareNotes;

    /**
     * 长者标签
     */
    private String elderTags;

    /**
     * 租户id
     */
    private Long tenantId;

    /**
     * 生日关怀日期
     */
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate birthdayCareDate;

    /**
     * 生日关怀农历日期
     */
    private String chineseCalendar;

    /**
     * 是否是农历日期，0: 否 1：是
     */
    private Integer isLunarCalendar;


    /**
     * 关联人
     */
    private String affiliatedPerson;

    /**
     * 关联说明
     */
    private String associationExplanation;

    /**
     * 在院状态 0：外出 1：在院
     */
    private Integer inHospitalStatus;

    /**
     * 系统类型
     */
    private Integer orgType;


    /**
     * 金蝶客户id
     */
    private String customerid;


    /**
     * 健康随访等级ID
     */
    private Long followUpConfigId;



    @Schema(description = "服务联系人")
    private String serviceContact;

    @Schema(description = "服务人联系方式")
    private String contactPhone;

    @Schema(description = "省份")
    private String province;

    @Schema(description = "省份ID", example = "6463")
    private Integer provinceId;

    @Schema(description = "城市ID", example = "12841")
    private Integer cityId;

    @Schema(description = "城市")
    private String city;

    @Schema(description = "区域ID", example = "13256")
    private Integer areaId;

    @Schema(description = "区域")
    private String area;

    @Schema(description = "服务地址")
    private String serviceAddress;

    @Schema(description = "经度")
    private String longitude;

    @Schema(description = "纬度")
    private String latitude;

    @Schema(description = "服务环境")
    private String serviceEnvironment;

    @Schema(description = "服务备注")
    private String remarks;

    @Schema(description = "服务对象状态", example = "2")
    private Integer serviceStatus;

    @Schema(description = "长护等级")
    private Integer longCareGrade;

    private String liveSituation;

    /**
     * 是否删除 1：已删除，0：未删除
     */
    @TableLogic
    private Boolean deleted;


    private String kingdeeCustomerId;

    private String kingdeeCustomerNumber;

    @Schema(description = "户籍地址")
    private String registeredResidenceAddress;

    // 照护类型，1：供养，2：寄养，3：托养
    @Schema(description = "照护类型")
    private Integer careType;

    @Schema(description = "入院编号")
    private String admissionNumber;



    //=========================扩展字段=======================================================

    /**
     * 老人码（临时字段）
     */
    @TableField(exist = false)
    private String patientCode;
    /**
     * 老人生日（临时字段）
     */
    @TableField(exist = false)
    private String birthdayStr;

    /**
     * 居住情况
     */


    /**
     * 扩展字段 不是数据库字段
     */
//    private InstitutionCustomerInfoEntity institutionCustomerInfo;

    @TableField(exist = false)
    private List<RelativesDO> relativesList;

    /**
     * 信息完整度百分比
     */
    @TableField(exist = false)
    private Integer infoPercentage;
    /**
     * 填写数量
     */
    @TableField(exist = false)
    private Integer infoFieldCount;
    /**
     * 字段总数量
      */
    @TableField(exist = false)
    private Integer totalInfoFieldCount;

//    @TableField(exist = false)
//    private Map<String, Object> dataMap;
//    @TableField(exist = false)
//    private String humidity = "0"; //湿度
//    @TableField(exist = false)
//    private String temperature = "0"; //温度

    //    @TableField(exist = false)
//    private SleepReport2 sleepReport;
//    @TableField(exist = false)
//    private ElderlyInfoExtend extend;
//    @TableField(exist = false)
//    private List<Relatives> relatives = new ArrayList<>();
//    @TableField(exist = false)
//    private Integer totalCount;   //总设备数
//    @TableField(exist = false)
//    private Integer onlineCount;  //在线设备数

    /**
     * 高压mmHg
     */
    @TableField(exist = false)
    private Integer mmHg1 = 0;
    /**
     * 低压mmHg
     */
    @TableField(exist = false)
    private Integer mmHg2 = 0;

    /**
     * 血糖
     */
    @TableField(exist = false)
    private Double bloodGlucose = 0d;

    /**
     * 心率
     */
    @TableField(exist = false)
    private Integer heartRate = 0;

    /**
     * 步数
     */
    @TableField(exist = false)
    private Integer realityStep = 0;

    /**
     * 是否在家，0：离家，1:：在家
     */
    @TableField(exist = false)
    private Integer residentialStatus = 1;

    /**
     * 报警开关，0：未设置，1:：已设置
     */
//    @TableField(exist = false)
//    private Integer alarmSwitch = 1;
//
//    @TableField(exist = false)
//    private String familiarIllness;
//    @TableField(exist = false)
//    private String nnd;
//
//    @TableField(exist = false)
//    private Integer saleStatus;
//    @TableField(exist = false)
//    private String deviceMac;

    /**
     * 入住天数
     */
    @TableField(exist = false)
    private Integer stayDay = 0;

    /**
     * 入住次数
     */
    @TableField(exist = false)
    private Integer stayNumber = 1;


    @TableField(exist = false)
    private Integer bpmStatus;


    @TableField(exist = false)
    private String processInstanceId;

    @TableField(exist = false)
    private Integer photoCount;

    @TableField(exist = false)
    private Date photoLastUpdateDate;

    @TableField(exist = false)
    private String tenantName;

//    @TableField(exist = false)
//    private ElderlyInfoExtend elderlyInfoExtend;
}
