Browse Source

门诊电子病历新增结束就诊

xiaochan 2 months ago
parent
commit
f3870526e5

+ 87 - 87
src/main/java/thyyxxk/webserver/api/ccbmispos/CcbMisPosApi.java

@@ -1,87 +1,87 @@
-package thyyxxk.webserver.api.ccbmispos;
-
-import com.ccb.wlpt.RequestProcess;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import thyyxxk.webserver.config.auth.PassToken;
-import thyyxxk.webserver.config.envionment.CcbMisConfig;
-
-import java.util.Objects;
-
-@Slf4j
-@RestController
-@RequestMapping("/api/ccbmispos")
-public class CcbMisPosApi {
-    private volatile boolean initialized = false;
-    private final CcbMisConfig cfg;
-
-    @Autowired
-    public CcbMisPosApi(CcbMisConfig cfg) {
-        this.cfg = cfg;
-    }
-
-    @PassToken
-    @GetMapping("/initFileCert")
-    public String initFileCert() {
-        log.info("initFileCert:{}", cfg);
-        String initResult = RequestProcess.initFileCert(cfg.getMchId(), cfg.getUserid(),
-                cfg.getCertFile(), cfg.getCertPassword(), cfg.getConfigFile());
-        if (Objects.equals(initResult, "")) {
-            initResult = "INIT SUCCESS";
-            initialized = true;
-        } else {
-            initialized = false;
-            initResult = "INIT FAILED:" + initResult;
-        }
-        log.info("initResult:{}", initResult);
-        return initResult;
-    }
-
-    @PassToken
-    @GetMapping("/removeFileCert")
-    public String removeFileCert() {
-        RequestProcess.removeFileCert(cfg.getMchId(), cfg.getUserid());
-        return "OK";
-    }
-
-    @PassToken
-    @GetMapping("/downloadTradeList")
-    public String downloadTradeList() {
-        if (!initialized) {
-            String initResult = initFileCert();
-            if (!Objects.equals(initResult, "INIT SUCCESS")) {
-                return initResult;
-            }
-        }
-        String xml = "<?xml version=\"1.0\" encoding=\"GB2312\" standalone=\"yes\" ?>  \n" +
-                "<TX>   \n" +
-                "  <REQUEST_SN>" + System.currentTimeMillis() + "000</REQUEST_SN>  \n" +
-                "  <CUST_ID>"+cfg.getMchId() +"</CUST_ID>  \n" +
-                "  <USER_ID>"+cfg.getUserid()+"</USER_ID>  \n" +
-                "  <PASSWORD>"+cfg.getUserPassword()+"</PASSWORD>  \n" +
-                "  <TX_CODE>5W1005</TX_CODE>  \n" +
-                "  <LANGUAGE>CN</LANGUAGE>  \n" +
-                "  <TX_INFO>  \n" +
-                "    <DATE>20250715</DATE>  \n" +
-                "    <KIND>1</KIND>  \n" +
-                "    <FILETYPE>1</FILETYPE>  \n" +
-                "    <TYPE>0</TYPE>  \n" +
-                "    <NORDERBY>1</NORDERBY>  \n" +
-                "    <POS_CODE></POS_CODE>  \n" +
-                "    <ORDER></ORDER>  \n" +
-                "    <STATUS>1</STATUS>  \n" +
-                "    <BILL_FLAG>1</BILL_FLAG>  \n" +
-                "    <Mrch_No></Mrch_No>  \n" +
-                "    <GROUP_FLAG>0</GROUP_FLAG>  \n" +
-                "    <TXN_TPCD>1</TXN_TPCD>  \n" +
-                "  </TX_INFO>\n" +
-                "</TX> \n";
-        log.info("入参:\r\n{}", xml);
-        String result =  RequestProcess.sendRequest(cfg.getServiceUrl(), xml);
-        log.info("出参:\r\n{}", result);
-        return result;
-    }
-}
+//package thyyxxk.webserver.api.ccbmispos;
+//
+//import com.ccb.wlpt.RequestProcess;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//import thyyxxk.webserver.config.auth.PassToken;
+//import thyyxxk.webserver.config.envionment.CcbMisConfig;
+//
+//import java.util.Objects;
+//
+//@Slf4j
+//@RestController
+//@RequestMapping("/api/ccbmispos")
+//public class CcbMisPosApi {
+//    private volatile boolean initialized = false;
+//    private final CcbMisConfig cfg;
+//
+//    @Autowired
+//    public CcbMisPosApi(CcbMisConfig cfg) {
+//        this.cfg = cfg;
+//    }
+//
+//    @PassToken
+//    @GetMapping("/initFileCert")
+//    public String initFileCert() {
+//        log.info("initFileCert:{}", cfg);
+//        String initResult = RequestProcess.initFileCert(cfg.getMchId(), cfg.getUserid(),
+//                cfg.getCertFile(), cfg.getCertPassword(), cfg.getConfigFile());
+//        if (Objects.equals(initResult, "")) {
+//            initResult = "INIT SUCCESS";
+//            initialized = true;
+//        } else {
+//            initialized = false;
+//            initResult = "INIT FAILED:" + initResult;
+//        }
+//        log.info("initResult:{}", initResult);
+//        return initResult;
+//    }
+//
+//    @PassToken
+//    @GetMapping("/removeFileCert")
+//    public String removeFileCert() {
+//        RequestProcess.removeFileCert(cfg.getMchId(), cfg.getUserid());
+//        return "OK";
+//    }
+//
+//    @PassToken
+//    @GetMapping("/downloadTradeList")
+//    public String downloadTradeList() {
+//        if (!initialized) {
+//            String initResult = initFileCert();
+//            if (!Objects.equals(initResult, "INIT SUCCESS")) {
+//                return initResult;
+//            }
+//        }
+//        String xml = "<?xml version=\"1.0\" encoding=\"GB2312\" standalone=\"yes\" ?>  \n" +
+//                "<TX>   \n" +
+//                "  <REQUEST_SN>" + System.currentTimeMillis() + "000</REQUEST_SN>  \n" +
+//                "  <CUST_ID>"+cfg.getMchId() +"</CUST_ID>  \n" +
+//                "  <USER_ID>"+cfg.getUserid()+"</USER_ID>  \n" +
+//                "  <PASSWORD>"+cfg.getUserPassword()+"</PASSWORD>  \n" +
+//                "  <TX_CODE>5W1005</TX_CODE>  \n" +
+//                "  <LANGUAGE>CN</LANGUAGE>  \n" +
+//                "  <TX_INFO>  \n" +
+//                "    <DATE>20250715</DATE>  \n" +
+//                "    <KIND>1</KIND>  \n" +
+//                "    <FILETYPE>1</FILETYPE>  \n" +
+//                "    <TYPE>0</TYPE>  \n" +
+//                "    <NORDERBY>1</NORDERBY>  \n" +
+//                "    <POS_CODE></POS_CODE>  \n" +
+//                "    <ORDER></ORDER>  \n" +
+//                "    <STATUS>1</STATUS>  \n" +
+//                "    <BILL_FLAG>1</BILL_FLAG>  \n" +
+//                "    <Mrch_No></Mrch_No>  \n" +
+//                "    <GROUP_FLAG>0</GROUP_FLAG>  \n" +
+//                "    <TXN_TPCD>1</TXN_TPCD>  \n" +
+//                "  </TX_INFO>\n" +
+//                "</TX> \n";
+//        log.info("入参:\r\n{}", xml);
+//        String result =  RequestProcess.sendRequest(cfg.getServiceUrl(), xml);
+//        log.info("出参:\r\n{}", result);
+//        return result;
+//    }
+//}

