|
|
@@ -1,13 +1,14 @@
|
|
|
package com.coffee.bus.entity;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
|
+import com.coffee.bus.enums.DeviceAlarmEnum;
|
|
|
+import com.coffee.bus.enums.DeviceEnum;
|
|
|
import com.coffee.bus.enums.DeviceStatusEnum;
|
|
|
-import com.coffee.bus.enums.DeviceWarnEnum;
|
|
|
import com.coffee.common.config.mybatis.DateToBigIntHandler;
|
|
|
import com.coffee.common.entity.TenantGenericEntity;
|
|
|
-import com.coffee.common.enums.SexEnum;
|
|
|
-import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.Data;
|
|
|
@@ -15,175 +16,227 @@ import lombok.EqualsAndHashCode;
|
|
|
import lombok.experimental.Accessors;
|
|
|
import org.apache.ibatis.type.EnumOrdinalTypeHandler;
|
|
|
|
|
|
+import javax.validation.constraints.DecimalMax;
|
|
|
+import javax.validation.constraints.DecimalMin;
|
|
|
+import javax.validation.constraints.Max;
|
|
|
+import javax.validation.constraints.Min;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Date;
|
|
|
|
|
|
/**
|
|
|
- * <p>
|
|
|
- *
|
|
|
- * </p>
|
|
|
- *
|
|
|
- * @author fanfan
|
|
|
- * @since 2020-07-03
|
|
|
- */
|
|
|
+ * @Author lifang
|
|
|
+ * @Date 10:52 2022/4/13
|
|
|
+ * @Description 设备历史运行数据记录
|
|
|
+ * @Param
|
|
|
+ * @return
|
|
|
+ **/
|
|
|
+
|
|
|
@Data
|
|
|
@EqualsAndHashCode(callSuper = false)
|
|
|
@Accessors(chain = true)
|
|
|
-@TableName(value = "bus_pump_history",autoResultMap = true)
|
|
|
-@ApiModel(value="网络泵历史数据", description="")
|
|
|
+@TableName(value = "bus_device_history",autoResultMap = true)
|
|
|
+@ApiModel(value="设备历史运行数据", description="设备历史运行数据记录")
|
|
|
public class BusDeviceHistoryEntity extends TenantGenericEntity<String,String> {
|
|
|
|
|
|
@ApiModelProperty(value = "网络泵id")
|
|
|
+ @JsonIgnoreProperties
|
|
|
private String deviceId;
|
|
|
|
|
|
@ApiModelProperty(value = "临床id")
|
|
|
+ @JsonIgnoreProperties
|
|
|
private String clinicId;
|
|
|
|
|
|
- @ApiModelProperty(value = "病号")
|
|
|
- private String patientCode;
|
|
|
+ @ApiModelProperty(value = "输注记录id")
|
|
|
+ @JsonIgnoreProperties
|
|
|
+ private String infusionId;
|
|
|
+
|
|
|
|
|
|
- @ApiModelProperty(value = "病人名称")
|
|
|
- private String patientName;
|
|
|
+ @ApiModelProperty(value = "总量",readOnly = true)
|
|
|
+ @Max(value = 999,message = "总量最大值不得超过999")
|
|
|
+ @Min(value = 0,message ="总量最小值不得超过0" )
|
|
|
+ private Integer totalDose;
|
|
|
|
|
|
- @ApiModelProperty(value = "别名")
|
|
|
- private String alias;
|
|
|
+ @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
|
|
|
+ @Max(value = 50,message = "首次量最大值不得超过50")
|
|
|
+ @Min(value = 0,message ="首次量最小值不得超过0" )
|
|
|
+ private Integer firstDose;
|
|
|
|
|
|
- @ApiModelProperty(value = "病人性别")
|
|
|
- @TableField(typeHandler = EnumOrdinalTypeHandler.class)
|
|
|
- private SexEnum patientSex;
|
|
|
|
|
|
- @ApiModelProperty(value = "病区")
|
|
|
- private String ward;
|
|
|
+ @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
|
|
|
+ private BigDecimal remainDose;
|
|
|
|
|
|
- @ApiModelProperty(value = "床号")
|
|
|
- private String bedNo;
|
|
|
+ @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
|
|
|
+ private BigDecimal inputDose;
|
|
|
|
|
|
- @ApiModelProperty(value = "剩余量")
|
|
|
- private BigDecimal remainQuantity;
|
|
|
+ @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
|
|
|
+ @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
|
|
|
+ @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
|
|
|
+ private BigDecimal appendDose;
|
|
|
|
|
|
- @ApiModelProperty(value = "持续量")
|
|
|
- private BigDecimal continueQuantity;
|
|
|
+ @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
|
|
|
+ @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
|
|
|
+ @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
|
|
|
+ private BigDecimal appendLockTime;
|
|
|
|
|
|
- @ApiModelProperty(value = "自控锁时")
|
|
|
+ @ApiModelProperty(value = "公共参数-极限量",readOnly = true)
|
|
|
+ @DecimalMax(value = "90",message = "PCA追加量最大值不得超过90")
|
|
|
+ @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
|
|
|
+ private BigDecimal maxDose;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "公共参数-自控锁时",readOnly = true)
|
|
|
private BigDecimal selfControlLockTime;
|
|
|
|
|
|
- @ApiModelProperty(value = "已输入量")
|
|
|
- private BigDecimal inputQuantity;
|
|
|
+ @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
|
|
|
+ private BigDecimal selfControlCount;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
|
|
|
+ private Integer pcaValidCount;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "公共参数-pca无效次数",readOnly = true)
|
|
|
+ private Integer pcaInvalidCount;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "公共参数-pca总按次数",readOnly = true)
|
|
|
+ private Integer pcaTotalCount;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "持续泵参数-持续量",readOnly = true)
|
|
|
+ @DecimalMax(value = "50",message = "持续给液量最大值不得超过50")
|
|
|
+ @DecimalMin(value = "0",message ="持续给液量最小值不得超过0" )
|
|
|
+ private BigDecimal continueDose;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "脉冲泵参数-脉冲量",readOnly = true)
|
|
|
+ @Max(value = 20,message = "脉冲量最大值不得超过20")
|
|
|
+ @Min(value = 0,message ="脉冲量最小值不得超过0" )
|
|
|
+ private Integer pulseDose;
|
|
|
|
|
|
- @ApiModelProperty(value = "有效次数")
|
|
|
- private Integer validTime;
|
|
|
+ @ApiModelProperty(value = "脉冲泵参数-脉冲锁时",readOnly = true)
|
|
|
+ @Max(value = 90,message = "脉冲锁时最大值不得超过90")
|
|
|
+ @Min(value = 30,message ="脉冲锁时最小值不得超过30" )
|
|
|
+ private Integer pulseLockTime;
|
|
|
|
|
|
- @ApiModelProperty(value = "无效次数")
|
|
|
- private Integer invalidTime;
|
|
|
+ @ApiModelProperty(value = "脉冲泵参数-脉冲首次锁时",readOnly = true)
|
|
|
+ @Max(value = 60,message = "脉冲首次锁时最大值不得超过60")
|
|
|
+ @Min(value = 0,message ="脉冲首次锁时最小值不得超过0" )
|
|
|
+ private Integer pulseFirstLockTime;
|
|
|
|
|
|
- @ApiModelProperty(value = "极限量")
|
|
|
- private BigDecimal maxQuantity;
|
|
|
+ @ApiModelProperty(value = "智能泵参数-加档周期",readOnly = true)
|
|
|
+ @DecimalMax(value = "10",message = "加档周期最大值不得超过10")
|
|
|
+ @DecimalMin(value = "0.5",message ="加档周期最小值不得超过0.5" )
|
|
|
+ private BigDecimal flowUpCycle;
|
|
|
|
|
|
- @ApiModelProperty(value = "首次量")
|
|
|
- private Integer firstQuantity;
|
|
|
+ @ApiModelProperty(value = "智能泵参数-减档周期",readOnly = true)
|
|
|
+ @DecimalMax(value = "10",message = "减档周期最大值不得超过10")
|
|
|
+ @DecimalMin(value = "0.5",message ="减档周期最小值不得超过0.5" )
|
|
|
+ private BigDecimal flowDownCycle;
|
|
|
|
|
|
- @ApiModelProperty(value = "追加量")
|
|
|
- private BigDecimal singleQuantity;
|
|
|
+ @ApiModelProperty(value = "智能泵参数-计次",readOnly = true)
|
|
|
+ @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
|
|
|
+ @DecimalMin(value = "1",message ="PCA追加量最小值不得超过1" )
|
|
|
+ private BigDecimal flowCount;
|
|
|
|
|
|
- @ApiModelProperty(value = "总量")
|
|
|
- private Integer totalQuantity;
|
|
|
+ @ApiModelProperty(value = "智能泵参数-上限",readOnly = true)
|
|
|
+ @DecimalMax(value = "50",message = "智能泵上限值最大值不得超过90")
|
|
|
+ @DecimalMin(value = "1",message ="智能泵上限值最小值不得超过0" )
|
|
|
+ private BigDecimal flowUpLimit;
|
|
|
|
|
|
- @ApiModelProperty(value = "总按次数")
|
|
|
- private Integer totalCount;
|
|
|
+ @ApiModelProperty(value = "智能泵参数-下限",readOnly = true)
|
|
|
+ @DecimalMax(value = "50",message = "智能泵下限值最大值不得超过50")
|
|
|
+ @DecimalMin(value = "0.1",message ="智能泵下限值最小值不得超过0.1" )
|
|
|
+ private BigDecimal flowDownLimit;
|
|
|
|
|
|
+ @ApiModelProperty(value = "智能泵参数-自调比例",readOnly = true)
|
|
|
+ @DecimalMax(value = "95",message = "自调比例不得超过95")
|
|
|
+ @DecimalMin(value = "0",message ="自调比例最小值不得超过0" )
|
|
|
+ private BigDecimal flowAdjustRate;
|
|
|
|
|
|
- @ApiModelProperty(value = "镇痛泵运行状态")
|
|
|
- @TableField(typeHandler = EnumOrdinalTypeHandler.class)
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "泵运行状态",readOnly = true)
|
|
|
+ @TableField(typeHandler = EnumOrdinalTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.IGNORED)
|
|
|
private DeviceStatusEnum runState;
|
|
|
|
|
|
- @ApiModelProperty(value = "提醒信息")
|
|
|
- @TableField(typeHandler = EnumOrdinalTypeHandler.class)
|
|
|
- private DeviceWarnEnum warn;
|
|
|
+ @ApiModelProperty(value = "报警信息",readOnly = true)
|
|
|
+ @TableField(typeHandler = EnumOrdinalTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.IGNORED)
|
|
|
+ private DeviceAlarmEnum alarm;
|
|
|
|
|
|
- @ApiModelProperty(value = "开始时间")
|
|
|
- @TableField(typeHandler = DateToBigIntHandler.class)
|
|
|
- private Date startTime;
|
|
|
+ @ApiModelProperty(value = "报警原因")
|
|
|
+ private String alarmCause;
|
|
|
|
|
|
- @ApiModelProperty(value = "是否已撤泵,0、未撤泵1、已撤泵")
|
|
|
- private Integer isUndo;
|
|
|
+ @ApiModelProperty(value = "输注即将结束提醒",readOnly = true)
|
|
|
+ private Boolean warnWillFinished;
|
|
|
|
|
|
- @ApiModelProperty(value = "备注")
|
|
|
- private String remark;
|
|
|
+ @ApiModelProperty(value = "镇痛不足提醒",readOnly = true)
|
|
|
+ private Boolean warnAnalgesicPoor;
|
|
|
|
|
|
- @ApiModelProperty(value = "最后上传时间")
|
|
|
- @TableField(typeHandler = DateToBigIntHandler.class)
|
|
|
- private Date lastUploadTime;
|
|
|
+ @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
|
|
|
+ private Boolean warnLowBattery;
|
|
|
|
|
|
- @TableField(typeHandler = DateToBigIntHandler.class)
|
|
|
- private Date registerTime;
|
|
|
+ @ApiModelProperty(value = "是否已撤泵,0、未撤泵1、已撤泵")
|
|
|
+ @JsonIgnoreProperties
|
|
|
+ private Boolean isUndo;
|
|
|
|
|
|
- @ApiModelProperty(value = "撤泵人")
|
|
|
- private String undoBy;
|
|
|
+ @ApiModelProperty(value = "是否为主泵数据, 0、副泵 1、主泵(即当前临床绑定的泵)")
|
|
|
+ @JsonIgnoreProperties
|
|
|
+ private Boolean master;
|
|
|
|
|
|
- @ApiModelProperty(value = "销毁人")
|
|
|
- private String destroyer;
|
|
|
+ @ApiModelProperty(value = "分包标记位",readOnly = true)
|
|
|
+ @JsonIgnoreProperties(allowSetters = true)
|
|
|
+ private String classification;
|
|
|
|
|
|
- @ApiModelProperty(value = "见证人")
|
|
|
- private String witnesses;
|
|
|
+ @ApiModelProperty(value = "泵类型",readOnly = true)
|
|
|
+ @TableField(typeHandler = EnumOrdinalTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.NEVER)
|
|
|
+ private DeviceEnum type;
|
|
|
|
|
|
+ @ApiModelProperty(value = "数据上传时间",readOnly = true,hidden = true)
|
|
|
@TableField(typeHandler = DateToBigIntHandler.class)
|
|
|
- private Date undoTime;
|
|
|
-
|
|
|
- @ApiModelProperty(value = "监护类型,1、有泵监护 2、无泵监护")
|
|
|
- private Integer monitorType;
|
|
|
-
|
|
|
- @ApiModelProperty(value = "是否为主泵数据")
|
|
|
- private Integer master;
|
|
|
-
|
|
|
- @ApiModelProperty(value = "当his信息不存在时,向his发起的请求id",hidden = true)
|
|
|
- @TableField(exist = false)
|
|
|
- @JsonIgnore
|
|
|
- private Long requestId;
|
|
|
-
|
|
|
- @ApiModelProperty(value = "泵类型")
|
|
|
- private String type;
|
|
|
- /**
|
|
|
- * 填充临床信息
|
|
|
- * @param clinic
|
|
|
- */
|
|
|
- public void fillClinic(BusClinicEntity clinic){
|
|
|
- this.clinicId=clinic.getId();
|
|
|
- this.patientName=clinic.getPatientName();
|
|
|
- this.patientSex=clinic.getPatientGender();
|
|
|
- this.ward=clinic.getWard();
|
|
|
- this.bedNo=clinic.getBedNo();
|
|
|
- }
|
|
|
-
|
|
|
- public static BusDeviceHistoryEntity of(BusDeviceRunningEntity pump, BusClinicEntity clinic){
|
|
|
- BusDeviceHistoryEntity history = new BusDeviceHistoryEntity();
|
|
|
-
|
|
|
- //临床信息
|
|
|
- history.setClinicId(clinic.getId());
|
|
|
- history.setPatientCode(clinic.getPatientCode());
|
|
|
- history.setWard(clinic.getWard());
|
|
|
- history.setBedNo(clinic.getBedNo());
|
|
|
-
|
|
|
- //设备信息
|
|
|
- history.setDeviceId(pump.getDeviceId());
|
|
|
- history.setTenantId(pump.getTenantId());
|
|
|
- history.setPatientName(pump.getPatientName());
|
|
|
- history.setPatientSex(pump.getPatientSex());
|
|
|
- history.setAlias(pump.getAlias());
|
|
|
- history.setRemainQuantity(pump.getRemainDose());
|
|
|
- history.setContinueQuantity(pump.getContinueDose());
|
|
|
- history.setSelfControlLockTime(pump.getSelfControlLockTime());
|
|
|
- history.setInputQuantity(pump.getInputDose());
|
|
|
- history.setValidTime(pump.getPcaValidCount());
|
|
|
- history.setInvalidTime(pump.getPcaInvalidCount());
|
|
|
- history.setMaxQuantity(pump.getMaxDose());
|
|
|
- history.setFirstQuantity(pump.getFirstDose());
|
|
|
- history.setSingleQuantity(pump.getAppendDose());
|
|
|
- history.setTotalQuantity(pump.getTotalDose());
|
|
|
- history.setTotalCount(pump.getPcaTotalCount());
|
|
|
- history.setRunState(pump.getRunState());
|
|
|
- history.setStartTime(pump.getStartTime());
|
|
|
-// history.setMonitorType(pump.getMonitorType());
|
|
|
-// history.setMaster(pump.getMaster());
|
|
|
- return history;
|
|
|
+ @JsonIgnoreProperties(allowSetters = true)
|
|
|
+ private Date uploadTime;
|
|
|
+
|
|
|
+
|
|
|
+ public static BusDeviceHistoryEntity parseRunningInfo(BusDeviceRunningEntity running){
|
|
|
+ BusDeviceHistoryEntity entity = new BusDeviceHistoryEntity();
|
|
|
+ entity.setDeviceId(running.getDeviceId());
|
|
|
+ entity.setClinicId(running.getClinicId());
|
|
|
+ entity.setType(running.getType());
|
|
|
+ entity.setClassification(running.getClassification());
|
|
|
+ entity.setTenantId(running.getTenantId());
|
|
|
+ entity.setInfusionId(running.getInfusionId());
|
|
|
+
|
|
|
+ entity.setTotalDose(running.getTotalDose());
|
|
|
+ entity.setFirstDose(running.getFirstDose());
|
|
|
+ entity.setRemainDose(running.getRemainDose());
|
|
|
+ entity.setInputDose(running.getInputDose());
|
|
|
+ entity.setContinueDose(running.getContinueDose());
|
|
|
+ entity.setAppendDose(running.getAppendDose());
|
|
|
+ entity.setMaxDose(running.getMaxDose());
|
|
|
+ entity.setSelfControlLockTime(running.getSelfControlLockTime());
|
|
|
+ entity.setSelfControlCount(running.getSelfControlCount());
|
|
|
+ entity.setPcaValidCount(running.getPcaValidCount());
|
|
|
+ entity.setPcaInvalidCount(running.getPcaInvalidCount());
|
|
|
+ entity.setPcaTotalCount(running.getPcaTotalCount());
|
|
|
+ /**
|
|
|
+ * 脉冲泵参数
|
|
|
+ */
|
|
|
+ entity.setPulseDose(running.getPulseDose());
|
|
|
+ entity.setPulseFirstLockTime(running.getPulseFirstLockTime());
|
|
|
+ entity.setPulseLockTime(running.getPulseLockTime());
|
|
|
+ /**
|
|
|
+ * 智能泵参数
|
|
|
+ */
|
|
|
+ entity.setFlowAdjustRate(running.getFlowAdjustRate());
|
|
|
+ entity.setFlowCount(running.getFlowCount());
|
|
|
+ entity.setFlowDownCycle(running.getFlowDownCycle());
|
|
|
+ entity.setFlowUpCycle(running.getFlowUpCycle());
|
|
|
+ entity.setFlowDownLimit(running.getFlowDownLimit());
|
|
|
+ entity.setFlowUpLimit(running.getFlowUpLimit());
|
|
|
+
|
|
|
+ entity.setUploadTime(running.getUploadTime());
|
|
|
+ entity.setRunState(running.getRunState());
|
|
|
+ entity.setWarnAnalgesicPoor(running.getWarnAnalgesicPoor());
|
|
|
+ entity.setWarnLowBattery(running.getWarnAnalgesicPoor());
|
|
|
+ entity.setWarnWillFinished(running.getWarnAnalgesicPoor());
|
|
|
+ entity.setAlarm(running.getAlarm());
|
|
|
+
|
|
|
+ entity.setMaster(running.getMaster());
|
|
|
+ entity.setTenantId(running.getTenantId());
|
|
|
+ return entity;
|
|
|
}
|
|
|
}
|