|
@@ -3,6 +3,7 @@ package com.diagbot.repository;
|
|
|
import com.diagbot.dto.BillNeoDTO;
|
|
|
import com.diagbot.dto.PacsBillNeoDTO;
|
|
|
import com.diagbot.entity.node.*;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.NeoUtil;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -18,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();
|
|
@@ -27,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();
|
|
@@ -40,8 +108,26 @@ public class PacsSubNameNode {
|
|
|
for (MedAllergen medAllergen : medAllergens) {
|
|
|
nodeInfo = new NodeInfo();
|
|
|
nodeInfo.setName(medAllergen.getName());
|
|
|
- nodeInfo.setTypeval(Constants.medallergen);
|
|
|
- pacsBillNeoDTO.getOperations().add(NeoUtil.updateNodeInfo(nodeInfo));
|
|
|
+ nodeInfo.setTypeval(NeoUtil.getMedType(medAllergen.getName()));
|
|
|
+ pacsBillNeoDTO.getAllergicmeds().add(NeoUtil.updateNodeInfo(nodeInfo));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -50,9 +136,9 @@ public class PacsSubNameNode {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 处理辅检开单合理性
|
|
|
+ * 处理辅检子项目开单合理性
|
|
|
*/
|
|
|
- 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;
|
|
|
|
|
@@ -61,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;
|
|
@@ -92,16 +180,19 @@ public class PacsSubNameNode {
|
|
|
|
|
|
List<String> pacslist = new ArrayList<>();
|
|
|
|
|
|
- List<PacsSubName> pacslt = pacsRepository.findByNameContaining(name);
|
|
|
+ List<PacsSubName> pacssublt = pacsRepository.index(name, name, 100);
|
|
|
+
|
|
|
+ if (ListUtil.isNotEmpty(pacssublt) && pacssublt.size() > 100) {
|
|
|
+ pacssublt = pacssublt.subList(0, 100);
|
|
|
+ }
|
|
|
|
|
|
- for (PacsSubName pacs : pacslt) {
|
|
|
+ for (PacsSubName pacs : pacssublt) {
|
|
|
pacsname = pacs.getName();
|
|
|
if (!pacslist.contains(pacsname)) {
|
|
|
pacslist.add(pacsname);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
return pacslist;
|
|
|
}
|
|
|
}
|