Browse Source

家族史规则添加

hujing 5 years ago
parent
commit
dbaef822fc

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0068.java

@@ -13,7 +13,7 @@ import java.util.List;
 
 /**
  * @ClassName : BEH0068
- * @Description : 月经史未描述月经痛经情况
+ * @Description : 月经史未描述白带情况
  * @Author : 胡敬
  * @Date: 2020-03-11 14:49
  */

+ 42 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0070.java

@@ -0,0 +1,42 @@
+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 com.lantone.qc.pub.model.entity.Clinical;
+import com.lantone.qc.pub.model.entity.Family;
+import com.lantone.qc.pub.model.entity.Menses;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0070
+ * @Description : 家族史未描述是否有家族性遗传病史及传染病史
+ * @Author : 胡敬
+ * @Date: 2020-03-11 15:09
+ */
+@Component
+public class BEH0070 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            List<Family> families = familyLabel.getFamilies();
+            boolean isFind = false;
+            for (Family family:families) {
+                if (family.getGeneticDiseaseKeyword() != null && StringUtil.isNotBlank(family.getGeneticDiseaseKeyword().getName())
+                && family.getDiagInfectious() != null && StringUtil.isNotBlank(family.getDiagInfectious().getName())){
+                    isFind = true;
+                    break;
+                }
+            }
+            if (!isFind){
+                status = "0";
+            }
+        }
+    }
+}

+ 45 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0072.java

@@ -0,0 +1,45 @@
+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 com.lantone.qc.pub.model.entity.Dead;
+import com.lantone.qc.pub.model.entity.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0072
+ * @Description : 家属有死亡者,未记录死亡原因及年龄
+ * @Author : 胡敬
+ * @Date: 2020-03-11 16:44
+ */
+@Component
+public class BEH0072 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            List<Family> families = familyLabel.getFamilies();
+            boolean isFind = false;
+            for (Family family : families) {
+                if (family.getDead() != null) {
+                    Dead dead = family.getDead();
+                    if (dead.getAge() != null && StringUtil.isNotBlank(dead.getAge().getName()) //年龄不为空
+                            //或者(死亡原因为空并且情况不详为空)
+                            && (dead.getDeadReason() != null && StringUtil.isNotBlank(dead.getDeadReason().getName())
+                     || (dead.getUnknow() != null && StringUtil.isNotBlank(dead.getUnknow().getName())))) {
+                        isFind = true;
+                        break;
+                    }
+                }
+            }
+            if (!isFind){
+                status = "0";
+            }
+        }
+    }
+}

+ 44 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0073.java

@@ -0,0 +1,44 @@
+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 com.lantone.qc.pub.model.entity.Dead;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.entity.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0073
+ * @Description : 家族中是否有肝炎、结核等病史未描述
+ * @Author : 胡敬
+ * @Date: 2020-03-11 17:05
+ */
+@Component
+public class BEH0073 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            List<Family> families = familyLabel.getFamilies();
+            boolean findDiag = false;
+            for (Family family : families) {
+                if (family.getDiags() != null && family.getDiags().size() > 0) {
+                    for (Diag diag : family.getDiags()) {
+                        if (diag.getName().contains("肝炎") || diag.getName().contains("结核")) {
+                            findDiag = true;
+                            break;
+                        }
+                    }
+                }
+            }
+            if (!findDiag) {
+                status = "0";
+            }
+        }
+    }
+}

+ 42 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0074.java

@@ -0,0 +1,42 @@
+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 com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.entity.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0074
+ * @Description : 两系三代内是否有肿瘤病史未描述
+ * @Author : 胡敬
+ * @Date: 2020-03-11 17:05
+ */
+@Component
+public class BEH0074 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            List<Family> families = familyLabel.getFamilies();
+            boolean findDiag = false;
+            for (Family family : families) {
+                if (family.getDiags() != null && family.getDiags().size() > 0) {
+                    for (Diag diag : family.getDiags()) {
+                        if (diag.getName().contains("癌") || diag.getName().contains("肿瘤")) {
+                            findDiag = true;
+                            break;
+                        }
+                    }
+                }
+            }
+            if (!findDiag) {
+                status = "0";
+            }
+        }
+    }
+}

+ 39 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0075.java

@@ -0,0 +1,39 @@
+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 com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.entity.Family;
+import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @ClassName : BEH0075
+ * @Description : 类似疾病史未描述
+ * @Author : 胡敬
+ * @Date: 2020-03-11 17:37
+ */
+@Component
+public class BEH0075 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
+            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            List<Family> families = familyLabel.getFamilies();
+            boolean findSimilarDiag = false;
+            for (Family family : families) {
+                if (family.getSimilarDiag() != null && StringUtil.isNotBlank(family.getSimilarDiag().getName())) {
+                    findSimilarDiag = true;
+                    break;
+                }
+            }
+            if (!findSimilarDiag){
+                status = "0";
+            }
+        }
+    }
+}

+ 25 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0081.java

@@ -0,0 +1,25 @@
+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;
+
+/**
+ * @ClassName : BEH0081
+ * @Description : 辅助检查与结果未记录
+ * @Author : 胡敬
+ * @Date: 2020-03-11 19:29
+ */
+@Component
+public class BEH0081 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getPacsLabel() != null) {
+            if (CatalogueUtil.isEmpty(inputInfo.getBeHospitalizedDoc().getPacsLabel().getText())) {
+                status = "0";
+            }
+        }
+    }
+}

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

