Forráskód Böngészése

add
查询住院号相关手术信息
新增输注泵对接

18339543638 4 hónapja
szülő
commit
0b5d2d78e9

+ 9 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/AppClinicRoomController.java

@@ -5,6 +5,7 @@ import cn.tr.core.pojo.TableDataInfo;
 import cn.tr.core.validation.Insert;
 import cn.tr.module.smart.app.controller.dto.AppDoctorClinicFinishDTO;
 import cn.tr.module.smart.app.controller.dto.AppDoctorClinicRoomDTO;
+import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomThumbnailVO;
 import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomVO;
 import cn.tr.module.smart.common.service.IBizClinicRoomService;
 import cn.tr.module.smart.common.dto.BizClinicAddOrEditDTO;
@@ -17,7 +18,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-
+import java.util.*;
 /**
  * @author wangzl
  * @description: TODO
@@ -76,4 +77,11 @@ public class AppClinicRoomController extends BaseController {
         return CommonResult.success(clinicRoomService.stdAddDoctorApp(source));
     }
 
+    @ApiOperationSupport(author = "lf",order = 7)
+    @ApiOperation(value="查询住院号相关手术信息",notes = "权限: 无")
+    @PostMapping("/queryPatientCode")
+    public CommonResult<List<WxDoctorClinicRoomThumbnailVO>> queryPatientCode(@RequestBody@Validated BizClinicAddOrEditDTO source) {
+        return CommonResult.success(clinicRoomService.queryPatientCode(source));
+    }
+
 }

+ 26 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/dto/AppDoctorClinicQueryByPatientCodeDTO.java

@@ -0,0 +1,26 @@
+package cn.tr.module.smart.app.controller.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/7/14 8:39
+ */
+@Data
+@ApiModel("医生端根据住院号查询")
+public class AppDoctorClinicQueryByPatientCodeDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "住院号", position = 1)
+    @NotBlank(message = "住院号不能为空")
+    private String patientCode;
+}

+ 49 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/vo/WxDoctorClinicRoomThumbnailVO.java

@@ -0,0 +1,49 @@
+package cn.tr.module.smart.app.controller.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/6/9 15:11
+ */
+@Data
+@ApiModel("医生端手术列表信息")
+public class WxDoctorClinicRoomThumbnailVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "手术ID", position = 1)
+    private String clinicRoomId;
+
+    @ApiModelProperty(value = "手术名称", position = 2)
+    private String clinicName;
+
+    @ApiModelProperty(value = "手术开始时间", position = 3)
+    private Date clinicStartTime;
+
+    @ApiModelProperty(value = "科室名称", position = 4)
+    private String deptName;
+
+    @ApiModelProperty(value = "住院号", position = 5)
+    private String patientCode;
+
+    @ApiModelProperty(value = "患者姓名", position = 6)
+    private String patientName;
+
+    @ApiModelProperty(value = "患者年龄", position = 7)
+    private Integer patientAge;
+
+    @ApiModelProperty(value = "患者性别", position = 8)
+    private String patientGender;
+
+    @ApiModelProperty("患者头像")
+    private String patientAvatar;
+
+    @ApiModelProperty(value = "泵信息", position = 9)
+    private WxDoctorPumpInfoVO pumpInfo;
+}

+ 24 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/config/PatientMonitorListener.java

@@ -0,0 +1,24 @@
+package cn.tr.module.smart.common.config;
+
+import cn.tr.module.smart.common.enums.RabbitMQConstant;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+public class PatientMonitorListener {
+
+    @RabbitListener(queues = RabbitMQConstant.QUEUE_PATIENT_MONITOR)
+    public void handlePatientMonitorMessage(String message) {
+        log.info("Received patient monitor message: {}", message);
+        // 在这里处理接收到的消息
+        processPatientMonitorData(message);
+    }
+
+    private void processPatientMonitorData(String message) {
+        // 实际处理患者监控数据的逻辑
+        log.info("Processing patient monitor data: {}", message);
+        // TODO: 根据业务需求实现具体的处理逻辑
+    }
+}

+ 32 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/config/RabbitMQConfig.java

