Selaa lähdekoodia

update 所有临床数据与输注绑定,去除多余字段

18339543638 3 vuotta sitten
vanhempi
commit
506835f3fb

+ 6 - 10
coffee-system/src/main/java/com/coffee/bus/controller/BusPatientController.java

@@ -167,28 +167,24 @@ public class BusPatientController  {
                 .eq(BusDeviceRunningEntity::getTenantId, undoConfig.getTenantId())
                 .eq(BusDeviceRunningEntity::getMaster, false)
                 .eq(BusDeviceRunningEntity::getIsUndo, false));
+        //处理缓存信息
+        PatientOperator<PatientCacheInfo> operator = patientRegistry.getOperator(undoConfig.getTenantId(), undoConfig.getPatientCode());
+        String bindDeviceId = operator.getBindDeviceId();
+        Set<DeviceTimeSmallInfo> allDevice = operator.getAllDevice();
+        Optional<DeviceTimeSmallInfo> first = allDevice.stream().filter(device -> device.getDeviceId().equals(bindDeviceId)).findFirst();
+        operator.setAllDevice(Collections.singleton(first.get()));
         if(count>0){
             //仅撤泵,病号报警不解除
             return R.success();
         }
-
         patientService.update(new UpdateWrapper<BusPatientEntity>().lambda()
                 .eq(BusPatientEntity::getCode,undoConfig.getPatientCode())
                 .eq(BusPatientEntity::getTenantId,undoConfig.getTenantId())
                 .set(BusPatientEntity::getAlarm, PatientAlarmEnum.NONE));
-
-        //处理缓存信息
-        PatientOperator<PatientCacheInfo> operator = patientRegistry.getOperator(undoConfig.getTenantId(), undoConfig.getPatientCode());
-        String bindDeviceId = operator.getBindDeviceId();
-        Set<DeviceTimeSmallInfo> allDevice = operator.getAllDevice();
-        Optional<DeviceTimeSmallInfo> first = allDevice.stream().filter(device -> device.getDeviceId().equals(bindDeviceId)).findFirst();
-        operator.setAllDevice(Collections.singleton(first.get()));
-
         return R.success();
     }
 
 
-    //todo
     @PostMapping("/edit")
     @SaCheckPermission("device:patient:edit")
     @ApiOperation(value = "编辑病人当前手术信息",notes = "编辑病人信息及病人当前手术信息,权限标识为【device:patient:edit】")

+ 0 - 4
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceAlarmEntity.java

@@ -53,9 +53,6 @@ public class BusDeviceAlarmEntity extends TenantGenericEntity<String,String> {
     @ApiModelProperty(value = "输注记录")
     private String infusionId;
 
-    @ApiModelProperty(value = "临床id",readOnly = true)
-    private String clinicId;
-
 
     @ApiModelProperty(value = "设备标识",readOnly = true,hidden = true)
     @JsonIgnoreProperties(allowSetters = true)
@@ -68,7 +65,6 @@ public class BusDeviceAlarmEntity extends TenantGenericEntity<String,String> {
         entity.setAlarmTime(history.getUploadTime());
         entity.setHistoryId(history.getId());
         entity.setInfusionId(history.getInfusionId());
-        entity.setClinicId(history.getClinicId());
         entity.setClassification(history.getClassification());
         entity.setTenantId(history.getTenantId());
         return entity;

+ 0 - 5
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceHistoryEntity.java

@@ -39,10 +39,6 @@ public class BusDeviceHistoryEntity extends TenantGenericEntity<String,String> {
     @JsonIgnoreProperties
     private String deviceId;
 
-    @ApiModelProperty(value = "临床id")
-    @JsonIgnoreProperties
-    private String clinicId;
-
     @ApiModelProperty(value = "输注记录id")
     @JsonIgnoreProperties
     private String infusionId;
@@ -194,7 +190,6 @@ public class BusDeviceHistoryEntity extends TenantGenericEntity<String,String> {
     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());

+ 0 - 9
coffee-system/src/main/java/com/coffee/bus/entity/BusInfusionModifyEntity.java

@@ -41,9 +41,6 @@ public class BusInfusionModifyEntity extends TenantGenericEntity<String,String>
     @ApiModelProperty(value = "输注记录")
     private String infusionId;
 
-    @ApiModelProperty(value = "临床号")
-    private String clinicId;
-
     @ApiModelProperty(value = "泵类型",readOnly = true)
     @TableField(updateStrategy = FieldStrategy.NEVER)
     private DeviceEnum type;
@@ -147,11 +144,6 @@ public class BusInfusionModifyEntity extends TenantGenericEntity<String,String>
     @ApiModelProperty(value = "参数修改时间")
     private Date modifyTime;
 
-    //todo
-    @ApiModelProperty(value = "监控当前病患临床开始时间")
-    @TableField(exist = false)
-    private Date clinicStartTime;
-
 
     @ApiModelProperty(value = "分包标记位",readOnly = true)
     @JsonIgnoreProperties(allowSetters = true)
@@ -160,7 +152,6 @@ public class BusInfusionModifyEntity extends TenantGenericEntity<String,String>
     public static BusInfusionModifyEntity parseRunningInfo(BusDeviceRunningEntity running){
         BusInfusionModifyEntity entity = new BusInfusionModifyEntity();
         entity.setDeviceId(running.getDeviceId());
-        entity.setClinicId(running.getClinicId());
         entity.setTenantId(running.getTenantId());
         entity.setInfusionId(running.getInfusionId());
         entity.setType(running.getType());

+ 2 - 0
coffee-system/src/main/java/com/coffee/bus/registry/patient/ClusterPatientRegistry.java

@@ -66,6 +66,8 @@ public class ClusterPatientRegistry implements PatientRegistry {
             //不存在临床或临床已结束
             if(clinic==null||Boolean.TRUE.equals(clinic.getFinished())){
                 clinicService.asyncFromHis(hospitalId,patientCode);
+                patient.setClinicId("-1");
+                patientOperator.setClinicId("-1");
             }else {
                 //填充临床信息
                 patient.setName(clinic.getName());