Ver código fonte

更新辅检项目名称和子项目名称的开单合理性合并

MarkHuang 4 anos atrás
pai
commit
575cb4ccf2

+ 23 - 0
src/main/java/com/diagbot/entity/node/PacsSubName.java

@@ -15,6 +15,20 @@ import java.util.Set;
 @NodeEntity(label = "辅助检查子项目名称")
 public class PacsSubName extends BaseNode  {
 
+	@Relationship(type = "辅助检查子项目名称禁忌性别", direction = Relationship.OUTGOING)
+	private Gender gender;
+
+	@Relationship(type = "辅助检查子项目名称禁忌临床表现", direction = Relationship.OUTGOING)
+	private Set<ClinicalFinding> clinicalfindings = new HashSet<>();
+
+	@Relationship(type = "辅助检查子项目名称禁忌体征", direction = Relationship.OUTGOING)
+	private Set<Vital> vitals = new HashSet<>();
+
+	@Relationship(type = "辅助检查子项目名称禁忌实验室检查", direction = Relationship.OUTGOING)
+	private Set<Lis> lis = new HashSet<>();
+
+	@Relationship(type = "辅助检查子项目名称禁忌辅助检查名称描述", direction = Relationship.OUTGOING)
+	private Set<PacsDescribe> pacsdescribes = new HashSet<>();
 
 	@Relationship(type = "辅助检查子项目名称禁忌药物过敏原", direction = Relationship.OUTGOING)
 	private Set<MedAllergen> medallergens = new HashSet<>();
@@ -22,9 +36,18 @@ public class PacsSubName extends BaseNode  {
 	@Relationship(type = "辅助检查子项目名称禁忌禁忌人群", direction = Relationship.OUTGOING)
 	private Set<Group> groups = new HashSet<>();
 
+	@Relationship(type = "辅助检查子项目名称禁忌服用药品", direction = Relationship.OUTGOING)
+	private Set<OralMedicine> oralmedicines = new HashSet<>();
+
 	@Relationship(type = "辅助检查子项目名称禁忌疾病", direction = Relationship.OUTGOING)
 	private Set<Disease> diseases = new HashSet<>();
 
+	@Relationship(type = "辅助检查子项目名称禁忌过敏原", direction = Relationship.OUTGOING)
+	private Set<Allergen> allergens = new HashSet<>();
+
+	@Relationship(type = "辅助检查子项目名称禁忌禁忌医疗器械及物品", direction = Relationship.OUTGOING)
+	private Set<ConflictDevice> conflictdevices = new HashSet<>();
+
 	@Relationship(type = "辅助检查名称包含辅助检查子项目名称", direction = Relationship.INCOMING)
 	private Set<Pacs> pacss = new HashSet<>();
 

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

@@ -51,6 +51,8 @@ public class NeoFacade {
     @Autowired
     PacsNameRepository pacsNameRepository;
     @Autowired
+    PacsSubNameRepository pacsSubNameRepository;
+    @Autowired
     LisNameRepository lisNameRepository;
     @Autowired
     LisSetRepository lisSetRepository;
@@ -595,6 +597,9 @@ public class NeoFacade {
         PacsNameNode pacsNode = new PacsNameNode();
         List<BillNeoDTO> billNeoDTOs = pacsNode.getPacsBill(pacsterm, pacsNameRepository);
 
+        PacsSubNameNode pacsSubNode = new PacsSubNameNode();
+        billNeoDTOs.addAll(pacsSubNode.getSubPacsBill(pacsterm, pacsSubNameRepository));
+
         return billNeoDTOs;
     }
 

+ 101 - 14
src/main/java/com/diagbot/repository/PacsSubNameNode.java

@@ -19,6 +19,64 @@ public class PacsSubNameNode {
         NodeInfo nodeInfo;
 
 
+        Gender gender = pacs.getGender();
+        if (gender != null) {
+            nodeInfo = new NodeInfo();
+            nodeInfo.setName(gender.getName());
+            nodeInfo.setTypeval(Constants.gender);
+            pacsBillNeoDTO.setGender(NeoUtil.updateNodeInfo(nodeInfo));
+        }
+
+
+        Set<ClinicalFinding> clinicalfindings = pacs.getClinicalfindings();
+        for (ClinicalFinding clinicalfinding : clinicalfindings) {
+            nodeInfo = new NodeInfo();
+            nodeInfo.setName(clinicalfinding.getName());
+            nodeInfo.setMinval(NeoUtil.DoubletoBigDecimal(clinicalfinding.getMinval()));
+            nodeInfo.setMaxval(NeoUtil.DoubletoBigDecimal(clinicalfinding.getMaxval()));
+            nodeInfo.setUnit(clinicalfinding.getUnit());
+            nodeInfo.setRange(clinicalfinding.getRange());
+            nodeInfo.setTypeval(Constants.clinicalfinding);
+            pacsBillNeoDTO.getClinicfindings().add(NeoUtil.updateNodeInfo(nodeInfo));
+        }
+
+
+        Set<Vital> vitals = pacs.getVitals();
+        for (Vital vital : vitals) {
+            nodeInfo = new NodeInfo();
+            String name = vital.getName();
+            nodeInfo.setName(name);
+            nodeInfo.setMinval(NeoUtil.DoubletoBigDecimal(vital.getMinval()));
+            nodeInfo.setMaxval(NeoUtil.DoubletoBigDecimal(vital.getMaxval()));
+            nodeInfo.setUnit(vital.getUnit());
+            nodeInfo.setRange(vital.getRange());
+            nodeInfo.setTypeval(Constants.vital);
+            pacsBillNeoDTO.getVitals().add(NeoUtil.updateNodeInfo(nodeInfo));
+        }
+
+
+        Set<Lis> liss = pacs.getLis();
+        for (Lis lis : liss) {
+            nodeInfo = new NodeInfo();
+            nodeInfo.setName(lis.getName());
+            nodeInfo.setMinval(NeoUtil.DoubletoBigDecimal(lis.getMinval()));
+            nodeInfo.setMaxval(NeoUtil.DoubletoBigDecimal(lis.getMaxval()));
+            nodeInfo.setUnit(lis.getUnit());
+            nodeInfo.setRange(lis.getRange());
+            nodeInfo.setTypeval(Constants.lis);
+            pacsBillNeoDTO.getLis().add(NeoUtil.updateNodeInfo(nodeInfo));
+        }
+
+
+        Set<PacsDescribe> conflict_pacsdesc = pacs.getPacsdescribes();
+        for (PacsDescribe pacsdesc : conflict_pacsdesc) {
+            nodeInfo = new NodeInfo();
+            nodeInfo.setName(pacsdesc.getName());
+            nodeInfo.setTypeval(Constants.pacsdesc);
+            pacsBillNeoDTO.getPacsDesc().add(NeoUtil.updateNodeInfo(nodeInfo));
+        }
+
+
         Set<Group> groups = pacs.getGroups();
         for (Group group : groups) {
             nodeInfo = new NodeInfo();
@@ -28,6 +86,15 @@ public class PacsSubNameNode {
         }
 
 
+        Set<OralMedicine> conflict_medicines = pacs.getOralmedicines();
+        for (OralMedicine conflict_medicine : conflict_medicines) {
+            nodeInfo = new NodeInfo();
+            nodeInfo.setName(conflict_medicine.getName());
+            nodeInfo.setTypeval(Constants.yaoping);
+            pacsBillNeoDTO.getOralmeds().add(NeoUtil.updateNodeInfo(nodeInfo));
+        }
+
+
         Set<Disease> diseases = pacs.getDiseases();
         for (Disease disease : diseases) {
             nodeInfo = new NodeInfo();
@@ -46,14 +113,32 @@ public class PacsSubNameNode {
         }
 
 
+        Set<Allergen> allergens = pacs.getAllergens();
+        for (Allergen allergen : allergens) {
+            nodeInfo = new NodeInfo();
+            nodeInfo.setName(allergen.getName());
+            nodeInfo.setTypeval(Constants.yaoping); // 过敏原归类成药物过敏原,与模型提取匹配
+            pacsBillNeoDTO.getAllergicmeds().add(NeoUtil.updateNodeInfo(nodeInfo));
+        }
+
+
+        Set<ConflictDevice> conflictDevices = pacs.getConflictdevices();
+        for (ConflictDevice conflictDevice : conflictDevices) {
+            nodeInfo = new NodeInfo();
+            nodeInfo.setName(conflictDevice.getName());
+            nodeInfo.setTypeval(Constants.conflictdevice);
+            pacsBillNeoDTO.getMeddevice().add(NeoUtil.updateNodeInfo(nodeInfo));
+        }
+
+
         return pacsBillNeoDTO;
     }
 
 
     /**
-     * 处理辅检开单合理性
+     * 处理辅检子项目开单合理性
      */
-    public List<BillNeoDTO> getPacsBill(Map<String, String> pacsterm, PacsSubNameRepository pacsRepository) {
+    public List<BillNeoDTO> getSubPacsBill(List<Map<String, String>> pacslist, PacsSubNameRepository pacsSubRepository) {
         List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
         BillNeoDTO billNeoDTO;
 
@@ -62,23 +147,25 @@ public class PacsSubNameNode {
         List<PacsSubName> pacslt;
         String pacsname;
 
-        for (String term : pacsterm.keySet()) {
-            billNeoDTO = new BillNeoDTO();
-            pacsname = pacsterm.get(term);
-            billNeoDTO.setName(term);
-            billNeoDTO.setStandname(pacsname);
+        for (Map<String, String> pacsterm : pacslist) {
+            for (String term : pacsterm.keySet()) {
+                billNeoDTO = new BillNeoDTO();
+                pacsname = pacsterm.get(term);
+                billNeoDTO.setName(term);
+                billNeoDTO.setStandname(pacsname);
 
-            pacsBillNeoDTO = new PacsBillNeoDTO();
+                pacsBillNeoDTO = new PacsBillNeoDTO();
 
-            pacslt = pacsRepository.findByNameIs(pacsname);
+                pacslt = pacsSubRepository.findByNameIs(pacsname);
 
-            if (pacslt != null && pacslt.size()>0) {
-                pacsBillNeoDTO = PacstoPACSDTO(pacslt.get(0));
-            }
+                if (pacslt != null && pacslt.size() > 0) {
+                    pacsBillNeoDTO = PacstoPACSDTO(pacslt.get(0));
+                }
 
-            billNeoDTO.setPacsBillNeoDTO(pacsBillNeoDTO);
+                billNeoDTO.setPacsBillNeoDTO(pacsBillNeoDTO);
 
-            billNeoDTOs.add(billNeoDTO);
+                billNeoDTOs.add(billNeoDTO);
+            }
         }
 
         return billNeoDTOs;