Browse Source

可以通过医保电子凭证分诊

lighter 2 years ago
parent
commit
8ad8e66914

+ 5 - 0
src/main/java/thyyxxk/webserver/controller/triage/TriageController.java

@@ -32,6 +32,11 @@ public class TriageController {
         return service.getUnTriagedPatients(currentPage, pageSize);
     }
 
+    @GetMapping("/getPatientIdByIdNo")
+    public ResultVo<List<String>> getPatientIdByIdNo(@RequestParam("idNo") String idNo) {
+        return service.getPatientIdByIdNo(idNo);
+    }
+
     @GetMapping("/getTriagedPatients")
     public ResultVo<List<MzfzPatientOrder>> getTriagedPatients() {
         return service.getTriagedPatients();

+ 10 - 7
src/main/java/thyyxxk/webserver/dao/his/triage/TriageDao.java

@@ -15,6 +15,9 @@ public interface TriageDao {
     @Select("select chosen_dept from t_triage_user_depts where code=#{code}")
     String selectChosenDepts(@Param("code") String code);
 
+    @Select("select rtrim(patient_id) from mz_patient_mi where social_no=#{idNo}")
+    List<String> selectPatientIdByIdNo(@Param("idNo") String idNo);
+
     // 根据code获取科室信息
     @Select("<script>" +
             "select rtrim(code) as code, rtrim(name) as name, rtrim(py_code) as pyCode " +
@@ -27,12 +30,12 @@ public interface TriageDao {
 
     // 获取未分诊的病人
     @Select("<script>" +
-            "select visit_date,patient_id, times, name, " +
+            "select visit_date,rtrim(patient_id) as patientId, times,rtrim(name) as name, " +
             "dept_code, dept_name=(select name from zd_unit_code where code=dept_code), " +
             "room_code,room_name=(select room_name from mzfz_zd_dept_room where room_code=a.room_code), " +
             "room_status=(select status_flag from mzfz_zd_dept_room where room_code=a.room_code), " +
             "doctor_code,doctor_name=(select name from a_employee_mi where code=doctor_code), " +
-            "serial_no, gh_no, req_type,req_name=(select name from mzy_zd_charge_type where code=a.req_type), " +
+            "serial_no, gh_no, req_type,reqName=(select rtrim(name) from mzy_zd_charge_type where code=a.req_type), " +
             "fz_no, slow_flag, status_flag, status_time,call_time, req_order, ampm, " +
             "req_fee=(select req_fee from mzy_reqrec where patient_id=a.patient_id and times=a.times)," +
             "clinic_fee=(select clinic_fee from mzy_reqrec where patient_id=a.patient_id and times=a.times) " +
@@ -52,7 +55,7 @@ public interface TriageDao {
             "room_code,room_name=(select room_name from mzfz_zd_dept_room where room_code=a.room_code), " +
             "room_status=(select status_flag from mzfz_zd_dept_room where room_code=a.room_code), " +
             "doctor_code,doctor_name=(select name from a_employee_mi where code=doctor_code), " +
-            "serial_no, gh_no, req_type,req_name=(select name from mzy_zd_charge_type where code=a.req_type), " +
+            "serial_no, gh_no, req_type,reqName=(select rtrim(name) from mzy_zd_charge_type where code=a.req_type), " +
             "fz_no, slow_flag, status_flag, status_time,call_time, req_order, ampm " +
             "from mzfz_patient_order a where datediff(day, visit_date, getdate())=0 and status_flag='1' " +
             "and dept_code in " +
@@ -69,7 +72,7 @@ public interface TriageDao {
             "room_code,room_name=(select room_name from mzfz_zd_dept_room where room_code=a.room_code), " +
             "room_status=(select status_flag from mzfz_zd_dept_room where room_code=a.room_code), " +
             "doctor_code,doctor_name=(select name from a_employee_mi where code=doctor_code), " +
-            "serial_no, gh_no, req_type,req_name=(select name from mzy_zd_charge_type where code=a.req_type), " +
+            "serial_no, gh_no, req_type,reqName=(select rtrim(name) from mzy_zd_charge_type where code=a.req_type), " +
             "fz_no, slow_flag, status_flag, status_time,call_time, req_order, ampm " +
             "from mzfz_patient_order a where datediff(day, visit_date, getdate())=0 and status_flag='9' " +
             "and dept_code in " +
@@ -91,7 +94,7 @@ public interface TriageDao {
             "doctor_title=(select rtrim(name) from zd_emp_title where code=(select emp_tit_code from a_employee_mi where " +
             "code=doctor_code))," +
             "phone_no=(select rtrim(isnull(phone_no,'-')) from mz_patient_mi where patient_id=a.patient_id)," +
-            "serial_no, gh_no, req_type,req_name=(select name from mzy_zd_charge_type where code=a.req_type), " +
+            "serial_no, gh_no, req_type,reqName=(select rtrim(name) from mzy_zd_charge_type where code=a.req_type), " +
             "fz_no, slow_flag, status_flag, status_time,call_time, req_order, ampm " +
             "from mzfz_patient_order a where datediff(day, visit_date, getdate())=0 " +
             "and status_flag in ('1','3') " +
@@ -103,7 +106,7 @@ public interface TriageDao {
     List<MzfzPatientOrder> getBigScreenData(@Param("deptCodes") String[] deptCodes);
 
     // 根据科室code获取诊室信息
-    @Select("select a.*, b.name as doctor_name,c.name as req_name from mzfz_zd_dept_room a, " +
+    @Select("select a.*, b.name as doctor_name,rtrim(c.name) as reqName from mzfz_zd_dept_room a, " +
             "a_employee_mi b, mzy_zd_charge_type c where a.dept_code=#{deptCode} and " +
             "b.code = a.doctor_code and c.code=a.req_type and a.status_flag=0 ")
     List<MzfzZdDeptRoom> getRooms(@Param("deptCode") String deptCode);
@@ -151,7 +154,7 @@ public interface TriageDao {
             "address=(select rtrim(isnull(adress,'-')) from mz_patient_mi where patient_id=a.patient_id)," +
             "room_status=(select status_flag from mzfz_zd_dept_room where room_code=a.room_code), " +
             "doctor_code,doctor_name=(select name from a_employee_mi where code=doctor_code), " +
-            "serial_no, gh_no, req_type,req_name=(select name from mzy_zd_charge_type where code=a.req_type), " +
+            "serial_no, gh_no, req_type,reqName=(select rtrim(name) from mzy_zd_charge_type where code=a.req_type), " +
             "fz_no, slow_flag, status_flag, status_time,call_time, req_order, ampm, " +
             "req_fee=(select req_fee from mzy_reqrec where patient_id=a.patient_id and times=a.times)," +
             "clinic_fee=(select clinic_fee from mzy_reqrec where patient_id=a.patient_id and times=a.times) " +

+ 8 - 0
src/main/java/thyyxxk/webserver/service/triage/TriageService.java

@@ -52,6 +52,14 @@ public class TriageService {
         return ResultVoUtil.success(map);
     }
 
+    public ResultVo<List<String>> getPatientIdByIdNo(String idNo) {
+        List<String> ids = dao.selectPatientIdByIdNo(idNo);
+        if (ids.isEmpty()) {
+            return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "患者在我院的就诊卡没有绑定身份证,无法查找。");
+        }
+        return ResultVoUtil.success(ids);
+    }
+
     public ResultVo<List<MzfzPatientOrder>> getTriagedPatients() {
         String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getTokenUserId()));
         if (depts.length == 0) {