版本更新

This commit is contained in:
Zhang.WH
2025-09-03 15:54:41 +08:00
parent 0b93d16b64
commit 8f82322d10
3290 changed files with 154339 additions and 23829 deletions

View File

@@ -0,0 +1,66 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.appservice;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.core.common.core.domain.R;
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
/**
* 门诊收费 service
*
* @author zwh
* @date 2025-03-12
*/
public interface IInpatientChargeAppService {
/**
* 查询就诊患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
* @return 就诊患者分页列表
*/
R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
Integer pageSize, HttpServletRequest request);
/**
* 根据就诊id查询患者处方列表
*
* @param encounterId 就诊id
* @return 患者处方列表
*/
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId, String startTime,
String endTime);
/**
* 医保转自费
*
* @param encounterId 就诊id
* @return 操作结果
*/
R<?> changeToSelfPay(Long encounterId);
/**
* 自费转医保
*
* @param encounterId 就诊id
* @return 操作结果
*/
R<?> changeToMedicalInsurance(Long encounterId);
/**
* 门诊收费页面初始化
*
* @return 初始化信息
*/
R<?> outpatientChargeInit();
}

View File

@@ -0,0 +1,65 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.appservice;
import javax.servlet.http.HttpServletRequest;
import com.core.common.core.domain.R;
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
import java.util.List;
/**
* 门诊收费 service
*
* @author zwh
* @date 2025-03-12
*/
public interface IOutpatientChargeAppService {
/**
* 查询就诊患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
* @return 就诊患者分页列表
*/
R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
Integer pageSize, HttpServletRequest request);
/**
* 根据就诊id查询患者处方列表
*
* @param encounterId 就诊id
* @return 患者处方列表
*/
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId);
/**
* 医保转自费
*
* @param encounterId 就诊id
* @return 操作结果
*/
R<?> changeToSelfPay(Long encounterId);
/**
* 自费转医保
*
* @param encounterId 就诊id
* @return 操作结果
*/
R<?> changeToMedicalInsurance(Long encounterId);
/**
* 门诊收费页面初始化
*
* @return 初始化信息
*/
R<?> outpatientChargeInit();
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.appservice;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
import com.openhis.web.doctorstation.dto.PatientInfoDto;
/**
* 门诊划价 service
*
* @author yangmo
* @date 2025-04-14
*/
public interface IOutpatientPricingAppService {
/**
* 查询就诊患者信息
*
* @param patientInfoDto 查询条件 (前端可传 statusEnum 区分就诊状态tab)
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 就诊患者信息
*/
IPage<PatientInfoDto> getPatientInfo(PatientInfoDto patientInfoDto, String searchKey, Integer pageNo,
Integer pageSize, HttpServletRequest request);
/**
* 查询医嘱信息
*
* @param adviceBaseDto 查询条件
* @param searchKey 模糊查询关键字
* @param locationId 药房id
* @param organizationId 患者挂号对应的科室id
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 医嘱信息
*/
IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
Long organizationId, Integer pageNo, Integer pageSize);
}

View File

@@ -0,0 +1,83 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.appservice;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.core.common.core.domain.R;
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
import com.openhis.web.chargemanage.dto.RefundItemParam;
/**
* 门诊退费 service
*
* @author zwh
* @date 2025-03-15
*/
public interface IOutpatientRefundAppService {
/**
* 根据就诊id查询患者的账单
*
* @param encounterId 就诊id
* @return 患者账单列表
*/
R<?> getEncounterPatientPayment(Long encounterId);
/**
* 根据账单退费
*
* @param refundItemList 退费项目id列表
* @return 操作结果
*/
R<?> refundPayment(List<RefundItemParam> refundItemList);
/**
* 查询结算过的就诊患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
* @return 就诊患者分页列表
*/
R<?> getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
Integer pageNo, Integer pageSize, HttpServletRequest request);
/**
* 门诊退费页面初始化
*
* @return 初始化信息
*/
R<?> outpatientRefundInit();
/**
* 根据就诊id查询患者的退费账单
*
* @param encounterId 就诊id
* @param billDateSTime 收费时间开始
* @param billDateETime 收费时间结束
* @return 退费账单列表
*/
R<?> getEncounterPatientRefund(Long encounterId, String billDateSTime, String billDateETime);
/**
* 根据就诊id查询患者因退费重新生成的账单
*
* @param encounterId 就诊id
* @return 重新生成的账单列表
*/
R<?> getRegenerateCharge(Long encounterId);
/**
* 校验是否可以退费(耗材/药品是否已退,诊疗是否取消执行)
*
* @param chargeItemIdList 收费项目id列表
* @return 是否可退
*/
R<?> verifyRefundable(List<Long> chargeItemIdList);
}

View File

@@ -0,0 +1,86 @@
package com.openhis.web.chargemanage.appservice;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
import com.openhis.web.basicservice.dto.HealthcareServiceDto;
import com.openhis.web.chargemanage.dto.*;
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
import javax.servlet.http.HttpServletRequest;
/**
* 门诊挂号 应用Service
*/
public interface IOutpatientRegistrationAppService {
/**
* 查询患者信息
*
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 患者信息
*/
Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize);
/**
* 查询门诊科室数据
*
* @return 门诊科室
*/
List<OrgMetadata> getOrgMetadata();
/**
* 根据科室id筛选医生
*
* @param orgId 科室ID
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 筛选医生
*/
IPage<PractitionerMetadata> getPractitionerMetadataByLocationId(Long orgId, String searchKey, Integer pageNo,
Integer pageSize);
/**
* 根据机构id筛选服务项目
*
* @param organizationId 机构id
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 服务项目
*/
IPage<HealthcareServiceDto> getHealthcareMetadataByOrganizationId(Long organizationId, String searchKey,
Integer pageNo, Integer pageSize);
/**
* 退号
*
* @param cancelRegPaymentDto 就诊id
* @return 结果
*/
R<?> returnRegister(CancelRegPaymentDto cancelRegPaymentDto);
/**
* 查询当日就诊数据
*
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 当日就诊数据
*/
IPage<CurrentDayEncounterDto> getCurrentDayEncounter(String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request);
/**
* 取消挂号
*
* @param encounterId 就诊id
* @return 结果
*/
R<?> cancelRegister(Long encounterId);
}

View File

@@ -0,0 +1,186 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.appservice.impl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
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.IAccountService;
import com.openhis.administration.service.IChargeItemService;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.constant.PromptMsgConstant;
import com.openhis.common.enums.AdministrativeGender;
import com.openhis.common.enums.ChargeItemContext;
import com.openhis.common.enums.ChargeItemStatus;
import com.openhis.common.enums.EncounterClass;
import com.openhis.common.utils.EnumUtils;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.web.chargemanage.appservice.IInpatientChargeAppService;
import com.openhis.web.chargemanage.dto.EncounterPatientPageDto;
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
import com.openhis.web.chargemanage.dto.OutpatientInitDto;
import com.openhis.web.chargemanage.mapper.InpatientChargeAppMapper;
/**
* 门诊收费 impl
*
* @author zwh
* @date 2025-03-12
*/
@Service
public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService {
@Autowired
private InpatientChargeAppMapper inpatientChargeAppMapper;
@Autowired
private IChargeItemService chargeItemService;
@Autowired
private IAccountService accountService;
/**
* 门诊收费页面初始化
*
* @return 初始化信息
*/
@Override
public R<?> outpatientChargeInit() {
OutpatientInitDto initDto = new OutpatientInitDto();
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(),
ChargeItemStatus.PLANNED.getInfo()));
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(),
ChargeItemStatus.BILLABLE.getInfo()));
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
ChargeItemStatus.BILLED.getInfo()));
initDto.setChargeItemStatusOptions(chargeItemStatusOptions);
return R.ok(initDto);
}
/**
* 查询就诊患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
* @return 就诊患者分页列表
*/
@Override
public R<?> getEncounterPatientPage(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 = inpatientChargeAppMapper
.selectEncounterPatientPage(EncounterClass.IMP.getValue(), new Page<>(pageNo, pageSize), queryWrapper);
encounterPatientPage.getRecords().forEach(e -> {
// 性别枚举
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
// 收费状态枚举
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
// 计算年龄
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
});
return R.ok(encounterPatientPage);
}
/**
* 根据就诊id查询患者处方列表
*
* @param encounterId 就诊id
* @return 患者处方列表
*/
@Override
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId, String startTime,
String endTime) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
startTime = startTime + "000000";
endTime = endTime + "235959";
Date startDate = null;
Date endDate = null;
try {
startDate = sdf.parse(startTime);
endDate = sdf.parse(endTime);
} catch (ParseException e) {
e.printStackTrace();
}
List<EncounterPatientPrescriptionDto> prescriptionDtoList =
inpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(), startDate, endDate);
prescriptionDtoList.forEach(e -> {
// 收费状态枚举
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
});
return prescriptionDtoList;
}
/**
* 医保转自费
*
* @param encounterId 就诊id
* @return 操作结果
*/
@Override
public R<?> changeToSelfPay(Long encounterId) {
// 获取就诊患者的自费账户id
Long accountId = accountService.getSelfPayAccount(encounterId);
if (accountId == null) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"自费账户"}));
}
// 医保转自费
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
if (!result) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
}
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
}
/**
* 自费转医保
*
* @param encounterId 就诊id
* @return 操作结果
*/
@Override
public R<?> changeToMedicalInsurance(Long encounterId) {
// 获取就诊患者的医保账户id
Long accountId = accountService.getMedicalInsuranceAccount(encounterId);
if (accountId == null) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
}
// 自费转医保
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
if (!result) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
}
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
}
}

View File

