|
@@ -6,12 +6,10 @@ import com.diagbot.entity.node.*;
|
|
import com.diagbot.util.NeoUtil;
|
|
import com.diagbot.util.NeoUtil;
|
|
import com.diagbot.util.StringUtil;
|
|
import com.diagbot.util.StringUtil;
|
|
import com.diagbot.vo.CriticalNeoVO;
|
|
import com.diagbot.vo.CriticalNeoVO;
|
|
|
|
+import com.diagbot.vo.NeoEntityVO;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Set;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
public class LisNode {
|
|
public class LisNode {
|
|
|
|
|
|
@@ -21,7 +19,7 @@ public class LisNode {
|
|
|
|
|
|
Gender gender = lis.getGender();
|
|
Gender gender = lis.getGender();
|
|
if (null!=gender) {
|
|
if (null!=gender) {
|
|
- lisBillNeoDTO.setGender(NeoUtil.updateNodeInfo(gender.getName(), null, null, null));
|
|
|
|
|
|
+ lisBillNeoDTO.setGender(NeoUtil.updateNodeInfo(gender.getName(), null, null, null, null));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -40,7 +38,8 @@ public class LisNode {
|
|
BigDecimal min = NeoUtil.DoubletoBigDecimal(clinicalfinding.getMinval());
|
|
BigDecimal min = NeoUtil.DoubletoBigDecimal(clinicalfinding.getMinval());
|
|
BigDecimal max = NeoUtil.DoubletoBigDecimal(clinicalfinding.getMaxval());
|
|
BigDecimal max = NeoUtil.DoubletoBigDecimal(clinicalfinding.getMaxval());
|
|
String unit = clinicalfinding.getUnit();
|
|
String unit = clinicalfinding.getUnit();
|
|
- lisBillNeoDTO.getClinicfindings().add(NeoUtil.updateNodeInfo(name, min, max, unit));
|
|
|
|
|
|
+ Integer range = clinicalfinding.getRange();
|
|
|
|
+ lisBillNeoDTO.getClinicfindings().add(NeoUtil.updateNodeInfo(name, min, max, unit, range));
|
|
}
|
|
}
|
|
|
|
|
|
Set<Vital> vitals = lis.getVitals();
|
|
Set<Vital> vitals = lis.getVitals();
|
|
@@ -49,31 +48,32 @@ public class LisNode {
|
|
BigDecimal min = NeoUtil.DoubletoBigDecimal(vital.getMinval());
|
|
BigDecimal min = NeoUtil.DoubletoBigDecimal(vital.getMinval());
|
|
BigDecimal max = NeoUtil.DoubletoBigDecimal(vital.getMaxval());
|
|
BigDecimal max = NeoUtil.DoubletoBigDecimal(vital.getMaxval());
|
|
String unit = vital.getUnit();
|
|
String unit = vital.getUnit();
|
|
- lisBillNeoDTO.getVitals().add(NeoUtil.updateNodeInfo(name, min, max, unit));
|
|
|
|
|
|
+ Integer range = vital.getRange();
|
|
|
|
+ lisBillNeoDTO.getVitals().add(NeoUtil.updateNodeInfo(name, min, max, unit, range));
|
|
}
|
|
}
|
|
|
|
|
|
Set<Medicine> conflict_medicines = lis.getConflict_medicines();
|
|
Set<Medicine> conflict_medicines = lis.getConflict_medicines();
|
|
for (Medicine conflict_medicine : conflict_medicines) {
|
|
for (Medicine conflict_medicine : conflict_medicines) {
|
|
String name = conflict_medicine.getName();
|
|
String name = conflict_medicine.getName();
|
|
- lisBillNeoDTO.getOralmeds().add(NeoUtil.updateNodeInfo(name, null, null, null));
|
|
|
|
|
|
+ lisBillNeoDTO.getOralmeds().add(NeoUtil.updateNodeInfo(name, null, null, null, null));
|
|
}
|
|
}
|
|
|
|
|
|
Set<AllergicMed> allergicmeds = lis.getAllergicmeds();
|
|
Set<AllergicMed> allergicmeds = lis.getAllergicmeds();
|
|
for (AllergicMed allergicmed : allergicmeds) {
|
|
for (AllergicMed allergicmed : allergicmeds) {
|
|
String name = allergicmed.getName();
|
|
String name = allergicmed.getName();
|
|
- lisBillNeoDTO.getAllergicmeds().add(NeoUtil.updateNodeInfo(name, null, null, null));
|
|
|
|
|
|
+ lisBillNeoDTO.getAllergicmeds().add(NeoUtil.updateNodeInfo(name, null, null, null, null));
|
|
}
|
|
}
|
|
|
|
|
|
Set<Operation> operations = lis.getOperations();
|
|
Set<Operation> operations = lis.getOperations();
|
|
for (Operation operation : operations) {
|
|
for (Operation operation : operations) {
|
|
String name = operation.getName();
|
|
String name = operation.getName();
|
|
- lisBillNeoDTO.getOperations().add(NeoUtil.updateNodeInfo(name, null, null, null));
|
|
|
|
|
|
+ lisBillNeoDTO.getOperations().add(NeoUtil.updateNodeInfo(name, null, null, null, null));
|
|
}
|
|
}
|
|
|
|
|
|
Set<Procedure> procedures = lis.getProcedures();
|
|
Set<Procedure> procedures = lis.getProcedures();
|
|
for (Procedure procedure : procedures) {
|
|
for (Procedure procedure : procedures) {
|
|
String name = procedure.getName();
|
|
String name = procedure.getName();
|
|
- lisBillNeoDTO.getProcedures().add(NeoUtil.updateNodeInfo(name, null, null, null));
|
|
|
|
|
|
+ lisBillNeoDTO.getProcedures().add(NeoUtil.updateNodeInfo(name, null, null, null, null));
|
|
}
|
|
}
|
|
|
|
|
|
Set<PACS> pacss = lis.getPacs();
|
|
Set<PACS> pacss = lis.getPacs();
|
|
@@ -83,19 +83,19 @@ public class LisNode {
|
|
// BigDecimal max = pacs.getMaxval();
|
|
// BigDecimal max = pacs.getMaxval();
|
|
// String unit = pacs.getUnit();
|
|
// String unit = pacs.getUnit();
|
|
// lisBillNeoDTO.getPacs().add(NeoUtil.updateNodeInfo(name, min, max, unit));
|
|
// lisBillNeoDTO.getPacs().add(NeoUtil.updateNodeInfo(name, min, max, unit));
|
|
- lisBillNeoDTO.getPacs().add(NeoUtil.updateNodeInfo(name, null, null, null));
|
|
|
|
|
|
+ lisBillNeoDTO.getPacs().add(NeoUtil.updateNodeInfo(name, null, null, null, null));
|
|
}
|
|
}
|
|
|
|
|
|
Set<Disease> diseases = lis.getDiseases();
|
|
Set<Disease> diseases = lis.getDiseases();
|
|
for (Disease disease : diseases) {
|
|
for (Disease disease : diseases) {
|
|
String name = disease.getName();
|
|
String name = disease.getName();
|
|
- lisBillNeoDTO.getDisease().add(NeoUtil.updateNodeInfo(name, null, null, null));
|
|
|
|
|
|
+ lisBillNeoDTO.getDisease().add(NeoUtil.updateNodeInfo(name, null, null, null, null));
|
|
}
|
|
}
|
|
|
|
|
|
Set<Group> groups = lis.getGroups();
|
|
Set<Group> groups = lis.getGroups();
|
|
for (Group group : groups) {
|
|
for (Group group : groups) {
|
|
String name = group.getName();
|
|
String name = group.getName();
|
|
- lisBillNeoDTO.getGroup().add(NeoUtil.updateNodeInfo(name, null, null, null));
|
|
|
|
|
|
+ lisBillNeoDTO.getGroup().add(NeoUtil.updateNodeInfo(name, null, null, null, null));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -244,5 +244,74 @@ public class LisNode {
|
|
|
|
|
|
return lislist;
|
|
return lislist;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 更新实体属性信息
|
|
|
|
+ */
|
|
|
|
+ public NeoEntityDTO updateEntity(String name, Map<String, String> props, List<String> keys, LisRepository lisRepository) {
|
|
|
|
+ NeoEntityDTO neoEntityDTO = new NeoEntityDTO();
|
|
|
|
+ neoEntityDTO.setName(name);
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ List<LIS> lisres = lisRepository.findByNameIs(name);
|
|
|
|
+
|
|
|
|
+ if (lisres!= null && lisres.size()>0) {
|
|
|
|
+ LIS lis = lisres.get(0);
|
|
|
|
+
|
|
|
|
+ for (String key : props.keySet()) {
|
|
|
|
+ switch (key) {
|
|
|
|
+ case "最大值":
|
|
|
|
+ lis.setMaxval(Double.parseDouble(props.get(key)));
|
|
|
|
+ break;
|
|
|
|
+ case "最小值":
|
|
|
|
+ lis.setMinval(Double.parseDouble(props.get(key)));
|
|
|
|
+ break;
|
|
|
|
+ case "单位":
|
|
|
|
+ lis.setUnit(props.get(key));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ lis = lisRepository.save(lis);
|
|
|
|
+
|
|
|
|
+ neoEntityDTO = fillNeoDTO(lis, keys);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex) {
|
|
|
|
+ ex.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return neoEntityDTO;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private NeoEntityDTO fillNeoDTO(LIS lis, List<String> keys) {
|
|
|
|
+ NeoEntityDTO neoEntityDTO = new NeoEntityDTO();
|
|
|
|
+ Map<String, String> props = new HashMap<>();
|
|
|
|
+ String val;
|
|
|
|
+
|
|
|
|
+ neoEntityDTO.setName(lis.getName());
|
|
|
|
+ for (String key:keys) {
|
|
|
|
+ val = "";
|
|
|
|
+ switch(key) {
|
|
|
|
+ case "最大值":
|
|
|
|
+ val = (lis.getMaxval()==null)?"":String.format("%.2f",lis.getMaxval());
|
|
|
|
+ break;
|
|
|
|
+ case "最小值":
|
|
|
|
+ val = (lis.getMinval()==null)?"":String.format("%.2f", lis.getMinval());
|
|
|
|
+ break;
|
|
|
|
+ case "单位":
|
|
|
|
+ val = lis.getUnit();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (StringUtil.isNotBlank(val)) {
|
|
|
|
+ props.put(key, val);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ neoEntityDTO.setProperty(props);
|
|
|
|
+
|
|
|
|
+ return neoEntityDTO;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|