|
@@ -1,16 +1,15 @@
|
|
|
package com.diagbot.repository;
|
|
|
|
|
|
|
|
|
-import com.diagbot.dto.BillNeoDTO;
|
|
|
-import com.diagbot.dto.HighRiskNeoDTO;
|
|
|
-import com.diagbot.dto.OperationBillNeoDTO;
|
|
|
-import com.diagbot.dto.OperationInfoDTO;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.diagbot.biz.push.entity.Item;
|
|
|
+import com.diagbot.dto.*;
|
|
|
import com.diagbot.entity.node.*;
|
|
|
+import com.diagbot.model.label.VitalLabel;
|
|
|
+import com.diagbot.util.CoreUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.NeoUtil;
|
|
|
|
|
|
-import javax.xml.soap.Node;
|
|
|
-import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -176,16 +175,17 @@ public class YiBaoOperationNameNode {
|
|
|
/**
|
|
|
* 获取高危手术和操作数据
|
|
|
*/
|
|
|
- public List<HighRiskNeoDTO> getHighRiskOperation(Map<String, String> opsterm, YiBaoOperationNameRepository operationRepository) {
|
|
|
+ public List<HighRiskNeoDTO> getHighRiskOperation(WordCrfDTO wordCrfDTO, YiBaoOperationNameRepository operationRepository) {
|
|
|
List<HighRiskNeoDTO> highRiskNeoDTOS = new ArrayList<>();
|
|
|
HighRiskNeoDTO highRiskNeoDTO;
|
|
|
- String opname, opgrade;
|
|
|
+ String term, opname, opgrade;
|
|
|
YiBaoOperationName operation;
|
|
|
|
|
|
- for (String term : opsterm.keySet()) {
|
|
|
+ for (Item item : wordCrfDTO.getOperationOrder()) {
|
|
|
highRiskNeoDTO = new HighRiskNeoDTO();
|
|
|
|
|
|
- opname = opsterm.get(term).trim();
|
|
|
+ term = item.getName().trim();
|
|
|
+ opname = item.getUniqueName().trim();
|
|
|
highRiskNeoDTO.setName(term);
|
|
|
highRiskNeoDTO.setStandname(opname);
|
|
|
|
|
@@ -201,6 +201,12 @@ public class YiBaoOperationNameNode {
|
|
|
highRiskNeoDTO.setType(Constants.shoushu);
|
|
|
highRiskNeoDTOS.add(highRiskNeoDTO);
|
|
|
}
|
|
|
+ else if (opgrade.equals("2")) {
|
|
|
+ highRiskNeoDTO = isHighRisk(wordCrfDTO, operation, highRiskNeoDTO);
|
|
|
+ if (null != highRiskNeoDTO) {
|
|
|
+ highRiskNeoDTOS.add(highRiskNeoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -208,4 +214,73 @@ public class YiBaoOperationNameNode {
|
|
|
return highRiskNeoDTOS;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public HighRiskNeoDTO isHighRisk(WordCrfDTO wordCrfDTO, YiBaoOperationName operation, HighRiskNeoDTO highRiskNeoDTO) {
|
|
|
+
|
|
|
+ NodeNeoDTO nodeNeoDTO;
|
|
|
+ Boolean match;
|
|
|
+ Map<String, Object> res;
|
|
|
+
|
|
|
+ try {
|
|
|
+ String cond = operation.getHighriskcond();
|
|
|
+ JSONObject jobj = JSONObject.parseObject(cond);
|
|
|
+ // 判断年龄
|
|
|
+ JSONObject ageobj = jobj.getJSONObject("年龄");
|
|
|
+ int age = wordCrfDTO.getAge();
|
|
|
+
|
|
|
+ nodeNeoDTO = NeoUtil.jsontoNodeNeoDTO("年龄", ageobj);
|
|
|
+ match = CoreUtil.compareNum(nodeNeoDTO, age);
|
|
|
+ if (match) {
|
|
|
+ highRiskNeoDTO.getFactor().add(nodeNeoDTO);
|
|
|
+ }
|
|
|
+ // 判断生命体征和查体
|
|
|
+ VitalLabel vitalLabel = wordCrfDTO.getVitalLabel();
|
|
|
+ JSONObject vitalobj = jobj.getJSONObject("生命体征及查体");
|
|
|
+ for (String key : vitalobj.keySet()) {
|
|
|
+ nodeNeoDTO = NeoUtil.jsontoNodeNeoDTO(key, vitalobj.getJSONObject(key));
|
|
|
+ res = CoreUtil.compareVital(nodeNeoDTO, vitalLabel);
|
|
|
+
|
|
|
+ if ((Boolean)res.get("flag")) {
|
|
|
+ highRiskNeoDTO.getFactor().add(nodeNeoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断合并疾病
|
|
|
+ List<Item> diags = wordCrfDTO.getDiag();
|
|
|
+ JSONObject diagobj = jobj.getJSONObject("合并疾病");
|
|
|
+ for (String key : diagobj.keySet()) {
|
|
|
+ nodeNeoDTO = NeoUtil.jsontoNodeNeoDTO(key, diagobj.getJSONObject(key));
|
|
|
+ match = CoreUtil.compareNameWithNodeNeoDTO(nodeNeoDTO, diags);
|
|
|
+ if (match) {
|
|
|
+ highRiskNeoDTO.getFactor().add(nodeNeoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断化验结果
|
|
|
+ List<com.diagbot.biz.push.entity.Lis> lislist = wordCrfDTO.getLis();
|
|
|
+ JSONObject lisobj = jobj.getJSONObject("化验结果");
|
|
|
+ for (String key : lisobj.keySet()) {
|
|
|
+ nodeNeoDTO = NeoUtil.jsontoNodeNeoDTO(key, lisobj.getJSONObject(key));
|
|
|
+ for (com.diagbot.biz.push.entity.Lis lis : lislist) {
|
|
|
+ res = CoreUtil.compareLis(nodeNeoDTO, lis);
|
|
|
+
|
|
|
+ if ((Boolean)res.get("flag")) {
|
|
|
+ highRiskNeoDTO.getFactor().add(nodeNeoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断辅检结果
|
|
|
+ }
|
|
|
+ catch (Exception ex) {
|
|
|
+ ex.printStackTrace();
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ return highRiskNeoDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|