@@ -0,0 +1,171 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
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.IAccountService;
import com.openhis.administration.service.IChargeItemService;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.constant.PromptMsgConstant;
import com.openhis.common.enums.AdministrativeGender;
import com.openhis.common.enums.ChargeItemContext;
import com.openhis.common.enums.ChargeItemStatus;
import com.openhis.common.enums.EncounterClass;
import com.openhis.common.utils.EnumUtils;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService;
import com.openhis.web.chargemanage.dto.EncounterPatientPageDto;
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
import com.openhis.web.chargemanage.dto.OutpatientInitDto;
import com.openhis.web.chargemanage.mapper.OutpatientChargeAppMapper;
/**
* 门诊收费 impl
*
* @author zwh
* @date 2025-03-12
*/
@Service
public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppService {
@Autowired
private OutpatientChargeAppMapper outpatientChargeAppMapper;
@Autowired
private IChargeItemService chargeItemService;
@Autowired
private IAccountService accountService;
/**
* 门诊收费页面初始化
*
* @return 初始化信息
*/
@Override
public R<?> outpatientChargeInit() {
OutpatientInitDto initDto = new OutpatientInitDto();
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(),
ChargeItemStatus.PLANNED.getInfo()));
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(),
ChargeItemStatus.BILLABLE.getInfo()));
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
ChargeItemStatus.BILLED.getInfo()));
initDto.setChargeItemStatusOptions(chargeItemStatusOptions);
return R.ok(initDto);
}
/**
* 查询就诊患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
* @return 就诊患者分页列表
*/
@Override
public R<?> getEncounterPatientPage(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 = outpatientChargeAppMapper
.selectEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.AMB.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(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
});
return R.ok(encounterPatientPage);
}
/**
* 根据就诊id查询患者处方列表
*
* @param encounterId 就诊id
* @return 患者处方列表
*/
@Override
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId) {
List<EncounterPatientPrescriptionDto> prescriptionDtoList =
outpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue());
prescriptionDtoList.forEach(e -> {
// 收费状态枚举
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
});
return prescriptionDtoList;
}
/**
* 医保转自费
*
* @param encounterId 就诊id
* @return 操作结果
*/
@Override
public R<?> changeToSelfPay(Long encounterId) {
// 获取就诊患者的自费账户id
Long accountId = accountService.getSelfPayAccount(encounterId);
if (accountId == null) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"自费账户"}));
}
// 医保转自费
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
if (!result) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
}
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
}
/**
* 自费转医保
*
* @param encounterId 就诊id
* @return 操作结果
*/
@Override
public R<?> changeToMedicalInsurance(Long encounterId) {
// 获取就诊患者的医保账户id
Long accountId = accountService.getMedicalInsuranceAccount(encounterId);
if (accountId == null) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
}
// 自费转医保
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
if (!result) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
}
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
}
}

View File

@@ -0,0 +1,74 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.appservice.impl;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.openhis.common.enums.Whether;
import com.openhis.web.chargemanage.appservice.IOutpatientPricingAppService;
import com.openhis.web.chargemanage.mapper.OutpatientPricingAppMapper;
import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService;
import com.openhis.web.doctorstation.appservice.IDoctorStationMainAppService;
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
import com.openhis.web.doctorstation.dto.PatientInfoDto;
import java.util.List;
/**
* 门诊划价 impl
*
* @author yangmo
* @date 2025-04-14
*/
@Service
public class OutpatientPricingAppServiceImpl implements IOutpatientPricingAppService {
@Resource
OutpatientPricingAppMapper outpatientPricingAppMapper;
@Resource
IDoctorStationMainAppService iDoctorStationMainAppService;
@Resource
IDoctorStationAdviceAppService iDoctorStationAdviceAppService;
/**
* 查询就诊患者信息
*
* @param patientInfoDto 查询条件 (前端传 statusEnum 区分就诊状态tab)
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 就诊患者信息
*/
@Override
public IPage<PatientInfoDto> getPatientInfo(PatientInfoDto patientInfoDto, String searchKey, Integer pageNo,
Integer pageSize, HttpServletRequest request) {
return iDoctorStationMainAppService.getPatientInfo(patientInfoDto, searchKey, pageNo, pageSize, request,
Whether.YES.getValue());
}
/**
* 查询医嘱信息
*
* @param adviceBaseDto 查询条件
* @param searchKey 模糊查询关键字
* @param locationId 药房id
* @param organizationId 患者挂号对应的科室id
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 医嘱信息
*/
@Override
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
Long organizationId, Integer pageNo, Integer pageSize) {
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null,
organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3));
}
}

View File

