package thyyxxk.webserver.entity.zhuyuanyisheng.emr;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class DischargedEmrModifyApply implements Serializable {
    // 出院患者是否可以编辑

    private static final long serialVersionUID = 5582662383769602062L;

    /**
     * 使用住院号和住院次数拼接例如:040121_1
     */
    private String patNo;

    /**
     * 申请备注  0416587
     */
    private String reqRemarks;

    /**
     * 申请状态 0-默认值 1-通过 2-拒绝
     */
    private Integer reqStatus;

    /**
     * 申请人
     */
    private String reqId;
    private String reqName;

    /**
     * 可以编辑的时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;

    /**
     * 审核备注
     */
    private String reviewNotes;

    /**
     * 创建时间
     */
    private Date creationTime;

    public String getReqStatusName() {
        if (reqStatus == null) {
            return "";
        }
        switch (reqStatus) {
            case 0:
                return "待审";
            case 1:
                return "通过";
            case 2:
                return "拒绝";
            default:
                return "";
        }
    }

    public String getReqStatusHtml() {
        if (reqStatus == null) {
            return "";
        }
        switch (reqStatus) {
            case 0:
                return "<span style='color: white;padding: 5px;background-color: #909399'>待审</span>";
            case 1:
                return "<span style='color: white;padding: 5px;background-color: #67C23A'>通过</span>";
            case 2:
                return "<span style='color: white;padding: 5px;background-color: #F56C6C'>拒绝</span>";
            default:
                return "";
        }
    }

}
