Explorar o código

优化填写生命体征功能

lighter hai 7 meses
pai
achega
33c80a358c

+ 3 - 2
src/main/java/thyyxxk/webserver/controller/outpatient/triage/TriageController.java

@@ -109,8 +109,9 @@ public class TriageController {
     }
 
     @GetMapping("/getMzVitalSigns")
-    public ResultVo<MzYshTzxx> getMzVitalSigns(@RequestParam("patientId") String patientId) {
-        return service.getMzVitalSigns(patientId);
+    public ResultVo<MzYshTzxx> getMzVitalSigns(@RequestParam("patientId") String patientId,
+                                               @RequestParam("times") Integer times) {
+        return service.getMzVitalSigns(patientId, times);
     }
 
     @PostMapping("/saveMzVitalSigns")

+ 6 - 6
src/main/java/thyyxxk/webserver/dao/his/outpatient/triage/TriageDao.java

@@ -183,18 +183,18 @@ public interface TriageDao {
             "</script>")
     List<MzfzPatientOrder> getAllPatients(@Param("deptCodes") String[] deptCodes, @Param("content") String content);
 
-    @Select("select * from mz_ysh_tzxx where patient_id=#{patientId} and datediff(day, visit_date, getdate())=0")
-    MzYshTzxx getMzVitalSigns(@Param("patientId") String patientId);
+    @Select("select * from mz_ysh_tzxx where patient_id=#{patientId} and times=#{times}")
+    MzYshTzxx getMzVitalSigns(String patientId, Integer times);
 
     @Update("update mz_ysh_tzxx set value_sg=#{valueSg}, value_tz=#{valueTz}, value_tw=#{valueTw}, " +
             "value_mb=#{valueMb}, value_hx=#{valueHx},value_ssy=#{valueSsy},value_szy=#{valueSzy}, " +
-            "visit_remark=#{visitRemark} where patient_id=#{patientId} and datediff(day, visit_date, getdate())=0")
+            "visit_remark=#{visitRemark} where patient_id=#{patientId} and times=#{times}")
     void updateMzVitalSigns(MzYshTzxx param);
 
-    @Insert("insert into mz_ysh_tzxx (patient_id, visit_date, value_sg, value_tz, value_tw, value_mb, " +
-            "value_hx, value_ssy, value_szy, visit_remark) values " +
+    @Insert("insert into mz_ysh_tzxx (patient_id,visit_date,value_sg,value_tz,value_tw,value_mb, " +
+            "value_hx,value_ssy,value_szy,visit_remark,times) values " +
             "(#{patientId},#{visitDate},#{valueSg},#{valueTz},#{valueTw},#{valueMb}, " +
-            "#{valueHx},#{valueSsy},#{valueSzy},#{visitRemark})")
+            "#{valueHx},#{valueSsy},#{valueSzy},#{visitRemark},#{times})")
     void insertMzVitalSigns(MzYshTzxx param);
 
     @Select("select dept_code,rtrim(room_code) as room_code,serial_no,rtrim(name) as name,fz_no, " +

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/outpatient/triage/MzYshTzxx.java

@@ -18,6 +18,8 @@ public class MzYshTzxx  implements Serializable {
 	 */
 	private String patientId;
 
+	private Integer times;
+
 	/**
 	 * 时间
 	 */

+ 1 - 1
src/main/java/thyyxxk/webserver/service/externalhttp/WebSocketService.java

@@ -14,7 +14,7 @@ public interface WebSocketService {
     ResultVo<String> sendMessageBySid(@JSONBody ApiMessageBody body);
 
     @Post(value = "/sendMessageByUserCode", async = true)
-    ResultVo<String> sendMessageByUserCode(@JSONBody ApiMessageBody body);
+    void sendMessageByUserCode(@JSONBody ApiMessageBody body);
 
     @Post(value = "/sendMessageByGroupId", async = true)
     void sendMessageByGroupId(@JSONBody ApiMessageBody body);

+ 4 - 3
src/main/java/thyyxxk/webserver/service/outpatient/triage/TriageService.java

@@ -256,20 +256,21 @@ public class TriageService {
         return ResultVoUtil.success(list);
     }
 
-    public ResultVo<MzYshTzxx> getMzVitalSigns(String patientId) {
+    public ResultVo<MzYshTzxx> getMzVitalSigns(String patientId, Integer times) {
         log.info("获取生命体征:{}", patientId);
-        MzYshTzxx vitalSigns = dao.getMzVitalSigns(patientId);
+        MzYshTzxx vitalSigns = dao.getMzVitalSigns(patientId, times);
         if (null == vitalSigns) {
             vitalSigns = new MzYshTzxx();
         }
         vitalSigns.setPatientId(patientId);
+        vitalSigns.setTimes(times);
         vitalSigns.setVisitDate(new Date());
         return ResultVoUtil.success(vitalSigns);
     }
 
     public ResultVo<String> saveMzVitalSigns(MzYshTzxx param) {
         log.info("保存生命体征:{}", param);
-        if (null == dao.getMzVitalSigns(param.getPatientId())) {
+        if (null == dao.getMzVitalSigns(param.getPatientId(), param.getTimes())) {
             dao.insertMzVitalSigns(param);
         } else {
             dao.updateMzVitalSigns(param);

+ 1 - 1
src/main/resources/application-dev.yml

@@ -94,7 +94,7 @@ forest:
   log-response-status: true
   connect-timeout: 1500
   variables:
-    socketCenter: http://localhost:8707/socketApi
+    socketCenter: http://demo.hnthyy.cn:8707/socketApi
     emrUrl: "http://172.16.32.125:8001/emr/runtime/api/v1"
 
 management: