package com.coffee.bus.entity; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import com.coffee.bus.bean.HisInfo; import com.coffee.common.config.mybatis.DateToBigIntHandler; import com.coffee.common.entity.TenantGenericEntity; import com.coffee.common.enums.SexEnum; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import org.apache.ibatis.type.EnumOrdinalTypeHandler; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.Size; import java.util.Date; /** * @author lifang * @version 1.0.0 * @ClassName BusDoctorEntity.java * @Description TODO * @createTime 2022年03月21日 11:17:00 */ @EqualsAndHashCode(callSuper = true) @Data @TableName(value = "bus_clinic",autoResultMap = true) @ApiModel(value="病人临床手术信息", description="病人临床手术信息实体类") public class BusClinicEntity extends TenantGenericEntity { @ApiModelProperty(value = "临床手术名称") @Length(max = 255,message = "临床手术名称长度不得超过255个字节") private String name; @ApiModelProperty(value = "病人id") private String patientId; @ApiModelProperty(value = "病号") @Length(max = 255,message = "病号长度不得超过255个字节") private String patientCode; @ApiModelProperty(value = "手术开始时间") @TableField(typeHandler = DateToBigIntHandler.class) @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") private Date startTime; @ApiModelProperty(value = "手术结束时间") @TableField(typeHandler = DateToBigIntHandler.class) @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") private Date endTime; @ApiModelProperty(value = "患者姓名") @Length(max = 255,message = "患者姓名长度不得超过255个字节") private String patientName; @ApiModelProperty(value = "患者性别") @TableField(typeHandler = EnumOrdinalTypeHandler.class) private SexEnum patientGender; @ApiModelProperty(value = "患者年龄") private Integer patientAge; @ApiModelProperty(value = "科室id") @Length(max = 255,message = "科室id") private String dept; @ApiModelProperty(value = "病床号") @Length(max = 255,message = "病床号长度不得超过255个字节") private String bedNo; @ApiModelProperty(value = "体重") @Length(max = 255,message = "体重不得超过255个字节") private String weight; @ApiModelProperty(value = "身高") @Length(max = 255,message = "身高不得超过255个字节") private String height; @ApiModelProperty(value = "麻醉医生") @Length(max = 255,message = "麻醉医生不得超过255个字节") private String anaDoctor; @ApiModelProperty(value = "麻醉方式") private String anaType; @ApiModelProperty(value = "镇痛方式") private String analType; @ApiModelProperty(value = "手术医生") @Length(max = 255,message = "手术医生不得超过255个字节") private String surgeryDoctor; @ApiModelProperty(value = "手术名称") @Length(max = 255,message = "手术名称不得超过255个字节") private String surgeryName; @ApiModelProperty(value = "配置人员") private String configPerson; @ApiModelProperty(value = "配方") private String formula; @ApiModelProperty(value = "临床是否结束") private Boolean finished; @TableField(fill = FieldFill.INSERT) @TableLogic(value = "0",delval = "1") private Integer isDelete; public static BusClinicEntity of(HisInfo hisInfo){ BusClinicEntity clinic = new BusClinicEntity(); clinic.setTenantId(hisInfo.getHospitalId()); clinic.setPatientCode(hisInfo.getPatientCode()); clinic.setPatientName(hisInfo.getPatientName()); clinic.setPatientGender(hisInfo.getGender()); clinic.setPatientAge(Integer.valueOf(hisInfo.getAge())); clinic.setWeight(hisInfo.getWeight()); clinic.setHeight(hisInfo.getHeight()); //病区 需新增 todo clinic.setDept(hisInfo.getWard()); clinic.setBedNo(hisInfo.getBedNo()); clinic.setName(hisInfo.getOperation()); clinic.setSurgeryDoctor(hisInfo.getSurgeon()); clinic.setStartTime(hisInfo.getOperationTime()); //asa分级 todo //easymode todo clinic.setFormula(hisInfo.getFormula()); clinic.setConfigPerson(hisInfo.getConfigPerson()); return clinic; } }