Bladeren bron

Merge remote-tracking branch 'origin/master'

rengb 5 jaren geleden
bovenliggende
commit
e9e07d5de6
44 gewijzigde bestanden met toevoegingen van 1050 en 36 verwijderingen
  1. 33 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0401.java
  2. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0402.java
  3. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0403.java
  4. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0404.java
  5. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0405.java
  6. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0406.java
  7. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0407.java
  8. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0408.java
  9. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0409.java
  10. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0410.java
  11. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0411.java
  12. 24 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0412.java
  13. 21 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0413.java
  14. 21 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0414.java
  15. 21 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0415.java
  16. 21 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0416.java
  17. 21 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0417.java
  18. 21 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0418.java
  19. 20 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0419.java
  20. 20 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0420.java
  21. 20 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0421.java
  22. 20 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0422.java
  23. 20 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0423.java
  24. 32 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0424.java
  25. 63 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0305.java
  26. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0306.java
  27. 35 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0307.java
  28. 35 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0308.java
  29. 35 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0309.java
  30. 2 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0149.java
  31. 5 6
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0155.java
  32. 4 4
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0156.java
  33. 6 2
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/AIAnalyze.java
  34. 4 3
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/BeHospitalizedAI.java
  35. 11 5
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/FirstCourseRecordAI.java
  36. 52 5
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/LeaveHospitalAI.java
  37. 3 2
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ModelAI.java
  38. 3 2
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/model/EntityEnum.java
  39. 74 0
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessLeaveHospital.java
  40. 2 0
      public/src/main/java/com/lantone/qc/pub/Content.java
  41. 16 0
      public/src/main/java/com/lantone/qc/pub/model/entity/Chief.java
  42. 1 1
      public/src/main/java/com/lantone/qc/pub/model/entity/Notice.java
  43. 14 0
      public/src/main/java/com/lantone/qc/pub/model/entity/Outcome.java
  44. 7 5
      public/src/main/java/com/lantone/qc/pub/model/label/LeaveHospitalLabel.java

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0401.java

@@ -0,0 +1,33 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Collection;
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0401
+ * @Description : 入院记录姓名未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0401 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("姓名");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0402.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0402
+ * @Description : 入院记录姓别未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0402 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("姓别");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0403.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0403
+ * @Description : 入院记录年龄未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0403 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("年龄");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0404.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0404
+ * @Description : 入院记录民族未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0404 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("民族");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0405.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0405
+ * @Description : 入院记录职业未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0405 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("职业");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0406.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0405
+ * @Description : 入院记录出生地未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0406 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("出生地");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0407.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0407
+ * @Description : 入院记录婚姻未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0407 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("婚姻");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0408.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0408
+ * @Description : 入院记录联系地址未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0408 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("联系地址");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0409.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0409
+ * @Description : 入院记录病史陈述者未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0409 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("病史陈述者");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0410.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0410
+ * @Description :  入院记录入院日期未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0410 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("入院日期");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0411.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0411
+ * @Description :  入院记录记录日期未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0411 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("记录日期");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 24 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0412.java

@@ -0,0 +1,24 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0412
+ * @Description :  入院记录姓名填写错误
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0412 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 21 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0413.java

@@ -0,0 +1,21 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0413
+ * @Description :  入院记录性别填写错误
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0413 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 21 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0414.java

@@ -0,0 +1,21 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0414
+ * @Description :  入院记录年龄填写错误
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0414 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 21 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0415.java

@@ -0,0 +1,21 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0415
+ * @Description :  入院记录名族填写错误
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0415 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 21 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0416.java

@@ -0,0 +1,21 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0416
+ * @Description :  入院记录职业填写错误
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0416 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 21 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0417.java

@@ -0,0 +1,21 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0417
+ * @Description : 入院记录出生地填写错误
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0417 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 21 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0418.java

@@ -0,0 +1,21 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0418
+ * @Description : 入院记录婚姻状况填写错误
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0418 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 20 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0419.java

@@ -0,0 +1,20 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0419
+ * @Description : 入院记录联系地址填写错误
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0419 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 20 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0420.java

@@ -0,0 +1,20 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0420
+ * @Description :  入院记录病史陈述者填写错误
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0420 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 20 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0421.java

@@ -0,0 +1,20 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0421
+ * @Description :  入院记录入院日期填写错误
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0421 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 20 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0422.java

