package com.yihu.figure.model.disease;

import com.yihu.figure.model.IdEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * Created by chenweida on 2017/3/6.
 * 检查检验表
 */
@Entity
@Table(name = "figure_inspection")
public class Inspection extends IdEntity {
    private String serial;//'文档序号'
    private String item;//''检查项目名称''
    private Integer orgId;//'机构ID'
    private String catalogCode;//''档案类型''
    private Integer r;//''排序号''
    private Date endTime;//''事件时间''
    private String orgName;//''机构名称''
    private String unionssid;//'文档序号'
    private Date ehrCommitTime;//''提交时间''
    private String type;//''事件类型1门诊2住院3体检''
    private String event;//''事件号''
    private String xmanId;//
    private String patientCode;//患者code

    private String cataLogCodeName;//类别名称
    public Inspection() {
    }

    public Inspection(String patientCode) {
        this.patientCode = patientCode;
    }

    @Transient
    public String getCataLogCodeName() {
        switch (this.catalogCode) {
            case "0131": {
                //门诊检查报告单
                return "检查";
            }
            case "0121": {
                //门诊检验报告单
                return "检验";
            }
            case "0221": {
                //住院检验报告
                return "检验";
            }
            case "0231": {
                //住院检查报告
                return "检查";
            }
        }
        return "未知";
    }

    public void setCataLogCodeName(String cataLogCodeName) {
        this.cataLogCodeName = cataLogCodeName;
    }

    public String getPatientCode() {
        return patientCode;
    }

    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
    }

    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        this.serial = serial;
    }

    public String getItem() {
        return item;
    }

    public void setItem(String item) {
        this.item = item;
    }

    public Integer getOrgId() {
        return orgId;
    }

    public void setOrgId(Integer orgId) {
        this.orgId = orgId;
    }

    public String getCatalogCode() {
        return catalogCode;
    }

    public void setCatalogCode(String catalogCode) {
        this.catalogCode = catalogCode;
    }

    public Integer getR() {
        return r;
    }

    public void setR(Integer r) {
        this.r = r;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getUnionssid() {
        return unionssid;
    }

    public void setUnionssid(String unionssid) {
        this.unionssid = unionssid;
    }

    public Date getEhrCommitTime() {
        return ehrCommitTime;
    }

    public void setEhrCommitTime(Date ehrCommitTime) {
        this.ehrCommitTime = ehrCommitTime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public String getXmanId() {
        return xmanId;
    }

    public void setXmanId(String xmanId) {
        this.xmanId = xmanId;
    }
}
