package com.xinelu.manage.domain.department;

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.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.time.LocalDate;

/**
 * 科室信息对象 department
 *
 * @author xinelu
 * @date 2024-02-26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "科室信息对象", description = "department")
public class Department extends BaseEntity {
    private static final long serialVersionUID = 1L;

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

    /**
     * 上级科室id
     */
    @ApiModelProperty(value = "上级科室id")
    @Excel(name = "上级科室id")
    private Long parentDepartmentId;

    /**
     * 所属机构id
     */
    @ApiModelProperty(value = "所属机构id")
    @Excel(name = "所属机构id")
    private Long hospitalAgencyId;

    /**
     * 所属机构名称
     */
    @ApiModelProperty(value = "所属机构名称")
    @Excel(name = "所属机构名称")
    private String hospitalAgencyName;

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

    /**
     * 科室代码
     */
    @ApiModelProperty(value = "科室代码")
    @Excel(name = "科室代码")
    private String departmentCode;

    /**
     * 科室类型
     */
    @ApiModelProperty(value = "科室类型")
    @Excel(name = "科室类型")
    private String departmentType;

    /**
     * 科室简称
     */
    @ApiModelProperty(value = "科室简称")
    @Excel(name = "科室简称")
    private String departmentAbbreviation;

    /**
     * 科室负责人id
     */
    @ApiModelProperty(value = "科室负责人id")
    @Excel(name = "科室负责人id")
    private Long departmentPersonId;

    /**
     * 科室负责人姓名
     */
    @ApiModelProperty(value = "科室负责人姓名")
    @Excel(name = "科室负责人姓名")
    private String departmentPersonName;

    /**
     * 节点类型，科室：DEPARTMENT，病区：WARD，
     */
    @ApiModelProperty(value = "节点类型，科室：DEPARTMENT，病区：WARD")
    @Excel(name = "节点类型，科室：DEPARTMENT，病区：WARD")
    private String nodeType;

    /**
     * 提供服务类别，门诊：OUTPATIENT_SERVICE，急诊：EMERGENCY_TREATMENT，住院：BE_HOSPITALIZED，病区：WARD，医技：MEDICAL_TECHNOLOGY，
     * 药剂：DRUG，财务：FINANCE，行政：ADMINISTRATION，药房：PHARMACY，药库：DRUG_STORAGE，公卫：PUBLIC_HEALTH
     */
    @ApiModelProperty(value = "提供服务类别，门诊：OUTPATIENT_SERVICE，急诊：EMERGENCY_TREATMENT，住院：BE_HOSPITALIZED，病区：WARD，医技：MEDICAL_TECHNOLOGY，药剂：DRUG，财务：FINANCE，行政：ADMINISTRATION，药房：PHARMACY，药库：DRUG_STORAGE，公卫：PUBLIC_HEALTH")
    @Excel(name = "提供服务类别，门诊：OUTPATIENT_SERVICE，急诊：EMERGENCY_TREATMENT，住院：BE_HOSPITALIZED，病区：WARD，医技：MEDICAL_TECHNOLOGY， 药剂：DRUG，财务：FINANCE，行政：ADMINISTRATION，药房：PHARMACY，药库：DRUG_STORAGE，公卫：PUBLIC_HEALTH")
    private String provideServiceCategory;

    /**
     * 细分类别id
     */
    @ApiModelProperty(value = "细分类别id")
    @Excel(name = "细分类别id")
    private Long subdivisionCategoryId;

    /**
     * 细分类别名称
     */
    @ApiModelProperty(value = "细分类别名称")
    @Excel(name = "细分类别名称")
    private String subdivisionCategoryName;

    /**
     * 标准科室对照id
     */
    @ApiModelProperty(value = "标准科室对照id")
    @Excel(name = "标准科室对照id")
    private Long normDepartmentCompareId;

    /**
     * 标准科室对照名称
     */
    @ApiModelProperty(value = "标准科室对照名称")
    @Excel(name = "标准科室对照名称")
    private String normDepartmentCompareName;

    /**
     * 编制床位数
     */
    @ApiModelProperty(value = "编制床位数")
    @Excel(name = "编制床位数")
    private Integer prepareBedsCount;

    /**
     * 科室电话
     */
    @ApiModelProperty(value = "科室电话")
    @Excel(name = "科室电话")
    private String departmentPhone;

    /**
     * 科室邮箱
     */
    @ApiModelProperty(value = "科室邮箱")
    @Excel(name = "科室邮箱")
    private String departmentMail;

    /**
     * 成立日期
     */
    @ApiModelProperty(value = "成立日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate establishDate;

    /**
     * 撤销日期
     */
    @ApiModelProperty(value = "撤销日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate revokeDate;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("parentDepartmentId", getParentDepartmentId())
                .append("hospitalAgencyId", getHospitalAgencyId())
                .append("hospitalAgencyName", getHospitalAgencyName())
                .append("departmentName", getDepartmentName())
                .append("departmentCode", getDepartmentCode())
                .append("departmentType", getDepartmentType())
                .append("departmentAbbreviation", getDepartmentAbbreviation())
                .append("departmentPersonId", getDepartmentPersonId())
                .append("departmentPersonName", getDepartmentPersonName())
                .append("nodeType", getNodeType())
                .append("provideServiceCategory", getProvideServiceCategory())
                .append("subdivisionCategoryId", getSubdivisionCategoryId())
                .append("subdivisionCategoryName", getSubdivisionCategoryName())
                .append("normDepartmentCompareId", getNormDepartmentCompareId())
                .append("normDepartmentCompareName", getNormDepartmentCompareName())
                .append("prepareBedsCount", getPrepareBedsCount())
                .append("departmentPhone", getDepartmentPhone())
                .append("departmentMail", getDepartmentMail())
                .append("establishDate", getEstablishDate())
                .append("revokeDate", getRevokeDate())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
