|
@@ -969,18 +969,15 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
return medServiceCostDetailList;
|
|
return medServiceCostDetailList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取医院病种成本明细表数据
|
|
|
|
|
- *
|
|
|
|
|
- * @return 病种成本明细列表
|
|
|
|
|
- */
|
|
|
|
|
- @Override
|
|
|
|
|
- public List<DiseaseCostDetailVO> getDiseaseCostDetail(String computeDate) {
|
|
|
|
|
- List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostDetailList(computeDate);
|
|
|
|
|
- if(CollectionUtils.isEmpty(projectCostAccountList)){
|
|
|
|
|
- throw new CostException("请先计算患者成本");
|
|
|
|
|
|
|
+ public List<DiseaseCostDetailVO> getDiseaseCostDetail(String computeDate, String diseaseFilter) {
|
|
|
|
|
+ List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostDetailList(computeDate,diseaseFilter);
|
|
|
|
|
+ if (CollectionUtils.isEmpty(projectCostAccountList)) {
|
|
|
|
|
+ throw new CostException("找不到满足条件的数据");
|
|
|
}
|
|
}
|
|
|
|
|
+ return getDiseaseCostDetail( computeDate,projectCostAccountList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public List<DiseaseCostDetailVO> getDiseaseCostDetail(String computeDate, List<DiseaseCostDetailVO> projectCostAccountList){
|
|
|
// 获取所有的标准字典数据
|
|
// 获取所有的标准字典数据
|
|
|
StandCostDictMapVO standCostDictMaps = getStandCostDictMaps();
|
|
StandCostDictMapVO standCostDictMaps = getStandCostDictMaps();
|
|
|
// 记录项目类别对象
|
|
// 记录项目类别对象
|
|
@@ -1034,17 +1031,29 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 获取病种成本构成明细表数据
|
|
|
|
|
|
|
+ * 获取医院病种成本明细表数据
|
|
|
*
|
|
*
|
|
|
- * @return 病种成本明细列表,包含各病种的成本明细及总计行
|
|
|
|
|
|
|
+ * @return 病种成本明细列表
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate) {
|
|
|
|
|
-
|
|
|
|
|
- List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostCompositionDetail(computeDate);
|
|
|
|
|
|
|
+ public List<DiseaseCostDetailVO> getDiseaseCostDetail(String computeDate) {
|
|
|
|
|
+ List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostDetailList(computeDate,null);
|
|
|
if(CollectionUtils.isEmpty(projectCostAccountList)){
|
|
if(CollectionUtils.isEmpty(projectCostAccountList)){
|
|
|
throw new CostException("请先计算患者成本");
|
|
throw new CostException("请先计算患者成本");
|
|
|
}
|
|
}
|
|
|
|
|
+ return getDiseaseCostDetail( computeDate,projectCostAccountList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate, String diseaseFilter) {
|
|
|
|
|
+
|
|
|
|
|
+ List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostCompositionDetail(computeDate, diseaseFilter);
|
|
|
|
|
+ if (CollectionUtils.isEmpty(projectCostAccountList)) {
|
|
|
|
|
+ throw new CostException("找不到满足条件的数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ return getDiseaseCostCompositionDetail(computeDate,projectCostAccountList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate, List<DiseaseCostDetailVO> projectCostAccountList) {
|
|
|
// 记录项目类别对象
|
|
// 记录项目类别对象
|
|
|
Map<String, DiseaseCostDetailVO> diseaseCostMap = new HashMap<>();
|
|
Map<String, DiseaseCostDetailVO> diseaseCostMap = new HashMap<>();
|
|
|
for (DiseaseCostDetailVO projectCostAccount : projectCostAccountList) {
|
|
for (DiseaseCostDetailVO projectCostAccount : projectCostAccountList) {
|
|
@@ -1070,20 +1079,35 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
List<DiseaseCostDetailVO> diseaseCostDetailList =new ArrayList<>(diseaseCostMap.values());
|
|
List<DiseaseCostDetailVO> diseaseCostDetailList =new ArrayList<>(diseaseCostMap.values());
|
|
|
//按会计科目类型计算占比
|
|
//按会计科目类型计算占比
|
|
|
diseaseCostDetailList.forEach(vo -> setAccountTypeExpenseRatio(vo));
|
|
diseaseCostDetailList.forEach(vo -> setAccountTypeExpenseRatio(vo));
|
|
|
|
|
+ diseaseCostDetailList.sort(Comparator.comparing(DiseaseCostDetailVO::getItemCode));
|
|
|
return diseaseCostDetailList;
|
|
return diseaseCostDetailList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
- * 获取服务单元病种成本构成明细表数据
|
|
|
|
|
- * @param computeDate
|
|
|
|
|
- * @return
|
|
|
|
|
|
|
+ * 获取病种成本构成明细表数据
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return 病种成本明细列表,包含各病种的成本明细及总计行
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public StandardDeptCostCollectResponse getDeptDiseaseCostCompositionDetail(String computeDate) {
|
|
|
|
|
- List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDeptDiseaseCostCompositionDetail(computeDate);
|
|
|
|
|
|
|
+ public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate) {
|
|
|
|
|
+
|
|
|
|
|
+ List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostCompositionDetail(computeDate,null);
|
|
|
if(CollectionUtils.isEmpty(projectCostAccountList)){
|
|
if(CollectionUtils.isEmpty(projectCostAccountList)){
|
|
|
throw new CostException("请先计算患者成本");
|
|
throw new CostException("请先计算患者成本");
|
|
|
}
|
|
}
|
|
|
|
|
+ return getDiseaseCostCompositionDetail(computeDate,projectCostAccountList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public StandardDeptCostCollectResponse getDeptDiseaseCostCompositionDetail(String computeDate, String diseaseFilter) {
|
|
|
|
|
+ List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDeptDiseaseCostCompositionDetail(computeDate,diseaseFilter);
|
|
|
|
|
+ if(CollectionUtils.isEmpty(projectCostAccountList)){
|
|
|
|
|
+ throw new CostException("找不到满足条件的数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ return getDeptDiseaseCostCompositionDetail( computeDate,projectCostAccountList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public StandardDeptCostCollectResponse getDeptDiseaseCostCompositionDetail(String computeDate,List<DiseaseCostDetailVO> projectCostAccountList) {
|
|
|
//科室责任中心对照数据
|
|
//科室责任中心对照数据
|
|
|
List<ResponsibilityDepartIdVO> responsibilityDepartment = responsibilityDepartmentRepository.getResponsibility(UserContext.getHospId());
|
|
List<ResponsibilityDepartIdVO> responsibilityDepartment = responsibilityDepartmentRepository.getResponsibility(UserContext.getHospId());
|
|
|
Map<String, List<ResponsibilityDepartIdVO>> deptRespMap = responsibilityDepartment.stream()
|
|
Map<String, List<ResponsibilityDepartIdVO>> deptRespMap = responsibilityDepartment.stream()
|
|
@@ -1183,6 +1207,20 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
return response;
|
|
return response;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取服务单元病种成本构成明细表数据
|
|
|
|
|
+ * @param computeDate
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public StandardDeptCostCollectResponse getDeptDiseaseCostCompositionDetail(String computeDate) {
|
|
|
|
|
+ List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDeptDiseaseCostCompositionDetail(computeDate,null);
|
|
|
|
|
+ if(CollectionUtils.isEmpty(projectCostAccountList)){
|
|
|
|
|
+ throw new CostException("请先计算患者成本");
|
|
|
|
|
+ }
|
|
|
|
|
+ return getDeptDiseaseCostCompositionDetail( computeDate,projectCostAccountList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取医院DRG成本明细表数据
|
|
* 获取医院DRG成本明细表数据
|
|
|
*
|
|
*
|
|
@@ -1623,7 +1661,7 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
item.setProfit(item.getIncome().subtract(item.getTotal()));
|
|
item.setProfit(item.getIncome().subtract(item.getTotal()));
|
|
|
}else{
|
|
}else{
|
|
|
item.setIncome(BigDecimal.ZERO);
|
|
item.setIncome(BigDecimal.ZERO);
|
|
|
- item.setProfit(BigDecimal.ZERO);
|
|
|
|
|
|
|
+ item.setProfit(item.getIncome().subtract(item.getTotal()));
|
|
|
}
|
|
}
|
|
|
//计算科室的床日成本及诊次成本
|
|
//计算科室的床日成本及诊次成本
|
|
|
if(responsibilityParamValueMap.containsKey(item.getResponsibilityCode())){
|
|
if(responsibilityParamValueMap.containsKey(item.getResponsibilityCode())){
|
|
@@ -2033,20 +2071,20 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
if (accountType == null) {
|
|
if (accountType == null) {
|
|
|
return; // 添加 null 检查
|
|
return; // 添加 null 检查
|
|
|
}
|
|
}
|
|
|
|
|
+ DictDataVo costType = standCostDictMaps.getCostTypeMap().get(String.valueOf(account.getCostType()));
|
|
|
//只处理医疗成本
|
|
//只处理医疗成本
|
|
|
- if(!NumberConstant.ONE_S.equals(accountType.getExpandOne()) ){
|
|
|
|
|
|
|
+ if(!NumberConstant.ONE_S.equals(costType.getExpandOne()) ){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- DictDataVo costType = standCostDictMaps.getCostTypeMap().get(String.valueOf(account.getCostType()));
|
|
|
|
|
DictDataVo standardShareLevel = standCostDictMaps.getStandardShareLevelMap().get(responsibility.getStandardShareLevel());
|
|
DictDataVo standardShareLevel = standCostDictMaps.getStandardShareLevelMap().get(responsibility.getStandardShareLevel());
|
|
|
DeptDirectMedicalCostVO deptDirectMedicalCostVO= new DeptDirectMedicalCostVO();
|
|
DeptDirectMedicalCostVO deptDirectMedicalCostVO= new DeptDirectMedicalCostVO();
|
|
|
- if(deptDirectMedicalCostMap.containsKey(allocationQuery.getResponsibilityCode())){
|
|
|
|
|
- deptDirectMedicalCostVO=deptDirectMedicalCostMap.get(allocationQuery.getResponsibilityCode());
|
|
|
|
|
|
|
+ if(deptDirectMedicalCostMap.containsKey(responsibility.getResponsibilityCode())){
|
|
|
|
|
+ deptDirectMedicalCostVO=deptDirectMedicalCostMap.get(responsibility.getResponsibilityCode());
|
|
|
}else{
|
|
}else{
|
|
|
initDeptCostReport(deptDirectMedicalCostVO, responsibility,accountType, costType,standardShareLevel);
|
|
initDeptCostReport(deptDirectMedicalCostVO, responsibility,accountType, costType,standardShareLevel);
|
|
|
// 初始化所有费用字段为0
|
|
// 初始化所有费用字段为0
|
|
|
BeanUtil.initBigDecimalFieldsToZero(deptDirectMedicalCostVO);
|
|
BeanUtil.initBigDecimalFieldsToZero(deptDirectMedicalCostVO);
|
|
|
- deptDirectMedicalCostMap.put(allocationQuery.getResponsibilityCode(),deptDirectMedicalCostVO);
|
|
|
|
|
|
|
+ deptDirectMedicalCostMap.put(responsibility.getResponsibilityCode(),deptDirectMedicalCostVO);
|
|
|
}
|
|
}
|
|
|
// 根据费用类型累加到对应字段
|
|
// 根据费用类型累加到对应字段
|
|
|
switch (accountType.getExpandOne()) {
|
|
switch (accountType.getExpandOne()) {
|
|
@@ -2358,9 +2396,14 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Object getDiseaseCostDetailByPage(Integer current, Integer pageSize, String computeDate) {
|
|
|
|
|
|
|
+ public Object getDiseaseCostDetailByPage(Integer current, Integer pageSize, String computeDate, String diseaseFilter) {
|
|
|
// 获取完整数据列表
|
|
// 获取完整数据列表
|
|
|
- List<DiseaseCostDetailVO> fullList = getDiseaseCostDetail(computeDate);
|
|
|
|
|
|
|
+ List<DiseaseCostDetailVO> fullList;
|
|
|
|
|
+ if (StringUtils.isEmpty(diseaseFilter)) {
|
|
|
|
|
+ fullList = getDiseaseCostDetail(computeDate);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ fullList = getDiseaseCostDetail(computeDate, diseaseFilter);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 手动分页
|
|
// 手动分页
|
|
|
int total = fullList.size();
|
|
int total = fullList.size();
|
|
@@ -2377,10 +2420,14 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Object getDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate) {
|
|
|
|
|
|
|
+ public Object getDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate, String diseaseFilter) {
|
|
|
// 获取完整数据列表
|
|
// 获取完整数据列表
|
|
|
- List<DiseaseCostDetailVO> fullList = getDiseaseCostCompositionDetail(computeDate);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ List<DiseaseCostDetailVO> fullList ;
|
|
|
|
|
+ if (StringUtils.isEmpty(diseaseFilter)) {
|
|
|
|
|
+ fullList = getDiseaseCostCompositionDetail(computeDate);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ fullList = getDiseaseCostCompositionDetail(computeDate,diseaseFilter);
|
|
|
|
|
+ }
|
|
|
// 手动分页
|
|
// 手动分页
|
|
|
int total = fullList.size();
|
|
int total = fullList.size();
|
|
|
int startIndex = (current - 1) * pageSize;
|
|
int startIndex = (current - 1) * pageSize;
|
|
@@ -2396,10 +2443,14 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Object getDeptDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate) {
|
|
|
|
|
|
|
+ public Object getDeptDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate, String diseaseFilter) {
|
|
|
// 获取完整数据
|
|
// 获取完整数据
|
|
|
- StandardDeptCostCollectResponse fullData = getDeptDiseaseCostCompositionDetail(computeDate);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ StandardDeptCostCollectResponse fullData ;
|
|
|
|
|
+ if (StringUtils.isEmpty(diseaseFilter)) {
|
|
|
|
|
+ fullData = getDeptDiseaseCostCompositionDetail(computeDate);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ fullData = getDeptDiseaseCostCompositionDetail(computeDate,diseaseFilter);
|
|
|
|
|
+ }
|
|
|
// 对数据进行分页
|
|
// 对数据进行分页
|
|
|
List<StandardReportFormCustomVo> fullList = fullData.getData();
|
|
List<StandardReportFormCustomVo> fullList = fullData.getData();
|
|
|
int total = fullList.size();
|
|
int total = fullList.size();
|
|
@@ -2416,8 +2467,11 @@ public class StandardReportServiceImpl implements StandardReportService {
|
|
|
StandardDeptCostCollectResponse pageData = new StandardDeptCostCollectResponse();
|
|
StandardDeptCostCollectResponse pageData = new StandardDeptCostCollectResponse();
|
|
|
pageData.setTitle(fullData.getTitle());
|
|
pageData.setTitle(fullData.getTitle());
|
|
|
pageData.setData(pageList);
|
|
pageData.setData(pageList);
|
|
|
-
|
|
|
|
|
- return new PageUtils(pageList, total, pageSize, current);
|
|
|
|
|
|
|
+ pageData.setCurrent(current);
|
|
|
|
|
+ pageData.setPageSize(pageSize);
|
|
|
|
|
+ pageData.setTotalCount( total);
|
|
|
|
|
+ pageData.setTotalPage((int)Math.ceil((double)total/pageSize));
|
|
|
|
|
+ return pageData;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|