Bladeren bron

1.修改规则:医嘱有抗生素使用病程无记录、加用抗生素未记录、减用抗生素未记录、抗生素加用原因不明确、抗生素减用原因不明确

huj 5 jaren geleden
bovenliggende
commit
77a1cd0cff

+ 22 - 10
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03069.java

@@ -45,7 +45,7 @@ public class THR03069 extends QCCatalogue {
         //抗生素加用集合   key:抗生素名    value:  0:未加用,1及以上:加用次数
         Map<String, Integer> antibioticStatus = Maps.newHashMap();
         //抗生素及各初始剂量     key:抗生素名    value:抗生素第一次使用时剂量
-        Map<String, Double> antibioticValue = Maps.newHashMap();
+        Map<String, List<Double>> antibioticValue = Maps.newHashMap();
 
         List<Map<String, String>> docAdvStruct = doctorAdviceDocs
                 .stream()
@@ -88,7 +88,7 @@ public class THR03069 extends QCCatalogue {
         //查房记录中抗生素加用集合   key:抗生素名    value:  0:未加用,1及以上:加用次数
         Map<String, Integer> antibioticStatusWard = Maps.newHashMap();
         //查房记录中抗生素及各初始剂量     key:抗生素名    value:抗生素第一次使用时剂量
-        Map<String, Double> antibioticValueWard = Maps.newHashMap();
+        Map<String, List<Double>> antibioticValueWard = Maps.newHashMap();
         List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
         for (ThreeLevelWardDoc doc : allDoctorWradDocs) {
             if (doc.getThreeLevelWardLabel().size() == 0) {
@@ -114,11 +114,11 @@ public class THR03069 extends QCCatalogue {
             }
         }
         //把查房记录中没加用过的抗生素删除
-        for (Map.Entry<String, Integer> as : antibioticStatusWard.entrySet()) {
+        /*for (Map.Entry<String, Integer> as : antibioticStatusWard.entrySet()) {
             if (as.getValue() == 0) {
                 antibioticDateWard.remove(as.getKey());
             }
-        }
+        }*/
 
         /**
          * 1.antibioticDate:从医嘱中取   key:抗生素名    value:医嘱中该抗生素所有加用时的时间(包括初始使用时间)
@@ -137,14 +137,25 @@ public class THR03069 extends QCCatalogue {
                 miss.add(drugKey);
                 continue;
             }
+            List<Double> antibioticValueList = antibioticValue.get(drugKey);
+            List<Double> antibioticValueWardList = antibioticValueWard.get(drugKey);
+            int findNum = 0;
+            for (int i = 1; i < antibioticValueList.size(); i++) {//从加用的值开始,如果加用过的值查房记录中都有,则不报该药
+                if (antibioticValueWardList.contains(antibioticValueList.get(i))) {
+                    findNum++;
+                }
+            }
+            if (findNum == antibioticValueList.size() - 1) {
+                continue;
+            }
             dateList = ad.getValue();
             int matchNum = 0;
+            List<String> wardDateStr = antibioticDateWard.get(drugKey);
             for (int i = 0; i < dateList.size() - 1; i++) {
                 start = dateList.get(i);        //抗生素开医嘱时间
                 change = dateList.get(i + 1);   //抗生素用量改变时间
                 Date adStart = StringUtil.parseDateTime(start);
                 Date adChange = StringUtil.parseDateTime(change);
-                List<String> wardDateStr = antibioticDateWard.get(drugKey);
                 for (int j = 0; j < wardDateStr.size() - 1; j++) {
                     wardStartStr = wardDateStr.get(j);         //查房记录开抗生素时间
                     wardChangeStr = wardDateStr.get(j + 1);    //查房记录改变抗生素用量时间
@@ -176,7 +187,7 @@ public class THR03069 extends QCCatalogue {
      * @param value            抗生素用量
      * @param startDateStr     抗生素使用时间(医嘱开始时间或查房时间)
      */
-    private void collectAntibioticInfo(Map<String, List<String>> antibioticDate, Map<String, Integer> antibioticStatus, Map<String, Double> antibioticValue, String drugName, String value, String startDateStr) {
+    private void collectAntibioticInfo(Map<String, List<String>> antibioticDate, Map<String, Integer> antibioticStatus, Map<String, List<Double>> antibioticValue, String drugName, String value, String startDateStr) {
         double v = -1;
         try {
             v = Double.parseDouble(getNumber(value));
@@ -187,13 +198,14 @@ public class THR03069 extends QCCatalogue {
             return;
         }
         if (!antibioticValue.containsKey(drugName)) {
-            antibioticValue.put(drugName, v);
+            antibioticValue.put(drugName, Lists.newArrayList(v));
             antibioticDate.put(drugName, Lists.newArrayList(startDateStr));
             antibioticStatus.put(drugName, 0);
         } else {
-            double beforeValue = antibioticValue.get(drugName);
-            if (beforeValue < v) {
-                antibioticValue.put(drugName, v);//更新该抗生素使用值为更大的值
+            List<Double> beforeValue = antibioticValue.get(drugName);
+            if (beforeValue.get(beforeValue.size() - 1) < v) {
+                beforeValue.add(v);
+                antibioticValue.put(drugName, beforeValue);//添加该抗生素更大的值
                 antibioticStatus.put(drugName, antibioticStatus.get(drugName) + 1);
                 antibioticDate.get(drugName).add(startDateStr);
             }

+ 22 - 10
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03072.java

@@ -45,7 +45,7 @@ public class THR03072 extends QCCatalogue {
         //抗生素减用集合   key:抗生素名    value:  0:未减用,1及以上:减用次数
         Map<String, Integer> antibioticStatus = Maps.newHashMap();
         //抗生素及各初始剂量     key:抗生素名    value:抗生素第一次使用时剂量
-        Map<String, Double> antibioticValue = Maps.newHashMap();
+        Map<String, List<Double>> antibioticValue = Maps.newHashMap();
 
         List<Map<String, String>> docAdvStruct = doctorAdviceDocs
                 .stream()
@@ -88,7 +88,7 @@ public class THR03072 extends QCCatalogue {
         //查房记录中抗生素减用集合   key:抗生素名    value:  0:未减用,1及以上:减用次数
         Map<String, Integer> antibioticStatusWard = Maps.newHashMap();
         //查房记录中抗生素及各初始剂量     key:抗生素名    value:抗生素第一次使用时剂量
-        Map<String, Double> antibioticValueWard = Maps.newHashMap();
+        Map<String, List<Double>> antibioticValueWard = Maps.newHashMap();
         List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
         for (ThreeLevelWardDoc doc : allDoctorWradDocs) {
             if (doc.getThreeLevelWardLabel().size() == 0) {
@@ -114,11 +114,11 @@ public class THR03072 extends QCCatalogue {
             }
         }
         //把查房记录中没减用过的抗生素删除
-        for (Map.Entry<String, Integer> as : antibioticStatusWard.entrySet()) {
+        /*for (Map.Entry<String, Integer> as : antibioticStatusWard.entrySet()) {
             if (as.getValue() == 0) {
                 antibioticDateWard.remove(as.getKey());
             }
-        }
+        }*/
 
         /**
          * 1.antibioticDate:从医嘱中取   key:抗生素名    value:医嘱中该抗生素所有减用时的时间(包括初始使用时间)
@@ -137,14 +137,25 @@ public class THR03072 extends QCCatalogue {
                 miss.add(drugKey);
                 continue;
             }
+            List<Double> antibioticValueList = antibioticValue.get(drugKey);
+            List<Double> antibioticValueWardList = antibioticValueWard.get(drugKey);
+            int findNum = 0;
+            for (int i = 1; i < antibioticValueList.size(); i++) {//从减用的值开始,如果减用过的值查房记录中都有,则不报该药
+                if (antibioticValueWardList.contains(antibioticValueList.get(i))) {
+                    findNum++;
+                }
+            }
+            if (findNum == antibioticValueList.size() - 1) {
+                continue;
+            }
             dateList = ad.getValue();
             int matchNum = 0;
+            List<String> wardDateStr = antibioticDateWard.get(drugKey);
             for (int i = 0; i < dateList.size() - 1; i++) {
                 start = dateList.get(i);        //抗生素开医嘱时间
                 change = dateList.get(i + 1);   //抗生素用量改变时间
                 Date adStart = StringUtil.parseDateTime(start);
                 Date adChange = StringUtil.parseDateTime(change);
-                List<String> wardDateStr = antibioticDateWard.get(drugKey);
                 for (int j = 0; j < wardDateStr.size() - 1; j++) {
                     wardStartStr = wardDateStr.get(j);         //查房记录开抗生素时间
                     wardChangeStr = wardDateStr.get(j + 1);    //查房记录改变抗生素用量时间
@@ -176,7 +187,7 @@ public class THR03072 extends QCCatalogue {
      * @param value            抗生素用量
      * @param startDateStr     抗生素使用时间(医嘱开始时间或查房时间)
      */
-    private void collectAntibioticInfo(Map<String, List<String>> antibioticDate, Map<String, Integer> antibioticStatus, Map<String, Double> antibioticValue, String drugName, String value, String startDateStr) {
+    private void collectAntibioticInfo(Map<String, List<String>> antibioticDate, Map<String, Integer> antibioticStatus, Map<String, List<Double>> antibioticValue, String drugName, String value, String startDateStr) {
         double v = -1;
         try {
             v = Double.parseDouble(getNumber(value));
@@ -187,13 +198,14 @@ public class THR03072 extends QCCatalogue {
             return;
         }
         if (!antibioticValue.containsKey(drugName)) {
-            antibioticValue.put(drugName, v);
+            antibioticValue.put(drugName, Lists.newArrayList(v));
             antibioticDate.put(drugName, Lists.newArrayList(startDateStr));
             antibioticStatus.put(drugName, 0);
         } else {
-            double beforeValue = antibioticValue.get(drugName);
-            if (beforeValue > v) {
-                antibioticValue.put(drugName, v);//更新该抗生素使用值为更小的值
+            List<Double> beforeValue = antibioticValue.get(drugName);
+            if (beforeValue.get(beforeValue.size() - 1) > v) {
+                beforeValue.add(v);
+                antibioticValue.put(drugName, beforeValue);//添减该抗生素更小的值
                 antibioticStatus.put(drugName, antibioticStatus.get(drugName) + 1);
                 antibioticDate.get(drugName).add(startDateStr);
             }

+ 22 - 10
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03074.java

@@ -45,7 +45,7 @@ public class THR03074 extends QCCatalogue {
         //抗生素加用集合   key:抗生素名    value:  0:未加用,1及以上:加用次数
         Map<String, Integer> antibioticStatus = Maps.newHashMap();
         //抗生素及各初始剂量     key:抗生素名    value:抗生素第一次使用时剂量
-        Map<String, Double> antibioticValue = Maps.newHashMap();
+        Map<String, List<Double>> antibioticValue = Maps.newHashMap();
 
         List<Map<String, String>> docAdvStruct = doctorAdviceDocs
                 .stream()
@@ -88,7 +88,7 @@ public class THR03074 extends QCCatalogue {
         //查房记录中抗生素加用集合   key:抗生素名    value:  0:未加用,1及以上:加用次数
         Map<String, Integer> antibioticStatusWard = Maps.newHashMap();
         //查房记录中抗生素及各初始剂量     key:抗生素名    value:抗生素第一次使用时剂量
-        Map<String, Double> antibioticValueWard = Maps.newHashMap();
+        Map<String, List<Double>> antibioticValueWard = Maps.newHashMap();
         List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
         for (ThreeLevelWardDoc doc : allDoctorWradDocs) {
             if (doc.getThreeLevelWardLabel().size() == 0) {
@@ -110,11 +110,11 @@ public class THR03074 extends QCCatalogue {
             }
         }
         //把查房记录中没加用过的抗生素删除
-        for (Map.Entry<String, Integer> as : antibioticStatusWard.entrySet()) {
+        /*for (Map.Entry<String, Integer> as : antibioticStatusWard.entrySet()) {
             if (as.getValue() == 0) {
                 antibioticDateWard.remove(as.getKey());
             }
-        }
+        }*/
 
         /**
          * 1.antibioticDate:从医嘱中取   key:抗生素名    value:医嘱中该抗生素所有加用时的时间(包括初始使用时间)
@@ -133,14 +133,25 @@ public class THR03074 extends QCCatalogue {
                 miss.add(drugKey);
                 continue;
             }
+            List<Double> antibioticValueList = antibioticValue.get(drugKey);
+            List<Double> antibioticValueWardList = antibioticValueWard.get(drugKey);
+            int findNum = 0;
+            for (int i = 1; i < antibioticValueList.size(); i++) {//从加用的值开始,如果加用过的值查房记录中都有,则不报该药
+                if (antibioticValueWardList.contains(antibioticValueList.get(i))) {
+                    findNum++;
+                }
+            }
+            if (findNum == antibioticValueList.size() - 1) {
+                continue;
+            }
             dateList = ad.getValue();
             int matchNum = 0;
+            List<String> wardDateStr = antibioticDateWard.get(drugKey);
             for (int i = 0; i < dateList.size() - 1; i++) {
                 start = dateList.get(i);        //抗生素开医嘱时间
                 change = dateList.get(i + 1);   //抗生素用量改变时间
                 Date adStart = StringUtil.parseDateTime(start);
                 Date adChange = StringUtil.parseDateTime(change);
-                List<String> wardDateStr = antibioticDateWard.get(drugKey);
                 for (int j = 0; j < wardDateStr.size() - 1; j++) {
                     wardStartStr = wardDateStr.get(j);         //查房记录开抗生素时间
                     wardChangeStr = wardDateStr.get(j + 1);    //查房记录改变抗生素用量时间
@@ -172,7 +183,7 @@ public class THR03074 extends QCCatalogue {
      * @param value            抗生素用量
      * @param startDateStr     抗生素使用时间(医嘱开始时间或查房时间)
      */
-    private void collectAntibioticInfo(Map<String, List<String>> antibioticDate, Map<String, Integer> antibioticStatus, Map<String, Double> antibioticValue, String drugName, String value, String startDateStr) {
+    private void collectAntibioticInfo(Map<String, List<String>> antibioticDate, Map<String, Integer> antibioticStatus, Map<String, List<Double>> antibioticValue, String drugName, String value, String startDateStr) {
         double v = -1;
         try {
             v = Double.parseDouble(getNumber(value));
@@ -183,13 +194,14 @@ public class THR03074 extends QCCatalogue {
             return;
         }
         if (!antibioticValue.containsKey(drugName)) {
-            antibioticValue.put(drugName, v);
+            antibioticValue.put(drugName, Lists.newArrayList(v));
             antibioticDate.put(drugName, Lists.newArrayList(startDateStr));
             antibioticStatus.put(drugName, 0);
         } else {
-            double beforeValue = antibioticValue.get(drugName);
-            if (beforeValue < v) {
-                antibioticValue.put(drugName, v);//更新该抗生素使用值为更大的值
+            List<Double> beforeValue = antibioticValue.get(drugName);
+            if (beforeValue.get(beforeValue.size() - 1) < v) {
+                beforeValue.add(v);
+                antibioticValue.put(drugName, beforeValue);//添加该抗生素更大的值
                 antibioticStatus.put(drugName, antibioticStatus.get(drugName) + 1);
                 antibioticDate.get(drugName).add(startDateStr);
             }

+ 22 - 10
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03075.java

@@ -45,7 +45,7 @@ public class THR03075 extends QCCatalogue {
         //抗生素减用集合   key:抗生素名    value:  0:未减用,1及以上:减用次数
         Map<String, Integer> antibioticStatus = Maps.newHashMap();
         //抗生素及各初始剂量     key:抗生素名    value:抗生素第一次使用时剂量
-        Map<String, Double> antibioticValue = Maps.newHashMap();
+        Map<String, List<Double>> antibioticValue = Maps.newHashMap();
 
         List<Map<String, String>> docAdvStruct = doctorAdviceDocs
                 .stream()
@@ -88,7 +88,7 @@ public class THR03075 extends QCCatalogue {
         //查房记录中抗生素减用集合   key:抗生素名    value:  0:未减用,1及以上:减用次数
         Map<String, Integer> antibioticStatusWard = Maps.newHashMap();
         //查房记录中抗生素及各初始剂量     key:抗生素名    value:抗生素第一次使用时剂量
-        Map<String, Double> antibioticValueWard = Maps.newHashMap();
+        Map<String, List<Double>> antibioticValueWard = Maps.newHashMap();
         List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
         for (ThreeLevelWardDoc doc : allDoctorWradDocs) {
             if (doc.getThreeLevelWardLabel().size() == 0) {
@@ -110,11 +110,11 @@ public class THR03075 extends QCCatalogue {
             }
         }
         //把查房记录中没减用过的抗生素删除
-        for (Map.Entry<String, Integer> as : antibioticStatusWard.entrySet()) {
+        /*for (Map.Entry<String, Integer> as : antibioticStatusWard.entrySet()) {
             if (as.getValue() == 0) {
                 antibioticDateWard.remove(as.getKey());
             }
-        }
+        }*/
 
         List<String> miss = Lists.newArrayList();
         String drugKey = null, start = null, change = null, wardStartStr = null, wardChangeStr = null;
@@ -125,14 +125,25 @@ public class THR03075 extends QCCatalogue {
                 miss.add(drugKey);
                 continue;
             }
+            List<Double> antibioticValueList = antibioticValue.get(drugKey);
+            List<Double> antibioticValueWardList = antibioticValueWard.get(drugKey);
+            int findNum = 0;
+            for (int i = 1; i < antibioticValueList.size(); i++) {//从减用的值开始,如果减用过的值查房记录中都有,则不报该药
+                if (antibioticValueWardList.contains(antibioticValueList.get(i))) {
+                    findNum++;
+                }
+            }
+            if (findNum == antibioticValueList.size() - 1) {
+                continue;
+            }
             dateList = ad.getValue();
             int matchNum = 0;
+            List<String> wardDateStr = antibioticDateWard.get(drugKey);
             for (int i = 0; i < dateList.size() - 1; i++) {
                 start = dateList.get(i);        //抗生素开医嘱时间
                 change = dateList.get(i + 1);   //抗生素用量改变时间
                 Date adStart = StringUtil.parseDateTime(start);
                 Date adChange = StringUtil.parseDateTime(change);
-                List<String> wardDateStr = antibioticDateWard.get(drugKey);
                 for (int j = 0; j < wardDateStr.size() - 1; j++) {
                     wardStartStr = wardDateStr.get(j);         //查房记录开抗生素时间
                     wardChangeStr = wardDateStr.get(j + 1);    //查房记录改变抗生素用量时间
@@ -164,7 +175,7 @@ public class THR03075 extends QCCatalogue {
      * @param value            抗生素用量
      * @param startDateStr     抗生素使用时间(医嘱开始时间或查房时间)
      */
-    private void collectAntibioticInfo(Map<String, List<String>> antibioticDate, Map<String, Integer> antibioticStatus, Map<String, Double> antibioticValue, String drugName, String value, String startDateStr) {
+    private void collectAntibioticInfo(Map<String, List<String>> antibioticDate, Map<String, Integer> antibioticStatus, Map<String, List<Double>> antibioticValue, String drugName, String value, String startDateStr) {
         double v = -1;
         try {
             v = Double.parseDouble(getNumber(value));
@@ -175,13 +186,14 @@ public class THR03075 extends QCCatalogue {
             return;
         }
         if (!antibioticValue.containsKey(drugName)) {
-            antibioticValue.put(drugName, v);
+            antibioticValue.put(drugName, Lists.newArrayList(v));
             antibioticDate.put(drugName, Lists.newArrayList(startDateStr));
             antibioticStatus.put(drugName, 0);
         } else {
-            double beforeValue = antibioticValue.get(drugName);
-            if (beforeValue > v) {
-                antibioticValue.put(drugName, v);//更新该抗生素使用值为更小的值
+            List<Double> beforeValue = antibioticValue.get(drugName);
+            if (beforeValue.get(beforeValue.size() - 1) > v) {
+                beforeValue.add(v);
+                antibioticValue.put(drugName, beforeValue);//添减该抗生素更小的值
                 antibioticStatus.put(drugName, antibioticStatus.get(drugName) + 1);
                 antibioticDate.get(drugName).add(startDateStr);
             }