Browse Source

质控意见

xiaochan 2 years ago
parent
commit
ac5ffcab5a

+ 25 - 3
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/emrcontrolrule/QualityControlAnalysisOfMedicalRecords.java

@@ -1,12 +1,13 @@
 package thyyxxk.webserver.entity.zhuyuanyisheng.emrcontrolrule;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
 import lombok.Data;
+import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrAuditDetail;
+import thyyxxk.webserver.utils.ListUtil;
 
 import java.math.BigDecimal;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 
 @Data
 public class QualityControlAnalysisOfMedicalRecords {
@@ -185,6 +186,27 @@ public class QualityControlAnalysisOfMedicalRecords {
         }
     }
 
+    private Map<String, String> qualityControlOpinions = new HashMap<>();
+
+    public void setQualityControlOpinions(EmrAuditDetail auditDetail) {
+        String key = auditDetail.getEmrName();
+        String msg = auditDetail.getName() + "缺陷数【" + auditDetail.getNumberOfDefects() + "】。";
+        String temp = qualityControlOpinions.get(auditDetail.getEmrName());
+        if (temp != null) {
+            temp += msg;
+            qualityControlOpinions.replace(key, temp);
+        } else {
+            qualityControlOpinions.put(key, msg);
+        }
+    }
+
+    public String getOpinion() {
+        if (qualityControlOpinions.isEmpty()) {
+            return "";
+        }
+        return JSON.toJSONString(qualityControlOpinions, SerializerFeature.PrettyFormat);
+    }
+
 
     public String getMessage() {
         if (!mapMessage.isEmpty()) {

+ 7 - 4
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/emr/EmrControlRuleSeverV2.java

@@ -36,6 +36,7 @@ public class EmrControlRuleSeverV2 {
     private final EmrControlDaoV2 dao;
     private final EmrEditor editor;
     private static final ConcurrentHashMap<String, Session> SESSION_MAP = new ConcurrentHashMap<>();
+
     public EmrControlRuleSeverV2(EmrControlDaoV2 dao, EmrEditor editor) {
         this.dao = dao;
         this.editor = editor;
@@ -53,8 +54,11 @@ public class EmrControlRuleSeverV2 {
     public ResultVo<JSONObject> specifyAdmissionQualityControl(String start, String end) {
         QueryWrapper<?> qw = new QueryWrapper<>();
 
-        qw.ge("admiss_date", start);
-        qw.le("admiss_date", end);
+        String sql = "(select count(1) " +
+                "from emr_audit_detail where pat_no = zy.inpatient_no and times = zy.admiss_times and history = 0 " + " and review_time >= ' " + start + "'" +
+                " and review_time <= '" + end + "' ) ";
+
+        qw.ge(sql, 1);
         qw.notLike("inpatient_no", "JT");
 
         List<QualityControlAnalysisOfMedicalRecords> patInfo = getPatients(qw);
@@ -120,7 +124,6 @@ public class EmrControlRuleSeverV2 {
 //                    if (rule.getType() == 2) {
 //                        executedAfterTheEvent(p, error, ruleV2);
 //                    }
-
                     if (rule.getType() == 3) {
                         int count = thingsToDoBeforeTheEvent(p, error, ruleV2);
                         p.setAccordingToTheNumberOfDefects(count);
@@ -141,7 +144,7 @@ public class EmrControlRuleSeverV2 {
             List<EmrAuditDetail> details = dao.patientQualityControl(p.getInpatientNo(), p.getAdmissTimes());
             if (ListUtil.notBlank(details)) {
                 for (EmrAuditDetail detail : details) {
-                    p.setMapMessage("病历:【" + detail.getEmrName() + "】", detail.getName() + "【缺陷数" + detail.getNumberOfDefects() + "】,");
+                    p.setQualityControlOpinions(detail);
                     p.setScore(detail.getScoringCriteria(), detail.getNumberOfDefects());
                 }
             }