|
|
@@ -1,11 +1,8 @@
|
|
|
package com.nb.app.doctor.controller;
|
|
|
|
|
|
-import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
-import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
@@ -15,16 +12,10 @@ import com.nb.app.assistant.api.feign.IAssistantUserBindClient;
|
|
|
import com.nb.app.assistant.api.feign.result.ContactQuery;
|
|
|
import com.nb.app.assistant.api.feign.result.PatientBindAssistantResult;
|
|
|
import com.nb.app.assistant.api.feign.result.UpdateBindPatientParam;
|
|
|
-import com.nb.app.doctor.api.feign.IAppDoctorUserClient;
|
|
|
-import com.nb.app.doctor.api.feign.IAppUserConsultConfigClient;
|
|
|
-import com.nb.app.doctor.controller.vo.*;
|
|
|
import com.nb.app.doctor.controller.vo.ChangeManageVo;
|
|
|
import com.nb.app.doctor.controller.vo.InviteCodeVo;
|
|
|
import com.nb.app.doctor.controller.vo.UpdateBindPatientVo;
|
|
|
-import com.nb.web.api.entity.BusInfusionHistoryEntity;
|
|
|
-import com.nb.web.api.entity.common.BusDeviceRunningEntity;
|
|
|
-import com.nb.web.api.enums.DeviceStatusEnum;
|
|
|
-import com.nb.web.api.enums.PatientAlarmEnum;
|
|
|
+import com.nb.web.api.dto.BusPatientAbnormalMarkDTO;
|
|
|
import com.nb.web.api.feign.query.DoctorPatientMonitorQuery;
|
|
|
import com.nb.web.api.feign.result.DoctorPatientMonitorResult;
|
|
|
import com.nb.app.doctor.service.dto.PatientMonitorConsultResult;
|
|
|
@@ -32,7 +23,6 @@ import com.nb.auth.utils.SecurityUtil;
|
|
|
import com.nb.common.lock.annotation.DistributeLock;
|
|
|
import com.nb.common.websocket.WebSocketSessionLifeCycleManage;
|
|
|
import com.nb.core.annotation.Log;
|
|
|
-import com.nb.core.entity.QueryParamEntity;
|
|
|
import com.nb.core.exception.CustomException;
|
|
|
import com.nb.core.result.R;
|
|
|
import com.nb.web.api.entity.BusClinicEntity;
|
|
|
@@ -55,18 +45,14 @@ import com.nb.web.service.bus.service.dto.ConstantQuery;
|
|
|
import com.nb.web.service.bus.service.dto.DeviceHistoryQuery;
|
|
|
import com.nb.web.service.bus.service.dto.ManualUndoConfig;
|
|
|
import com.nb.web.service.bus.utils.WsPublishUtils;
|
|
|
-import io.swagger.annotations.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.dao.DuplicateKeyException;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
-import java.io.Serializable;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -248,30 +234,21 @@ public class PatientMonitorController {
|
|
|
return R.success();
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/do/{monitorType}/finished")
|
|
|
- @SaCheckPermission("app:finished:*")
|
|
|
+ @PostMapping("/doFinished")
|
|
|
@Log(title = "手动结束管理")
|
|
|
- @ApiResponse(code = 4001,message = "病号当前绑定了多个设备,不可结束管理")
|
|
|
- @ApiOperation(value = "手动结束管理",notes = "病患当前绑定主设备必须要在关机、不在服务器、待机中才能结束管理,权限【app:finished:*】")
|
|
|
- public R<Boolean> appFinished(@PathVariable("monitorType")@ApiParam(value = "是否为无泵管理 false、无泵 true、有泵",defaultValue = "false" ) boolean haveDevice,
|
|
|
- @RequestBody MonitorFinishedVo monitorFinishedVo,
|
|
|
- @RequestAttribute("tenantId")@ApiParam(hidden = true) String tenantId) {
|
|
|
-
|
|
|
+ @ApiOperation(value = "手动结束管理",notes = "病患当前绑定主设备必须要在关机、不在服务器、待机中才能结束管理")
|
|
|
+ public R<Boolean> appFinished(
|
|
|
+ @RequestBody MonitorFinishedVo monitorFinishedVo,
|
|
|
+ @RequestAttribute("tenantId")@ApiParam(hidden = true) String tenantId) {
|
|
|
log.info("结束管理,【{}】",JSONUtil.toJsonStr(monitorFinishedVo));
|
|
|
- if (haveDevice){
|
|
|
- if (CollUtil.isEmpty(monitorFinishedVo.getPatientIds())){
|
|
|
- throw new CustomException("未选择住院号");
|
|
|
- }
|
|
|
- R<Boolean> result = monitorFinished(monitorFinishedVo, tenantId);
|
|
|
- CompletableFuture.runAsync(()->wsPublishUtils.publishMonitorTotalCount(tenantId))
|
|
|
- .thenRunAsync(()->wsPublishUtils.publishDeviceNone(tenantId))
|
|
|
- .thenRunAsync(()->wsPublishUtils.publishMonitorStateCount(tenantId));
|
|
|
- return result;
|
|
|
- }else {
|
|
|
- return manualFinished(monitorFinishedVo);
|
|
|
+ if (CollUtil.isEmpty(monitorFinishedVo.getPatientIds())){
|
|
|
+ throw new CustomException("未选择住院号");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ R<Boolean> result = monitorFinished(monitorFinishedVo, tenantId);
|
|
|
+ CompletableFuture.runAsync(()->wsPublishUtils.publishMonitorTotalCount(tenantId))
|
|
|
+ .thenRunAsync(()->wsPublishUtils.publishDeviceNone(tenantId))
|
|
|
+ .thenRunAsync(()->wsPublishUtils.publishMonitorStateCount(tenantId));
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
private R<Boolean> monitorFinished(MonitorFinishedVo monitorFinishedVo, String tenantId){
|
|
|
@@ -301,21 +278,10 @@ public class PatientMonitorController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private R<Boolean> manualFinished(MonitorFinishedVo monitorFinishedVo){
|
|
|
- List<String> clinicIds = monitorFinishedVo.getClinicIds();
|
|
|
- if (CollUtil.isEmpty(clinicIds)) {
|
|
|
- throw new CustomException("未选择临床信息");
|
|
|
- }
|
|
|
- manualService.finishedMonitor(monitorFinishedVo);
|
|
|
- return R.success(true);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
@PostMapping("/clinic/edit")
|
|
|
@Log(title = "编辑患者信息")
|
|
|
@ApiOperation(value = "编辑患者信息")
|
|
|
public R<Boolean> edit(@RequestBody @Validated BusClinicEntity busClinic) {
|
|
|
-
|
|
|
return R.success(patientClient.setClinic(busClinic));
|
|
|
}
|
|
|
|
|
|
@@ -353,15 +319,14 @@ public class PatientMonitorController {
|
|
|
|
|
|
/**
|
|
|
* @description: 网络泵技改项目
|
|
|
- * ①在主界面添加患者的异常表示
|
|
|
+ * ①在主界面 添加/删除 患者的异常标识
|
|
|
* @author lifang
|
|
|
* @date 2025-04-17
|
|
|
*/
|
|
|
- @PostMapping("/addAbnormalMark")
|
|
|
- @ApiOperation(value = "添加异常标识(平板技改)")
|
|
|
- public R<List<DoctorPatientMonitorResult>> addAbnormalMark(@RequestBody DoctorPatientMonitorQuery query) {
|
|
|
- query.setTenantId(SecurityUtil.getTenantId());
|
|
|
- return R.success(patientClient.doctorSelectPatientList(query));
|
|
|
+ @PostMapping("/editAbnormalMark")
|
|
|
+ @ApiOperation(value = "修改异常标识(平板技改)")
|
|
|
+ public R<Boolean> editAbnormalMark(@RequestBody@Validated BusPatientAbnormalMarkDTO source) {
|
|
|
+ return R.success(patientClient.editAbnormalMark(source));
|
|
|
}
|
|
|
|
|
|
|