@@ -0,0 +1,20 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0422
+ * @Description :  入院记录记录日期填写错误
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0422 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 20 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0423.java

@@ -0,0 +1,20 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @ClassName : BEH0423
+ * @Description : 入院记录联系电话填写错误
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0423 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+
+    }
+}

+ 32 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0424.java

@@ -0,0 +1,32 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH0424
+ * @Description :  入院记录联系电话未填写
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class BEH0424 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+
+        status = "0";
+        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if(structureMap != null){
+            String name = structureMap.get("电话");
+            if(CatalogueUtil.isEmpty(name)){
+                status = "-1";
+            }
+        }
+
+    }
+}

+ 63 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0305.java

@@ -0,0 +1,63 @@
+package com.lantone.qc.kernel.catalogue.clinicalblood;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : CLI0305
+ * @Description : 输血记录未在输注结束后24小时内完成
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class CLI0305 extends QCCatalogue {
+    public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm"; //输注时间
+    public static String FORMAT_LONG_CN_MI = "yyyy年MM月dd日HH时mm分"; //记录时间
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
+        if(clinicalBloodDocs != null && clinicalBloodDocs.size()>0){
+            for (ClinicalBloodDoc cliB:clinicalBloodDocs) {
+                Map<String, String> cliBStructureMap = cliB.getStructureMap();
+                String infusionDtae = cliBStructureMap.get("输注时间");
+                String infusion_begin= cliBStructureMap.get("输注开始");
+                String infusion_end = cliBStructureMap.get("输注结束");
+                String record_date= cliBStructureMap.get("记录时间");
+                if(StringUtils.isNotEmpty(infusionDtae) && StringUtils.isNotEmpty(record_date)){
+                    try {
+                        Date date_in = new SimpleDateFormat(DATE_TIME_FORMAT).parse(infusionDtae);
+                        Date date_out = new SimpleDateFormat(FORMAT_LONG_CN_MI).parse(record_date);
+                        Calendar from  =  Calendar.getInstance();
+                        from.setTime(date_in);
+                        Calendar  to  =  Calendar.getInstance();
+                        to.setTime(date_out);
+                        int fromYear = from.get(Calendar.DAY_OF_MONTH);
+                        int toYear = to.get(Calendar.DAY_OF_MONTH);
+                        int year = toYear  -  fromYear;
+                        if(year >= 1){
+                            status = "-1";
+                        }
+                    } catch (ParseException e) {
+                        e.printStackTrace();
+                    }
+                }else if(StringUtils.isNotEmpty(infusion_begin) && StringUtils.isNotEmpty(infusion_end)){
+
+                }
+            }
+        }
+
+    }
+}

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0306.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.clinicalblood;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : CLI0306
+ * @Description : 输血记录中无输血指征
+ * CRF缺少足够标注数据,使用规则判断输血原因是否有数字
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class CLI0306 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
+        if(clinicalBloodDocs != null && clinicalBloodDocs.size()>0){
+            for (ClinicalBloodDoc cliB:clinicalBloodDocs) {
+                Map<String, String> cliBStructureMap = cliB.getStructureMap();
+                String infusionReason = cliBStructureMap.get("输注原因");
+                if(StringUtils.isNotEmpty(infusionReason)){
+                    Pattern compile = Pattern.compile("[^\\d]+(\\d+)");
+                    Matcher matcher = compile.matcher(infusionReason);
+                    while (matcher.find()){
+                        status = "0";
+                        break;
+                    }
+
+                }
+            }
+        }
+
+    }
+}

+ 35 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0307.java

@@ -0,0 +1,35 @@
+package com.lantone.qc.kernel.catalogue.clinicalblood;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : CLI0307
+ * @Description : 输血记录中无血液制品种类及量
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class CLI0307 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
+        if(clinicalBloodDocs != null && clinicalBloodDocs.size()>0){
+            for (ClinicalBloodDoc cliB:clinicalBloodDocs) {
+                Map<String, String> cliBStructureMap = cliB.getStructureMap();
+                if(StringUtils.isEmpty(cliBStructureMap.get("输注种类、血型、数量"))){
+                    status = "-1";
+                    break;
+                }
+            }
+        }
+
+    }
+}

+ 35 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0308.java

