package com.xinelu.manage.domain.patientinfoimport;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.time.LocalDate;
import java.util.Objects;

/**
 * 患者导入表对象 patient_info_import
 *
 * @author xinelu
 * @date 2024-11-26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "患者导入表对象", description = "patient_info_import")
public class PatientInfoImport extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    private Long id;

    /**
     * 序号
     */
    @ApiModelProperty(value = "序号")
    @Excel(name = "序号")
    private Long orderNum;

    /**
     * 科室名称（别名）
     */
    @ApiModelProperty(value = "科室名称")
    @Excel(name = "科室名称")
    private String deptAlias;

    /**
     * 就诊时间（门诊患者），时间格式：yyyy-MM-dd
     */
    @ApiModelProperty(value = "就诊时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "就诊时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDate visitDate;

    /**
     * 门诊/住院号
     */
    @ApiModelProperty(value = "门诊/住院号")
    @Excel(name = "就诊号")
    private String inHospitalNumber;

    /**
     * 患者姓名
     */
    @ApiModelProperty(value = "患者姓名")
    @Excel(name = "姓名")
    private String patientName;

    /**
     * 身份证号
     */
    @ApiModelProperty(value = "身份证号")
    @Excel(name = "身份证号")
    private String cardNo;

    /**
     * 年龄
     */
    @ApiModelProperty(value = "年龄")
    @Excel(name = "年龄")
    private Integer age;

    /**
     * 主要诊断
     */
    @ApiModelProperty(value = "主要诊断")
    @Excel(name = "诊断")
    private String mainDiagnosis;



    /**
     * 患者类型
     */
    @ApiModelProperty(value = "患者类型")
    @Excel(name = "患者类型")
    private String patientType;

    /**
     * 就诊方式
     */
    @ApiModelProperty(value = "就诊方式")
    @Excel(name = "就诊方式")
    private String visitMethod;


    /**
     * 患者电话
     */
    @ApiModelProperty(value = "患者电话")
    @Excel(name = "联系电话")
    private String patientPhone;

    /**
     * 匹配的科室ID
     */
    @ApiModelProperty(value = "匹配的科室ID")
    @Excel(name = "匹配的科室ID")
    private Long departmentId;

    /**
     * 匹配的科室名称
     */
    @ApiModelProperty(value = "匹配的科室名称")
    @Excel(name = "匹配的科室名称")
    private String departmentName;

    /**
     * 流水号
     */
    @ApiModelProperty(value = "流水号")
    @Excel(name = "流水号")
    private String sn;

    @ApiModelProperty(value = "导入人员所属机构ID")
    @Excel(name = "导入人员所属机构ID")
    private Long hospitalAgencyId;

    @ApiModelProperty(value = "所属医院名称")
    @Excel(name = "所属医院名称")
    private String hospitalAgencyName;

    private Long patientInfoImportId;

    private Long residentId;

    private Long patientInfoId;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PatientInfoImport that = (PatientInfoImport) o;
        return Objects.equals(patientName, that.patientName) && Objects.equals(patientPhone, that.patientPhone);
    }

    @Override
    public int hashCode() {
        return Objects.hash(patientName, patientPhone);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("orderNum", getOrderNum())
                .append("deptAlias", getDeptAlias())
                .append("visitDate", getVisitDate())
                .append("inHospitalNumber", getInHospitalNumber())
                .append("patientName", getPatientName())
                .append("cardNo", getCardNo())
                .append("age", getAge())
                .append("mainDiagnosis", getMainDiagnosis())
                .append("patientPhone", getPatientPhone())
                .append("departmentId", getDepartmentId())
                .append("departmentName", getDepartmentName())
                .append("sn", getSn())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .toString();
    }
}