@@ -0,0 +1,482 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.appservice.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.exception.ServiceException;
import com.core.common.utils.AgeCalculatorUtil;
import com.core.common.utils.AssignSeqUtil;
import com.core.common.utils.MessageUtils;
import com.core.common.utils.SecurityUtils;
import com.openhis.administration.domain.ChargeItem;
import com.openhis.administration.service.IChargeItemService;
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.financial.service.IPaymentReconciliationService;
import com.openhis.medication.domain.MedicationDispense;
import com.openhis.medication.domain.MedicationRequest;
import com.openhis.medication.service.IMedicationDispenseService;
import com.openhis.medication.service.IMedicationRequestService;
import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService;
import com.openhis.web.chargemanage.dto.*;
import com.openhis.web.chargemanage.mapper.OutpatientRefundAppMapper;
import com.openhis.workflow.domain.DeviceDispense;
import com.openhis.workflow.domain.DeviceRequest;
import com.openhis.workflow.domain.ServiceRequest;
import com.openhis.workflow.service.IDeviceDispenseService;
import com.openhis.workflow.service.IDeviceRequestService;
import com.openhis.workflow.service.IServiceRequestService;
/**
* 门诊退费 impl
*
* @author zwh
* @date 2025-03-15
*/
@Service
public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppService {
@Autowired
private OutpatientRefundAppMapper outpatientRefundAppMapper;
@Autowired
private IPaymentReconciliationService paymentReconciliationService;
@Autowired
private IChargeItemService chargeItemService;
@Autowired
private IMedicationDispenseService medicationDispenseService;
@Autowired
private IDeviceDispenseService deviceDispenseService;
@Autowired
private IServiceRequestService serviceRequestService;
@Autowired
private IMedicationRequestService medicationRequestService;
@Autowired
private IDeviceRequestService deviceRequestService;
@Autowired
private AssignSeqUtil assignSeqUtil;
/**
* 门诊退费页面初始化
*
* @return 初始化信息
*/
@Override
public R<?> outpatientRefundInit() {
OutpatientInitDto initDto = new OutpatientInitDto();
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
ChargeItemStatus.BILLED.getInfo()));
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDING.getValue(),
ChargeItemStatus.REFUNDING.getInfo()));
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDED.getValue(),
ChargeItemStatus.REFUNDED.getInfo()));
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(
ChargeItemStatus.PART_REFUND.getValue(), ChargeItemStatus.PART_REFUND.getInfo()));
initDto.setChargeItemStatusOptions(chargeItemStatusOptions);
return R.ok(initDto);
}
/**
* 根据就诊id查询患者的账单
*
* @param encounterId 就诊id
* @return 患者账单列表
*/
@Override
public R<?> getEncounterPatientPayment(Long encounterId) {
// 患者账单信息列表
List<EncounterPatientPaymentDto> encounterPatientPaymentList =
outpatientRefundAppMapper.selectEncounterPatientPayment(encounterId, PaymentStatus.SUCCESS.getValue(),
PaymentStatus.REFUND_PART.getValue(), PaymentStatus.REFUND_ALL.getValue());
// 获取付款id集合
List<Long> paymentIdList =
encounterPatientPaymentList.stream().map(EncounterPatientPaymentDto::getId).collect(Collectors.toList());
if (paymentIdList.isEmpty()) {
return R.ok(null);
}
// 根据付款id获取对应收费项目的id列表(费用项id)
List<Long> chargeItemIdList = paymentReconciliationService.getChargeItemIdListByPayment(paymentIdList);
// 根据收费项目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);
refundItemList.forEach(e -> {
// 退费状态
e.setRefundStatus_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getRefundStatus()));
// 发放状态
e.setDispenseStatus_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getDispenseStatus()));
// 执行状态
e.setServiceStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getServiceStatus()));
});
return R.ok(refundItemList);
}
/**
* 根据账单退费
*
* @param refundItemList 退费项目id列表
* @return 操作结果
*/
@Override
public R<?> refundPayment(List<RefundItemParam> refundItemList) {
// 未退费用项,生成新的请求发放费用项
List<RefundItemParam> creatList = new ArrayList<>();
for (RefundItemParam param : refundItemList) {
if (!param.getRefundFlg()) {
// 未退费费用项list
creatList.add(param);
}
}
if (!creatList.isEmpty()) {
// 未退费费用项id集合
List<Long> creatChargeItemIdList =
creatList.stream().map(RefundItemParam::getChargeItemId).collect(Collectors.toList());
// 根据费用项id查询费用项请求发放信息
List<RefundItemDto> creatChargeItemList = outpatientRefundAppMapper.selectRefundItem(creatChargeItemIdList,
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
for (RefundItemDto creatdDto : creatChargeItemList) {
// 未退费用项,生成新的请求,发放,费用项
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(creatdDto.getServiceTable())) {
// 药品请求查询
MedicationRequest medicationRequest = medicationRequestService.getById(creatdDto.getRequestId());
// 生成新的药品请求
medicationRequest.setId(null); // 药品请求id
medicationRequest
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码
medicationRequest.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号
medicationRequestService.save(medicationRequest);
// 药品发放查询
MedicationDispense medicationDispense =
medicationDispenseService.getById(creatdDto.getDispenseId());
// 生成新的药品发放
medicationDispense.setId(null); // 药品发放id
medicationDispense
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4)); // 药品发放编码
medicationDispense.setMedReqId(medicationRequest.getId()); // 药品请求id
medicationDispenseService.save(medicationDispense);
// 费用项查询
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
// 生成新的费用项
chargeItem.setRefundId(chargeItem.getId());// 退费id
chargeItem.setId(null); // 费用项id
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo())); // 编码
chargeItem.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号
chargeItem.setServiceId(medicationRequest.getId()); // 医疗服务ID
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
chargeItemService.save(chargeItem);
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(creatdDto.getServiceTable())) {
// 服务请求查询
ServiceRequest serviceRequest = serviceRequestService.getById(creatdDto.getRequestId());
// 生成新的服务请求
serviceRequest.setId(null); // 服务请求id
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
serviceRequestService.save(serviceRequest);
// 费用项查询
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
// 生成新的费用项
chargeItem.setRefundId(chargeItem.getId());// 退费id
chargeItem.setId(null); // 费用项id
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(serviceRequest.getBusNo())); // 编码
chargeItem.setServiceId(serviceRequest.getId()); // 医疗服务ID
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
chargeItemService.save(chargeItem);
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(creatdDto.getServiceTable())) {
// 耗材请求查询
DeviceRequest deviceRequest = deviceRequestService.getById(creatdDto.getRequestId());
// 生成新的耗材请求
deviceRequest.setId(null); // 耗材请求id
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码
deviceRequestService.save(deviceRequest);
// 耗材发放查询
DeviceDispense deviceDispense = deviceDispenseService.getById(creatdDto.getDispenseId());
// 生成新的耗材发放
deviceDispense.setId(null); // 耗材id
deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4)); // 器材发放id
deviceDispense.setDeviceReqId(deviceRequest.getId()); // 器材请求id
deviceDispenseService.save(deviceDispense);
// 费用项查询
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
// 生成新的费用项
chargeItem.setRefundId(chargeItem.getId());// 退费id
chargeItem.setId(null); // 费用项id
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(deviceRequest.getBusNo())); // 编码
chargeItem.setServiceId(deviceRequest.getId()); // 医疗服务ID
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
chargeItemService.save(chargeItem);
}
}
}
// 全部退费
// 退费费用项id集合
List<Long> chargeItemIdList =
refundItemList.stream().map(RefundItemParam::getChargeItemId).collect(Collectors.toList());
// 根据费用项id查询费用项请求发放信息
List<RefundItemDto> chargeItemList = outpatientRefundAppMapper.selectRefundItem(chargeItemIdList,
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
List<Long> medDisIdList = new ArrayList<>();
List<Long> devDisIdList = new ArrayList<>();
List<Long> serReqIdList = new ArrayList<>();
for (RefundItemDto dto : chargeItemList) {
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(dto.getServiceTable())) {
// 药品需要先退药
if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
|| DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
// 药品请求查询
MedicationRequest medicationRequest = medicationRequestService.getById(dto.getRequestId());
if (medicationRequest.getRefundMedicineId() != null) {
throw new ServiceException("已申请退药,请勿重复申请");
}
// 生成药品请求(退药)
medicationRequest.setId(null); // 药品请求id
medicationRequest
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码
medicationRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量
medicationRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
medicationRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
medicationRequest.setRefundMedicineId(dto.getRequestId()); // 退药id
medicationRequest.setPrescriptionNo(String.valueOf("T" + dto.getPrescriptionNo()));
medicationRequestService.save(medicationRequest);
} else {
if (DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())
&& NotPerformedReason.REFUND.getValue().equals(dto.getNotPerformedReason())) {
throw new ServiceException("已申请退药,请勿重复申请");
}
medDisIdList.add(dto.getDispenseId());
}
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(dto.getServiceTable())) {
// 诊疗项目需医技科室同意退费
if (RequestStatus.COMPLETED.getValue().equals(dto.getServiceStatus())) {
// 服务请求查询
ServiceRequest serviceRequest = serviceRequestService.getById(dto.getRequestId());
if (serviceRequest.getRefundServiceId() != null) {
throw new ServiceException("已申请退费,请勿重复申请");
}
// 生成服务请求(取消服务)
serviceRequest.setId(null); // 服务请求id
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
serviceRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量
serviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
serviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
serviceRequest.setRefundServiceId(dto.getRequestId()); // 退药id
serviceRequestService.save(serviceRequest);
} else {
if (RequestStatus.STOPPED.getValue().equals(dto.getServiceStatus())) {
throw new ServiceException("已申请退费,请勿重复申请");
}
serReqIdList.add(dto.getServiceId());
}
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(dto.getServiceTable())) {
// 耗材需要先退药
if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
|| DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
// 耗材请求查询
DeviceRequest deviceRequest = deviceRequestService.getById(dto.getRequestId());
if (deviceRequest.getRefundDeviceId() == null) {
// 生成耗材请求(退耗材)
deviceRequest.setId(null); // 耗材请求id
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码
deviceRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量
deviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
deviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
deviceRequest.setRefundDeviceId(dto.getRequestId()); // 退药id
deviceRequestService.save(deviceRequest);
}
} else if (!DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())) {
devDisIdList.add(dto.getDispenseId());
}
}
}
// 更新收费状态:退费中
chargeItemService.updateRefundChargeStatus(chargeItemIdList);
if (!medDisIdList.isEmpty()) {
// 更新未发放药品状态:停止发放,停止原因:退费
medicationDispenseService.updateStopDispenseStatus(medDisIdList, NotPerformedReason.REFUND.getValue());
}
if (!devDisIdList.isEmpty()) {
// 更新未发放耗材状态:停止发放,停止原因:退费
deviceDispenseService.updateStopDispenseStatus(devDisIdList, NotPerformedReason.REFUND.getValue());
}
if (!serReqIdList.isEmpty()) {
// 更新未执行诊疗状态:停止
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(), ChargeItemStatus.REFUNDING.getValue(),
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(),
AccountType.MEDICAL_ELECTRONIC_CERTIFICATE.getCode(), EncounterClass.AMB.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);
}
/**
* 根据就诊id查询患者的退费账单
*
* @param encounterId 就诊id
* @param billDateSTime 收费时间开始
* @param billDateETime 收费时间结束
* @return 退费账单列表
*/
@Override
public R<?> getEncounterPatientRefund(Long encounterId, String billDateSTime, String billDateETime) {
List<EncounterPatientRefundDto> refundDtoList =
outpatientRefundAppMapper.selectEncounterPatientRefund(encounterId, ChargeItemStatus.REFUNDING.getValue(),
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(),
CommonConstants.TableName.WOR_SERVICE_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
CommonConstants.TableName.MED_MEDICATION_REQUEST, billDateSTime, billDateETime);
refundDtoList.forEach(e -> {
// 收费状态枚举
e.setChargeStatus_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getChargeStatus()));
// 支付状态枚举
e.setPaymentStatus_enumText(EnumUtils.getInfoByValue(PaymentStatus.class, e.getPaymentStatus()));
// 发药状态
e.setDispenseStatus_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getDispenseStatus()));
// 诊疗执行枚举
e.setServiceStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getServiceStatus()));
});
return R.ok(refundDtoList);
}
/**
* 根据就诊id查询患者因退费重新生成的账单
*
* @param encounterId 就诊id
* @return 重新生成的账单列表
*/
@Override
public R<?> getRegenerateCharge(Long encounterId) {
return R.ok(chargeItemService.getRegenerateCharge(encounterId));
}
/**
* 校验是否可以退费(耗材/药品是否已退,诊疗是否取消执行)
*
* @param chargeItemIdList 收费项目id列表
* @return 是否可退
*/
@Override
public R<?> verifyRefundable(List<Long> chargeItemIdList) {
// 查询收费项目信息
List<ChargeItem> chargeItemList = chargeItemService.listByIds(chargeItemIdList);
// 分别获取各个请求id列表
List<Long> medReqIdList = new ArrayList<>();
List<Long> devReqIdList = new ArrayList<>();
chargeItemList.forEach(item -> {
switch (item.getServiceTable()) {
case CommonConstants.TableName.MED_MEDICATION_REQUEST -> medReqIdList.add(item.getServiceId());
case CommonConstants.TableName.WOR_DEVICE_REQUEST -> devReqIdList.add(item.getServiceId());
}
});
if (!medReqIdList.isEmpty()) {
List<MedicationRequest> medicationRequestList = medicationRequestService.list(
new LambdaQueryWrapper<MedicationRequest>().in(MedicationRequest::getRefundMedicineId, medReqIdList));
if (!medicationRequestList.isEmpty()) {
if (medicationRequestList.stream().map(MedicationRequest::getStatusEnum)
.anyMatch(x -> x.equals(RequestStatus.CANCELLED.getValue()))) {
throw new ServiceException("请先退药后再退费");
}
}
}
String fixmedinsCode =
SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_CODE);
if (!HospitalCodeEnum.CCU.getCode().equals(fixmedinsCode)) {
if (!devReqIdList.isEmpty()) {
List<DeviceRequest> deviceRequestList = deviceRequestService
.list(new LambdaQueryWrapper<DeviceRequest>().in(DeviceRequest::getRefundDeviceId, devReqIdList));
if (!deviceRequestList.isEmpty()) {
if (deviceRequestList.stream().map(DeviceRequest::getStatusEnum)
.anyMatch(x -> x.equals(RequestStatus.CANCELLED.getValue()))) {
throw new ServiceException("请先退耗材后再退费");
}
}
}
}
return R.ok();
}
}

View File

