瀏覽代碼

开单合理项维护

zhaops 4 年之前
父節點
當前提交
8438b8fd60

+ 12 - 37
src/main/java/com/diagbot/facade/BillManFacade.java

@@ -1,11 +1,9 @@
 package com.diagbot.facade;
 
 import com.diagbot.dto.DictionaryInfoDTO;
-import com.diagbot.entity.node.Age;
 import com.diagbot.entity.node.BillConcept;
 import com.diagbot.entity.node.BillCondition;
 import com.diagbot.entity.node.BillItem;
-import com.diagbot.entity.node.ClinicalFinding;
 import com.diagbot.entity.node.Group;
 import com.diagbot.entity.node.Lis;
 import com.diagbot.entity.node.LisSet;
@@ -299,14 +297,7 @@ public class BillManFacade {
 
         //条件名称
         if (billSaveVO.getRuleType().equals(2)) {
-            if (billSaveVO.getRelationId() == null) {
-                conditionName_save = conditionName_new;
-            } else {
-                if (!(existRelation != null &&
-                        billSaveVO.getRelationId().equals(existRelation.getRelationId()))) {
-                    conditionName_save = conditionName_new;
-                }
-            }
+            conditionName_save = conditionName_new;
         }
 
         //新增已存在
@@ -316,12 +307,13 @@ public class BillManFacade {
                 throw new CommonException(CommonErrorCode.IS_EXISTS, "规则已存在");
             }
         } else {
-            if (!(existRelation != null
-                    && billSaveVO.getRelationId().equals(existRelation.getRelationId()))) {
-                if (existRelation_new != null
-                        && !billSaveVO.getRelationId().equals(existRelation_new.getRelationId())) {
-                    throw new CommonException(CommonErrorCode.IS_EXISTS, "规则已存在");
-                }
+            if ((billSaveVO.getRelationId().equals(1)
+                    && existRelation != null
+                    && !existRelation.getRelationId().equals(billSaveVO.getRelationId()))
+                    || (billSaveVO.getRelationId().equals(2)
+                    && existRelation_new != null
+                    && !existRelation_new.getRelationId().equals(billSaveVO.getRelationId()))) {
+                throw new CommonException(CommonErrorCode.IS_EXISTS, "规则已存在");
             }
         }
 
@@ -369,17 +361,6 @@ public class BillManFacade {
                             condition.getUnit(),
                             condition.getName());
                     break;
-                case "临床表现":
-                    ClinicalFinding clinicalFinding = clinicalFindingRepository.createOrUpdate(conditionName_save,
-                            0,
-                            Cn2SpellUtil.converterToFirstSpell(conditionName_save),
-                            1,
-                            condition.getMaxValue(),
-                            condition.getMinValue(),
-                            condition.getRange(),
-                            condition.getUnit(),
-                            condition.getName());
-                    break;
                 case "禁忌人群":
                     Group group = groupRepository.createOrUpdate(conditionName_save,
                             0,
@@ -402,18 +383,12 @@ public class BillManFacade {
                             condition.getUnit(),
                             condition.getName());
                     break;
+                /*
+                case "临床表现":
+                    break;
                 case "年龄":
-                    Age age = ageRepository.createOrUpdate(conditionName_save,
-                            0,
-                            Cn2SpellUtil.converterToFirstSpell(conditionName_save),
-                            1,
-                            condition.getMaxValue(),
-                            condition.getMinValue(),
-                            condition.getRange(),
-                            condition.getUnit(),
-                            condition.getName());
                     break;
-                /*case "性别":
+                case "性别":
                     break;
                 case "辅助检查名称描述":
                     break;

+ 16 - 4
src/main/java/com/diagbot/repository/BillManRepository.java

@@ -21,7 +21,7 @@ public interface BillManRepository extends Neo4jRepository<BillItemDetail,Long>
 
     @Query(value = "match(m)-[r]->(n) \n" +
             "where 1 = 1 \n" +
-            "and (m:实验室检查名 or m:辅助检查名称 or m:辅助检查子项目名称 or m:医保手术和操作名称 or m:药品注册名) \n" +
+            "and (m:实验室检查套餐名 or m:辅助检查名称 or m:辅助检查子项目名称 or m:医保手术和操作名称 or m:药品注册名) \n" +
             //"and (case {labels} is not null and size({labels})>0 when true then labels(m)[0] in {labels} else 1 = 1 end ) \n" +
             "and (case {conceptName} is not null and {conceptName} <> '' when true then m.name contains {conceptName} else 1 = 1 end ) \n" +
             "and (case {conditionName} is not null and {conditionName} <> '' when true then n.name contains {conditionName} else 1 = 1 end ) \n" +
@@ -39,11 +39,18 @@ public interface BillManRepository extends Neo4jRepository<BillItemDetail,Long>
             "end as type," +
             "id(m) as conceptId,m.name as conceptName,labels(m)[0] as conceptType,\n" +
             "id(r) as relationId,type(r) as relationName,r.状态 as relationStatus, \n" +
-            "id(n) as conditionId,n.name as conditionName,labels(n)[0] as conditionType  \n" +
+            "id(n) as conditionId," +
+            "(case labels(n)[0] " +
+            "when '体征' then n.体征指标 "+
+            "when '实验室检查' then n.实验室检查指标 "+
+            "when '禁忌人群' then n.禁忌人群指标 "+
+            "else n.name " +
+            "end )as conditionName," +
+            "labels(n)[0] as conditionType  \n" +
             "order by id(r) desc",
             countQuery = "match(m)-[r]->(n) \n" +
                     "where 1 = 1 \n" +
-                    "and (m:实验室检查名称 or m:辅助检查名称 or m:辅助检查子项目名称 or m:医保手术和操作名称 or m:药品注册名) \n" +
+                    "and (m:实验室检查套餐名 or m:辅助检查名称 or m:辅助检查子项目名称 or m:医保手术和操作名称 or m:药品注册名) \n" +
                     //"and (case {labels} is not null and size({labels})>0 when true then labels(m)[0] in {labels} else 1 = 1 end ) \n" +
                     "and (case {conceptName} is not null and {conceptName} <> '' when true then m.name contains {conceptName} else 1 = 1 end ) \n" +
                     "and (case {conditionName} is not null and {conditionName} <> '' when true then n.name contains {conditionName} else 1 = 1 end ) \n" +
@@ -144,7 +151,12 @@ public interface BillManRepository extends Neo4jRepository<BillItemDetail,Long>
             "type(r) as relationName,\n" +
             "r.状态 as relationStatus,\n" +
             "id(n) as conditionId,\n" +
-            "n.name as conditionName,\n" +
+            "(case labels(n)[0] " +
+            "when '体征' then n.体征指标 "+
+            "when '实验室检查' then n.实验室检查指标 "+
+            "when '禁忌人群' then n.禁忌人群指标 "+
+            "else n.name " +
+            "end )as conditionName," +
             "labels(n)[0] as conditionLabel,\n" +
             "n.最小值 as conditionMinValue,\n" +
             "n.最大值 as conditionMaxValue,\n" +