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.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import com.coffee.bus.bean.HisInfo; import com.coffee.bus.service.dto.UndoDeviceConfig; import com.coffee.common.entity.TenantGenericEntity; import com.coffee.common.enums.SexEnum; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import org.hibernate.validator.constraints.Length; import java.util.*; /** * @author lifang * @version 1.0.0 * @ClassName BusClinicEntity.java * @Description TODO * @createTime 2022年03月21日 11:17:00 */ @EqualsAndHashCode(callSuper = true) @Data @TableName(value = "bus_clinic",autoResultMap = true) @ApiModel(value="病人临床手术信息", description="病人临床手术信息实体类") @ToString public class BusClinicEntity extends TenantGenericEntity { @ApiModelProperty(value = "临床手术名称") @Length(max = 255,message = "临床手术名称长度不得超过255个字节") private String name; @ApiModelProperty(value = "病号") @Length(max = 255,message = "病号长度不得超过255个字节") private String patientCode; @ApiModelProperty(value = "手术开始时间") private Date startTime; @TableField @ApiModelProperty("手术监护开始时间,即该临床手术后第一次上传数据时间") private Date monitorStartTime; @ApiModelProperty(value = "手术监护结束时间") private Date endTime; @ApiModelProperty(value = "患者姓名") @Length(max = 255,message = "患者姓名长度不得超过255个字节") private String patientName; @ApiModelProperty(value = "患者性别") private SexEnum patientGender; @ApiModelProperty(value = "患者年龄") private Integer patientAge; @ApiModelProperty(value = "病区") @Length(max = 255,message = "病区") private String ward; @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 = "配置人员") private String configPerson; @ApiModelProperty(value = "配方") @TableField(typeHandler = FastjsonTypeHandler.class,javaType = true) private List formula; @ApiModelProperty(value = "临床是否结束,0、未结束 1、结束 ") private Boolean finished; @ApiModelProperty(value = "临床使用过的设备号") @TableField(typeHandler = FastjsonTypeHandler.class,javaType = true) private Set deviceCodes; @TableField(fill = FieldFill.INSERT) @TableLogic(value = "0",delval = "1") private Integer isDelete; @ApiModelProperty("结束管理(撤泵)配置,仅在 其他监控中使用") @TableField(typeHandler = FastjsonTypeHandler.class) private UndoDeviceConfig undoConfig; //todo @ApiModelProperty(value = "监护类型,1、有泵监护 0、无泵监护") @JsonIgnoreProperties(allowGetters = true) private Boolean monitorType; 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.setWard(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; } }