@@ -0,0 +1,35 @@
+package com.lantone.qc.kernel.catalogue.clinicalblood;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : CLI0308
+ * @Description :  输血记录中未记录是否有不良反应
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class CLI0308 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
+        if(clinicalBloodDocs != null && clinicalBloodDocs.size()>0){
+            for (ClinicalBloodDoc cliB:clinicalBloodDocs) {
+                Map<String, String> cliBStructureMap = cliB.getStructureMap();
+                String infusion_process = cliBStructureMap.get("输注过程");
+                if(StringUtils.isNotEmpty(infusion_process) && infusion_process.contains("不良反应")){
+                    status = "0";
+                    break;
+                }
+            }
+        }
+
+    }
+}

+ 35 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0309.java

@@ -0,0 +1,35 @@
+package com.lantone.qc.kernel.catalogue.clinicalblood;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : CLI0309
+ * @Description : 无输血或使用血液制品后效果评价
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class CLI0309 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
+        if(clinicalBloodDocs != null && clinicalBloodDocs.size()>0){
+            for (ClinicalBloodDoc cliB:clinicalBloodDocs) {
+                Map<String, String> cliBStructureMap = cliB.getStructureMap();
+                if(StringUtils.isEmpty(cliBStructureMap.get("输注后效果评价"))){
+                    status = "-1";
+                    break;
+                }
+            }
+        }
+
+    }
+}

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0149.java

@@ -3,6 +3,7 @@ package com.lantone.qc.kernel.catalogue.leavehospital;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.entity.Chief;
 import com.lantone.qc.pub.model.entity.General;
 import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
 import com.lantone.qc.pub.util.ListUtil;
