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

手术申请显示和提示

xiaochan 2 éve
szülő
commit
cc5ce0f943

+ 14 - 0
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/ShouShuShenQingController.java

@@ -5,6 +5,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
+import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.entity.zhuyuanyisheng.query.ChaXunJianChaHeJianYan;
 import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.OpRecord;
 import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.ShouShuFanHui;
@@ -39,6 +40,19 @@ public class ShouShuShenQingController {
         return server.obtainSurgicalItems(name, type);
     }
 
+
+    @GetMapping("/getDoctorByOpCode")
+    public ResultVo<List<CodeName>> getDoctorByOpCode(@RequestParam("opCode") String opCode) {
+        return server.getDoctorByOpCode(opCode);
+    }
+
+    @GetMapping("/preoperativeDiscussion")
+    public ResultVo<Boolean> preoperativeDiscussion(@RequestParam("patNo") String patNo,
+                                                    @RequestParam("times") Integer times,
+                                                    @RequestParam("count") Integer count) {
+        return server.preoperativeDiscussion(patNo, times, count);
+    }
+
     @GetMapping("/shouShuShenQingCeBianLan")
     public ResultVo<List<GetDropdownBox>> shouShuShenQingCeBianLan() {
         return server.shouShuShenQingCeBianLan();

+ 14 - 2
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/ShouShuShenQingDao.java

@@ -3,7 +3,9 @@ package thyyxxk.webserver.dao.his.zhuyuanyisheng;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.*;
+import org.aspectj.apache.bcel.classfile.Code;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
+import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.OpRecord;
 import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.ShouShuFanHui;
 import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.ZdIcd9Cm3;
@@ -27,7 +29,7 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
     @Select("<script>" +
             "select op_type_name = (select name from zd_operation_type where code = op_type), " +
             "       rtrim(code) as code," +
-            "       name " +
+            "       rtrim(name) name,op_scale " +
             "from zd_icd9_cm3 " +
             "where (code like #{name} or name like #{name} or py_code like #{name} or d_code like #{name}) " +
             "<if test=\"type !=null and type != 0 \">" +
@@ -37,6 +39,9 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
     List<ZdIcd9Cm3> obtainSurgicalItems(String name,
                                         Integer type);
 
+    @Select("select code as code,name_doctor as name from op_level_management where code_op = #{code} ")
+    List<CodeName> getDoctorByOpCode(String code);
+
     @Select("select rtrim(op_name) as  value " +
             "from op_record with (NOLOCK) " +
             "where inpatient_no = #{patNo} " +
@@ -46,6 +51,13 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
                                                @Param("times") Integer times,
                                                @Param("name") String name);
 
+
+    @Select("select count(1) from op_record where inpatient_no = #{patNo} and admiss_times = #{times} and status <> 'd' ")
+    int currentPatientOpCount(String patNo, Integer times);
+
+    @Select("select count(1) from emr_patient_data where pat_no = #{patNo} and times = #{times} and del_flag = 0  and emr_category_code = 'shuqiantaolun' ")
+    int currentEmrPreoperativelyDiscussCount(String patNo, Integer times);
+
     @Select("SELECT a.code, a.name " +
             "FROM ysh_zd_ss_type a with (NOLOCK), " +
             "     yz_order_item b with (NOLOCK) " +
@@ -72,7 +84,7 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
             "       diag_before_op /* 术前诊断 */, " +
             "       diag_before_code, " +
             "       hocus_code, " +
-            "       hocus_code_name = (select rtrim(name) from zd_anaesthesia with (NOLOCK) where code = hocus_code), " +
+            "       hocusName = (select rtrim(name) from zd_anaesthesia with (NOLOCK) where code = hocus_code), " +
             "       op_scale, " +
             "    /*术后等级不知道*/ " +
             "       doctor_zd_name  = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = doctor_zd)/*主刀医生*/, " +

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/shoushu/ZdIcd9Cm3.java

@@ -47,4 +47,5 @@ public class ZdIcd9Cm3 {
     private Integer pageSize;
 
 
+
 }

+ 19 - 0
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/ShouShuShenQingService.java

@@ -15,6 +15,7 @@ import thyyxxk.webserver.dao.his.zhuyuanyisheng.ShouShuShenQingDao;
 import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
+import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.entity.zhuyuanyisheng.query.ChaXunJianChaHeJianYan;
 import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.OpRecord;
 import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.ShouShuFanHui;
@@ -59,10 +60,28 @@ public class ShouShuShenQingService {
      * @param type 搜索类型
      * @return
      */
+    @DS("his")
     public ResultVo<List<ZdIcd9Cm3>> obtainSurgicalItems(String name, Integer type) {
         return ResultVoUtil.success(dao.obtainSurgicalItems(StringUtil.isContainChinese(name), type));
     }
 
+    @DS("his")
+    public ResultVo<List<CodeName>> getDoctorByOpCode(String opCode) {
+        return ResultVoUtil.success(dao.getDoctorByOpCode(opCode));
+    }
+
+
+    @DS("his")
+    public ResultVo<Boolean> preoperativeDiscussion(String patNo, Integer times, Integer count) {
+        int currentPatientOpCount = dao.currentPatientOpCount(patNo, times);
+        currentPatientOpCount += count;
+        int currentEmrPreoperativelyDiscussCount = dao.currentEmrPreoperativelyDiscussCount(patNo, times);
+        if (currentPatientOpCount > currentEmrPreoperativelyDiscussCount) {
+            return ResultVoUtil.success(true);
+        }
+        return ResultVoUtil.success(false);
+    }
+
 
     public ResultVo<List<GetDropdownBox>> shouShuShenQingCeBianLan() {
         return ResultVoUtil.success(dao.shouShuShenQingCeBianLan());

+ 0 - 1
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/emr/EmrServer.java

@@ -226,7 +226,6 @@ public class EmrServer {
             jsonObject.putAll(extractedData);
             dao.updatePatientDataSource(param.getPatNo(), param.getTimes(), JSON.toJSONString(jsonObject));
         }
-        dao.unlockMedicalRecords(param);
         log.info("提取到的数据:{}", JSON.toJSONString(extractedData));
         return extractedData;
     }