package thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru;

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

import java.util.Date;

/**
 * <p>
 * 描述： 住院患者
 * </p>
 *
 * @author xc
 * @date 2022-01-05 15:35
 */
@Data
public class PatientTemp {
    private String table;
    private String inpatientNo;
    private Integer admissTimes;
    private Date midSetlDate;
    private Integer ledgerSn;
    private Integer age;
    private String staffId;
    private String socialNo;
    private String name;
    private Integer sex;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthDate;
    private String homeTel;
    private String admissPhysician;
    private String admissPhysicianName;
    private String referPhysician;
    private String referPhysicianName;
    private String admissDiagStr;
    private String clinicDiagStr;
    private String admissWard;
    private String admissWardName;
    private String admissDept;
    private String smallDept;
    private String smallDeptName;
    private Date admissDate;
    private Date ybRegisterDate;
    private String responceType;
    private Integer dismissOrder;
    private String icdCode;
    private String icdText;
    private String ybGsNo;
    private String ybCardNo;
    private String remark;
    private String inputId;
    private String inputName;
    private Date inputDate;
    private String ybRemark;
    private String passId;
    private String passName;
    private Date passDate;
    private String admissStatus;
    private String zkWard;
    private String bedNo;
    private String statusFlag;
    private String totalCharge;
    private String hicNo;
    private String cardIden;
    private String indiId;
    private String zySerialNo;
    private String ybJlh;
    private String centerId;
    private String ward;
    private String sid;
    private String disDiagStatus;
    private String operation;
    private String chargeYb;
    private Boolean midSetl; // 中间断账标志
    private Date zjdzDatetime; // 中间断账时间
    private Date dismissOrderDate; // 口腔科生成出院医嘱的出院时间
    private String medType;
    private String admdvs;
    private String matnType; // 生育类别
    private String latechbFlag; // 是否晚育
    private String pretFlag; // 是否早产
    private String mdtrtId;
    private String responceTypeName;
    private String actIptDays; // 入院时间
    /**
     * 患者居住地
     */
    private String homeStreet;

    /**
     * 是否有出纳
     */
    private Integer timesBilled;

    private String yp;
    private String jyjc;
    private String yb;
    // 余额
    private String balance;

    public String getSexName() {
        if (sex == null) {
            return "";
        }
        switch (sex) {
            case 1:
                return "男";
            case 2:
                return "女";
            default:
                return "未知";
        }
    }

    public Boolean getMidSetl() {
        return null != midSetl && midSetl;
    }

    public String getTable() {
        return null == table ? "zy_actpatient" : (table).trim();
    }

    public String mainInfo() {
        return "姓名：" + name + "，住院号：" + inpatientNo + "，住院次数：" + admissTimes;
    }
}