@@ -23,7 +24,7 @@ public class LEA0149 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         LeaveHospitalLabel leaveHospitalLabel = inputInfo.getLeaveHospitalDoc().getLeaveHospitalLabel();
         if (leaveHospitalLabel != null) {
-            List<General> chiefs = leaveHospitalLabel.getChiefs();
+            List<Chief> chiefs = leaveHospitalLabel.getChiefs();
             if (ListUtil.isNotEmpty(chiefs)) {
                 long count = chiefs.stream().filter(i -> i != null && StringUtil.isNotBlank(i.getName())).count();
                 if (count > 0) {

+ 5 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0155.java

@@ -1,6 +1,7 @@
 package com.lantone.qc.kernel.catalogue.leavehospital;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.DoctorAdvice;
@@ -21,14 +22,12 @@ public class LEA0155 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status = "0";
         LeaveHospitalLabel leaveHospitalLabel = inputInfo.getLeaveHospitalDoc().getLeaveHospitalLabel();
         if (leaveHospitalLabel != null) {
-            List<DoctorAdvice> doctorAdvices = leaveHospitalLabel.getDoctorAdvices();
-            if (ListUtil.isNotEmpty(doctorAdvices)) {
-                long count = doctorAdvices.stream().filter(i -> i != null && StringUtil.isNotBlank(i.getName())).count();
-                if (count > 0) {
-                    status = "0";
-                }
+            DoctorAdvice doctorAdvices = leaveHospitalLabel.getDoctorAdvices();
+            if (CatalogueUtil.isEmpty(doctorAdvices.getName())) {
+                status = "-1";
             }
         }
     }

+ 4 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0156.java

@@ -3,7 +3,7 @@ package com.lantone.qc.kernel.catalogue.leavehospital;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
-import com.lantone.qc.pub.model.entity.Notice;
+import com.lantone.qc.pub.model.entity.Notes;
 import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
@@ -23,9 +23,9 @@ public class LEA0156 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         LeaveHospitalLabel leaveHospitalLabel = inputInfo.getLeaveHospitalDoc().getLeaveHospitalLabel();
         if (leaveHospitalLabel != null) {
-            List<Notice> notices = leaveHospitalLabel.getNotices();
-            if (ListUtil.isNotEmpty(notices)) {
-                long count = notices.stream().filter(i -> i != null && StringUtil.isNotBlank(i.getName())).count();
+            List<Notes> notes = leaveHospitalLabel.getNotes();
+            if (ListUtil.isNotEmpty(notes)) {
+                long count = notes.stream().filter(i -> i != null && StringUtil.isNotBlank(i.getName())).count();
                 if (count > 0) {
                     status = "0";
                 }

+ 6 - 2
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/AIAnalyze.java

@@ -12,13 +12,17 @@ public class AIAnalyze {
 
     private CRFServiceClient crfServiceClient;
     BeHospitalizedAI beHospitalizedAI = new BeHospitalizedAI();
+    FirstCourseRecordAI firstCourseRecordAI = new FirstCourseRecordAI();
+    LeaveHospitalAI leaveHospitalAI = new LeaveHospitalAI();
 
     public AIAnalyze(CRFServiceClient crfService) {
         this.crfServiceClient = crfService;
     }
-    public void AIprocess(InputInfo inputInfo){
-            beHospitalizedAI.medrec(inputInfo, crfServiceClient);
 
+    public void AIprocess(InputInfo inputInfo) {
+        beHospitalizedAI.medrec(inputInfo, crfServiceClient);
+        firstCourseRecordAI.medrec(inputInfo, crfServiceClient);
+        leaveHospitalAI.medrec(inputInfo, crfServiceClient);
     }
 
 

+ 4 - 3
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/BeHospitalizedAI.java

@@ -36,11 +36,12 @@ public class BeHospitalizedAI extends ModelAI {
      * PersonalHistory_cx[个人史(月经史、婚育史)]
      * HPIForCX_cx[主诉、现病史、专科检查]
      * GeneralVital_cx[一般体格检查]
-     * chief_present[邵逸夫医院主诉现病史]
+     * chief_present[邵逸夫医院主诉]
      * primary_diag[诊断]
+     * Present_cx[现病史]
      */
     public static List<String> medicalTextType = Arrays.asList("FirstCourseRecord_cx", "PastFamily_cx", "PersonalHistory_cx", "HPIForCX_cx",
-            "GeneralVital_cx", "chief_present", "Diagnoses_cx");
+            "GeneralVital_cx", "chief_present", "Diagnoses_cx","Present_cx");
     public static String entityRelationObject = "entity_relation_object";
     public static String outputs = "outputs";
 
@@ -68,7 +69,7 @@ public class BeHospitalizedAI extends ModelAI {
             //主诉
             putContent(crfContent, medicalTextType.get(3), chief_text, Content.chief);
             //现病史
-            putContent(crfContent, medicalTextType.get(3), present_text, Content.present);
+            putContent(crfContent, medicalTextType.get(7), present_text, Content.present);
             //专科检查
             putContent(crfContent, medicalTextType.get(3), vitalSpecial_text, Content.special_exam);
             //既往史

+ 11 - 5
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/FirstCourseRecordAI.java

@@ -29,6 +29,7 @@ public class FirstCourseRecordAI extends ModelAI {
     public static List<String> medicalTextType = Arrays.asList("FirstCoursera_cx", "Diagnoses_cx");
     public static String entityRelationObject = "entity_relation_object";
     public static String outputs = "outputs";
+    public static String content = "content";
 
     public void medrec(InputInfo inputInfo, CRFServiceClient crfServiceClient) {
         JSONArray crfContent = new JSONArray();
@@ -56,11 +57,12 @@ public class FirstCourseRecordAI extends ModelAI {
 
     /**
      * 病历特点
+     *
      * @param jsonObject
      * @param inputInfo
      */
     public void putCaseCharacteristicCrfData(JSONObject jsonObject, InputInfo inputInfo) {
-        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs);
+        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
         //使用现病史结构来处理病历特点
         EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
         PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
@@ -70,11 +72,12 @@ public class FirstCourseRecordAI extends ModelAI {
 
     /**
      * 初步诊断
+     *
      * @param jsonObject
      * @param inputInfo
      */
     public void putInitialDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
-        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs);
+        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
         //诊断信息
         EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
         List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
@@ -83,11 +86,12 @@ public class FirstCourseRecordAI extends ModelAI {
 
     /**
      * 诊断依据
+     *
      * @param jsonObject
      * @param inputInfo
      */
     public void putDiagnosisCrfData(JSONObject jsonObject, InputInfo inputInfo) {
-        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs);
+        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
         //使用现病史结构来处理诊断依据
         EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
         PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
@@ -97,11 +101,12 @@ public class FirstCourseRecordAI extends ModelAI {
 
     /**
      * 鉴别诊断
+     *
      * @param jsonObject
      * @param inputInfo
      */
     public void putDifferentialDiagCrfData(JSONObject jsonObject, InputInfo inputInfo) {
-        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs);
+        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
         //诊断信息
         EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
         List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
@@ -110,11 +115,12 @@ public class FirstCourseRecordAI extends ModelAI {
 
     /**
      * 诊疗计划
+     *
      * @param jsonObject
      * @param inputInfo
      */
     public void putTreatPlanCrfData(JSONObject jsonObject, InputInfo inputInfo) {
-        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs);
+        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
         //诊疗计划
         EntityProcessTreatPlan entityProcessTreatPlan = new EntityProcessTreatPlan();
         TreatPlanLabel treatPlanLabel = entityProcessTreatPlan.extractEntity(aiOut);

+ 52 - 5
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/LeaveHospitalAI.java

@@ -1,10 +1,57 @@
 package com.lantone.qc.kernel.structure.ai;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.lantone.qc.kernel.client.CRFServiceClient;
+import com.lantone.qc.kernel.structure.ai.process.EntityProcessLeaveHospital;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
+import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Arrays;
+import java.util.List;
+
 /**
- * @ClassName : LeaveHospitalAI
- * @Description : 出院小结
- * @Author : 楼辉荣
- * @Date: 2020-03-20 10:33
+ * @ClassName : DischargeAI
+ * @Description :
+ * @Author : 胡敬
+ * @Date: 2020-03-20 11:00
  */
-public class LeaveHospitalAI {
+public class LeaveHospitalAI extends ModelAI {
+    /**
+     *
+     */
+    public static List<String> medicalTextType = Arrays.asList("DischargeQA_cx");
+    public static String entityRelationObject = "entity_relation_object";
+    public static String outputs = "outputs";
+    public static String content = "content";
+
+    public void medrec(InputInfo inputInfo, CRFServiceClient crfServiceClient) {
+        JSONArray crfContent = new JSONArray();
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if (leaveHospitalDoc != null && StringUtils.isNotEmpty(leaveHospitalDoc.getText())) {
+            //出院小结全部文本
+            putContent(crfContent, medicalTextType.get(0), leaveHospitalDoc.getText(), Content.discharge);
+
+            JSONObject midData = loadAI(crfContent, crfServiceClient);//crf返回数据
+            putDischargeCrfData(midData.getJSONObject(Content.discharge), inputInfo);//出院小结
+        }
+    }
+
+    /**
+     * 病历特点
+     *
+     * @param jsonObject
+     * @param inputInfo
+     */
+    public void putDischargeCrfData(JSONObject jsonObject, InputInfo inputInfo) {
+        JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
+        //使用现病史结构来处理病历特点
+        EntityProcessLeaveHospital entityProcessLeaveHospital = new EntityProcessLeaveHospital();
+        LeaveHospitalLabel leaveHospitalLabel = entityProcessLeaveHospital.extractEntity(aiOut);
+        //临床表现
+        inputInfo.getLeaveHospitalDoc().setLeaveHospitalLabel(leaveHospitalLabel);
+    }
 }

+ 3 - 2
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ModelAI.java

@@ -33,11 +33,12 @@ public class ModelAI {
         return midData;
     }
 
-    protected JSONObject loadEntity(JSONObject jsonObject, String entityRelationObject, String outputs) {
-        if(jsonObject ==null) {
+    protected JSONObject loadEntity(JSONObject jsonObject, String entityRelationObject, String outputs, String content) {
+        if (jsonObject == null) {
             return new JSONObject();
         }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(outputs);
+        aiOut.put(content, jsonObject.getJSONObject(entityRelationObject).getJSONObject(content));
         return aiOut;
     }
 

+ 3 - 2
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/model/EntityEnum.java

@@ -8,7 +8,7 @@ package com.lantone.qc.kernel.structure.ai.model;
 public enum EntityEnum {
     CLINICAL_FEATURE("临床表现"), DIEASE("疾病名称"), BODY("身体部位"), SIGN("体征"), INDEX_VALUE("指标值"),
     LABORATORY("实验室检查"), LABORATORY_VALUE("实验室检查值"), AUXILIARY_EXAMINATION("辅助检查"), AUXILIARY_DESCRIPT("辅助检查描述"),
-        NEGATIVE("否定"), POSSIBLE("可能的"), TIME("时间"), CAUSE("诱因"), MODIFICATION("修饰"),
+    NEGATIVE("否定"), POSSIBLE("可能的"), TIME("时间"), CAUSE("诱因"), MODIFICATION("修饰"),
     PROPERTY("性质"), DEGREE("程度"), AGGRAVATE("加重情况"), RELIEF("缓解情况"), BEHOSPITALIZEDWAY("入院途径"),
     TREND("趋势"), FREQUENCY("频率"), QUANTITY("数量"), SIZE("尺寸"), CURE("治疗"), DRUG("药物名称"),
     DOSE("药品剂量"), OPERATION("手术名称"), GENERAL("一般情况"), GENERAL_DESCRIPT("一般情况描述"),
@@ -21,7 +21,8 @@ public enum EntityEnum {
     OCCUPATION("职业"), LOCATION("地点"), DEAD("死亡"), DEAD_REASON("死亡原因"),
     SIMILAR_DISEASE_KEYWORD("相似疾病"), GENETIC_DISEASE_KEYWORD("家族遗传病"), EPIDEMIC_AREA_HISTORY("疫区史"), SPECIAL_HOBBY("特殊嗜好"),
     CONTACT_HISTORY("接触史"), MARITAL_HISTORY("冶游史"), MARITAL_STATUS("婚姻情况"), MARRYIAGE("结婚年龄"), NEAR_RELATION("近亲史"),
-    CURE_AIM("治疗目的"), OTHER("其他"),OUTERCOURTYARD("外院"),NURSINGLEVEL("护理级别");
+    CURE_AIM("治疗目的"), OTHER("其他"), OUTERCOURTYARD("外院"), NURSINGLEVEL("护理级别"), CHIEF("主诉"), NOTES("注意事项"),
+    KEY_WORD_FOR_DOCTOR_ADVICES("出院医嘱标题"), DOCTORADVICE("医嘱"), KEY_WORD_FOR_PART("大标题"), OUTCOME("转归情况");
 
     private String value;
 

+ 74 - 0
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessLeaveHospital.java

@@ -0,0 +1,74 @@
+package com.lantone.qc.kernel.structure.ai.process;
+
+import com.alibaba.fastjson.JSONObject;
+import com.lantone.qc.kernel.structure.ai.model.EntityEnum;
+import com.lantone.qc.kernel.structure.ai.model.Lemma;
+import com.lantone.qc.pub.model.entity.Chief;
+import com.lantone.qc.pub.model.entity.DoctorAdvice;
+import com.lantone.qc.pub.model.entity.Medicine;
+import com.lantone.qc.pub.model.entity.Notes;
+import com.lantone.qc.pub.model.entity.NursingLevel;
+import com.lantone.qc.pub.model.entity.Outcome;
+import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
+import com.lantone.qc.pub.model.label.TreatPlanLabel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName : EntityProcessLeaveHospital
+ * @Description : 出院小结
+ * @Author : 胡敬
+ * @Date: 2020-03-20 11:20
+ */
+public class EntityProcessLeaveHospital extends EntityProcess {
+    public LeaveHospitalLabel extractEntity(JSONObject aiOut) {
+        LeaveHospitalLabel leaveHospitalLabel = new LeaveHospitalLabel();
+        //主诉
+        List<Lemma> chiefLemmas = createEntityTree(aiOut, EntityEnum.CHIEF.toString());
+        List<Chief> chiefs = new ArrayList<>();
+        for (Lemma lemma : chiefLemmas) {
+            Chief chief = new Chief();
+            chief.setName(lemma.getText());
+            chiefs.add(chief);
+        }
+        leaveHospitalLabel.setChiefs(chiefs);
+        //注意事项
+        List<Lemma> notesLemmas = createEntityTree(aiOut, EntityEnum.NOTES.toString());
+        List<Notes> noteses = new ArrayList<>();
+        for (Lemma lemma : notesLemmas) {
+            Notes notes = new Notes();
+            notes.setName(lemma.getText());
+            noteses.add(notes);
+        }
+        leaveHospitalLabel.setNoteses(noteses);
+        //医嘱
+        List<Lemma> keyWordForDoctorAdvicesesLemmas = createEntityTree(aiOut, EntityEnum.KEY_WORD_FOR_DOCTOR_ADVICES.toString());
+        List<Lemma> keyWordForPartLemmas = createEntityTree(aiOut, EntityEnum.KEY_WORD_FOR_PART.toString());
+        DoctorAdvice doctorAdvice = new DoctorAdvice();
+        int keyWordForDoctorAdvicesesStart = 0, partStart = 0, minPart = 0;
+        for (Lemma doctorAdviceLemma : keyWordForDoctorAdvicesesLemmas) {
+            keyWordForDoctorAdvicesesStart = Integer.parseInt(doctorAdviceLemma.getPosition());
+            for (Lemma part : keyWordForPartLemmas) {
+                partStart = Integer.parseInt(part.getPosition());
+                if (minPart == 0 || partStart > keyWordForDoctorAdvicesesStart && partStart < minPart) {
+                    minPart = partStart;
+                }
+            }
+        }
+        String content = aiOut.getString("content");
+        String doctorAdviceContent = content.substring(keyWordForDoctorAdvicesesStart, minPart);
+        doctorAdvice.setName(doctorAdviceContent);
+        leaveHospitalLabel.setDoctorAdvices(doctorAdvice);
+        //转归情况
+        List<Lemma> outcomeLemmas = createEntityTree(aiOut, EntityEnum.OUTCOME.toString());
+        List<Outcome> outcomes = new ArrayList<>();
+        for (Lemma lemma : outcomeLemmas) {
+            Outcome outcome = new Outcome();
+            outcome.setName(lemma.getText());
+            outcomes.add(outcome);
+        }
+        leaveHospitalLabel.setOutcomes(outcomes);
+        return leaveHospitalLabel;
+    }
+}

+ 2 - 0
public/src/main/java/com/lantone/qc/pub/Content.java

@@ -114,6 +114,8 @@ public class Content {
     public static final String differential_diag_basis = "四、鉴别诊断";
     public static final String treat_plan = "五、诊疗计划";
 
+    public static final String discharge = "出院小结";
+
 
     public static final String name_medical_institution = "医疗机构名称";
     public static final String code_medical_institution = "医疗机构代码";

+ 16 - 0
public/src/main/java/com/lantone/qc/pub/model/entity/Chief.java

@@ -0,0 +1,16 @@
+package com.lantone.qc.pub.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @ClassName : Chief
+ * @Description : 主诉
+ * @Author : 胡敬
+ * @Date: 2020-03-20 10:52
+ */
+
+@Getter
+@Setter
+public class Chief extends General {
+}

+ 1 - 1
public/src/main/java/com/lantone/qc/pub/model/entity/Notice.java

@@ -6,5 +6,5 @@ package com.lantone.qc.pub.model.entity;
  * @Author : 楼辉荣
  * @Date: 2020-03-18 15:54
  */
-public class Notice extends General {
+public class Notes extends General {
 }

+ 14 - 0
public/src/main/java/com/lantone/qc/pub/model/entity/Outcome.java

@@ -0,0 +1,14 @@
+package com.lantone.qc.pub.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 转归情况
+@Setter
+@Getter
+*/
+@Setter
+@Getter
+public class Outcome extends General{
+}

+ 7 - 5
public/src/main/java/com/lantone/qc/pub/model/label/LeaveHospitalLabel.java

@@ -1,8 +1,9 @@
 package com.lantone.qc.pub.model.label;
 
+import com.lantone.qc.pub.model.entity.Chief;
 import com.lantone.qc.pub.model.entity.DoctorAdvice;
-import com.lantone.qc.pub.model.entity.General;
-import com.lantone.qc.pub.model.entity.Notice;
+import com.lantone.qc.pub.model.entity.Notes;
+import com.lantone.qc.pub.model.entity.Outcome;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -18,7 +19,8 @@ import java.util.List;
 @Getter
 @Setter
 public class LeaveHospitalLabel {
-    List<General> chiefs = new ArrayList<>();   //主诉
-    List<Notice> notices = new ArrayList<>();   //注意事项
-    List<DoctorAdvice> doctorAdvices = new ArrayList<>();   //医嘱信息
+    List<Chief> chiefs = new ArrayList<>();   //主诉
+    List<Notes> noteses = new ArrayList<>();   //注意事项
+    DoctorAdvice doctorAdvices;   //医嘱信息
+    List<Outcome> outcomes = new ArrayList<>();   //转归情况
 }