@@ -0,0 +1,32 @@
+package cn.tr.module.smart.common.config;
+
+import cn.tr.module.smart.common.enums.RabbitMQConstant;
+import org.springframework.amqp.core.Binding;
+import org.springframework.amqp.core.BindingBuilder;
+import org.springframework.amqp.core.Queue;
+import org.springframework.amqp.core.TopicExchange;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class RabbitMQConfig {
+
+    @Bean
+    public TopicExchange topicExchange() {
+        // 设置交换机持久化
+        return new TopicExchange(RabbitMQConstant.TOPIC_EXCHANGE_NAME, true, false);
+    }
+
+    @Bean
+    public Queue patientMonitorQueue() {
+        // 设置队列不持久化,并且在没有消费者时自动删除
+        return new Queue(RabbitMQConstant.QUEUE_PATIENT_MONITOR, false, false, true);
+    }
+
+    @Bean
+    public Binding patientMonitorBinding() {
+        return BindingBuilder.bind(patientMonitorQueue())
+                .to(topicExchange())
+                .with(RabbitMQConstant.ROUTING_KEY_PATIENT_MONITOR);
+    }
+}

+ 226 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/NbPumpInfusionDTO.java

@@ -0,0 +1,226 @@
+package cn.tr.module.smart.common.dto;
+
+import cn.hutool.core.text.CharSequenceUtil;
+import cn.hutool.core.util.EnumUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.tr.module.smart.common.enums.FlowStatusEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName PatientMonitorResult.java
+ * @Description TODO
+ * @createTime 2022年04月21日 15:57:00
+ */
+@ApiModel("网络泵输注试题")
+@Data
+@ToString
+public class NbPumpInfusionDTO implements Serializable {
+    @ApiModelProperty("输注id")
+    private String infusionId;
+
+    @ApiModelProperty(value = "格式化后的病号")
+    private String patientCode;
+
+    private String classification;
+
+    private Integer dataNum;
+
+    @ApiModelProperty(value = "设备id")
+    private String deviceId;
+
+    @ApiModelProperty(value = "泵别名")
+    private String deviceAlias;
+
+    @ApiModelProperty(value = "总量")
+    private Integer totalDose;
+
+    @ApiModelProperty(value = "公共参数-首次量")
+    private Integer firstDose;
+
+    @ApiModelProperty(value = "公共参数-电量")
+    private Integer electricQuantity;
+
+    @ApiModelProperty(value = "公共参数-剩余量")
+    private BigDecimal remainDose;
+
+    @ApiModelProperty(value = "公共参数-已输入量")
+    private BigDecimal inputDose;
+
+    @ApiModelProperty(value = "公共参数-追加量")
+    private BigDecimal appendDose;
+
+    @ApiModelProperty(value = "公共参数-追加锁时")
+    private BigDecimal appendLockTime;
+
+    @ApiModelProperty(value = "公共参数-极限量")
+    private BigDecimal maxDose;
+
+    @ApiModelProperty(value = "公共参数-自控锁时")
+    private BigDecimal selfControlLockTime;
+
+    @ApiModelProperty(value = "公共参数-自控次数")
+    private BigDecimal selfControlCount;
+
+    @ApiModelProperty(value = "公共参数-pca有效次数")
+    private Integer pcaValidCount;
+
+    @ApiModelProperty(value = "公共参数-pca无效次数")
+    private Integer pcaInvalidCount;
+
+    @ApiModelProperty(value = "公共参数-pca总按次数")
+    private Integer pcaTotalCount;
+
+    @ApiModelProperty(value = "持续泵参数-持续量")
+    private BigDecimal continueDose;
+
+    @ApiModelProperty(value = "脉冲泵参数-脉冲量")
+    private Integer pulseDose;
+
+    @ApiModelProperty(value = "脉冲泵参数-脉冲锁时")
+    private Integer pulseLockTime;
+
+    @ApiModelProperty(value = "脉冲泵参数-脉冲首次锁时")
+    private Integer pulseFirstLockTime;
+
+    @ApiModelProperty(value = "智能泵参数-加档周期")
+    private BigDecimal flowUpCycle;
+
+    @ApiModelProperty(value = "智能泵参数-减档周期")
+    private BigDecimal flowDownCycle;
+
+    @ApiModelProperty(value = "智能泵参数-计次")
+    private BigDecimal flowCount;
+
+    @ApiModelProperty(value = "智能泵参数-上限")
+    private BigDecimal flowUpLimit;
+
+    @ApiModelProperty(value = "智能泵参数-下限")
+    private BigDecimal flowDownLimit;
+
+    @ApiModelProperty(value = "智能泵参数-自调比例")
+    private BigDecimal flowAdjustRate;
+
+
+    @ApiModelProperty(value = "泵运行状态")
+    private String deviceRunState;
+
+    @ApiModelProperty(value = "报警信息")
+    private String deviceAlarm;
+
+    @ApiModelProperty(value = "输注开始时间,即本次运行开机时间")
+    private Date infusionStartTime;
+
+    @ApiModelProperty(value = "输注是否已结束")
+    private Boolean infusionFinished;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "泵类型")
+    private String deviceType;
+
+    @ApiModelProperty(value = "麻醉医生")
+    private String anaDoctor;
+
+    @ApiModelProperty(value = "麻醉方式")
+    private String anaType;
+
+    @ApiModelProperty(value = "镇痛方式")
+    private String analType;
+
+    @ApiModelProperty(value = "手术医生")
+    private String surgeryDoctor;
+
+    @ApiModelProperty(value = "手术名称")
+    private String surgeryName;
+
+    @ApiModelProperty(value = "输注即将结束提醒")
+    private Boolean warnWillFinished;
+
+    @ApiModelProperty(value = "镇痛不足提醒")
+    private Boolean warnAnalgesicPoor;
+
+    @ApiModelProperty(value = "电量偏低提醒")
+    private Boolean warnLowBattery;
+
+    @ApiModelProperty(value = "加减档提示")
+    private String warnFlow;
+
+    @ApiModelProperty("提醒字段")
+    private String warns;
+
+    @ApiModelProperty("最后上传时间")
+    private Date lastUploadTime;
+    private void judgeWarnWillFinished() {
+        if(!Boolean.TRUE.equals(this.warnWillFinished)){
+            return;
+        }
+        if (CharSequenceUtil.isEmpty(this.warns)) {
+            this.warns="输注即将结束;";
+        }else {
+            this.warns=this.warns+"输注即将结束;";
+        }
+    }
+
+    private void judgeWarnAnalgesicPoor() {
+        if(!Boolean.TRUE.equals(this.warnAnalgesicPoor)){
+            return;
+        }
+        if (CharSequenceUtil.isEmpty(this.warns)) {
+            this.warns="镇痛不足;";
+        }else {
+            this.warns=this.warns+"镇痛不足;";
+        }
+    }
+
+    private void judgeWarnLowBattery() {
+        if(!Boolean.TRUE.equals(this.warnLowBattery)){
+            return;
+        }
+        if (CharSequenceUtil.isEmpty(this.warns)) {
+            this.warns="电量偏低;";
+        }else {
+            this.warns=this.warns+"电量偏低;";
+        }
+    }
+
+    private void judgeWarnFlow() {
+        if(this.warnFlow==null){
+            return;
+        }
+        FlowStatusEnum flow = EnumUtil.likeValueOf( FlowStatusEnum.class,this.warns);
+        if (ObjectUtil.isNull(flow)) {
+            return;
+        }
+        if (CharSequenceUtil.isEmpty(this.warns)) {
+            this.warns=flow.getText()+";";
+        }else {
+            this.warns=this.warns+flow.getText()+";";
+        }
+    }
+
+    public void handleWarn(){
+        judgeWarnAnalgesicPoor();
+        judgeWarnFlow();
+        judgeWarnLowBattery();
+        judgeWarnWillFinished();
+    }
+
+    public String getWarns() {
+        if (StrUtil.isNotEmpty(warns)) {
+            return warns.endsWith(";")?warns.substring(0,warns.length()-1):warns;
+        }
+        return warns;
+
+    }
+}