@@ -0,0 +1,290 @@
package com.openhis.web.chargemanage.appservice.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.utils.AgeCalculatorUtil;
import com.core.common.utils.MessageUtils;
import com.core.common.utils.SecurityUtils;
import com.core.common.utils.StringUtils;
import com.core.common.utils.bean.BeanUtils;
import com.openhis.administration.domain.*;
import com.openhis.administration.mapper.PatientMapper;
import com.openhis.administration.service.*;
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.HisPageUtils;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.financial.domain.PaymentReconciliation;
import com.openhis.web.basicservice.dto.HealthcareServiceDto;
import com.openhis.web.basicservice.mapper.HealthcareServiceBizMapper;
import com.openhis.web.chargemanage.appservice.IOutpatientRegistrationAppService;
import com.openhis.web.chargemanage.dto.CurrentDayEncounterDto;
import com.openhis.web.chargemanage.dto.OrgMetadata;
import com.openhis.web.chargemanage.dto.PatientMetadata;
import com.openhis.web.chargemanage.dto.PractitionerMetadata;
import com.openhis.web.chargemanage.mapper.OutpatientRegistrationAppMapper;
import com.openhis.web.paymentmanage.appservice.IPaymentRecService;
import com.openhis.web.paymentmanage.dto.CancelPaymentDto;
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
import com.openhis.yb.model.CancelRegPaymentModel;
import com.openhis.yb.service.YbManager;
/**
* 门诊挂号 应用实现类
*/
@Service
public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistrationAppService {
@Resource
PatientMapper patientMapper;
@Resource
OutpatientRegistrationAppMapper outpatientRegistrationAppMapper;
@Resource
HealthcareServiceBizMapper healthcareServiceBizMapper;
@Resource
IEncounterService iEncounterService;
@Resource
IAccountService iAccountService;
@Resource
IChargeItemService iChargeItemService;
@Resource
IOrganizationService iOrganizationService;
@Resource
YbManager ybManager;
@Resource
IPaymentRecService iPaymentRecService;
@Resource
IPatientIdentifierService patientIdentifierService;
/**
* 门诊挂号 - 查询患者信息
*
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 患者信息
*/
@Override
public Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) {
// 构建查询条件
QueryWrapper<Patient> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str")), null);
// 设置排序
queryWrapper.orderByDesc("update_time");
// 通过证件号匹配 patient
if (StringUtils.isNotEmpty(searchKey)) {
PatientIdentifier patientIdentifier = patientIdentifierService
.getOne(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getIdentifierNo, searchKey));
if (patientIdentifier != null) {
queryWrapper.or(q -> q.eq("id", patientIdentifier.getPatientId()));
}
}
// 患者信息
Page<PatientMetadata> patientMetadataPage =
HisPageUtils.selectPage(patientMapper, queryWrapper, pageNo, pageSize, PatientMetadata.class);
// 现有就诊过的患者id集合
List<Long> patientIdList =
iEncounterService.list().stream().map(e -> e.getPatientId()).collect(Collectors.toList());
patientMetadataPage.getRecords().forEach(e -> {
// 性别枚举
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
// 计算年龄
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
// 初复诊
e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo()
: EncounterType.INITIAL.getInfo());
});
return patientMetadataPage;
}
/**
* 查询门诊科室数据
*
* @return 门诊科室
*/
@Override
public List<OrgMetadata> getOrgMetadata() {
List<Organization> list =
iOrganizationService.getList(OrganizationType.DEPARTMENT.getValue(), OrganizationClass.CLINIC.getValue());
List<OrgMetadata> orgMetadataList = new ArrayList<>();
OrgMetadata orgMetadata;
for (Organization organization : list) {
orgMetadata = new OrgMetadata();
BeanUtils.copyProperties(organization, orgMetadata);
orgMetadataList.add(orgMetadata);
}
return orgMetadataList;
}
/**
* 根据科室id筛选医生
*
* @param orgId 科室ID
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 筛选医生
*/
@Override
public IPage<PractitionerMetadata> getPractitionerMetadataByLocationId(Long orgId, String searchKey, Integer pageNo,
Integer pageSize) {
// 构建查询条件
QueryWrapper<PractitionerMetadata> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
IPage<PractitionerMetadata> practitionerMetadataPage =
outpatientRegistrationAppMapper.getPractitionerMetadataPage(new Page<>(pageNo, pageSize), orgId,
PractitionerRoles.DOCTOR.getCode(), queryWrapper);
practitionerMetadataPage.getRecords().forEach(e -> {
// 性别
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
});
return practitionerMetadataPage;
}
/**
* 根据机构id筛选服务项目
*
* @param organizationId 机构id
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 服务项目
*/
@Override
public IPage<HealthcareServiceDto> getHealthcareMetadataByOrganizationId(Long organizationId, String searchKey,
Integer pageNo, Integer pageSize) {
// 构建查询条件
HealthcareServiceDto healthcareServiceDto = new HealthcareServiceDto();
healthcareServiceDto.setOfferedOrgId(organizationId);
QueryWrapper<HealthcareServiceDto> queryWrapper = HisQueryUtils.buildQueryWrapper(healthcareServiceDto,
searchKey, new HashSet<>(Arrays.asList("name", "charge_name")), null);
return healthcareServiceBizMapper.getHealthcareServicePage(new Page<>(pageNo, pageSize),
CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
queryWrapper);
}
/**
* 退号
*
* @param cancelRegPaymentDto 就诊id
* @return 结果
*/
@Override
public R<?> returnRegister(CancelRegPaymentDto cancelRegPaymentDto) {
Encounter byId = iEncounterService.getById(cancelRegPaymentDto.getEncounterId());
if (EncounterStatus.CANCELLED.getValue().equals(byId.getStatusEnum())) {
return R.fail(null, "该患者已经退号,请勿重复退号");
}
iEncounterService.returnRegister(cancelRegPaymentDto.getEncounterId());
// 查询账户信息
Account account = iAccountService
.getOne(new LambdaQueryWrapper<Account>().eq(Account::getEncounterId, cancelRegPaymentDto.getEncounterId())
.ne(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode())
.eq(Account::getEncounterFlag, Whether.YES.getValue()));
CancelPaymentDto cancelPaymentDto = new CancelPaymentDto();
BeanUtils.copyProperties(cancelRegPaymentDto, cancelPaymentDto);
// 开通医保的处理
if ("1".equals(SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))
&& account != null && !CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(account.getContractNo())) {
CancelRegPaymentModel model = new CancelRegPaymentModel();
BeanUtils.copyProperties(cancelRegPaymentDto, model);
model.setContractNo(account.getContractNo());
ybManager.cancelReg(model);
cancelPaymentDto.setSetlId(model.getSetlId());
// return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"医保退号"}));
}
R<?> result = iPaymentRecService.cancelRegPayment(cancelPaymentDto);
PaymentReconciliation paymentRecon = null;
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
paymentRecon = (PaymentReconciliation)result.getData();
}
if (paymentRecon != null) {
String[] strings = paymentRecon.getChargeItemIds().split(",");
List<Long> chargeItemIds = new ArrayList<>();
for (String string : strings) {
chargeItemIds.add(Long.parseLong(string));
}
// 更新收费状态:已退费
if (!chargeItemIds.isEmpty()) {
iChargeItemService.updatePaymentStatus(chargeItemIds, ChargeItemStatus.REFUNDED.getValue());
}
}
// 2025/05/05 该处保存费用项后,会通过统一收费处理进行收费
return R.ok(paymentRecon, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"退号"}));
}
/**
* 查询当日就诊数据
*
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 当日就诊数据
*/
@Override
public IPage<CurrentDayEncounterDto> getCurrentDayEncounter(String searchKey, Integer pageNo, Integer pageSize,
HttpServletRequest request) {
// 构建查询条件
QueryWrapper<CurrentDayEncounterDto> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name")),
request);
IPage<CurrentDayEncounterDto> currentDayEncounter = outpatientRegistrationAppMapper.getCurrentDayEncounter(
new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), ParticipantType.ADMITTER.getCode(),
queryWrapper, ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue());
currentDayEncounter.getRecords().forEach(e -> {
// 性别
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
// 就诊状态
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(EncounterStatus.class, e.getStatusEnum()));
// 计算年龄
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
});
return currentDayEncounter;
}
/**
* 取消挂号
*
* @param encounterId 就诊id
* @return 结果
*/
@Override
public R<?> cancelRegister(Long encounterId) {
iEncounterService.removeById(encounterId);
return R.ok("已取消挂号");
}
}

View File

@@ -0,0 +1,95 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.controller;
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.IInpatientChargeAppService;
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 门诊收费 controller
*
* @author zwh
* @date 2025-03-12
*/
@RestController
@RequestMapping("/charge-manage/inpa-charge")
@Slf4j
@AllArgsConstructor
public class InpatientChargeController {
@Autowired
private IInpatientChargeAppService inpatientChargeAppService;
/**
* 收费页面初始化
*
* @return 初始化信息
*/
@GetMapping(value = "/init")
public R<?> outpatientChargeInit() {
return inpatientChargeAppService.outpatientChargeInit();
}
/**
* 查询就诊患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
* @return 就诊患者分页列表
*/
@GetMapping(value = "/encounter-patient-page")
public R<?> getEncounterPatientPage(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(inpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
pageSize, request));
}
/**
* 根据就诊id查询患者处方列表
*
* @param encounterId 就诊id
* @return 患者处方列表
*/
@GetMapping(value = "/patient-prescription")
public R<?> getEncounterPatientPrescription(@RequestParam Long encounterId, @RequestParam String startTime,
@RequestParam String endTime) {
return R.ok(inpatientChargeAppService.getEncounterPatientPrescription(encounterId, startTime, endTime));
}
/**
* 医保转自费
*
* @param encounterId 就诊id
* @return 操作结果
*/
@PutMapping("/self-pay")
public R<?> changeToSelfPay(@RequestParam Long encounterId) {
return inpatientChargeAppService.changeToSelfPay(encounterId);
}
/**
* 自费转医保
*
* @param encounterId 就诊id
* @return 操作结果
*/
@PutMapping("/medical-insurance")
public R<?> changeToMedicalInsurance(@RequestParam Long encounterId) {
return inpatientChargeAppService.changeToMedicalInsurance(encounterId);
}
}

View File

@@ -0,0 +1,94 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.controller;
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.IOutpatientChargeAppService;
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 门诊收费 controller
*
* @author zwh
* @date 2025-03-12
*/
@RestController
@RequestMapping("/charge-manage/charge")
@Slf4j
@AllArgsConstructor
public class OutpatientChargeController {
@Autowired
private IOutpatientChargeAppService outpatientChargeAppService;
/**
* 门诊收费页面初始化
*
* @return 初始化信息
*/
@GetMapping(value = "/init")
public R<?> outpatientChargeInit() {
return outpatientChargeAppService.outpatientChargeInit();
}
/**
* 查询就诊患者分页列表
*
* @param encounterPatientPageParam 查询条件
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @param request 请求
* @return 就诊患者分页列表
*/
@GetMapping(value = "/encounter-patient-page")
public R<?> getEncounterPatientPage(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(outpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
pageSize, request));
}
/**
* 根据就诊id查询患者处方列表
*
* @param encounterId 就诊id
* @return 患者处方列表
*/
@GetMapping(value = "/patient-prescription")
public R<?> getEncounterPatientPrescription(@RequestParam Long encounterId) {
return R.ok(outpatientChargeAppService.getEncounterPatientPrescription(encounterId));
}
/**
* 医保转自费
*
* @param encounterId 就诊id
* @return 操作结果
*/
@PutMapping("/self-pay")
public R<?> changeToSelfPay(@RequestParam Long encounterId) {
return outpatientChargeAppService.changeToSelfPay(encounterId);
}
/**
* 自费转医保
*
* @param encounterId 就诊id
* @return 操作结果
*/
@PutMapping("/medical-insurance")
public R<?> changeToMedicalInsurance(@RequestParam Long encounterId) {
return outpatientChargeAppService.changeToMedicalInsurance(encounterId);
}
}

