|
@@ -8,13 +8,16 @@ import com.diagbot.dto.IndicationDTO;
|
|
|
import com.diagbot.dto.NodeNeoDTO;
|
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
|
import com.diagbot.enums.TypeEnum;
|
|
|
+import com.diagbot.model.entity.Vital;
|
|
|
import com.diagbot.model.label.PacsLabel;
|
|
|
+import com.diagbot.model.label.VitalLabel;
|
|
|
+import com.diagbot.rule.AgeRule;
|
|
|
import com.diagbot.util.CoreUtil;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.MsgUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -34,97 +37,74 @@ public class HighRiskProcess {
|
|
|
*/
|
|
|
public void process(List<HighRiskNeoDTO> highRiskNeoDTOList, IndicationDTO res, WordCrfDTO wordCrfDTO) {
|
|
|
for (HighRiskNeoDTO highRiskNeoDTO : highRiskNeoDTOList) {
|
|
|
- BillMsg billMsg = new BillMsg();
|
|
|
- String type = highRiskNeoDTO.getType();
|
|
|
- if (TypeEnum.operation.getName().equals(type)) {
|
|
|
- billMsg.setMsg(highRiskNeoDTO.getName() + "为高风险手术,请留意");
|
|
|
- } else if (TypeEnum.drug.getName().equals(type)) {
|
|
|
- billMsg.setMsg(highRiskNeoDTO.getName() + "为" + highRiskNeoDTO.getHighLevel() + "药品,请留意");
|
|
|
- }
|
|
|
-
|
|
|
- billMsg.setOrderName(highRiskNeoDTO.getName());
|
|
|
- billMsg.setOrderStandName(highRiskNeoDTO.getStandname());
|
|
|
- billMsg.setType(type);
|
|
|
- res.getHighRiskList().add(billMsg);
|
|
|
System.out.println(highRiskNeoDTO);
|
|
|
- }
|
|
|
- // TODO 测试数据开始
|
|
|
- HighRiskNeoDTO highRiskNeoDTO = new HighRiskNeoDTO();
|
|
|
- highRiskNeoDTO.setName("锁骨下动脉药物洗脱支架置入术");
|
|
|
- highRiskNeoDTO.setStandname("锁骨下动脉药物洗脱支架置入术");
|
|
|
- highRiskNeoDTO.setType("手术");
|
|
|
- List<NodeNeoDTO> factor = highRiskNeoDTO.getFactor();
|
|
|
- NodeNeoDTO nodeNeo = new NodeNeoDTO();
|
|
|
- nodeNeo.setTermtype("诊断");
|
|
|
- nodeNeo.setName("急性胰腺炎");
|
|
|
- factor.add(nodeNeo);
|
|
|
- NodeNeoDTO nodeLis = new NodeNeoDTO();
|
|
|
- nodeLis.setTermtype("化验");
|
|
|
- nodeLis.setName("白细胞计数");
|
|
|
- nodeLis.setMax(new BigDecimal(20));
|
|
|
- nodeLis.setMin(new BigDecimal(10));
|
|
|
- nodeLis.setValType(0);
|
|
|
- factor.add(nodeLis);
|
|
|
- NodeNeoDTO nodeLis1 = new NodeNeoDTO();
|
|
|
- nodeLis1.setTermtype("化验");
|
|
|
- nodeLis1.setName("红细胞压积");
|
|
|
- nodeLis1.setVal("阳性");
|
|
|
- factor.add(nodeLis1);
|
|
|
+ String type = highRiskNeoDTO.getType();
|
|
|
+ if (highRiskNeoDTO.getIsHighrisk()) {
|
|
|
+ BillMsg billMsg = new BillMsg();
|
|
|
+ if (TypeEnum.operation.getName().equals(type)) {
|
|
|
+ billMsg.setMsg(highRiskNeoDTO.getName() + "为高风险手术,请留意");
|
|
|
+ } else if (TypeEnum.drug.getName().equals(type)) {
|
|
|
+ billMsg.setMsg(highRiskNeoDTO.getName() + "为" + highRiskNeoDTO.getHighLevel() + "药品,请留意");
|
|
|
+ }
|
|
|
|
|
|
- NodeNeoDTO nodePass = new NodeNeoDTO();
|
|
|
- nodePass.setTermtype("辅检");
|
|
|
- nodePass.setName("胸部CT");
|
|
|
- nodePass.setVal("肺叶根治性切除标本");
|
|
|
- factor.add(nodePass);
|
|
|
- highRiskNeoDTOList.add(highRiskNeoDTO);
|
|
|
- // TODO 测试数据结束
|
|
|
- proceSurgery(highRiskNeoDTOList, res, wordCrfDTO);
|
|
|
- }
|
|
|
+ billMsg.setOrderName(highRiskNeoDTO.getName());
|
|
|
+ billMsg.setOrderStandName(highRiskNeoDTO.getStandname());
|
|
|
+ billMsg.setType(type);
|
|
|
+ res.getHighRiskList().add(billMsg);
|
|
|
+ } else {
|
|
|
|
|
|
- public void proceSurgery(List<HighRiskNeoDTO> highRiskNeoDTOList, IndicationDTO res, WordCrfDTO wordCrfDTO) {
|
|
|
- for (HighRiskNeoDTO highRiskNeoDTO : highRiskNeoDTOList) {
|
|
|
- String type = highRiskNeoDTO.getType();
|
|
|
- List<Item> diag = wordCrfDTO.getDiag();
|
|
|
- List<Lis> lisList = wordCrfDTO.getLis();
|
|
|
- PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
|
|
|
- //diagLabel 诊断
|
|
|
- if (TypeEnum.operation.getName().equals(type)) {
|
|
|
- List<NodeNeoDTO> factor = highRiskNeoDTO.getFactor();
|
|
|
- for (NodeNeoDTO nodeNeoDTO : factor) {
|
|
|
- if (TypeEnum.disease.getName().equals(nodeNeoDTO.getTermtype())) {
|
|
|
- String name = nodeNeoDTO.getName();
|
|
|
- for (Item item : diag) {
|
|
|
- if (item.getUniqueName().equals(name)) {
|
|
|
- BillMsg billMsg = MsgUtil.getComplexOperationMsg("高风险手术", item.getName(), nodeNeoDTO.getTermtype());
|
|
|
- res.getHighRiskList().add(billMsg);
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (TypeEnum.lis.getName().equals(nodeNeoDTO.getTermtype())) {
|
|
|
- for (Lis lis : lisList) {
|
|
|
- if (lis.getUniqueName().equals(nodeNeoDTO.getName())) {
|
|
|
- Map<String, Object> map = CoreUtil.compareLis(nodeNeoDTO, lis);
|
|
|
- if ((Boolean) map.get("flag") == true) {
|
|
|
- BillMsg billMsg = MsgUtil.getComplexOperationMsg("高风险手术", (String)map.get("msg"), nodeNeoDTO.getTermtype());
|
|
|
+ List<Item> diag = wordCrfDTO.getDiag();
|
|
|
+ List<Lis> lisList = wordCrfDTO.getLis();
|
|
|
+ PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
|
|
|
+ VitalLabel vitalLabel = wordCrfDTO.getVitalLabel();
|
|
|
+ Integer age1 = wordCrfDTO.getAge();
|
|
|
+ // 复杂情况高危手术
|
|
|
+ if (TypeEnum.operation.getName().equals(type)) {
|
|
|
+ List<NodeNeoDTO> factor = highRiskNeoDTO.getFactor();
|
|
|
+ for (NodeNeoDTO nodeNeoDTO : factor) {
|
|
|
+ if (TypeEnum.disease.getName().equals(nodeNeoDTO.getTermtype())) {
|
|
|
+ String name = nodeNeoDTO.getName();
|
|
|
+ for (Item item : diag) {
|
|
|
+ if (item.getUniqueName().equals(name)) {
|
|
|
+ BillMsg billMsg = MsgUtil.getComplexOperationMsg( item.getName(), highRiskNeoDTO.getName(),nodeNeoDTO.getTermtype());
|
|
|
res.getHighRiskList().add(billMsg);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- } else if (TypeEnum.pacs.getName().equals(nodeNeoDTO.getTermtype())) {
|
|
|
- //辅助检查描述
|
|
|
- List<Item> pacsDescList = new ArrayList<>();
|
|
|
- pacsLabel.getRes().stream().forEach(
|
|
|
- x -> {
|
|
|
- Item item = new Item();
|
|
|
- item.setName(x.getName());
|
|
|
- item.setUniqueName(x.getUniqueName());
|
|
|
- pacsDescList.add(item);
|
|
|
+ } else if (TypeEnum.lis.getName().equals(nodeNeoDTO.getTermtype())) {
|
|
|
+ for (Lis lis : lisList) {
|
|
|
+ if (lis.getUniqueName().equals(nodeNeoDTO.getName())) {
|
|
|
+ Map<String, Object> map = CoreUtil.compareLis(nodeNeoDTO, lis);
|
|
|
+ if ((Boolean) map.get("flag") == true) {
|
|
|
+ BillMsg billMsg = MsgUtil.getComplexOperationMsg((String)map.get("msg"), highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
|
|
|
+ res.getHighRiskList().add(billMsg);
|
|
|
+ }
|
|
|
}
|
|
|
- );
|
|
|
+ }
|
|
|
+ } else if (TypeEnum.pacs.getName().equals(nodeNeoDTO.getTermtype())) {
|
|
|
+ List<Item> pacsDescList = pacsLabel.getRes();
|
|
|
+ //辅检匹配结果
|
|
|
+ for (Item item : pacsDescList) {
|
|
|
+ if (item.getUniqueName().equals(nodeNeoDTO.getVal())) {
|
|
|
+ BillMsg billMsg = MsgUtil.getComplexOperationMsg(item.getName(), highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
|
|
|
+ res.getHighRiskList().add(billMsg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (TypeEnum.vital.getName().equals(nodeNeoDTO.getTermtype())){
|
|
|
+ Map<String, Object> map = CoreUtil.compareVital(nodeNeoDTO, vitalLabel);
|
|
|
+ if ((Boolean) map.get("flag") == true) {
|
|
|
+ BillMsg commonBillMsg = MsgUtil.getComplexOperationMsg((String)map.get("msg"),highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
|
|
|
+ res.getHighRiskList().add(commonBillMsg);
|
|
|
+ }
|
|
|
|
|
|
- //辅检匹配结果
|
|
|
- for (Item item : pacsDescList) {
|
|
|
- if (item.getUniqueName().equals(nodeNeoDTO.getVal())) {
|
|
|
- BillMsg billMsg = MsgUtil.getComplexOperationMsg("高风险手术", item.getName(), nodeNeoDTO.getTermtype());
|
|
|
+ }else if(TypeEnum.age.getName().equals(nodeNeoDTO.getTermtype())){
|
|
|
+ Boolean flag = false;
|
|
|
+ if(nodeNeoDTO != null && wordCrfDTO.getAge() != null) {
|
|
|
+ Integer age = wordCrfDTO.getAge();
|
|
|
+ flag = CoreUtil.compareNum(nodeNeoDTO, age);
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ String message = "年龄" + wordCrfDTO.getAge();
|
|
|
+ BillMsg billMsg = MsgUtil.getComplexOperationMsg(message, highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
|
|
|
res.getHighRiskList().add(billMsg);
|
|
|
}
|
|
|
}
|