BusPatientEntity.java 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package com.coffee.bus.entity;
  2. import com.baomidou.mybatisplus.annotation.FieldFill;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.baomidou.mybatisplus.annotation.TableLogic;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import com.coffee.bus.bean.HisInfo;
  7. import com.coffee.bus.enums.PatientAlarmEnum;
  8. import com.coffee.common.entity.TenantGenericEntity;
  9. import com.coffee.common.enums.SexEnum;
  10. import io.swagger.annotations.ApiModel;
  11. import io.swagger.annotations.ApiModelProperty;
  12. import lombok.Data;
  13. import lombok.EqualsAndHashCode;
  14. import lombok.ToString;
  15. import org.hibernate.validator.constraints.Length;
  16. /**
  17. * @author lifang
  18. * @version 1.0.0
  19. * @ClassName BusPatientEntity.java
  20. * @Description TODO
  21. * @createTime 2022年03月21日 11:17:00
  22. */
  23. @EqualsAndHashCode(callSuper = true)
  24. @Data
  25. @TableName(value = "bus_patient",autoResultMap = true)
  26. @ApiModel(value="住院病人基本信息", description="住院病人基本信息实体类")
  27. @ToString
  28. public class BusPatientEntity extends TenantGenericEntity<String,String> {
  29. @ApiModelProperty(value = "病号")
  30. @Length(max = 255,message = "病号长度不得超过255个字节")
  31. private String code;
  32. @ApiModelProperty(value = "病人名称")
  33. @Length(max = 255,message = "医生岗位长度不得超过255个字节")
  34. private String name;
  35. @ApiModelProperty(value = "性别")
  36. private SexEnum gender;
  37. @TableField
  38. @ApiModelProperty("病号最新的输注记录")
  39. private String infusionId;
  40. @TableField(fill = FieldFill.INSERT)
  41. @TableLogic(value = "0",delval = "1")
  42. private Integer isDelete;
  43. @ApiModelProperty(value = "病人报警信息",example = "泵重复,无泵")
  44. private PatientAlarmEnum alarm;
  45. public static BusPatientEntity of(HisInfo hisInfo){
  46. BusPatientEntity patient = new BusPatientEntity();
  47. patient.setCode(hisInfo.getPatientCode());
  48. patient.setGender(hisInfo.getGender());
  49. patient.setName(hisInfo.getPatientName());
  50. patient.setTenantId(hisInfo.getHospitalId());
  51. return patient;
  52. }
  53. }