提交merge1.3
This commit is contained in:
@@ -36,7 +36,7 @@ public interface IATDManageAppService {
|
||||
* @return 入院患者分页列表
|
||||
*/
|
||||
R<?> getAdmissionPatientPage(AdmissionPageParam admissionPageParam, Integer pageNo, Integer pageSize,
|
||||
String searchKey, HttpServletRequest request);
|
||||
String searchKey, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 入院患者床位信息分页列表
|
||||
@@ -56,16 +56,7 @@ public interface IATDManageAppService {
|
||||
*/
|
||||
R<?> getAdmissionPatientInfo(Long encounterId);
|
||||
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD
|
||||
* 住院患者待处理信息列表
|
||||
*
|
||||
* @param encounterId 住院id
|
||||
* @return 待处理信息列表
|
||||
*/
|
||||
R<?> getInPatientPendingList(Long encounterId);
|
||||
=======
|
||||
* 住院患者待处理列表查询
|
||||
*
|
||||
* @param inpatientAdviceParam 查询条件
|
||||
@@ -74,7 +65,6 @@ public interface IATDManageAppService {
|
||||
* @return 住院患者医
|
||||
*/
|
||||
R<?> getInPatientPendingList(InpatientAdviceParam inpatientAdviceParam, Integer pageNo, Integer pageSize);
|
||||
>>>>>>> v1.3
|
||||
|
||||
/**
|
||||
* 入科床位分配
|
||||
@@ -87,11 +77,7 @@ public interface IATDManageAppService {
|
||||
/**
|
||||
* 转科
|
||||
*
|
||||
<<<<<<< HEAD
|
||||
* @param encounterId 住院id
|
||||
=======
|
||||
* @param encounterId 住院患者id
|
||||
>>>>>>> v1.3
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> transferDepartment(Long encounterId);
|
||||
@@ -99,12 +85,6 @@ public interface IATDManageAppService {
|
||||
/**
|
||||
* 出院
|
||||
*
|
||||
<<<<<<< HEAD
|
||||
* @param encounterId 住院id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> hospitalDischarge(Long encounterId);
|
||||
=======
|
||||
* @param encounterId 住院患者id
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -120,18 +100,19 @@ public interface IATDManageAppService {
|
||||
|
||||
/**
|
||||
* 诊断个人账户金额信息获取
|
||||
*
|
||||
*
|
||||
* @param encounterId 诊断id
|
||||
* @return EncounterAccountDto 诊断账户金额
|
||||
**/
|
||||
*
|
||||
*/
|
||||
R<?> getAmount(Long encounterId);
|
||||
|
||||
/**
|
||||
* 获取待配/退药
|
||||
*
|
||||
*
|
||||
* @param encounterId 诊断id
|
||||
* @return PendingMedicationDto 待配/退药
|
||||
**/
|
||||
*
|
||||
*/
|
||||
R<?> getPendingMedication(Long encounterId);
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
@@ -17,21 +17,6 @@ import com.openhis.web.inhospitalnursestation.dto.MedicineSummaryParam;
|
||||
public interface IMedicineSummaryAppService {
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD
|
||||
* 查询发药单信息
|
||||
*
|
||||
* @param dispenseFormSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求
|
||||
* @return 发药单信息
|
||||
*/
|
||||
R<?> getMedicineDispenseFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询药品汇总单
|
||||
=======
|
||||
* 药品汇总单初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
@@ -40,31 +25,15 @@ public interface IMedicineSummaryAppService {
|
||||
|
||||
/**
|
||||
* 查询发药单信息
|
||||
>>>>>>> v1.3
|
||||
*
|
||||
* @param dispenseFormSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
<<<<<<< HEAD
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求
|
||||
* @return 药品汇总单
|
||||
*/
|
||||
R<?> getMedicineSummaryFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo, Integer pageSize,
|
||||
String searchKey, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询药品汇总单详情
|
||||
*
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 药品汇总单详情
|
||||
*/
|
||||
=======
|
||||
* @param request 请求
|
||||
* @return 发药单信息
|
||||
*/
|
||||
R<?> getMedicineDispenseFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询药品汇总单
|
||||
@@ -77,7 +46,7 @@ public interface IMedicineSummaryAppService {
|
||||
* @return 药品汇总单
|
||||
*/
|
||||
R<?> getMedicineSummaryFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo, Integer pageSize,
|
||||
String searchKey, HttpServletRequest request);
|
||||
String searchKey, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询药品汇总单详情
|
||||
@@ -85,7 +54,6 @@ public interface IMedicineSummaryAppService {
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 药品汇总单详情
|
||||
*/
|
||||
>>>>>>> v1.3
|
||||
R<?> getMedicineSummaryFormDetail(String summaryNo);
|
||||
|
||||
/**
|
||||
@@ -102,16 +70,5 @@ public interface IMedicineSummaryAppService {
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 处理结果
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
R<?> checkInventoryItem(List<Long> devDispenseId, List<Long> medDispenseId);
|
||||
|
||||
/**
|
||||
* 取消汇总
|
||||
*
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 处理结果
|
||||
*/
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
R<?> cancelSummary(String summaryNo);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.openhis.web.inhospitalnursestation.appservice;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.core.common.core.domain.R;
|
||||
=======
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@@ -13,48 +10,20 @@ import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.dto.CostDetailSearchParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceParam;
|
||||
import com.openhis.web.regdoctorstation.dto.AdviceBatchOpParam;
|
||||
>>>>>>> v1.3
|
||||
import com.openhis.web.regdoctorstation.dto.RegAdviceSaveParam;
|
||||
|
||||
public interface INurseBillingAppService {
|
||||
|
||||
/*
|
||||
* 住院护士 划价添加
|
||||
* @return
|
||||
*/
|
||||
public R<?> addInNurseBilling(RegAdviceSaveParam regAdviceSaveParam);
|
||||
<<<<<<< HEAD
|
||||
/*
|
||||
* 住院护士 划价列表 根据护士encounterId查询
|
||||
* @return
|
||||
*/
|
||||
public R<?> getBillingListByEncounterId();
|
||||
=======
|
||||
|
||||
>>>>>>> v1.3
|
||||
/*
|
||||
* 住院护士撤销划价
|
||||
* @return
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
public R<?> deleteInNurseBilling();
|
||||
/*
|
||||
* 医嘱计费添加 诊疗 耗材
|
||||
*/
|
||||
public R<?> addOrderBilling();
|
||||
/*
|
||||
* 医嘱计费删除 诊疗 耗材
|
||||
*/
|
||||
public R<?> deleteOrderBilling();
|
||||
/*
|
||||
* 医嘱计费修改 诊疗 耗材
|
||||
*/
|
||||
public R<?> updateOrderBilling();
|
||||
/*
|
||||
根据医嘱id查询已计费的 耗材列表
|
||||
* @return
|
||||
*/
|
||||
public R<?> getOrderBillingByRequestId();
|
||||
=======
|
||||
public R<?> deleteInNurseBilling(List<AdviceBatchOpParam> paramList);
|
||||
|
||||
/**
|
||||
@@ -66,7 +35,7 @@ public interface INurseBillingAppService {
|
||||
* @return 住院患者医
|
||||
*/
|
||||
R<?> getInNurseBillingPage(InpatientAdviceParam inpatientAdviceParam, Integer pageNo, Integer pageSize,
|
||||
LocalDateTime startTime, LocalDateTime endTime);
|
||||
LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
/*
|
||||
* 医嘱计费添加 诊疗 耗材
|
||||
@@ -94,12 +63,11 @@ public interface INurseBillingAppService {
|
||||
|
||||
/**
|
||||
* 费用明细导出
|
||||
*
|
||||
*
|
||||
* @param costDetailSearchParam 查询条件
|
||||
* @param request request请求
|
||||
* @param response response响应
|
||||
*/
|
||||
void makeExcelFile(CostDetailSearchParam costDetailSearchParam, HttpServletRequest request,
|
||||
HttpServletResponse response);
|
||||
>>>>>>> v1.3
|
||||
HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,7 @@ import com.openhis.web.inhospitalnursestation.dto.OrgDeviceSummaryParam;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import java.util.List;
|
||||
>>>>>>> v1.3
|
||||
|
||||
/**
|
||||
* 科室耗材盘点 应用实现接口
|
||||
@@ -19,13 +16,6 @@ import java.util.List;
|
||||
public interface IOrgDeviceStockTakeAppService {
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD
|
||||
* 查询科室耗材汇总
|
||||
*
|
||||
* @param orgDeviceSummaryParam 查询条件
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
=======
|
||||
* 页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
@@ -36,30 +26,21 @@ public interface IOrgDeviceStockTakeAppService {
|
||||
* 查询科室耗材汇总
|
||||
*
|
||||
* @param orgDeviceSummaryParam 查询条件
|
||||
>>>>>>> v1.3
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求
|
||||
* @return 科室耗材汇总单
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
R<?> getOrgDeviceSummaryFromPage(OrgDeviceSummaryParam orgDeviceSummaryParam, String startTime, String endTime,
|
||||
=======
|
||||
R<?> getOrgDeviceSummaryFromPage(OrgDeviceSummaryParam orgDeviceSummaryParam,
|
||||
>>>>>>> v1.3
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, String searchKey,
|
||||
HttpServletRequest request);
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, String searchKey,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 科室耗材汇总
|
||||
*
|
||||
* @return 科室耗材汇总单
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
R<?> orgDeviceSummary(OrgDeviceSummaryParam orgDeviceSummaryParam);
|
||||
=======
|
||||
R<?> orgDeviceSummary(List<OrgDeviceSummaryParam> orgDeviceSummaryParamList);
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
@@ -105,23 +105,23 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
// 住院状态
|
||||
List<ATDManageInitDto.encounterStatusOption> encounterStatusOptions = new ArrayList<>();
|
||||
encounterStatusOptions.add(new ATDManageInitDto.encounterStatusOption(EncounterZyStatus.REGISTERED.getValue(),
|
||||
EncounterZyStatus.REGISTERED.getInfo()));
|
||||
EncounterZyStatus.REGISTERED.getInfo()));
|
||||
encounterStatusOptions
|
||||
.add(new ATDManageInitDto.encounterStatusOption(EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getValue(),
|
||||
EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getInfo()));
|
||||
.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()));
|
||||
.add(new ATDManageInitDto.bedStatusOption(LocationStatus.IDLE.getValue(), LocationStatus.IDLE.getInfo()));
|
||||
bedStatusOptions.add(
|
||||
new ATDManageInitDto.bedStatusOption(LocationStatus.OCCUPY.getValue(), LocationStatus.OCCUPY.getInfo()));
|
||||
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());
|
||||
.map(
|
||||
priorityLevel -> new ATDManageInitDto.priorityOption(priorityLevel.getValue(), priorityLevel.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
atdManageInitDto.setBedStatusOptions(bedStatusOptions).setEncounterStatusOptions(encounterStatusOptions)
|
||||
.setPriorityOptions(priorityOptions);
|
||||
.setPriorityOptions(priorityOptions);
|
||||
return R.ok(atdManageInitDto);
|
||||
}
|
||||
|
||||
@@ -137,17 +137,17 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAdmissionPatientPage(AdmissionPageParam admissionPageParam, Integer pageNo, Integer pageSize,
|
||||
String searchKey, HttpServletRequest request) {
|
||||
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);
|
||||
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(), EncounterActivityStatus.ACTIVE.getValue(),
|
||||
LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(), LocationForm.BED.getValue());
|
||||
new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.IMP.getValue(),
|
||||
EncounterZyStatus.TO_BE_REGISTERED.getValue(), EncounterActivityStatus.ACTIVE.getValue(),
|
||||
LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(), LocationForm.BED.getValue());
|
||||
admissionPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
@@ -174,15 +174,15 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
@Override
|
||||
public R<?> getAdmissionBedPage(AdmissionPageParam admissionPageParam, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<AdmissionPageParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(admissionPageParam, null, null, null);
|
||||
QueryWrapper<AdmissionPageParam> queryWrapper
|
||||
= HisQueryUtils.buildQueryWrapper(admissionPageParam, null, null, null);
|
||||
// 入院患者床位分页列表
|
||||
Page<AdmissionBedPageDto> admissionBedPage =
|
||||
atdManageAppMapper.selectAdmissionBadPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
EncounterActivityStatus.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());
|
||||
Page<AdmissionBedPageDto> admissionBedPage
|
||||
= atdManageAppMapper.selectAdmissionBadPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
EncounterActivityStatus.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()));
|
||||
@@ -207,42 +207,27 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
@Override
|
||||
public R<?> getAdmissionPatientInfo(Long encounterId) {
|
||||
// 查询住院患者详细信息
|
||||
AdmissionPatientInfoDto admissionPatientInfoDto =
|
||||
atdManageAppMapper.selectAdmissionPatientInfo(encounterId, EncounterActivityStatus.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 admissionPatientInfoDto
|
||||
= atdManageAppMapper.selectAdmissionPatientInfo(encounterId, EncounterActivityStatus.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());
|
||||
// 年龄
|
||||
if (admissionPatientInfoDto.getBirthDate() != null) {
|
||||
admissionPatientInfoDto.setAge(AgeCalculatorUtil.getAge(admissionPatientInfoDto.getBirthDate()));
|
||||
}
|
||||
// 性别
|
||||
admissionPatientInfoDto.setGenderEnum_enumText(
|
||||
EnumUtils.getInfoByValue(AdministrativeGender.class, admissionPatientInfoDto.getGenderEnum()));
|
||||
EnumUtils.getInfoByValue(AdministrativeGender.class, admissionPatientInfoDto.getGenderEnum()));
|
||||
// 病情
|
||||
admissionPatientInfoDto.setPriorityEnum_enumText(
|
||||
EnumUtils.getInfoByValue(PriorityLevel.class, admissionPatientInfoDto.getPriorityEnum()));
|
||||
EnumUtils.getInfoByValue(PriorityLevel.class, admissionPatientInfoDto.getPriorityEnum()));
|
||||
// 获取入院体征
|
||||
getAdmissionSigns(encounterId, admissionPatientInfoDto);
|
||||
return R.ok(admissionPatientInfoDto);
|
||||
}
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD
|
||||
* 住院患者待处理信息列表
|
||||
*
|
||||
* @param encounterId 住院id
|
||||
* @return 待处理信息列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getInPatientPendingList(Long encounterId) {
|
||||
// List<InpatientAdviceDto> inPatientPendingList =
|
||||
// atdManageAppMapper.selectInPatientPendingList(encounterId, EncounterActivityStatus.ACTIVE.getValue(),
|
||||
// LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue(), LocationForm.BED.getValue(),
|
||||
// ParticipantType.PRIMARY_NURSE.getCode(), ParticipantType.ATTENDING_DOCTOR.getCode(),
|
||||
// ParticipantType.ADMITTING_DOCTOR.getCode());
|
||||
return null;
|
||||
=======
|
||||
* 住院患者医嘱查询
|
||||
*
|
||||
* @param inpatientAdviceParam 查询条件
|
||||
@@ -253,19 +238,19 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
@Override
|
||||
public R<?> getInPatientPendingList(InpatientAdviceParam inpatientAdviceParam, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<InpatientAdviceParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
|
||||
QueryWrapper<InpatientAdviceParam> queryWrapper
|
||||
= HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
|
||||
|
||||
// 患者医嘱分页列表
|
||||
Page<InpatientAdviceDto> inpatientAdvicePage = atdManageAppMapper.selectInpatientAdvicePage(
|
||||
new Page<>(pageNo, pageSize), queryWrapper, CommonConstants.TableName.MED_MEDICATION_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, RequestStatus.DRAFT.getValue(),
|
||||
RequestStatus.STOPPED.getValue(), EncounterActivityStatus.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(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue(), ActivityDefCategory.TRANSFER.getCode(),
|
||||
ActivityDefCategory.DISCHARGE.getCode(), ActivityDefCategory.NURSING.getCode());
|
||||
new Page<>(pageNo, pageSize), queryWrapper, CommonConstants.TableName.MED_MEDICATION_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, RequestStatus.DRAFT.getValue(),
|
||||
RequestStatus.STOPPED.getValue(), EncounterActivityStatus.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(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue(), ActivityDefCategory.TRANSFER.getCode(),
|
||||
ActivityDefCategory.DISCHARGE.getCode(), ActivityDefCategory.NURSING.getCode());
|
||||
inpatientAdvicePage.getRecords().forEach(e -> {
|
||||
// 是否皮试
|
||||
e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag()));
|
||||
@@ -283,7 +268,6 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
}
|
||||
});
|
||||
return R.ok(inpatientAdvicePage);
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -319,19 +303,19 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
// 更新住院参与者
|
||||
// 住院医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getAdmittingDoctorId(), ParticipantType.ADMITTING_DOCTOR.getCode());
|
||||
admissionPatientInfoDto.getAdmittingDoctorId(), ParticipantType.ADMITTING_DOCTOR.getCode());
|
||||
// 责任护士
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getPrimaryNurseId(), ParticipantType.PRIMARY_NURSE.getCode());
|
||||
admissionPatientInfoDto.getPrimaryNurseId(), ParticipantType.PRIMARY_NURSE.getCode());
|
||||
if (admissionPatientInfoDto.getAttendingDoctorId() != null) {
|
||||
// 主治医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getAttendingDoctorId(), ParticipantType.ATTENDING_DOCTOR.getCode());
|
||||
admissionPatientInfoDto.getAttendingDoctorId(), ParticipantType.ATTENDING_DOCTOR.getCode());
|
||||
}
|
||||
if (admissionPatientInfoDto.getChiefDoctorId() != null) {
|
||||
// 主任医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getChiefDoctorId(), ParticipantType.CHIEF_DOCTOR.getCode());
|
||||
admissionPatientInfoDto.getChiefDoctorId(), ParticipantType.CHIEF_DOCTOR.getCode());
|
||||
}
|
||||
}
|
||||
// 更新入院体征
|
||||
@@ -343,13 +327,13 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
if (oldBedId != null) {
|
||||
// 判断目标床位是否已经被占用
|
||||
if (targetEncounterId != null) {
|
||||
List<EncounterLocation> locationList =
|
||||
encounterLocationService.getEncounterLocationInfo(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(EncounterActivityStatus.ACTIVE.getValue())).findFirst();
|
||||
Optional<EncounterLocation> encounterLocationOptional
|
||||
= locationList.stream().filter(x -> x.getFormEnum().equals(LocationForm.BED.getValue()))
|
||||
.filter(x -> x.getStatusEnum().equals(EncounterActivityStatus.ACTIVE.getValue())).findFirst();
|
||||
if (encounterLocationOptional.isPresent()) {
|
||||
EncounterLocation encounterLocation = encounterLocationOptional.get();
|
||||
targetStartTime = encounterLocation.getStartTime();
|
||||
@@ -363,18 +347,18 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
// 保存住院位置(目标床位)
|
||||
// 病房
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime,
|
||||
admissionPatientInfoDto.getTargetHouseId(), LocationForm.HOUSE.getValue());
|
||||
admissionPatientInfoDto.getTargetHouseId(), LocationForm.HOUSE.getValue());
|
||||
// 病床
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime, targetBedId,
|
||||
LocationForm.BED.getValue());
|
||||
LocationForm.BED.getValue());
|
||||
|
||||
// 保存住院位置(原床位)
|
||||
// 病房
|
||||
encounterLocationService.creatEncounterLocation(targetEncounterId, targetStartTime,
|
||||
admissionPatientInfoDto.getHouseId(), LocationForm.HOUSE.getValue());
|
||||
admissionPatientInfoDto.getHouseId(), LocationForm.HOUSE.getValue());
|
||||
// 病床
|
||||
encounterLocationService.creatEncounterLocation(targetEncounterId, targetStartTime, oldBedId,
|
||||
LocationForm.BED.getValue());
|
||||
LocationForm.BED.getValue());
|
||||
|
||||
} else {
|
||||
// 更新旧病床状态:空闲
|
||||
@@ -388,10 +372,10 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
// 保存住院位置
|
||||
// 病房
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime,
|
||||
admissionPatientInfoDto.getTargetHouseId(), LocationForm.HOUSE.getValue());
|
||||
admissionPatientInfoDto.getTargetHouseId(), LocationForm.HOUSE.getValue());
|
||||
// 病床
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime, targetBedId,
|
||||
LocationForm.BED.getValue());
|
||||
LocationForm.BED.getValue());
|
||||
// 更新病床状态:占用
|
||||
locationService.updateStatusById(targetBedId, LocationStatus.OCCUPY.getValue());
|
||||
}
|
||||
@@ -399,29 +383,29 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
// 保存住院位置
|
||||
// 病房
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime,
|
||||
admissionPatientInfoDto.getTargetHouseId(), LocationForm.HOUSE.getValue());
|
||||
admissionPatientInfoDto.getTargetHouseId(), LocationForm.HOUSE.getValue());
|
||||
// 病床
|
||||
encounterLocationService.creatEncounterLocation(encounterId, startTime, targetBedId,
|
||||
LocationForm.BED.getValue());
|
||||
LocationForm.BED.getValue());
|
||||
// 更新病床状态:占用
|
||||
locationService.updateStatusById(targetBedId, LocationStatus.OCCUPY.getValue());
|
||||
|
||||
// 保存住院参与者
|
||||
// 住院医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getAdmittingDoctorId(), ParticipantType.ADMITTING_DOCTOR.getCode());
|
||||
admissionPatientInfoDto.getAdmittingDoctorId(), ParticipantType.ADMITTING_DOCTOR.getCode());
|
||||
// 责任护士
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getPrimaryNurseId(), ParticipantType.PRIMARY_NURSE.getCode());
|
||||
admissionPatientInfoDto.getPrimaryNurseId(), ParticipantType.PRIMARY_NURSE.getCode());
|
||||
if (admissionPatientInfoDto.getAttendingDoctorId() != null) {
|
||||
// 主治医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getAttendingDoctorId(), ParticipantType.ATTENDING_DOCTOR.getCode());
|
||||
admissionPatientInfoDto.getAttendingDoctorId(), ParticipantType.ATTENDING_DOCTOR.getCode());
|
||||
}
|
||||
if (admissionPatientInfoDto.getChiefDoctorId() != null) {
|
||||
// 主任医生
|
||||
encounterParticipantService.creatEncounterParticipants(encounterId, startTime,
|
||||
admissionPatientInfoDto.getChiefDoctorId(), ParticipantType.CHIEF_DOCTOR.getCode());
|
||||
admissionPatientInfoDto.getChiefDoctorId(), ParticipantType.CHIEF_DOCTOR.getCode());
|
||||
}
|
||||
}
|
||||
if (admissionPatientInfoDto.getPriorityEnum() != null) {
|
||||
@@ -429,8 +413,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
encounterService.updatePriorityEnumById(encounterId, admissionPatientInfoDto.getPriorityEnum());
|
||||
}
|
||||
// 更新住院状态:已住院
|
||||
Integer result =
|
||||
encounterService.updateEncounterStatus(encounterId, EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getValue());
|
||||
Integer result
|
||||
= encounterService.updateEncounterStatus(encounterId, EncounterZyStatus.ADMITTED_TO_THE_HOSPITAL.getValue());
|
||||
if (result == 0) {
|
||||
return R.fail("床位分配失败,请联系管理员");
|
||||
}
|
||||
@@ -442,42 +426,35 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
/**
|
||||
* 转科
|
||||
*
|
||||
<<<<<<< HEAD
|
||||
* @param encounterId 住院id
|
||||
=======
|
||||
* @param encounterId 住院患者id
|
||||
>>>>>>> v1.3
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> transferDepartment(Long encounterId) {
|
||||
<<<<<<< HEAD
|
||||
return null;
|
||||
=======
|
||||
if (encounterId == null) {
|
||||
return R.fail("转科失败,请选择有效的患者");
|
||||
}
|
||||
// 获取是否还有待执行医嘱
|
||||
List<MedicationRequest> medicationRequestList = medicationRequestService
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().eq(MedicationRequest::getEncounterId, encounterId)
|
||||
.ne(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().eq(MedicationRequest::getEncounterId, encounterId)
|
||||
.ne(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
List<ServiceRequest> serviceRequestList = serviceRequestService
|
||||
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getEncounterId, encounterId)
|
||||
.ne(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.TRANSFER.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.DISCHARGE.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.NURSING.getValue())
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getEncounterId, encounterId)
|
||||
.ne(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.TRANSFER.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.DISCHARGE.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.NURSING.getValue())
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
if (!medicationRequestList.isEmpty() || !serviceRequestList.isEmpty()) {
|
||||
return R.fail("有待执行的医嘱,请执行完后再转科");
|
||||
}
|
||||
// 查询患者待取的药品
|
||||
List<MedicationDispense> medicationDispenseList = medicationDispenseService
|
||||
.list(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getEncounterId, encounterId)
|
||||
.in(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUMMARIZED.getValue())
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
.list(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getEncounterId, encounterId)
|
||||
.in(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUMMARIZED.getValue())
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
if (!medicationDispenseList.isEmpty()) {
|
||||
return R.fail("患者有待取的药品,请先取药");
|
||||
}
|
||||
@@ -485,9 +462,9 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
Encounter encounter = encounterService.getById(encounterId);
|
||||
// 查询转科信息
|
||||
List<OrderProcess> orderProcessList = orderProcessService
|
||||
.list(new LambdaQueryWrapper<OrderProcess>().eq(OrderProcess::getEncounterId, encounterId)
|
||||
.eq(OrderProcess::getOriginalOrganizationId, encounter.getOrganizationId())
|
||||
.orderByDesc(OrderProcess::getCreateTime));
|
||||
.list(new LambdaQueryWrapper<OrderProcess>().eq(OrderProcess::getEncounterId, encounterId)
|
||||
.eq(OrderProcess::getOriginalOrganizationId, encounter.getOrganizationId())
|
||||
.orderByDesc(OrderProcess::getCreateTime));
|
||||
if (orderProcessList.isEmpty()) {
|
||||
return R.fail("转科失败,请检查转科信息");
|
||||
}
|
||||
@@ -495,7 +472,7 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
|
||||
// 更新原病床状态:空闲
|
||||
List<EncounterLocation> encounterLocationList = encounterLocationService.getEncounterLocationList(encounterId,
|
||||
LocationForm.BED, EncounterActivityStatus.ACTIVE);
|
||||
LocationForm.BED, EncounterActivityStatus.ACTIVE);
|
||||
if (encounterLocationList == null || encounterLocationList.size() != 1) {
|
||||
return R.fail("清床失败,请检查病床状态");
|
||||
}
|
||||
@@ -506,59 +483,51 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
encounterParticipantService.updateEncounterParticipantsStatus(encounterId);
|
||||
// 新增患者待转病区
|
||||
encounterLocationService.creatEncounterLocation(encounterId, DateUtils.getNowDate(),
|
||||
orderProcess.getTargetLocationId(), LocationForm.WARD.getValue());
|
||||
orderProcess.getTargetLocationId(), LocationForm.WARD.getValue());
|
||||
// 更新住院信息
|
||||
encounter.setOrganizationId(orderProcess.getTargetOrganizationId())
|
||||
.setStatusEnum(EncounterZyStatus.REGISTERED.getValue());
|
||||
.setStatusEnum(EncounterZyStatus.REGISTERED.getValue());
|
||||
return R.ok("转科成功");
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
/**
|
||||
* 出院
|
||||
*
|
||||
<<<<<<< HEAD
|
||||
* @param encounterId 住院id
|
||||
=======
|
||||
* @param encounterId 住院患者id
|
||||
>>>>>>> v1.3
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> hospitalDischarge(Long encounterId) {
|
||||
<<<<<<< HEAD
|
||||
return null;
|
||||
=======
|
||||
if (encounterId == null) {
|
||||
return R.fail("出院失败,请选择有效的患者");
|
||||
}
|
||||
// 获取是否还有待执行医嘱
|
||||
List<MedicationRequest> medicationRequestList = medicationRequestService
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().eq(MedicationRequest::getEncounterId, encounterId)
|
||||
.ne(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().eq(MedicationRequest::getEncounterId, encounterId)
|
||||
.ne(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
List<ServiceRequest> serviceRequestList = serviceRequestService
|
||||
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getEncounterId, encounterId)
|
||||
.ne(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.TRANSFER.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.DISCHARGE.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.NURSING.getValue())
|
||||
.eq(ServiceRequest::getParentId, null)
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getEncounterId, encounterId)
|
||||
.ne(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.TRANSFER.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.DISCHARGE.getValue())
|
||||
.ne(ServiceRequest::getCategoryEnum, ActivityDefCategory.NURSING.getValue())
|
||||
.eq(ServiceRequest::getParentId, null)
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
if (!medicationRequestList.isEmpty() || !serviceRequestList.isEmpty()) {
|
||||
return R.fail("有待执行的医嘱,请执行完后再出院");
|
||||
}
|
||||
// 查询患者待取的药品
|
||||
List<MedicationDispense> medicationDispenseList = medicationDispenseService
|
||||
.list(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getEncounterId, encounterId)
|
||||
.in(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUMMARIZED.getValue())
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
.list(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getEncounterId, encounterId)
|
||||
.in(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUMMARIZED.getValue())
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
if (!medicationDispenseList.isEmpty()) {
|
||||
return R.fail("患者有待取的药品,请先取药");
|
||||
}
|
||||
int affectedRows =
|
||||
encounterService.updateEncounterStatus(encounterId, EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue());
|
||||
int affectedRows
|
||||
= encounterService.updateEncounterStatus(encounterId, EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue());
|
||||
if (affectedRows > 0) {
|
||||
return R.ok("出院成功");
|
||||
}
|
||||
@@ -576,7 +545,7 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
Encounter encounter = encounterService.getById(encounterId);
|
||||
|
||||
if (EncounterZyStatus.ALREADY_SETTLED.getValue().equals(encounter.getStatusEnum())
|
||||
|| EncounterZyStatus.REGISTERED.getValue().equals(encounter.getStatusEnum())) {
|
||||
|| EncounterZyStatus.REGISTERED.getValue().equals(encounter.getStatusEnum())) {
|
||||
return R.fail("请等待出院结算完成后再清床");
|
||||
}
|
||||
// 更新患者位置状态:已完成
|
||||
@@ -585,7 +554,7 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
encounterParticipantService.updateEncounterParticipantsStatus(encounterId);
|
||||
// 更新原病床状态:空闲
|
||||
List<EncounterLocation> encounterLocationList = encounterLocationService.getEncounterLocationList(encounterId,
|
||||
LocationForm.BED, EncounterActivityStatus.ACTIVE);
|
||||
LocationForm.BED, EncounterActivityStatus.ACTIVE);
|
||||
if (encounterLocationList == null || encounterLocationList.size() != 1) {
|
||||
return R.fail("清床失败,请检查病床状态");
|
||||
}
|
||||
@@ -595,28 +564,30 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
|
||||
/**
|
||||
* 诊断个人账户金额信息获取
|
||||
*
|
||||
*
|
||||
* @param encounterId 诊断id
|
||||
* @return EncounterAccountDto 诊断账户金额
|
||||
**/
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAmount(Long encounterId) {
|
||||
return R.ok(atdManageAppMapper.getAmount(AccountType.PERSONAL_CASH_ACCOUNT.getCode(),
|
||||
ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), encounterId));
|
||||
ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待配/退药
|
||||
*
|
||||
*
|
||||
* @param encounterId 诊断id
|
||||
* @return PendingMedicationDto 待配/退药
|
||||
**/
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPendingMedication(Long encounterId) {
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
return R.ok(atdManageAppMapper.getPendingMedication(encounterId, DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.SUMMARIZED.getValue(), RequestStatus.CANCELLED.getValue(), tenantId));
|
||||
DispenseStatus.SUMMARIZED.getValue(), RequestStatus.CANCELLED.getValue(), tenantId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -679,7 +650,7 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
String endBloodPressure = dto.getEndBloodPressure() == null ? " " : dto.getEndBloodPressure();
|
||||
String highBloodPressure = dto.getHighBloodPressure() == null ? " " : dto.getHighBloodPressure();
|
||||
String bloodPressure = " ".equals(endBloodPressure) && " ".equals(highBloodPressure) ? null
|
||||
: endBloodPressure + "/" + highBloodPressure;
|
||||
: endBloodPressure + "/" + highBloodPressure;
|
||||
map.put(TemperatureChartEnum.BLOOD_PRESSURE.getTypeCode(), bloodPressure);
|
||||
// 获取文书定义列表
|
||||
List<DocStatisticsDefinitionDto> definitionList = docStatisticsDefinitionAppService.getList(1);
|
||||
@@ -691,9 +662,9 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
// 获取患者ID
|
||||
Encounter encounter = encounterService.getById(encounterId);
|
||||
// 创建体温单统计列表
|
||||
List<DocStatisticsDto> data =
|
||||
((List<DocStatisticsDto>)docStatisticsAppService.queryByEncounterId(encounterId).getData()).stream()
|
||||
.filter(item -> DocDefinitionEnum.ADMISSION_VITAL_SIGNS.getValue().equals(item.getSource())).toList();
|
||||
List<DocStatisticsDto> data
|
||||
= ((List<DocStatisticsDto>) docStatisticsAppService.queryByEncounterId(encounterId).getData()).stream()
|
||||
.filter(item -> DocDefinitionEnum.ADMISSION_VITAL_SIGNS.getValue().equals(item.getSource())).toList();
|
||||
List<DocStatisticsDto> list = new ArrayList<>(data);
|
||||
map.keySet().forEach(key -> {
|
||||
if (map.get(key) != null && !map.get(key).isEmpty()) {
|
||||
@@ -713,6 +684,5 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
if (!list.isEmpty()) {
|
||||
docStatisticsAppService.saveOrUpdateAdmissionSigns(list);
|
||||
}
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,14 +30,8 @@ import com.openhis.web.inhospitalnursestation.dto.MedicineDispenseFormDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.MedicineSummaryFormDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.MedicineSummaryParam;
|
||||
import com.openhis.web.inhospitalnursestation.mapper.MedicineSummaryAppMapper;
|
||||
<<<<<<< HEAD
|
||||
import com.openhis.web.pharmacymanage.dto.UnDispenseInventoryDto;
|
||||
import com.openhis.web.pharmacymanage.mapper.ReturnMedicineMapper;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
=======
|
||||
import com.openhis.web.pharmacymanage.dto.DispenseInitDto;
|
||||
import com.openhis.web.pharmacymanage.mapper.ReturnMedicineMapper;
|
||||
>>>>>>> v1.3
|
||||
import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
|
||||
@@ -72,59 +66,6 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
private ReturnMedicineMapper returnMedicineMapper;
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD
|
||||
* 查询发药单信息
|
||||
*
|
||||
* @param dispenseFormSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求
|
||||
* @return 发药单信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicineDispenseFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
// 初始化查询参数
|
||||
String encounterIds = dispenseFormSearchParam.getEncounterIds();
|
||||
dispenseFormSearchParam.setEncounterIds(null);
|
||||
// 构建查询条件
|
||||
QueryWrapper<DispenseFormSearchParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(dispenseFormSearchParam, null, null, request);
|
||||
|
||||
// 手动拼接住院患者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<MedicineDispenseFormDto> medicineDispenseFormPage =
|
||||
medicineSummaryAppMapper.selectMedicineDispenseFormPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
RequestStatus.COMPLETED.getValue(), EncounterActivityStatus.ACTIVE.getValue(),
|
||||
LocationForm.BED.getValue(), ParticipantType.ADMITTING_DOCTOR.getCode(),
|
||||
AccountType.PERSONAL_CASH_ACCOUNT.getCode(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
DispenseStatus.SUMMARIZED.getValue());
|
||||
medicineDispenseFormPage.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.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 计算年龄
|
||||
if (e.getBirthDate() != null) {
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
}
|
||||
});
|
||||
return R.ok(medicineDispenseFormPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询药品汇总单
|
||||
=======
|
||||
* 药品汇总单初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
@@ -133,17 +74,17 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
public R<?> getMedicineSummaryInit() {
|
||||
DispenseInitDto initDto = new DispenseInitDto();
|
||||
// 未发药原因下拉选列表
|
||||
List<DispenseInitDto.NotPerformedReasonOption> notPerformedReasonOptions =
|
||||
Stream.of(NotPerformedReasonEnum.values())
|
||||
.map(notPerformedReason -> new DispenseInitDto.NotPerformedReasonOption(notPerformedReason.getValue(),
|
||||
notPerformedReason.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
List<DispenseInitDto.NotPerformedReasonOption> notPerformedReasonOptions
|
||||
= Stream.of(NotPerformedReasonEnum.values())
|
||||
.map(notPerformedReason -> new DispenseInitDto.NotPerformedReasonOption(notPerformedReason.getValue(),
|
||||
notPerformedReason.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
// 发药状态
|
||||
List<DispenseInitDto.DispenseStatusOption> dispenseStatusOptions = new ArrayList<>();
|
||||
dispenseStatusOptions.add(new DispenseInitDto.DispenseStatusOption(DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.PREPARATION.getInfo()));
|
||||
DispenseStatus.PREPARATION.getInfo()));
|
||||
dispenseStatusOptions.add(new DispenseInitDto.DispenseStatusOption(DispenseStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.COMPLETED.getInfo()));
|
||||
DispenseStatus.COMPLETED.getInfo()));
|
||||
|
||||
initDto.setNotPerformedReasonOptions(notPerformedReasonOptions).setDispenseStatusOptions(dispenseStatusOptions);
|
||||
return R.ok(initDto);
|
||||
@@ -151,69 +92,37 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
|
||||
/**
|
||||
* 查询发药单信息
|
||||
>>>>>>> v1.3
|
||||
*
|
||||
* @param dispenseFormSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
<<<<<<< HEAD
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求
|
||||
* @return 药品汇总单
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicineSummaryFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo,
|
||||
Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<DispenseFormSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(dispenseFormSearchParam,
|
||||
searchKey, new HashSet<>(List.of(CommonConstants.FieldName.BusNo)), request);
|
||||
|
||||
// 汇总单分页列表
|
||||
Page<MedicineSummaryFormDto> medicineSummaryFormPage = medicineSummaryAppMapper.selectMedicineSummaryFormPage(
|
||||
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.IN_PROGRESS.getValue(), SupplyType.SUMMARY_DISPENSE.getValue());
|
||||
medicineSummaryFormPage.getRecords().forEach(e -> {
|
||||
// 发药状态
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
return R.ok(medicineSummaryFormPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询药品汇总单详情
|
||||
*
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 药品汇总单详情
|
||||
*/
|
||||
@Override
|
||||
=======
|
||||
* @param request 请求
|
||||
* @return 发药单信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicineDispenseFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
// 初始化查询参数
|
||||
String encounterIds = dispenseFormSearchParam.getEncounterIds();
|
||||
dispenseFormSearchParam.setEncounterIds(null);
|
||||
// 构建查询条件
|
||||
QueryWrapper<DispenseFormSearchParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(dispenseFormSearchParam, null, null, request);
|
||||
QueryWrapper<DispenseFormSearchParam> queryWrapper
|
||||
= HisQueryUtils.buildQueryWrapper(dispenseFormSearchParam, null, null, request);
|
||||
|
||||
// 手动拼接住院患者id条件
|
||||
if (encounterIds != null && !encounterIds.isEmpty()) {
|
||||
List<Long> encounterIdList =
|
||||
Arrays.stream(encounterIds.split(CommonConstants.Common.COMMA)).map(Long::parseLong).toList();
|
||||
List<Long> encounterIdList
|
||||
= Arrays.stream(encounterIds.split(CommonConstants.Common.COMMA)).map(Long::parseLong).toList();
|
||||
queryWrapper.in(CommonConstants.FieldName.EncounterId, encounterIdList);
|
||||
}
|
||||
// 领药信息列表
|
||||
Page<MedicineDispenseFormDto> medicineDispenseFormPage =
|
||||
medicineSummaryAppMapper.selectMedicineDispenseFormPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
RequestStatus.COMPLETED.getValue(), EncounterActivityStatus.ACTIVE.getValue(),
|
||||
LocationForm.BED.getValue(), ParticipantType.ADMITTING_DOCTOR.getCode(),
|
||||
AccountType.PERSONAL_CASH_ACCOUNT.getCode(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
DispenseStatus.SUMMARIZED.getValue());
|
||||
Page<MedicineDispenseFormDto> medicineDispenseFormPage
|
||||
= medicineSummaryAppMapper.selectMedicineDispenseFormPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
RequestStatus.COMPLETED.getValue(), EncounterActivityStatus.ACTIVE.getValue(),
|
||||
LocationForm.BED.getValue(), ParticipantType.ADMITTING_DOCTOR.getCode(),
|
||||
AccountType.PERSONAL_CASH_ACCOUNT.getCode(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
DispenseStatus.SUMMARIZED.getValue());
|
||||
medicineDispenseFormPage.getRecords().forEach(e -> {
|
||||
// 是否皮试
|
||||
e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag()));
|
||||
@@ -243,15 +152,15 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicineSummaryFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo,
|
||||
Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<DispenseFormSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(dispenseFormSearchParam,
|
||||
searchKey, new HashSet<>(List.of(CommonConstants.FieldName.BusNo)), request);
|
||||
searchKey, new HashSet<>(List.of(CommonConstants.FieldName.BusNo)), request);
|
||||
|
||||
// 汇总单分页列表
|
||||
Page<MedicineSummaryFormDto> medicineSummaryFormPage = medicineSummaryAppMapper.selectMedicineSummaryFormPage(
|
||||
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.PREPARATION.getValue(), SupplyType.SUMMARY_DISPENSE.getValue());
|
||||
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.PREPARATION.getValue(), SupplyType.SUMMARY_DISPENSE.getValue());
|
||||
medicineSummaryFormPage.getRecords().forEach(e -> {
|
||||
// 发药状态
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getStatusEnum()));
|
||||
@@ -266,7 +175,6 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
* @return 药品汇总单详情
|
||||
*/
|
||||
@Override
|
||||
>>>>>>> v1.3
|
||||
public R<?> getMedicineSummaryFormDetail(String summaryNo) {
|
||||
// 药品汇总单详情
|
||||
return R.ok(medicineSummaryAppMapper.selectMedicineSummaryFormDetail(summaryNo));
|
||||
@@ -287,23 +195,23 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
// 申请人
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 药品发放id
|
||||
List<Long> medDispenseIdList =
|
||||
medicineSummaryParamList.stream().map(MedicineSummaryParam::getDispenseId).toList();
|
||||
List<Long> medDispenseIdList
|
||||
= medicineSummaryParamList.stream().map(MedicineSummaryParam::getDispenseId).toList();
|
||||
// 药品发放信息列表
|
||||
List<MedicationDispense> medicationDispenseList = medicationDispenseService.listByIds(medDispenseIdList);
|
||||
if (medicationDispenseList == null || medicationDispenseList.isEmpty()) {
|
||||
throw new ServiceException("未找到药品发放信息");
|
||||
}
|
||||
if (medicationDispenseList.stream().map(MedicationDispense::getStatusEnum)
|
||||
.anyMatch(x -> x.equals(DispenseStatus.SUMMARIZED.getValue()))) {
|
||||
.anyMatch(x -> x.equals(DispenseStatus.SUMMARIZED.getValue()))) {
|
||||
throw new ServiceException("药品已汇总,请勿重复汇总");
|
||||
}
|
||||
// 查询药品信息
|
||||
List<MedicationDefinition> medicationDefinitions = medicationDefinitionService
|
||||
.listByIds(medicationDispenseList.stream().map(MedicationDispense::getMedicationId).toList());
|
||||
.listByIds(medicationDispenseList.stream().map(MedicationDispense::getMedicationId).toList());
|
||||
// 根据发放药房分组
|
||||
Map<Long, List<MedicationDispense>> medicationLocationMap =
|
||||
medicationDispenseList.stream().collect(Collectors.groupingBy(MedicationDispense::getLocationId));
|
||||
Map<Long, List<MedicationDispense>> medicationLocationMap
|
||||
= medicationDispenseList.stream().collect(Collectors.groupingBy(MedicationDispense::getLocationId));
|
||||
// 循环每个药房
|
||||
for (Map.Entry<Long, List<MedicationDispense>> entry : medicationLocationMap.entrySet()) {
|
||||
// 汇总单据号
|
||||
@@ -312,9 +220,9 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
List<MedicationDispense> medicationDispenses = entry.getValue();
|
||||
// 根据相同批号的同一药品进行汇总
|
||||
Map<String, List<MedicationDispense>> medicationSummaryInfoMap = medicationDispenses.stream().collect(
|
||||
Collectors.groupingBy(x -> x.getMedicationId() + CommonConstants.Common.DASH + x.getLotNumber()));
|
||||
Collectors.groupingBy(x -> x.getMedicationId() + CommonConstants.Common.DASH + x.getLotNumber()));
|
||||
for (Map.Entry<String, List<MedicationDispense>> medicationSummaryInfoList : medicationSummaryInfoMap
|
||||
.entrySet()) {
|
||||
.entrySet()) {
|
||||
List<MedicationDispense> medicationSummaryList = medicationSummaryInfoList.getValue();
|
||||
MedicationDispense medicationDispense = medicationSummaryList.get(0);
|
||||
Long medicationId = medicationDispense.getMedicationId();
|
||||
@@ -328,8 +236,8 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
// 单位
|
||||
String unitCode = null;
|
||||
// 根据药品id获取对应的药品信息
|
||||
Optional<MedicationDefinition> medicationDefinition =
|
||||
medicationDefinitions.stream().filter(x -> x.getId().equals(medicationId)).findFirst();
|
||||
Optional<MedicationDefinition> medicationDefinition
|
||||
= medicationDefinitions.stream().filter(x -> x.getId().equals(medicationId)).findFirst();
|
||||
if (medicationDefinition.isPresent()) {
|
||||
partPercent = medicationDefinition.get().getPartPercent();
|
||||
minUnitCode = medicationDefinition.get().getMinUnitCode();
|
||||
@@ -349,89 +257,15 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
minQuantity = minQuantity.add(quantity);
|
||||
}
|
||||
Long supplyRequestId = supplyRequestService.createSummarySupplyRequest(medicationId, locationId,
|
||||
lotNumber, patientId, minQuantity, minUnitCode, practitionerId, now, busNo);
|
||||
lotNumber, patientId, minQuantity, minUnitCode, practitionerId, now, busNo);
|
||||
supplyDeliveryService.createSummarySupplyDelivery(medicationId, lotNumber, patientId, minQuantity,
|
||||
minUnitCode, receiverId, supplyRequestId);
|
||||
minUnitCode, receiverId, supplyRequestId);
|
||||
}
|
||||
// 药品发放状态更新
|
||||
medicationDispenseService.updateDispenseStatusSummarized(
|
||||
medicationDispenses.stream().map(MedicationDispense::getId).toList(), busNo);
|
||||
medicationDispenses.stream().map(MedicationDispense::getId).toList(), busNo);
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"汇总申请"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消汇总
|
||||
*
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public R<?> checkInventoryItem(List<Long> devDispenseId, List<Long> medDispenseId) {
|
||||
|
||||
List<InventoryItem> inventoryItemList = new ArrayList<>();
|
||||
// 获取库存信息
|
||||
List<UnDispenseInventoryDto> inventoryList = returnMedicineMapper.selectInventoryInfoList(devDispenseId, medDispenseId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION);
|
||||
// 按每个药品分组
|
||||
Map<Long, List<UnDispenseInventoryDto>> groupedByItemId =
|
||||
inventoryList.stream().collect(Collectors.groupingBy(UnDispenseInventoryDto::getItemId));
|
||||
// 遍历每个分组校验库存状态
|
||||
for (Map.Entry<Long, List<UnDispenseInventoryDto>> entry : groupedByItemId.entrySet()) {
|
||||
List<UnDispenseInventoryDto> groupItems = entry.getValue();
|
||||
if (groupItems.stream().map(UnDispenseInventoryDto::getInventoryStatusEnum)
|
||||
.allMatch(x -> x.equals(PublicationStatus.RETIRED.getValue()))) {
|
||||
// 库存停供校验
|
||||
return R.fail(groupItems.get(0).getItemName() + "库存已停供");
|
||||
}
|
||||
}
|
||||
if (!inventoryList.isEmpty()) {
|
||||
for (UnDispenseInventoryDto unDispenseInventoryDto : inventoryList) {
|
||||
if (PublicationStatus.ACTIVE.getValue().equals(unDispenseInventoryDto.getInventoryStatusEnum())) {
|
||||
InventoryItem inventoryItem = new InventoryItem();
|
||||
// 库存数量判定
|
||||
if (unDispenseInventoryDto.getDispenseUnit().equals(unDispenseInventoryDto.getInventoryUnitCode())) {
|
||||
// 当前库存数量(拆零单位)=当前库存数量(拆零单位)-请求数量
|
||||
BigDecimal quantity = unDispenseInventoryDto.getInventoryQuantity().subtract(unDispenseInventoryDto.getQuantity());
|
||||
// 库存数量判定
|
||||
if (quantity.compareTo(BigDecimal.ZERO) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(unDispenseInventoryDto.getItemName() + "当前库存数量不足");
|
||||
} else {
|
||||
inventoryItem.setId(unDispenseInventoryDto.getInventoryId()).setQuantity(quantity);
|
||||
}
|
||||
} else {
|
||||
// 当前库存数量(拆零单位)=当前库存数量(拆零单位)-拆零数量(拆零比×请求数量)
|
||||
BigDecimal quantity = unDispenseInventoryDto.getInventoryQuantity()
|
||||
.subtract(unDispenseInventoryDto.getPartPercent().multiply(unDispenseInventoryDto.getQuantity()));
|
||||
// 库存数量判定
|
||||
if (quantity.compareTo(BigDecimal.ZERO) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(unDispenseInventoryDto.getItemName() + "当前库存数量不足");
|
||||
} else {
|
||||
inventoryItem.setId(unDispenseInventoryDto.getInventoryId()).setQuantity(quantity);
|
||||
}
|
||||
}
|
||||
inventoryItemList.add(inventoryItem);
|
||||
}
|
||||
}
|
||||
=======
|
||||
public R<?> cancelSummary(String summaryNo) {
|
||||
// 取消汇总申请(软删除)
|
||||
List<Long> requestIdList = supplyRequestService.cancelSummarySupplyRequest(List.of(summaryNo));
|
||||
if (requestIdList.isEmpty()) {
|
||||
return R.fail("取消汇总申请失败");
|
||||
}
|
||||
// 软删除汇总发放
|
||||
supplyDeliveryService.deleteSupplyDeliveryByReqId(requestIdList);
|
||||
// 取消药品汇总
|
||||
boolean result = medicationDispenseService.cancelMedicationSummary(List.of(summaryNo));
|
||||
if (!result) {
|
||||
return R.fail("取消汇总申请失败");
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"取消"}));
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"汇总申请"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -454,7 +288,30 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
if (!result) {
|
||||
return R.fail("取消汇总申请失败");
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"取消"}));
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"取消"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消汇总
|
||||
*
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> cancelSummary(String summaryNo) {
|
||||
// 取消汇总申请(软删除)
|
||||
List<Long> requestIdList = supplyRequestService.cancelSummarySupplyRequest(List.of(summaryNo));
|
||||
if (requestIdList.isEmpty()) {
|
||||
return R.fail("取消汇总申请失败");
|
||||
}
|
||||
// 软删除汇总发放
|
||||
supplyDeliveryService.deleteSupplyDeliveryByReqId(requestIdList);
|
||||
// 取消药品汇总
|
||||
boolean result = medicationDispenseService.cancelMedicationSummary(List.of(summaryNo));
|
||||
if (!result) {
|
||||
return R.fail("取消汇总申请失败");
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"取消"}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,37 +1,5 @@
|
||||
package com.openhis.web.inhospitalnursestation.appservice.impl;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.web.doctorstation.dto.AdviceSaveDto;
|
||||
import com.openhis.web.doctorstation.utils.AdviceUtils;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.INurseBillingAppService;
|
||||
import com.openhis.web.regdoctorstation.dto.RegAdviceSaveDto;
|
||||
import com.openhis.web.regdoctorstation.dto.RegAdviceSaveParam;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.IDeviceRequestService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 住院护士站划价服务实现类
|
||||
* 核心功能:临时耗材/诊疗活动划价签发、关联费用项管理、库存校验、医嘱删除(已收费校验)等
|
||||
=======
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
@@ -83,56 +51,13 @@ import com.openhis.workflow.service.IDeviceRequestService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
|
||||
/**
|
||||
* 住院护士站划价服务实现类 核心职责: 1. 临时耗材划价签发(含耗材请求生成、发放记录创建、费用项关联) 2. 诊疗活动划价签发(含服务请求生成、子项处理、费用项关联) 3. 划价参数校验(非空校验、库房校验等) 4.
|
||||
* 已收费项目删除限制(避免误删已结算数据) 5. 关联数据一致性管理(请求表、执行表、费用表、发放表联动)
|
||||
>>>>>>> v1.3
|
||||
* 住院护士站划价服务实现类 核心职责: 1. 临时耗材划价签发(含耗材请求生成、发放记录创建、费用项关联) 2.
|
||||
* 诊疗活动划价签发(含服务请求生成、子项处理、费用项关联) 3. 划价参数校验(非空校验、库房校验等) 4. 已收费项目删除限制(避免误删已结算数据) 5.
|
||||
* 关联数据一致性管理(请求表、执行表、费用表、发放表联动)
|
||||
*/
|
||||
@Service
|
||||
public class NurseBillingAppService implements INurseBillingAppService {
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 依赖注入:保留@Resource注解,按原有方式注入依赖
|
||||
@Resource
|
||||
private AdviceUtils adviceUtils;
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
@Resource
|
||||
private IDeviceRequestService iDeviceRequestService;
|
||||
@Resource
|
||||
private IServiceRequestService iServiceRequestService;
|
||||
@Resource
|
||||
private IChargeItemService iChargeItemService;
|
||||
@Resource
|
||||
private IDeviceDispenseService iDeviceDispenseService;
|
||||
|
||||
// 常量提取:避免魔法值,提高代码可维护性和可读性
|
||||
/** 耗材请求服务表名(关联费用项使用) */
|
||||
private static final String SERVICE_TABLE_DEVICE_REQUEST = CommonConstants.TableName.WOR_DEVICE_REQUEST;
|
||||
private static final String SERVICE_TABLE_SERVICE_REQUEST = CommonConstants.TableName.WOR_SERVICE_REQUEST;
|
||||
/** 费用项业务编号前缀 */
|
||||
private static final String CHARGE_ITEM_BUS_NO_PREFIX = AssignSeqEnum.CHARGE_ITEM_NO.getPrefix();
|
||||
/** 耗材申请单号序列号长度(按日生成) */
|
||||
private static final int DEVICE_RES_NO_SEQ_LENGTH = 4;
|
||||
/** 医嘱签发编码序列号长度 */
|
||||
private static final int ADVICE_SIGN_SEQ_LENGTH = 10;
|
||||
|
||||
/**
|
||||
* 新增住院护士站划价
|
||||
* 完整流程:参数初始化 → 入参校验 → 医嘱分类(耗材/诊疗活动)→ 生成签发编码 → 处理耗材划价 → 处理诊疗活动划价
|
||||
*
|
||||
* @param regAdviceSaveParam 划价请求参数(含患者信息、医嘱列表、科室ID等核心数据)
|
||||
* @return R<?> 划价结果响应(成功/失败信息、状态码)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class) // 事务管理:划价相关操作原子性,任一环节失败整体回滚
|
||||
public R<?> addInNurseBilling(RegAdviceSaveParam regAdviceSaveParam) {
|
||||
// 1. 时间参数初始化:默认使用当前时间,支持入参指定
|
||||
Date curDate = new Date();
|
||||
Date startTime = regAdviceSaveParam.getStartTime() == null ? curDate : regAdviceSaveParam.getStartTime();
|
||||
Date authoredTime = regAdviceSaveParam.getAuthoredTime() == null ? curDate : regAdviceSaveParam.getAuthoredTime();
|
||||
|
||||
// 2. 入参校验:非空校验 + 库存校验,校验失败直接返回错误响应
|
||||
=======
|
||||
// ======================== 常量定义(关联表名/编码规则)========================
|
||||
/**
|
||||
* 耗材请求服务关联表名(用于费用项关联数据源)
|
||||
@@ -215,11 +140,12 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
// ======================== 核心业务方法(划价新增)========================
|
||||
|
||||
/**
|
||||
* 新增住院护士站划价(核心入口方法) 完整流程:参数初始化 → 入参校验 → 医嘱分类 → 生成全局签发编码 → 分类处理划价 → 返回结果 事务特性:所有操作原子化,任一环节失败则整体回滚(避免数据不一致)
|
||||
* 新增住院护士站划价(核心入口方法) 完整流程:参数初始化 → 入参校验 → 医嘱分类 → 生成全局签发编码 → 分类处理划价 → 返回结果
|
||||
* 事务特性:所有操作原子化,任一环节失败则整体回滚(避免数据不一致)
|
||||
*
|
||||
* @param regAdviceSaveParam 划价请求参数体 包含:患者ID、就诊ID、住院科室ID、医嘱列表(耗材/诊疗活动)、操作时间等核心数据
|
||||
* @param regAdviceSaveParam 划价请求参数体
|
||||
* 包含:患者ID、就诊ID、住院科室ID、医嘱列表(耗材/诊疗活动)、操作时间等核心数据
|
||||
* @return R<?> 划价结果响应 成功:返回操作成功提示(编码M00002) 失败:返回具体错误信息(如参数缺失、库房为空等)
|
||||
*/
|
||||
@Override
|
||||
@@ -231,295 +157,18 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
// 1. 时间参数初始化:优先使用入参指定时间,无则默认当前系统时间
|
||||
Date curDate = new Date();
|
||||
Date startTime = regAdviceSaveParam.getStartTime() == null ? curDate : regAdviceSaveParam.getStartTime();
|
||||
Date authoredTime =
|
||||
regAdviceSaveParam.getAuthoredTime() == null ? curDate : regAdviceSaveParam.getAuthoredTime();
|
||||
Date authoredTime
|
||||
= regAdviceSaveParam.getAuthoredTime() == null ? curDate : regAdviceSaveParam.getAuthoredTime();
|
||||
|
||||
// 2. 入参校验:校验不通过直接返回错误响应(避免后续无效处理)
|
||||
>>>>>>> v1.3
|
||||
R<?> checkResult = checkNurseBillingParam(regAdviceSaveParam);
|
||||
if (checkResult.getCode() != R.SUCCESS) {
|
||||
return checkResult;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 3. 提取核心业务参数
|
||||
Long organizationId = regAdviceSaveParam.getOrganizationId(); // 患者住院科室ID
|
||||
List<RegAdviceSaveDto> allAdviceList = regAdviceSaveParam.getRegAdviceSaveList(); // 所有待处理医嘱列表
|
||||
|
||||
// 4. 按医嘱类型分类:拆分耗材类和诊疗活动类(分别处理)
|
||||
List<RegAdviceSaveDto> deviceAdviceList = filterDeviceAdvice(allAdviceList); // 耗材类医嘱
|
||||
List<RegAdviceSaveDto> activityAdviceList = filterActivityAdvice(allAdviceList); // 诊疗活动类医嘱
|
||||
|
||||
// 5. 生成全局唯一的医嘱签发编码
|
||||
String signCode = assignSeqUtil.getSeq(AssignSeqEnum.ADVICE_SIGN.getPrefix(), ADVICE_SIGN_SEQ_LENGTH);
|
||||
|
||||
// 6. 处理耗材类医嘱划价(新增/修改/删除逻辑)
|
||||
handleDeviceBilling(deviceAdviceList, null, signCode, organizationId, curDate);
|
||||
|
||||
// 7. 处理诊疗活动类医嘱划价(原代码未实现,保留扩展入口)
|
||||
handleActivityBilling(activityAdviceList, signCode, organizationId, curDate, startTime, authoredTime);
|
||||
|
||||
// 8. 划价成功返回响应
|
||||
return R.ok("住院划价签发成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选耗材类医嘱
|
||||
* 按医嘱类型枚举(ItemType.DEVICE)过滤,仅保留耗材相关医嘱
|
||||
*
|
||||
* @param allAdviceList 所有待处理医嘱列表
|
||||
* @return List<RegAdviceSaveDto> 耗材类医嘱列表
|
||||
*/
|
||||
private List<RegAdviceSaveDto> filterDeviceAdvice(List<RegAdviceSaveDto> allAdviceList) {
|
||||
return allAdviceList.stream()
|
||||
.filter(advice -> ItemType.DEVICE.getValue().equals(advice.getAdviceType()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选诊疗活动类医嘱
|
||||
* 按医嘱类型枚举(ItemType.ACTIVITY)过滤,仅保留诊疗活动相关医嘱
|
||||
*
|
||||
* @param allAdviceList 所有待处理医嘱列表
|
||||
* @return List<RegAdviceSaveDto> 诊疗活动类医嘱列表
|
||||
*/
|
||||
private List<RegAdviceSaveDto> filterActivityAdvice(List<RegAdviceSaveDto> allAdviceList) {
|
||||
return allAdviceList.stream()
|
||||
.filter(advice -> ItemType.ACTIVITY.getValue().equals(advice.getAdviceType()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理耗材类医嘱划价
|
||||
* 核心流程:筛选临时耗材 → 处理删除(已收费校验)→ 新增/修改耗材记录 → 同步发放+费用项
|
||||
*
|
||||
* @param deviceAdviceList 耗材类医嘱列表
|
||||
* @param deleteList 待删除的耗材医嘱列表(可为null,暂无删除场景传null)
|
||||
* @param signCode 医嘱签发编码(全局唯一)
|
||||
* @param organizationId 患者住院科室ID
|
||||
* @param curDate 当前操作时间
|
||||
*/
|
||||
private void handleDeviceBilling(List<RegAdviceSaveDto> deviceAdviceList, List<AdviceSaveDto> deleteList,
|
||||
String signCode, Long organizationId, Date curDate) {
|
||||
// 1. 筛选临时类型耗材:仅处理临时医嘱(TherapyTimeType.TEMPORARY)的新增/修改
|
||||
List<AdviceSaveDto> tempDeviceList = deviceAdviceList.stream()
|
||||
.filter(advice -> TherapyTimeType.TEMPORARY.getValue().equals(advice.getTherapyEnum()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 2. 处理耗材删除:校验已收费状态 + 关联数据删除
|
||||
handleDelRequest(deleteList,SERVICE_TABLE_DEVICE_REQUEST);
|
||||
|
||||
// 3. 处理耗材新增/修改:同步保存耗材请求、发放记录、费用项
|
||||
handleDeviceInsertOrUpdate(tempDeviceList, organizationId, curDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理诊疗活动类医嘱划价
|
||||
* (扩展入口:原代码未实现,可参考耗材处理逻辑,关联服务请求表、费用项等)
|
||||
*
|
||||
* @param activityAdviceList 诊疗活动类医嘱列表
|
||||
* @param signCode 医嘱签发编码
|
||||
* @param organizationId 住院科室ID
|
||||
* @param curDate 当前操作时间
|
||||
* @param startTime 医嘱开始时间
|
||||
* @param authoredTime 医嘱签发时间
|
||||
*/
|
||||
private void handleActivityBilling(List<RegAdviceSaveDto> activityAdviceList, String signCode,
|
||||
Long organizationId, Date curDate, Date startTime, Date authoredTime) {
|
||||
// 注:诊疗活动划价逻辑待实现,建议流程:
|
||||
// 1. 筛选临时类型诊疗活动
|
||||
// 2. 处理删除(如需)
|
||||
// 3. 新增/修改服务请求记录(IServiceRequestService)
|
||||
// 4. 同步生成/更新费用项(IChargeItemService)
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理耗材删除逻辑
|
||||
* 关键校验:已收费的耗材项目不允许删除
|
||||
* 关联删除:耗材请求表 → 耗材发放记录 → 费用项表(级联删除关联数据)
|
||||
*
|
||||
* @param deleteList 待删除的耗材医嘱列表(可为null)
|
||||
*/
|
||||
private void handleDelRequest(List<AdviceSaveDto> deleteList,String serviceTable) {
|
||||
// 空列表直接返回,避免无效循环和查询
|
||||
if (deleteList == null || deleteList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
// 提取待删除请求ID列表(用于查询费用状态)
|
||||
List<Long> delRequestIds = deleteList.stream()
|
||||
.map(AdviceSaveDto::getRequestId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 校验:待删除项是否已收费,已收费则抛出异常阻止删除
|
||||
checkDeletedDeviceChargeStatus(delRequestIds);
|
||||
|
||||
// 执行级联删除:循环处理每个待删除项的关联数据
|
||||
for (AdviceSaveDto deleteDto : deleteList) {
|
||||
Long requestId = deleteDto.getRequestId();
|
||||
if (serviceTable.equals(SERVICE_TABLE_DEVICE_REQUEST)){
|
||||
iDeviceRequestService.removeById(requestId); // 删除耗材请求主记录
|
||||
iDeviceDispenseService.deleteDeviceDispense(requestId); // 删除关联的耗材发放记录
|
||||
}
|
||||
// 删除关联的费用项(按服务表+服务ID关联)
|
||||
iChargeItemService.deleteByServiceTableAndId(SERVICE_TABLE_DEVICE_REQUEST, requestId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验待删除耗材的费用状态
|
||||
* 查询待删除项对应的费用项,若存在已收费(ChargeItemStatus.BILLED)状态则抛出业务异常
|
||||
*
|
||||
* @param delRequestIds 待删除的耗材请求ID列表
|
||||
*/
|
||||
private void checkDeletedDeviceChargeStatus(List<Long> delRequestIds) {
|
||||
if (delRequestIds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 查询待删除耗材对应的费用项列表
|
||||
List<ChargeItem> chargeItemList = iChargeItemService.getChargeItemInfoByReqId(delRequestIds);
|
||||
if (chargeItemList == null || chargeItemList.isEmpty()) {
|
||||
return; // 无关联费用项,直接允许删除
|
||||
}
|
||||
|
||||
// 校验是否存在已收费项:使用stream.anyMatch简化循环判断
|
||||
boolean hasBilledItem = chargeItemList.stream()
|
||||
.anyMatch(ci -> ChargeItemStatus.BILLED.getValue().equals(ci.getStatusEnum()));
|
||||
if (hasBilledItem) {
|
||||
throw new ServiceException("删除失败:部分项目已完成收费,不支持直接删除,请联系收费人员处理后重试");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理耗材新增/修改
|
||||
* 流程:构建耗材请求对象 → 保存/更新 → 处理耗材发放 → 构建费用项 → 保存/更新费用项
|
||||
*
|
||||
* @param tempDeviceList 临时耗材医嘱列表(新增/修改)
|
||||
* @param organizationId 住院科室ID
|
||||
* @param curDate 当前操作时间
|
||||
*/
|
||||
private void handleDeviceInsertOrUpdate(List<AdviceSaveDto> tempDeviceList, Long organizationId, Date curDate) {
|
||||
if (tempDeviceList.isEmpty()) {
|
||||
return; // 无临时耗材需处理,直接返回
|
||||
}
|
||||
|
||||
// 循环处理每个临时耗材医嘱
|
||||
for (AdviceSaveDto adviceDto : tempDeviceList) {
|
||||
// 1. 构建耗材请求对象(DeviceRequest)并执行保存/更新
|
||||
if (adviceDto.getRequestId() == null) {
|
||||
adviceDto.setDbOpType(DbOpType.INSERT.getCode()); // 新增时设置操作类型
|
||||
}else {
|
||||
adviceDto.setDbOpType(DbOpType.UPDATE.getCode()); // 修改时设置操作类型
|
||||
}
|
||||
DeviceRequest deviceRequest = buildDeviceRequest(adviceDto, curDate);
|
||||
iDeviceRequestService.saveOrUpdate(deviceRequest);
|
||||
|
||||
// 2. 同步处理耗材发放:根据操作类型(新增/修改)执行发放逻辑
|
||||
iDeviceDispenseService.handleDeviceDispense(deviceRequest, adviceDto.getDbOpType());
|
||||
|
||||
// 3. 构建费用项对象(ChargeItem)并执行保存/更新
|
||||
ChargeItem chargeItem = buildChargeItem(adviceDto, deviceRequest, curDate);
|
||||
iChargeItemService.saveOrUpdate(chargeItem);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建耗材请求对象(DeviceRequest)
|
||||
* 功能:将医嘱DTO(AdviceSaveDto)的属性映射到耗材请求实体,设置默认状态和业务编号
|
||||
*
|
||||
* @param adviceDto 耗材医嘱DTO(含请求参数)
|
||||
* @param curDate 当前操作时间
|
||||
* @return DeviceRequest 构建完成的耗材请求实体
|
||||
*/
|
||||
private DeviceRequest buildDeviceRequest(AdviceSaveDto adviceDto, Date curDate) {
|
||||
DeviceRequest deviceRequest = new DeviceRequest();
|
||||
|
||||
// 基础配置:主键、状态、业务编号
|
||||
deviceRequest.setId(adviceDto.getRequestId()); // 主键ID(新增为null,修改为已有ID)
|
||||
deviceRequest.setStatusEnum(RequestStatus.ACTIVE.getValue()); // 划价时直接签发,状态为"激活"
|
||||
// 按日生成业务编号:前缀+4位序列号(确保每日唯一)
|
||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), DEVICE_RES_NO_SEQ_LENGTH));
|
||||
deviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源:医生处方
|
||||
|
||||
// 业务属性映射:从DTO映射到实体
|
||||
deviceRequest.setQuantity(adviceDto.getQuantity()); // 请求数量
|
||||
deviceRequest.setUnitCode(adviceDto.getUnitCode()); // 单位编码
|
||||
deviceRequest.setLotNumber(adviceDto.getLotNumber()); // 产品批号
|
||||
deviceRequest.setCategoryEnum(adviceDto.getCategoryEnum()); // 请求类型(枚举)
|
||||
deviceRequest.setDeviceDefId(adviceDto.getAdviceDefinitionId()); // 耗材定义ID
|
||||
deviceRequest.setPatientId(adviceDto.getPatientId()); // 患者ID
|
||||
deviceRequest.setRequesterId(adviceDto.getPractitionerId()); // 开方医生ID
|
||||
deviceRequest.setOrgId(adviceDto.getFounderOrgId()); // 开方人科室ID
|
||||
deviceRequest.setReqAuthoredTime(curDate); // 请求开始时间
|
||||
deviceRequest.setPerformLocation(adviceDto.getLocationId()); // 发放耗材房ID
|
||||
deviceRequest.setEncounterId(adviceDto.getEncounterId()); // 就诊ID
|
||||
deviceRequest.setPackageId(adviceDto.getPackageId()); // 组套ID
|
||||
deviceRequest.setContentJson(adviceDto.getContentJson()); // 请求内容JSON(扩展信息)
|
||||
deviceRequest.setYbClassEnum(adviceDto.getYbClassEnum()); // 医保类别编码
|
||||
deviceRequest.setConditionId(adviceDto.getConditionId()); // 诊断ID
|
||||
deviceRequest.setEncounterDiagnosisId(adviceDto.getEncounterDiagnosisId()); // 就诊诊断ID
|
||||
|
||||
return deviceRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建费用项对象(ChargeItem)
|
||||
* 功能:关联耗材请求实体和医嘱DTO,映射费用相关属性,设置默认状态和业务编号
|
||||
*
|
||||
* @param adviceDto 耗材医嘱DTO(含费用参数)
|
||||
* @param deviceRequest 已保存的耗材请求实体(关联服务ID)
|
||||
* @param curDate 当前操作时间
|
||||
* @return ChargeItem 构建完成的费用项实体
|
||||
*/
|
||||
private ChargeItem buildChargeItem(AdviceSaveDto adviceDto, DeviceRequest deviceRequest,Date curDate) {
|
||||
ChargeItem chargeItem = new ChargeItem();
|
||||
|
||||
// 基础配置:主键、状态、业务编号
|
||||
chargeItem.setId(adviceDto.getChargeItemId()); // 费用项ID(新增为null,修改为已有ID)
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.DRAFT.getValue()); // 初始状态:草稿(未收费)
|
||||
// 业务编号:费用项前缀+耗材请求编号(确保与耗材请求一一关联)
|
||||
chargeItem.setBusNo(CHARGE_ITEM_BUS_NO_PREFIX.concat(deviceRequest.getBusNo()));
|
||||
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源:医生处方
|
||||
|
||||
// 业务属性映射:患者、就诊、定价相关信息
|
||||
chargeItem.setPatientId(adviceDto.getPatientId()); // 患者ID
|
||||
chargeItem.setContextEnum(adviceDto.getAdviceType()); // 费用类型(耗材)
|
||||
chargeItem.setEncounterId(adviceDto.getEncounterId()); // 就诊ID
|
||||
chargeItem.setDefinitionId(adviceDto.getDefinitionId()); // 费用定价ID
|
||||
chargeItem.setDefDetailId(adviceDto.getDefinitionDetailId()); // 定价子表主键(明细定价)
|
||||
chargeItem.setEntererId(adviceDto.getPractitionerId()); // 开立人ID(开方医生)
|
||||
chargeItem.setRequestingOrgId(SecurityUtils.getLoginUser().getOrgId()); // 开立科室ID
|
||||
chargeItem.setEnteredDate(curDate); // 开立时间
|
||||
chargeItem.setServiceTable(SERVICE_TABLE_DEVICE_REQUEST); // 医疗服务类型(关联耗材请求表)
|
||||
chargeItem.setServiceId(deviceRequest.getId()); // 医疗服务ID(关联耗材请求ID)
|
||||
chargeItem.setProductTable(SERVICE_TABLE_DEVICE_REQUEST);// 产品所在表(耗材表)
|
||||
chargeItem.setProductId(adviceDto.getAdviceDefinitionId());// 产品ID(耗材定义ID)
|
||||
chargeItem.setAccountId(adviceDto.getAccountId()); // 关联账户ID(患者账户)
|
||||
chargeItem.setConditionId(adviceDto.getConditionId()); // 诊断ID
|
||||
chargeItem.setEncounterDiagnosisId(adviceDto.getEncounterDiagnosisId()); // 就诊诊断ID
|
||||
|
||||
// 费用核心属性:数量、单位、单价、总价
|
||||
chargeItem.setQuantityValue(adviceDto.getQuantity()); // 数量(与耗材请求一致)
|
||||
chargeItem.setQuantityUnit(adviceDto.getUnitCode()); // 单位(与耗材请求一致)
|
||||
chargeItem.setUnitPrice(adviceDto.getUnitPrice()); // 单价(从DTO传入,已定价)
|
||||
chargeItem.setTotalPrice(adviceDto.getTotalPrice()); // 总价(数量×单价,DTO已计算)
|
||||
|
||||
return chargeItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 划价入参校验
|
||||
* 校验规则:1. 参数非空 2. 科室ID非空 3. 医嘱列表非空 4. 临时耗材库存校验
|
||||
*
|
||||
* @param regAdviceSaveParam 划价请求参数
|
||||
* @return R<?> 校验结果(成功返回R.ok(),失败返回R.fail())
|
||||
*/
|
||||
private R<?> checkNurseBillingParam(RegAdviceSaveParam regAdviceSaveParam) {
|
||||
// 1. 整体参数非空校验
|
||||
=======
|
||||
// 3. 提取核心业务参数:住院科室ID(优先入参,无则取登录用户所属科室)
|
||||
Long organizationId = regAdviceSaveParam.getOrganizationId() == null ? loginUser.getOrgId()
|
||||
: regAdviceSaveParam.getOrganizationId();
|
||||
: regAdviceSaveParam.getOrganizationId();
|
||||
// 待处理医嘱列表(含耗材、诊疗活动两种类型)
|
||||
List<RegAdviceSaveDto> allAdviceList = regAdviceSaveParam.getRegAdviceSaveList();
|
||||
|
||||
@@ -539,11 +188,12 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
}
|
||||
|
||||
// 7. 划价成功:返回统一成功提示(通过国际化工具类拼接提示信息)
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"住院护士划价"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"住院护士划价"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除住院划价记录(核心实现) 流程:参数校验 → 分类筛选医嘱 → 已收费状态校验 → 级联删除关联数据 → 返回结果 事务特性:所有删除操作原子化,任一环节失败整体回滚
|
||||
* 删除住院划价记录(核心实现) 流程:参数校验 → 分类筛选医嘱 → 已收费状态校验 → 级联删除关联数据 → 返回结果
|
||||
* 事务特性:所有删除操作原子化,任一环节失败整体回滚
|
||||
*
|
||||
* @return R<?> 删除结果响应
|
||||
*/
|
||||
@@ -556,15 +206,15 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
List<Long> activityRequestIds = Collections.emptyList();
|
||||
if (paramList != null && !paramList.isEmpty()) {
|
||||
activityRequestIds = paramList.stream().filter(e -> e != null // 避免单个参数对象为null
|
||||
&& ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) && e.getRequestId() != null) // 避免requestId为null(按需添加)
|
||||
.map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
&& ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) && e.getRequestId() != null) // 避免requestId为null(按需添加)
|
||||
.map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
}
|
||||
// 耗材ids
|
||||
List<Long> deviceRequestIds = Collections.emptyList();
|
||||
if (paramList != null && !paramList.isEmpty()) {
|
||||
deviceRequestIds = paramList.stream().filter(e -> e != null // 避免单个参数对象为null
|
||||
&& ItemType.DEVICE.getValue().equals(e.getAdviceType()) && e.getRequestId() != null) // 避免requestId为null(按需添加)
|
||||
.map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
&& ItemType.DEVICE.getValue().equals(e.getAdviceType()) && e.getRequestId() != null) // 避免requestId为null(按需添加)
|
||||
.map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
}
|
||||
this.handleDel(deviceRequestIds, SERVICE_TABLE_DEVICE);
|
||||
this.handleDel(activityRequestIds, SERVICE_TABLE_SERVICE);
|
||||
@@ -581,31 +231,31 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getInNurseBillingPage(InpatientAdviceParam inpatientAdviceParam, Integer pageNo, Integer pageSize,
|
||||
LocalDateTime startTime, LocalDateTime endTime) {
|
||||
LocalDateTime startTime, LocalDateTime endTime) {
|
||||
// 初始化查询参数
|
||||
String encounterIds = inpatientAdviceParam.getEncounterIds();
|
||||
inpatientAdviceParam.setEncounterIds(null);
|
||||
Integer exeStatus = inpatientAdviceParam.getExeStatus();
|
||||
inpatientAdviceParam.setExeStatus(null);
|
||||
// 构建查询条件
|
||||
QueryWrapper<InpatientAdviceParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
|
||||
QueryWrapper<InpatientAdviceParam> queryWrapper
|
||||
= HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
|
||||
|
||||
// 手动拼接住院患者id条件
|
||||
if (encounterIds != null && !encounterIds.isEmpty()) {
|
||||
List<Long> encounterIdList =
|
||||
Arrays.stream(encounterIds.split(CommonConstants.Common.COMMA)).map(Long::parseLong).toList();
|
||||
List<Long> encounterIdList
|
||||
= Arrays.stream(encounterIds.split(CommonConstants.Common.COMMA)).map(Long::parseLong).toList();
|
||||
queryWrapper.in(CommonConstants.FieldName.EncounterId, encounterIdList);
|
||||
}
|
||||
// 患者医嘱分页列表
|
||||
Page<InpatientAdviceDto> inpatientAdvicePage =
|
||||
nurseBillingAppMapper.getInNurseBillingPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
RequestStatus.DRAFT.getValue(), EncounterActivityStatus.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(),
|
||||
GenerateSource.NURSE_PRICING.getValue(), startTime, endTime);
|
||||
Page<InpatientAdviceDto> inpatientAdvicePage
|
||||
= nurseBillingAppMapper.getInNurseBillingPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
RequestStatus.DRAFT.getValue(), EncounterActivityStatus.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(),
|
||||
GenerateSource.NURSE_PRICING.getValue(), startTime, endTime);
|
||||
inpatientAdvicePage.getRecords().forEach(e -> {
|
||||
// 医嘱类型
|
||||
e.setTherapyEnum_enumText(EnumUtils.getInfoByValue(TherapyTimeType.class, e.getTherapyEnum()));
|
||||
@@ -622,112 +272,47 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
}
|
||||
|
||||
// ======================== 入参校验方法 ========================
|
||||
|
||||
/**
|
||||
* 划价入参校验(通用校验逻辑) 校验规则:1. 参数非空 2. 住院科室ID非空 3. 医嘱列表非空 4. 隐含库房校验(耗材类单独校验) 校验失败直接返回错误响应,不进入后续业务逻辑
|
||||
* 划价入参校验(通用校验逻辑) 校验规则:1. 参数非空 2. 住院科室ID非空 3. 医嘱列表非空 4. 隐含库房校验(耗材类单独校验)
|
||||
* 校验失败直接返回错误响应,不进入后续业务逻辑
|
||||
*
|
||||
* @param regAdviceSaveParam 划价请求参数体
|
||||
* @return R<?> 校验结果:成功返回R.ok(),失败返回R.fail(错误信息)
|
||||
*/
|
||||
private R<?> checkNurseBillingParam(RegAdviceSaveParam regAdviceSaveParam) {
|
||||
// 1. 整体参数非空校验:请求体为null直接返回失败
|
||||
>>>>>>> v1.3
|
||||
if (regAdviceSaveParam == null) {
|
||||
return R.fail("划价请求失败:未获取到有效请求数据,请重新提交");
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 2. 核心字段非空校验:患者住院科室ID
|
||||
=======
|
||||
// 2. 核心字段非空校验:患者住院科室ID不能为空
|
||||
>>>>>>> v1.3
|
||||
if (regAdviceSaveParam.getOrganizationId() == null) {
|
||||
return R.fail("划价请求失败:患者住院科室信息缺失,请确认患者科室后重试");
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 3. 医嘱列表非空校验
|
||||
=======
|
||||
// 3. 医嘱列表非空校验:必须选择至少一个待划价项目
|
||||
>>>>>>> v1.3
|
||||
List<RegAdviceSaveDto> adviceList = regAdviceSaveParam.getRegAdviceSaveList();
|
||||
if (adviceList == null || adviceList.isEmpty()) {
|
||||
return R.fail("划价请求失败:未选择任何待划价项目,请添加医嘱后提交");
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 4. 临时耗材库存校验:仅校验非删除、非诊疗活动的临时医嘱
|
||||
=======
|
||||
// 4. 库存校验:临时注释(当前需求:划价不校验库存,实际发放时校验)
|
||||
// 若后续需要恢复库存校验,可解除以下注释
|
||||
/*
|
||||
>>>>>>> v1.3
|
||||
List<AdviceSaveDto> needCheckInventoryList = adviceList.stream()
|
||||
.filter(advice -> TherapyTimeType.TEMPORARY.getValue().equals(advice.getTherapyEnum())
|
||||
&& !DbOpType.DELETE.getCode().equals(advice.getDbOpType())
|
||||
&& !ItemType.ACTIVITY.getValue().equals(advice.getAdviceType()))
|
||||
.collect(Collectors.toList());
|
||||
<<<<<<< HEAD
|
||||
|
||||
// 调用工具类校验库存,返回非null则表示库存不足
|
||||
String inventoryTip = adviceUtils.checkInventory(new ArrayList<>(needCheckInventoryList));
|
||||
if (inventoryTip != null) {
|
||||
// 库存提示已包含具体耗材名称和短缺数量,直接拼接操作建议
|
||||
return R.fail("划价失败:" + inventoryTip + ",请联系库房确认库存或调整申请数量");
|
||||
}
|
||||
=======
|
||||
|
||||
String inventoryTip = adviceUtils.checkInventory(new ArrayList<>(needCheckInventoryList));
|
||||
if (inventoryTip != null) {
|
||||
return R.fail("划价失败:" + inventoryTip + ",请联系库房确认库存或调整申请数量");
|
||||
}
|
||||
*/
|
||||
>>>>>>> v1.3
|
||||
|
||||
*/
|
||||
// 所有校验通过
|
||||
return R.ok();
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
// ======================== 以下方法原代码未实现,保留接口方法签名 ========================
|
||||
|
||||
@Override
|
||||
public R<?> getBillingListByEncounterId() {
|
||||
// 功能:根据就诊ID查询划价列表(待实现)
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> deleteInNurseBilling() {
|
||||
// 功能:删除住院划价记录(待实现)
|
||||
// List<AdviceSaveDto> deleteList
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> addOrderBilling() {
|
||||
// 功能:新增订单划价(待实现)
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> deleteOrderBilling() {
|
||||
// 功能:删除订单划价(待实现)
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateOrderBilling() {
|
||||
// 功能:修改订单划价(待实现)
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getOrderBillingByRequestId() {
|
||||
// 功能:根据请求ID查询订单划价(待实现)
|
||||
return null;
|
||||
}
|
||||
=======
|
||||
// ======================== 医嘱分类工具方法 ========================
|
||||
|
||||
/**
|
||||
@@ -738,7 +323,7 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
*/
|
||||
private List<RegAdviceSaveDto> filterDeviceAdvice(List<RegAdviceSaveDto> allAdviceList) {
|
||||
return allAdviceList.stream().filter(advice -> ItemType.DEVICE.getValue().equals(advice.getAdviceType()))
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -749,13 +334,13 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
*/
|
||||
private List<RegAdviceSaveDto> filterActivityAdvice(List<RegAdviceSaveDto> allAdviceList) {
|
||||
return allAdviceList.stream().filter(advice -> ItemType.ACTIVITY.getValue().equals(advice.getAdviceType()))
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// ======================== 耗材类划价处理 ========================
|
||||
|
||||
/**
|
||||
* 处理耗材类医嘱划价(核心子流程) 流程:筛选临时耗材 → 校验发放库房 → 生成耗材请求 → 生成执行记录 → 生成耗材发放 → 生成费用项 特殊规则:临时耗材划价不校验库存、不预减库存(仅记录发放需求,实际发放时扣库)
|
||||
* 处理耗材类医嘱划价(核心子流程) 流程:筛选临时耗材 → 校验发放库房 → 生成耗材请求 → 生成执行记录 → 生成耗材发放 → 生成费用项
|
||||
* 特殊规则:临时耗材划价不校验库存、不预减库存(仅记录发放需求,实际发放时扣库)
|
||||
*
|
||||
* @param deviceAdviceList 耗材类医嘱列表(已筛选)
|
||||
* @param signCode 全局签发编码(关联同一批次划价)
|
||||
@@ -763,7 +348,7 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
* @param curDate 当前操作时间(用于填充创建时间/执行时间)
|
||||
*/
|
||||
private void handleAddDeviceBilling(List<RegAdviceSaveDto> deviceAdviceList, String signCode, Long organizationId,
|
||||
Date curDate) {
|
||||
Date curDate) {
|
||||
// 1. 筛选临时类型耗材:仅处理临时医嘱(TherapyTimeType.TEMPORARY),且请求ID不为空
|
||||
List<AdviceSaveDto> tempDeviceList = deviceAdviceList.stream().collect(Collectors.toList());
|
||||
|
||||
@@ -780,30 +365,30 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
|
||||
// 3.2 生成医嘱执行记录(CLIN_PROCEDURE):记录执行状态、执行科室、执行时间等
|
||||
Long procedureId = this.addProcedureRecord(deviceRequest.getEncounterId(), // 就诊ID
|
||||
deviceRequest.getPatientId(), // 患者ID
|
||||
deviceRequest.getId(), // 耗材请求ID(关联执行记录与请求)
|
||||
SERVICE_TABLE_DEVICE, // 关联表名(耗材请求表)
|
||||
EventStatus.COMPLETED, // 执行状态:已完成
|
||||
ProcedureCategory.INPATIENT_NURSE_ADVICE, // 执行种类:住院护士医嘱
|
||||
deviceRequest.getLocationId(), // 执行位置(发放库房)
|
||||
curDate, null, null // 当前时间为执行时间,组号/取消ID为空
|
||||
deviceRequest.getPatientId(), // 患者ID
|
||||
deviceRequest.getId(), // 耗材请求ID(关联执行记录与请求)
|
||||
SERVICE_TABLE_DEVICE, // 关联表名(耗材请求表)
|
||||
EventStatus.COMPLETED, // 执行状态:已完成
|
||||
ProcedureCategory.INPATIENT_NURSE_ADVICE, // 执行种类:住院护士医嘱
|
||||
deviceRequest.getLocationId(), // 执行位置(发放库房)
|
||||
curDate, null, null // 当前时间为执行时间,组号/取消ID为空
|
||||
);
|
||||
|
||||
// 3.3 生成耗材发放记录(WOR_DEVICE_DISPENSE):状态设为待发放,关联执行记录
|
||||
Long dispenseId = iDeviceDispenseService.generateDeviceDispense(deviceRequest, procedureId,
|
||||
deviceRequest.getLocationId(), curDate);
|
||||
deviceRequest.getLocationId(), curDate);
|
||||
|
||||
// 3.4 生成费用项记录(ADM_CHARGE_ITEM):关联耗材请求、发放记录、执行记录,状态设为待结算
|
||||
ChargeItem chargeItem = buildChargeItem(adviceDto, deviceRequest.getBusNo(), deviceRequest.getId(),
|
||||
SERVICE_TABLE_DEVICE, PRODUCT_TABLE_DEVICE, curDate, procedureId, dispenseId, WOR_DEVICE_DISPENSE);
|
||||
SERVICE_TABLE_DEVICE, PRODUCT_TABLE_DEVICE, curDate, procedureId, dispenseId, WOR_DEVICE_DISPENSE);
|
||||
iChargeItemService.saveOrUpdate(chargeItem);
|
||||
}
|
||||
}
|
||||
|
||||
// ======================== 诊疗活动类划价处理 ========================
|
||||
|
||||
/**
|
||||
* 处理诊疗活动类医嘱划价(核心子流程) 流程:生成服务请求 → 生成执行记录 → 生成费用项 → 处理诊疗子项(如有) 特殊规则:诊疗活动可能包含子项(如套餐类活动),需递归处理子项划价
|
||||
* 处理诊疗活动类医嘱划价(核心子流程) 流程:生成服务请求 → 生成执行记录 → 生成费用项 → 处理诊疗子项(如有)
|
||||
* 特殊规则:诊疗活动可能包含子项(如套餐类活动),需递归处理子项划价
|
||||
*
|
||||
* @param activityAdviceList 诊疗活动类医嘱列表(已筛选)
|
||||
* @param signCode 全局签发编码(关联同一批次划价)
|
||||
@@ -813,27 +398,27 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
* @param authoredTime 医嘱签发时间
|
||||
*/
|
||||
private void handleAddActivityBilling(List<RegAdviceSaveDto> activityAdviceList, String signCode,
|
||||
Long organizationId, Date curDate, Date startTime, Date authoredTime) {
|
||||
Long organizationId, Date curDate, Date startTime, Date authoredTime) {
|
||||
// 循环处理每个诊疗活动医嘱
|
||||
for (AdviceSaveDto adviceDto : activityAdviceList) {
|
||||
// 1. 生成诊疗活动请求记录(WOR_SERVICE_REQUEST):状态设为激活,来源标记为护士划价
|
||||
ServiceRequest serviceRequest =
|
||||
this.buildActivityRequest(adviceDto, signCode, organizationId, curDate, startTime, authoredTime);
|
||||
ServiceRequest serviceRequest
|
||||
= this.buildActivityRequest(adviceDto, signCode, organizationId, curDate, startTime, authoredTime);
|
||||
|
||||
// 2. 生成医嘱执行记录(CLIN_PROCEDURE):关联服务请求,记录执行状态
|
||||
Long procedureId = this.addProcedureRecord(serviceRequest.getEncounterId(), // 就诊ID
|
||||
serviceRequest.getPatientId(), // 患者ID
|
||||
serviceRequest.getId(), // 服务请求ID(关联执行记录与请求)
|
||||
SERVICE_TABLE_SERVICE, // 关联表名(服务请求表)
|
||||
EventStatus.COMPLETED, // 执行状态:已完成
|
||||
ProcedureCategory.INPATIENT_NURSE_ADVICE, // 执行种类:住院护士医嘱
|
||||
serviceRequest.getLocationId(), // 执行位置(执行科室)
|
||||
curDate, null, null // 当前时间为执行时间,组号/取消ID为空
|
||||
serviceRequest.getPatientId(), // 患者ID
|
||||
serviceRequest.getId(), // 服务请求ID(关联执行记录与请求)
|
||||
SERVICE_TABLE_SERVICE, // 关联表名(服务请求表)
|
||||
EventStatus.COMPLETED, // 执行状态:已完成
|
||||
ProcedureCategory.INPATIENT_NURSE_ADVICE, // 执行种类:住院护士医嘱
|
||||
serviceRequest.getLocationId(), // 执行位置(执行科室)
|
||||
curDate, null, null // 当前时间为执行时间,组号/取消ID为空
|
||||
);
|
||||
|
||||
// 3. 生成费用项记录(ADM_CHARGE_ITEM):关联服务请求、执行记录,状态设为待结算
|
||||
ChargeItem chargeItem = buildChargeItem(adviceDto, serviceRequest.getBusNo(), serviceRequest.getId(),
|
||||
SERVICE_TABLE_SERVICE, PRODUCT_TABLE_ACTIVITY, curDate, procedureId, null, null);
|
||||
SERVICE_TABLE_SERVICE, PRODUCT_TABLE_ACTIVITY, curDate, procedureId, null, null);
|
||||
iChargeItemService.saveOrUpdate(chargeItem);
|
||||
|
||||
// 4. 处理诊疗子项(如活动包含子项配置,递归生成子项的划价数据)
|
||||
@@ -842,7 +427,6 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
}
|
||||
|
||||
// ======================== 执行记录工具方法 ========================
|
||||
|
||||
/**
|
||||
* 生成医嘱执行记录(通用方法,支持耗材/诊疗活动两种类型) 功能:调用执行记录服务,创建CLIN_PROCEDURE表记录,关联请求数据与执行信息
|
||||
*
|
||||
@@ -859,15 +443,14 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
* @return Long 执行记录ID(CLIN_PROCEDURE表主键)
|
||||
*/
|
||||
private Long addProcedureRecord(Long encounterId, Long patientId, Long requestId, String requestTable,
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Date exeDate, Long groupId,
|
||||
Long refundId) {
|
||||
EventStatus eventStatus, ProcedureCategory procedureCategory, Long locationId, Date exeDate, Long groupId,
|
||||
Long refundId) {
|
||||
// 调用执行记录服务创建记录,返回执行记录主键ID
|
||||
return iProcedureService.addProcedureRecord(encounterId, patientId, requestId, requestTable, eventStatus,
|
||||
procedureCategory, locationId, exeDate, exeDate, groupId, refundId);
|
||||
procedureCategory, locationId, exeDate, exeDate, groupId, refundId);
|
||||
}
|
||||
|
||||
// ======================== 实体构建工具方法(请求/费用项)========================
|
||||
|
||||
/**
|
||||
* 构建耗材请求实体(DeviceRequest) 功能:将医嘱DTO参数映射为耗材请求实体,填充默认配置(状态、业务编号、来源等)
|
||||
*
|
||||
@@ -883,7 +466,7 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
deviceRequest.setId(adviceDto.getRequestId());
|
||||
// 业务编号:按日生成,前缀+4位序列号(确保每日唯一)
|
||||
deviceRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), DEVICE_RES_NO_SEQ_LENGTH));
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), DEVICE_RES_NO_SEQ_LENGTH));
|
||||
// deviceRequest.setPrescriptionNo(null);//处方号
|
||||
// deviceRequest.setActivityId(null);//诊疗ID
|
||||
// deviceRequest.setPackageId(null);//组套id
|
||||
@@ -900,9 +483,9 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
deviceRequest.setDeviceDefId(adviceDto.getAdviceDefinitionId()); // 耗材定义ID(关联ADM_DEVICE_DEFINITION)
|
||||
// deviceRequest.setDeviceSpecifications(null)//器材规格
|
||||
deviceRequest.setRequesterId(
|
||||
adviceDto.getPractitionerId() == null ? loginUser.getPractitionerId() : adviceDto.getPractitionerId());// 请求发起人
|
||||
adviceDto.getPractitionerId() == null ? loginUser.getPractitionerId() : adviceDto.getPractitionerId());// 请求发起人
|
||||
deviceRequest
|
||||
.setOrgId(adviceDto.getFounderOrgId() == null ? loginUser.getOrgId() : adviceDto.getFounderOrgId());// 请求发起的科室
|
||||
.setOrgId(adviceDto.getFounderOrgId() == null ? loginUser.getOrgId() : adviceDto.getFounderOrgId());// 请求发起的科室
|
||||
deviceRequest.setLocationId(adviceDto.getLocationId());// 默认器材房
|
||||
deviceRequest.setPerformLocation(adviceDto.getLocationId()); // 发放库房ID(关联耗材发放位置)
|
||||
deviceRequest.setEncounterId(adviceDto.getEncounterId()); // 就诊ID(关联患者本次住院记录)
|
||||
@@ -946,7 +529,7 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
* @return ServiceRequest 构建完成的诊疗活动请求实体(已保存到数据库)
|
||||
*/
|
||||
private ServiceRequest buildActivityRequest(AdviceSaveDto activityDto, String signCode, Long organizationId,
|
||||
Date curDate, Date startTime, Date authoredTime) {
|
||||
Date curDate, Date startTime, Date authoredTime) {
|
||||
ServiceRequest serviceRequest = new ServiceRequest();
|
||||
|
||||
// 基础配置:主键、状态、业务编号、签发编码
|
||||
@@ -989,7 +572,7 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
* @param organizationId 住院科室ID
|
||||
*/
|
||||
private void buidActivityRequestChild(ServiceRequest serviceRequest, Long chargeItemId, AdviceSaveDto activityDto,
|
||||
Long organizationId) {
|
||||
Long organizationId) {
|
||||
// 1. 查询诊疗活动定义信息(获取子项配置JSON)
|
||||
ActivityDefinition activityDefinition = iActivityDefinitionService.getById(activityDto.getAdviceDefinitionId());
|
||||
String childrenJson = activityDefinition.getChildrenJson();
|
||||
@@ -1011,7 +594,8 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建费用项实体(ChargeItem) 功能:关联请求记录(耗材/诊疗)与费用信息,生成待结算的费用项(ADM_CHARGE_ITEM表) 通用性:支持耗材、诊疗活动两种类型的费用项构建
|
||||
* 构建费用项实体(ChargeItem) 功能:关联请求记录(耗材/诊疗)与费用信息,生成待结算的费用项(ADM_CHARGE_ITEM表)
|
||||
* 通用性:支持耗材、诊疗活动两种类型的费用项构建
|
||||
*
|
||||
* @param adviceDto 医嘱DTO(含费用相关参数:单价、总价等)
|
||||
* @param requestBusNo 关联请求的业务编号(耗材/服务请求的busNo)
|
||||
@@ -1025,8 +609,8 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
* @return ChargeItem 构建完成的费用项实体(可直接保存)
|
||||
*/
|
||||
private ChargeItem buildChargeItem(AdviceSaveDto adviceDto, String requestBusNo, Long requestId,
|
||||
String serviceTable, String productTable, Date curDate, Long procedureId, Long dispenseId,
|
||||
String dispenseTable) {
|
||||
String serviceTable, String productTable, Date curDate, Long procedureId, Long dispenseId,
|
||||
String dispenseTable) {
|
||||
ChargeItem chargeItem = new ChargeItem();
|
||||
// TODO1、是否需跨批次 2、金额 精确到小数点后6位 、数量 计算
|
||||
// 基础配置:主键、状态、业务编号
|
||||
@@ -1066,9 +650,9 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
}
|
||||
|
||||
// ======================== 耗材删除相关方法 ========================
|
||||
|
||||
/**
|
||||
* 处理耗材删除逻辑(级联删除关联数据) 核心规则:已收费的耗材项目不允许删除,未收费项目级联删除关联数据 级联删除顺序:耗材请求表 → 耗材发放表 → 费用项表
|
||||
* 处理耗材删除逻辑(级联删除关联数据) 核心规则:已收费的耗材项目不允许删除,未收费项目级联删除关联数据 级联删除顺序:耗材请求表 → 耗材发放表
|
||||
* → 费用项表
|
||||
*
|
||||
* @param requestIds 待删除的耗材医嘱列表(可为null)
|
||||
* @param serviceTable 关联服务表名(此处为耗材请求表)
|
||||
@@ -1083,8 +667,8 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
// 软删除执行记录
|
||||
List<Procedure> procedureList = iProcedureService.listByIds(requestIds);
|
||||
List<Long> procedureIds = procedureList.stream().filter(Objects::nonNull) // 过滤掉null的Procedure对象
|
||||
.map(Procedure::getId).filter(Objects::nonNull) // 过滤掉id为null的记录(按需添加)
|
||||
.collect(Collectors.toList());
|
||||
.map(Procedure::getId).filter(Objects::nonNull) // 过滤掉id为null的记录(按需添加)
|
||||
.collect(Collectors.toList());
|
||||
// 批量删除执行记录
|
||||
iProcedureService.removeBatchByIds(procedureIds);
|
||||
|
||||
@@ -1123,15 +707,14 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
}
|
||||
|
||||
// 2. 校验是否存在已收费项(状态为BILLED)
|
||||
boolean hasBilledItem =
|
||||
chargeItemList.stream().anyMatch(ci -> ChargeItemStatus.BILLED.getValue().equals(ci.getStatusEnum()));
|
||||
boolean hasBilledItem
|
||||
= chargeItemList.stream().anyMatch(ci -> ChargeItemStatus.BILLED.getValue().equals(ci.getStatusEnum()));
|
||||
if (hasBilledItem) {
|
||||
throw new ServiceException("删除失败:部分项目已完成收费(结算),不支持直接删除,请联系收费人员处理后重试");
|
||||
}
|
||||
}
|
||||
|
||||
// ======================== 未实现接口方法(保留签名,待扩展)========================
|
||||
|
||||
/**
|
||||
* 新增订单划价(待实现) 功能:针对订单类型的划价(如患者自主购买耗材/服务),生成对应的费用项
|
||||
*
|
||||
@@ -1174,19 +757,19 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<List<CostDetailDto>> getCostDetails(CostDetailSearchParam costDetailSearchParam,
|
||||
HttpServletRequest request) {
|
||||
HttpServletRequest request) {
|
||||
List<Long> encounterIds = costDetailSearchParam.getEncounterIds();
|
||||
if (encounterIds == null || encounterIds.isEmpty()) {
|
||||
return R.fail("就诊ID不能为空");
|
||||
}
|
||||
costDetailSearchParam.setEncounterIds(null);
|
||||
QueryWrapper<CostDetailSearchParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(costDetailSearchParam, null, null, request);
|
||||
QueryWrapper<CostDetailSearchParam> queryWrapper
|
||||
= HisQueryUtils.buildQueryWrapper(costDetailSearchParam, null, null, request);
|
||||
queryWrapper.in(CommonConstants.FieldName.EncounterId, encounterIds);
|
||||
List<CostDetailDto> list = iChargeItemService.getCostDetails(queryWrapper, ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
EncounterActivityStatus.ACTIVE.getValue(), LocationForm.BED.getValue(),
|
||||
ParticipantType.ADMITTING_DOCTOR.getCode(), AccountType.PERSONAL_CASH_ACCOUNT.getCode());
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
EncounterActivityStatus.ACTIVE.getValue(), LocationForm.BED.getValue(),
|
||||
ParticipantType.ADMITTING_DOCTOR.getCode(), AccountType.PERSONAL_CASH_ACCOUNT.getCode());
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@@ -1198,7 +781,7 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
*/
|
||||
@Override
|
||||
public void makeExcelFile(CostDetailSearchParam costDetailSearchParam, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
HttpServletResponse response) {
|
||||
R<List<CostDetailDto>> costDetails = getCostDetails(costDetailSearchParam, request);
|
||||
if (costDetails.getData() != null) {
|
||||
List<CostDetailDto> dataList = costDetails.getData();
|
||||
@@ -1208,16 +791,16 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
costDetailDto.setOrgName(organizationService.getById(orgId).getName());
|
||||
});
|
||||
// 根据EncounterId分组
|
||||
Map<Long, List<CostDetailDto>> map =
|
||||
dataList.stream().collect(Collectors.groupingBy(CostDetailDto::getEncounterId));
|
||||
Map<Long, List<CostDetailDto>> map
|
||||
= dataList.stream().collect(Collectors.groupingBy(CostDetailDto::getEncounterId));
|
||||
map.forEach((key, value) -> {
|
||||
// 新加一条小计
|
||||
value.add(new CostDetailDto().setEncounterId(key).setChargeName("小计").setTotalPrice(
|
||||
value.stream().map(CostDetailDto::getTotalPrice).reduce(BigDecimal.ZERO, BigDecimal::add)));
|
||||
value.stream().map(CostDetailDto::getTotalPrice).reduce(BigDecimal.ZERO, BigDecimal::add)));
|
||||
});
|
||||
// 收集要导出的数据
|
||||
List<CostDetailExcelOutDto> excelOutList =
|
||||
map.entrySet().stream().map(entry -> new CostDetailExcelOutDto(entry.getKey(), entry.getValue(),
|
||||
List<CostDetailExcelOutDto> excelOutList
|
||||
= map.entrySet().stream().map(entry -> new CostDetailExcelOutDto(entry.getKey(), entry.getValue(),
|
||||
entry.getValue().get(0).getPatientName())).toList();
|
||||
try {
|
||||
// 住院记账-费用明细 导出
|
||||
@@ -1229,5 +812,4 @@ public class NurseBillingAppService implements INurseBillingAppService {
|
||||
}
|
||||
}
|
||||
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,26 +8,16 @@ import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
<<<<<<< HEAD
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
=======
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.common.appservice.impl.CommonServiceImpl;
|
||||
import com.openhis.web.common.dto.LocationDto;
|
||||
>>>>>>> v1.3
|
||||
import com.openhis.web.common.dto.UnitDto;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IOrgDeviceStockTakeAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.OrgDeviceDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.OrgDeviceSummaryFromDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.OrgDeviceSummaryParam;
|
||||
import com.openhis.web.inhospitalnursestation.mapper.OrgDeviceStockTakeAppMapper;
|
||||
<<<<<<< HEAD
|
||||
import com.openhis.web.pharmacymanage.mapper.ReturnMedicineMapper;
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.mapper.InventoryItemMapper;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
@@ -39,10 +29,6 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
<<<<<<< HEAD
|
||||
import java.time.LocalDate;
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -76,8 +62,6 @@ public class OrgDeviceStockTakeAppServiceImpl implements IOrgDeviceStockTakeAppS
|
||||
@Resource
|
||||
private InventoryItemMapper inventoryItemMapper;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
@Resource
|
||||
private CommonServiceImpl commonService;
|
||||
|
||||
@@ -92,16 +76,10 @@ public class OrgDeviceStockTakeAppServiceImpl implements IOrgDeviceStockTakeAppS
|
||||
return R.ok(inventoryPharmacyList);
|
||||
}
|
||||
|
||||
>>>>>>> v1.3
|
||||
/**
|
||||
* 查询科室耗材汇总
|
||||
*
|
||||
* @param orgDeviceSummaryParam 查询条件
|
||||
<<<<<<< HEAD
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
@@ -109,115 +87,24 @@ public class OrgDeviceStockTakeAppServiceImpl implements IOrgDeviceStockTakeAppS
|
||||
* @return 科室耗材汇总单
|
||||
*/
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public R<?> getOrgDeviceSummaryFromPage(OrgDeviceSummaryParam orgDeviceSummaryParam, String startTime,
|
||||
String endTime, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
=======
|
||||
public R<?> getOrgDeviceSummaryFromPage(OrgDeviceSummaryParam orgDeviceSummaryParam, Integer pageNo,
|
||||
Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
>>>>>>> v1.3
|
||||
Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
pageSize = Integer.MAX_VALUE;
|
||||
|
||||
QueryWrapper<OrgDeviceDto> queryWrapper = HisQueryUtils.buildQueryWrapper(orgDeviceSummaryParam, searchKey,
|
||||
new HashSet<>(List.of(CommonConstants.FieldName.ItemName)), request);
|
||||
<<<<<<< HEAD
|
||||
if (!(startTime == null || endTime == null)) {
|
||||
queryWrapper.between(CommonConstants.FieldName.ApplyTime, LocalDate.parse(startTime),
|
||||
LocalDate.parse(endTime));
|
||||
}
|
||||
new HashSet<>(List.of(CommonConstants.FieldName.ItemName)), request);
|
||||
|
||||
Page<OrgDeviceDto> orgDeviceDtoPage =
|
||||
orgDeviceStockTakeAppMapper.selectOrgDeviceInfo(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
List<OrgDeviceDto> orgDeviceList =
|
||||
new ArrayList<>(orgDeviceDtoPage.getRecords()).stream().filter(x -> x.getDispenseId() != null).toList();
|
||||
|
||||
=======
|
||||
|
||||
Page<OrgDeviceDto> orgDeviceDtoPage =
|
||||
orgDeviceStockTakeAppMapper.selectOrgDeviceInfo(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
EncounterClass.IMP.getValue(), RequestStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.PREPARATION.getValue(), ChargeItemStatus.BILLABLE.getValue());
|
||||
Page<OrgDeviceDto> orgDeviceDtoPage
|
||||
= orgDeviceStockTakeAppMapper.selectOrgDeviceInfo(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
EncounterClass.IMP.getValue(), RequestStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.PREPARATION.getValue(), ChargeItemStatus.BILLABLE.getValue());
|
||||
|
||||
List<OrgDeviceDto> orgDeviceList = new ArrayList<>(orgDeviceDtoPage.getRecords());
|
||||
>>>>>>> v1.3
|
||||
// 根据项目id + 批次号 + 库房号分组
|
||||
Map<String, List<OrgDeviceDto>> orgDeviceGroupBy =
|
||||
orgDeviceList.stream().collect(Collectors.groupingBy(item -> item.getItemId() + CommonConstants.Common.DASH
|
||||
Map<String, List<OrgDeviceDto>> orgDeviceGroupBy
|
||||
= orgDeviceList.stream().collect(Collectors.groupingBy(item -> item.getItemId() + CommonConstants.Common.DASH
|
||||
+ item.getLotNumber() + CommonConstants.Common.DASH + item.getSourceLocationId()));
|
||||
|
||||
<<<<<<< HEAD
|
||||
ArrayList<OrgDeviceSummaryFromDto> orgDeviceSummaryFromDtoList = new ArrayList<>();
|
||||
|
||||
orgDeviceGroupBy.forEach((k, v) -> {
|
||||
OrgDeviceSummaryFromDto orgDeviceSummaryFromDto = new OrgDeviceSummaryFromDto();
|
||||
|
||||
String itemId = k.split(CommonConstants.Common.DASH)[0];
|
||||
String lotNumber = k.split(CommonConstants.Common.DASH)[1];
|
||||
String sourceLocationId = k.split(CommonConstants.Common.DASH)[2];
|
||||
|
||||
OrgDeviceDto orgDeviceDtoFirst = v.get(0);
|
||||
// 拆零比例
|
||||
BigDecimal partPercent = orgDeviceDtoFirst.getPartPercent();
|
||||
// 最小单位
|
||||
String minUnitCode = orgDeviceDtoFirst.getMinUnitCode();
|
||||
// 常规单位
|
||||
String unitCode = orgDeviceDtoFirst.getMaxUnitCode();
|
||||
if (minUnitCode == null || unitCode == null || partPercent == null) {
|
||||
throw new ServiceException("耗材信息有误,请联系管理员");
|
||||
}
|
||||
|
||||
List<Long> dispenseIdList = new ArrayList<>();
|
||||
|
||||
// 最小单位数量
|
||||
BigDecimal minQuantity = BigDecimal.ZERO;
|
||||
for (OrgDeviceDto orgDeviceDto : v) {
|
||||
BigDecimal quantity = orgDeviceDto.getQuantity();
|
||||
if (unitCode.equals(orgDeviceDto.getUnitCode())) {
|
||||
// 转换为小单位进行累加
|
||||
quantity = orgDeviceDto.getQuantity().multiply(partPercent);
|
||||
}
|
||||
minQuantity = minQuantity.add(quantity);
|
||||
dispenseIdList.add(orgDeviceDto.getDispenseId());
|
||||
}
|
||||
|
||||
List<UnitDto> unitList = new ArrayList<>();
|
||||
UnitDto unitDto = new UnitDto();
|
||||
// 单位列表
|
||||
unitDto.setUnitCode(orgDeviceDtoFirst.getUnitCode()).setMinUnitCode(minUnitCode);
|
||||
unitList.add(unitDto);
|
||||
|
||||
orgDeviceSummaryFromDto.setItemId(Long.valueOf(itemId)) // 器材id
|
||||
.setName(orgDeviceDtoFirst.getItemName()) // 器材名称
|
||||
.setTotalVolume(orgDeviceDtoFirst.getTotalVolume()) // 规格
|
||||
.setManufacturer(orgDeviceDtoFirst.getManufacturer()) // 厂家
|
||||
.setLotNumber(lotNumber) // 批号
|
||||
.setUnitPrice(orgDeviceDtoFirst.getUnitPrice()) // 单价
|
||||
.setDispenseQuantity(minQuantity) // 发放数量
|
||||
.setUnitCode(orgDeviceDtoFirst.getUnitCode()) // 单位
|
||||
.setMinUnitCode(minUnitCode) // 最小单位
|
||||
.setPartPercent(partPercent) // 拆零比
|
||||
.setUnitCode_dictText(orgDeviceDtoFirst.getUnitCode_dictText()) // 单位文字
|
||||
.setSourceLocationId(Long.valueOf(sourceLocationId)) // 发放地点
|
||||
.setDispenseIdList(dispenseIdList) // 发放id列表
|
||||
.setUnitList(unitList); // 单位列表
|
||||
|
||||
orgDeviceSummaryFromDtoList.add(orgDeviceSummaryFromDto);
|
||||
});
|
||||
|
||||
List<Long> itemIdList = orgDeviceSummaryFromDtoList.stream().map(OrgDeviceSummaryFromDto::getItemId).toList();
|
||||
List<InventoryItem> inventoryItemList = inventoryItemService.selectInventoryByItemIdList(itemIdList, 1);
|
||||
for (InventoryItem inventoryItem : inventoryItemList)
|
||||
for (OrgDeviceSummaryFromDto orgDeviceSummaryFromDto : orgDeviceSummaryFromDtoList)
|
||||
if (orgDeviceSummaryFromDto.getItemId().equals(inventoryItem.getItemId())
|
||||
&& orgDeviceSummaryFromDto.getLotNumber().equals(inventoryItem.getLotNumber())
|
||||
&& orgDeviceSummaryFromDto.getSourceLocationId().equals(inventoryItem.getLocationId())) {
|
||||
// 库存数量
|
||||
orgDeviceSummaryFromDto.setQuantity(inventoryItem.getQuantity());
|
||||
// 库存id
|
||||
orgDeviceSummaryFromDto.setInventoryItemId(inventoryItem.getId());
|
||||
}
|
||||
=======
|
||||
List<OrgDeviceSummaryFromDto> orgDeviceSummaryFromDtoList = new ArrayList<>();
|
||||
|
||||
// 对分组后的数量进行汇总
|
||||
@@ -268,19 +155,19 @@ public class OrgDeviceStockTakeAppServiceImpl implements IOrgDeviceStockTakeAppS
|
||||
unitList.add(unitDto);
|
||||
|
||||
orgDeviceSummaryFromDto.setItemId(Long.valueOf(itemId)) // 器材id
|
||||
.setName(orgDeviceDtoFirst.getItemName()) // 器材名称
|
||||
.setTotalVolume(orgDeviceDtoFirst.getTotalVolume()) // 规格
|
||||
.setManufacturer(orgDeviceDtoFirst.getManufacturer()) // 厂家
|
||||
.setLotNumber(lotNumber) // 批号
|
||||
.setUnitPrice(orgDeviceDtoFirst.getUnitPrice()) // 单价
|
||||
.setDispenseQuantity(minQuantity) // 发放数量
|
||||
.setUnitCode(orgDeviceDtoFirst.getUnitCode()) // 单位
|
||||
.setMinUnitCode(minUnitCode) // 最小单位
|
||||
.setPartPercent(partPercent) // 拆零比
|
||||
.setUnitCode_dictText(orgDeviceDtoFirst.getUnitCode_dictText()) // 单位文字
|
||||
.setSourceLocationId(Long.valueOf(sourceLocationId)) // 发放地点
|
||||
.setDispenseIdList(dispenseIdList) // 发放id列表
|
||||
.setUnitList(unitList); // 单位列表
|
||||
.setName(orgDeviceDtoFirst.getItemName()) // 器材名称
|
||||
.setTotalVolume(orgDeviceDtoFirst.getTotalVolume()) // 规格
|
||||
.setManufacturer(orgDeviceDtoFirst.getManufacturer()) // 厂家
|
||||
.setLotNumber(lotNumber) // 批号
|
||||
.setUnitPrice(orgDeviceDtoFirst.getUnitPrice()) // 单价
|
||||
.setDispenseQuantity(minQuantity) // 发放数量
|
||||
.setUnitCode(orgDeviceDtoFirst.getUnitCode()) // 单位
|
||||
.setMinUnitCode(minUnitCode) // 最小单位
|
||||
.setPartPercent(partPercent) // 拆零比
|
||||
.setUnitCode_dictText(orgDeviceDtoFirst.getUnitCode_dictText()) // 单位文字
|
||||
.setSourceLocationId(Long.valueOf(sourceLocationId)) // 发放地点
|
||||
.setDispenseIdList(dispenseIdList) // 发放id列表
|
||||
.setUnitList(unitList); // 单位列表
|
||||
|
||||
orgDeviceSummaryFromDtoList.add(orgDeviceSummaryFromDto);
|
||||
}
|
||||
@@ -290,19 +177,20 @@ public class OrgDeviceStockTakeAppServiceImpl implements IOrgDeviceStockTakeAppS
|
||||
List<Long> itemIdList = orgDeviceSummaryFromDtoList.stream().map(OrgDeviceSummaryFromDto::getItemId).toList();
|
||||
if (!itemIdList.isEmpty()) {
|
||||
List<InventoryItem> inventoryItemList = inventoryItemService.selectInventoryByItemIdList(itemIdList,
|
||||
SecurityUtils.getLoginUser().getTenantId());
|
||||
for (InventoryItem inventoryItem : inventoryItemList)
|
||||
for (OrgDeviceSummaryFromDto orgDeviceSummaryFromDto : orgDeviceSummaryFromDtoList)
|
||||
SecurityUtils.getLoginUser().getTenantId());
|
||||
for (InventoryItem inventoryItem : inventoryItemList) {
|
||||
for (OrgDeviceSummaryFromDto orgDeviceSummaryFromDto : orgDeviceSummaryFromDtoList) {
|
||||
if (orgDeviceSummaryFromDto.getItemId().equals(inventoryItem.getItemId())
|
||||
&& orgDeviceSummaryFromDto.getLotNumber().equals(inventoryItem.getLotNumber())
|
||||
&& orgDeviceSummaryFromDto.getSourceLocationId().equals(inventoryItem.getLocationId())) {
|
||||
&& orgDeviceSummaryFromDto.getLotNumber().equals(inventoryItem.getLotNumber())
|
||||
&& orgDeviceSummaryFromDto.getSourceLocationId().equals(inventoryItem.getLocationId())) {
|
||||
// 库存数量
|
||||
orgDeviceSummaryFromDto.setQuantity(inventoryItem.getQuantity());
|
||||
// 库存id
|
||||
orgDeviceSummaryFromDto.setInventoryItemId(inventoryItem.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
>>>>>>> v1.3
|
||||
|
||||
return R.ok(orgDeviceSummaryFromDtoList);
|
||||
}
|
||||
@@ -313,77 +201,11 @@ public class OrgDeviceStockTakeAppServiceImpl implements IOrgDeviceStockTakeAppS
|
||||
* @return 科室耗材汇总单
|
||||
*/
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public R<?> orgDeviceSummary(OrgDeviceSummaryParam orgDeviceSummaryParam) {
|
||||
=======
|
||||
public R<?> orgDeviceSummary(List<OrgDeviceSummaryParam> orgDeviceSummaryParamList) {
|
||||
>>>>>>> v1.3
|
||||
// 申请时间
|
||||
Date now = DateUtils.getNowDate();
|
||||
// 申请人
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
<<<<<<< HEAD
|
||||
// 汇总单据号
|
||||
String busNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_SUMMARY_NO.getPrefix(), 4);
|
||||
|
||||
// 数量
|
||||
BigDecimal stockTakeQuantity = orgDeviceSummaryParam.getStockTakeQuantity();
|
||||
// 使用单位
|
||||
String useUnitCode = orgDeviceSummaryParam.getUseUnitCode();
|
||||
// 最小单位
|
||||
String minUnitCode = orgDeviceSummaryParam.getMinUnitCode();
|
||||
// 拆零比
|
||||
BigDecimal partPercent = orgDeviceSummaryParam.getPartPercent();
|
||||
// 发放id列表
|
||||
List<Long> dispenseIdList = orgDeviceSummaryParam.getDispenseIdList();
|
||||
|
||||
if (orgDeviceSummaryParam.getInventoryItemId() == null) {
|
||||
return R.ok("未匹配到库存");
|
||||
}
|
||||
List<InventoryItem> inventoryItemList = new ArrayList<>();
|
||||
// 获取库存信息
|
||||
InventoryItem inventoryItem = inventoryItemMapper.selectById(orgDeviceSummaryParam.getInventoryItemId());
|
||||
if (inventoryItem != null) {
|
||||
if (PublicationStatus.ACTIVE.getValue().equals(inventoryItem.getInventoryStatusEnum())) {
|
||||
// 库存数量判定
|
||||
if (useUnitCode.equals(inventoryItem.getUnitCode())) {
|
||||
// 当前库存数量(拆零单位)=当前库存数量(拆零单位)-请求数量
|
||||
BigDecimal quantity = inventoryItem.getQuantity().subtract(stockTakeQuantity);
|
||||
// 库存数量判定
|
||||
if (quantity.compareTo(BigDecimal.ZERO) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail("当前库存数量不足");
|
||||
} else {
|
||||
inventoryItem.setQuantity(quantity);
|
||||
}
|
||||
} else {
|
||||
// 当前库存数量(拆零单位)=当前库存数量(拆零单位)-拆零数量(拆零比×请求数量)
|
||||
BigDecimal quantity = inventoryItem.getQuantity().subtract(partPercent.multiply(stockTakeQuantity));
|
||||
// 库存数量判定
|
||||
if (quantity.compareTo(BigDecimal.ZERO) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail("当前库存数量不足");
|
||||
} else {
|
||||
inventoryItem.setQuantity(quantity);
|
||||
}
|
||||
}
|
||||
inventoryItemList.add(inventoryItem);
|
||||
}
|
||||
// 库存更新
|
||||
inventoryItemService.updateBatchById(inventoryItemList);
|
||||
// 添加汇总单
|
||||
Long supplyRequestId = supplyRequestService.createDeviceSummarySupplyRequest(
|
||||
orgDeviceSummaryParam.getItemId(), orgDeviceSummaryParam.getSourceLocationId(),
|
||||
orgDeviceSummaryParam.getLotNumber(), stockTakeQuantity, minUnitCode, practitionerId, now, busNo);
|
||||
supplyDeliveryService.createDeviceSummarySupplyDelivery(orgDeviceSummaryParam.getItemId(),
|
||||
orgDeviceSummaryParam.getLotNumber(), stockTakeQuantity, minUnitCode, supplyRequestId);
|
||||
|
||||
// 耗材发放状态更新
|
||||
deviceDispenseService.updateDispenseStatusSummarized(dispenseIdList, busNo);
|
||||
return R.ok("盘点成功");
|
||||
}
|
||||
return R.fail("未找到对应库存数据");
|
||||
=======
|
||||
|
||||
for (OrgDeviceSummaryParam orgDeviceSummaryParam : orgDeviceSummaryParamList) {
|
||||
// 汇总单据号
|
||||
@@ -424,8 +246,8 @@ public class OrgDeviceStockTakeAppServiceImpl implements IOrgDeviceStockTakeAppS
|
||||
}
|
||||
} else {
|
||||
// 当前库存数量(拆零单位)=当前库存数量(拆零单位)-拆零数量(拆零比×请求数量)
|
||||
BigDecimal quantity =
|
||||
inventoryItem.getQuantity().subtract(partPercent.multiply(stockTakeQuantity));
|
||||
BigDecimal quantity
|
||||
= inventoryItem.getQuantity().subtract(partPercent.multiply(stockTakeQuantity));
|
||||
// 库存数量判定
|
||||
if (quantity.compareTo(BigDecimal.ZERO) < 0) {
|
||||
// 库存数量不足
|
||||
@@ -441,10 +263,10 @@ public class OrgDeviceStockTakeAppServiceImpl implements IOrgDeviceStockTakeAppS
|
||||
|
||||
// 添加汇总单
|
||||
Long supplyRequestId = supplyRequestService.createDeviceSummarySupplyRequest(
|
||||
orgDeviceSummaryParam.getItemId(), orgDeviceSummaryParam.getSourceLocationId(),
|
||||
orgDeviceSummaryParam.getLotNumber(), stockTakeQuantity, minUnitCode, practitionerId, now, busNo);
|
||||
orgDeviceSummaryParam.getItemId(), orgDeviceSummaryParam.getSourceLocationId(),
|
||||
orgDeviceSummaryParam.getLotNumber(), stockTakeQuantity, minUnitCode, practitionerId, now, busNo);
|
||||
supplyDeliveryService.createDeviceSummarySupplyDelivery(orgDeviceSummaryParam.getItemId(),
|
||||
orgDeviceSummaryParam.getLotNumber(), stockTakeQuantity, minUnitCode, supplyRequestId);
|
||||
orgDeviceSummaryParam.getLotNumber(), stockTakeQuantity, minUnitCode, supplyRequestId);
|
||||
|
||||
// 库存更新
|
||||
inventoryItemService.updateBatchById(inventoryItemList);
|
||||
@@ -452,7 +274,6 @@ public class OrgDeviceStockTakeAppServiceImpl implements IOrgDeviceStockTakeAppS
|
||||
return R.fail("未查询到" + orgDeviceSummaryParam.getName() + "对应库存数据");
|
||||
}
|
||||
return R.ok("盘点成功");
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ public class ATDManageController {
|
||||
*/
|
||||
@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) {
|
||||
@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);
|
||||
}
|
||||
|
||||
@@ -70,8 +70,8 @@ public class ATDManageController {
|
||||
*/
|
||||
@GetMapping(value = "/admission-bed")
|
||||
public R<?> getAdmissionBedPage(AdmissionPageParam admissionPageParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return atdManageAppService.getAdmissionBedPage(admissionPageParam, pageNo, pageSize);
|
||||
}
|
||||
|
||||
@@ -88,16 +88,7 @@ public class ATDManageController {
|
||||
|
||||
/**
|
||||
* 住院患者待处理信息列表
|
||||
<<<<<<< HEAD
|
||||
*
|
||||
* @param encounterId 住院id
|
||||
* @return 待处理信息列表
|
||||
*/
|
||||
@GetMapping(value = "/patient-pending")
|
||||
public R<?> getInPatientPendingList(Long encounterId) {
|
||||
return atdManageAppService.getInPatientPendingList(encounterId);
|
||||
=======
|
||||
*
|
||||
* @param inpatientAdviceParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
@@ -105,10 +96,9 @@ public class ATDManageController {
|
||||
*/
|
||||
@GetMapping(value = "/patient-pending")
|
||||
public R<?> getInPatientPendingList(InpatientAdviceParam inpatientAdviceParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return atdManageAppService.getInPatientPendingList(inpatientAdviceParam, pageNo, pageSize);
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,11 +115,7 @@ public class ATDManageController {
|
||||
/**
|
||||
* 转科
|
||||
*
|
||||
<<<<<<< HEAD
|
||||
* @param encounterId 住院id
|
||||
=======
|
||||
* @param encounterId 住院患者id
|
||||
>>>>>>> v1.3
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/transfer-department")
|
||||
@@ -140,19 +126,13 @@ public class ATDManageController {
|
||||
/**
|
||||
* 出院
|
||||
*
|
||||
<<<<<<< HEAD
|
||||
* @param encounterId 住院id
|
||||
=======
|
||||
* @param encounterId 住院患者id
|
||||
>>>>>>> v1.3
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/hospital-discharge")
|
||||
public R<?> hospitalDischarge(Long encounterId) {
|
||||
return atdManageAppService.hospitalDischarge(encounterId);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
/**
|
||||
* 清床
|
||||
@@ -167,10 +147,11 @@ public class ATDManageController {
|
||||
|
||||
/**
|
||||
* 诊断个人账户金额信息获取
|
||||
*
|
||||
*
|
||||
* @param encounterId 诊断id
|
||||
* @return EncounterAccountDto 诊断账户金额
|
||||
**/
|
||||
*
|
||||
*/
|
||||
@GetMapping(value = "/get-amount")
|
||||
public R<?> getAmount(Long encounterId) {
|
||||
return atdManageAppService.getAmount(encounterId);
|
||||
@@ -178,13 +159,13 @@ public class ATDManageController {
|
||||
|
||||
/**
|
||||
* 获取待配/退药
|
||||
*
|
||||
*
|
||||
* @param encounterId 诊断id
|
||||
* @return PendingMedicationDto 待配/退药
|
||||
**/
|
||||
*
|
||||
*/
|
||||
@GetMapping(value = "/get-dr-medication")
|
||||
public R<?> getPendingMedication(Long encounterId) {
|
||||
return atdManageAppService.getPendingMedication(encounterId);
|
||||
}
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
@@ -31,26 +31,6 @@ public class MedicineSummaryController {
|
||||
public IMedicineSummaryAppService medicineSummaryAppService;
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD
|
||||
* 查询发药单信息
|
||||
*
|
||||
* @param dispenseFormSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求
|
||||
* @return 发药单信息
|
||||
*/
|
||||
@GetMapping(value = "/dispensing-form")
|
||||
public R<?> getMedicineDispenseFormPage(DispenseFormSearchParam dispenseFormSearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return medicineSummaryAppService.getMedicineDispenseFormPage(dispenseFormSearchParam, pageNo, pageSize,
|
||||
request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询药品汇总单
|
||||
=======
|
||||
* 药品汇总单初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
@@ -62,41 +42,19 @@ public class MedicineSummaryController {
|
||||
|
||||
/**
|
||||
* 查询发药单信息
|
||||
>>>>>>> v1.3
|
||||
*
|
||||
* @param dispenseFormSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
<<<<<<< HEAD
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求
|
||||
* @return 药品汇总单
|
||||
*/
|
||||
@GetMapping(value = "/summary-form")
|
||||
public R<?> getMedicineSummaryFormPage(DispenseFormSearchParam dispenseFormSearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, String searchKey,
|
||||
HttpServletRequest request) {
|
||||
return medicineSummaryAppService.getMedicineSummaryFormPage(dispenseFormSearchParam, pageNo, pageSize,
|
||||
searchKey, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询药品汇总单详情
|
||||
*
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 药品汇总单详情
|
||||
*/
|
||||
=======
|
||||
* @param request 请求
|
||||
* @return 发药单信息
|
||||
*/
|
||||
@GetMapping(value = "/dispensing-form")
|
||||
public R<?> getMedicineDispenseFormPage(DispenseFormSearchParam dispenseFormSearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return medicineSummaryAppService.getMedicineDispenseFormPage(dispenseFormSearchParam, pageNo, pageSize,
|
||||
request);
|
||||
request);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,11 +69,11 @@ public class MedicineSummaryController {
|
||||
*/
|
||||
@GetMapping(value = "/summary-form")
|
||||
public R<?> getMedicineSummaryFormPage(DispenseFormSearchParam dispenseFormSearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, String searchKey,
|
||||
HttpServletRequest request) {
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, String searchKey,
|
||||
HttpServletRequest request) {
|
||||
return medicineSummaryAppService.getMedicineSummaryFormPage(dispenseFormSearchParam, pageNo, pageSize,
|
||||
searchKey, request);
|
||||
searchKey, request);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +82,6 @@ public class MedicineSummaryController {
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 药品汇总单详情
|
||||
*/
|
||||
>>>>>>> v1.3
|
||||
@GetMapping(value = "/summary-form-detail")
|
||||
public R<?> getMedicineSummaryFormDetail(String summaryNo) {
|
||||
return medicineSummaryAppService.getMedicineSummaryFormDetail(summaryNo);
|
||||
|
||||
@@ -1,26 +1,5 @@
|
||||
package com.openhis.web.inhospitalnursestation.controller;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.regdoctorstation.dto.RegAdviceSaveParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author whm
|
||||
* @date 2025/11/10 16:00
|
||||
* @description 住院护士 患者划价、医嘱计费
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/inhospitalnursestation/innursebilling")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class NurseBillingController {
|
||||
// TODO: Implement InNurseBillingController
|
||||
=======
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@@ -44,70 +23,28 @@ import lombok.extern.slf4j.Slf4j;
|
||||
/**
|
||||
* 住院护士 患者划价、医嘱计费
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/inhospitalnursestation/nursebilling")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class NurseBillingController {
|
||||
|
||||
@Resource
|
||||
private INurseBillingAppService iNurseBillingAppService;
|
||||
|
||||
>>>>>>> v1.3
|
||||
/*
|
||||
* 新增住院护士划价
|
||||
* @return
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
public R<?> addInNurseBilling(RegAdviceSaveParam regAdviceSaveParam) {
|
||||
return R.ok();
|
||||
}
|
||||
/*
|
||||
* 住院护士 划价列表 根据护士encounterId查询
|
||||
* @return
|
||||
*/
|
||||
public R<?> getBillingListByEncounterId() {
|
||||
return R.ok();
|
||||
}
|
||||
=======
|
||||
@PostMapping("/add-billing")
|
||||
public R<?> addInNurseBilling(@RequestBody RegAdviceSaveParam regAdviceSaveParam) {
|
||||
return iNurseBillingAppService.addInNurseBilling(regAdviceSaveParam);
|
||||
}
|
||||
|
||||
>>>>>>> v1.3
|
||||
/*
|
||||
* 住院护士撤销划价
|
||||
* @return
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
public R<?> deleteInNurseBilling() {
|
||||
return R.ok();
|
||||
}
|
||||
/*
|
||||
* 医嘱计费添加 诊疗 耗材
|
||||
*/
|
||||
public R<?> addOrderBilling() {
|
||||
return R.ok();
|
||||
}
|
||||
/*
|
||||
* 医嘱计费删除 诊疗 耗材
|
||||
*/
|
||||
public R<?> deleteOrderBilling() {
|
||||
return R.ok();
|
||||
}
|
||||
/*
|
||||
* 医嘱计费修改 诊疗 耗材
|
||||
*/
|
||||
public R<?> updateOrderBilling() {
|
||||
return R.ok();
|
||||
}
|
||||
/*
|
||||
根据医嘱id查询已计费的 耗材列表
|
||||
* @return
|
||||
*/
|
||||
public R<?> getOrderBillingByRequestId() {
|
||||
=======
|
||||
@PostMapping("/del-billing")
|
||||
public R<?> deleteInNurseBilling(@RequestBody List<AdviceBatchOpParam> paramList) {
|
||||
return iNurseBillingAppService.deleteInNurseBilling(paramList);
|
||||
@@ -123,12 +60,12 @@ public class NurseBillingController {
|
||||
*/
|
||||
@GetMapping(value = "/innurse-billing-list/")
|
||||
public R<?> getInNurseBillingPage(InpatientAdviceParam inpatientAdviceParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime startTime,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime startTime,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
|
||||
return iNurseBillingAppService.getInNurseBillingPage(inpatientAdviceParam, pageNo, pageSize, startTime,
|
||||
endTime);
|
||||
endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,14 +82,14 @@ public class NurseBillingController {
|
||||
|
||||
/**
|
||||
* 费用明细导出
|
||||
*
|
||||
*
|
||||
* @param costDetailSearchParam 查询条件
|
||||
* @param request request请求
|
||||
* @param response response响应
|
||||
*/
|
||||
@GetMapping("/excel-out")
|
||||
public void makeExcelFile(CostDetailSearchParam costDetailSearchParam, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
HttpServletResponse response) {
|
||||
iNurseBillingAppService.makeExcelFile(costDetailSearchParam, request, response);
|
||||
}
|
||||
|
||||
@@ -174,7 +111,6 @@ public class NurseBillingController {
|
||||
* 医嘱计费修改 诊疗 耗材
|
||||
*/
|
||||
public R<?> updateOrderBilling() {
|
||||
>>>>>>> v1.3
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
package com.openhis.web.inhospitalnursestation.controller;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IOrgDeviceStockTakeAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.OrgDeviceSummaryParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
=======
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -24,7 +13,6 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
>>>>>>> v1.3
|
||||
|
||||
/**
|
||||
* 科室耗材盘点
|
||||
@@ -33,11 +21,7 @@ import java.util.List;
|
||||
* @date 2025/11/05
|
||||
*/
|
||||
@RestController
|
||||
<<<<<<< HEAD
|
||||
@RequestMapping("/nurse-station/orgdevice-stocktake")
|
||||
=======
|
||||
@RequestMapping("/nurse-station/org-device-stockTake")
|
||||
>>>>>>> v1.3
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OrgDeviceStockTakeController {
|
||||
@@ -46,13 +30,6 @@ public class OrgDeviceStockTakeController {
|
||||
private IOrgDeviceStockTakeAppService orgDeviceStockTakeService;
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD
|
||||
* 查询科室耗材汇总
|
||||
*
|
||||
* @param orgDeviceSummaryParam 查询条件
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
=======
|
||||
* 页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
@@ -66,7 +43,6 @@ public class OrgDeviceStockTakeController {
|
||||
* 查询科室耗材汇总
|
||||
*
|
||||
* @param orgDeviceSummaryParam 查询条件
|
||||
>>>>>>> v1.3
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
@@ -74,21 +50,12 @@ public class OrgDeviceStockTakeController {
|
||||
* @return 科室耗材汇总单
|
||||
*/
|
||||
@GetMapping(value = "/summary-from")
|
||||
<<<<<<< HEAD
|
||||
public R<?> getOrgDeviceSummaryFromPage(OrgDeviceSummaryParam orgDeviceSummaryParam, String startTime,
|
||||
String endTime, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, String searchKey,
|
||||
HttpServletRequest request) {
|
||||
return orgDeviceStockTakeService.getOrgDeviceSummaryFromPage(orgDeviceSummaryParam, startTime, endTime, pageNo,
|
||||
pageSize, searchKey, request);
|
||||
=======
|
||||
public R<?> getOrgDeviceSummaryFromPage(OrgDeviceSummaryParam orgDeviceSummaryParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, String searchKey,
|
||||
HttpServletRequest request) {
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, String searchKey,
|
||||
HttpServletRequest request) {
|
||||
return orgDeviceStockTakeService.getOrgDeviceSummaryFromPage(orgDeviceSummaryParam, pageNo, pageSize, searchKey,
|
||||
request);
|
||||
>>>>>>> v1.3
|
||||
request);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,15 +63,9 @@ public class OrgDeviceStockTakeController {
|
||||
*
|
||||
* @return 科室耗材汇总单
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
@PutMapping(value = "/orgdevice-summary")
|
||||
public R<?> orgDeviceSummary(OrgDeviceSummaryParam orgDeviceSummaryParam) {
|
||||
return orgDeviceStockTakeService.orgDeviceSummary(orgDeviceSummaryParam);
|
||||
=======
|
||||
@PutMapping(value = "/org-device-summary")
|
||||
public R<?> orgDeviceSummary(@RequestBody List<OrgDeviceSummaryParam> orgDeviceSummaryParamList) {
|
||||
return orgDeviceStockTakeService.orgDeviceSummary(orgDeviceSummaryParamList);
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,38 +21,52 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class AdviceExecuteDetailParam {
|
||||
|
||||
/** 医嘱请求id */
|
||||
/**
|
||||
* 医嘱请求id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestId;
|
||||
|
||||
/** 就诊Id */
|
||||
/**
|
||||
* 就诊Id
|
||||
*/
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者Id */
|
||||
/**
|
||||
* 患者Id
|
||||
*/
|
||||
private Long patientId;
|
||||
|
||||
/** 账号id */
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 执行id */
|
||||
/**
|
||||
* 执行id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long procedureId;
|
||||
|
||||
/** 医嘱类型 */
|
||||
/**
|
||||
* 医嘱类型
|
||||
*/
|
||||
private Integer therapyEnum;
|
||||
|
||||
/** 医嘱请求所在表 */
|
||||
/**
|
||||
* 医嘱请求所在表
|
||||
*/
|
||||
private String adviceTable;
|
||||
|
||||
/** 组号 */
|
||||
/**
|
||||
* 组号
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
<<<<<<< HEAD
|
||||
/** 执行时间点集合 */
|
||||
=======
|
||||
/** 预计执行时间点集合 */
|
||||
>>>>>>> v1.3
|
||||
/**
|
||||
* 预计执行时间点集合
|
||||
*/
|
||||
private List<String> executeTimes;
|
||||
|
||||
}
|
||||
|
||||
@@ -22,33 +22,46 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class DispenseFormSearchParam implements Serializable {
|
||||
|
||||
/** 汇总状态 */
|
||||
/**
|
||||
* 汇总状态
|
||||
*/
|
||||
private Integer SummaryStatus;
|
||||
|
||||
/** 中药标识 */
|
||||
/**
|
||||
* 中药标识
|
||||
*/
|
||||
private Integer tcmFlag;
|
||||
|
||||
/** 医嘱类型 */
|
||||
/**
|
||||
* 医嘱类型
|
||||
*/
|
||||
private Integer therapyEnum;
|
||||
|
||||
/** 就诊ids */
|
||||
/**
|
||||
* 就诊ids
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private String encounterIds;
|
||||
|
||||
/** 发放药房id */
|
||||
/**
|
||||
* 发放药房id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 执行时间 */
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
private Date exeTime;
|
||||
|
||||
/** 汇总人id */
|
||||
/**
|
||||
* 汇总人id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long applicantId;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
/** 发放状态 */
|
||||
/**
|
||||
* 发放状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
@@ -47,7 +47,9 @@ public class MedicineSummaryInfoDto {
|
||||
*/
|
||||
private String totalVolume;
|
||||
|
||||
/** 拆零比 */
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/**
|
||||
@@ -56,8 +58,6 @@ public class MedicineSummaryInfoDto {
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
/**
|
||||
* 药品类型
|
||||
@@ -70,5 +70,4 @@ public class MedicineSummaryInfoDto {
|
||||
* 生产厂家
|
||||
*/
|
||||
private String manufacturerText;
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
|
||||
@@ -18,57 +18,67 @@ import java.util.List;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgDeviceSummaryParam {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/** 发放地点 */
|
||||
|
||||
/**
|
||||
* 发放地点
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long sourceLocationId;
|
||||
>>>>>>> v1.3
|
||||
|
||||
/** 项目id */
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/** 器材名称 */
|
||||
/**
|
||||
* 器材名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
>>>>>>> v1.3
|
||||
/** 库存id */
|
||||
/**
|
||||
* 库存id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long inventoryItemId;
|
||||
|
||||
/** 发放数量 */
|
||||
/**
|
||||
* 发放数量
|
||||
*/
|
||||
private BigDecimal dispenseQuantity;
|
||||
|
||||
/** 盈亏数量 */
|
||||
/**
|
||||
* 盈亏数量
|
||||
*/
|
||||
private BigDecimal stockTakeQuantity;
|
||||
|
||||
/** 批号 */
|
||||
/**
|
||||
* 批号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
<<<<<<< HEAD
|
||||
/** 发放地点 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long sourceLocationId;
|
||||
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
/** 使用单位 */
|
||||
/**
|
||||
* 使用单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String useUnitCode;
|
||||
private String useUnitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
/**
|
||||
* 最小单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/** 拆零比 */
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 发放id列表 */
|
||||
/**
|
||||
* 发放id列表
|
||||
*/
|
||||
private List<Long> dispenseIdList;
|
||||
|
||||
}
|
||||
|
||||
@@ -36,11 +36,11 @@ public interface MedicineSummaryAppMapper {
|
||||
* @return 领药列表
|
||||
*/
|
||||
Page<MedicineDispenseFormDto> selectMedicineDispenseFormPage(@Param("page") Page<MedicineDispenseFormDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
|
||||
@Param("completed") Integer completed, @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("summarized") Integer summarized);
|
||||
@Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
|
||||
@Param("completed") Integer completed, @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("summarized") Integer summarized);
|
||||
|
||||
/**
|
||||
* 查询汇总单分页列表
|
||||
@@ -48,22 +48,14 @@ public interface MedicineSummaryAppMapper {
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param completed 发药状态:已完成
|
||||
<<<<<<< HEAD
|
||||
* @param inProgress 发药状态:待发药
|
||||
=======
|
||||
* @param preparation 发药状态:待配药
|
||||
>>>>>>> v1.3
|
||||
* @param summaryDispense 单据类型:汇总发药
|
||||
* @return 汇总单列表
|
||||
*/
|
||||
Page<MedicineSummaryFormDto> selectMedicineSummaryFormPage(@Param("page") Page<MedicineSummaryFormDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
|
||||
<<<<<<< HEAD
|
||||
@Param("completed") Integer completed, @Param("inProgress") Integer inProgress,
|
||||
=======
|
||||
@Param("completed") Integer completed, @Param("preparation") Integer preparation,
|
||||
>>>>>>> v1.3
|
||||
@Param("summaryDispense") Integer summaryDispense);
|
||||
@Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
|
||||
@Param("completed") Integer completed, @Param("preparation") Integer preparation,
|
||||
@Param("summaryDispense") Integer summaryDispense);
|
||||
|
||||
/**
|
||||
* 获取汇总单详情
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
package com.openhis.web.inhospitalnursestation.mapper;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface NurseBillingAppMapper {
|
||||
=======
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -45,12 +39,11 @@ public interface NurseBillingAppMapper {
|
||||
* @return 医嘱分页列表
|
||||
*/
|
||||
Page<InpatientAdviceDto> getInNurseBillingPage(@Param("page") Page<InpatientAdviceDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientAdviceParam> queryWrapper,
|
||||
@Param("worDeviceRequest") String worDeviceRequest, @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, @Param("generateSourceEnum") Integer generateSourceEnum,
|
||||
@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||
>>>>>>> v1.3
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientAdviceParam> queryWrapper,
|
||||
@Param("worDeviceRequest") String worDeviceRequest, @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, @Param("generateSourceEnum") Integer generateSourceEnum,
|
||||
@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||
}
|
||||
|
||||
@@ -18,11 +18,7 @@ public interface OrgDeviceStockTakeAppMapper {
|
||||
* @return 科室耗材信息
|
||||
*/
|
||||
Page<OrgDeviceDto> selectOrgDeviceInfo(@Param("page") Page<OrgDeviceDto> page,
|
||||
<<<<<<< HEAD
|
||||
@Param(Constants.WRAPPER) QueryWrapper<OrgDeviceDto> queryWrapper);
|
||||
=======
|
||||
@Param(Constants.WRAPPER) QueryWrapper<OrgDeviceDto> queryWrapper, @Param("imp") Integer imp,
|
||||
@Param("requestStatus") Integer requestStatus, @Param("dispenseStatus") Integer dispenseStatus,
|
||||
@Param("chargeItemStatus") Integer chargeItemStatus);
|
||||
>>>>>>> v1.3
|
||||
@Param(Constants.WRAPPER) QueryWrapper<OrgDeviceDto> queryWrapper, @Param("imp") Integer imp,
|
||||
@Param("requestStatus") Integer requestStatus, @Param("dispenseStatus") Integer dispenseStatus,
|
||||
@Param("chargeItemStatus") Integer chargeItemStatus);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user