+ 37 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/enums/FlowStatusEnum.java

@@ -0,0 +1,37 @@
+package cn.tr.module.smart.common.enums;
+
+import com.baomidou.mybatisplus.annotation.IEnum;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+
+/**
+ * @Author 龙三郎
+ * @Date 2022-04-26 09:28:34
+ * @Version 1.0
+ * @Description 智能泵提示
+ */
+@AllArgsConstructor
+@Getter
+public enum FlowStatusEnum  {
+    /**
+     * 0 --- 正常(默认值)
+     * 1 --- 加档受限
+     * 2 --- 流速已达上限
+     * 3 --- 加档
+     * 4 --- 减档
+     * 5 --- 低输注状态
+     */
+    None(""),
+    Limited("加档受限"),
+    MaxFlow("持续量已达上限"),
+    Up("加档"),
+    Down("减档"),
+    Lowest("低输注状态");
+
+
+    @ApiModelProperty("状态内容")
+    private String text;
+}

+ 11 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/enums/RabbitMQConstant.java

@@ -0,0 +1,11 @@
+package cn.tr.module.smart.common.enums;
+
+
+public interface RabbitMQConstant {
+    // 定义队列、交换机和路由键名称
+    String TOPIC_EXCHANGE_NAME = "nb.exchange";
+
+    String ROUTING_KEY_PATIENT_MONITOR = "patient.monitor";
+
+    String QUEUE_PATIENT_MONITOR = "patient.monitor.queue";
+}

