|
@@ -0,0 +1,96 @@
|
|
|
+package com.diagbot.repository;
|
|
|
+
|
|
|
+import com.diagbot.dto.BillNeoDTO;
|
|
|
+import com.diagbot.dto.CombiOpBillNeoDTO;
|
|
|
+import com.diagbot.dto.NodeNeoDTO;
|
|
|
+import com.diagbot.dto.TransfusionBillNeoDTO;
|
|
|
+import com.diagbot.entity.node.*;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.NeoUtil;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
+public class TransfusionRemindNode {
|
|
|
+
|
|
|
+ public TransfusionBillNeoDTO TransfusionRemindtoTransfusionDTO(List<TransfusionRemind> transfusionReminds) {
|
|
|
+
|
|
|
+ TransfusionBillNeoDTO transfusionBillNeoDTO = new TransfusionBillNeoDTO();
|
|
|
+ NodeInfo nodeInfo;
|
|
|
+ NodeNeoDTO nodeNeoDTO;
|
|
|
+ String typelbl = "";
|
|
|
+
|
|
|
+ for (TransfusionRemind tr : transfusionReminds) {
|
|
|
+ nodeNeoDTO = new NodeNeoDTO();
|
|
|
+ nodeInfo = new NodeInfo();
|
|
|
+ nodeInfo.setName(tr.getIndex_name());
|
|
|
+
|
|
|
+ String label = tr.getNode_label();
|
|
|
+ switch (label) {
|
|
|
+ case "医保手术和操作名称":
|
|
|
+ typelbl = Constants.shoushu;
|
|
|
+ nodeInfo.setTypeval(typelbl);
|
|
|
+ nodeNeoDTO = NeoUtil.updateNodeInfo(nodeInfo);
|
|
|
+ transfusionBillNeoDTO.getOperations().add(nodeNeoDTO);
|
|
|
+ break;
|
|
|
+ case "医保疾病名称":
|
|
|
+ typelbl = Constants.zhenduan;
|
|
|
+ nodeInfo.setTypeval(typelbl);
|
|
|
+ nodeNeoDTO = NeoUtil.updateNodeInfo(nodeInfo);
|
|
|
+ transfusionBillNeoDTO.getDisease().add(nodeNeoDTO);
|
|
|
+ break;
|
|
|
+ case "实验室检查名称":
|
|
|
+ typelbl = Constants.huayan;
|
|
|
+ nodeInfo.setTypeval(typelbl);
|
|
|
+ nodeInfo.setMinval(NeoUtil.DoubletoBigDecimal(tr.getMinval()));
|
|
|
+ nodeInfo.setMaxval(NeoUtil.DoubletoBigDecimal(tr.getMaxval()));
|
|
|
+ nodeInfo.setUnit(tr.getUnit());
|
|
|
+ nodeNeoDTO = NeoUtil.updateNodeInfo(nodeInfo);
|
|
|
+ transfusionBillNeoDTO.getLis().add(nodeNeoDTO);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return transfusionBillNeoDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取输血开单合理性
|
|
|
+ */
|
|
|
+ public List<BillNeoDTO> getTransfusionBill(Map<String, String> transfusion, TransfusionRemindRepository transfusionRepository) {
|
|
|
+
|
|
|
+ List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
|
|
|
+ BillNeoDTO billNeoDTO;
|
|
|
+
|
|
|
+ TransfusionBillNeoDTO transfusionBillNeoDTO;
|
|
|
+
|
|
|
+ List<TransfusionRemind> trlist;
|
|
|
+ String transfsname;
|
|
|
+
|
|
|
+ for (String term : transfusion.keySet()) {
|
|
|
+ billNeoDTO = new BillNeoDTO();
|
|
|
+ transfsname = transfusion.get(term);
|
|
|
+ billNeoDTO.setName(term);
|
|
|
+ billNeoDTO.setStandname(transfsname);
|
|
|
+
|
|
|
+ trlist = transfusionRepository.findByTransfusionName(transfsname);
|
|
|
+
|
|
|
+ if (ListUtil.isNotEmpty(trlist)) {
|
|
|
+ transfusionBillNeoDTO = TransfusionRemindtoTransfusionDTO(trlist);
|
|
|
+
|
|
|
+ billNeoDTO.setTransfusionBillNeoDTO(transfusionBillNeoDTO);
|
|
|
+
|
|
|
+ billNeoDTOs.add(billNeoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return billNeoDTOs;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|