Selaa lähdekoodia

年龄字段修改

zhoutg 4 vuotta sitten
vanhempi
commit
1fddf1cca8

+ 4 - 2
src/main/java/com/diagbot/dto/WordCrfDTO.java

@@ -30,8 +30,10 @@ import java.util.List;
 @Data
 public class WordCrfDTO {
     private Long hospitalId;
-    // 年龄
-    private Integer age;
+    // 年龄(字符串,如:3月)
+    private String age;
+    // 年龄数字数据
+    private Double ageNum;
     // 性别(1:男,2:女)
     private Integer sex;
     // 化验项目和结果

+ 2 - 6
src/main/java/com/diagbot/entity/node/PacsRemind.java

@@ -5,10 +5,6 @@ import lombok.Getter;
 import lombok.Setter;
 import org.neo4j.ogm.annotation.NodeEntity;
 import org.neo4j.ogm.annotation.Property;
-import org.neo4j.ogm.annotation.Relationship;
-
-import java.util.HashSet;
-import java.util.Set;
 
 @Setter
 @Getter
@@ -16,10 +12,10 @@ import java.util.Set;
 public class PacsRemind extends BaseNode  {
 
 	@Property(name = "年龄最小值")
-	private Integer minval;
+	private Double minval;
 
 	@Property(name = "年龄最大值")
-	private Integer maxval;
+	private Double maxval;
 
 	@Property(name = "年龄范围")
 	private Integer range=0;

+ 1 - 0
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -59,6 +59,7 @@ public class CommonFacade {
         AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient);
         WordCrfDTO wordCrfDTO = new WordCrfDTO();
         wordCrfDTO.setHospitalId(searchData.getHospitalId());
+        wordCrfDTO.setAgeNum(searchData.getAgeNum());
         wordCrfDTO.setAge(searchData.getAge());
         wordCrfDTO.setSex(searchData.getSex());
         if (searchData.getDiseaseName() != null && StringUtils.isNotBlank(searchData.getDiseaseName().getName())) {

+ 1 - 1
src/main/java/com/diagbot/facade/CriticalFacade.java

@@ -60,7 +60,7 @@ public class CriticalFacade {
     public CriticalNeoVO fillCriticalNeo(WordCrfDTO wordCrfDTO) {
         CriticalNeoVO criticalNeoVO = new CriticalNeoVO();
 
-        criticalNeoVO.setAge(wordCrfDTO.getAge());
+        criticalNeoVO.setAge(wordCrfDTO.getAgeNum());
         criticalNeoVO.setSex(wordCrfDTO.getSex());
         criticalNeoVO.setVitalLabel(wordCrfDTO.getVitalLabel());
         criticalNeoVO.setLis(wordCrfDTO.getLis());

+ 5 - 5
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -243,7 +243,7 @@ public class NeoFacade {
      * @return
      */
     public List<NeoPushDTO> getPush(NeoPushVO pushVO) {
-        Integer age = pushVO.getAge();
+        Double age = pushVO.getAgeNum();
         Integer sex = pushVO.getSex();
         List<NeoPushDTO> neoPushDTOS = new ArrayList<>();
         List<String> allDis = Lists.newArrayList();
@@ -285,8 +285,8 @@ public class NeoFacade {
             }
             if(disAgeCache.containsKey(disease)){
                 String[] betweenAge = disAgeCache.get(disease).split("-");
-                if(betweenAge.length == 2 && (age < Integer.parseInt(betweenAge[0])
-                        || age > Integer.parseInt(betweenAge[1]))){
+                if(betweenAge.length == 2 && (age < Double.parseDouble(betweenAge[0])
+                        || age > Double.parseDouble(betweenAge[1]))){
                     iterator_dis.remove();
                 }
             }
@@ -329,7 +329,7 @@ public class NeoFacade {
         return neoPushDTOS;
     }
 
-    public List<String> getDisBySymptom(List<String> symptoms,Integer age,Integer sex){
+    public List<String> getDisBySymptom(List<String> symptoms,Double age,Integer sex){
         List<String> symptomCache = getSymptomCache();
         //取交集
         symptoms.retainAll(symptomCache);
@@ -347,7 +347,7 @@ public class NeoFacade {
      * @param symptoms
      * @return
      */
-    public List<String> pushDis(SymptomNameRepository symptomNameRepository,List<String> symptoms,Integer age,Integer sex){
+    public List<String> pushDis(SymptomNameRepository symptomNameRepository,List<String> symptoms,Double age,Integer sex){
         List<String> allDis = Lists.newArrayList();
 
         /*if(ListUtil.isNotEmpty(symptoms)){

+ 9 - 9
src/main/java/com/diagbot/facade/TestFacade.java

@@ -256,7 +256,7 @@ public class TestFacade {
                         break;
                     case "14": // 年龄
                         String[] splitAge = bean.getNeoName().split(",|,");
-                        indicationPushVO.setAge((int) getValueNum(splitAge));
+                        indicationPushVO.setAgeNum(getValueNum(splitAge));
                         break;
                     default:
                         continue;
@@ -451,15 +451,15 @@ public class TestFacade {
             if (bean.getAgeRange() != null) {
                 if (bean.getAgeRange() == 0) {
                     if (bean.getAgeMin() != null) {
-                        indicationPushVO.setAge(bean.getAgeMin() + 1);
+                        indicationPushVO.setAgeNum(bean.getAgeMin() + 1);
                     } else if (bean.getAgeMax() != null) {
-                        indicationPushVO.setAge(bean.getAgeMin() - 1);
+                        indicationPushVO.setAgeNum(bean.getAgeMin() - 1);
                     }
                 } else if (bean.getAgeRange() == 1) {
                     if (bean.getAgeMin() != null) {
-                        indicationPushVO.setAge(bean.getAgeMin() - 1);
+                        indicationPushVO.setAgeNum(bean.getAgeMin() - 1);
                     } else if (bean.getAgeMax() != null) {
-                        indicationPushVO.setAge(bean.getAgeMax() + 1);
+                        indicationPushVO.setAgeNum(bean.getAgeMax() + 1);
                     }
                 }
             }
@@ -586,11 +586,11 @@ public class TestFacade {
             IndicationPushVO indicationPushVO = new IndicationPushVO();
             indicationPushVO.setRuleType("1");
             if (StringUtil.isNotBlank(bean.getCriticalAge()) && "成人".equals(bean.getCriticalAge())) {
-                indicationPushVO.setAge(20);
+                indicationPushVO.setAgeNum(20.0D);
             } else if (StringUtil.isNotBlank(bean.getCriticalAge()) && "新生儿".equals(bean.getCriticalAge())) {
-                indicationPushVO.setAge(1);
+                indicationPushVO.setAgeNum(1.0D);
             } else {
-                indicationPushVO.setAge(20);
+                indicationPushVO.setAgeNum(20.0D);
             }
             indicationPushVO.setSex(1);
             indicationPushVO.setIdNum(bean.getIdNum());
@@ -757,7 +757,7 @@ public class TestFacade {
             IndicationPushVO indicationPushVOAge = new IndicationPushVO();
             String[] split = bean.getAgeAll().split(",");
             setname(indicationPushVOAge,bean);
-            indicationPushVOAge.setAge((int) getValueNum(split));
+            indicationPushVOAge.setAgeNum(getValueNum(split));
             indicationPushVOAge.setMsg("年龄:"+(int) getValueNum(split)+operationNameMsg);
             indicationPushVOAge.setRuleType("3");
             indicationPushVOAge.setIdNum(bean.getIdNum());

+ 11 - 12
src/main/java/com/diagbot/process/BillProcess.java

@@ -5,7 +5,6 @@ import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.BillNeoMaxDTO;
 import com.diagbot.dto.IndicationDTO;
-import com.diagbot.dto.NodeNeoDTO;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.enums.NeoEnum;
 import com.diagbot.enums.TypeEnum;
@@ -92,17 +91,17 @@ public class BillProcess {
             }
             billNeoMaxDTO.setOrderName(billNeoDTO.getName()); // 开单名称
             billNeoMaxDTO.setOrderStandName(billNeoDTO.getStandname()); // 开单标准名称
-            // TODO 测试数据开始
-            if (billNeoDTO.getStandname().equals("胸部CT")) {
-                NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
-                nodeNeoDTO.setName("心电图");
-                billNeoMaxDTO.getPacsOrder().add(nodeNeoDTO);
-            }
-            if (billNeoDTO.getStandname().equals("心电图")) {
-                NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
-                nodeNeoDTO.setName("胸部CT");
-                billNeoMaxDTO.getPacsOrder().add(nodeNeoDTO);
-            }
+            // // TODO 测试数据开始
+            // if (billNeoDTO.getStandname().equals("胸部CT")) {
+            //     NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
+            //     nodeNeoDTO.setName("心电图");
+            //     billNeoMaxDTO.getPacsOrder().add(nodeNeoDTO);
+            // }
+            // if (billNeoDTO.getStandname().equals("心电图")) {
+            //     NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
+            //     nodeNeoDTO.setName("胸部CT");
+            //     billNeoMaxDTO.getPacsOrder().add(nodeNeoDTO);
+            // }
             // if (billNeoDTO.getName().equals("普通胃镜检查")) {
             //     NodeNeoDTO sexNeo = new NodeNeoDTO();
             //     sexNeo.setName("男");

+ 6 - 8
src/main/java/com/diagbot/repository/LisNameNode.java

@@ -16,8 +16,6 @@ import com.diagbot.util.ListUtil;
 import com.diagbot.util.NeoUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.CriticalNeoVO;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -234,13 +232,13 @@ public class LisNameNode {
 	 */
 	public List<CriticalNeoDTO> getLisCritialList(CriticalNeoVO criticalNeoVO, LisNameRepository lisRepository) {
 		String nodename;
-		Integer agemin, agemax;
+		Double agemin, agemax;
 
 		List<CriticalNeoDTO> lislist = new ArrayList<>();
 		CriticalNeoDTO criticalNeoDTO;
 
 		Integer gender = criticalNeoVO.getSex();
-		Integer age = criticalNeoVO.getAge();
+		Double age = criticalNeoVO.getAge();
 		List<Lis> lisVO = criticalNeoVO.getLis();
 
 		try {
@@ -261,12 +259,12 @@ public class LisNameNode {
 						List<LisCritical> lisCriticals = new ArrayList<>(lis.getLiscritials());
 
 						for (LisCritical lisCritical : lisCriticals) {
-							agemin = 0;
-							agemax = 0;
+							agemin = 0.0D;
+							agemax = 0.0D;
 							if (lisCritical.getAge().contains(":")) {
 								String[] agerange = lisCritical.getAge().split(":");
-								agemin = Integer.parseInt(agerange[0]);
-								agemax = Integer.parseInt(agerange[1]);
+								agemin = Double.parseDouble(agerange[0]);
+								agemax = Double.parseDouble(agerange[1]);
 							}
 
 							if (age >= agemin && age <= agemax) {

+ 5 - 8
src/main/java/com/diagbot/repository/PacsCriticalNode.java

@@ -1,16 +1,13 @@
 package com.diagbot.repository;
 
 import com.diagbot.biz.push.entity.Item;
-import com.diagbot.biz.push.entity.Lis;
-import com.diagbot.dto.*;
-import com.diagbot.entity.node.*;
-import com.diagbot.model.label.PacsLabel;
-import com.diagbot.util.NeoUtil;
+import com.diagbot.dto.CriticalNeoDTO;
+import com.diagbot.entity.node.PacsCritical;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.CriticalNeoVO;
 
-import java.math.BigDecimal;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
 
 public class PacsCriticalNode {
 
@@ -26,7 +23,7 @@ public class PacsCriticalNode {
 		CriticalNeoDTO criticalNeoDTO;
 
 		Integer gender = criticalNeoVO.getSex();
-		Integer age = criticalNeoVO.getAge();
+		Double age = criticalNeoVO.getAge();
 		List<Item> pacsres = criticalNeoVO.getPacsLabel().getRes();
 
 		try {

+ 5 - 5
src/main/java/com/diagbot/repository/PacsRemindNode.java

@@ -25,7 +25,7 @@ public class PacsRemindNode {
 		List<String> pacsresultdisease = new ArrayList<>();
 		String pacsgender = "";
 		String disname, gender, psresult, posres, negres, msg;
-		Integer age= null;
+		Double age= null;
 		Integer agerange = null;
 
 		for (Item dg : wordCrfDTO.getDiag()) {
@@ -44,13 +44,13 @@ public class PacsRemindNode {
             }
         }
 
-		if (null!=wordCrfDTO.getAge()) {
-            age = wordCrfDTO.getAge();
+		if (null!=wordCrfDTO.getAgeNum()) {
+            age = wordCrfDTO.getAgeNum();
         }
 
 		for (PacsRemind pr : pacsReminds) {
-			Integer minage = null;
-			Integer maxage = null;
+			Double minage = null;
+			Double maxage = null;
 			disname = "";
 			gender = "";
 			agerange = 0;

+ 1 - 1
src/main/java/com/diagbot/repository/YiBaoDiseaseNode.java

@@ -21,7 +21,7 @@ public class YiBaoDiseaseNode {
 		PushBaseDTO pushBaseDTO;
 
 		int gender = neoPushVO.getSex();
-		int age = neoPushVO.getAge();
+		double age = neoPushVO.getAgeNum();
 
 		if (NeoUtil.matchBasic(disease, gender, age)) {
 

+ 1 - 1
src/main/java/com/diagbot/repository/YiBaoOperationNameNode.java

@@ -250,7 +250,7 @@ public class YiBaoOperationNameNode {
 
                 nodeNeoDTO = NeoUtil.jsontoNodeNeoDTO("年龄", ageobj);
                 if (null != wordCrfDTO.getAge()) {
-                    int age = wordCrfDTO.getAge();
+                    double age = wordCrfDTO.getAgeNum();
                     match = CoreUtil.compareNum(nodeNeoDTO, age);
                     if (match) {
                         nodeNeoDTO.setName("年龄:" + age);

+ 2 - 2
src/main/java/com/diagbot/rule/AgeRule.java

@@ -28,8 +28,8 @@ public class AgeRule {
     public void bill(WordCrfDTO wordCrfDTO, BillNeoMaxDTO billNeoMaxDTO, List<BillMsg> billMsgList, String type) {
         NodeNeoDTO ageNeoDTO = billNeoMaxDTO.getAgeNeoDTO();
         Boolean flag = false;
-        if (ageNeoDTO != null && wordCrfDTO.getAge() != null) {
-            Integer age = wordCrfDTO.getAge();
+        if (ageNeoDTO != null && wordCrfDTO.getAgeNum() != null) {
+            Double age = wordCrfDTO.getAgeNum();
             flag = CoreUtil.compareNum(ageNeoDTO, age);
         }
         if (flag) {

+ 3 - 4
src/main/java/com/diagbot/util/NeoUtil.java

@@ -3,7 +3,6 @@ package com.diagbot.util;
 import com.alibaba.fastjson.JSONObject;
 import com.diagbot.dto.NodeNeoDTO;
 import com.diagbot.dto.PushBaseDTO;
-import com.diagbot.entity.node.Age;
 import com.diagbot.entity.node.Vital;
 import com.diagbot.entity.node.YiBaoDiseaseName;
 import com.diagbot.repository.Constants;
@@ -126,7 +125,7 @@ public class NeoUtil {
         return medtype;
     }
 
-    public static boolean matchBasic(YiBaoDiseaseName disease, int gender_code, int age){
+    public static boolean matchBasic(YiBaoDiseaseName disease, int gender_code, double age){
         boolean match = true;
         String gender_neo4j = disease.getGender();
         String age_neo4j = disease.getAge();
@@ -135,8 +134,8 @@ public class NeoUtil {
             match = false;
         }else if(age_neo4j != null){
             String[] betweenAge = age_neo4j.split("-");
-            if(betweenAge.length == 2 && (age < Integer.parseInt(betweenAge[0])
-                    || age > Integer.parseInt(betweenAge[1]))){
+            if(betweenAge.length == 2 && (age < Double.parseDouble(betweenAge[0])
+                    || age > Double.parseDouble(betweenAge[1]))){
                 match = false;
             }
         }

+ 1 - 1
src/main/java/com/diagbot/vo/CriticalNeoVO.java

@@ -12,7 +12,7 @@ import java.util.List;
 public class CriticalNeoVO {
 
     // 年龄
-    private Integer age;
+    private Double age;
 
     // 性别(1:男,2:女)
     private Integer sex;

+ 4 - 1
src/main/java/com/diagbot/vo/NeoPushVO.java

@@ -12,7 +12,10 @@ import lombok.Data;
  */
 @Data
 public class NeoPushVO {
-    private Integer age;
+    // 年龄(字符串)
+    private String age;
+    // 年龄数字数据
+    private Double ageNum;
     // 性别(1:男,2:女)
     private Integer sex;
     //选中的诊断

+ 8 - 2
src/main/java/com/diagbot/vo/SearchData.java

@@ -3,6 +3,7 @@ package com.diagbot.vo;
 import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.biz.push.entity.Pacs;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -22,9 +23,14 @@ public class SearchData extends HospitalBaseVO {
      */
     private Integer length = 10;
     /**
-     * 年龄
+     * 年龄文本数据
      */
-    private Integer age;
+    private String age;
+    /**
+     * 年龄数字数据
+     */
+    @ApiModelProperty(hidden = true)
+    private Double ageNum;
     /**
      * 性别(1:男,2:女,3:通用)
      */

+ 4 - 4
src/main/java/com/diagbot/vo/TestIndicationVO.java

@@ -38,7 +38,7 @@ public class TestIndicationVO implements Serializable {
      * 年龄
      */
     @Excel(name="年龄")
-    private Integer age;
+    private Double age;
     /**
      * 性别(1:男,2:女,3:通用)
      */
@@ -221,11 +221,11 @@ public class TestIndicationVO implements Serializable {
     @Excel(name="指标标签")
     private String itemNodeName;
     @Excel(name="年龄最大值")
-    private Integer ageMax;
+    private Double ageMax;
     @Excel(name="年龄最小值")
-    private Integer ageMin;
+    private Double ageMin;
     @Excel(name="年龄范围")
-    private Integer ageRange;
+    private Double ageRange;
     @Excel(name="检查结果")
     private String pacsDesc;
     @Excel(name="检查结论有")