+ 6 - 0
src/main/java/thyyxxk/webserver/controller/outpatient/thmz/MzEmrController.java

@@ -96,4 +96,10 @@ public class MzEmrController {
         return service.print(documentId);
     }
 
+    @GetMapping("/endOfVisit")
+    public ResultVo<String> endOfVisit(@RequestParam("patientNo") String patientNo,
+                                       @RequestParam("times") Integer times) {
+        return service.endOfVisit(patientNo, times);
+    }
+
 }

+ 8 - 0
src/main/java/thyyxxk/webserver/dao/his/outpatient/thmz/MzEmrDao.java

@@ -39,4 +39,12 @@ public interface MzEmrDao extends BaseMapper<MzEmrPatientData> {
 
     @Update("update mz_emr_patient_data set del_flag = 0 where emr_document_id = #{id}")
     int restoreMedicalRecords(String id);
+
+
+    @Update("update mz_visit_list\n" +
+            "set visit_status = 1 , visit_end_time = getdate()\n" +
+            "where patient_id = #{patientNo}\n" +
+            "  and times = #{times}\n" +
+            "  and visit_doctor = #{visitDoctor} and visit_status = 0")
+    int endOfVisit(String patientNo, Integer times, String visitDoctor);
 }

+ 8 - 0
src/main/java/thyyxxk/webserver/service/outpatient/thmz/MzEmrService.java

@@ -284,4 +284,12 @@ public class MzEmrService {
     }
 
 
+    public ResultVo<String> endOfVisit(String patientNo, Integer times) {
+        int i = dao.endOfVisit(patientNo, times, TokenUtil.getInstance().getTokenUserId());
+        if (i > 0) {
+            return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
+        }
+        return R.fail(ExceptionEnum.LOGICAL_ERROR, "操作失败,可能原因就诊医生不是您,或者已经完成了结束就诊了。");
+    }
+
 }