|
@@ -2,10 +2,14 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.dto.BillNeoDTO;
|
|
|
import com.diagbot.dto.DrugBillNeoDTO;
|
|
|
+import com.diagbot.dto.PacsBillNeoDTO;
|
|
|
import com.diagbot.entity.node.Medicine;
|
|
|
+import com.diagbot.entity.node.PACS;
|
|
|
import com.diagbot.entity.relationship.Medicine_AgeMin;
|
|
|
import com.diagbot.repository.MedicineNode;
|
|
|
import com.diagbot.repository.MedicineRepository;
|
|
|
+import com.diagbot.repository.PACSNode;
|
|
|
+import com.diagbot.repository.PacsRepository;
|
|
|
import com.diagbot.vo.BillNeoVO;
|
|
|
import com.diagbot.vo.StandConvert;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -27,6 +31,9 @@ public class NeoFacade {
|
|
|
|
|
|
@Autowired
|
|
|
MedicineRepository medicineRepository;
|
|
|
+ @Autowired
|
|
|
+ PacsRepository pacsRepository;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 返回药品缓存信息
|
|
@@ -51,12 +58,10 @@ public class NeoFacade {
|
|
|
|
|
|
List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
|
|
|
|
|
|
- for (String medname : billNeoVO.getDrugList()) {
|
|
|
- BillNeoDTO billNeoDTO = new BillNeoDTO();
|
|
|
- billNeoDTO.setName(medname);
|
|
|
- billNeoDTO.setDrugBillNeoDTOList(getDrugBill(medname));
|
|
|
- }
|
|
|
+ billNeoDTOs.addAll(getDrugBill(billNeoVO.getDrugList()));
|
|
|
+ billNeoDTOs.addAll(getPacsBill(billNeoVO.getPacsList()));
|
|
|
|
|
|
+ System.out.println(billNeoDTOs);
|
|
|
return billNeoDTOs;
|
|
|
}
|
|
|
|
|
@@ -65,22 +70,68 @@ public class NeoFacade {
|
|
|
/**
|
|
|
* 处理处方开单合理性
|
|
|
*/
|
|
|
- public List<DrugBillNeoDTO> getDrugBill(String medname) {
|
|
|
- List<DrugBillNeoDTO> drugBillNeoDTOS = new ArrayList<>();
|
|
|
+ public List<BillNeoDTO> getDrugBill(List<String> meds) {
|
|
|
+ List<BillNeoDTO> billNeoDTOS = new ArrayList<>();
|
|
|
+ BillNeoDTO billNeoDTO;
|
|
|
+
|
|
|
DrugBillNeoDTO drugBillNeoDTO;
|
|
|
|
|
|
MedicineNode medicineNode = new MedicineNode();
|
|
|
Medicine medicine;
|
|
|
|
|
|
- medicine = medicineRepository.findByNameIs(medname);
|
|
|
+ for (String medname : meds) {
|
|
|
+ billNeoDTO = new BillNeoDTO();
|
|
|
+ billNeoDTO.setName(medname);
|
|
|
+ List<DrugBillNeoDTO> drugBillNeoDTOs = new ArrayList<>();
|
|
|
+
|
|
|
+ medicine = medicineRepository.findByNameIs(medname);
|
|
|
+
|
|
|
+ if (medicine!=null) {
|
|
|
+ drugBillNeoDTO = medicineNode.MedicinetoDrugDTO(medicine);
|
|
|
+
|
|
|
+ drugBillNeoDTOs.add(drugBillNeoDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+ billNeoDTO.setDrugBillNeoDTOList(drugBillNeoDTOs);
|
|
|
+
|
|
|
+ billNeoDTOS.add(billNeoDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+ return billNeoDTOS;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理辅检开单合理性
|
|
|
+ */
|
|
|
+ public List<BillNeoDTO> getPacsBill(List<String> pacslist) {
|
|
|
+ List<BillNeoDTO> billNeoDTOS = new ArrayList<>();
|
|
|
+ BillNeoDTO billNeoDTO;
|
|
|
+
|
|
|
+ PacsBillNeoDTO pacsBillNeoDTO;
|
|
|
+
|
|
|
+ PACSNode pacsNode = new PACSNode();
|
|
|
+ PACS pacs;
|
|
|
+
|
|
|
+ for (String pacsname : pacslist) {
|
|
|
+ billNeoDTO = new BillNeoDTO();
|
|
|
+ billNeoDTO.setName(pacsname);
|
|
|
+ List<PacsBillNeoDTO> pacsBillNeoDTOS = new ArrayList<>();
|
|
|
+
|
|
|
+ pacs = pacsRepository.findByNameIs(pacsname);
|
|
|
+
|
|
|
+ if (pacs!=null) {
|
|
|
+ pacsBillNeoDTO = pacsNode.PacstoPACSDTO(pacs);
|
|
|
+
|
|
|
+ pacsBillNeoDTOS.add(pacsBillNeoDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+ billNeoDTO.setPacsBillNeoDTOList(pacsBillNeoDTOS);
|
|
|
|
|
|
- if (medicine!=null) {
|
|
|
- drugBillNeoDTO = medicineNode.MedicinetoDrugDTO(medicine);
|
|
|
- System.out.println(drugBillNeoDTO);
|
|
|
- drugBillNeoDTOS.add(drugBillNeoDTO);
|
|
|
+ billNeoDTOS.add(billNeoDTO);
|
|
|
}
|
|
|
|
|
|
- return drugBillNeoDTOS;
|
|
|
+ return billNeoDTOS;
|
|
|
}
|
|
|
|
|
|
|