Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -3,10 +3,13 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
|
||||
/**
|
||||
* 门诊退费 service
|
||||
*
|
||||
@@ -30,4 +33,17 @@ public interface IOutpatientRefundAppService {
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> refundPayment(List<Long> paymentIdList);
|
||||
|
||||
/**
|
||||
* 查询结算过的就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
R<?> getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
}
|
||||
|
||||
@@ -3,20 +3,37 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.PaymentStatus;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageDto;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPaymentDto;
|
||||
import com.openhis.web.chargemanage.dto.RefundItemDto;
|
||||
import com.openhis.web.chargemanage.mapper.OutpatientRefundAppMapper;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
|
||||
/**
|
||||
* 门诊退费 impl
|
||||
@@ -33,6 +50,12 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
private IPaymentReconciliationService paymentReconciliationService;
|
||||
@Autowired
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
@Autowired
|
||||
private IDeviceDispenseService deviceDispenseService;
|
||||
@Autowired
|
||||
private IServiceRequestService serviceRequestService;
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者的账单
|
||||
@@ -56,20 +79,97 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> refundPayment(List<Long> paymentIdList) {
|
||||
|
||||
// 医生同意退费
|
||||
// 查询所有的chargeid,对应生成一个负的chargeitem
|
||||
// 根据每个 chargeitem判断对应的服务,药品,耗材是否已发放执行
|
||||
// 若已发放/执行需要对应的发药人/执行人审批(药品耗材需要先退药)
|
||||
|
||||
// todo:医生同意退费(审批流)
|
||||
// 根据支付id获取对应收费项目的id列表
|
||||
List<Long> chargeItemIdList = paymentReconciliationService.getChargeItemIdListByPayment(paymentIdList);
|
||||
|
||||
//根据收费项目id列表查询退费项
|
||||
// 根据收费项目id列表查询退费项
|
||||
List<RefundItemDto> refundItemList = outpatientRefundAppMapper.selectRefundItem(chargeItemIdList,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
|
||||
|
||||
return null;
|
||||
List<Long> medDisIdList = new ArrayList<>();
|
||||
List<Long> devDisIdList = new ArrayList<>();
|
||||
List<Long> serReqIdList = new ArrayList<>();
|
||||
|
||||
for (RefundItemDto refundItem : refundItemList) {
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(refundItem.getServiceTable())) {
|
||||
|
||||
// 药品需要先退药
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(refundItem.getRefundStatus())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(refundItem.getRefundStatus())) {
|
||||
return R
|
||||
.fail(MessageUtils.createMessage(PromptMsgConstant.ChargeRefund.M00001, new Object[] {"药品"}));
|
||||
} else {
|
||||
// todo:审批流药师同意退费
|
||||
medDisIdList.add(refundItem.getDispenseId());
|
||||
}
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(refundItem.getServiceTable())) {
|
||||
// 诊疗项目需医技科室同意退费
|
||||
if (RequestStatus.COMPLETED.getValue().equals(refundItem.getRefundStatus())) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.ChargeRefund.M00002, null));
|
||||
} else {
|
||||
// todo:审批流医技师同意退费
|
||||
serReqIdList.add(refundItem.getServiceId());
|
||||
}
|
||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(refundItem.getServiceTable())) {
|
||||
// 耗材需要先退药
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(refundItem.getRefundStatus())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(refundItem.getRefundStatus())) {
|
||||
return R
|
||||
.fail(MessageUtils.createMessage(PromptMsgConstant.ChargeRefund.M00001, new Object[] {"耗材"}));
|
||||
} else {
|
||||
devDisIdList.add(refundItem.getDispenseId());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 更新收费状态:已退费
|
||||
chargeItemService.updateRefundChargeStatus(chargeItemIdList);
|
||||
// 更新未发放药品状态:停止发放,停止原因:退费
|
||||
medicationDispenseService.updateStopDispenseStatus(medDisIdList, NotPerformedReason.REFUND.getValue());
|
||||
// 更新未发放耗材状态:停止发放,停止原因:退费
|
||||
deviceDispenseService.updateStopDispenseStatus(devDisIdList, NotPerformedReason.REFUND.getValue());
|
||||
// 更新执行诊疗状态:停止
|
||||
serviceRequestService.updateStopRequestStatus(serReqIdList);
|
||||
// 返回退费成功信息
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"处方退费"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询结算过的就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<EncounterPatientPageParam> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage =
|
||||
outpatientRefundAppMapper.selectBilledEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
ChargeItemStatus.BILLED.getValue(), AccountType.MEDICAL_INSURANCE.getValue());
|
||||
|
||||
encounterPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
// 计算年龄
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
// 合同类型枚举
|
||||
e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(ContractCategory.class, e.getCategoryEnum()));
|
||||
});
|
||||
return R.ok(encounterPatientPage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,20 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门诊退费 controller
|
||||
*
|
||||
@@ -29,6 +32,25 @@ public class OutpatientRefundController {
|
||||
@Autowired
|
||||
private IOutpatientRefundAppService outpatientRefundAppService;
|
||||
|
||||
/**
|
||||
* 查询结算过的就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
@GetMapping(value = "/encounter-patient-page")
|
||||
public R<?> getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return R.ok(outpatientRefundAppService.getBilledEncounterPatientPage(encounterPatientPageParam, searchKey,
|
||||
pageNo, pageSize, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者的账单
|
||||
*
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -72,7 +73,9 @@ public class EncounterPatientPageDto {
|
||||
/**
|
||||
* 账户类型编码
|
||||
*/
|
||||
@Dict(dictCode = "account_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/**
|
||||
* 账户余额
|
||||
@@ -92,4 +95,28 @@ public class EncounterPatientPageDto {
|
||||
/** 收费状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/**
|
||||
* 医保总额
|
||||
*/
|
||||
private BigDecimal insurancePrice;
|
||||
|
||||
/**
|
||||
* 自费总额
|
||||
*/
|
||||
private BigDecimal selfPrice;
|
||||
|
||||
/**
|
||||
* 付款总额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 合同类型 */
|
||||
private Integer categoryEnum;
|
||||
private String categoryEnum_enumText;
|
||||
|
||||
/**
|
||||
* 结算时间
|
||||
*/
|
||||
private Date billDate;
|
||||
}
|
||||
|
||||
@@ -53,13 +53,13 @@ public class EncounterPatientPageParam {
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 收费时间
|
||||
*/
|
||||
private Date billTime;
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
/**
|
||||
* 退款标识
|
||||
*/
|
||||
private Integer refundFlag;
|
||||
}
|
||||
|
||||
@@ -14,4 +14,35 @@ import lombok.experimental.Accessors;
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RefundItemDto {}
|
||||
public class RefundItemDto {
|
||||
|
||||
/** 收费ID */
|
||||
private Long chargeId;
|
||||
|
||||
/** 医疗服务所在表 */
|
||||
private String serviceTable;
|
||||
|
||||
/** 医疗服务ID */
|
||||
private Long serviceId;
|
||||
|
||||
/** 请求编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
private String unitCode;
|
||||
|
||||
/** 退款状态 */
|
||||
private Integer refundStatus;
|
||||
|
||||
/** 项目id */
|
||||
private Long itemId;
|
||||
|
||||
/** 发放id */
|
||||
private Long dispenseId;
|
||||
|
||||
/** 项目名 */
|
||||
private Long itemName;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,11 @@ import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageDto;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPaymentDto;
|
||||
import com.openhis.web.chargemanage.dto.RefundItemDto;
|
||||
|
||||
@@ -47,4 +52,17 @@ public interface OutpatientRefundAppMapper {
|
||||
@Param("medMedicationRequest") String medMedicationRequest,
|
||||
@Param("worServiceRequest") String worServiceRequest, @Param("worDeviceRequest") String worDeviceRequest,
|
||||
@Param("three") Integer three);
|
||||
|
||||
/**
|
||||
* 查询已结算就诊患者分页列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @param billed 收费状态:已结算
|
||||
* @param insurance 账户类型:医保
|
||||
* @return 已结算就诊患者分页列表
|
||||
*/
|
||||
Page<EncounterPatientPageDto> selectBilledEncounterPatientPage(@Param("page") Page<EncounterPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper, @Param("billed") Integer billed,
|
||||
@Param("insurance") Integer insurance);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import java.util.stream.Stream;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -20,21 +22,20 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.*;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.system.service.ISysDictTypeService;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.datadictionary.appservice.IDiagnosisTreatmentManageAppService;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentInitDto;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentUpDto;
|
||||
import com.openhis.web.datadictionary.appservice.IItemDefinitionService;
|
||||
import com.openhis.web.datadictionary.dto.*;
|
||||
import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.mapper.ActivityDefinitionMapper;
|
||||
@@ -59,6 +60,13 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme
|
||||
private ISysDictTypeService iSysDictTypeService;
|
||||
@Resource
|
||||
private ActivityDefinitionManageMapper activityDefinitionManageMapper;
|
||||
@Autowired
|
||||
private IItemDefinitionService itemDefinitionServic;
|
||||
@Autowired
|
||||
private ISysDictTypeService sysDictTypeService;
|
||||
|
||||
@Autowired(required = false)
|
||||
AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 诊疗目录初期查询
|
||||
@@ -82,7 +90,15 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setExeOrganizations(exeOrganizations);
|
||||
|
||||
// 获取诊疗分类
|
||||
// 获取诊目录疗分类
|
||||
List<SysDictData> diagnosisList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DIAGNOSIS_CATEGORY_CODE);
|
||||
// 获取诊疗录疗分类
|
||||
List<DiagnosisTreatmentInitDto.dictCategoryCode> diagnosisCategories = diagnosisList.stream().map(
|
||||
category -> new DiagnosisTreatmentInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setDiagnosisCategoryOptions(diagnosisCategories);
|
||||
|
||||
// 查询医疗服务项类型
|
||||
List<SysDictData> medical_service_items =
|
||||
iSysDictTypeService.selectDictDataByType(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getCode());
|
||||
@@ -92,30 +108,31 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme
|
||||
status.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
List<DiagnosisTreatmentInitDto.diseaseTreatmentCategory> diseaseTreatmentCategories = new ArrayList<>();
|
||||
|
||||
DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory =
|
||||
new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getValue(),
|
||||
ActivityDefCategory.MEDICAL_SERVICE_ITEM.getInfo());
|
||||
diseaseTreatmentCategory.setChildren(diseaseTreatmentCategoryList);
|
||||
diseaseTreatmentCategories.add(diseaseTreatmentCategory);
|
||||
diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories);
|
||||
|
||||
// 查询手术与治疗类型
|
||||
List<SysDictData> medical_service_items2 =
|
||||
iSysDictTypeService.selectDictDataByType(ActivityDefCategory.TREATMENT_SURGERY.getCode());
|
||||
// 获取手术与治疗List
|
||||
List<DiagnosisTreatmentInitDto.diseaseTreatmentType> diseaseTreatmentCategoryList2 = medical_service_items2
|
||||
.stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(),
|
||||
status.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory2 =
|
||||
new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.TREATMENT_SURGERY.getValue(),
|
||||
ActivityDefCategory.TREATMENT_SURGERY.getInfo());
|
||||
diseaseTreatmentCategory2.setChildren(diseaseTreatmentCategoryList2);
|
||||
diseaseTreatmentCategories.add(diseaseTreatmentCategory2);
|
||||
|
||||
diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories);
|
||||
//
|
||||
// //获取目录分类
|
||||
// DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory =
|
||||
// new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getValue(),
|
||||
// ActivityDefCategory.MEDICAL_SERVICE_ITEM.getInfo());
|
||||
// diseaseTreatmentCategory.setChildren(diseaseTreatmentCategoryList);
|
||||
// diseaseTreatmentCategories.add(diseaseTreatmentCategory);
|
||||
// diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories);
|
||||
//
|
||||
// // 查询手术与治疗类型
|
||||
// List<SysDictData> medical_service_items2 =
|
||||
// iSysDictTypeService.selectDictDataByType(ActivityDefCategory.TREATMENT_SURGERY.getCode());
|
||||
// // 获取手术与治疗List
|
||||
// List<DiagnosisTreatmentInitDto.diseaseTreatmentType> diseaseTreatmentCategoryList2 = medical_service_items2
|
||||
// .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(),
|
||||
// status.getDictLabel()))
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
// DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory2 =
|
||||
// new DiagnosisTreatmentInitDto.diseaseTreatmentCategory(ActivityDefCategory.TREATMENT_SURGERY.getValue(),
|
||||
// ActivityDefCategory.TREATMENT_SURGERY.getInfo());
|
||||
// diseaseTreatmentCategory2.setChildren(diseaseTreatmentCategoryList2);
|
||||
// diseaseTreatmentCategories.add(diseaseTreatmentCategory2);
|
||||
//
|
||||
// diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories);
|
||||
|
||||
// 获取类型
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> typeEnumOptions = Stream.of(ActivityType.values())
|
||||
@@ -138,15 +155,6 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme
|
||||
@Override
|
||||
public R<?> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
//
|
||||
// // 构建查询条件
|
||||
// QueryWrapper<ActivityDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam,
|
||||
// searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
// // 设置排序
|
||||
// queryWrapper.orderByAsc("bus_no");
|
||||
// // 分页查询
|
||||
// Page<DiagnosisTreatmentDto> diseaseTreatmentPage = HisPageUtils.selectPage(activityDefinitionMapper,
|
||||
// queryWrapper, pageNo, pageSize, DiagnosisTreatmentDto.class);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DiagnosisTreatmentDto> queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam,
|
||||
@@ -163,8 +171,6 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme
|
||||
e.setYbMatchFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getYbMatchFlag()));
|
||||
// 类型举类回显赋值
|
||||
e.setTypeEnum_enumText(EnumUtils.getInfoByValue(ActivityType.class, e.getTypeEnum()));
|
||||
// 目录类别举类回显赋值
|
||||
e.setCategory_enumText(EnumUtils.getInfoByValue(ActivityDefCategory.class, e.getCategoryEnum()));
|
||||
// 状态举类回显赋值
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
@@ -198,14 +204,32 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme
|
||||
@Override
|
||||
public R<?> editDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto) {
|
||||
|
||||
ActivityDefinition ActivityDefinition = new ActivityDefinition();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, ActivityDefinition);
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition);
|
||||
|
||||
// 使用10位数基础采番
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_NUM.getPrefix(), 10);
|
||||
activityDefinition.setBusNo(code);
|
||||
// 拼音码
|
||||
activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName()));
|
||||
// 五笔码
|
||||
activityDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(activityDefinition.getName()));
|
||||
|
||||
// 更新诊疗信息
|
||||
return iActivityDefinitionService.updateById(ActivityDefinition)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
if (iActivityDefinitionService.updateById(activityDefinition)) {
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(diagnosisTreatmentUpDto.getYbType())
|
||||
.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setInstanceId(diagnosisTreatmentUpDto.getId());
|
||||
|
||||
// 更新价格表
|
||||
return itemDefinitionServic.updateItem(chargeItemDefinition)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,13 +291,31 @@ public class DiagnosisTreatmentManageAppServiceImpl implements IDiagnosisTreatme
|
||||
@Override
|
||||
public R<?> addDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto) {
|
||||
|
||||
ActivityDefinition ActivityDefinition = new ActivityDefinition();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, ActivityDefinition);
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition);
|
||||
// 拼音码
|
||||
activityDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(activityDefinition.getName()));
|
||||
// 五笔码
|
||||
activityDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(activityDefinition.getName()));
|
||||
|
||||
// 新增外来诊疗目录
|
||||
ActivityDefinition.setStatusEnum(PublicationStatus.DRAFT.getValue());
|
||||
return iActivityDefinitionService.addDiagnosisTreatment(ActivityDefinition)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
activityDefinition.setStatusEnum(PublicationStatus.DRAFT.getValue());
|
||||
if (iActivityDefinitionService.addDiagnosisTreatment(activityDefinition)) {
|
||||
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(diagnosisTreatmentUpDto.getName())
|
||||
.setInstanceId(activityDefinition.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice());
|
||||
|
||||
return itemDefinitionServic.addItem(itemUpFromDirectoryDto)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,9 @@ public class DiagnosisTreatmentDto {
|
||||
private Long id;
|
||||
|
||||
/** 目录类别 */
|
||||
private Integer categoryEnum;
|
||||
private String category_enumText;
|
||||
@Dict(dictCode = "activity_category_code")
|
||||
private String categoryCode;
|
||||
private String categoryCode_dictText;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
@@ -93,9 +94,6 @@ public class DiagnosisTreatmentDto {
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
/** 售价 */
|
||||
private BigDecimal price;
|
||||
|
||||
/** 财务类别 */
|
||||
@Dict(dictCode = "fin_type_code")
|
||||
private String typeCode;
|
||||
@@ -114,6 +112,6 @@ public class DiagnosisTreatmentDto {
|
||||
|
||||
/** 最高零售价 */
|
||||
private BigDecimal maximumRetailPrice;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.openhis.web.datadictionary.dto;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -19,6 +21,8 @@ public class DiagnosisTreatmentInitDto {
|
||||
private List<diseaseTreatmentCategory> diseaseTreatmentCategoryList;
|
||||
private List<exeOrganization> exeOrganizations;
|
||||
private List<statusEnumOption> typeEnumOptions;
|
||||
//诊疗目录
|
||||
private List<dictCategoryCode> diagnosisCategoryOptions;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
@@ -64,6 +68,21 @@ public class DiagnosisTreatmentInitDto {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 诊疗目录类型
|
||||
*/
|
||||
@Data
|
||||
public static class dictCategoryCode {
|
||||
private String value;
|
||||
private String info;
|
||||
private List<dictCategoryCode> children = new ArrayList<>();
|
||||
|
||||
public dictCategoryCode(String value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行机构
|
||||
*/
|
||||
@@ -77,4 +96,5 @@ public class DiagnosisTreatmentInitDto {
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
|
||||
public class DiagnosisTreatmentSelParam {
|
||||
|
||||
/** 目录类别 */
|
||||
private Integer categoryEnum;
|
||||
private Integer categoryCode;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
@@ -22,13 +22,14 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DiagnosisTreatmentUpDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 目录类别 */
|
||||
@NotNull(message = "目录类别不能为空")
|
||||
private ActivityDefCategory categoryEnum;
|
||||
private String categoryCode;
|
||||
|
||||
/** 编码 */
|
||||
@NotBlank(message = "项目编码不能为空")
|
||||
|
||||
@@ -53,7 +53,6 @@ public class MedicationManageUpDto {
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 批次号 */
|
||||
@NotBlank(message = "批次号不能为空")
|
||||
private String lotNumber;
|
||||
|
||||
/** 生效日期 */
|
||||
|
||||
@@ -246,6 +246,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
List<ItemChargeDetailDto> chargeDetailList) {
|
||||
List<ChargeItemDefDetail> resultList = new ArrayList<>();
|
||||
|
||||
// todo:同一批次不能改价
|
||||
// 将各个项目的定价信息按项目id分组
|
||||
Map<Long, List<ItemChargeDetailDto>> chargeDetailGroup =
|
||||
chargeDetailList.stream().collect(Collectors.groupingBy(ItemChargeDetailDto::getInstanceId));
|
||||
@@ -307,7 +308,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
*/
|
||||
private ChargeItemDefDetail addChargeItemDefApp(String conditionValue, BigDecimal sellPrice, Long definitionId) {
|
||||
ChargeItemDefDetail chargeItemDefDetail = new ChargeItemDefDetail();
|
||||
// todo:命中条件或建成字典枚举,此处为批次号,单位
|
||||
// todo:命中条件或建成字典枚举,此处为批次号,单位,优先级加一
|
||||
chargeItemDefDetail
|
||||
// 命中值
|
||||
.setConditionValue(conditionValue)
|
||||
|
||||
@@ -31,9 +31,6 @@ no.update.permission=您没有修改数据的权限,请联系管理员添加
|
||||
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
|
||||
|
||||
|
||||
|
||||
apl.common.M00001={0}添加成功
|
||||
apl.common.M00002={0}保存成功
|
||||
apl.common.M00003={0}已经存在
|
||||
@@ -43,4 +40,5 @@ apl.common.M00006=操作失败,该数据已被他人删除,请刷新后重试
|
||||
apl.common.M00007=操作失败,该数据已被他人更改,请刷新后重试
|
||||
apl.common.M00008=请勿重复提交
|
||||
apl.common.M00009=查询成功
|
||||
apl.common.M00010=操作失败,请联系管理员
|
||||
apl.common.M00010=操作失败,请联系管理员
|
||||
apl.chargeRefund.M00001=该收费单相关{0}已经发出,请先退药后再进行退费
|
||||
@@ -4,22 +4,23 @@
|
||||
|
||||
<select id="selectEncounterPatientPage"
|
||||
resultType="com.openhis.web.chargemanage.dto.EncounterPatientPageDto">
|
||||
SELECT T3.encounter_id,
|
||||
T3.encounter_bus_no,
|
||||
T3.start_time,
|
||||
T3.patient_name,
|
||||
T3.patient_bus_no,
|
||||
T3.gender_enum,
|
||||
T3.birth_date,
|
||||
T3.id_card,
|
||||
T3.patient_py_str,
|
||||
T3.patient_wb_str,
|
||||
T3.status_enum
|
||||
SELECT T4.encounter_id,
|
||||
T4.encounter_bus_no,
|
||||
T4.start_time,
|
||||
T4.patient_name,
|
||||
T4.patient_bus_no,
|
||||
T4.gender_enum,
|
||||
T4.birth_date,
|
||||
T4.id_card,
|
||||
T4.patient_py_str,
|
||||
T4.patient_wb_str,
|
||||
T4.status_enum
|
||||
FROM (
|
||||
SELECT T1.id AS encounter_id,
|
||||
SELECT T1.id AS encounter_id,
|
||||
T1.bus_no AS encounter_bus_no,
|
||||
T1.start_time,
|
||||
T1.delete_flag,
|
||||
T1.tenant_id,
|
||||
T2."name" AS patient_name,
|
||||
T2.bus_no AS patient_bus_no,
|
||||
T2.gender_enum,
|
||||
@@ -34,8 +35,8 @@
|
||||
LEFT JOIN adm_charge_item AS T3
|
||||
ON T3.encounter_id = T1.id
|
||||
WHERE T1.delete_flag = '0'
|
||||
ORDER BY T1.encounter_bus_no DESC
|
||||
) AS T3
|
||||
ORDER BY T1.bus_no DESC
|
||||
) AS T4
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -24,46 +24,144 @@
|
||||
AND T1.delete_flag = '0'
|
||||
</select>
|
||||
<select id="selectRefundItem" resultType="com.openhis.web.chargemanage.dto.RefundItemDto">
|
||||
SELECT (T1.discount_amount + T2.surcharge_amount) AS pay_amount,
|
||||
SELECT T1.id AS charge_id,
|
||||
T1.service_table,
|
||||
T1.service_id,
|
||||
T2.bus_no,
|
||||
T2.prescription_no,
|
||||
T2.quantity,
|
||||
T2.medication_id AS item_id,
|
||||
T2.unit_code,
|
||||
T3.status_enum
|
||||
T3.status_enum AS refund_status,
|
||||
T3.id AS dispense_id,
|
||||
T7.name AS item_name
|
||||
FROM adm_charge_item AS T1
|
||||
LEFT JOIN med_medication_request AS T2
|
||||
ON T2.bus_no = SUBSTRING(T1.bus_no, #{three})
|
||||
LEFT JOIN med_medication_dispense AS T3
|
||||
ON T3.med_req_id = T2.id
|
||||
ON T3.med_req_id = T2.id
|
||||
LEFT JOIN med_medication_definition AS T7
|
||||
ON T1.product_id = T7.id
|
||||
WHERE T1.service_table = #{medMedicationRequest}
|
||||
AND T1.id IN
|
||||
<foreach collection="chargeItemIdList" item="chargeItemId" separator="," open="(" close=")">
|
||||
#{chargeItemId}
|
||||
</foreach>
|
||||
UNION
|
||||
SELECT T1.*,
|
||||
T2.name AS service_name
|
||||
UNION
|
||||
SELECT T1.id AS charge_id,
|
||||
T1.service_table,
|
||||
T1.service_id,
|
||||
T4.bus_no,
|
||||
T4.prescription_no,
|
||||
T4.quantity,
|
||||
T4.device_def_id AS item_id,
|
||||
T4.unit_code,
|
||||
T5.status_enum AS refund_status,
|
||||
T5.id AS dispense_id,
|
||||
T8.name AS item_name
|
||||
FROM adm_charge_item AS T1
|
||||
LEFT JOIN wor_device_request AS T4
|
||||
ON T4.bus_no = SUBSTRING(T1.bus_no, #{three})
|
||||
LEFT JOIN wor_device_dispense AS T5
|
||||
ON T5.device_req_id = T4.id
|
||||
LEFT JOIN adm_device_definition AS T8
|
||||
ON T1.product_id = T8.id
|
||||
WHERE T1.service_table = #{worDeviceRequest}
|
||||
AND T1.id IN
|
||||
<foreach collection="chargeItemIdList" item="chargeItemId" separator="," open="(" close=")">
|
||||
#{chargeItemId}
|
||||
</foreach>
|
||||
UNION
|
||||
SELECT T1.*,
|
||||
T2.name AS service_name
|
||||
SELECT T1.id AS charge_id,,
|
||||
T1.service_table,
|
||||
T1.service_id,
|
||||
T6.bus_no,
|
||||
T6.prescription_no,
|
||||
T6.quantity,
|
||||
T6.activity_id AS item_id,
|
||||
T6.unit_code,
|
||||
T6.status_enum AS refund_status,
|
||||
null AS dispense_id,
|
||||
T9.name AS item_name
|
||||
FROM adm_charge_item AS T1
|
||||
LEFT JOIN wor_service_request AS T6
|
||||
ON T6.bus_no = SUBSTRING(T1.bus_no, #{three})
|
||||
LEFT JOIN wor_activity_definition AS T9
|
||||
ON T1.product_id = T9.id
|
||||
WHERE T1.service_table = #{worServiceRequest}
|
||||
AND T1.id IN
|
||||
<foreach collection="chargeItemIdList" item="chargeItemId" separator="," open="(" close=")">
|
||||
#{chargeItemId}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectBilledEncounterPatientPage"
|
||||
resultType="com.openhis.web.chargemanage.dto.EncounterPatientPageDto">
|
||||
SELECT T8.encounter_id,
|
||||
T8.encounter_bus_no,
|
||||
T8.start_time,
|
||||
T8.patient_name,
|
||||
T8.patient_bus_no,
|
||||
T8.gender_enum,
|
||||
T8.birth_date,
|
||||
T8.id_card,
|
||||
T8.patient_py_str,
|
||||
T8.patient_wb_str,
|
||||
T8.type_code,
|
||||
T8.category_enum,
|
||||
T8.total_amount,
|
||||
T8.bill_date
|
||||
FROM (
|
||||
SELECT T1.id AS encounter_id,
|
||||
T1.bus_no AS encounter_bus_no,
|
||||
T1.start_time,
|
||||
T1.delete_flag,
|
||||
T1.tenant_id,
|
||||
T2."name" AS patient_name,
|
||||
T2.bus_no AS patient_bus_no,
|
||||
T2.gender_enum,
|
||||
T2.birth_date,
|
||||
T2.id_card,
|
||||
T2.py_str AS patient_py_str,
|
||||
T2.wb_str AS patient_wb_str,
|
||||
T4.type_code,
|
||||
T5.category_enum,
|
||||
SUM(T6.tendered_amount) AS total_amount,
|
||||
T6.bill_date,
|
||||
CASE WHEN T7.account_enum = #{insurance} THEN SUM(T7.amount) ELSE 0 END AS insurance_amount,
|
||||
CASE WHEN T7.account_enum != #{insurance} THEN SUM(T7.amount) ELSE 0 END AS self_amount
|
||||
FROM adm_encounter AS T1
|
||||
LEFT JOIN adm_patient AS T2
|
||||
ON T1.patient_id = T2.id
|
||||
LEFT JOIN adm_charge_item AS T3
|
||||
ON T3.encounter_id = T1.id
|
||||
LEFT JOIN adm_account AS T4
|
||||
ON T4.id = T3.account_id
|
||||
LEFT JOIN fin_contract AS T5
|
||||
ON T5.bus_no = T4.contract_no
|
||||
LEFT JOIN fin_payment_reconciliation AS T6
|
||||
ON T6.encouter_id = T1.id
|
||||
LEFT JOIN fin_payment_rec_detail AS T7
|
||||
ON T7.reconciliation_id = T6.id
|
||||
WHERE T3.status_enum = #{billed}
|
||||
AND T1.delete_flag = '0'
|
||||
GROUP BY T1.id,
|
||||
T1.bus_no,
|
||||
T1.start_time,
|
||||
T1.delete_flag,
|
||||
T1.tenant_id,
|
||||
T2."name",
|
||||
T2.bus_no,
|
||||
T2.gender_enum,
|
||||
T2.birth_date,
|
||||
T2.id_card,
|
||||
T2.py_str,
|
||||
T2.wb_str,
|
||||
T4.type_code,
|
||||
T5.category_enum,
|
||||
T6.bill_date,
|
||||
T7.account_enum
|
||||
ORDER BY T6.bill_date DESC
|
||||
) AS T8
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
SELECT
|
||||
T3.id,
|
||||
T3.category_enum,
|
||||
T3.category_code,
|
||||
T3.bus_no,
|
||||
T3.name,
|
||||
T3.py_str,
|
||||
@@ -33,7 +33,7 @@
|
||||
(
|
||||
SELECT
|
||||
T1.id,
|
||||
T1.category_enum,
|
||||
T1.category_code,
|
||||
T1.bus_no,
|
||||
T1.name,
|
||||
T1.py_str,
|
||||
@@ -83,7 +83,7 @@
|
||||
<select id="getDiseaseTreatmentOne" resultType="com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto">
|
||||
SELECT
|
||||
T1.id,
|
||||
T1.category_enum,
|
||||
T1.category_code,
|
||||
T1.bus_no,
|
||||
T1.name,
|
||||
T1.py_str,
|
||||
|
||||
Reference in New Issue
Block a user