View File

@@ -0,0 +1,71 @@
package com.openhis.web.chargemanage.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.core.common.core.domain.R;
import com.openhis.web.chargemanage.appservice.IOutpatientPricingAppService;
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
import com.openhis.web.doctorstation.dto.PatientInfoDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 门诊划价 controller
*
* @author yangmo
* @date 2025-04-14
*/
@RestController
@RequestMapping("/charge-manage/pricing")
@Slf4j
@AllArgsConstructor
public class OutpatientPricingController {
private final IOutpatientPricingAppService iOutpatientPricingAppService;
/**
* 查询就诊患者信息
*
* @param patientInfoDto 查询条件 (前端可传 statusEnum 区分就诊状态tab)
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 就诊患者信息
*/
@GetMapping(value = "/patient-info")
public R<?> getPatientInfo(PatientInfoDto patientInfoDto,
@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(iOutpatientPricingAppService.getPatientInfo(patientInfoDto, searchKey, pageNo, pageSize, request));
}
/**
* 查询医嘱信息
*
* @param adviceBaseDto 查询条件
* @param searchKey 模糊查询关键字
* @param locationId 药房id
* @param organizationId 患者挂号对应的科室id
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 医嘱信息
*/
@GetMapping(value = "/advice-base-info")
public R<?> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto,
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "locationId", required = false) Long locationId,
@RequestParam(value = "organizationId") Long organizationId,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return R.ok(iOutpatientPricingAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, organizationId,
pageNo, pageSize));
}
}

View File

@@ -0,0 +1,122 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
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 com.openhis.web.chargemanage.dto.RefundItemParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 门诊退费 controller
*
* @author zwh
* @date 2025-03-15
*/
@RestController
@RequestMapping("/charge-manage/refund")
@Slf4j
@AllArgsConstructor
public class OutpatientRefundController {
@Autowired
private IOutpatientRefundAppService outpatientRefundAppService;
/**
* 门诊退费页面初始化
*
* @return 初始化信息
*/
@GetMapping(value = "/init")
public R<?> outpatientRefundInit() {
return outpatientRefundAppService.outpatientRefundInit();
}
/**
* 查询结算过的就诊患者分页列表
*
* @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 outpatientRefundAppService.getBilledEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
pageSize, request);
}
/**
* 根据就诊id查询患者的账单申请退费列表
*
* @param encounterId 就诊id
* @return 患者账单列表
*/
@GetMapping(value = "/patient-payment")
public R<?> getEncounterPatientPayment(@RequestParam Long encounterId) {
return outpatientRefundAppService.getEncounterPatientPayment(encounterId);
}
/**
* 根据账单申请退费
*
* @param refundItemList 退费项目id列表
* @return 操作结果
*/
@PostMapping(value = "/refund-payment")
public R<?> refundPayment(@RequestBody List<RefundItemParam> refundItemList) {
return outpatientRefundAppService.refundPayment(refundItemList);
}
/**
* 根据就诊id查询患者的退费账单
*
* @param encounterId 就诊id
* @param billDateSTime 收费时间开始
* @param billDateETime 收费时间结束
* @return 退费账单列表
*/
@GetMapping(value = "/patient-refund")
public R<?> getEncounterPatientRefund(@RequestParam Long encounterId, @RequestParam String billDateSTime,
@RequestParam String billDateETime) {
return outpatientRefundAppService.getEncounterPatientRefund(encounterId, billDateSTime, billDateETime);
}
/**
* 根据就诊id查询患者因退费重新生成的账单
*
* @param encounterId 就诊id
* @return 重新生成的账单列表
*/
@GetMapping(value = "/regenerate_charge")
public R<?> getRegenerateCharge(@RequestParam Long encounterId) {
return outpatientRefundAppService.getRegenerateCharge(encounterId);
}
/**
* 校验是否可以退费(耗材/药品是否已退,诊疗是否取消执行)
*
* @param chargeItemIdList 收费项目id列表
* @return 是否可退
*/
@GetMapping(value = "/verify_refund")
public R<?> verifyRefundable(@RequestParam List<Long> chargeItemIdList) {
return outpatientRefundAppService.verifyRefundable(chargeItemIdList);
}
}

View File

@@ -0,0 +1,157 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.controller;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.common.enums.PriorityLevel;
import com.openhis.financial.domain.PaymentReconciliation;
import com.openhis.web.chargemanage.appservice.IOutpatientRegistrationAppService;
import com.openhis.web.chargemanage.dto.OutpatientRegistrationInitDto;
import com.openhis.web.paymentmanage.appservice.IEleInvoiceService;
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 门诊挂号 controller
*/
@RestController
@RequestMapping("/charge-manage/register")
@Slf4j
@AllArgsConstructor
public class OutpatientRegistrationController {
private final IOutpatientRegistrationAppService iOutpatientRegistrationAppService;
@Autowired
private IEleInvoiceService eleInvoiceService;
/**
* 基础数据初始化
*/
@GetMapping(value = "/init")
public R<?> init() {
OutpatientRegistrationInitDto outpatientRegistrationInitDto = new OutpatientRegistrationInitDto();
// 优先级
List<OutpatientRegistrationInitDto.priorityLevelOption> priorityLevelOptionOptions =
Stream.of(PriorityLevel.values())
.map(e -> new OutpatientRegistrationInitDto.priorityLevelOption(e.getValue(), e.getInfo()))
.collect(Collectors.toList());
outpatientRegistrationInitDto.setPriorityLevelOptionOptions(priorityLevelOptionOptions);
return R.ok(outpatientRegistrationInitDto);
}
/**
* 查询患者信息
*
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 患者信息
*/
@GetMapping(value = "/patient-metadata")
public R<?> getPatientMetadata(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return R.ok(iOutpatientRegistrationAppService.getPatientMetadataBySearchKey(searchKey, pageNo, pageSize));
}
/**
* 查询就诊科室
*
* @return 就诊科室集合
*/
@GetMapping(value = "/org-list")
public R<?> getLocationTree() {
return R.ok(iOutpatientRegistrationAppService.getOrgMetadata());
}
/**
* 根据科室id筛选医生
*/
@GetMapping(value = "/practitioner-metadata")
public R<?> getPractitionerMetadata(@RequestParam(value = "orgId") Long orgId,
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return R.ok(
iOutpatientRegistrationAppService.getPractitionerMetadataByLocationId(orgId, searchKey, pageNo, pageSize));
}
/**
* 根据机构id筛选服务项目
*/
@GetMapping(value = "/healthcare-metadata")
public R<?> getHealthcareMetadata(@RequestParam(value = "organizationId") Long organizationId,
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return R.ok(iOutpatientRegistrationAppService.getHealthcareMetadataByOrganizationId(organizationId, searchKey,
pageNo, pageSize));
}
/**
* 退号
*
* @param cancelRegPaymentDto 就诊id
* @return 结果
*/
@PutMapping(value = "return")
public R<?> returnRegister(@RequestBody CancelRegPaymentDto cancelRegPaymentDto) {
R<?> result = iOutpatientRegistrationAppService.returnRegister(cancelRegPaymentDto);
// 取消付款成功后,开具发票
if (result.getCode() == 200) {
PaymentReconciliation paymentRecon = null;
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
paymentRecon = (PaymentReconciliation)result.getData();
}
R<?> eleResult =
eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelRegPaymentDto.getReason());
if (eleResult.getCode() != 200) {
// 因取消付款成功前端需要关闭弹窗此处信息仅用于提示所以返回ok
return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg());
}
}
return result;
}
/**
* 取消挂号
*
* @param encounterId 就诊id
* @return 结果
*/
@PutMapping(value = "cancel")
public R<?> cancelRegister(@RequestParam(value = "encounterId") Long encounterId) {
return iOutpatientRegistrationAppService.cancelRegister(encounterId);
}
/**
* 查询当日就诊数据
*
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 当日就诊数据
*/
@GetMapping(value = "/current-day-encounter")
public R<?> getCurrentDayEncounter(@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(iOutpatientRegistrationAppService.getCurrentDayEncounter(searchKey, pageNo, pageSize, request));
}
}

View File

