BusClinicEntity.java 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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.common.config.mybatis.DateToBigIntHandler;
  8. import com.coffee.common.entity.TenantGenericEntity;
  9. import com.coffee.common.enums.SexEnum;
  10. import com.fasterxml.jackson.annotation.JsonFormat;
  11. import io.swagger.annotations.ApiModel;
  12. import io.swagger.annotations.ApiModelProperty;
  13. import lombok.Data;
  14. import lombok.EqualsAndHashCode;
  15. import org.apache.ibatis.type.EnumOrdinalTypeHandler;
  16. import org.hibernate.validator.constraints.Length;
  17. import javax.validation.constraints.Size;
  18. import java.util.Date;
  19. /**
  20. * @author lifang
  21. * @version 1.0.0
  22. * @ClassName BusDoctorEntity.java
  23. * @Description TODO
  24. * @createTime 2022年03月21日 11:17:00
  25. */
  26. @EqualsAndHashCode(callSuper = true)
  27. @Data
  28. @TableName(value = "bus_clinic",autoResultMap = true)
  29. @ApiModel(value="病人临床手术信息", description="病人临床手术信息实体类")
  30. public class BusClinicEntity extends TenantGenericEntity<String,String> {
  31. @ApiModelProperty(value = "临床手术名称")
  32. @Length(max = 255,message = "临床手术名称长度不得超过255个字节")
  33. private String name;
  34. @ApiModelProperty(value = "病人id")
  35. private String patientId;
  36. @ApiModelProperty(value = "病号")
  37. @Length(max = 255,message = "病号长度不得超过255个字节")
  38. private String patientCode;
  39. @ApiModelProperty(value = "手术开始时间")
  40. @TableField(typeHandler = DateToBigIntHandler.class)
  41. @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  42. private Date startTime;
  43. @ApiModelProperty(value = "手术结束时间")
  44. @TableField(typeHandler = DateToBigIntHandler.class)
  45. @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  46. private Date endTime;
  47. @ApiModelProperty(value = "患者姓名")
  48. @Length(max = 255,message = "患者姓名长度不得超过255个字节")
  49. private String patientName;
  50. @ApiModelProperty(value = "患者性别")
  51. @TableField(typeHandler = EnumOrdinalTypeHandler.class)
  52. private SexEnum patientGender;
  53. @ApiModelProperty(value = "患者年龄")
  54. private Integer patientAge;
  55. @ApiModelProperty(value = "科室id")
  56. @Length(max = 255,message = "科室id")
  57. private String dept;
  58. @ApiModelProperty(value = "病床号")
  59. @Length(max = 255,message = "病床号长度不得超过255个字节")
  60. private String bedNo;
  61. @ApiModelProperty(value = "体重")
  62. @Length(max = 255,message = "体重不得超过255个字节")
  63. private String weight;
  64. @ApiModelProperty(value = "身高")
  65. @Length(max = 255,message = "身高不得超过255个字节")
  66. private String height;
  67. @ApiModelProperty(value = "麻醉医生")
  68. @Length(max = 255,message = "麻醉医生不得超过255个字节")
  69. private String anaDoctor;
  70. @ApiModelProperty(value = "麻醉方式")
  71. private String anaType;
  72. @ApiModelProperty(value = "镇痛方式")
  73. private String analType;
  74. @ApiModelProperty(value = "手术医生")
  75. @Length(max = 255,message = "手术医生不得超过255个字节")
  76. private String surgeryDoctor;
  77. @ApiModelProperty(value = "手术名称")
  78. @Length(max = 255,message = "手术名称不得超过255个字节")
  79. private String surgeryName;
  80. @ApiModelProperty(value = "配置人员")
  81. private String configPerson;
  82. @ApiModelProperty(value = "配方")
  83. private String formula;
  84. @ApiModelProperty(value = "临床是否结束")
  85. private Boolean finished;
  86. @TableField(fill = FieldFill.INSERT)
  87. @TableLogic(value = "0",delval = "1")
  88. private Integer isDelete;
  89. public static BusClinicEntity of(HisInfo hisInfo){
  90. BusClinicEntity clinic = new BusClinicEntity();
  91. clinic.setTenantId(hisInfo.getHospitalId());
  92. clinic.setPatientCode(hisInfo.getPatientCode());
  93. clinic.setPatientName(hisInfo.getPatientName());
  94. clinic.setPatientGender(hisInfo.getGender());
  95. clinic.setPatientAge(Integer.valueOf(hisInfo.getAge()));
  96. clinic.setWeight(hisInfo.getWeight());
  97. clinic.setHeight(hisInfo.getHeight());
  98. //病区 需新增 todo
  99. clinic.setDept(hisInfo.getWard());
  100. clinic.setBedNo(hisInfo.getBedNo());
  101. clinic.setName(hisInfo.getOperation());
  102. clinic.setSurgeryDoctor(hisInfo.getSurgeon());
  103. clinic.setStartTime(hisInfo.getOperationTime());
  104. //asa分级 todo
  105. //easymode todo
  106. clinic.setFormula(hisInfo.getFormula());
  107. clinic.setConfigPerson(hisInfo.getConfigPerson());
  108. return clinic;
  109. }
  110. }