+ 3 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizClinicRoomService.java

@@ -1,6 +1,7 @@
 package cn.tr.module.smart.common.service;
 
 import cn.tr.module.smart.app.controller.dto.*;
+import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomThumbnailVO;
 import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomVO;
 import cn.tr.module.smart.common.dto.BizClinicRoomDTO;
 import cn.tr.module.smart.common.dto.BizClinicRoomQueryDTO;
@@ -119,4 +120,6 @@ public interface IBizClinicRoomService {
     Boolean stdAddDoctorApp(BizClinicAddOrEditDTO source);
 
     Boolean validateCardNo(BizWxUserCheckCardNoDTO source) throws IOException;
+
+    List<WxDoctorClinicRoomThumbnailVO> queryPatientCode(BizClinicAddOrEditDTO source);
 }

+ 9 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizClinicRoomServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
 import cn.tr.core.exception.TRExcCode;
 import cn.tr.core.strategy.LoginUserStrategy;
 import cn.tr.module.smart.app.controller.dto.*;
+import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomThumbnailVO;
 import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomVO;
 import cn.tr.module.smart.common.dto.BizDeptDTO;
 import cn.tr.module.smart.common.enums.ClinicPhaseEnums;
@@ -423,6 +424,11 @@ public class BizClinicRoomServiceImpl implements IBizClinicRoomService {
         return Boolean.TRUE;
     }
 
+    @Override
+    public List<WxDoctorClinicRoomThumbnailVO> queryPatientCode(BizClinicAddOrEditDTO source) {
+        return Collections.emptyList();
+    }
+
     /**
      * 微信小程序基于医生已填写的信息更新数据
      */
@@ -447,4 +453,7 @@ public class BizClinicRoomServiceImpl implements IBizClinicRoomService {
         }
     }
 
+    public static void main(String[] args) {
+        
+    }
 }

+ 5 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizSmsServiceImpl.java

@@ -3,6 +3,7 @@ package cn.tr.module.smart.common.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.RandomUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.tr.core.exception.ServiceException;
 import cn.tr.core.exception.TRExcCode;
 import cn.tr.module.api.sys.sms.BizSmsPOJO;
@@ -31,6 +32,10 @@ public class BizSmsServiceImpl implements IBizSmsService {
         if(ObjectUtil.isNull(source.getType())){
             throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"短信类型不能为空");
         }
+        String smsCode = self.getSmsCode(source.getType(), source.getPhone());
+        if(StrUtil.isNotEmpty(smsCode)){
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"短信已发送");
+        }
         int validateCode = RandomUtil.randomInt(1000,9999);
         Map<String, Object> param = new HashMap<>();
         param.put("code",validateCode);

+ 3 - 0
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizClinicRoomMapper.xml

@@ -59,10 +59,13 @@
         bqa.answer_time       as last_modify_question_time,
         su.id                 as doctor_id,
         su.nickname           as doctor_nickname,
+        bp.new_human as new_human,
+        bp.card_no as card_no,
         bcr.last_before_question_time as last_before_question_time,
         bcr.last_pain_assessment_time as last_pain_assessment_time,
         bcr.last_after_question_time as last_after_question_time
         from biz_clinic_room as bcr
+        join biz_patient as bp on bp.id = bcr.patient_id
         join biz_clinic_room_wx_user as bcrwu on bcrwu.clinic_room_id = bcr.id
         left join biz_clinic_room_doctor_user as bcrmu on bcrmu.clinic_room_id = bcr.id
         left join sys_user as su on bcrmu.user_id = su.id