Browse Source

电子病历质控优化

DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
bbb7c3896c

+ 4 - 2
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/EmrControlDao.java

@@ -156,11 +156,13 @@ public interface EmrControlDao {
             "  and times = #{times} " +
             "  and ${sql} " +
             "  and date >= convert(varchar(10), getdate(), 120)" +
-            "  and flag = 1 " +
+            "  and flag = 1" +
+            "  and input_id = #{inputId} " +
             "order by date desc ")
     EmrRuleUnlock selectRemoveRestrictions(String patNo,
                                            Integer times,
-                                           String sql);
+                                           String sql,
+                                           String inputId);
 
 
     @Select("<script>" +

+ 5 - 2
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/EmrPatientDao.java

@@ -204,7 +204,9 @@ public interface EmrPatientDao {
             "  and flag = 1 " +
             "  and date = (select max(date) " +
             "from emr_rule_unlock where pat_no = #{patNo} " +
-            "and times = #{times} and code = #{emrCategoryCode} and flag = 1)")
+            " and times = #{times} and code = #{emrCategoryCode} and flag = 1) " +
+            " and input_id = #{createId}" +
+            " and emr_id is null")
     void unlockMedicalRecords(EmrPatientData param);
 
 
@@ -323,7 +325,8 @@ public interface EmrPatientDao {
             "       admiss_times, " +
             "       detail_no, " +
             "       userid=(select rtrim(name) name from a_employee_mi where code = userid)," +
-            "       GLU as glu " +
+            "       GLU as glu," +
+            "       heart " +
             "from yz_temperature " +
             "where inpatient_no = #{patNo} " +
             "  and admiss_times = #{times}" +

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

@@ -275,7 +275,7 @@ public class EmrControlRuleSever {
             unlockSql = "code = '" + code + "'";
         }
 
-        EmrRuleUnlock emrRuleUnlock = dao.selectRemoveRestrictions(patNo, times, unlockSql);
+        EmrRuleUnlock emrRuleUnlock = dao.selectRemoveRestrictions(patNo, times, unlockSql, TokenUtil.getTokenUserId());
 
         if (emrRuleUnlock != null) {
             ruleVerify.setFlag(false);

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

@@ -194,6 +194,7 @@ public class EmrServer {
         }
         EmrDataElement emrDataElement = dao.obtainPatientSOriginalData(param.getPatNo(), param.getTimes());
         if (emrDataElement == null) {
+            // 创建的病历可以解锁了
             dao.insertDataSource(param.getPatNo(), param.getTimes(), JSON.toJSONString(extractedData));
         } else {
             JSONObject jsonObject = JSONObject.parseObject(emrDataElement.getDataElement());
@@ -201,7 +202,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;