package thyyxxk.webserver.entity.inpatient;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
import thyyxxk.webserver.entity.inpatient.charge.ZyDepositFile;
import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ZyActpatient implements Serializable {

    private static final long serialVersionUID = 5145290750715622360L;
    //出院表
    public static final String ZY_INACTPATIENT = "zy_inactpatient";
    //在院表
    public static final String ZY_ACTPATIENT = "zy_actpatient";

    /**
     * 自费病人身份
     */
    public static final String SELF_PAYING_RESPONCE_TYPE = "01";

    private String wardName;
    private String patientId;
    /**
     * 医保类型
     */
    private String responceTypeName;
    private BigDecimal balance;
    private String wardCode;
    private String deptCode;
    private Integer ledgerSn;
    private Integer maxDetailSn;
    private String staffId;

    /**
     * 执行科室 （门 急诊转入时用的）
     */
    private String execUnit;

    /**
     * 住院天数
     */
    private String actIptDays;

    /**
     * 身份证
     */
    private String certno;
    /**
     * 参保地
     */
    private String insuplcAdmdvs;
    /**
     * 参保地名称
     */
    private String insuplcAdmdvsName;

    /**
     * 0 - 没有出院医嘱
     * 1 - 有出院医嘱
     */
    private Integer chuYuanYiZhu;

    private Integer infantFlag;

    private String reqExecUnit;

    @TableField(exist = false)
    private List<MzChargeDetail> list;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date chargeDate;

    /**
     * inpatientNo
     */
    private String inpatientNo;

    /**
     * admissTimes
     */
    private Integer admissTimes;

    /**
     * name
     */
    private String name;

    /**
     * outpatientNo
     */
    private String outpatientNo;

    /**
     * chargeType
     */
    private String chargeType;

    /**
     * visitType
     */
    private String visitType;

    /**
     * admissDate
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date admissDate;

    /**
     * admissStatus
     */
    private String admissStatus;

    /**
     * clinicDiag
     */
    private String clinicDiag;

    /**
     * admissDiag
     */
    private String admissDiag;

    /**
     * admissPhysician
     */
    private String admissPhysician;

    /**
     * 管床医生
     */
    private String referPhysician;
    private String referPhysicianName;

    /**
     * consultPhysician
     */
    private String consultPhysician;

    /**
     * deptDirector
     */
    private String deptDirector;

    /**
     * admissDept
     */
    private String admissDept;

    /**
     * admissWard
     */
    private String admissWard;

    /**
     * disDate
     */
    private Date disDate;

    /**
     * 主要诊断代码
     */
    private String disDiag;
    /**
     * 主要诊断名称
     */
    private String disDiagComment;

    /**
     * disStatus
     */
    private String disStatus;

    /**
     * disDept
     */
    private String disDept;

    /**
     * disWard
     */
    private String disWard;

    /**
     * insurCode
     */
    private String insurCode;

    /**
     * contractCode
     */
    private String contractCode;

    /**
     * 医保类型
     */
    private String responceType;

    /**
     * timesBilled
     */
    private Integer timesBilled;


    /**
     * totalCharge
     */
    private BigDecimal totalCharge;


    /**
     * ward
     */
    private String ward;

    /**
     * dept
     */
    private String dept;

    /**
     * bedNo
     */
    private String bedNo;

    /**
     * sex
     */
    private String sex;

    /**
     * bloodType
     */
    private String bloodType;

    /**
     * diagnosisDate
     */
    private Date diagnosisDate;

    /**
     * allergyMedicine
     */
    private String allergyMedicine;

    /**
     * rescueTimes
     */
    private String rescueTimes;

    /**
     * successTimes
     */
    private String successTimes;

    /**
     * followupMark
     */
    private String followupMark;

    /**
     * followupPrior
     */
    private String followupPrior;

    /**
     * autopsyMark
     */
    private String autopsyMark;

    /**
     * qualityLevel
     */
    private String qualityLevel;

    /**
     * opIdCode
     */
    private String opIdCode;

    /**
     * archiveCode
     */
    private String archiveCode;

    /**
     * archiveMark
     */
    private String archiveMark;

    /**
     * teachingMark
     */
    private String teachingMark;

    /**
     * diagnoseConform1
     */
    private String diagnoseConform1;

    /**
     * diagnoseConform2
     */
    private String diagnoseConform2;

    /**
     * diagnoseConform3
     */
    private String diagnoseConform3;

    /**
     * diagnoseConform4
     */
    private String diagnoseConform4;

    /**
     * diagnoseConform5
     */
    private String diagnoseConform5;

    /**
     * diagnoseConform6
     */
    private String diagnoseConform6;

    /**
     * diagnoseConform7
     */
    private String diagnoseConform7;

    /**
     * diagnoseConform8
     */
    private String diagnoseConform8;

    /**
     * internCode
     */
    private String internCode;

    /**
     * diagnoseConform9
     */
    private String diagnoseConform9;

    /**
     * diagnoseConform10
     */
    private String diagnoseConform10;

    /**
     * pathologyDiag
     */
    private String pathologyDiag;

    /**
     * disHour
     */
    private Date disHour;

    /**
     * admissHour
     */
    private Date admissHour;

    /**
     * capBloody
     */
    private Integer capBloody;

    /**
     * maxLedger
     */
    private Integer maxLedger;

    /**
     * admissDiagStr
     */
    private String admissDiagStr;

    /**
     * patientStatus
     */
    private String patientStatus;

    /**
     * moveFlag
     */
    private String moveFlag;

    /**
     * jzjlh
     */
    private String jzjlh;

    /**
     * zkDept
     */
    private String zkDept;

    /**
     * hbsag
     */
    private String hbsag;

    /**
     * archiveCode1
     */
    private String archiveCode1;

    /**
     * jobDoctor
     */
    private String jobDoctor;

    /**
     * jobNurse
     */
    private String jobNurse;

    /**
     * ybjy
     */
    private Double ybjy;

    /**
     * bczf
     */
    private Double bczf;

    /**
     * zflj
     */
    private Double zflj;

    /**
     * disDiagStr
     */
    private String disDiagStr;

    /**
     * ybZyh
     */
    private String ybZyh;

    /**
     * ybJzlb
     */
    private String ybJzlb;

    /**
     * yzIn
     */
    private Date yzIn;

    /**
     * yzOut
     */
    private Date yzOut;

    /**
     * ybFlag
     */
    private String ybFlag;

    /**
     * oweFlag
     */
    private String oweFlag;

    /**
     * zkWard
     */
    private String zkWard;
    private String zkWardName;

    /**
     * zkDate
     */
    private Date zkDate;

    /**
     * ybJlh
     */
    private String ybJlh;

    /**
     * ybType
     */
    private String ybType;

    /**
     * zySerialNo
     */
    private String zySerialNo;

    /**
     * mzNo
     */
    private String mzNo;

    /**
     * clinicDiagStr
     */
    private String clinicDiagStr;

    /**
     * 床位状态:1入院；2：安排；3:待出院;4:转科;5:出院9：召回
     */
    private String bedStatus;

    /**
     * inputDate
     */
    private Date inputDate;

    /**
     * ybJsffbz
     */
    private String ybJsffbz;

    /**
     * ybSylb
     */
    private String ybSylb;

    /**
     * ybZszh
     */
    private String ybZszh;

    /**
     * admissDateYb
     */
    private Date admissDateYb;

    /**
     * baReceiveFlag
     */
    private String baReceiveFlag;

    /**
     * blzkStatus
     */
    private String blzkStatus;

    /**
     * room
     */
    private String room;

    /**
     * disYb
     */
    private String disYb;

    /**
     * disYbStr
     */
    private String disYbStr;

    /**
     * ybBzfx
     */
    private String ybBzfx;

    /**
     * disRoom
     */
    private String disRoom;

    /**
     * disYb1
     */
    private String disYb1;

    /**
     * disYbStr1
     */
    private String disYbStr1;

    /**
     * disYb2
     */
    private String disYb2;

    /**
     * disYbStr2
     */
    private String disYbStr2;

    /**
     * 入院小科室
     */
    private String smallDept;
    private String smallDeptName;

    /**
     * xnhFamilysysno
     */
    private String xnhFamilysysno;

    /**
     * xnhMembersysno
     */
    private String xnhMembersysno;

    /**
     * xnhBookno
     */
    private String xnhBookno;

    /**
     * xnhCardno
     */
    private String xnhCardno;

    /**
     * xnhCmisno
     */
    private String xnhCmisno;

    /**
     * xnhZyh
     */
    private String xnhZyh;

    /**
     * xnhReferralno
     */
    private String xnhReferralno;

    /**
     * xnhRedeemType
     */
    private String xnhRedeemType;

    /**
     * xnhHasreferral
     */
    private String xnhHasreferral;

    /**
     * zyFlag
     */
    private String zyFlag;

    /**
     * xnhRejectFlag
     */
    private String xnhRejectFlag;

    /**
     * ownFlag
     */
    private String ownFlag;

    /**
     * ownTime
     */
    private Date ownTime;

    /**
     * freeFlag
     */
    private String freeFlag;

    /**
     * operation
     */
    private String operation;

    /**
     * cyyy
     */
    private String cyyy;

    /**
     * ybGsNo
     */
    private String ybGsNo;

    /**
     * treatType
     */
    private String treatType;

    /**
     * hicNo
     */
    private String hicNo;

    /**
     * ybRegisterDate
     */
    private Date ybRegisterDate;

    /**
     * pathologyDiagComment
     */
    private String pathologyDiagComment;

    /**
     * fileStatus
     */
    private String fileStatus;
    /**
     * 西药费
     */
    private BigDecimal charge1;

    /**
     * 中草药费
     */
    private BigDecimal charge2;

    /**
     * 床位费
     */
    private BigDecimal charge3;

    /**
     * B超
     */
    private BigDecimal charge4;

    /**
     * 手术器械使用费
     */
    private BigDecimal charge5;

    /**
     * 心电监护
     */
    private BigDecimal charge6;

    /**
     * 体外反搏
     */
    private BigDecimal charge7;

    /**
     * 电胸电图
     */
    private BigDecimal charge8;

    /**
     * 心脑电图
     */
    private BigDecimal charge9;

    /**
     * 麻醉费
     */
    private BigDecimal charge10;

    /**
     * 透视照片
     */
    private BigDecimal charge11;

    /**
     * 手术费
     */
    private BigDecimal charge12;

    /**
     * 化验
     */
    private BigDecimal charge13;

    /**
     * 输血
     */
    private BigDecimal charge14;

    /**
     * 输氧
     */
    private BigDecimal charge15;

    /**
     * 接生
     */
    private BigDecimal charge16;

    /**
     * 护婴
     */
    private BigDecimal charge17;

    /**
     * CT
     */
    private BigDecimal charge18;

    /**
     * 护理
     */
    private BigDecimal charge19;

    /**
     * 陪护
     */
    private BigDecimal charge20;

    /**
     * 理疗费
     */
    private BigDecimal charge21;

    /**
     * 抢救
     */
    private BigDecimal charge22;

    /**
     * 卫生处理
     */
    private BigDecimal charge23;

    /**
     * 消毒
     */
    private BigDecimal charge24;

    /**
     * 治疗费
     */
    private BigDecimal charge25;

    /**
     * 其他
     */
    private BigDecimal charge26;

    /**
     * 材料费
     */
    private BigDecimal charge27;

    /**
     * 中成药费
     */
    private BigDecimal charge28;
    private BigDecimal charge29;
    private BigDecimal charge30;
    //小病室名称
    private String zkDeptName;


    // zy_actpatient 在院病人  zy_inactpatient 出院病人表
    private String tableName;
    //旧住院号  执行修改住院号时传参使用
    private String oldInpatientNo;
    //旧住次数  执行修改住院号时传参使用
    private Integer oldAdmissTimes;
    //性别中文 用于页面显示
    private String gender;
    //当前科室名称
    private String deptName;
    /**
     * 0未结算 1是出院结算  3是中间结算  4是已出纳  非数据库字段
     */
    private String settleType;
    //预交金合计
    private BigDecimal yjjHj;
    //直退押金合计
    private BigDecimal ztYjjHj;

    // 陪护人员
    private String phry;

    //非数据库字段 控制发票打印标志，只是页面做显示，不更新
    private Integer printFlag;
    //住院缴费记录
    List<ZyDepositFile> zyDepositFiles;

    // 电子病历入院记录的主要诊断
    private String emrDiagStr;

    private Integer age;

    /**
     * 出生日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthDate;

    /**
     * 违规费用
     */
    private List<ZyDetailCharge> weiXieDaiYuanLiuShui;

    /**
     * 未匹配
     */
    private List<WeiGuiFeiYongFenXi> weiPiPei;

    /**
     * 机制号
     * 这个实体类只在急诊费用转入中有效，
     * 用来冲正发票，是mz_receipt_serial表中的字段
     */
    private Integer serialNo;


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