|
@@ -58,6 +58,12 @@ public class ReportServiceImpl implements ReportService {
|
|
private final EnteralNutritionConsumableMapper enteralNutritionConsumableMapper;
|
|
private final EnteralNutritionConsumableMapper enteralNutritionConsumableMapper;
|
|
private final SuppliesManageMapper suppliesManageMapper;
|
|
private final SuppliesManageMapper suppliesManageMapper;
|
|
private final SuppliesCategoryMapper suppliesCategoryMapper;
|
|
private final SuppliesCategoryMapper suppliesCategoryMapper;
|
|
|
|
+ private final NutritionScreeningMapper nutritionScreeningMapper;
|
|
|
|
+ private final NutritionEvaluationMapper nutritionEvaluationMapper;
|
|
|
|
+ private final NutritionDiagnosisMapper nutritionDiagnosisMapper;
|
|
|
|
+ private final NutritionEducationMapper nutritionEducationMapper;
|
|
|
|
+ private final SysScreeningAssessmentConfigMapper sysScreeningAssessmentConfigMapper;
|
|
|
|
+ private final SysDiseaseLabelMapper sysDiseaseLabelMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public R getNutritionalQualityControl(Timestamp start, Timestamp end) {
|
|
public R getNutritionalQualityControl(Timestamp start, Timestamp end) {
|
|
@@ -102,6 +108,7 @@ public class ReportServiceImpl implements ReportService {
|
|
.ge(bo.getCalculationDateEarliest() != null, HospitalMealPlan::getCreateTime, bo.getCalculationDateEarliest())
|
|
.ge(bo.getCalculationDateEarliest() != null, HospitalMealPlan::getCreateTime, bo.getCalculationDateEarliest())
|
|
.le(bo.getCalculationDateLatest() != null, HospitalMealPlan::getCreateTime, bo.getCalculationDateLatest())
|
|
.le(bo.getCalculationDateLatest() != null, HospitalMealPlan::getCreateTime, bo.getCalculationDateLatest())
|
|
.in(!ids.isEmpty(), HospitalMealPlan::getPatientId, ids)
|
|
.in(!ids.isEmpty(), HospitalMealPlan::getPatientId, ids)
|
|
|
|
+ .eq(bo.getConsultationType() != null, HospitalMealPlan::getType, bo.getConsultationType())
|
|
.eq(bo.getPatientDepartmentId() != null, HospitalMealPlan::getDeptId, bo.getPatientDepartmentId())
|
|
.eq(bo.getPatientDepartmentId() != null, HospitalMealPlan::getDeptId, bo.getPatientDepartmentId())
|
|
.eq(bo.getDoctorDepartmentId() != null, HospitalMealPlan::getCreateDept, bo.getDoctorDepartmentId())
|
|
.eq(bo.getDoctorDepartmentId() != null, HospitalMealPlan::getCreateDept, bo.getDoctorDepartmentId())
|
|
.isNotNull(HospitalMealPlan::getSettlementId)
|
|
.isNotNull(HospitalMealPlan::getSettlementId)
|
|
@@ -356,7 +363,7 @@ public class ReportServiceImpl implements ReportService {
|
|
for (Long ingredientId : recipeToIngredientMap.get(recipe.getRecipeId()))
|
|
for (Long ingredientId : recipeToIngredientMap.get(recipe.getRecipeId()))
|
|
for (SysFoodIngredient e : ingredients) {
|
|
for (SysFoodIngredient e : ingredients) {
|
|
if (Objects.equals(ingredientId, e.getFoodIngredientId())) ingredientNames.add(e.getName());
|
|
if (Objects.equals(ingredientId, e.getFoodIngredientId())) ingredientNames.add(e.getName());
|
|
- cost = cost.add(e.getPurchasePrice());
|
|
|
|
|
|
+ if (e.getPurchasePrice() != null) cost = cost.add(e.getPurchasePrice());
|
|
}
|
|
}
|
|
|
|
|
|
foodVo.setIngredients(ingredientNames);
|
|
foodVo.setIngredients(ingredientNames);
|
|
@@ -632,9 +639,11 @@ public class ReportServiceImpl implements ReportService {
|
|
Map<Long, String> typeMap = new HashMap<>();
|
|
Map<Long, String> typeMap = new HashMap<>();
|
|
Map<Long, String> manufacturerMap = new HashMap<>();
|
|
Map<Long, String> manufacturerMap = new HashMap<>();
|
|
Map<Long, String> providerMap = new HashMap<>();
|
|
Map<Long, String> providerMap = new HashMap<>();
|
|
|
|
+ Map<String, String> unitMap = new HashMap<>();
|
|
|
|
|
|
productManufacturerMapper.selectList().forEach(e -> manufacturerMap.put(e.getId(), e.getName()));
|
|
productManufacturerMapper.selectList().forEach(e -> manufacturerMap.put(e.getId(), e.getName()));
|
|
productSupplierMapper.selectList().forEach(e -> providerMap.put(e.getId(), e.getName()));
|
|
productSupplierMapper.selectList().forEach(e -> providerMap.put(e.getId(), e.getName()));
|
|
|
|
+ sysDictDataMapper.selectDictDataByType("product_package_unit").forEach(e -> unitMap.put(e.getDictValue(), e.getDictLabel()));
|
|
|
|
|
|
if (bo.getProductType() == 0) {
|
|
if (bo.getProductType() == 0) {
|
|
|
|
|
|
@@ -665,14 +674,16 @@ public class ReportServiceImpl implements ReportService {
|
|
vo.setProductClassification(productType);
|
|
vo.setProductClassification(productType);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String minUnit = unitMap.get(e.getMinUnit());
|
|
|
|
+
|
|
vo.setProductType("营养产品");
|
|
vo.setProductType("营养产品");
|
|
vo.setProductName(e.getProductName());
|
|
vo.setProductName(e.getProductName());
|
|
- vo.setProductSpecification(e.getProductSpec());
|
|
|
|
- vo.setProviderName(Objects.nonNull(e.getSupplier()) ? providerMap.get(Long.valueOf(e.getSupplier())) : null);
|
|
|
|
- vo.setManufacturerName(Objects.nonNull(e.getManufacturer()) ? manufacturerMap.get(Long.valueOf(e.getManufacturer())) : null);
|
|
|
|
|
|
+ vo.setProductSpecification(e.getProductSpec() + minUnit);
|
|
|
|
+ vo.setProviderName(Objects.nonNull(e.getSupplier()) && !e.getSupplier().isEmpty() ? providerMap.get(Long.valueOf(e.getSupplier())) : null);
|
|
|
|
+ vo.setManufacturerName(Objects.nonNull(e.getManufacturer()) && !e.getManufacturer().isEmpty() ? manufacturerMap.get(Long.valueOf(e.getManufacturer())) : null);
|
|
|
|
|
|
- String prePackageUnit = e.getPackageUnit();
|
|
|
|
- String configureUnit = e.getMinUnit();
|
|
|
|
|
|
+ String prePackageUnit = unitMap.get(e.getPackageUnit());
|
|
|
|
+ String configureUnit = unitMap.get(e.getMinUnit());
|
|
|
|
|
|
int prePackageCount = 0, configureCount = 0, longTermCount = 0;
|
|
int prePackageCount = 0, configureCount = 0, longTermCount = 0;
|
|
for (EnteralNutrition enteralNutrition : enteralNutritionList) {
|
|
for (EnteralNutrition enteralNutrition : enteralNutritionList) {
|
|
@@ -688,20 +699,20 @@ public class ReportServiceImpl implements ReportService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- vo.setPrePackageSalesVolume(prePackageCount + prePackageUnit);
|
|
|
|
|
|
+ vo.setPrePackageSalesVolume(prePackageCount + ".00" + prePackageUnit);
|
|
vo.setPrePackageSalesAmount(e.getPackagePrice().multiply(new BigDecimal(prePackageCount)));
|
|
vo.setPrePackageSalesAmount(e.getPackagePrice().multiply(new BigDecimal(prePackageCount)));
|
|
- vo.setPrePackagePurchaseUnitPrice(new BigDecimal("0"));
|
|
|
|
- vo.setPrePackagePurchaseAmount(new BigDecimal("0"));
|
|
|
|
- vo.setConfigureSalesVolume(configureCount + configureUnit);
|
|
|
|
|
|
+ vo.setPrePackagePurchaseUnitPrice(new BigDecimal("0.00"));
|
|
|
|
+ vo.setPrePackagePurchaseAmount(new BigDecimal("0.00"));
|
|
|
|
+ vo.setConfigureSalesVolume(configureCount + ".00" + configureUnit);
|
|
vo.setConfigureSalesAmount(e.getConfigSalePrice().multiply(new BigDecimal(configureCount)));
|
|
vo.setConfigureSalesAmount(e.getConfigSalePrice().multiply(new BigDecimal(configureCount)));
|
|
- vo.setLongTermPrescriptionSalesVolume(longTermCount + configureUnit);
|
|
|
|
|
|
+ vo.setLongTermPrescriptionSalesVolume(longTermCount + ".00" + configureUnit);
|
|
vo.setLongTermPrescriptionSalesAmount(e.getConfigSalePrice().multiply(new BigDecimal(longTermCount)));
|
|
vo.setLongTermPrescriptionSalesAmount(e.getConfigSalePrice().multiply(new BigDecimal(longTermCount)));
|
|
- vo.setPrePackageRefundVolume("0" + prePackageUnit);
|
|
|
|
- vo.setPrePackageRefundAmount(new BigDecimal("0"));
|
|
|
|
- vo.setConfigureRefundVolume("0" + configureUnit);
|
|
|
|
- vo.setConfigureRefundAmount(new BigDecimal("0"));
|
|
|
|
- vo.setLongTermPrescriptionRefundVolume("0" + configureUnit);
|
|
|
|
- vo.setLongTermPrescriptionRefundAmount(new BigDecimal("0"));
|
|
|
|
|
|
+ vo.setPrePackageRefundVolume("0.00" + prePackageUnit);
|
|
|
|
+ vo.setPrePackageRefundAmount(new BigDecimal("0.00"));
|
|
|
|
+ vo.setConfigureRefundVolume("0.00" + configureUnit);
|
|
|
|
+ vo.setConfigureRefundAmount(new BigDecimal("0.00"));
|
|
|
|
+ vo.setLongTermPrescriptionRefundVolume("0.00" + configureUnit);
|
|
|
|
+ vo.setLongTermPrescriptionRefundAmount(new BigDecimal("0.00"));
|
|
return vo;
|
|
return vo;
|
|
}));
|
|
}));
|
|
} else {
|
|
} else {
|
|
@@ -729,13 +740,15 @@ public class ReportServiceImpl implements ReportService {
|
|
vo.setProductClassification(productClassification);
|
|
vo.setProductClassification(productClassification);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String specificationUnit = unitMap.get(e.getSuppliesSpecUnit());
|
|
|
|
+
|
|
vo.setProductName(e.getSuppliesName());
|
|
vo.setProductName(e.getSuppliesName());
|
|
- vo.setProductSpecification(e.getSuppliesSpec());
|
|
|
|
- vo.setProviderName(Objects.nonNull(e.getSupplier()) ? providerMap.get(e.getSupplier()) : null);
|
|
|
|
- vo.setManufacturerName(Objects.nonNull(e.getManufacturer()) ? manufacturerMap.get(e.getManufacturer()) : null);
|
|
|
|
|
|
+ vo.setProductSpecification(e.getSuppliesSpec() + specificationUnit);
|
|
|
|
+ vo.setProviderName(Objects.nonNull(e.getSupplier()) && !e.getSupplier().isEmpty() ? providerMap.get(Long.valueOf(e.getSupplier())) : null);
|
|
|
|
+ vo.setManufacturerName(Objects.nonNull(e.getManufacturer()) && !e.getManufacturer().isEmpty() ? manufacturerMap.get(Long.valueOf(e.getManufacturer())) : null);
|
|
|
|
|
|
- String prePackageUnit = e.getSuppliesUnit();
|
|
|
|
- String configureUnit = e.getSuppliesSpecUnit();
|
|
|
|
|
|
+ String prePackageUnit = unitMap.get(e.getSuppliesUnit());
|
|
|
|
+ String configureUnit = unitMap.get(e.getSuppliesSpecUnit());
|
|
|
|
|
|
int configureCount = 0, longTermCount = 0;
|
|
int configureCount = 0, longTermCount = 0;
|
|
for (EnteralNutritionConsumable enteralNutritionConsumable : enteralNutritionConsumableList) {
|
|
for (EnteralNutritionConsumable enteralNutritionConsumable : enteralNutritionConsumableList) {
|
|
@@ -744,23 +757,233 @@ public class ReportServiceImpl implements ReportService {
|
|
else longTermCount++;
|
|
else longTermCount++;
|
|
}
|
|
}
|
|
|
|
|
|
- vo.setPrePackageSalesVolume("0" + prePackageUnit);
|
|
|
|
- vo.setPrePackageSalesAmount(new BigDecimal("0"));
|
|
|
|
- vo.setPrePackagePurchaseUnitPrice(new BigDecimal("0"));
|
|
|
|
- vo.setPrePackagePurchaseAmount(new BigDecimal("0"));
|
|
|
|
- vo.setConfigureSalesVolume(configureCount + configureUnit);
|
|
|
|
- vo.setConfigureSalesAmount(e.getSellPrice().multiply(new BigDecimal(configureUnit)));
|
|
|
|
- vo.setLongTermPrescriptionSalesVolume(longTermCount + configureUnit);
|
|
|
|
|
|
+ vo.setPrePackageSalesVolume("0.00" + prePackageUnit);
|
|
|
|
+ vo.setPrePackageSalesAmount(new BigDecimal("0.00"));
|
|
|
|
+ vo.setPrePackagePurchaseUnitPrice(new BigDecimal("0.00"));
|
|
|
|
+ vo.setPrePackagePurchaseAmount(new BigDecimal("0.00"));
|
|
|
|
+ vo.setConfigureSalesVolume(configureCount + ".00" + configureUnit);
|
|
|
|
+ vo.setConfigureSalesAmount(e.getSellPrice().multiply(new BigDecimal(configureCount)));
|
|
|
|
+ vo.setLongTermPrescriptionSalesVolume(longTermCount + ".00" + configureUnit);
|
|
vo.setLongTermPrescriptionSalesAmount(e.getSellPrice().multiply(new BigDecimal(longTermCount)));
|
|
vo.setLongTermPrescriptionSalesAmount(e.getSellPrice().multiply(new BigDecimal(longTermCount)));
|
|
- vo.setPrePackageRefundVolume("0" + prePackageUnit);
|
|
|
|
- vo.setPrePackageRefundAmount(new BigDecimal("0"));
|
|
|
|
- vo.setConfigureRefundVolume("0" + configureUnit);
|
|
|
|
- vo.setConfigureRefundAmount(new BigDecimal("0"));
|
|
|
|
- vo.setLongTermPrescriptionRefundVolume("0" + configureUnit);
|
|
|
|
- vo.setLongTermPrescriptionRefundAmount(new BigDecimal("0"));
|
|
|
|
|
|
+ vo.setPrePackageRefundVolume("0.00" + prePackageUnit);
|
|
|
|
+ vo.setPrePackageRefundAmount(new BigDecimal("0.00"));
|
|
|
|
+ vo.setConfigureRefundVolume("0.00" + configureUnit);
|
|
|
|
+ vo.setConfigureRefundAmount(new BigDecimal("0.00"));
|
|
|
|
+ vo.setLongTermPrescriptionRefundVolume("0.00" + configureUnit);
|
|
|
|
+ vo.setLongTermPrescriptionRefundAmount(new BigDecimal("0.00"));
|
|
return vo;
|
|
return vo;
|
|
}));
|
|
}));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public TableDataInfo listPageScreeningOrAssessment(ScreeningOrAssessmentBo bo, PageQuery pageQuery) {
|
|
|
|
+
|
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ treatmentUserMapper.selectList(
|
|
|
|
+ Wrappers.lambdaQuery(TreatmentUser.class)
|
|
|
|
+ .like(bo.getPatientName() != null, TreatmentUser::getTreatName, bo.getPatientName())
|
|
|
|
+ ).forEach(e -> ids.add(e.getId()));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<Long, String> deptMap = new HashMap<>();
|
|
|
|
+ Map<Long, String> doctorMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ List<TreatmentUser> patientList = treatmentUserMapper.selectList();
|
|
|
|
+ sysDeptMapper.selectList().forEach(e -> deptMap.put(e.getDeptId(), e.getDeptName()));
|
|
|
|
+ sysUserMapper.selectList().forEach(e -> doctorMap.put(e.getUserId(), e.getName()));
|
|
|
|
+
|
|
|
|
+ switch (bo.getType()) {
|
|
|
|
+ case 1 -> {
|
|
|
|
+
|
|
|
|
+ Map<Long, String> screeningTypeMap = new HashMap<>();
|
|
|
|
+ sysScreeningAssessmentConfigMapper.selectList().forEach(e -> screeningTypeMap.put(e.getConfigId(), e.getName()));
|
|
|
|
+
|
|
|
|
+ IPage<NutritionScreening> page = nutritionScreeningMapper.selectPage(
|
|
|
|
+ pageQuery.build(),
|
|
|
|
+ Wrappers.lambdaQuery(NutritionScreening.class)
|
|
|
|
+ .ge(bo.getCreateTimeEarliest() != null, NutritionScreening::getCreateTime, bo.getCreateTimeEarliest())
|
|
|
|
+ .le(bo.getCreateTimeLatest() != null, NutritionScreening::getCreateTime, bo.getCreateTimeLatest())
|
|
|
|
+ .eq(bo.getDoctorDepartmentId() != null, NutritionScreening::getCreateDept, bo.getDoctorDepartmentId())
|
|
|
|
+ .eq(bo.getConsultationType() != null, NutritionScreening::getVisitType, bo.getConsultationType())
|
|
|
|
+ .in(!ids.isEmpty(), NutritionScreening::getPatientId, ids)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return TableDataInfo.build(page.convert(e -> {
|
|
|
|
+ NutritionalScreeningVo vo = new NutritionalScreeningVo();
|
|
|
|
+ vo.setCreateTime(e.getScreeningTime());
|
|
|
|
+ vo.setDoctorName(doctorMap.get(e.getCreateBy()));
|
|
|
|
+ vo.setDoctorDepartment(deptMap.get(e.getCreateDept()));
|
|
|
|
+ patientList.forEach(patient -> {
|
|
|
|
+ if (patient.getId().equals(e.getPatientId())) {
|
|
|
|
+ vo.setSicknessArea(patient.getWardName());
|
|
|
|
+ vo.setPatientName(patient.getTreatName());
|
|
|
|
+ vo.setBmi(patient.getBmi());
|
|
|
|
+ vo.setVisitType(Objects.equals(e.getVisitType(), "0") ? "门诊" : "住院");
|
|
|
|
+ vo.setPatientDepartment(deptMap.get(patient.getDoorId()));
|
|
|
|
+ vo.setMedicalId(patient.getTreatNum());
|
|
|
|
+ vo.setHeight(patient.getHeight());
|
|
|
|
+ vo.setWeight(patient.getWeight());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ vo.setScreeningType(screeningTypeMap.get(e.getConfigId()));
|
|
|
|
+ vo.setScreeningScore(e.getScreeningScore());
|
|
|
|
+ vo.setScreeningConclusion(e.getScreeningConclusion());
|
|
|
|
+ return vo;
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ case 2 -> {
|
|
|
|
+
|
|
|
|
+ Map<Long, String> configMap = new HashMap<>();
|
|
|
|
+ sysScreeningAssessmentConfigMapper.selectList().forEach(e -> configMap.put(e.getConfigId(), e.getName()));
|
|
|
|
+
|
|
|
|
+ IPage<NutritionEvaluation> page = nutritionEvaluationMapper.selectPage(
|
|
|
|
+ pageQuery.build(),
|
|
|
|
+ Wrappers.lambdaQuery(NutritionEvaluation.class)
|
|
|
|
+ .ge(bo.getCreateTimeEarliest() != null, NutritionEvaluation::getCreateTime, bo.getCreateTimeEarliest())
|
|
|
|
+ .le(bo.getCreateTimeLatest() != null, NutritionEvaluation::getCreateTime, bo.getCreateTimeLatest())
|
|
|
|
+ .eq(bo.getDoctorDepartmentId() != null, NutritionEvaluation::getCreateDept, bo.getDoctorDepartmentId())
|
|
|
|
+ .eq(bo.getConsultationType() != null, NutritionEvaluation::getVisitType, bo.getConsultationType())
|
|
|
|
+ .in(!ids.isEmpty(), NutritionEvaluation::getPatientId, ids)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return TableDataInfo.build(page.convert(e -> {
|
|
|
|
+ NutritionalEvaluationVo vo = new NutritionalEvaluationVo();
|
|
|
|
+ vo.setCreateTime(e.getCreateTime());
|
|
|
|
+ vo.setDoctor(doctorMap.get(e.getCreateBy()));
|
|
|
|
+ vo.setDoctorDepartment(deptMap.get(e.getCreateDept()));
|
|
|
|
+
|
|
|
|
+ patientList.forEach(patient -> {
|
|
|
|
+ if (e.getPatientId().equals(patient.getId())) {
|
|
|
|
+ vo.setConsultationType(Objects.equals(e.getVisitType(), "0") ? "门诊" : "住院");
|
|
|
|
+ vo.setSicknessArea(patient.getWardName());
|
|
|
|
+ vo.setPatientName(patient.getTreatName());
|
|
|
|
+ vo.setBmi(patient.getBmi());
|
|
|
|
+ vo.setPatientDepartment(deptMap.get(patient.getDoorId()));
|
|
|
|
+ vo.setMedicalId(patient.getTreatNum());
|
|
|
|
+ vo.setHeight(patient.getHeight());
|
|
|
|
+ vo.setWeight(patient.getWeight());
|
|
|
|
+ vo.setAdmissionId(patient.getOutpatientNo());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ vo.setEvaluationType(configMap.get(e.getConfigId()));
|
|
|
|
+ vo.setEvaluationScore(new BigDecimal("0"));
|
|
|
|
+ vo.setEvaluationConclusion(e.getContent());
|
|
|
|
+ return vo;
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ case 3 -> {
|
|
|
|
+
|
|
|
|
+ Map<Long, String> configMap = new HashMap<>();
|
|
|
|
+ Map<Long, String> screeningTypeMap = new HashMap<>();
|
|
|
|
+ Map<Long, String> diseaseLabelMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ sysScreeningAssessmentConfigMapper.selectList().forEach(e -> configMap.put(e.getConfigId(), e.getName()));
|
|
|
|
+ sysScreeningAssessmentConfigMapper.selectList().forEach(e -> screeningTypeMap.put(e.getConfigId(), e.getName()));
|
|
|
|
+ sysDiseaseLabelMapper.selectList().forEach(e -> diseaseLabelMap.put(e.getLabelId(), e.getLabelName()));
|
|
|
|
+
|
|
|
|
+ IPage<NutritionDiagnosis> page = nutritionDiagnosisMapper.selectPage(
|
|
|
|
+ pageQuery.build(),
|
|
|
|
+ Wrappers.lambdaQuery(NutritionDiagnosis.class)
|
|
|
|
+ .ge(bo.getCreateTimeEarliest() != null, NutritionDiagnosis::getCreateTime, bo.getCreateTimeEarliest())
|
|
|
|
+ .le(bo.getCreateTimeLatest() != null, NutritionDiagnosis::getCreateTime, bo.getCreateTimeLatest())
|
|
|
|
+ .eq(bo.getDoctorDepartmentId() != null, NutritionDiagnosis::getCreateDept, bo.getDoctorDepartmentId())
|
|
|
|
+ .eq(bo.getConsultationType() != null, NutritionDiagnosis::getType, bo.getConsultationType())
|
|
|
|
+ .in(!ids.isEmpty(), NutritionDiagnosis::getTreatmentUserId, ids)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return TableDataInfo.build(page.convert(e -> {
|
|
|
|
+ NutritionalDiagnosisVo vo = new NutritionalDiagnosisVo();
|
|
|
|
+ vo.setCreateTime(e.getCreateTime());
|
|
|
|
+ vo.setDoctor(doctorMap.get(e.getCreateBy()));
|
|
|
|
+ vo.setDoctorDepartment(deptMap.get(e.getCreateDept()));
|
|
|
|
+
|
|
|
|
+ patientList.forEach(patient -> {
|
|
|
|
+ if (e.getTreatmentUserId().equals(patient.getId())) {
|
|
|
|
+ vo.setConsultationType(Objects.equals(e.getType(), "0") ? "门诊" : "住院");
|
|
|
|
+ vo.setPatientName(patient.getTreatName());
|
|
|
|
+ vo.setBmi(patient.getBmi());
|
|
|
|
+ vo.setPatientDepartment(deptMap.get(patient.getDoorId()));
|
|
|
|
+ vo.setMedicalId(patient.getTreatNum());
|
|
|
|
+ vo.setHeight(patient.getHeight());
|
|
|
|
+ vo.setWeight(patient.getWeight());
|
|
|
|
+ vo.setAdmissionId(patient.getOutpatientNo());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ List<Long> diagnosisBasisIds = new ArrayList<>();
|
|
|
|
+ if (e.getDiagnosisBasisId() != null && !e.getDiagnosisBasisId().isEmpty()) {
|
|
|
|
+ String[] diagnosisBasisIdsInString = e.getDiagnosisBasisId().split(",");
|
|
|
|
+ for (String diagnosisBasisId : diagnosisBasisIdsInString) diagnosisBasisIds.add(Long.valueOf(diagnosisBasisId));
|
|
|
|
+ String diagnosisBasis = "";
|
|
|
|
+
|
|
|
|
+ List<NutritionScreening> nutritionScreeningList = nutritionScreeningMapper.selectList(
|
|
|
|
+ Wrappers.lambdaQuery(NutritionScreening.class)
|
|
|
|
+ .in(!diagnosisBasisIds.isEmpty(), NutritionScreening::getId, diagnosisBasisIds)
|
|
|
|
+ );
|
|
|
|
+ List<NutritionEvaluation> nutritionEvaluationList = nutritionEvaluationMapper.selectList(
|
|
|
|
+ Wrappers.lambdaQuery(NutritionEvaluation.class)
|
|
|
|
+ .in(!diagnosisBasisIds.isEmpty(), NutritionEvaluation::getId, diagnosisBasisIds)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ for (NutritionScreening nutritionScreening : nutritionScreeningList)
|
|
|
|
+ diagnosisBasis += screeningTypeMap.get(nutritionScreening.getConfigId()) + ",";
|
|
|
|
+ for (NutritionEvaluation nutritionEvaluation : nutritionEvaluationList)
|
|
|
|
+ diagnosisBasis += configMap.get(nutritionEvaluation.getConfigId()) + ",";
|
|
|
|
+
|
|
|
|
+ vo.setDiagnosisBasis(diagnosisBasis);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (e.getDiagnosisLableId() != null && !e.getDiagnosisLableId().isEmpty()) {
|
|
|
|
+ String[] diagnosisLabelIds = e.getDiagnosisLableId().split(",");
|
|
|
|
+ String nutritionDiagnosis = "";
|
|
|
|
+
|
|
|
|
+ for (String diagnosisLabelIdStr : diagnosisLabelIds)
|
|
|
|
+ nutritionDiagnosis += diseaseLabelMap.get(Long.valueOf(diagnosisLabelIdStr)) + ",";
|
|
|
|
+
|
|
|
|
+ vo.setNutritionDiagnosis(nutritionDiagnosis);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return vo;
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ case 4 -> {
|
|
|
|
+
|
|
|
|
+ IPage<NutritionEducation> page = nutritionEducationMapper.selectPage(
|
|
|
|
+ pageQuery.build(),
|
|
|
|
+ Wrappers.lambdaQuery(NutritionEducation.class)
|
|
|
|
+ .ge(bo.getCreateTimeEarliest() != null, NutritionEducation::getCreateTime, bo.getCreateTimeEarliest())
|
|
|
|
+ .le(bo.getCreateTimeLatest() != null, NutritionEducation::getCreateTime, bo.getCreateTimeLatest())
|
|
|
|
+ .eq(bo.getDoctorDepartmentId() != null, NutritionEducation::getCreateDept, bo.getDoctorDepartmentId())
|
|
|
|
+ .eq(bo.getConsultationType() != null, NutritionEducation::getType, bo.getConsultationType())
|
|
|
|
+ .in(!ids.isEmpty(), NutritionEducation::getPatientId, ids)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return TableDataInfo.build(page.convert(e -> {
|
|
|
|
+ NutritionalEducationVo vo = new NutritionalEducationVo();
|
|
|
|
+ vo.setCreateTime(e.getCreateTime());
|
|
|
|
+ vo.setEducationTitle(e.getEducationTitle());
|
|
|
|
+ vo.setDoctor(doctorMap.get(e.getCreateBy()));
|
|
|
|
+ vo.setDoctorDepartment(deptMap.get(e.getCreateDept()));
|
|
|
|
+
|
|
|
|
+ for (TreatmentUser patient : patientList) {
|
|
|
|
+ if (e.getPatientId().equals(patient.getId())) {
|
|
|
|
+ vo.setConsultationType(Objects.equals(e.getType(), "0") ? "门诊" : "住院");
|
|
|
|
+ vo.setPatientName(patient.getTreatName());
|
|
|
|
+ vo.setPatientDepartment(deptMap.get(patient.getDoorId()));
|
|
|
|
+ vo.setAdmissionId(patient.getOutpatientNo());
|
|
|
|
+ vo.setSicknessArea(patient.getWardName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return vo;
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ default -> throw new RuntimeException("位置报表类型!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|