@@ -62,17 +62,17 @@ public class BeHospitalizedAI {
         //专科检查
         putContent(crfContent, medicalTextType.get(3), vitalSpecial_text, Content.special_exam);
         //既往史
-        putContent(crfContent, medicalTextType.get(3), past_text, Content.past);
+        putContent(crfContent, medicalTextType.get(1), past_text, Content.past);
         //家族史
-        putContent(crfContent, medicalTextType.get(3), family_text, Content.family);
+        putContent(crfContent, medicalTextType.get(1), family_text, Content.family);
         //存放一般查体
-        putContent(crfContent, medicalTextType.get(3), vital_text, Content.phys_exam);
+        putContent(crfContent, medicalTextType.get(4), vital_text, Content.phys_exam);
         //个人史
-        putContent(crfContent, medicalTextType.get(3), Personal_text, Content.personal);
+        putContent(crfContent, medicalTextType.get(2), Personal_text, Content.personal);
         //月经史
-        putContent(crfContent, medicalTextType.get(3), menstrual_text, Content.menses);
+        putContent(crfContent, medicalTextType.get(2), menstrual_text, Content.menses);
         //婚育史
-        putContent(crfContent, medicalTextType.get(3), marital_text, Content.marriage);
+        putContent(crfContent, medicalTextType.get(2), marital_text, Content.marriage);
         //存储CRF完整所需结构数据
         CRFVo crfVo = new CRFVo();
         crfVo.setData(crfContent);

+ 31 - 0
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessFamily.java

@@ -42,6 +42,8 @@ public class EntityProcessFamily extends EntityProcess {
                         family.setHealthCondition(addHealthCondition(relationLemma));
                     } else if (relationLemma.getProperty().equals(EntityEnum.DIEASE.toString())) {
                         family.addDiag(addDiags(relationLemma));
+                    } else if (relationLemma.getProperty().equals(EntityEnum.SIMILAR_DISEASE_KEYWORD.toString())) {
+                        family.setSimilarDiag(addSimilarDiag(relationLemma));
                     }
                 }
             }
@@ -60,6 +62,21 @@ public class EntityProcessFamily extends EntityProcess {
         dead.setName(deadLemma.getText());
         if (deadLemma.isHaveChildren()) {
             dead.setDesc(deadLemma.getRelationLemmas().get(0).getText());
+            for (Lemma lemma:deadLemma.getRelationLemmas()) {
+                if (lemma.getProperty().equals(EntityEnum.DEAD_REASON.toString())) {
+                    DeadReason deadReason = new DeadReason();
+                    deadReason.setName(lemma.getText());
+                    dead.setDeadReason(deadReason);
+                } else if (lemma.getProperty().equals(EntityEnum.UNKNOWN.toString())){
+                    Unknow unknow = new Unknow();
+                    unknow.setName(lemma.getText());
+                    dead.setUnknow(unknow);
+                } else if (lemma.getProperty().equals(EntityEnum.AGE.toString())){
+                    Age age = new Age();
+                    age.setName(lemma.getText());
+                    dead.setAge(age);
+                }
+            }
         }
         return dead;
     }
@@ -116,4 +133,18 @@ public class EntityProcessFamily extends EntityProcess {
         }
         return diag;
     }
+
+    /**
+     * 相似疾病
+     * @param diagLemma
+     * @return
+     */
+    private SimilarDiag addSimilarDiag(Lemma diagLemma) {
+        SimilarDiag similarDiag = new SimilarDiag();
+        similarDiag.setName(diagLemma.getText());
+        if (diagLemma.isHaveChildren()) {
+            similarDiag.setNegative(findNegative(diagLemma));
+        }
+        return similarDiag;
+    }
 }

+ 3 - 0
public/src/main/java/com/lantone/qc/pub/model/entity/Dead.java

@@ -10,4 +10,7 @@ import lombok.Setter;
 @Getter
 public class Dead extends General {
     private String desc;
+    private DeadReason deadReason;
+    private Unknow unknow;
+    private Age age;
 }

+ 13 - 0
public/src/main/java/com/lantone/qc/pub/model/entity/DeadReason.java

@@ -0,0 +1,13 @@
+package com.lantone.qc.pub.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 死亡原因
+ */
+@Setter
+@Getter
+public class DeadReason extends General {
+
+}

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

@@ -3,6 +3,7 @@ package com.lantone.qc.pub.model.entity;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -17,8 +18,9 @@ public class Family extends General{
     private Dead dead;
     private GeneticDiseaseKeyword geneticDiseaseKeyword;//家族遗传病
     private DiagInfectious diagInfectious;//传染病史
-    private List<Diag> diags;//疾病名称
+    private List<Diag> diags = new ArrayList<>();//疾病名称
     private HealthCondition healthCondition;//健康状况
+    private SimilarDiag similarDiag;//相似疾病
 
     public void addDiag(Diag diag) {
         this.diags.add(diag);

+ 2 - 1
public/src/main/java/com/lantone/qc/pub/model/label/PersonalLabel.java

@@ -4,6 +4,7 @@ import com.lantone.qc.pub.model.entity.*;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -15,7 +16,7 @@ import java.util.List;
 @Setter
 @Getter
 public class PersonalLabel extends GeneralLabel {
-    private List<Address> addresses;    //地点
+    private List<Address> addresses = new ArrayList<>();    //地点
     private Occupation occupation;  //职业
     private EpidemicArea epidemicArea; //疫区史
     private Contact contact;    //接触史