@@ -0,0 +1,67 @@
package com.openhis.web.chargemanage.dto;
import java.math.BigDecimal;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.enums.AccountBillingStatus;
import com.openhis.common.enums.AccountStatus;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 就诊账号 表单数据
*/
@Data
@Accessors(chain = true)
public class AccountFormData {
/**
* 就诊ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/** 患者id */
@NotNull(message = "患者id不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
/** 状态枚举 */
private Integer statusEnum;
/** 结账状态枚举 */
private Integer billingStatusEnum;
/** 账户类型编码 */
private String typeCode; // 【01医保电子凭证 | 02 居民身份证 | 03 社会保障卡 | 04 个人现金账户】
/** 名称 */
private String name; // 刷医保卡时应该会带出该信息
/** 账户余额 */
private BigDecimal balanceAmount; // 刷医保卡时应该会带出该信息
/** 医保区域编码 */
private String ybAreaNo; // 刷医保卡时应该会带出该信息
/** 合同编码 */
private String contractNo; // 从选择的费用性质里选择合同编码
/** 欠费限制额度 */
private BigDecimal limitAccount; // 刷医保卡时应该会带出该信息
/**
* 设置默认值
*/
public AccountFormData() {
this.contractNo = CommonConstants.BusinessName.DEFAULT_CONTRACT_NO;
this.statusEnum = AccountStatus.ACTIVE.getValue();
this.billingStatusEnum = AccountBillingStatus.OPEN.getValue();
}
}

View File

@@ -0,0 +1,94 @@
package com.openhis.web.chargemanage.dto;
import java.math.BigDecimal;
import java.util.Date;
import javax.validation.constraints.NotNull;
import com.core.common.utils.SecurityUtils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.enums.ChargeItemContext;
import com.openhis.common.enums.ChargeItemStatus;
import com.openhis.common.enums.EncounterClass;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 费用项管理 表单数据
*/
@Data
@Accessors(chain = true)
public class ChargeItemFormData {
/**
* 就诊ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/** 患者id */
@NotNull(message = "患者id不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
/** 层级 */
private String busNo;
/** 状态 */
private Integer statusEnum;
/** 类别 */
private Integer contextEnum;
/** 发生时间 */
private Date occurrenceTime;
/** 执行人Id */
@JsonSerialize(using = ToStringSerializer.class)
private Long performerId;
/** 费用定价ID */
@NotNull(message = "费用定价ID不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long definitionId;
/** 开立人ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long entererId;
/** 开立时间 */
private Date enteredDate;
/** 医疗服务类型 */
private String serviceTable;
/** 医疗服务ID */
@NotNull(message = "医疗服务ID不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long serviceId;
/** 总价 */
@NotNull(message = "总价不能为空")
private BigDecimal totalPrice;
/** 关联账户ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long accountId;
/**
* 设置默认值
*/
public ChargeItemFormData() {
this.statusEnum = ChargeItemStatus.PLANNED.getValue();
this.contextEnum = ChargeItemContext.REGISTER.getValue();
this.occurrenceTime = new Date();
this.performerId = SecurityUtils.getLoginUser().getPractitionerId();
this.entererId = SecurityUtils.getLoginUser().getPractitionerId();
this.enteredDate = new Date();
this.serviceTable = CommonConstants.TableName.ADM_HEALTHCARE_SERVICE;
}
}

View File

@@ -0,0 +1,16 @@
package com.openhis.web.chargemanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 费用性质 元数据
*/
@Data
@Accessors(chain = true)
public class ContractMetadata {
/** 合同名称 */
private String contractName;
/** 合同编码 */
private String busNo;
}

View File

@@ -0,0 +1,134 @@
package com.openhis.web.chargemanage.dto;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 当天就诊信息
*/
@Data
@Accessors(chain = true)
public class CurrentDayEncounterDto {
/** 租户ID */
private Integer tenantId;
/**
* 就诊ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/**
* 科室ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long organizationId;
/**
* 科室名称
*/
private String organizationName;
/**
* 挂号类型
*/
private String healthcareName;
/**
* 专家账号id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long practitionerUserId;
/**
* 专家
*/
private String practitionerName;
/**
* 费用性质
*/
private String contractName;
/**
* 患者id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
/**
* 患者姓名
*/
private String patientName;
/**
* 患者性别
*/
private Integer genderEnum;
private String genderEnum_enumText;
/**
* 证件号
*/
private String idCard;
/**
* 就诊状态
*/
private Integer statusEnum;
private String statusEnum_enumText;
/**
* 挂号日期/时间
*/
private Date registerTime;
/**
* 价格
*/
private BigDecimal totalPrice;
/**
* 账户名称
*/
private String accountName;
/**
* 挂号人
*/
private String entererName;
/**
* 收费项目ids
*/
private String chargeItemIds;
/**
* 付款id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long paymentId;
/**
* 发票url地址
*/
private String pictureUrl;
/**
* 年龄
*/
private String age;
/**
* 生日
*/
private Date birthDate;
}

View File

@@ -0,0 +1,31 @@
package com.openhis.web.chargemanage.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
/**
* 就诊诊断 表单数据
*/
@Data
@Accessors(chain = true)
public class EncounterDiagnosisFormData {
/**
* 就诊ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/**
* 诊断ID
*/
@NotBlank(message = "诊断ID不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long conditionId;
}

View File

@@ -0,0 +1,87 @@
package com.openhis.web.chargemanage.dto;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.enums.*;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 就诊 表单数据
*/
@Data
@Accessors(chain = true)
public class EncounterFormData {
/**
* 患者ID
*/
@NotNull(message = "患者ID不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
/**
* 状态编码
*/
private Integer statusEnum;
/**
* 类别编码
*/
private Integer classEnum;
/**
* 类别医保编码
*/
private Integer ybClassEnum;
/**
* 类别医保文本
*/
private String ybClassText; // 医保接口获取
/**
* 优先级编码
*/
@NotNull(message = "优先级编码不能为空")
private Integer priorityEnum;
/**
* 分类编码
*/
private Integer typeEnum;
/**
* 服务ID
*/
@NotNull(message = "服务ID不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long serviceTypeId;
/**
* 就诊对象状态
*/
private Integer subjectStatusEnum;
/**
* 机构ID
*/
@NotNull(message = "机构ID不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long organizationId;
/**
* 设置默认值
*/
public EncounterFormData() {
this.statusEnum = EncounterStatus.PLANNED.getValue();
this.classEnum = EncounterClass.AMB.getValue();
this.ybClassEnum = EncounterYbClass.ORDINARY_OUTPATIENT.getValue();
this.typeEnum = OutpatientClass.GENERAL_OUTPATIENT_SERVICE.getValue();
this.subjectStatusEnum = EncounterSubjectStatus.TRIAGED.getValue();
}
}

View File

@@ -0,0 +1,46 @@
package com.openhis.web.chargemanage.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.enums.EncounterLocationStatus;
import com.openhis.common.enums.LocationForm;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 就诊位置 表单数据
*/
@Data
@Accessors(chain = true)
public class EncounterLocationFormData {
/**
* 就诊ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/**
* 位置ID
*/
private Long locationId;
/** 状态枚举 */
private Integer statusEnum;
/** 物理形式枚举 */
private Integer formEnum;
/**
* 设置默认值
*/
public EncounterLocationFormData() {
this.statusEnum = EncounterLocationStatus.PLANNED.getValue();
this.formEnum = LocationForm.ROOM.getValue();
}
}

View File

@@ -0,0 +1,37 @@
package com.openhis.web.chargemanage.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.enums.ParticipantType;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 就诊参数者 表单数据
*/
@Data
@Accessors(chain = true)
public class EncounterParticipantFormData {
/**
* 就诊ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/** 参与者类型 */
private String typeCode;
/** 参与者ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long practitionerId;
/**
* 设置默认值
*/
public EncounterParticipantFormData() {
this.typeCode = ParticipantType.REGISTRATION_DOCTOR.getCode();// 挂号医生
}
}

View File

@@ -0,0 +1,138 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.dto;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
* 就诊患者分页dto
*
* @author zwh
* @date 2025-03-12
*/
@Data
@Accessors(chain = true)
public class EncounterPatientPageDto {
/**
* 就诊ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/**
* 患者
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
/**
* 患者姓名
*/
private String patientName;
/**
* 患者院内编码/病历号
*/
private String patientBusNo;
/**
* 身份证号
*/
private String idCard;
/**
* 拼音码
*/
private String patientPyStr;
/**
* 五笔码
*/
private String patientWbStr;
/**
* 就诊编码
*/
private String encounterBusNo;
/**
* 性别编码
*/
private Integer genderEnum;
private String genderEnum_enumText;
/**
* 生日
*/
private Date birthDate;
/**
* 账户类型编码
*/
@Dict(dictCode = "account_code")
private String typeCode;
private String typeCode_dictText;
/**
* 账户余额
*/
private BigDecimal balanceAmount;
/**
* 接诊时间
*/
private Date receptionTime;
/**
* 年龄
*/
private String age;
/** 收费状态 */
private Integer statusEnum;
private String statusEnum_enumText;
/**
* 医保总额
*/
private BigDecimal insuranceAmount;
/**
* 自费总额
*/
private BigDecimal selfAmount;
/**
* 付款总额
*/
private BigDecimal totalAmount;
/** 合同类型 */
private Integer categoryEnum;
private String categoryEnum_enumText;
/**
* 结算时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date maxBillDate;
/**
* 开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
}

View File

@@ -0,0 +1,70 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.dto;
import java.util.Date;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 就诊患者分页查询条件
*
* @author zwh
* @date 2025-03-12
*/
@Data
@Accessors(chain = true)
public class EncounterPatientPageParam {
/**
* 患者姓名
*/
private String patientName;
/**
* 患者院内编码/病历号
*/
private String patientBusNo;
/**
* 身份证号
*/
private String idCard;
/**
* 拼音码
*/
private String patientPyStr;
/**
* 五笔码
*/
private String patientWbStr;
/**
* 就诊编码
*/
private String encounterBusNo;
/**
* 接诊时间
*/
private Date receptionTime;
/**
* 住院开始时间
*/
private Date startTime;
/**
* 收费时间
*/
private Date billTime;
/**
* 收费状态
*/
private Integer statusEnum;
}

View File

@@ -0,0 +1,75 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.dto;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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;
/**
* 就诊患者账单 dto
*
* @author zwh
* @date 2025-03-17
*/
@Data
@Accessors(chain = true)
public class EncounterPatientPaymentDto {
/** ID */
@TableId(type = IdType.ASSIGN_ID)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** 就诊ID */
private Long encounterId;
/** 处方号 */
private String prescriptionNo;
/** 关联账户ID */
private Long accountId;
/** 支付状态 */
private Integer statusEnum;
/** 关联ID */
private Long relationId;
/** 支付的业务标识符 */
private String paymentNo;
/** 付款类别 */
private Integer paymentEnum;
/** 支付位置 */
@Dict(dictTable = "adm_location", dictText = "name", dictCode = "id")
private Long locationId;
private String locationId_dictText;
/** 到期时间 */
private Date expirationDate;
/** 应收金额 */
private BigDecimal tenderedAmount;
/** 找零金额 */
private BigDecimal returnedAmount;
/** 付款总额 */
private BigDecimal displayAmount;
/** 合同编码 */
private String contractNo;
}

View File

@@ -0,0 +1,106 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.dto;
import java.math.BigDecimal;
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;
/**
* 就诊患者处方 dto
*
* @author zwh
* @date 2025-03-14
*/
@Data
@Accessors(chain = true)
public class EncounterPatientPrescriptionDto {
/** 收费项目类型 */
private Integer contextEnum;
private String contextEnum_enumText;
/** 收费状态 */
private Integer statusEnum;
private String statusEnum_enumText;
/** 就诊ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/** 患者id */
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
/** ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** 开立科室 */
@JsonSerialize(using = ToStringSerializer.class)
private Long requestingOrgId;
/** 数量 */
private Long quantityValue;
/** 单位 */
private String quantityUnit;
/** 单价 */
private BigDecimal unitPrice;
/** 总价 */
private BigDecimal totalPrice;
/** 处方号 */
private String prescriptionNo;
/** 业务编码 */
private String busNo;
/** 收款人ID */
@JsonSerialize(using = ToStringSerializer.class)
@Dict(dictCode = "id", dictTable = "adm_practitioner", dictText = "name")
private Long entererId;
private String entererId_dictText;
/** 开立时间 */
private Date enteredDate;
/** 收费时间 */
private Date billDate;
/** 关联账户ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long accountId;
/** 物品编码 */
@JsonSerialize(using = ToStringSerializer.class)
private Long itemId;
/** 物品名称 */
private String itemName;
/** 特病标识 */
@Dict(dictCode = "med_type")
private String medTypeCode;
private String medTypeCode_dictText;
/** 合同编码 */
private String contractNo;
/** 医保编码 */
private String ybNo;
/** 合同名称 */
private String contractName;
/** 服务所在表 */
private String serviceTable;
}

View File

@@ -0,0 +1,118 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.dto;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.annotation.Dict;
import com.openhis.yb.dto.PaymentDetailDto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 患者退款信息列表
*
* @author zwh
* @date 2025-05-05
*/
@Data
@Accessors(chain = true)
public class EncounterPatientRefundDto {
/** 支付ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long paymentId;
/** 收款人ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long entererId;
/** 就诊ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/** 支付的患者ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
/** 请求ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long requestId;
/** 发放ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long dispenseId;
/** 处方号 */
private String prescriptionNo;
/** 收费项目编号 */
private String busNo;
/** 合同编号 */
private String contractNo;
/** 项目名 */
private String itemName;
/** 项目名 */
private String orgName;
/** 收费项目ids */
private String chargeItemIds;
/** 收款人 */
private String entererName;
/** 服务表名 */
private String serviceTable;
/** 收费状态 */
private Integer chargeStatus;
private String chargeStatus_enumText;
/** 支付状态 */
private Integer paymentStatus;
private String paymentStatus_enumText;
/** 发放状态 */
private Integer dispenseStatus;
private String dispenseStatus_enumText;
/** 执行状态 */
private Integer serviceStatus;
private String serviceStatus_enumText;
/** 数量 */
private Integer quantityValue;
/** 已发药数量 */
private Integer dispenseQuantity;
/** 单位 */
@Dict(dictCode = "unit_code")
private String quantityUnit;
private String quantityUnit_dictText;
/** 单价 */
private BigDecimal unitPrice;
/** 总价 */
private BigDecimal totalPrice;
/** 结算时间 */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date billDate;
/**
* 支付明细列表
*/
private List<PaymentDetailDto> paymentDetailList;
}

View File

@@ -0,0 +1,27 @@
package com.openhis.web.chargemanage.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 门诊科室信息 元数据
*/
@Data
@Accessors(chain = true)
public class OrgMetadata {
/**
* ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 科室名称
*/
private String name;
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
/**
* 门诊费用相关初始化
*
* @author zwh
* @date 2025-03-30
*/
@Data
@Accessors(chain = true)
public class OutpatientInitDto {
private List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions;
/**
* 收费状态
*/
@Data
public static class chargeItemStatusOption {
private Integer value;
private String label;
public chargeItemStatusOption(Integer value, String label) {
this.value = value;
this.label = label;
}
}
}

View File

@@ -0,0 +1,53 @@
package com.openhis.web.chargemanage.dto;
import java.math.BigDecimal;
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;
/**
* 门诊划价库存 dto
*/
@Data
@Accessors(chain = true)
public class OutpatientPricingInventoryDto {
/** 物理表名 */
private String itemTable;
/** 实例id */
@JsonSerialize(using = ToStringSerializer.class)
private Long itemId;
/** 当前库存数量 ,对应小单位*/
private BigDecimal quantity;
/** 单位 , 对应小单位*/
@Dict(dictCode = "unit_code")
private String unitCode;
private String unitCode_dictText;
/** 产品批号 */
private String lotNumber;
/** 库位 */
@JsonSerialize(using = ToStringSerializer.class)
private Long locationStoreId;
/** 库房id */
@JsonSerialize(using = ToStringSerializer.class)
private Long locationId;
/**
* 库房名称
*/
private String locationName;
/** 采购单价(进价) */
private BigDecimal price;
}

View File

@@ -0,0 +1,46 @@
package com.openhis.web.chargemanage.dto;
import java.math.BigDecimal;
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;
/**
* 门诊划价价格 dto
*/
@Data
@Accessors(chain = true)
public class OutpatientPricingPriceDto {
/**
* 费用定价名称
*/
private String chargeName;
/** 费用定价主表ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long definitionId;
/** 费用定价子表ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long definitionDetailId;
/** 命中条件 */
private String conditionCode;
/** 命中值 */
private String conditionValue;
/** 价格 */
private BigDecimal price;
/** 单位 */
@Dict(dictCode = "unit_code")
private String unitCode;
private String unitCode_dictText;
}

View File

@@ -0,0 +1,75 @@
package com.openhis.web.chargemanage.dto;
import java.util.List;
import javax.validation.Valid;
import com.openhis.yb.dto.Info5301SpecialConditionResult;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 门诊挂号 新增参数
*/
@Data
@Accessors(chain = true)
public class OutpatientRegistrationAddParam {
/**
* 就诊管理-表单数据
*/
@Valid
private EncounterFormData encounterFormData;
// /**
// * 就诊诊断管理-表单数据
// */
// private EncounterDiagnosisFormData encounterDiagnosisFormData;
/**
* 就诊位置管理-表单数据
*/
@Valid
private EncounterLocationFormData encounterLocationFormData;
/**
* 就诊参数者管理-表单数据
*/
@Valid
private EncounterParticipantFormData encounterParticipantFormData;
/**
* 就诊账户管理-表单数据
*/
@Valid
private AccountFormData accountFormData;
/**
* 费用项管理-表单数据 //todo:挂号费会绑定诊查费该字段会变成List挂号前先把这个收费项开个前台后台没有保存
*/
@Valid
private ChargeItemFormData chargeItemFormData;
/**
* 密钥 医保挂号时使用
*/
private String busiCardInfo;// 2025/05/16 前后端一致,前端大写,后端保持大写
/**
* 类型 医保挂号时使用
*/
private String ybMdtrtCertType;
/**
* 医保个人结算方式 参照枚举 按项目结算 01 按定额结算 02
*/
private String YbPsnSetlWay;
/**
* 特慢病列表
*/
private List<Info5301SpecialConditionResult> feedetail;
public OutpatientRegistrationAddParam() {
this.YbPsnSetlWay = "01";
}
}

View File

@@ -0,0 +1,32 @@
package com.openhis.web.chargemanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
/**
* 门诊挂号 init基础数据
*/
@Data
@Accessors(chain = true)
public class OutpatientRegistrationInitDto {
private List<priorityLevelOption> priorityLevelOptionOptions;
/**
* 优先级
*/
@Data
public static class priorityLevelOption {
private Integer value;
private String label;
public priorityLevelOption(Integer value, String label) {
this.value = value;
this.label = label;
}
}
}

View File

@@ -0,0 +1,22 @@
package com.openhis.web.chargemanage.dto;
import java.util.List;
import com.openhis.yb.dto.PaymentDetailDto;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class OutpatientRegistrationSettleParam {
OutpatientRegistrationAddParam outpatientRegistrationAddParam;
String chrgBchno;// 收费批次号 付款时必传
String busNo;// 挂号no
List<PaymentDetailDto> paymentDetails;// 支付渠道 付款时必传
}

View File

@@ -0,0 +1,59 @@
package com.openhis.web.chargemanage.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 患者信息 元数据
*/
@Data
@Accessors(chain = true)
public class PatientMetadata {
/**
* ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 患者姓名
*/
private String name;
/**
* 性别编码
*/
private Integer genderEnum;
private String genderEnum_enumText;
/**
* 身份证号
*/
private String idCard;
/**
* 电话
*/
private String phone;
/**
* 生日
*/
private Date birthDate;
/**
* 年龄
*/
private String age;
/**
* 初复诊
*/
private String firstEnum_enumText;
}

View File

@@ -0,0 +1,36 @@
package com.openhis.web.chargemanage.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 参与者 元数据
*/
@Data
@Accessors(chain = true)
public class PractitionerMetadata {
/**
* ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** 姓名 */
private String name;
/**
* 性别编码
*/
private Integer genderEnum;
private String genderEnum_enumText;
/** 拼音码 */
private String pyStr;
/** 五笔码 */
private String wbStr;
}

View File

@@ -0,0 +1,150 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.dto;
import com.core.common.utils.SecurityUtils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.enums.EncounterClass;
import com.openhis.common.enums.RequestStatus;
import com.openhis.common.enums.TherapyTimeType;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 划价项目 dto
*
* @author zwh
* @date 2025-04-10
*/
@Data
@Accessors(chain = true)
public class PricingProjectDto {
/** 医嘱类型 */
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
/**
* 医嘱详细分类
*/
private String categoryCode;
/** 拆零比 */
private BigDecimal partPercent;
/** 执行次数 */
private Integer executeNum; // 当医嘱类型为药品时,选填
/** 请求数量 */
private Integer quantity;
/** 请求单位编码 */
private String unitCode;
/** 单价 */
private BigDecimal unitPrice;
/** 总价 */
private BigDecimal totalPrice;
/** 费用定价主表ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long definitionId;
/** 费用定价子表ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long definitionDetailId;
/** 产品批号 */
private String lotNumber;
/**
* 请求状态
*/
private Integer statusEnum;
/** 请求类型 */
private Integer categoryEnum;
/** 耗材ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long deviceId;
/**
* 医嘱对应表名
*/
private String adviceTableName;
/** 患者 */
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
/** 开方医生 */
@JsonSerialize(using = ToStringSerializer.class)
private Long practitionerId;
/** 请求发起的位置 */
@JsonSerialize(using = ToStringSerializer.class)
private Long locationId;
/** 发放位置 */
@JsonSerialize(using = ToStringSerializer.class)
private Long performLocation;
/** 所属科室 */
@JsonSerialize(using = ToStringSerializer.class)
private Long orgId;
/** 就诊id */
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/**
* 账户id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long accountId;
/**
* 诊断ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long conditionId;
/** 治疗类型 */
private Integer therapyEnum;
/** 用法 */
private String methodCode;
/** 用药频次 */
private String rateCode;
/** 单次剂量 */
private BigDecimal dose;
/** 剂量单位 */
private String doseUnitCode;
/** 组套id */
@JsonSerialize(using = ToStringSerializer.class)
private Long packageId;
/** 活动(项目)定义id */
@JsonSerialize(using = ToStringSerializer.class)
private Long activityId;
/**
* 设置默认值
*/
public PricingProjectDto() {
this.statusEnum = RequestStatus.ACTIVE.getValue();
this.categoryEnum = EncounterClass.AMB.getValue();
this.therapyEnum = TherapyTimeType.TEMPORARY.getValue();
this.practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
this.orgId = SecurityUtils.getLoginUser().getOrgId(); // 开方人科室
}
}

View File

@@ -0,0 +1,85 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.dto;
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;
import java.math.BigDecimal;
/**
* 退款项目 dto
*
* @author zwh
* @date 2025-03-18
*/
@Data
@Accessors(chain = true)
public class RefundItemDto {
/** 收费ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long chargeItemId;
/** 收费ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long paymentId;
/** 医疗服务所在表 */
private String serviceTable;
/** 医疗服务ID */
private Long serviceId;
/** 请求编码 */
private String busNo;
/** 处方号 */
private String prescriptionNo;
/** 请求数量 */
private Integer quantity;
/** 请求单位编码 */
@Dict(dictCode = "unit_code")
private String unitCode;
private String unitCode_dictText;
/** 单价 */
private BigDecimal unitPrice;
/** 总价 */
private BigDecimal totalPrice;
/** 退款状态 */
private Integer refundStatus;
private String refundStatus_enumText;
/** 发放状态 */
private Integer dispenseStatus;
private String dispenseStatus_enumText;
/** 执行状态 */
private Integer serviceStatus;
private String serviceStatus_enumText;
/** 未发药原因 */
private Integer notPerformedReason;
/** 项目id */
private Long itemId;
/** 发放id */
private Long dispenseId;
/** 请求id */
private Long requestId;
/** 项目名 */
private String itemName;
}

View File

@@ -0,0 +1,28 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 退费项目id列表 dto
*
* @author yangmo
* @date 2025-04-15
*/
@Data
@Accessors(chain = true)
public class RefundItemParam {
/** 付款ID */
private Long paymentId;
/** 收费项ID */
private Long chargeItemId;
/** 退费标志 */
private Boolean refundFlg;
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.mapper;
import java.util.Date;
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.EncounterPatientPrescriptionDto;
/**
* 门诊收费 appMapper
*
* @author zwh
* @date 2025-03-13
*/
@Repository
public interface InpatientChargeAppMapper {
/**
* 查询就诊患者分页列表
*
* @param page 分页
* @param queryWrapper 查询条件
* @return 就诊患者分页列表
*/
Page<EncounterPatientPageDto> selectEncounterPatientPage(@Param("classEnum") Integer classEnum,
@Param("page") Page<EncounterPatientPageDto> page,
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper);
/**
* 根据就诊id查询患者处方列表
*
* @param encounterId 就诊id
* @param activity 项目
* @param medication 药品
* @param device 耗材
* @param register 挂号费
* @param planned 收费状态:待收费
* @param billable 收费状态:待结算
* @param billed 收费状态:已结算
* @param refunding 收费状态:退费中
* @param refunded 收费状态:全部退费
* @param partRefund 收费状态:部分退费
* @return 患者处方列表
*/
List<EncounterPatientPrescriptionDto> selectEncounterPatientPrescription(@Param("encounterId") Long encounterId,
@Param("activity") Integer activity, @Param("medication") Integer medication, @Param("device") Integer device,
@Param("register") Integer register, @Param("planned") Integer planned, @Param("billable") Integer billable,
@Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
@Param("partRefund") Integer partRefund, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
}

View File

@@ -0,0 +1,59 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.mapper;
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.EncounterPatientPrescriptionDto;
/**
* 门诊收费 appMapper
*
* @author zwh
* @date 2025-03-13
*/
@Repository
public interface OutpatientChargeAppMapper {
/**
* 查询就诊患者分页列表
*
* @param page 分页
* @param queryWrapper 查询条件
* @param amb 就诊类型:门诊
* @return 就诊患者分页列表
*/
Page<EncounterPatientPageDto> selectEncounterPatientPage(@Param("page") Page<EncounterPatientPageDto> page,
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper, @Param("amb") Integer amb);
/**
* 根据就诊id查询患者处方列表
*
* @param encounterId 就诊id
* @param activity 项目
* @param medication 药品
* @param device 耗材
* @param register 挂号费
* @param planned 收费状态:待收费
* @param billable 收费状态:待结算
* @param billed 收费状态:已结算
* @param refunding 收费状态:退费中
* @param refunded 收费状态:全部退费
* @param partRefund 收费状态:部分退费
* @return 患者处方列表
*/
List<EncounterPatientPrescriptionDto> selectEncounterPatientPrescription(@Param("encounterId") Long encounterId,
@Param("activity") Integer activity, @Param("medication") Integer medication, @Param("device") Integer device,
@Param("register") Integer register, @Param("planned") Integer planned, @Param("billable") Integer billable,
@Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
@Param("partRefund") Integer partRefund);
}

View File

@@ -0,0 +1,17 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.mapper;
import org.springframework.stereotype.Repository;
/**
* 门诊划价 appMapper
*
* @author yangmo
* @date 2025-04-14
*/
@Repository
public interface OutpatientPricingAppMapper {
}

View File

@@ -0,0 +1,90 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.chargemanage.mapper;
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.*;
/**
* 门诊退费 appMapper
*
* @author zwh
* @date 2025-03-15
*/
@Repository
public interface OutpatientRefundAppMapper {
/**
* 获取就诊患者账单列表
*
* @param encounterId 就诊id
* @param success 支付状态:成功
* @param refundPart 支付状态:部分退款
* @param refundAll 支付状态:全部退款
* @return 就诊患者账单列表
*/
List<EncounterPatientPaymentDto> selectEncounterPatientPayment(@Param("encounterId") Long encounterId,
@Param("success") Integer success, @Param("refundPart") Integer refundPart,
@Param("refundAll") Integer refundAll);
/**
* 查询退费项目
*
* @param chargeItemIdList 收费项列表
* @param medMedicationRequest 药品请求表
* @param worServiceRequest 服务请求表
* @param worDeviceRequest 耗材请求表
* @param three 用于字符截位
* @return 退费项目列表
*/
List<RefundItemDto> selectRefundItem(@Param("chargeItemIdList") List<Long> chargeItemIdList,
@Param("medMedicationRequest") String medMedicationRequest,
@Param("worServiceRequest") String worServiceRequest, @Param("worDeviceRequest") String worDeviceRequest,
@Param("three") Integer three);
/**
* 查询已结算就诊患者分页列表
*
* @param page 分页
* @param queryWrapper 查询条件
* @param billed 收费状态:已结算
* @param refunding 收费状态:退费中
* @param refunded 收费状态:已退费
* @param partRefund 收费状态:部分退费
* @param insurance 账户类型:医保
* @param amb 就诊类型:门诊
* @return 已结算就诊患者分页列表
*/
Page<EncounterPatientPageDto> selectBilledEncounterPatientPage(@Param("page") Page<EncounterPatientPageDto> page,
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper, @Param("billed") Integer billed,
@Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
@Param("partRefund") Integer partRefund, @Param("insurance") String insurance, @Param("amb") Integer amb);
/**
* 查询患者退费项目
*
* @param encounterId 就诊id
* @param refunding 收费状态:退费中
* @param refunded 收费状态:已退款
* @param partRefund 收费状态:部分退款
* @param worServiceRequest 服务请求表
* @param worDeviceRequest 设备请求表
* @param medMedicationRequest 药品请求表
* @param billDateSTime 收费时间开始
* @param billDateETime 收费时间结束
* @return 查询患者退费项目
*/
List<EncounterPatientRefundDto> selectEncounterPatientRefund(@Param("encounterId") Long encounterId,
@Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
@Param("partRefund") Integer partRefund, @Param("worServiceRequest") String worServiceRequest,
@Param("worDeviceRequest") String worDeviceRequest, @Param("medMedicationRequest") String medMedicationRequest,
@Param("billDateSTime") String billDateSTime, @Param("billDateETime") String billDateETime);
}

View File

@@ -0,0 +1,59 @@
package com.openhis.web.chargemanage.mapper;
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.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.chargemanage.dto.CurrentDayEncounterDto;
import com.openhis.web.chargemanage.dto.PractitionerMetadata;
import com.openhis.web.personalization.dto.ActivityDeviceDto;
/**
* 门诊挂号 应用Mapper
*/
@Repository
public interface OutpatientRegistrationAppMapper {
/**
* 查询医生
*/
IPage<PractitionerMetadata> getPractitionerMetadataPage(@Param("page") Page<PractitionerMetadata> page,
@Param("orgId") Long orgId, @Param("RoleCode") String RoleCode,
@Param(Constants.WRAPPER) QueryWrapper<PractitionerMetadata> queryWrapper);
/**
* 根据病人id和科室id查询当日挂号次数
*/
Integer getNumByPatientIdAndOrganizationId(@Param("patientId") Long patientId,
@Param("serviceTypeId") Long serviceTypeId, @Param("cancelled") Integer cancelled);
/**
* 查询当日就诊数据
*
* @param page 分页参数
* @param classEnum 就诊类型
* @param participantType 参与者类型
* @param queryWrapper 查询条件
* @param register 收费项目类型:挂号
* @param paymentStatus 支付状态:成功
* @return 当日就诊数据
*/
IPage<CurrentDayEncounterDto> getCurrentDayEncounter(@Param("page") Page<CurrentDayEncounterDto> page,
@Param("classEnum") Integer classEnum, @Param("participantType") String participantType,
@Param(Constants.WRAPPER) QueryWrapper<CurrentDayEncounterDto> queryWrapper,
@Param("register") Integer register, @Param("paymentStatus") Integer paymentStatus);
/**
* 查询item绑定的信息(耗材或诊疗)
*
* @param itemId itemId
* @param devActable 绑定的表名(耗材或诊疗)
* @return item绑定的信息
*/
List<ActivityDeviceDto> getTmpActivityList(@Param("itemId") String itemId, @Param("devActable") String devActable);
}