版本更新
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
package com.openhis.web.inhospitalcharge.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalcharge.dto.AdvancePaymentFlowRecordDto;
|
||||
import com.openhis.web.inhospitalcharge.dto.AdvancePaymentInAndOutDto;
|
||||
import com.openhis.web.inhospitalcharge.dto.AdvancePaymentInfoDto;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 预交金管理 应用Service
|
||||
*/
|
||||
public interface IAdvancePaymentManageAppService {
|
||||
|
||||
/**
|
||||
* 查询患者预交金基本信息
|
||||
*
|
||||
* @param advancePaymentInfoDto 患者预交金基本信息dto
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 患者预交金基本信息
|
||||
*/
|
||||
IPage<AdvancePaymentInfoDto> getAdvancePaymentInfo(AdvancePaymentInfoDto advancePaymentInfoDto, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询预交金支付流水记录
|
||||
*
|
||||
* @param encounterId 住院就诊Id
|
||||
* @return 预交金支付流水记录
|
||||
*/
|
||||
List<AdvancePaymentFlowRecordDto> getAdvancePaymentFlowRecord(Long encounterId);
|
||||
|
||||
/**
|
||||
* 预交金交款
|
||||
*
|
||||
* @param advancePaymentInAndOutDto 交款dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> inAdvancePayment(AdvancePaymentInAndOutDto advancePaymentInAndOutDto);
|
||||
|
||||
/**
|
||||
* 预交金退款
|
||||
*
|
||||
* @param advancePaymentInAndOutDto 退款dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> outAdvancePayment(AdvancePaymentInAndOutDto advancePaymentInAndOutDto);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.openhis.web.inhospitalcharge.appservice;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalcharge.dto.*;
|
||||
|
||||
/**
|
||||
* 住院登记 应用Service
|
||||
*/
|
||||
public interface IInHospitalRegisterAppService {
|
||||
|
||||
/**
|
||||
* 门诊医生开住院申请
|
||||
*
|
||||
* @param inHospitalRegisterDto 住院登记参数
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> registerByDoctor(InHospitalRegisterDto inHospitalRegisterDto);
|
||||
|
||||
/**
|
||||
* 查询住院登记信息
|
||||
*
|
||||
* @param inHospitalRegisterQueryDto 查询dto
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param registeredFlag 已登记标识,已登记传 1 ,待登记传 0
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 住院登记信息
|
||||
*/
|
||||
IPage<InHospitalRegisterQueryDto> getRegisterInfo(InHospitalRegisterQueryDto inHospitalRegisterQueryDto,
|
||||
String searchKey, String registeredFlag, Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询患者基本信息
|
||||
*
|
||||
* @param patientId 患者ID
|
||||
* @return 患者基本信息
|
||||
*/
|
||||
InHospitalPatientInfoDto getPatientInfo(Long patientId);
|
||||
|
||||
/**
|
||||
* 查询住院就诊信息
|
||||
*
|
||||
* @param encounterId 住院就诊id
|
||||
* @return 住院就诊信息
|
||||
*/
|
||||
InHospitalInfoDto getInHospitalInfo(Long encounterId);
|
||||
|
||||
/**
|
||||
* 根据病区号查询床位数
|
||||
*
|
||||
* @param wardBusNo 病区号
|
||||
* @return 床位数
|
||||
*/
|
||||
HashMap<String, Integer> getBedsNumByWardBusNo(String wardBusNo);
|
||||
|
||||
/**
|
||||
* 更新患者信息
|
||||
*
|
||||
* @param patientUpdateDto 更新患者信息dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> updatePatient(PatientUpdateDto patientUpdateDto);
|
||||
|
||||
/**
|
||||
* 款台登记
|
||||
*
|
||||
* @param inHospitalInfoDto 登记dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> registerByCashier(InHospitalInfoDto inHospitalInfoDto);
|
||||
|
||||
/**
|
||||
* 无档登记
|
||||
*
|
||||
* @param noFilesRegisterDto 无档登记dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> noFilesRegister(NoFilesRegisterDto noFilesRegisterDto);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.openhis.web.inhospitalcharge.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Account;
|
||||
import com.openhis.administration.service.IAccountService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.enums.ybenums.YbPayment;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.financial.domain.PaymentRecDetail;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.service.IPaymentRecDetailService;
|
||||
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||
import com.openhis.web.inhospitalcharge.appservice.IAdvancePaymentManageAppService;
|
||||
import com.openhis.web.inhospitalcharge.dto.AdvancePaymentFlowRecordDto;
|
||||
import com.openhis.web.inhospitalcharge.dto.AdvancePaymentInAndOutDto;
|
||||
import com.openhis.web.inhospitalcharge.dto.AdvancePaymentInfoDto;
|
||||
import com.openhis.web.inhospitalcharge.mapper.AdvancePaymentManageAppMapper;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 预交金管理 应用实现类
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AdvancePaymentManageAppServiceImpl implements IAdvancePaymentManageAppService {
|
||||
|
||||
@Resource
|
||||
AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Resource
|
||||
AdvancePaymentManageAppMapper advancePaymentManageAppMapper;
|
||||
|
||||
@Resource
|
||||
IPaymentReconciliationService iPaymentReconciliationService;
|
||||
|
||||
@Resource
|
||||
IPaymentRecDetailService iPaymentRecDetailService;
|
||||
|
||||
@Resource
|
||||
IAccountService iAccountService;
|
||||
|
||||
/**
|
||||
* 查询患者预交金基本信息
|
||||
*
|
||||
* @param advancePaymentInfoDto 患者预交金基本信息dto
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 患者预交金基本信息
|
||||
*/
|
||||
@Override
|
||||
public IPage<AdvancePaymentInfoDto> getAdvancePaymentInfo(AdvancePaymentInfoDto advancePaymentInfoDto,
|
||||
String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<AdvancePaymentInfoDto> queryWrapper = HisQueryUtils.buildQueryWrapper(advancePaymentInfoDto,
|
||||
searchKey, new HashSet<>(Arrays.asList("bus_no", "patient_name", "inHospital_org_name")), request);
|
||||
|
||||
IPage<AdvancePaymentInfoDto> advancePaymentInfo = advancePaymentManageAppMapper.getAdvancePaymentInfo(
|
||||
new Page<>(pageNo, pageSize), PaymentKind.HOSPITAL_DEPOSIT.getValue(), LocationForm.WARD.getValue(),
|
||||
LocationForm.HOUSE.getValue(), LocationForm.BED.getValue(), EncounterLocationStatus.ACTIVE.getValue(),
|
||||
ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), EncounterClass.IMP.getValue(),
|
||||
AccountType.PERSONAL_CASH_ACCOUNT.getCode(), queryWrapper);
|
||||
advancePaymentInfo.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
|
||||
});
|
||||
|
||||
return advancePaymentInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询预交金支付流水记录
|
||||
*
|
||||
* @param encounterId 住院就诊Id
|
||||
* @return 预交金支付流水记录
|
||||
*/
|
||||
@Override
|
||||
public List<AdvancePaymentFlowRecordDto> getAdvancePaymentFlowRecord(Long encounterId) {
|
||||
List<AdvancePaymentFlowRecordDto> advancePaymentFlowRecordList =
|
||||
advancePaymentManageAppMapper.getAdvancePaymentFlowRecordList(encounterId);
|
||||
advancePaymentFlowRecordList.forEach(e ->
|
||||
// 付款类别
|
||||
e.setPaymentEnum_enumText(EnumUtils.getInfoByValue(PaymentType.class, e.getPaymentEnum())));
|
||||
return advancePaymentFlowRecordList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 预交金交款
|
||||
*
|
||||
* @param advancePaymentInAndOutDto 交款dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> inAdvancePayment(AdvancePaymentInAndOutDto advancePaymentInAndOutDto) {
|
||||
this.handleAdvancePayment(advancePaymentInAndOutDto, PaymentType.PAY.getValue());
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"预交金交款"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 预交金退款
|
||||
*
|
||||
* @param advancePaymentInAndOutDto 退款dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> outAdvancePayment(AdvancePaymentInAndOutDto advancePaymentInAndOutDto) {
|
||||
this.handleAdvancePayment(advancePaymentInAndOutDto, PaymentType.UN_PAY.getValue());
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"预交金退款"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 预交金交费/退费
|
||||
*
|
||||
* @param advancePaymentInAndOutDto 预交金dto
|
||||
* @param paymentEnum 类别
|
||||
*/
|
||||
private void handleAdvancePayment(AdvancePaymentInAndOutDto advancePaymentInAndOutDto, Integer paymentEnum) {
|
||||
BigDecimal ammount;
|
||||
// 交费
|
||||
if (PaymentType.PAY.getValue().equals(paymentEnum)) {
|
||||
ammount = advancePaymentInAndOutDto.getAmount();
|
||||
}
|
||||
// 退费
|
||||
else {
|
||||
ammount = advancePaymentInAndOutDto.getAmount().multiply(new BigDecimal("-1"));
|
||||
}
|
||||
// 保存支付信息
|
||||
String paymentNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.PAYMENT_NO.getPrefix(), 20); // 生成流水号
|
||||
Date setlTime = new Date();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(setlTime);
|
||||
calendar.add(Calendar.HOUR_OF_DAY, 24);
|
||||
Date futureTime = calendar.getTime();
|
||||
|
||||
// 支付管理主表
|
||||
PaymentReconciliation payment = new PaymentReconciliation();
|
||||
payment.setStatusEnum(PaymentStatus.SUCCESS.getValue()); // 状态
|
||||
payment.setPaymentNo(paymentNo); // 支付的业务标识符
|
||||
payment.setPaymentEnum(paymentEnum); // 付款类别
|
||||
payment.setPaymentReconciliationId(advancePaymentInAndOutDto.getPatientId()); // 付款实体ID
|
||||
payment.setKindEnum(PaymentKind.HOSPITAL_DEPOSIT.getValue()); // 发起支付的工作流程类别-住院存款
|
||||
payment.setEntererId(SecurityUtils.getLoginUser().getPractitionerId()); // 收款员
|
||||
payment.setPatientId(advancePaymentInAndOutDto.getPatientId()); // 患者ID
|
||||
payment.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId()); // 请求支付责任人ID
|
||||
payment.setOutcomeEnum(PaymentOutcome.PARTIAL.getCode()); // 付款结果
|
||||
payment.setLocationId(-99L); // 支付位置
|
||||
payment.setExpirationDate(futureTime); // 到期时间
|
||||
payment.setTenderedAmount(ammount); // 应收金额
|
||||
payment.setDisplayAmount(ammount); // 付款总额
|
||||
payment.setPrintCount(0); // 打印标识
|
||||
payment.setEncounterId(advancePaymentInAndOutDto.getEncounterId()); // 住院就诊id
|
||||
payment.setBillDate(setlTime); // 结算时间
|
||||
iPaymentReconciliationService.save(payment);
|
||||
|
||||
// 支付管理子表
|
||||
PaymentRecDetail paymentDetail = new PaymentRecDetail();
|
||||
paymentDetail.setAccountId(advancePaymentInAndOutDto.getAccountId()); // 账户
|
||||
paymentDetail.setPayEnum(YbPayment.SELF_CASH_PAY.getValue()); // 支付类型
|
||||
paymentDetail.setPayLevelEnum(YbPayment.SELF_CASH_PAY.getLevel()); // 支付类型等级
|
||||
paymentDetail.setAmount(ammount); // 金额
|
||||
paymentDetail.setPayTransNo(CommonConstants.BusinessName.DEFAULT_CONTRACT_NO);
|
||||
paymentDetail.setReconciliationId(payment.getId()); // 付款id
|
||||
|
||||
iPaymentRecDetailService.save(paymentDetail);
|
||||
|
||||
// 更新个人现金账户的预交金
|
||||
Account account =
|
||||
iAccountService.lambdaQuery().eq(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode())
|
||||
.eq(Account::getEncounterId, advancePaymentInAndOutDto.getEncounterId())
|
||||
.select(Account::getId, Account::getBalanceAmount).one();
|
||||
if (account == null) {
|
||||
throw new RuntimeException("未找到对应的个人现金账户信息");
|
||||
}
|
||||
BigDecimal currentBalance = account.getBalanceAmount() != null ? account.getBalanceAmount() : BigDecimal.ZERO;
|
||||
BigDecimal newBalance = currentBalance.add(ammount);
|
||||
iAccountService.lambdaUpdate().set(Account::getBalanceAmount, newBalance).eq(Account::getId, account.getId())
|
||||
.update();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,453 @@
|
||||
package com.openhis.web.inhospitalcharge.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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.*;
|
||||
import com.openhis.administration.domain.*;
|
||||
import com.openhis.administration.service.*;
|
||||
import com.openhis.clinical.domain.Condition;
|
||||
import com.openhis.clinical.service.IConditionService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.enums.ybenums.YbIptDiseTypeCode;
|
||||
import com.openhis.common.enums.ybenums.YbPayment;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.financial.domain.PaymentRecDetail;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.service.IPaymentRecDetailService;
|
||||
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||
import com.openhis.web.inhospitalcharge.appservice.IInHospitalRegisterAppService;
|
||||
import com.openhis.web.inhospitalcharge.dto.*;
|
||||
import com.openhis.web.inhospitalcharge.mapper.InHospitalRegisterAppMapper;
|
||||
import com.openhis.web.patientmanage.appservice.IPatientInformationService;
|
||||
import com.openhis.web.patientmanage.dto.PatientInformationDto;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 住院登记 应用实现类
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class InHospitalRegisterAppServiceImpl implements IInHospitalRegisterAppService {
|
||||
|
||||
@Resource
|
||||
AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Resource
|
||||
InHospitalRegisterAppMapper inHospitalRegisterAppMapper;
|
||||
|
||||
@Resource
|
||||
IEncounterService iEncounterService;
|
||||
|
||||
@Resource
|
||||
IEncounterParticipantService iEncounterParticipantService;
|
||||
|
||||
@Resource
|
||||
IConditionService iConditionService;
|
||||
|
||||
@Resource
|
||||
IEncounterDiagnosisService iEncounterDiagnosisService;
|
||||
|
||||
@Resource
|
||||
IEncounterLocationService iEncounterLocationService;
|
||||
|
||||
@Resource
|
||||
IAccountService iAccountService;
|
||||
|
||||
@Resource
|
||||
IPatientInformationService patientInformationService;
|
||||
|
||||
@Resource
|
||||
IPaymentReconciliationService iPaymentReconciliationService;
|
||||
|
||||
@Resource
|
||||
IPaymentRecDetailService iPaymentRecDetailService;
|
||||
|
||||
@Resource
|
||||
IPatientService iPatientService;
|
||||
|
||||
/**
|
||||
* 门诊医生开住院申请
|
||||
*
|
||||
* @param inHospitalRegisterDto 住院登记参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> registerByDoctor(InHospitalRegisterDto inHospitalRegisterDto) {
|
||||
// 当前账号的参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 患者id
|
||||
Long patientId = inHospitalRegisterDto.getPatientId();
|
||||
// 门诊就诊id
|
||||
Long ambEncounterId = inHospitalRegisterDto.getAmbEncounterId();
|
||||
// 获取执行科室
|
||||
LambdaQueryWrapper<Encounter> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Encounter::getAmbEncounterId, ambEncounterId);
|
||||
if (iEncounterService.list(queryWrapper).size() > 0) {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
|
||||
// 住院encounter
|
||||
Encounter zYEncounter = new Encounter();
|
||||
zYEncounter.setPatientId(patientId); // 患者id
|
||||
zYEncounter.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.ADMISSION_NUM.getPrefix(), 4));// 住院编号
|
||||
zYEncounter.setPriorityEnum(inHospitalRegisterDto.getPriorityEnum()); // 优先级
|
||||
zYEncounter.setStatusEnum(EncounterZyStatus.TO_BE_REGISTERED.getValue()); // 状态为待登记
|
||||
zYEncounter.setClassEnum(EncounterClass.IMP.getValue()); // 类别为住院
|
||||
zYEncounter.setYbClassEnum(inHospitalRegisterDto.getYbClassEnum()); // 医保类别
|
||||
zYEncounter.setOrganizationId(inHospitalRegisterDto.getInHospitalOrgId()); // 住院科室id
|
||||
zYEncounter.setAmbEncounterId(ambEncounterId); // 门诊就诊id
|
||||
iEncounterService.save(zYEncounter);
|
||||
Long zYEncounterId = zYEncounter.getId();// 住院就诊id
|
||||
|
||||
// 住院encounter的参与者
|
||||
EncounterParticipant zYEncounterParticipant = new EncounterParticipant();
|
||||
zYEncounterParticipant.setEncounterId(zYEncounterId); // 住院就诊id
|
||||
zYEncounterParticipant.setTypeCode(ParticipantType.ADMITTER.getCode()); // 接诊医生
|
||||
zYEncounterParticipant.setPractitionerId(practitionerId); // 参与者id
|
||||
iEncounterParticipantService.save(zYEncounterParticipant);
|
||||
|
||||
// 住院诊断
|
||||
Condition zYCondition = new Condition();
|
||||
zYCondition.setVerificationStatusEnum(ConditionVerificationStatus.CONFIRMED.getValue()); // 验证状态
|
||||
zYCondition.setPatientId(patientId); // 患者id
|
||||
zYCondition.setDefinitionId(inHospitalRegisterDto.getDiagnosisDefinitionId()); // 诊断定义Id
|
||||
zYCondition.setYbNo(inHospitalRegisterDto.getDiagnosisYbNo()); // 诊断对应的医保编码
|
||||
zYCondition.setRecordedDatetime(new Date()); // 记录时间
|
||||
zYCondition.setRecorderId(SecurityUtils.getLoginUser().getPractitionerId());// 记录人
|
||||
iConditionService.save(zYCondition);
|
||||
Long conditionId = zYCondition.getId();// 诊断id
|
||||
|
||||
EncounterDiagnosis zYEncounterDiagnosis = new EncounterDiagnosis();
|
||||
zYEncounterDiagnosis.setEncounterId(zYEncounterId); // 住院就诊id
|
||||
zYEncounterDiagnosis.setConditionId(conditionId); // 诊断id
|
||||
zYEncounterDiagnosis.setMaindiseFlag(Whether.YES.getValue()); // 主诊断
|
||||
zYEncounterDiagnosis.setMedTypeCode(inHospitalRegisterDto.getMedTypeCode());// 医疗类型
|
||||
zYEncounterDiagnosis.setDiagnosisDesc(inHospitalRegisterDto.getDiagnosisDesc()); // 诊断描述
|
||||
zYEncounterDiagnosis.setIptDiseTypeCode(YbIptDiseTypeCode.ADMISSION_DIAGNOSIS.getValue()); // 住院患者疾病诊断类型代码
|
||||
iEncounterDiagnosisService.save(zYEncounterDiagnosis);
|
||||
|
||||
// 病区
|
||||
if (inHospitalRegisterDto.getWardLocationId() != null) {
|
||||
EncounterLocation zYEncounterLocation = new EncounterLocation();
|
||||
zYEncounterLocation.setEncounterId(zYEncounterId); // 住院就诊id
|
||||
zYEncounterLocation.setLocationId(inHospitalRegisterDto.getWardLocationId()); // 病区id
|
||||
zYEncounterLocation.setFormEnum(LocationForm.WARD.getValue()); // 物理形式枚举
|
||||
iEncounterLocationService.save(zYEncounterLocation);
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"住院申请"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询住院登记信息
|
||||
*
|
||||
* @param inHospitalRegisterQueryDto 查询dto
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param registeredFlag 已登记标识,已登记传 1 ,待登记传 0
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 住院登记信息
|
||||
*/
|
||||
@Override
|
||||
public IPage<InHospitalRegisterQueryDto> getRegisterInfo(InHospitalRegisterQueryDto inHospitalRegisterQueryDto,
|
||||
String searchKey, String registeredFlag, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
Integer encounterStatus = EncounterZyStatus.TO_BE_REGISTERED.getValue(); // 待登记
|
||||
// 构建查询条件
|
||||
QueryWrapper<InHospitalRegisterQueryDto> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(inHospitalRegisterQueryDto, searchKey,
|
||||
new HashSet<>(Arrays.asList("registrar", "source_name", "patient_name")), request);
|
||||
|
||||
IPage<InHospitalRegisterQueryDto> inHospitalRegisterInfo = inHospitalRegisterAppMapper
|
||||
.getInHospitalRegisterInfo(new Page<>(pageNo, pageSize), EncounterClass.IMP.getValue(), encounterStatus,
|
||||
registeredFlag, LocationForm.WARD.getValue(), queryWrapper);
|
||||
inHospitalRegisterInfo.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
|
||||
});
|
||||
|
||||
return inHospitalRegisterInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询患者基本信息
|
||||
*
|
||||
* @param patientId 患者ID
|
||||
* @return 患者基本信息
|
||||
*/
|
||||
@Override
|
||||
public InHospitalPatientInfoDto getPatientInfo(Long patientId) {
|
||||
InHospitalPatientInfoDto patientInfo = inHospitalRegisterAppMapper.getPatientInfo(patientId);
|
||||
// 性别
|
||||
patientInfo
|
||||
.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, patientInfo.getGenderEnum()));
|
||||
// 计算年龄
|
||||
patientInfo
|
||||
.setAge(patientInfo.getBirthDate() != null ? AgeCalculatorUtil.getAge(patientInfo.getBirthDate()) : "");
|
||||
// 婚姻状态
|
||||
patientInfo.setMaritalStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(MaritalStatus.class, patientInfo.getMaritalStatusEnum()));
|
||||
// 职业
|
||||
patientInfo.setPrfsEnum_enumText(EnumUtils.getInfoByValue(OccupationType.class, patientInfo.getPrfsEnum()));
|
||||
return patientInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询住院就诊信息
|
||||
*
|
||||
* @param encounterId 住院就诊id
|
||||
* @return 住院就诊信息
|
||||
*/
|
||||
@Override
|
||||
public InHospitalInfoDto getInHospitalInfo(Long encounterId) {
|
||||
InHospitalInfoDto inHospitalInfo = inHospitalRegisterAppMapper.getInHospitalInfo(encounterId,
|
||||
LocationForm.WARD.getValue(), Whether.YES.getValue(), ParticipantType.ADMITTER.getCode(),
|
||||
AccountType.PERSONAL_CASH_ACCOUNT.getCode());
|
||||
// 优先级(患者病情)
|
||||
inHospitalInfo
|
||||
.setPriorityEnum_enumText(EnumUtils.getInfoByValue(PriorityLevel.class, inHospitalInfo.getPriorityEnum()));
|
||||
// 病区号
|
||||
String wardBusNo = inHospitalInfo.getWardBusNo();
|
||||
if (!StringUtils.isEmpty(wardBusNo)) {
|
||||
// 计算床位数
|
||||
Integer totalBedsNum = inHospitalRegisterAppMapper.getTotalBedsNum(LocationForm.BED.getValue(),
|
||||
LocationStatus.INACTIVE.getValue(), wardBusNo);
|
||||
inHospitalInfo.setTotalBedsNum(totalBedsNum); // 当前病区总床位数
|
||||
Integer idleBedsNum = inHospitalRegisterAppMapper.getIdleBedsNum(LocationForm.BED.getValue(),
|
||||
LocationStatus.IDLE.getValue(), wardBusNo);
|
||||
inHospitalInfo.setIdleBedsNum(idleBedsNum); // 当前病区空闲床位数
|
||||
}
|
||||
return inHospitalInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据病区号查询床位数
|
||||
*
|
||||
* @param wardBusNo 病区号
|
||||
* @return 床位数
|
||||
*/
|
||||
@Override
|
||||
public HashMap<String, Integer> getBedsNumByWardBusNo(String wardBusNo) {
|
||||
HashMap<String, Integer> resMap = new HashMap<>();
|
||||
// 当前病区总床位数
|
||||
Integer totalBedsNum = inHospitalRegisterAppMapper.getTotalBedsNum(LocationForm.BED.getValue(),
|
||||
LocationStatus.INACTIVE.getValue(), wardBusNo);
|
||||
// // 当前病区空闲床位数
|
||||
Integer idleBedsNum = inHospitalRegisterAppMapper.getIdleBedsNum(LocationForm.BED.getValue(),
|
||||
LocationStatus.IDLE.getValue(), wardBusNo);
|
||||
resMap.put("totalBedsNum", totalBedsNum);
|
||||
resMap.put("idleBedsNum", idleBedsNum);
|
||||
return resMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新患者信息
|
||||
*
|
||||
* @param patientUpdateDto 更新患者信息dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> updatePatient(PatientUpdateDto patientUpdateDto) {
|
||||
Patient patient = new Patient();
|
||||
patient.setId(patientUpdateDto.getPatientId());
|
||||
patient.setName(patientUpdateDto.getName()); // 患者姓名
|
||||
patient.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(patientUpdateDto.getName())); // 拼音码
|
||||
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patientUpdateDto.getName())); // 五笔码
|
||||
patient.setGenderEnum(patientUpdateDto.getGenderEnum()); // 性别编码
|
||||
patient.setBirthDate(patientUpdateDto.getBirthDate()); // 生日
|
||||
patient.setPhone(patientUpdateDto.getPhone()); // 电话
|
||||
patient.setIdCard(patientUpdateDto.getIdCard()); // 身份证号
|
||||
|
||||
iPatientService.saveOrUpdate(patient);
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"患者信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 款台登记(门诊入口)
|
||||
*
|
||||
* @param inHospitalInfoDto 登记dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> registerByCashier(InHospitalInfoDto inHospitalInfoDto) {
|
||||
this.handleRegister(inHospitalInfoDto, null); // 处理入院登记信息
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"住院登记"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 无档登记
|
||||
*
|
||||
* @param noFilesRegisterDto 无档登记dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> noFilesRegister(NoFilesRegisterDto noFilesRegisterDto) {
|
||||
// 患者信息
|
||||
PatientInformationDto patientInformation = noFilesRegisterDto.getPatientInformation();
|
||||
// 新增患者
|
||||
R<?> r = patientInformationService.addPatient(patientInformation);
|
||||
if (r.getCode() == 200) {
|
||||
Patient patient = (Patient)r.getData();
|
||||
// 住院信息
|
||||
InHospitalInfoDto inHospitalInfoDto = noFilesRegisterDto.getInHospitalInfo();
|
||||
this.handleRegister(inHospitalInfoDto, patient); // 处理入院登记信息
|
||||
} else {
|
||||
R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"无档登记"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理入院登记信息
|
||||
*
|
||||
* @param inHospitalInfoDto 住院信息dto
|
||||
* @param patient 患者信息
|
||||
*/
|
||||
private void handleRegister(InHospitalInfoDto inHospitalInfoDto, Patient patient) {
|
||||
// 住院就诊id
|
||||
Long encounterId = inHospitalInfoDto.getEncounterId();
|
||||
|
||||
// 处理住院就诊信息
|
||||
Encounter encounterReg = new Encounter();
|
||||
encounterReg.setId(encounterId);
|
||||
if (encounterId == null) {
|
||||
encounterReg.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.ADMISSION_NUM.getPrefix(), 4));// 住院编号
|
||||
encounterReg.setPatientId(patient.getId()); // 患者ID
|
||||
encounterReg.setStatusEnum(EncounterZyStatus.REGISTERED.getValue()); // 状态已登记
|
||||
encounterReg.setClassEnum(EncounterClass.IMP.getValue()); // 类别为住院
|
||||
encounterReg.setYbClassEnum(inHospitalInfoDto.getYbClassEnum()); // 医保类别
|
||||
}
|
||||
encounterReg.setStatusEnum(EncounterZyStatus.REGISTERED.getValue()); // 已登记
|
||||
encounterReg.setOrganizationId(inHospitalInfoDto.getInHospitalOrgId());// 住院科室id
|
||||
encounterReg.setPriorityEnum(inHospitalInfoDto.getPriorityEnum()); // 优先级(患者病情)
|
||||
encounterReg.setAdmitSourceCode(inHospitalInfoDto.getAdmitSourceCode()); // 入院类型
|
||||
encounterReg.setInWayCode(inHospitalInfoDto.getInWayCode()); // 入院方式
|
||||
encounterReg.setStartTime(inHospitalInfoDto.getStartTime()); // 入院日期
|
||||
encounterReg.setRegistrarId(SecurityUtils.getLoginUser().getPractitionerId()); // 登记员id
|
||||
iEncounterService.saveOrUpdate(encounterReg);
|
||||
|
||||
// 先查询当前就诊是否已经分配了病区
|
||||
EncounterLocation encounterLocation = iEncounterLocationService.getOne(
|
||||
new LambdaQueryWrapper<EncounterLocation>().eq(EncounterLocation::getEncounterId, encounterReg.getId())
|
||||
.eq(EncounterLocation::getFormEnum, LocationForm.WARD.getValue()));
|
||||
// 处理病区信息
|
||||
EncounterLocation encounterLocationReg = new EncounterLocation();
|
||||
if (encounterLocation != null) {
|
||||
encounterLocationReg.setId(encounterLocation.getId());
|
||||
}
|
||||
encounterLocationReg.setEncounterId(encounterReg.getId()); // 住院就诊id
|
||||
encounterLocationReg.setLocationId(inHospitalInfoDto.getWardLocationId()); // 病区id
|
||||
encounterLocationReg.setFormEnum(LocationForm.WARD.getValue()); // 物理形式枚举
|
||||
iEncounterLocationService.saveOrUpdate(encounterLocationReg);
|
||||
|
||||
// 处理账号预交金信息
|
||||
String contractNo = inHospitalInfoDto.getContractNo();
|
||||
// 自费标识
|
||||
boolean selfFundedFlag = CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(contractNo);
|
||||
// 生成个人现金账户的account记录用于存储预交金
|
||||
Account accountPersonalCash = new Account();
|
||||
accountPersonalCash.setTypeCode(AccountType.PERSONAL_CASH_ACCOUNT.getCode()); // 账户类型
|
||||
accountPersonalCash.setPatientId(
|
||||
inHospitalInfoDto.getPatientId() != null ? inHospitalInfoDto.getPatientId() : patient.getId()); // 患者id
|
||||
accountPersonalCash.setEncounterId(encounterReg.getId()); // 住院就诊id
|
||||
accountPersonalCash.setBalanceAmount(inHospitalInfoDto.getBalanceAmount()); // 账户余额
|
||||
// 自费
|
||||
if (selfFundedFlag) {
|
||||
accountPersonalCash.setEncounterFlag(Whether.YES.getValue());
|
||||
} else {
|
||||
// 生成非自费的账号
|
||||
Account accountNoSelfFunded = new Account();
|
||||
accountNoSelfFunded.setTypeCode(inHospitalInfoDto.getTypeCoce()); // 账户类型
|
||||
accountNoSelfFunded.setPatientId(
|
||||
inHospitalInfoDto.getPatientId() != null ? inHospitalInfoDto.getPatientId() : patient.getId()); // 患者id
|
||||
accountNoSelfFunded.setEncounterId(encounterReg.getId()); // 住院就诊id
|
||||
accountNoSelfFunded.setContractNo(contractNo); // 合同编码
|
||||
accountNoSelfFunded.setEncounterFlag(Whether.YES.getValue());
|
||||
iAccountService.save(accountNoSelfFunded);
|
||||
|
||||
accountPersonalCash.setEncounterFlag(Whether.NO.getValue());
|
||||
}
|
||||
iAccountService.save(accountPersonalCash);
|
||||
|
||||
// 保存支付信息
|
||||
String paymentNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.PAYMENT_NO.getPrefix(), 20); // 生成流水号
|
||||
Date setlTime = new Date();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(setlTime);
|
||||
calendar.add(Calendar.HOUR_OF_DAY, 24);
|
||||
Date futureTime = calendar.getTime();
|
||||
|
||||
// 支付管理主表
|
||||
PaymentReconciliation payment = new PaymentReconciliation();
|
||||
payment.setStatusEnum(PaymentStatus.SUCCESS.getValue()); // 状态
|
||||
payment.setPaymentNo(paymentNo); // 支付的业务标识符
|
||||
payment.setPaymentEnum(PaymentType.PAY.getValue()); // 付款类别
|
||||
payment.setPaymentReconciliationId(accountPersonalCash.getPatientId()); // 付款实体ID
|
||||
payment.setKindEnum(PaymentKind.HOSPITAL_DEPOSIT.getValue()); // 发起支付的工作流程类别-住院存款
|
||||
payment.setEntererId(SecurityUtils.getLoginUser().getPractitionerId()); // 收款员
|
||||
payment.setPatientId(accountPersonalCash.getPatientId()); // 患者ID
|
||||
payment.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId()); // 请求支付责任人ID
|
||||
payment.setOutcomeEnum(PaymentOutcome.PARTIAL.getCode()); // 付款结果
|
||||
payment.setLocationId(-99L); // 支付位置
|
||||
payment.setExpirationDate(futureTime); // 到期时间
|
||||
payment.setTenderedAmount(inHospitalInfoDto.getBalanceAmount()); // 应收金额
|
||||
payment.setDisplayAmount(inHospitalInfoDto.getBalanceAmount()); // 付款总额
|
||||
payment.setPrintCount(0); // 打印标识
|
||||
payment.setEncounterId(encounterReg.getId()); // 住院就诊id
|
||||
payment.setBillDate(setlTime); // 结算时间
|
||||
iPaymentReconciliationService.save(payment);
|
||||
|
||||
// 支付管理子表
|
||||
PaymentRecDetail paymentDetail = new PaymentRecDetail();
|
||||
paymentDetail.setAccountId(accountPersonalCash.getId()); // 账户
|
||||
paymentDetail.setPayEnum(YbPayment.SELF_CASH_PAY.getValue()); // 支付类型
|
||||
paymentDetail.setPayLevelEnum(YbPayment.SELF_CASH_PAY.getLevel()); // 支付类型等级
|
||||
paymentDetail.setAmount(inHospitalInfoDto.getBalanceAmount()); // 金额
|
||||
paymentDetail.setPayTransNo(CommonConstants.BusinessName.DEFAULT_CONTRACT_NO);
|
||||
paymentDetail.setReconciliationId(payment.getId()); // 付款id
|
||||
|
||||
iPaymentRecDetailService.save(paymentDetail);
|
||||
|
||||
// 处理住院诊断(无档登记场景)
|
||||
if (patient != null && inHospitalInfoDto.getDiagnosisDefinitionId() != null) {
|
||||
// 住院诊断
|
||||
Condition zYCondition = new Condition();
|
||||
zYCondition.setVerificationStatusEnum(ConditionVerificationStatus.CONFIRMED.getValue()); // 验证状态
|
||||
zYCondition.setPatientId(patient.getId()); // 患者id
|
||||
zYCondition.setDefinitionId(inHospitalInfoDto.getDiagnosisDefinitionId()); // 诊断定义Id
|
||||
zYCondition.setYbNo(inHospitalInfoDto.getDiagnosisYbNo()); // 诊断对应的医保编码
|
||||
zYCondition.setRecordedDatetime(new Date()); // 记录时间
|
||||
zYCondition.setRecorderId(SecurityUtils.getLoginUser().getPractitionerId());// 记录人
|
||||
iConditionService.save(zYCondition);
|
||||
Long conditionId = zYCondition.getId();// 诊断id
|
||||
|
||||
EncounterDiagnosis zYEncounterDiagnosis = new EncounterDiagnosis();
|
||||
zYEncounterDiagnosis.setEncounterId(encounterReg.getId()); // 住院就诊id
|
||||
zYEncounterDiagnosis.setConditionId(conditionId); // 诊断id
|
||||
zYEncounterDiagnosis.setMaindiseFlag(Whether.YES.getValue()); // 主诊断
|
||||
zYEncounterDiagnosis.setMedTypeCode(inHospitalInfoDto.getMedTypeCode());// 医疗类型
|
||||
zYEncounterDiagnosis.setDiagnosisDesc(inHospitalInfoDto.getDiagnosisDesc()); // 诊断描述
|
||||
zYEncounterDiagnosis.setIptDiseTypeCode(YbIptDiseTypeCode.ADMISSION_DIAGNOSIS.getValue()); // 住院患者疾病诊断类型代码
|
||||
iEncounterDiagnosisService.save(zYEncounterDiagnosis);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalcharge.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalcharge.appservice.IAdvancePaymentManageAppService;
|
||||
import com.openhis.web.inhospitalcharge.dto.AdvancePaymentInAndOutDto;
|
||||
import com.openhis.web.inhospitalcharge.dto.AdvancePaymentInfoDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 预交金管理 controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inhospital-charge/advance-payment")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class AdvancePaymentManageController {
|
||||
|
||||
private final IAdvancePaymentManageAppService iAdvancePaymentManageAppService;
|
||||
|
||||
/**
|
||||
* 查询患者预交金基本信息
|
||||
*
|
||||
* @param advancePaymentInfoDto 患者预交金基本信息dto
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 患者预交金基本信息
|
||||
*/
|
||||
@GetMapping(value = "/advance-payment-info")
|
||||
public R<?> getAdvancePaymentInfo(AdvancePaymentInfoDto advancePaymentInfoDto,
|
||||
@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(iAdvancePaymentManageAppService.getAdvancePaymentInfo(advancePaymentInfoDto, searchKey, pageNo,
|
||||
pageSize, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询预交金支付流水记录
|
||||
*
|
||||
* @param encounterId 住院就诊Id
|
||||
* @return 预交金支付流水记录
|
||||
*/
|
||||
@GetMapping(value = "/advance-payment-flow")
|
||||
public R<?> getAdvancePaymentFlowRecord(@RequestParam Long encounterId) {
|
||||
return R.ok(iAdvancePaymentManageAppService.getAdvancePaymentFlowRecord(encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 预交金交款
|
||||
*
|
||||
* @param advancePaymentInAndOutDto 交款dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/in-advance-payment")
|
||||
public R<?> inAdvancePayment(@RequestBody AdvancePaymentInAndOutDto advancePaymentInAndOutDto) {
|
||||
return iAdvancePaymentManageAppService.inAdvancePayment(advancePaymentInAndOutDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预交金退款
|
||||
*
|
||||
* @param advancePaymentInAndOutDto 退款dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/out-advance-payment")
|
||||
public R<?> outAdvancePayment(@RequestBody AdvancePaymentInAndOutDto advancePaymentInAndOutDto) {
|
||||
return iAdvancePaymentManageAppService.outAdvancePayment(advancePaymentInAndOutDto);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalcharge.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.inhospitalcharge.dto.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalcharge.appservice.IInHospitalRegisterAppService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 住院登记 controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inhospital-charge/register")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class InHospitalRegisterController {
|
||||
|
||||
private final IInHospitalRegisterAppService iInHospitalRegisterAppService;
|
||||
|
||||
/**
|
||||
* 门诊医生开住院申请
|
||||
*
|
||||
* @param inHospitalRegisterDto 住院登记参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/by-doctor")
|
||||
public R<?> registerByDoctor(@RequestBody InHospitalRegisterDto inHospitalRegisterDto) {
|
||||
return iInHospitalRegisterAppService.registerByDoctor(inHospitalRegisterDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询住院登记信息
|
||||
*
|
||||
* @param inHospitalRegisterQueryDto 查询dto
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param registeredFlag 已登记标识,已登记传 1 ,待登记传 0
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 住院登记信息
|
||||
*/
|
||||
@GetMapping(value = "/register-info")
|
||||
public R<?> getRegisterInfo(InHospitalRegisterQueryDto inHospitalRegisterQueryDto,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "registeredFlag") String registeredFlag,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return R.ok(iInHospitalRegisterAppService.getRegisterInfo(inHospitalRegisterQueryDto, searchKey, registeredFlag,
|
||||
pageNo, pageSize, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询患者基本信息
|
||||
*
|
||||
* @param patientId 患者ID
|
||||
* @return 患者基本信息
|
||||
*/
|
||||
@GetMapping(value = "/patient-info")
|
||||
public R<?> getPatientInfo(@RequestParam Long patientId) {
|
||||
return R.ok(iInHospitalRegisterAppService.getPatientInfo(patientId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询住院就诊信息
|
||||
*
|
||||
* @param encounterId 住院就诊id
|
||||
* @return 住院就诊信息
|
||||
*/
|
||||
@GetMapping(value = "/in-hospital-info")
|
||||
public R<?> getInHospitalInfo(@RequestParam Long encounterId) {
|
||||
return R.ok(iInHospitalRegisterAppService.getInHospitalInfo(encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据病区号查询床位数
|
||||
*
|
||||
* @param wardBusNo 病区号
|
||||
* @return 床位数
|
||||
*/
|
||||
@GetMapping(value = "/beds-num")
|
||||
public R<?> getBedsNumByWardBusNo(@RequestParam String wardBusNo) {
|
||||
return R.ok(iInHospitalRegisterAppService.getBedsNumByWardBusNo(wardBusNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新患者信息
|
||||
*
|
||||
* @param patientUpdateDto 更新患者信息dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/update-patient")
|
||||
public R<?> updatePatient(@RequestBody PatientUpdateDto patientUpdateDto) {
|
||||
return iInHospitalRegisterAppService.updatePatient(patientUpdateDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 款台登记
|
||||
*
|
||||
* @param inHospitalInfoDto 登记dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/by-cashier")
|
||||
public R<?> registerByCashier(@RequestBody InHospitalInfoDto inHospitalInfoDto) {
|
||||
return iInHospitalRegisterAppService.registerByCashier(inHospitalInfoDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 无档登记
|
||||
*
|
||||
* @param noFilesRegisterDto 无档登记dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/no-files")
|
||||
public R<?> noFilesRegister(@RequestBody NoFilesRegisterDto noFilesRegisterDto) {
|
||||
return iInHospitalRegisterAppService.noFilesRegister(noFilesRegisterDto);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.openhis.web.inhospitalcharge.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 预交金支付流水记录 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdvancePaymentFlowRecordDto {
|
||||
|
||||
/**
|
||||
* 流水号
|
||||
*/
|
||||
private String paymentNo;
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal tenderedAmount;
|
||||
|
||||
/** 付款类别 */
|
||||
private Integer paymentEnum;
|
||||
private String paymentEnum_enumText;
|
||||
|
||||
/** 操作时间 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date operateTime;
|
||||
|
||||
/**
|
||||
* 收款人
|
||||
*/
|
||||
private String enterer;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.openhis.web.inhospitalcharge.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 预交金进出 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdvancePaymentInAndOutDto {
|
||||
|
||||
/**
|
||||
* 住院就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.openhis.web.inhospitalcharge.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 lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 预交金信息 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdvancePaymentInfoDto {
|
||||
|
||||
/**
|
||||
* 住院就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 患者
|
||||
*/
|
||||
private String patientName;
|
||||
|
||||
/**
|
||||
* 性别编码
|
||||
*/
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
|
||||
/**
|
||||
* 病区
|
||||
*/
|
||||
private String wardName;
|
||||
|
||||
/**
|
||||
* 病房
|
||||
*/
|
||||
private String houseName;
|
||||
|
||||
/**
|
||||
* 床位
|
||||
*/
|
||||
private String bedName;
|
||||
|
||||
/**
|
||||
* 住院科室
|
||||
*/
|
||||
private String inHospitalOrgName;
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 总额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package com.openhis.web.inhospitalcharge.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
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InHospitalInfoDto {
|
||||
|
||||
/** 患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 住院就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 类别医保编码
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/**
|
||||
* 住院次数
|
||||
*/
|
||||
private Integer inHospitalCount;
|
||||
|
||||
/**
|
||||
* 住院科室id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long inHospitalOrgId;
|
||||
|
||||
/**
|
||||
* 住院科室
|
||||
*/
|
||||
private String inHospitalOrgName;
|
||||
|
||||
/**
|
||||
* 病区id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long wardLocationId;
|
||||
|
||||
/**
|
||||
* 病区
|
||||
*/
|
||||
private String wardName;
|
||||
|
||||
/**
|
||||
* 病区号
|
||||
*/
|
||||
private String wardBusNo;
|
||||
|
||||
/**
|
||||
* 当前病区总床位数
|
||||
*/
|
||||
private Integer totalBedsNum;
|
||||
|
||||
/**
|
||||
* 当前病区空闲床位数
|
||||
*/
|
||||
private Integer idleBedsNum;
|
||||
|
||||
/**
|
||||
* 门诊就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long ambEncounterId;
|
||||
|
||||
/**
|
||||
* 门诊医生id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long ambDoctorPractitionerId;
|
||||
|
||||
/**
|
||||
* 门诊医生
|
||||
*/
|
||||
private String ambDoctorPractitionerName;
|
||||
|
||||
/**
|
||||
* 门诊诊断名称
|
||||
*/
|
||||
private String ambDiagnosisName;
|
||||
|
||||
/** 优先级(患者病情) */
|
||||
private Integer priorityEnum;
|
||||
private String priorityEnum_enumText;
|
||||
|
||||
/**
|
||||
* 入院类型
|
||||
*/
|
||||
@Dict(dictCode = "admit_source_code")
|
||||
private String admitSourceCode;
|
||||
private String admitSourceCode_dictText;
|
||||
|
||||
/**
|
||||
* 入院方式
|
||||
*/
|
||||
@Dict(dictCode = "in_way_code")
|
||||
private String inWayCode;
|
||||
private String inWayCode_dictText;
|
||||
|
||||
/** 入院日期 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 费用性质(合同编码)
|
||||
*/
|
||||
private String contractNo;
|
||||
|
||||
/**
|
||||
* 账户类型编码
|
||||
*/
|
||||
private String typeCoce;
|
||||
|
||||
/** 账户余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/**
|
||||
* 诊断定义id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long diagnosisDefinitionId;
|
||||
|
||||
/**
|
||||
* 诊断对应的医保编码
|
||||
*/
|
||||
private String diagnosisYbNo;
|
||||
|
||||
/** 诊断的医疗类型 */
|
||||
private String medTypeCode;
|
||||
|
||||
/**
|
||||
* 诊断描述
|
||||
*/
|
||||
private String diagnosisDesc;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.openhis.web.inhospitalcharge.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 住院患者信息 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InHospitalPatientInfoDto {
|
||||
|
||||
/** 患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 患者编码
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/**
|
||||
* 患者
|
||||
*/
|
||||
private String patientName;
|
||||
|
||||
/** 证件号 */
|
||||
private String idCard;
|
||||
|
||||
/** 出生日期 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
|
||||
/**
|
||||
* 性别编码
|
||||
*/
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 民族 */
|
||||
@Dict(dictCode = "nationality_code")
|
||||
private String nationalityCode;
|
||||
private String nationalityCode_dictText;
|
||||
|
||||
/** 国家编码 */
|
||||
private String countryCode;
|
||||
|
||||
/** 婚姻状态 */
|
||||
private Integer maritalStatusEnum;
|
||||
private String maritalStatusEnum_enumText;
|
||||
|
||||
/** 职业编码 */
|
||||
private Integer prfsEnum;
|
||||
private String prfsEnum_enumText;
|
||||
|
||||
/** 电话 */
|
||||
private String phone;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
/** 籍贯 */
|
||||
private String nativePlace;
|
||||
|
||||
/** 工作单位 */
|
||||
private String workCompany;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.openhis.web.inhospitalcharge.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 住院登记基础 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InHospitalRegisterDto {
|
||||
|
||||
/**
|
||||
* 住院就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 门诊就诊id | 门诊挂号转办理入院时使用
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long ambEncounterId;
|
||||
|
||||
/** 优先级 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
/**
|
||||
* 类别医保编码
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/**
|
||||
* 诊断定义id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long diagnosisDefinitionId;
|
||||
|
||||
/**
|
||||
* 住院科室id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long inHospitalOrgId;
|
||||
|
||||
/**
|
||||
* 诊断对应的医保编码
|
||||
*/
|
||||
private String diagnosisYbNo;
|
||||
|
||||
/** 诊断的医疗类型 */
|
||||
private String medTypeCode;
|
||||
|
||||
/**
|
||||
* 诊断描述
|
||||
*/
|
||||
private String diagnosisDesc;
|
||||
|
||||
/**
|
||||
* 病区id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long wardLocationId;
|
||||
|
||||
/** 账户余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.openhis.web.inhospitalcharge.dto;
|
||||
|
||||
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 lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 住院登记查询 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InHospitalRegisterQueryDto {
|
||||
|
||||
/** 患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 住院就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 门诊就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long ambEncounterId;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date requestTime;
|
||||
|
||||
/**
|
||||
* 记录员
|
||||
*/
|
||||
private String registrar;
|
||||
|
||||
/**
|
||||
* 挂号科室(来源)
|
||||
*/
|
||||
private String sourceName;
|
||||
|
||||
/**
|
||||
* 患者
|
||||
*/
|
||||
private String patientName;
|
||||
|
||||
/**
|
||||
* 性别编码
|
||||
*/
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
|
||||
/**
|
||||
* 病区
|
||||
*/
|
||||
private String wardName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.openhis.web.inhospitalcharge.dto;
|
||||
|
||||
import com.openhis.web.patientmanage.dto.PatientInformationDto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 无档登记 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class NoFilesRegisterDto {
|
||||
|
||||
/**
|
||||
* 患者信息
|
||||
*/
|
||||
private PatientInformationDto patientInformation;
|
||||
|
||||
/**
|
||||
* 住院信息
|
||||
*/
|
||||
private InHospitalInfoDto inHospitalInfo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.openhis.web.inhospitalcharge.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;
|
||||
|
||||
/**
|
||||
* 更新患者信息 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PatientUpdateDto {
|
||||
|
||||
/** 患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String name;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
|
||||
/** 生日 */
|
||||
private Date birthDate;
|
||||
|
||||
/** 电话 */
|
||||
private String phone;
|
||||
|
||||
/** 身份证号 */
|
||||
private String idCard;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.openhis.web.inhospitalcharge.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.inhospitalcharge.dto.AdvancePaymentFlowRecordDto;
|
||||
import com.openhis.web.inhospitalcharge.dto.AdvancePaymentInfoDto;
|
||||
|
||||
/**
|
||||
* 预交金管理 应用Mapper
|
||||
*/
|
||||
@Repository
|
||||
public interface AdvancePaymentManageAppMapper {
|
||||
|
||||
/**
|
||||
* 查询预交金基本信息
|
||||
*
|
||||
* @param kindEnum 住院存款
|
||||
* @param wardEnum 病区
|
||||
* @param houseEnum 病房
|
||||
* @param bedEnum 床位
|
||||
* @param encounterLocationStatus 使用状态
|
||||
* @param status1 待结算
|
||||
* @param status2 已收费
|
||||
* @param status3 已退费
|
||||
* @param classEnum 住院
|
||||
* @param accountTypeCode 个人现金账号
|
||||
* @return 预交金基本信息
|
||||
*/
|
||||
IPage<AdvancePaymentInfoDto> getAdvancePaymentInfo(@Param("page") Page<AdvancePaymentInfoDto> page,
|
||||
@Param("kindEnum") Integer kindEnum, @Param("wardEnum") Integer wardEnum, @Param("houseEnum") Integer houseEnum,
|
||||
@Param("bedEnum") Integer bedEnum, @Param("encounterLocationStatus") Integer encounterLocationStatus,
|
||||
@Param("status1") Integer status1, @Param("status2") Integer status2, @Param("status3") Integer status3,
|
||||
@Param("classEnum") Integer classEnum, @Param("accountTypeCode") String accountTypeCode,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<AdvancePaymentInfoDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询预交金支付流水记录
|
||||
*
|
||||
* @param encounterId 住院就诊Id
|
||||
* @return 预交金支付流水记录
|
||||
*/
|
||||
List<AdvancePaymentFlowRecordDto> getAdvancePaymentFlowRecordList(@Param("encounterId") Long encounterId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.openhis.web.inhospitalcharge.mapper;
|
||||
|
||||
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.inhospitalcharge.dto.InHospitalInfoDto;
|
||||
import com.openhis.web.inhospitalcharge.dto.InHospitalPatientInfoDto;
|
||||
import com.openhis.web.inhospitalcharge.dto.InHospitalRegisterQueryDto;
|
||||
|
||||
/**
|
||||
* 住院登记 应用Mapper
|
||||
*/
|
||||
@Repository
|
||||
public interface InHospitalRegisterAppMapper {
|
||||
|
||||
/**
|
||||
* 查询住院登记信息
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param encounterClass 就诊类别
|
||||
* @param encounterStatus 登记状态
|
||||
* @param registeredFlag 已登记标识,已登记传 1 ,待登记传 0
|
||||
* @param formEnum 物理位置
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 住院登记信息
|
||||
*/
|
||||
IPage<InHospitalRegisterQueryDto> getInHospitalRegisterInfo(@Param("page") Page<InHospitalRegisterQueryDto> page,
|
||||
@Param("encounterClass") Integer encounterClass, @Param("encounterStatus") Integer encounterStatus,
|
||||
@Param("registeredFlag") String registeredFlag, @Param("formEnum") Integer formEnum,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InHospitalRegisterQueryDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询患者基本信息
|
||||
*
|
||||
* @param patientId 患者ID
|
||||
* @return 患者基本信息
|
||||
*/
|
||||
InHospitalPatientInfoDto getPatientInfo(@Param("patientId") Long patientId);
|
||||
|
||||
/**
|
||||
* 查询住院就诊信息
|
||||
*
|
||||
* @param encounterId 住院就诊id
|
||||
* @param formEnum 物理位置
|
||||
* @param maindiseFlag 主诊断标识
|
||||
* @param participantType 参与者类型
|
||||
* @param accountType 账号类型
|
||||
* @return 住院就诊信息
|
||||
*/
|
||||
InHospitalInfoDto getInHospitalInfo(@Param("encounterId") Long encounterId, @Param("formEnum") Integer formEnum,
|
||||
@Param("maindiseFlag") Integer maindiseFlag, @Param("participantType") String participantType,
|
||||
@Param("accountType") String accountType);
|
||||
|
||||
/**
|
||||
* 根据病区号获取总床位数
|
||||
*
|
||||
* @param formEnum 物理位置
|
||||
* @param status 状态
|
||||
* @param wardBusNo 病区号
|
||||
* @return 总床位数
|
||||
*/
|
||||
Integer getTotalBedsNum(@Param("formEnum") Integer formEnum, @Param("status") Integer status,
|
||||
@Param("wardBusNo") String wardBusNo);
|
||||
|
||||
/**
|
||||
* 根据病区号获取空闲床位数
|
||||
*
|
||||
* @param formEnum 物理位置
|
||||
* @param status 状态
|
||||
* @param wardBusNo 病区号
|
||||
* @return 空闲床位数
|
||||
*/
|
||||
Integer getIdleBedsNum(@Param("formEnum") Integer formEnum, @Param("status") Integer status,
|
||||
@Param("wardBusNo") String wardBusNo);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user