版本更新
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPageParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPatientInfoDto;
|
||||
|
||||
/**
|
||||
* 入出转管理 service
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
public interface IATDManageAppService {
|
||||
|
||||
/**
|
||||
* 入院患者分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return 入院患者分页列表
|
||||
*/
|
||||
R<?> getAdmissionPatientPage(AdmissionPageParam admissionPageParam, Integer pageNo, Integer pageSize,
|
||||
String searchKey, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 入院患者床位信息分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 床位信息分页列表
|
||||
*/
|
||||
R<?> getAdmissionBedPage(AdmissionPageParam admissionPageParam, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 入院患者详细信息
|
||||
*
|
||||
* @param encounterId 住院id
|
||||
* @return 入院患者详细信息
|
||||
*/
|
||||
R<?> getAdmissionPatientInfo(Long encounterId);
|
||||
|
||||
/**
|
||||
* 入出转管理页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> atdManageInit();
|
||||
|
||||
/**
|
||||
* 入科床位分配
|
||||
*
|
||||
* @param admissionPatientInfoDto 床位分配参数
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> admissionBedAssignment(AdmissionPatientInfoDto admissionPatientInfoDto);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.common.dto.PerformInfoDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPageParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceParam;
|
||||
|
||||
/**
|
||||
* 护士站医嘱处理接口
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
public interface IAdviceProcessAppService {
|
||||
|
||||
/**
|
||||
* 住院患者分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return 住院患者分页列表
|
||||
*/
|
||||
R<?> getInpatientPage(AdmissionPageParam admissionPageParam, Integer pageNo, Integer pageSize, String searchKey,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 住院患者医嘱查询
|
||||
*
|
||||
* @param inpatientAdviceParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 住院患者医
|
||||
*/
|
||||
R<?> getInpatientAdvicePage(InpatientAdviceParam inpatientAdviceParam, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 医嘱校对通过
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> adviceVerify(List<PerformInfoDto> performInfoList);
|
||||
|
||||
/**
|
||||
* 医嘱退回
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> adviceReject(List<PerformInfoDto> performInfoList);
|
||||
|
||||
/**
|
||||
* 医嘱执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> adviceExecute(List<PerformInfoDto> performInfoList);
|
||||
|
||||
/**
|
||||
* 医嘱取消执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> adviceCancel(List<PerformInfoDto> performInfoList);
|
||||
|
||||
/**
|
||||
* 医嘱不执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> adviceVoid(List<PerformInfoDto> performInfoList);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.openhis.web.inhospitalnursestation.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicineSearchParam;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
|
||||
/**
|
||||
* 住院领药 应用实现接口
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025/8/18
|
||||
*/
|
||||
public interface IInpatientMedicineCollectionAppService {
|
||||
|
||||
/**
|
||||
* 分页查询在科病人列表
|
||||
*
|
||||
* @param searchParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 发药病人列表
|
||||
*/
|
||||
R<?> getEncounterInfoListPage(InpatientMedicineSearchParam searchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询医嘱列表
|
||||
*
|
||||
* @param searchParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 处方单列表
|
||||
*/
|
||||
R<?> getPrescriptionInfo(InpatientMedicineSearchParam searchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 显示汇总发药单(生成之前的确认,此刻还没生成汇总单)
|
||||
*
|
||||
* @param searchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 处理结果
|
||||
*/
|
||||
R<?> showMedicineSummary(List<InpatientMedicineSearchParam> searchParam, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 生成汇总发药单
|
||||
*
|
||||
* @param prescriptionInfo 汇总发药单
|
||||
* @return 处理结果
|
||||
*/
|
||||
R<?> medicineSummary(List<InpatientMedicinePrescriptionInfoDto> prescriptionInfo);
|
||||
|
||||
/**
|
||||
* 校验库存
|
||||
*
|
||||
* @param devDispenseId 耗材发放id
|
||||
* @param medDispenseId 药品发放id
|
||||
* @return 处理结果
|
||||
*/
|
||||
R<?> checkInventoryItem(List<Long> devDispenseId, List<Long> medDispenseId);
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
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.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.openhis.administration.domain.EncounterLocation;
|
||||
import com.openhis.administration.service.IEncounterLocationService;
|
||||
import com.openhis.administration.service.IEncounterParticipantService;
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IATDManageAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.*;
|
||||
import com.openhis.web.inhospitalnursestation.mapper.ATDManageAppMapper;
|
||||
|
||||
/**
|
||||
* 入出转管理 实现类
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Service
|
||||
public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
|
||||
@Resource
|
||||
private ATDManageAppMapper atdManageAppMapper;
|
||||
|
||||
@Resource
|
||||
private IEncounterLocationService encounterLocationService;
|
||||
|
||||
@Resource
|
||||
private IEncounterParticipantService encounterParticipantService;
|
||||
|
||||
@Resource
|
||||
private ILocationService locationService;
|
||||
|
||||
@Resource
|
||||
private IEncounterService encounterService;
|
||||
|
||||
/**
|
||||
* 入出转管理页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> atdManageInit() {
|
||||
ATDManageInitDto atdManageInitDto = new ATDManageInitDto();
|
||||
// 住院状态
|
||||
List<ATDManageInitDto.encounterStatusOption> encounterStatusOptions = new ArrayList<>();
|
||||
encounterStatusOptions.add(new ATDManageInitDto.encounterStatusOption(EncounterZyStatus.REGISTERED.getValue(),
|
||||
EncounterZyStatus.REGISTERED.getInfo()));
|
||||
encounterStatusOptions
|
||||
.add(new ATDManageInitDto.encounterStatusOption(EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getValue(),
|
||||
EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getInfo()));
|
||||
// 床位状态
|
||||
List<ATDManageInitDto.bedStatusOption> bedStatusOptions = new ArrayList<>();
|
||||
bedStatusOptions
|
||||
.add(new ATDManageInitDto.bedStatusOption(LocationStatus.IDLE.getValue(), LocationStatus.IDLE.getInfo()));
|
||||
bedStatusOptions.add(
|
||||
new ATDManageInitDto.bedStatusOption(LocationStatus.OCCUPY.getValue(), LocationStatus.OCCUPY.getInfo()));
|
||||
// 患者病情
|
||||
List<ATDManageInitDto.priorityOption> priorityOptions = Stream.of(PriorityLevel.values())
|
||||
.map(
|
||||
priorityLevel -> new ATDManageInitDto.priorityOption(priorityLevel.getValue(), priorityLevel.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
atdManageInitDto.setBedStatusOptions(bedStatusOptions).setEncounterStatusOptions(encounterStatusOptions)
|
||||
.setPriorityOptions(priorityOptions);
|
||||
return R.ok(atdManageInitDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入院患者分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return 入院患者分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAdmissionPatientPage(AdmissionPageParam admissionPageParam, Integer pageNo, Integer pageSize,
|
||||
String searchKey, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<AdmissionPageParam> queryWrapper = HisQueryUtils.buildQueryWrapper(admissionPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.BusNo)),
|
||||
request);
|
||||
// 入院患者分页列表
|
||||
Page<AdmissionPatientPageDto> admissionPatientPage = atdManageAppMapper.selectAdmissionPatientPage(
|
||||
new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.IMP.getValue(),
|
||||
EncounterZyStatus.TO_BE_REGISTERED.getValue(), EncounterLocationStatus.ACTIVE.getValue(),
|
||||
LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(), LocationForm.BED.getValue());
|
||||
admissionPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 病情
|
||||
e.setPriorityEnum_enumText(EnumUtils.getInfoByValue(PriorityLevel.class, e.getPriorityEnum()));
|
||||
// 计算年龄
|
||||
if (e.getBirthDate() != null) {
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
}
|
||||
// 住院状态
|
||||
e.setEncounterStatus_enumText(EnumUtils.getInfoByValue(EncounterZyStatus.class, e.getEncounterStatus()));
|
||||
});
|
||||
return R.ok(admissionPatientPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入院患者床位信息分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 床位信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAdmissionBedPage(AdmissionPageParam admissionPageParam, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<AdmissionPageParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(admissionPageParam, null, null, null);
|
||||
// 入院患者床位分页列表
|
||||
Page<AdmissionBedPageDto> admissionBedPage =
|
||||
atdManageAppMapper.selectAdmissionBadPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
EncounterLocationStatus.ACTIVE.getValue(), LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(),
|
||||
LocationForm.BED.getValue(), AccountType.PERSONAL_CASH_ACCOUNT.getCode(),
|
||||
LocationStatus.INACTIVE.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue());
|
||||
admissionBedPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 床位状态
|
||||
e.setBedStatus_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getBedStatus()));
|
||||
// 计算年龄
|
||||
if (e.getBirthDate() != null) {
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
}
|
||||
// 住院状态
|
||||
e.setEncounterStatus_enumText(EnumUtils.getInfoByValue(EncounterZyStatus.class, e.getEncounterStatus()));
|
||||
});
|
||||
return R.ok(admissionBedPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入院患者详细信息
|
||||
*
|
||||
* @param encounterId 住院id
|
||||
* @return 入院患者详细信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAdmissionPatientInfo(Long encounterId) {
|
||||
// 查询住院患者详细信息
|
||||
AdmissionPatientInfoDto admissionPatientInfoDto =
|
||||
atdManageAppMapper.selectAdmissionPatientInfo(encounterId, EncounterLocationStatus.ACTIVE.getValue(),
|
||||
LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(), LocationForm.BED.getValue(),
|
||||
ParticipantType.PRIMARY_NURSE.getCode(), ParticipantType.ATTENDING_DOCTOR.getCode(),
|
||||
ParticipantType.ADMITTING_DOCTOR.getCode(), ParticipantType.CHIEF_DOCTOR.getCode());
|
||||
// 年龄
|
||||
admissionPatientInfoDto.setAge(AgeCalculatorUtil.getAge(admissionPatientInfoDto.getBirthDate()));
|
||||
// 性别
|
||||
admissionPatientInfoDto.setGenderEnum_enumText(
|
||||
EnumUtils.getInfoByValue(AdministrativeGender.class, admissionPatientInfoDto.getGenderEnum()));
|
||||
// 病情
|
||||
admissionPatientInfoDto.setPriorityEnum_enumText(
|
||||
EnumUtils.getInfoByValue(PriorityLevel.class, admissionPatientInfoDto.getPriorityEnum()));
|
||||
return R.ok(admissionPatientInfoDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入科床位分配
|
||||
*
|
||||
* @param admissionPatientInfoDto 床位分配参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> admissionBedAssignment(AdmissionPatientInfoDto admissionPatientInfoDto) {
|
||||
// 住院id
|
||||
Long encounterId = admissionPatientInfoDto.getEncounterId();
|
||||
// 目标床位住院患者id
|
||||
Long targetEncounterId = admissionPatientInfoDto.getTargetEncounterId();
|
||||
// 入科时间
|
||||
Date startTime = admissionPatientInfoDto.getStartTime();
|
||||
// 患者床位id
|
||||
Long oldBedId = admissionPatientInfoDto.getBedId();
|
||||
// 目标床位id
|
||||
Long targetBedId = admissionPatientInfoDto.getTargetBedId();
|
||||
|
||||
// 进入编辑患者信息,不更换床位
|
||||
if (Whether.YES.getCode().equals(admissionPatientInfoDto.getEditFlag())) {
|
||||
if (admissionPatientInfoDto.getPriorityEnum() != null) {
|
||||
// 更新患者病情
|
||||
encounterService.updatePriorityEnumById(encounterId, admissionPatientInfoDto.getPriorityEnum());
|
||||
// 将之前的住院参与者更新为已完成
|
||||
Integer result = encounterParticipantService.updateEncounterParticipantsStatus(encounterId);
|
||||
if (result == 0) {
|
||||
return R.fail("患者信息更新失败,请联系管理员");
|
||||
}
|
||||
// 更新住院参与者
|
||||
// 住院医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getAdmittingDoctorId(), ParticipantType.ADMITTING_DOCTOR.getCode());
|
||||
// 责任护士
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getPrimaryNurseId(), ParticipantType.PRIMARY_NURSE.getCode());
|
||||
if (admissionPatientInfoDto.getAttendingDoctorId() != null) {
|
||||
// 主治医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getAttendingDoctorId(), ParticipantType.ATTENDING_DOCTOR.getCode());
|
||||
}
|
||||
if (admissionPatientInfoDto.getChiefDoctorId() != null) {
|
||||
// 主任医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getChiefDoctorId(), ParticipantType.CHIEF_DOCTOR.getCode());
|
||||
}
|
||||
}
|
||||
return R.ok("患者信息更新成功");
|
||||
}
|
||||
|
||||
// 判断患者是否已经在床
|
||||
if (oldBedId != null) {
|
||||
// 判断目标床位是否已经被占用
|
||||
if (targetEncounterId != null) {
|
||||
List<EncounterLocation> locationList =
|
||||
encounterLocationService.getEncounterLocationInfo(targetEncounterId, null);
|
||||
// 查询目标患者的入科时间
|
||||
Date targetStartTime = null;
|
||||
Optional<EncounterLocation> encounterLocationOptional =
|
||||
locationList.stream().filter(x -> x.getFormEnum().equals(LocationForm.BED.getValue()))
|
||||
.filter(x -> x.getStatusEnum().equals(EncounterLocationStatus.ACTIVE.getValue())).findFirst();
|
||||
if (encounterLocationOptional.isPresent()) {
|
||||
EncounterLocation encounterLocation = encounterLocationOptional.get();
|
||||
targetStartTime = encounterLocation.getStartTime();
|
||||
}
|
||||
// 床位互换
|
||||
Integer result = encounterLocationService.updateEncounterLocationStatus(encounterId, false);
|
||||
Integer targetResult = encounterLocationService.updateEncounterLocationStatus(targetEncounterId, false);
|
||||
if (result == 0 || targetResult == 0) {
|
||||
return R.fail("换床失败,请联系管理员");
|
||||
}
|
||||
// 保存住院位置(目标床位)
|
||||
// 病房
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime,
|
||||
admissionPatientInfoDto.getTargetHouseId(), LocationForm.HOUSE.getValue());
|
||||
// 病床
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime, targetBedId,
|
||||
LocationForm.BED.getValue());
|
||||
|
||||
// 保存住院位置(原床位)
|
||||
// 病房
|
||||
encounterLocationService.creatEncounterLocation(targetEncounterId, targetStartTime,
|
||||
admissionPatientInfoDto.getHouseId(), LocationForm.HOUSE.getValue());
|
||||
// 病床
|
||||
encounterLocationService.creatEncounterLocation(targetEncounterId, targetStartTime, oldBedId,
|
||||
LocationForm.BED.getValue());
|
||||
|
||||
} else {
|
||||
// 更新旧病床状态:空闲
|
||||
locationService.updateStatusById(oldBedId, LocationStatus.IDLE.getValue());
|
||||
|
||||
// 换床
|
||||
Integer result = encounterLocationService.updateEncounterLocationStatus(encounterId, false);
|
||||
if (result == 0) {
|
||||
return R.fail("换床失败,请联系管理员");
|
||||
}
|
||||
// 保存住院位置
|
||||
// 病房
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime,
|
||||
admissionPatientInfoDto.getTargetHouseId(), LocationForm.HOUSE.getValue());
|
||||
// 病床
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime, targetBedId,
|
||||
LocationForm.BED.getValue());
|
||||
// 更新病床状态:占用
|
||||
locationService.updateStatusById(targetBedId, LocationStatus.OCCUPY.getValue());
|
||||
}
|
||||
} else {
|
||||
// 保存住院位置
|
||||
// 病房
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime,
|
||||
admissionPatientInfoDto.getTargetHouseId(), LocationForm.HOUSE.getValue());
|
||||
// 病床
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime, targetBedId,
|
||||
LocationForm.BED.getValue());
|
||||
// 更新病床状态:占用
|
||||
locationService.updateStatusById(targetBedId, LocationStatus.OCCUPY.getValue());
|
||||
|
||||
// 保存住院参与者
|
||||
// 住院医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getAdmittingDoctorId(), ParticipantType.ADMITTING_DOCTOR.getCode());
|
||||
// 责任护士
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getPrimaryNurseId(), ParticipantType.PRIMARY_NURSE.getCode());
|
||||
if (admissionPatientInfoDto.getAttendingDoctorId() != null) {
|
||||
// 主治医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getAttendingDoctorId(), ParticipantType.ATTENDING_DOCTOR.getCode());
|
||||
}
|
||||
if (admissionPatientInfoDto.getChiefDoctorId() != null) {
|
||||
// 主任医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getChiefDoctorId(), ParticipantType.CHIEF_DOCTOR.getCode());
|
||||
}
|
||||
}
|
||||
if (admissionPatientInfoDto.getPriorityEnum() != null) {
|
||||
// 更新患者病情
|
||||
encounterService.updatePriorityEnumById(encounterId, admissionPatientInfoDto.getPriorityEnum());
|
||||
}
|
||||
// 更新住院状态:已住院
|
||||
Integer result =
|
||||
encounterService.updateEncounterStatus(encounterId, EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getValue());
|
||||
if (result == 0) {
|
||||
return R.fail("床位分配失败,请联系管理员");
|
||||
}
|
||||
return R.ok("床位分配成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,375 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
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.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.SecurityUtils;
|
||||
import com.openhis.clinical.service.IProcedureService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.medication.service.IMedicationRequestService;
|
||||
import com.openhis.web.common.dto.PerformInfoDto;
|
||||
import com.openhis.web.common.dto.PerformRecordDto;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IAdviceProcessAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPageParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPatientPageDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceParam;
|
||||
import com.openhis.web.inhospitalnursestation.mapper.AdviceProcessAppMapper;
|
||||
import com.openhis.web.outpatientmanage.mapper.OutpatientTreatmentAppMapper;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
|
||||
/**
|
||||
* 护士站医嘱处理实现类
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
@Service
|
||||
public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
|
||||
@Resource
|
||||
private AdviceProcessAppMapper adviceProcessAppMapper;
|
||||
|
||||
@Resource
|
||||
private IProcedureService procedureService;
|
||||
|
||||
@Resource
|
||||
private OutpatientTreatmentAppMapper outpatientTreatmentAppMapper;
|
||||
|
||||
@Resource
|
||||
private IMedicationRequestService medicationRequestService;
|
||||
|
||||
@Resource
|
||||
private IServiceRequestService serviceRequestService;
|
||||
|
||||
@Resource
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
|
||||
/**
|
||||
* 住院患者分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return 住院患者分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getInpatientPage(AdmissionPageParam admissionPageParam, Integer pageNo, Integer pageSize,
|
||||
String searchKey, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<AdmissionPageParam> queryWrapper = HisQueryUtils.buildQueryWrapper(admissionPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.BusNo)),
|
||||
request);
|
||||
// 入院患者分页列表
|
||||
Page<AdmissionPatientPageDto> admissionPatientPage =
|
||||
adviceProcessAppMapper.selectInpatientPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
EncounterClass.IMP.getValue(), EncounterZyStatus.TO_BE_REGISTERED.getValue(),
|
||||
EncounterZyStatus.REGISTERED.getValue(), EncounterLocationStatus.ACTIVE.getValue(),
|
||||
LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(), LocationForm.BED.getValue());
|
||||
admissionPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 病情
|
||||
e.setPriorityEnum_enumText(EnumUtils.getInfoByValue(PriorityLevel.class, e.getPriorityEnum()));
|
||||
// 计算年龄
|
||||
if (e.getBirthDate() != null) {
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
}
|
||||
// 住院状态
|
||||
e.setEncounterStatus_enumText(EnumUtils.getInfoByValue(EncounterZyStatus.class, e.getEncounterStatus()));
|
||||
});
|
||||
return R.ok(admissionPatientPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院患者医嘱查询
|
||||
*
|
||||
* @param inpatientAdviceParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 住院患者医
|
||||
*/
|
||||
@Override
|
||||
public R<?> getInpatientAdvicePage(InpatientAdviceParam inpatientAdviceParam, Integer pageNo, Integer pageSize) {
|
||||
// 初始化查询参数
|
||||
String encounterIds = inpatientAdviceParam.getEncounterIds();
|
||||
inpatientAdviceParam.setEncounterIds(null);
|
||||
Integer exeStatus = inpatientAdviceParam.getExeStatus();
|
||||
inpatientAdviceParam.setExeStatus(null);
|
||||
// 构建查询条件
|
||||
QueryWrapper<InpatientAdviceParam> queryWrapper = HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.BusNo)),
|
||||
null);
|
||||
|
||||
// 手动拼接住院患者id条件
|
||||
if (encounterIds != null && !encounterIds.isEmpty()) {
|
||||
List<Long> encounterIdList =
|
||||
Arrays.stream(encounterIds.split(CommonConstants.Common.COMMA)).map(Long::parseLong).toList();
|
||||
queryWrapper.in(CommonConstants.FieldName.EncounterId, encounterIdList);
|
||||
}
|
||||
|
||||
// 入院患者分页列表
|
||||
Page<InpatientAdviceDto> inpatientAdvicePage =
|
||||
adviceProcessAppMapper.selectInpatientAdvicePage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
RequestStatus.DRAFT.getValue(), EncounterLocationStatus.ACTIVE.getValue(), LocationForm.BED.getValue(),
|
||||
ParticipantType.ADMITTING_DOCTOR.getCode(), AccountType.PERSONAL_CASH_ACCOUNT.getCode(),
|
||||
ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), EncounterClass.IMP.getValue());
|
||||
inpatientAdvicePage.getRecords().forEach(e -> {
|
||||
// 是否皮试
|
||||
e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag()));
|
||||
// 是否为注射药物
|
||||
e.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getInjectFlag()));
|
||||
// 医嘱类型
|
||||
e.setTherapyEnum_enumText(EnumUtils.getInfoByValue(TherapyTimeType.class, e.getTherapyEnum()));
|
||||
// 请求状态
|
||||
e.setRequestStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getRequestStatus()));
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
if (e.getBirthDate() != null) {
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
}
|
||||
});
|
||||
|
||||
// 获取医嘱列表
|
||||
List<InpatientAdviceDto> inpatientAdviceList = inpatientAdvicePage.getRecords();
|
||||
// 获取请求ids
|
||||
List<Long> reqIds = inpatientAdviceList.stream().map(InpatientAdviceDto::getRequestId).toList();
|
||||
Map<Long, List<PerformRecordDto>> procedureRecordGroup = new HashMap<>();
|
||||
if (!reqIds.isEmpty()) {
|
||||
// 查询执行记录
|
||||
List<PerformRecordDto> performRecordList = outpatientTreatmentAppMapper.selectPerformRecordList(reqIds);
|
||||
if (performRecordList != null && !performRecordList.isEmpty()) {
|
||||
// 根据服务请求id分组
|
||||
procedureRecordGroup = performRecordList.stream()
|
||||
.collect(Collectors.groupingBy(PerformRecordDto::getRequestId, Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
// 手动处理前端传来的执行条件
|
||||
if (exeStatus != null) {
|
||||
// 处理执行记录状态
|
||||
for (InpatientAdviceDto inpatientAdvice : inpatientAdviceList) {
|
||||
List<PerformRecordDto> performRecordList = procedureRecordGroup.get(inpatientAdvice.getRequestId());
|
||||
List<PerformRecordDto> exePerformRecordList = new ArrayList<>();
|
||||
List<PerformRecordDto> cancelPerformRecordList = new ArrayList<>();
|
||||
List<PerformRecordDto> stopPerformRecordList = new ArrayList<>();
|
||||
if (performRecordList != null && !performRecordList.isEmpty()) {
|
||||
// 按时间分组,处理每个时间点的多条记录
|
||||
Map<String, List<PerformRecordDto>> recordsByTime = performRecordList.stream()
|
||||
.collect(Collectors.groupingBy(record -> record.getOccurrenceTime().toString()));
|
||||
for (Map.Entry<String, List<PerformRecordDto>> entry : recordsByTime.entrySet()) {
|
||||
List<PerformRecordDto> records = entry.getValue();
|
||||
// 按操作顺序排序
|
||||
records.sort(Comparator.comparing(PerformRecordDto::getCreateTime));
|
||||
// 取最后一条记录,最终状态由最后一次操作决定
|
||||
PerformRecordDto lastRecord = records.get(records.size() - 1);
|
||||
if (EventStatus.COMPLETED.getValue().equals(lastRecord.getStatusEnum())) {
|
||||
exePerformRecordList.add(lastRecord);
|
||||
} else if (EventStatus.CANCEL.getValue().equals(lastRecord.getStatusEnum())) {
|
||||
cancelPerformRecordList.add(lastRecord);
|
||||
} else if (EventStatus.STOPPED.getValue().equals(lastRecord.getStatusEnum())) {
|
||||
stopPerformRecordList.add(lastRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
inpatientAdvice.setExePerformRecordList(exePerformRecordList)
|
||||
.setCancelPerformRecordList(cancelPerformRecordList)
|
||||
.setStopPerformRecordList(stopPerformRecordList);
|
||||
}
|
||||
|
||||
// 根据执行状态过滤医嘱列表
|
||||
List<InpatientAdviceDto> filteredList = new ArrayList<>();
|
||||
if (EventStatus.COMPLETED.getValue().equals(exeStatus)) {
|
||||
// 已执行 - 过滤出有执行记录的医嘱
|
||||
filteredList = inpatientAdviceList.stream().filter(
|
||||
advice -> advice.getExePerformRecordList() != null && !advice.getExePerformRecordList().isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
// 更新分页数据
|
||||
inpatientAdvicePage.setRecords(filteredList);
|
||||
inpatientAdvicePage.setTotal(filteredList.size());
|
||||
} else if (EventStatus.CANCEL.getValue().equals(exeStatus)) {
|
||||
// 取消执行 - 过滤出有取消记录的医嘱
|
||||
filteredList = inpatientAdviceList.stream().filter(advice -> advice.getCancelPerformRecordList() != null
|
||||
&& !advice.getCancelPerformRecordList().isEmpty()).collect(Collectors.toList());
|
||||
// 更新分页数据
|
||||
inpatientAdvicePage.setRecords(filteredList);
|
||||
inpatientAdvicePage.setTotal(filteredList.size());
|
||||
} else if (EventStatus.STOPPED.getValue().equals(exeStatus)) {
|
||||
// 不执行 - 过滤出有停止记录的医嘱
|
||||
filteredList = inpatientAdviceList.stream().filter(
|
||||
advice -> advice.getStopPerformRecordList() != null && !advice.getStopPerformRecordList().isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
// 更新分页数据
|
||||
inpatientAdvicePage.setRecords(filteredList);
|
||||
inpatientAdvicePage.setTotal(filteredList.size());
|
||||
}
|
||||
}
|
||||
return R.ok(inpatientAdvicePage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱校对通过
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> adviceVerify(List<PerformInfoDto> performInfoList) {
|
||||
// 分别创建两个列表来存储不同类型的请求
|
||||
List<PerformInfoDto> serviceRequestList = new ArrayList<>();
|
||||
List<PerformInfoDto> medRequestList = new ArrayList<>();
|
||||
for (PerformInfoDto item : performInfoList) {
|
||||
if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(item.getRequestTable())) {
|
||||
serviceRequestList.add(item);
|
||||
} else if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(item.getRequestTable())) {
|
||||
medRequestList.add(item);
|
||||
}
|
||||
}
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
Date checkDate = new Date();
|
||||
if (!serviceRequestList.isEmpty()) {
|
||||
// 更新服务请求状态已完成
|
||||
serviceRequestService.updateCompleteRequestStatus(
|
||||
serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate);
|
||||
}
|
||||
if (!medRequestList.isEmpty()) {
|
||||
// 更新药品请求状态已完成
|
||||
medicationRequestService.updateCompletedStatusBatch(
|
||||
medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate);
|
||||
}
|
||||
return R.ok(null, "校对成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱退回
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> adviceReject(List<PerformInfoDto> performInfoList) {
|
||||
// 分别创建两个列表来存储不同类型的请求
|
||||
List<PerformInfoDto> serviceRequestList = new ArrayList<>();
|
||||
List<PerformInfoDto> medRequestList = new ArrayList<>();
|
||||
for (PerformInfoDto item : performInfoList) {
|
||||
if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(item.getRequestTable())) {
|
||||
serviceRequestList.add(item);
|
||||
} else if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(item.getRequestTable())) {
|
||||
medRequestList.add(item);
|
||||
}
|
||||
}
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
Date checkDate = new Date();
|
||||
if (!serviceRequestList.isEmpty()) {
|
||||
// 更新服务请求状态待发送
|
||||
serviceRequestService.updateDraftStatus(
|
||||
serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate);
|
||||
}
|
||||
if (!medRequestList.isEmpty()) {
|
||||
// 更新药品请求状态待发送
|
||||
medicationRequestService.updateDraftStatusBatch(
|
||||
medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate);
|
||||
}
|
||||
return R.ok(null, "退回成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> adviceExecute(List<PerformInfoDto> performInfoList) {
|
||||
// 分别创建两个列表来存储不同类型的请求
|
||||
List<PerformInfoDto> serviceRequestList = new ArrayList<>();
|
||||
List<PerformInfoDto> medRequestList = new ArrayList<>();
|
||||
for (PerformInfoDto item : performInfoList) {
|
||||
if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(item.getRequestTable())) {
|
||||
serviceRequestList.add(item);
|
||||
} else if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(item.getRequestTable())) {
|
||||
medRequestList.add(item);
|
||||
}
|
||||
}
|
||||
//分别处理长期/临时医嘱
|
||||
// 执行项目列表(需过滤掉特殊医嘱,已经停嘱的医嘱,执行时间与出院时间/入院时间冲突的)
|
||||
List<PerformInfoDto> executeList = performInfoList;
|
||||
// 校验是否已经停嘱
|
||||
// 校验患者是否在科,出院,死亡
|
||||
// 处理药品医嘱
|
||||
if (!medRequestList.isEmpty()) {
|
||||
// 查询医嘱信息
|
||||
List<Long> requestIdList = medRequestList.stream().map(PerformInfoDto::getRequestId).toList();
|
||||
List<MedicationRequest> medicationRequestList = medicationRequestService.listByIds(requestIdList);
|
||||
// 按每个药品分组校验库存
|
||||
Map<Long, List<MedicationRequest>> medMap =
|
||||
medicationRequestList.stream().collect(Collectors.groupingBy(MedicationRequest::getMedicationId));
|
||||
for (Map.Entry<Long, List<MedicationRequest>> entry : medMap.entrySet()) {
|
||||
List<MedicationRequest> medicationRequests = entry.getValue();
|
||||
}
|
||||
//校验库存是校验某个药在某个药房这一次执行的总数够不够,生成药品发放是按每个请求生成的
|
||||
// 生成药品发放
|
||||
// medicationDispenseService.handleMedicationDispense();
|
||||
}
|
||||
if (!serviceRequestList.isEmpty()) {
|
||||
// todo:查询绑定的耗材
|
||||
//生成执行记录
|
||||
}
|
||||
// 记录操作记录
|
||||
for (PerformInfoDto execute : executeList) {
|
||||
//生成账单(待结算)
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱取消执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> adviceCancel(List<PerformInfoDto> performInfoList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱不执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> adviceVoid(List<PerformInfoDto> performInfoList) {
|
||||
// 长期临时都可以不执行,长期不执行的是某一时间点,也可以不执行这一整个医嘱(更新serviceRequest状态为7)
|
||||
// 已执行的时间点不能不执行,需要先取消
|
||||
// 增加不执行记录
|
||||
// 不执行的医嘱还可以再执行(暂时不做限制)
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
package com.openhis.web.inhospitalnursestation.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.constant.HttpStatus;
|
||||
import com.core.common.utils.*;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IInpatientMedicineCollectionAppService;
|
||||
import com.openhis.web.pharmacymanage.dto.InventoryDto;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
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.exception.ServiceException;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.enums.ybenums.YbDrordType;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.*;
|
||||
import com.openhis.web.inhospitalnursestation.mapper.InpatientMedicineCollectionMapper;
|
||||
import com.openhis.web.pharmacymanage.mapper.ReturnMedicineMapper;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
|
||||
/**
|
||||
* 住院领药 应用实现类
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025/8/18
|
||||
*/
|
||||
@Service
|
||||
public class InpatientMedicineCollectionAppServiceImpl implements IInpatientMedicineCollectionAppService {
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Autowired
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
|
||||
@Autowired
|
||||
private IDeviceDispenseService deviceDispenseService;
|
||||
|
||||
@Autowired
|
||||
private InpatientMedicineCollectionMapper inpatientMedicineCollectionMapper;
|
||||
@Resource
|
||||
private ISupplyRequestService supplyRequestService;
|
||||
|
||||
@Resource
|
||||
private ISupplyDeliveryService supplyDeliveryService;
|
||||
@Autowired
|
||||
private ReturnMedicineMapper returnMedicineMapper;
|
||||
|
||||
/**
|
||||
* 分页查询在科病人列表
|
||||
*
|
||||
* @param searchParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 发药病人列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEncounterInfoListPage(InpatientMedicineSearchParam searchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
// 参与者科室id
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
searchParam.setOrganizationId(orgId);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<InpatientMedicineSearchParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(searchParam, searchKey,
|
||||
new HashSet<>(
|
||||
Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.InpatientBed)),
|
||||
request);
|
||||
queryWrapper.orderByDesc(CommonConstants.FieldName.EncounterId);
|
||||
|
||||
// 查询就诊病人列表
|
||||
Page<InpatientMedicineEncounterInfoDto> encounterInfoPageDto = inpatientMedicineCollectionMapper
|
||||
.selectEncounterInfoListPage(new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.IMP.getValue());
|
||||
|
||||
// 个别项目设定
|
||||
encounterInfoPageDto.getRecords().forEach(patientInfoDto -> {
|
||||
// 性别
|
||||
patientInfoDto.setGenderEnum_enumText(
|
||||
EnumUtils.getInfoByValue(AdministrativeGender.class, patientInfoDto.getGenderEnum()));
|
||||
// 年龄
|
||||
patientInfoDto.setAge(AgeCalculatorUtil.getAge(patientInfoDto.getBirthDate()));
|
||||
});
|
||||
|
||||
return R.ok(encounterInfoPageDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询医嘱列表
|
||||
*
|
||||
* @param searchParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 处方单列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPrescriptionInfo(InpatientMedicineSearchParam searchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 就诊id
|
||||
List<Long> encounterIdList = searchParam.getEncounterIdList();
|
||||
searchParam.setEncounterIdList(null);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<InpatientMedicineSearchParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(searchParam, searchKey, null, request);
|
||||
queryWrapper.orderByDesc(CommonConstants.FieldName.BusNo);
|
||||
queryWrapper.le(CommonConstants.FieldName.PlannedDispenseTime, searchParam.getPlannedDispenseTime());
|
||||
// queryWrapper.in(CommonConstants.FieldName.encounterId,encounterIdList);
|
||||
searchParam.setPlannedDispenseTime(null);
|
||||
|
||||
// 查询医嘱列表
|
||||
Page<InpatientMedicinePrescriptionInfoDto> prescriptionInfoPageDto =
|
||||
inpatientMedicineCollectionMapper.selectPrescriptionInfoListPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
encounterIdList, DispenseStatus.IN_PROGRESS.getValue(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION);
|
||||
// 个别项目设定
|
||||
prescriptionInfoPageDto.getRecords().forEach(prescriptionInfo -> {
|
||||
// 治疗类型
|
||||
prescriptionInfo.setTherapyEnum_enumText(
|
||||
EnumUtils.getInfoByValue(YbDrordType.class, prescriptionInfo.getTherapyEnum()));
|
||||
// 状态
|
||||
prescriptionInfo.setStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(DispenseStatus.class, prescriptionInfo.getStatusEnum()));
|
||||
});
|
||||
|
||||
return R.ok(prescriptionInfoPageDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示汇总发药单(生成之前的确认,此刻还没生成汇总单)
|
||||
*
|
||||
* @param searchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> showMedicineSummary(List<InpatientMedicineSearchParam> searchParam, Integer pageNo, Integer pageSize) {
|
||||
// 药品发放id
|
||||
List<Long> medDispenseId = searchParam.stream()
|
||||
.filter(param -> param != null
|
||||
&& Objects.equals(param.getItemTable(), CommonConstants.TableName.MED_MEDICATION_DEFINITION))
|
||||
.map(InpatientMedicineSearchParam::getDispenseId).collect(Collectors.toList());
|
||||
// 耗材发放id
|
||||
List<Long> devDispenseId = searchParam.stream()
|
||||
.filter(param -> param != null
|
||||
&& Objects.equals(param.getItemTable(), CommonConstants.TableName.ADM_DEVICE_DEFINITION))
|
||||
.map(InpatientMedicineSearchParam::getDispenseId).collect(Collectors.toList());
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<InpatientMedicineSearchParam> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByAsc(CommonConstants.FieldName.itemId);
|
||||
|
||||
// 查询汇总医嘱列表
|
||||
Page<InpatientMedicinePrescriptionInfoDto> prescriptionSummaryInfoPageDto =
|
||||
inpatientMedicineCollectionMapper.selectPrescriptionSummaryInfoListPage(new Page<>(pageNo, pageSize),
|
||||
queryWrapper, medDispenseId, devDispenseId, CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION);
|
||||
// 个别项目设定
|
||||
prescriptionSummaryInfoPageDto.getRecords().forEach(prescriptionInfo -> {
|
||||
// 地点类型
|
||||
prescriptionInfo.setLocationEnum_enumText(
|
||||
EnumUtils.getInfoByValue(LocationForm.class, prescriptionInfo.getLocationEnum()));
|
||||
});
|
||||
|
||||
return R.ok(prescriptionSummaryInfoPageDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成汇总发药单
|
||||
*
|
||||
* @param prescriptionInfo 汇总发药单
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> medicineSummary(List<InpatientMedicinePrescriptionInfoDto> prescriptionInfo) {
|
||||
// 药品发放id
|
||||
List<Long> medDispenseId = new ArrayList<>();
|
||||
// 耗材发放id
|
||||
List<Long> devDispenseId = new ArrayList<>();
|
||||
// 供应申请
|
||||
List<SupplyRequest> supplyRequestList = new ArrayList<>();
|
||||
SupplyRequest supplyRequest;
|
||||
// 供应发放
|
||||
List<SupplyDelivery> supplyDeliveryList = new ArrayList<>();
|
||||
SupplyDelivery supplyDelivery;
|
||||
Date now = DateUtils.getNowDate();
|
||||
|
||||
// 校验库存
|
||||
R<?> checkInventoryReturn = this.checkInventoryItem(devDispenseId, medDispenseId);
|
||||
if (checkInventoryReturn.getCode() != HttpStatus.SUCCESS) {
|
||||
return checkInventoryReturn;
|
||||
}
|
||||
|
||||
// 单据号
|
||||
String busNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.DISPENSING_ORDER.getPrefix(), 4);
|
||||
if (prescriptionInfo.stream().map(InpatientMedicinePrescriptionInfoDto::getStatusEnum)
|
||||
.anyMatch(x -> x.equals(DispenseStatus.SUMMARIZED.getValue()))) {
|
||||
throw new ServiceException("药品已汇总,请勿重复汇总");
|
||||
} else {
|
||||
for (InpatientMedicinePrescriptionInfoDto item : prescriptionInfo) {
|
||||
// 供应申请
|
||||
supplyRequest = new SupplyRequest().setBusNo(busNo).setTypeEnum(SupplyType.DISPENSING_ORDER.getValue())
|
||||
.setStatusEnum(SupplyStatus.SEND.getValue())
|
||||
.setCategoryEnum(SupplyCategory.INPATIENT_PATIENT_SUMMARY_DISPENSING.getValue())
|
||||
.setItemTable(item.getItemTable()).setItemId(item.getItemId()).setUnitCode(item.getUnitCode())
|
||||
.setItemQuantity(new BigDecimal(item.getQuantity())).setLotNumber(item.getLotNumber())
|
||||
.setSourceTypeEnum(item.getLocationEnum()).setSourceLocationId(item.getLocationId())
|
||||
.setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue())
|
||||
.setPurposeLocationId(SecurityUtils.getLoginUser().getOrgId())
|
||||
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId()).setApplyTime(now);
|
||||
supplyRequestList.add(supplyRequest);
|
||||
|
||||
// 供应发放
|
||||
supplyDelivery = new SupplyDelivery().setRequestId(supplyRequest.getId())
|
||||
.setStatusEnum(DispenseStatus.IN_PROGRESS.getValue()).setTypeEnum(supplyRequest.getTypeEnum())
|
||||
.setItemTable(supplyRequest.getItemTable()).setItemId(supplyRequest.getItemId())
|
||||
.setBasedOnIds(item.getDispenseIds()).setUnitCode(supplyRequest.getUnitCode())
|
||||
.setQuantity(supplyRequest.getItemQuantity()).setLotNumber(supplyRequest.getLotNumber())
|
||||
.setReceiverId(SecurityUtils.getLoginUser().getPractitionerId());
|
||||
if (item.getItemTable().equals(CommonConstants.TableName.MED_MEDICATION_DEFINITION)) {
|
||||
// 设置供应发放信息
|
||||
supplyDelivery.setBasedOnTable(CommonConstants.TableName.MED_MEDICATION_DISPENSE);
|
||||
// 设置药品发放id
|
||||
medDispenseId.addAll(Arrays.stream(item.getDispenseIds().split(",")).map(String::trim) // 去除每个ID前后的空格
|
||||
.filter(s -> !s.isEmpty()) // 过滤空字符串
|
||||
.map(Long::parseLong) // 转换为Long类型
|
||||
.toList());
|
||||
} else {
|
||||
// 设置供应发放信息
|
||||
supplyDelivery.setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE);
|
||||
// 设置耗材发放id
|
||||
devDispenseId.addAll(Arrays.stream(item.getDispenseIds().split(",")).map(String::trim) // 去除每个ID前后的空格
|
||||
.filter(s -> !s.isEmpty()) // 过滤空字符串
|
||||
.map(Long::parseLong) // 转换为Long类型
|
||||
.toList());
|
||||
}
|
||||
supplyDeliveryList.add(supplyDelivery);
|
||||
}
|
||||
// 供应申请更新
|
||||
boolean requestFlg = supplyRequestService.saveBatch(supplyRequestList);
|
||||
if (!requestFlg) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
// 供应发放更新
|
||||
boolean deliveryFlg = supplyDeliveryService.saveBatch(supplyDeliveryList);
|
||||
if (!deliveryFlg) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
// 药品发放状态更新
|
||||
medicationDispenseService.updateDispenseStatusSummarized(medDispenseId);
|
||||
// 耗材发放状态更新
|
||||
deviceDispenseService.updateDispenseStatusSummarized(devDispenseId);
|
||||
}
|
||||
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验库存
|
||||
*
|
||||
* @param devDispenseId 耗材发放id
|
||||
* @param medDispenseId 药品发放id
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> checkInventoryItem(List<Long> devDispenseId, List<Long> medDispenseId) {
|
||||
|
||||
List<InventoryItem> inventoryItemList = new ArrayList<>();
|
||||
// 获取库存信息
|
||||
List<InventoryDto> inventoryList = returnMedicineMapper.selectInventoryInfoList(devDispenseId, medDispenseId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION);
|
||||
// 按每个药品分组
|
||||
Map<Long, List<InventoryDto>> groupedByItemId =
|
||||
inventoryList.stream().collect(Collectors.groupingBy(InventoryDto::getItemId));
|
||||
// 遍历每个分组校验库存状态
|
||||
for (Map.Entry<Long, List<InventoryDto>> entry : groupedByItemId.entrySet()) {
|
||||
List<InventoryDto> groupItems = entry.getValue();
|
||||
if (groupItems.stream().map(InventoryDto::getInventoryStatusEnum)
|
||||
.allMatch(x -> x.equals(PublicationStatus.RETIRED.getValue()))) {
|
||||
// 库存停供校验
|
||||
return R.fail(groupItems.get(0).getItemName() + "库存已停供");
|
||||
}
|
||||
}
|
||||
if (!inventoryList.isEmpty()) {
|
||||
for (InventoryDto inventoryDto : inventoryList) {
|
||||
if (PublicationStatus.ACTIVE.getValue().equals(inventoryDto.getInventoryStatusEnum())) {
|
||||
InventoryItem inventoryItem = new InventoryItem();
|
||||
// 库存数量判定
|
||||
if (inventoryDto.getDispenseUnit().equals(inventoryDto.getInventoryUnitCode())) {
|
||||
// 当前库存数量(拆零单位)=当前库存数量(拆零单位)-请求数量
|
||||
BigDecimal quantity = inventoryDto.getInventoryQuantity().subtract(inventoryDto.getQuantity());
|
||||
// 库存数量判定
|
||||
if (quantity.compareTo(BigDecimal.ZERO) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(inventoryDto.getItemName() + "当前库存数量不足");
|
||||
} else {
|
||||
inventoryItem.setId(inventoryDto.getInventoryId()).setQuantity(quantity);
|
||||
}
|
||||
} else {
|
||||
// 当前库存数量(拆零单位)=当前库存数量(拆零单位)-拆零数量(拆零比×请求数量)
|
||||
BigDecimal quantity = inventoryDto.getInventoryQuantity()
|
||||
.subtract(inventoryDto.getPartPercent().multiply(inventoryDto.getQuantity()));
|
||||
// 库存数量判定
|
||||
if (quantity.compareTo(BigDecimal.ZERO) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(inventoryDto.getItemName() + "当前库存数量不足");
|
||||
} else {
|
||||
inventoryItem.setId(inventoryDto.getInventoryId()).setQuantity(quantity);
|
||||
}
|
||||
}
|
||||
inventoryItemList.add(inventoryItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(inventoryItemList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IATDManageAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPageParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPatientInfoDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 入出转管理 controller
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/nurse-station/atd-manage")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class ATDManageController {
|
||||
|
||||
@Resource
|
||||
private IATDManageAppService atdManageAppService;
|
||||
|
||||
/**
|
||||
* 入出转管理页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> atdManageInit() {
|
||||
return atdManageAppService.atdManageInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 入院患者分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return 入院患者分页列表
|
||||
*/
|
||||
@GetMapping(value = "/admission-patient")
|
||||
public R<?> getAdmissionPatientPage(AdmissionPageParam admissionPageParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
return atdManageAppService.getAdmissionPatientPage(admissionPageParam, pageNo, pageSize, searchKey, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入院患者床位信息分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 床位信息分页列表
|
||||
*/
|
||||
@GetMapping(value = "/admission-bed")
|
||||
public R<?> getAdmissionBedPage(AdmissionPageParam admissionPageParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return atdManageAppService.getAdmissionBedPage(admissionPageParam, pageNo, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入院患者详细信息
|
||||
*
|
||||
* @param encounterId 住院id
|
||||
* @return 入院患者详细信息
|
||||
*/
|
||||
@GetMapping(value = "/admission-patient-info")
|
||||
public R<?> getAdmissionPatientInfo(Long encounterId) {
|
||||
return atdManageAppService.getAdmissionPatientInfo(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入科床位分配
|
||||
*
|
||||
* @param admissionPatientInfoDto 床位分配参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/bed-assignment")
|
||||
public R<?> admissionBedAssignment(@RequestBody AdmissionPatientInfoDto admissionPatientInfoDto) {
|
||||
return atdManageAppService.admissionBedAssignment(admissionPatientInfoDto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.common.dto.PerformInfoDto;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IAdviceProcessAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPageParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 护士站医嘱处理 controller
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/nurse-station/advice-process")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class AdviceProcessController {
|
||||
|
||||
@Resource
|
||||
private IAdviceProcessAppService adviceProcessAppService;
|
||||
|
||||
/**
|
||||
* 住院患者分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return 住院患者分页列表
|
||||
*/
|
||||
@GetMapping(value = "/inpatient")
|
||||
public R<?> getInpatientPage(AdmissionPageParam admissionPageParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
return adviceProcessAppService.getInpatientPage(admissionPageParam, pageNo, pageSize, searchKey, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院患者医嘱查询
|
||||
*
|
||||
* @param inpatientAdviceParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 住院患者医
|
||||
*/
|
||||
@GetMapping(value = "/inpatient-advice")
|
||||
public R<?> getInpatientAdvicePage(InpatientAdviceParam inpatientAdviceParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return adviceProcessAppService.getInpatientAdvicePage(inpatientAdviceParam, pageNo, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱校对通过
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping(value = "/advice-verify")
|
||||
public R<?> adviceVerify(List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceVerify(performInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱退回
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping(value = "/advice-reject")
|
||||
public R<?> adviceReject(List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceReject(performInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping(value = "/advice-execute")
|
||||
public R<?> adviceExecute(List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceExecute(performInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱取消执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping(value = "/advice-cancel")
|
||||
public R<?> adviceCancel(List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceCancel(performInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱不执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping(value = "/advice-void")
|
||||
public R<?> adviceVoid(List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceVoid(performInfoList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.openhis.web.inhospitalnursestation.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IInpatientMedicineCollectionAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicineSearchParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 住院领药
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025/8/18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/nurse-station/inpatient-medicine-collection")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class InpatientMedicineCollectionController {
|
||||
|
||||
@Resource
|
||||
public IInpatientMedicineCollectionAppService medicineCollectionService;
|
||||
|
||||
/**
|
||||
* 分页查询在科病人列表
|
||||
*
|
||||
* @param searchParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 发药病人列表
|
||||
*/
|
||||
@GetMapping("/encounter-list")
|
||||
public R<?> getEncounterInfoList(InpatientMedicineSearchParam searchParam, String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return medicineCollectionService.getEncounterInfoListPage(searchParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱查询
|
||||
*
|
||||
* @param searchParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
*/
|
||||
@GetMapping("/prescription-list")
|
||||
public R<?> getPatientInfoList(InpatientMedicineSearchParam searchParam, String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return medicineCollectionService.getPrescriptionInfo(searchParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示汇总发药单(生成之前的确认,此刻还没生成汇总单)
|
||||
*
|
||||
* @param searchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 处理结果
|
||||
*/
|
||||
@GetMapping("/show-medicine-summary")
|
||||
public R<?> showMedicineSummary(@RequestBody List<InpatientMedicineSearchParam> searchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return medicineCollectionService.showMedicineSummary(searchParam, pageNo, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成汇总发药单
|
||||
*
|
||||
* @param prescriptionInfo 汇总发药单
|
||||
* @return 处理结果
|
||||
*/
|
||||
@PostMapping("/medicine-summary")
|
||||
public R<?> medicineSummary(@RequestBody List<InpatientMedicinePrescriptionInfoDto> prescriptionInfo) {
|
||||
return medicineCollectionService.medicineSummary(prescriptionInfo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 入出转管理页面初始化dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ATDManageInitDto {
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
private List<ATDManageInitDto.encounterStatusOption> encounterStatusOptions;
|
||||
|
||||
/**
|
||||
* 床位状态
|
||||
*/
|
||||
private List<ATDManageInitDto.bedStatusOption> bedStatusOptions;
|
||||
|
||||
/**
|
||||
* 患者病情
|
||||
*/
|
||||
private List<ATDManageInitDto.priorityOption> priorityOptions;
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
@Data
|
||||
public static class encounterStatusOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public encounterStatusOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 床位状态
|
||||
*/
|
||||
@Data
|
||||
public static class bedStatusOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public bedStatusOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者病情
|
||||
*/
|
||||
@Data
|
||||
public static class priorityOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public priorityOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 入院床位 Dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025/7/29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionBedPageDto {
|
||||
|
||||
/**
|
||||
* 入院ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
private Integer encounterStatus;
|
||||
private String encounterStatus_enumText;
|
||||
|
||||
/**
|
||||
* 入院科室
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 病区ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long wardId;
|
||||
|
||||
/**
|
||||
* 病区名称
|
||||
*/
|
||||
private String wardName;
|
||||
|
||||
/** 病房ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long houseId;
|
||||
|
||||
/**
|
||||
* 病房名称
|
||||
*/
|
||||
private String houseName;
|
||||
|
||||
/** 病床ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long bedId;
|
||||
|
||||
/**
|
||||
* 病床名称
|
||||
*/
|
||||
private String bedName;
|
||||
|
||||
/** 床位状态 */
|
||||
private Integer bedStatus;
|
||||
private String bedStatus_enumText;
|
||||
|
||||
/** 余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/** 总额 */
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 病人年龄 */
|
||||
private String age;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 入院分页查询条件
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionPageParam {
|
||||
|
||||
/**
|
||||
* 入院科室
|
||||
*/
|
||||
private Long organizationId;
|
||||
|
||||
/** 入院病区 */
|
||||
private Long wardId;
|
||||
|
||||
/** 入院病房 */
|
||||
private Long houseId;
|
||||
|
||||
/**
|
||||
* 入院类型
|
||||
*/
|
||||
private String admitSourceCode;
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
private Integer encounterStatus;
|
||||
|
||||
/** 床位状态 */
|
||||
private Integer bedStatus;
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
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.enums.Whether;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 入院患者基本信息 dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionPatientInfoDto {
|
||||
|
||||
/**
|
||||
* 入院ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 目标床位住院患者id
|
||||
*/
|
||||
private Long targetEncounterId;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/**
|
||||
* 入院时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inHosTime;
|
||||
|
||||
/**
|
||||
* 入科时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 病情
|
||||
*/
|
||||
private Integer priorityEnum;
|
||||
private String priorityEnum_enumText;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 病人年龄 */
|
||||
private String age;
|
||||
|
||||
/** 电话 */
|
||||
private String phone;
|
||||
|
||||
/** 位置ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String organizationName;
|
||||
|
||||
/**
|
||||
* 病区名称
|
||||
*/
|
||||
private String wardName;
|
||||
|
||||
/** 病房ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long houseId;
|
||||
|
||||
/** 目标病房ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long targetHouseId;
|
||||
|
||||
/**
|
||||
* 病房名称
|
||||
*/
|
||||
private String houseName;
|
||||
|
||||
/** 病床ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long bedId;
|
||||
|
||||
/** 目标病床ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long targetBedId;
|
||||
|
||||
/**
|
||||
* 病床名称
|
||||
*/
|
||||
private String bedName;
|
||||
|
||||
/**
|
||||
* 费别
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 住院医生id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long admittingDoctorId;
|
||||
|
||||
/**
|
||||
* 主治医生id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long attendingDoctorId;
|
||||
|
||||
/**
|
||||
* 主任医生id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long chiefDoctorId;
|
||||
|
||||
/**
|
||||
* 责任护士id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long primaryNurseId;
|
||||
|
||||
/**
|
||||
* 住院医生
|
||||
*/
|
||||
private String admittingDoctorName;
|
||||
|
||||
/**
|
||||
* 主治医生
|
||||
*/
|
||||
private String attendingDoctorName;
|
||||
|
||||
/**
|
||||
* 主任医生
|
||||
*/
|
||||
private String chiefDoctorName;
|
||||
|
||||
/**
|
||||
* 责任护士
|
||||
*/
|
||||
private String primaryNurseName;
|
||||
|
||||
/**
|
||||
* 住院诊断
|
||||
*/
|
||||
private String conditionNames;
|
||||
|
||||
/**
|
||||
* 编辑标识
|
||||
*/
|
||||
private String editFlag;
|
||||
|
||||
// TODO 体温单相关字段
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
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-07-28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionPatientPageDto {
|
||||
|
||||
/**
|
||||
* 入院ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
private Integer encounterStatus;
|
||||
private String encounterStatus_enumText;
|
||||
|
||||
/**
|
||||
* 入院时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 出院时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 病情
|
||||
*/
|
||||
private Integer priorityEnum;
|
||||
private String priorityEnum_enumText;
|
||||
|
||||
/**
|
||||
* 入院类型
|
||||
*/
|
||||
@Dict(dictCode = "admit_source_code")
|
||||
private String admitSourceCode;
|
||||
private String admitSourceCode_dictText;
|
||||
|
||||
/**
|
||||
* 入院科室
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 患者拼音码 */
|
||||
private String patientPyStr;
|
||||
|
||||
/** 患者五笔码 */
|
||||
private String patientWbStr;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 病人年龄 */
|
||||
private String age;
|
||||
|
||||
/** 病区ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long wardId;
|
||||
|
||||
/**
|
||||
* 病区名称
|
||||
*/
|
||||
private String wardName;
|
||||
|
||||
/** 病房ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long houseId;
|
||||
|
||||
/**
|
||||
* 病房名称
|
||||
*/
|
||||
private String houseName;
|
||||
|
||||
/** 病床ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long bedId;
|
||||
|
||||
/**
|
||||
* 病床名称
|
||||
*/
|
||||
private String bedName;
|
||||
|
||||
/** 病床状态 */
|
||||
private Integer bedStatus;
|
||||
private String bedStatus_enumText;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String organizationName;
|
||||
|
||||
/**
|
||||
* 费别
|
||||
*/
|
||||
private String contractName;
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.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.web.common.dto.PerformRecordDto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 住院医嘱dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientAdviceDto {
|
||||
|
||||
/** 住院患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 医嘱所在表 */
|
||||
private String adviceTable; // 1:药品 , 2: 耗材 , 3:项目
|
||||
/**
|
||||
* 请求人id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_practitioner", dictCode = "id", dictText = "name")
|
||||
private Long requesterId;
|
||||
private String requesterId_dictText;
|
||||
|
||||
/** 请求时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date requestTime;
|
||||
|
||||
/** 医嘱开始时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 医嘱结束时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 诊断定义名称
|
||||
*/
|
||||
private String conditionDefinitionName;
|
||||
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 请求id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestId;
|
||||
|
||||
/** 医嘱名称 */
|
||||
private String adviceName;
|
||||
|
||||
/**
|
||||
* 医嘱项目id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long adviceId;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String volume;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 请求状态 */
|
||||
private Integer requestStatus;
|
||||
private String requestStatus_enumText;
|
||||
|
||||
/** 是否皮试 */
|
||||
private Integer skinTestFlag;
|
||||
private String skinTestFlag_enumText;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
private Integer injectFlag;
|
||||
private String injectFlag_enumText;
|
||||
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
@Dict(dictCode = "method_code")
|
||||
private String methodCode;
|
||||
private String methodCode_dictText;
|
||||
|
||||
/**
|
||||
* 使用频次
|
||||
*/
|
||||
@Dict(dictCode = "rate_code")
|
||||
private String rateCode;
|
||||
private String rateCode_dictText;
|
||||
|
||||
/**
|
||||
* 单次剂量
|
||||
*/
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/**
|
||||
* 物理位置id | 可能是 发药药房id,耗材房id,执行科室id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long positionId;
|
||||
|
||||
/**
|
||||
* 物理位置| 可能是 发药药房,耗材房,执行科室
|
||||
*/
|
||||
private String positionName;
|
||||
|
||||
/** 用药天数 */
|
||||
private Integer dispensePerDuration;
|
||||
|
||||
/** 拆零比 */
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/**
|
||||
* 中药付数
|
||||
*/
|
||||
private Integer chineseHerbsDoseQuantity;
|
||||
|
||||
/**
|
||||
* 代煎标识 | 0:否 , 1:是
|
||||
*/
|
||||
private Integer sufferingFlag;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Integer sortNumber;
|
||||
|
||||
/**
|
||||
* 频次时间点
|
||||
*/
|
||||
private String dayTimes;
|
||||
|
||||
/**
|
||||
* 执行时间点
|
||||
*/
|
||||
private List<PerformRecordDto> exePerformRecordList;
|
||||
|
||||
/**
|
||||
* 取消时间点
|
||||
*/
|
||||
private List<PerformRecordDto> cancelPerformRecordList;
|
||||
|
||||
/**
|
||||
* 停止时间点
|
||||
*/
|
||||
private List<PerformRecordDto> stopPerformRecordList;
|
||||
|
||||
/** 医嘱类型 */
|
||||
private Integer therapyEnum;
|
||||
private String therapyEnum_enumText;
|
||||
|
||||
/** 总执行次数 */
|
||||
private Integer executeNum;
|
||||
|
||||
/** 执行次数 */
|
||||
private Integer executeCount;
|
||||
|
||||
/** 住院号 */
|
||||
private String BusNo;
|
||||
|
||||
/** 患者名称 */
|
||||
private String patientName;
|
||||
|
||||
/** 床位名称 */
|
||||
private String badName;
|
||||
|
||||
/** 性别 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
|
||||
/** 费别 */
|
||||
private String contractName;
|
||||
|
||||
/** 诊断 */
|
||||
private String conditionNames;
|
||||
|
||||
/** 住院医生 */
|
||||
private String admittingDoctorName;
|
||||
|
||||
/** 余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 住院患者医嘱查询条件
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientAdviceParam {
|
||||
|
||||
/** 住院患者ids */
|
||||
private String encounterIds;
|
||||
|
||||
/** 住院患者id */
|
||||
private Long encounterId;
|
||||
|
||||
/** 医嘱类型 */
|
||||
private Integer therapyEnum;
|
||||
|
||||
/** 执行状态 */
|
||||
private Integer exeStatus;
|
||||
|
||||
/** 请求状态 */
|
||||
private Integer requestStatus;
|
||||
|
||||
/** 截至时间 */
|
||||
private String deadline;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 就诊人员列表
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientMedicineEncounterInfoDto {
|
||||
|
||||
/** 科室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 科室 */
|
||||
private String organizationName;
|
||||
|
||||
/** 就诊id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
/** 住院号 */
|
||||
private String busNo;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 拼音码 */
|
||||
private String patientPyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String patientWbStr;
|
||||
|
||||
/** 性别 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
private Date birthDate;
|
||||
|
||||
/** 年龄 */
|
||||
private String age;
|
||||
|
||||
/** 床位 */
|
||||
private String inpatientBed;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
*住院领药初期dto
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientMedicineInitDto {
|
||||
|
||||
/** 科室列表 */
|
||||
private List<LongOptions> departmentOptions;
|
||||
/** 领药人列表 */
|
||||
private List<Practitioner> applicantOptions;
|
||||
|
||||
/** 发药状态 */
|
||||
private List<IntegerOptions> dispenseStatusOptions;
|
||||
|
||||
@Data
|
||||
public static class LongOptions {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long value;
|
||||
private String label;
|
||||
|
||||
public LongOptions(Long value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class IntegerOptions {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public IntegerOptions(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 医嘱列表
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientMedicinePrescriptionInfoDto {
|
||||
|
||||
/**
|
||||
* 药品发放id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long dispenseId;
|
||||
|
||||
/**
|
||||
* 药品发放id
|
||||
*/
|
||||
private String dispenseIds;
|
||||
|
||||
/**
|
||||
* 治疗类型
|
||||
*/
|
||||
private Integer therapyEnum;
|
||||
private String therapyEnum_enumText;
|
||||
|
||||
/**
|
||||
* 预定发药时间
|
||||
*/
|
||||
private Date plannedDispenseTime;
|
||||
|
||||
/**
|
||||
* 就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String patientName;
|
||||
|
||||
/**
|
||||
* 发放状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/**
|
||||
* 项目表
|
||||
*/
|
||||
private String itemTable;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 项目名
|
||||
*/
|
||||
private String itemName;
|
||||
|
||||
/**
|
||||
* 请求数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 请求单位编码
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/**
|
||||
* 发放地点
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
/**
|
||||
* 发放地点
|
||||
*/
|
||||
private String locationName;
|
||||
/**
|
||||
* 地点类型
|
||||
*/
|
||||
private Integer locationEnum;
|
||||
private String locationEnum_enumText;
|
||||
|
||||
/**
|
||||
* 批号
|
||||
*/
|
||||
private String lotNumber;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String totalVolume;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 患者列表查询条件
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientMedicineSearchParam implements Serializable {
|
||||
|
||||
/** 科室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 医嘱类型 */
|
||||
private Integer therapyEnum;
|
||||
|
||||
/**
|
||||
* 领药至哪天
|
||||
* */
|
||||
private Date plannedDispenseTime;
|
||||
|
||||
/** 就诊id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private List<Long> encounterIdList;
|
||||
|
||||
/** 发放id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long dispenseId;
|
||||
|
||||
/**
|
||||
* 项目表
|
||||
*/
|
||||
private String itemTable;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.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.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionBedPageDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPageParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPatientInfoDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPatientPageDto;
|
||||
|
||||
/**
|
||||
* 入出转管理 appMapper
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Repository
|
||||
public interface ATDManageAppMapper {
|
||||
|
||||
/**
|
||||
* 入院患者分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param imp 就诊类型:住院
|
||||
* @param toBeRegistered 就诊状态:待登记
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param ward 位置类型:病区
|
||||
* @param house 位置类型:病房
|
||||
* @param bed 位置类型:病床
|
||||
* @return 入院患者分页列表
|
||||
*/
|
||||
Page<AdmissionPatientPageDto> selectAdmissionPatientPage(@Param("page") Page<AdmissionPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<AdmissionPageParam> queryWrapper, @Param("imp") Integer imp,
|
||||
@Param("toBeRegistered") Integer toBeRegistered, @Param("active") Integer active, @Param("ward") Integer ward,
|
||||
@Param("house") Integer house, @Param("bed") Integer bed);
|
||||
|
||||
/**
|
||||
* 入院患者床位信息分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param ward 位置类型:病区
|
||||
* @param house 位置类型:病房
|
||||
* @param bed 位置类型:病床
|
||||
* @param personalCashAccount 账户类型:个人现金账户
|
||||
* @param inactive 床位状态:停用
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunded 收费状态:已退费
|
||||
* @return 患者床位信息分页列表
|
||||
*/
|
||||
Page<AdmissionBedPageDto> selectAdmissionBadPage(@Param("page") Page<AdmissionBedPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<AdmissionPageParam> queryWrapper, @Param("active") Integer active,
|
||||
@Param("ward") Integer ward, @Param("house") Integer house, @Param("bed") Integer bed,
|
||||
@Param("personalCashAccount") String personalCashAccount, @Param("inactive") Integer inactive,
|
||||
@Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded);
|
||||
|
||||
/**
|
||||
* 查询住院患者详细信息
|
||||
*
|
||||
* @param encounterId 住院id
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param ward 位置类型:病区
|
||||
* @param house 位置类型:病房
|
||||
* @param bed 位置类型:病床
|
||||
* @param primaryNurse 住院参与人:责任护士
|
||||
* @param attendingDoctor 住院参与人:主治医生
|
||||
* @param admittingDoctor 住院参与人:住院医生
|
||||
* @param chiefDoctor 住院参与人:主任医生
|
||||
* @return 住院患者详细信息
|
||||
*/
|
||||
AdmissionPatientInfoDto selectAdmissionPatientInfo(@Param("encounterId") Long encounterId,
|
||||
@Param("active") Integer active, @Param("ward") Integer ward, @Param("house") Integer house,
|
||||
@Param("bed") Integer bed, @Param("primaryNurse") String primaryNurse,
|
||||
@Param("attendingDoctor") String attendingDoctor, @Param("admittingDoctor") String admittingDoctor,
|
||||
@Param("chiefDoctor") String chiefDoctor);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.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.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPageParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPatientPageDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceParam;
|
||||
|
||||
/**
|
||||
* 护士站医嘱处理 mapper
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
@Repository
|
||||
public interface AdviceProcessAppMapper {
|
||||
|
||||
/**
|
||||
* 入院患者分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param imp 就诊类型:住院
|
||||
* @param toBeRegistered 就诊状态:待登记
|
||||
* @param registered 就诊状态:待入院
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param ward 位置类型:病区
|
||||
* @param house 位置类型:病房
|
||||
* @param bed 位置类型:病床
|
||||
* @return 入院患者分页列表
|
||||
*/
|
||||
Page<AdmissionPatientPageDto> selectInpatientPage(@Param("page") Page<AdmissionPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<AdmissionPageParam> queryWrapper, @Param("imp") Integer imp,
|
||||
@Param("toBeRegistered") Integer toBeRegistered, @Param("registered") Integer registered,
|
||||
@Param("active") Integer active, @Param("ward") Integer ward, @Param("house") Integer house,
|
||||
@Param("bed") Integer bed);
|
||||
|
||||
/**
|
||||
* 查询医嘱分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param worServiceRequest 请求所在表:服务请求
|
||||
* @param medMedicationRequest 请求所在表:药品请求
|
||||
* @param draft 医嘱状态:待发送
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param bed 位置类型:病床
|
||||
* @param admittingDoctor 住院医生
|
||||
* @param personalCashAccount 个人现金账户
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunded 收费状态:已退费
|
||||
* @param imp 患者状态:住院
|
||||
* @return 医嘱分页列表
|
||||
*/
|
||||
Page<InpatientAdviceDto> selectInpatientAdvicePage(@Param("page") Page<InpatientAdviceDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientAdviceParam> queryWrapper,
|
||||
@Param("medMedicationRequest") String medMedicationRequest,
|
||||
@Param("worServiceRequest") String worServiceRequest, @Param("draft") Integer draft,
|
||||
@Param("active") Integer active, @Param("bed") Integer bed, @Param("admittingDoctor") String admittingDoctor,
|
||||
@Param("personalCashAccount") String personalCashAccount, @Param("billable") Integer billable,
|
||||
@Param("billed") Integer billed, @Param("refunded") Integer refunded, @Param("imp") Integer imp);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.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.inhospitalnursestation.dto.*;
|
||||
|
||||
@Repository
|
||||
public interface InpatientMedicineCollectionMapper {
|
||||
|
||||
/**
|
||||
* 就诊病人列表分页查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @param amb 住院
|
||||
* @return 就诊病人列表
|
||||
*/
|
||||
Page<InpatientMedicineEncounterInfoDto> selectEncounterInfoListPage(
|
||||
@Param("page") Page<InpatientMedicineEncounterInfoDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientMedicineSearchParam> queryWrapper, @Param("amb") Integer amb);
|
||||
|
||||
/**
|
||||
* 医嘱列表查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @param encounterIdList 就诊id
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
Page<InpatientMedicinePrescriptionInfoDto> selectPrescriptionInfoListPage(
|
||||
@Param("page") Page<InpatientMedicinePrescriptionInfoDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientMedicineSearchParam> queryWrapper,
|
||||
@Param("encounterIdList") List<Long> encounterIdList,
|
||||
@Param("statusEnum") Integer statusEnum,
|
||||
@Param("medMedicationDefinition") String medMedicationDefinition,
|
||||
@Param("admDeviceDefinition") String admDeviceDefinition);
|
||||
|
||||
/**
|
||||
* 医嘱汇总列表查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param medDispenseIdList 药品发放id
|
||||
* @param medDispenseIdList 耗材发放id
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
Page<InpatientMedicinePrescriptionInfoDto> selectPrescriptionSummaryInfoListPage(
|
||||
@Param("page") Page<InpatientMedicinePrescriptionInfoDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientMedicineSearchParam> queryWrapper,
|
||||
@Param("dispenseIdList") List<Long> medDispenseIdList,
|
||||
@Param("dispenseIdList") List<Long> devDispenseIdList,
|
||||
@Param("medMedicationDefinition") String medMedicationDispense,
|
||||
@Param("admDeviceDefinition") String admDeviceDispense);
|
||||
}
|
||||
Reference in New Issue
Block a user