Merge branch 'merge_1.3' into develop
This commit is contained in:
@@ -13,6 +13,7 @@ import org.springframework.core.env.Environment;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import com.openhis.web.ybmanage.config.YbServiceConfig;
|
||||
import com.openhis.administration.domain.Instrument;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
@@ -25,6 +26,14 @@ import com.openhis.web.ybmanage.config.YbServiceConfig;
|
||||
public class OpenHisApplication {
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
// 测试 Instrument 类加载
|
||||
// try {
|
||||
// Class.forName("com.openhis.administration.domain.Instrument");
|
||||
// System.out.println("Instrument class loaded successfully");
|
||||
// } catch (ClassNotFoundException e) {
|
||||
// System.err.println("Failed to load Instrument class: " + e.getMessage());
|
||||
// }
|
||||
|
||||
ConfigurableApplicationContext application = SpringApplication.run(OpenHisApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.quartz.task;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.core.framework.config.TenantContext;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IEncounterAutoRollAppService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 自动滚方定时任务(每日执行)
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("AutoRollTask")
|
||||
public class AutoRollTask {
|
||||
|
||||
@Resource
|
||||
private IEncounterAutoRollAppService encounterAutoRollAppService;
|
||||
|
||||
/**
|
||||
* 护理费
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
* @param orderPricing 医嘱定价来源 | 定时任务调用时传参
|
||||
*/
|
||||
public void autoRollNursingFee(Integer tenantId, String orderPricing) {
|
||||
// 设置当前线程的租户ID
|
||||
TenantContext.setCurrentTenant(tenantId);
|
||||
// 滚护理费
|
||||
encounterAutoRollAppService.autoRollNursingFee(tenantId, orderPricing);
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础服务费 | 取暖费,床位费 等
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
* @param orderPricing 医嘱定价来源 | 定时任务调用时传参
|
||||
*/
|
||||
public void autoRollBasicService(Integer tenantId, String orderPricing) {
|
||||
// 设置当前线程的租户ID
|
||||
TenantContext.setCurrentTenant(tenantId);
|
||||
// 滚基础服务费
|
||||
encounterAutoRollAppService.autoRollBasicService(tenantId, orderPricing);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.quartz.task;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.framework.config.TenantContext;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.document.domain.DocInventoryItemStatic;
|
||||
import com.openhis.document.service.IDocInventoryItemStaticService;
|
||||
import com.openhis.web.inventorymanage.appservice.IProductDetailAppService;
|
||||
import com.openhis.web.inventorymanage.dto.ProductDetailPageDto;
|
||||
import com.openhis.web.inventorymanage.dto.ProductDetailSearchParam;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 库存备份定时任务(每日执行)
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-11-12
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("InventoryBackupTask")
|
||||
public class InventoryBackupTask {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(InventoryBackupTask.class);
|
||||
|
||||
@Resource
|
||||
private IProductDetailAppService productDetailAppService;
|
||||
|
||||
@Resource
|
||||
private IDocInventoryItemStaticService docInventoryItemStaticService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
private static final AtomicBoolean isRunning = new AtomicBoolean(false);
|
||||
|
||||
/**
|
||||
* 库存备份
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
*/
|
||||
public void inventoryBackup(Integer tenantId) {
|
||||
|
||||
// 添加执行锁,防止重复执行
|
||||
if (!isRunning.compareAndSet(false, true)) {
|
||||
logger.warn("库存备份任务正在执行中,跳过本次执行");
|
||||
return;
|
||||
}
|
||||
|
||||
// 定时任务指定租户id
|
||||
try {
|
||||
logger.info("库存备份START:{}", DateUtils.getNowDate());
|
||||
// 设置当前线程的租户ID
|
||||
TenantContext.setCurrentTenant(tenantId);
|
||||
String now = DateUtils.dateTime();
|
||||
// 查询当天是否已经执行过一次库存备份
|
||||
List<DocInventoryItemStatic> hisDocInventoryItemStaticList = docInventoryItemStaticService
|
||||
.list(new LambdaQueryWrapper<DocInventoryItemStatic>()
|
||||
.eq(DocInventoryItemStatic::getDeleteFlag, DelFlag.NO.getCode())
|
||||
.eq(DocInventoryItemStatic::getTenantId, tenantId))
|
||||
.stream().filter(item -> item.getBusNo() != null && item.getBusNo().length() >= 11
|
||||
&& now.equals(item.getBusNo().substring(3, 11)))
|
||||
.toList();
|
||||
if (!hisDocInventoryItemStaticList.isEmpty()) {
|
||||
logger.warn("库存备份任务已执行过,跳过本次执行");
|
||||
return;
|
||||
}
|
||||
// 生成备份编号
|
||||
String busNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.AUTO_BACKUP_NO.getPrefix(), 2);
|
||||
// 获取库存商品明细
|
||||
Page<ProductDetailPageDto> productDetailPage = productDetailAppService
|
||||
.getProductDetailPage(new ProductDetailSearchParam(), 1, 9999, null, null).getData();
|
||||
List<DocInventoryItemStatic> docInventoryItemStaticList = new ArrayList<>();
|
||||
if (productDetailPage != null && productDetailPage.getTotal() > 0) {
|
||||
List<ProductDetailPageDto> productDetailList = productDetailPage.getRecords();
|
||||
for (ProductDetailPageDto productDetail : productDetailList) {
|
||||
DocInventoryItemStatic docInventoryItemStatic = new DocInventoryItemStatic();
|
||||
docInventoryItemStatic
|
||||
// 库存状态枚举
|
||||
.setInventoryStatusEnum(productDetail.getInventoryStatusEnum())
|
||||
// 备份编号
|
||||
.setBusNo(busNo)
|
||||
// 库存id
|
||||
.setInventoryId(productDetail.getInventoryId())
|
||||
// 医保等级
|
||||
.setChrgitmLv(productDetail.getChrgitmLv())
|
||||
// 耗材类型
|
||||
.setDevCategoryCode(productDetail.getDevCategoryCode())
|
||||
// 项目id
|
||||
.setItemId(productDetail.getItemId())
|
||||
// 项目名称
|
||||
.setName(productDetail.getItemName())
|
||||
// 项目编号
|
||||
.setItemNo(productDetail.getBusNo())
|
||||
// 药品类别
|
||||
.setMedCategoryCode(productDetail.getMedCategoryCode())
|
||||
// 项目所在表
|
||||
.setItemTable(productDetail.getItemTable())
|
||||
// 所在位置
|
||||
.setLocationId(productDetail.getLocationId())
|
||||
// 位置名称
|
||||
.setLocationName(productDetail.getLocationName())
|
||||
// 所在货位
|
||||
.setLocationStoreId(productDetail.getLocationStoreId())
|
||||
// 货位名称
|
||||
.setLocationStoreName(productDetail.getLocationStoreName())
|
||||
// 厂家
|
||||
.setManufacturerText(productDetail.getManufacturerText())
|
||||
// 最小单位
|
||||
.setMinUnitCode(productDetail.getMinUnitCode())
|
||||
// 拆零比
|
||||
.setPartPercent(productDetail.getPartPercent())
|
||||
// 采购价
|
||||
.setPrice(productDetail.getPurchasePrice())
|
||||
// 生产日期
|
||||
.setProductionDate(productDetail.getProductionDate())
|
||||
// 到期日期
|
||||
.setExpirationDate(productDetail.getExpirationDate())
|
||||
// 库存数量
|
||||
.setQuantity(productDetail.getQuantity())
|
||||
// 销售价
|
||||
.setSalePrice(productDetail.getSalePrice())
|
||||
// 采购总价
|
||||
.setTotalPrice(productDetail.getTotalPurchasePrice())
|
||||
// 销售总价
|
||||
.setTotalSalePrice(productDetail.getTotalSalePrice())
|
||||
// 规格
|
||||
.setTotalVolume(productDetail.getTotalVolume())
|
||||
// 单位
|
||||
.setUnitCode(productDetail.getUnitCode())
|
||||
// 五笔码
|
||||
.setWbStr(productDetail.getWbStr())
|
||||
// 拼音码
|
||||
.setPyStr(productDetail.getPyStr())
|
||||
// 供应商id
|
||||
.setSupplierId(productDetail.getSupplierId())
|
||||
// 供应商名称
|
||||
.setSupplierName(productDetail.getSupplierName())
|
||||
// 剩余过期天数
|
||||
.setRemainingDays(productDetail.getRemainingDays())
|
||||
// 包装数量(整数)
|
||||
.setNumber(productDetail.getNumber())
|
||||
// 包装数量(小数)
|
||||
.setRemainder(productDetail.getRemainder())
|
||||
// 医保码
|
||||
.setYbNo(productDetail.getYbNo())
|
||||
// 批准文号
|
||||
.setApprovalNumber(productDetail.getApprovalNumber())
|
||||
// 批次号
|
||||
.setLotNumber(productDetail.getLotNumber());
|
||||
docInventoryItemStatic.setTenantId(tenantId);
|
||||
docInventoryItemStaticList.add(docInventoryItemStatic);
|
||||
}
|
||||
docInventoryItemStaticService.saveBatch(docInventoryItemStaticList);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("库存备份失败:", e);
|
||||
} finally {
|
||||
// 清除线程局部变量,防止内存泄漏
|
||||
TenantContext.clear();
|
||||
// 释放执行锁
|
||||
isRunning.set(false);
|
||||
logger.info("库存备份END:{}", DateUtils.getNowDate());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.openhis.quartz.task;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.openhis.web.inventorymanage.appservice.IProductStocktakingAppService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.framework.config.TenantContext;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
|
||||
/**
|
||||
* 批量盘点定时任务
|
||||
*
|
||||
* @author yuxj
|
||||
*/
|
||||
@Component("stocktakingBatchTask")
|
||||
public class StocktakingBatchTask {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(StocktakingBatchTask.class);
|
||||
@Resource
|
||||
IProductStocktakingAppService productStocktakingAppService;
|
||||
|
||||
public void autoStocktakingBatch(Integer tenantId) {
|
||||
// 定时任务指定租户id,示例
|
||||
try {
|
||||
// 在控制台打印当前时间加执行的功能名
|
||||
System.out.println("执行自动批量盘点START:" + DateUtils.getNowDate());
|
||||
logger.info("执行自动批量盘点START:" + DateUtils.getNowDate());
|
||||
|
||||
// 设置当前线程的租户ID
|
||||
TenantContext.setCurrentTenant(tenantId);
|
||||
//执行自动盘点
|
||||
productStocktakingAppService.autoStocktakingBatch();
|
||||
|
||||
logger.info("执行自动批量盘点END:" + DateUtils.getNowDate());
|
||||
// 在控制台打印当前时间加执行的功能名
|
||||
System.out.println("执行自动批量盘点END:" + DateUtils.getNowDate());
|
||||
} finally {
|
||||
// 清除线程局部变量,防止内存泄漏
|
||||
TenantContext.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.openhis.web.Inspection.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.Device;
|
||||
import com.openhis.administration.domain.Instrument;
|
||||
import com.openhis.web.Inspection.dto.InstrumentSelParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/18 15:38
|
||||
*/
|
||||
public interface IInstrumentManageAppService {
|
||||
|
||||
|
||||
R<?> getManageInit();
|
||||
|
||||
|
||||
R<?> getInstrumentPage(InstrumentSelParam InstrumentSelParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
|
||||
R<?> updateOrAddInstrument(Instrument instrument);
|
||||
|
||||
R<?> getInstrumentOne(Long id);
|
||||
|
||||
R<?> editInstrumentStatus(List<Long> ids, Integer status);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.openhis.web.Inspection.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.Inspection.dto.ReportResultManageDto;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/10/16 15:36
|
||||
*/
|
||||
public interface ILaboratoryManageAppService {
|
||||
|
||||
R<?> getReportResultList(ReportResultManageDto reportResultManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request);
|
||||
|
||||
|
||||
R<?> getReportById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.openhis.web.Inspection.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.Inspection.dto.LisConfigManageDto;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/29 16:00
|
||||
*/
|
||||
public interface ILisConfigManageAppService {
|
||||
|
||||
R<?> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
|
||||
R<?> getInfoList(String searchKey,String type);
|
||||
|
||||
R<?> getInfoDetail(Long id);
|
||||
|
||||
R<?> saveAll(LisConfigManageDto manageDto);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param patientId 患者id
|
||||
* @param ServiceId 服务id
|
||||
* @param itemId 检验项目id
|
||||
* @return
|
||||
*/
|
||||
R<?>createAll(Long patientId,Long ServiceId, Long itemId);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.openhis.web.Inspection.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.ObservationDefinition;
|
||||
import com.openhis.web.Inspection.dto.ObservationDefSelParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/23 16:32
|
||||
*/
|
||||
public interface IObservationManageAppService {
|
||||
|
||||
R<?> getManageInit();
|
||||
|
||||
|
||||
R<?> getObservationDefPage(ObservationDefSelParam ObservationDefSelParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
|
||||
R<?> updateOrAddObservationDef(ObservationDefinition Observation);
|
||||
|
||||
R<?> getObservationDefOne(Long id);
|
||||
|
||||
R<?> editObservationDefStatus(List<Long> ids, Integer status);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.openhis.web.Inspection.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/10/16 15:36
|
||||
*/
|
||||
public interface ISampleCollectAppManageAppService {
|
||||
|
||||
R<?> getSampleCollectList(SampleCollectManageDto sampleCollectManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request);
|
||||
|
||||
|
||||
R<?>updateSampleStatus(SampleCollectStatusRequest statusRequest);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.openhis.web.Inspection.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.SpecimenDefinition;
|
||||
import com.openhis.web.Inspection.dto.SpecimenDefSelParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/9 16:46
|
||||
*/
|
||||
public interface ISpecimenManageAppService {
|
||||
|
||||
|
||||
|
||||
R<?> getManageInit();
|
||||
|
||||
|
||||
R<?> getSpecimenPage(SpecimenDefSelParam specimenDefSelParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
|
||||
R<?> updateOrAddSpecimen(SpecimenDefinition specimenDefinition);
|
||||
|
||||
R<?> getSpecimenOne(Long id);
|
||||
|
||||
R<?> editSpecimenStatus(List<Long> ids,Integer status);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.openhis.web.Inspection.appservice.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.Instrument;
|
||||
import com.openhis.administration.mapper.InstrumentMapper;
|
||||
import com.openhis.administration.service.IInstrumentService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.InstrumentCategory;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.Inspection.appservice.IInstrumentManageAppService;
|
||||
import com.openhis.web.Inspection.dto.InstrumentManageDto;
|
||||
import com.openhis.web.Inspection.dto.InstrumentManageInitDto;
|
||||
import com.openhis.web.Inspection.dto.InstrumentSelParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Description 仪器信息
|
||||
* @Author
|
||||
* @Date 2025/9/18
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class InstrumentManageAppServiceImpl implements IInstrumentManageAppService {
|
||||
|
||||
private final IInstrumentService instrumentService ;
|
||||
private final InstrumentMapper instrumentMapper ;
|
||||
|
||||
|
||||
@Override
|
||||
public R<?> getManageInit() {
|
||||
InstrumentManageInitDto instrumentManageInitDto = new InstrumentManageInitDto();
|
||||
// 获取状态
|
||||
List<InstrumentManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new InstrumentManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
instrumentManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
// 获取仪器种类
|
||||
List<InstrumentManageInitDto.InstrumentType> typeList = Stream.of(com.openhis.common.enums.InstrumentCategory.values())
|
||||
.map(status -> new InstrumentManageInitDto.InstrumentType(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
instrumentManageInitDto.setInstrumentTypeList(typeList);
|
||||
// 获取仪器状态
|
||||
List<InstrumentManageInitDto.InstrumentStatusEnumOption> InstrumentStatusEnumOptions = Stream.of(com.openhis.common.enums.InstrumentStatus.values())
|
||||
.map(status -> new InstrumentManageInitDto.InstrumentStatusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
instrumentManageInitDto.setInstrumentStatusEnumList(InstrumentStatusEnumOptions);
|
||||
|
||||
return R.ok(instrumentManageInitDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getInstrumentPage(InstrumentSelParam InstrumentSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
QueryWrapper<Instrument> queryWrapper = HisQueryUtils.buildQueryWrapper(InstrumentSelParam,
|
||||
searchKey, new HashSet<>(Arrays.asList( "instrument_name", "instrument_name")), request);
|
||||
Page<InstrumentManageDto> instrumentPage = HisPageUtils.selectPage(instrumentMapper, queryWrapper, pageNo, pageSize,InstrumentManageDto.class);
|
||||
instrumentPage.getRecords().forEach(instrumentManageDto -> {
|
||||
instrumentManageDto.setInstrumentTypeEnumText(EnumUtils.getInfoByValue(InstrumentCategory.class, instrumentManageDto.getInstrumentTypeEnum())) ;
|
||||
});
|
||||
|
||||
return R.ok(instrumentPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateOrAddInstrument(Instrument instrument) {
|
||||
instrumentService.saveOrUpdate( instrument);
|
||||
return R.ok();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getInstrumentOne(Long id)
|
||||
{
|
||||
Instrument byId = instrumentService.getById(id);
|
||||
InstrumentManageDto dto = new InstrumentManageDto();
|
||||
BeanUtils.copyProperties(byId,dto);
|
||||
return R.ok(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> editInstrumentStatus(List<Long> ids, Integer status) {
|
||||
List<Instrument> instrumentList = new CopyOnWriteArrayList<>();
|
||||
for (Long detail : ids) {
|
||||
Instrument instrument = new Instrument();
|
||||
instrument.setId(detail);
|
||||
instrument.setUsageStatusEnum(status);
|
||||
instrumentList.add(instrument);
|
||||
}
|
||||
return instrumentService.updateBatchById(instrumentList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"仪器信息"})) : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.openhis.web.Inspection.appservice.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.Inspection.appservice.ILaboratoryManageAppService;
|
||||
import com.openhis.web.Inspection.dto.ReportResultManageDto;
|
||||
import com.openhis.web.Inspection.mapper.LisReportMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 样本采集
|
||||
* @Author
|
||||
* @Date 2025/10/16
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class LaboratoryManageAppService implements ILaboratoryManageAppService {
|
||||
|
||||
private final LisReportMapper reportMapper;
|
||||
@Override
|
||||
public R<?> getReportResultList(ReportResultManageDto reportResultManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
QueryWrapper<ReportResultManageDto> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(reportResultManageDto,
|
||||
searchKey, new HashSet<>(Arrays.asList( "patient_name", "charge_name")), request);
|
||||
IPage<ReportResultManageDto> reportResultList = reportMapper.getReportResultList(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
Long total = reportMapper.getReportResultListTotal(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
reportResultList.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
});
|
||||
if(total == null){
|
||||
//总条数为null
|
||||
total = 0L;
|
||||
}
|
||||
reportResultList.setTotal(total);
|
||||
return R.ok(reportResultList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getReportById(Long id) {
|
||||
//根据id查询所有观测值
|
||||
List<ReportResultManageDto> list = reportMapper.getReportListById(new QueryWrapper<ReportResultManageDto>().eq("id", id));
|
||||
//打印组件配置
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.openhis.web.Inspection.appservice.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Device;
|
||||
import com.openhis.administration.domain.DeviceDefinition;
|
||||
import com.openhis.administration.domain.ObservationDefinition;
|
||||
import com.openhis.administration.domain.SpecimenDefinition;
|
||||
import com.openhis.administration.service.IDeviceDefinitionService;
|
||||
import com.openhis.administration.service.IDeviceService;
|
||||
import com.openhis.administration.service.IObservationDefinitionService;
|
||||
import com.openhis.administration.service.ISpecimenDefinitionService;
|
||||
import com.openhis.common.enums.SpecCollectStatus;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.lab.domain.*;
|
||||
import com.openhis.lab.mapper.ActivityDefDeviceDefMapper;
|
||||
import com.openhis.lab.mapper.ActivityDefObservationDefMapper;
|
||||
import com.openhis.lab.mapper.ActivityDefSpecimenDefMapper;
|
||||
import com.openhis.lab.service.IObservationService;
|
||||
import com.openhis.lab.service.ISpecimenService;
|
||||
import com.openhis.web.Inspection.appservice.ILisConfigManageAppService;
|
||||
import com.openhis.web.Inspection.dto.LisConfigManageDto;
|
||||
import com.openhis.web.Inspection.dto.LisConfigManageInitDto;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||
import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.val;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/29
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class LisConfigManageAppServiceImpl implements ILisConfigManageAppService {
|
||||
|
||||
@Resource
|
||||
private ActivityDefinitionManageMapper activityDefinitionManageMapper;
|
||||
@Resource
|
||||
private ActivityDefDeviceDefMapper activityDefDeviceDefMapper;
|
||||
@Resource
|
||||
private ActivityDefObservationDefMapper activityDefObservationDefMapper;
|
||||
@Resource
|
||||
private ActivityDefSpecimenDefMapper activityDefSpecimenDefMapper;
|
||||
@Resource
|
||||
private IDeviceDefinitionService deviceDefinitionService;
|
||||
@Resource
|
||||
private ISpecimenDefinitionService specimenDefinitionService;
|
||||
@Resource
|
||||
private IObservationDefinitionService observationDefinitionService;
|
||||
@Resource
|
||||
private IObservationService observationService;
|
||||
@Resource
|
||||
private ISpecimenService specimenService;
|
||||
@Resource
|
||||
private IDeviceService deviceService;
|
||||
|
||||
|
||||
@Override
|
||||
public R<?> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<DiagnosisTreatmentDto> queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
|
||||
// 分页查询
|
||||
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage =
|
||||
activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
|
||||
|
||||
return R.ok(diseaseTreatmentPage);
|
||||
}
|
||||
|
||||
public R<?> getInfoList(String searchKey, String type) {
|
||||
LisConfigManageInitDto initDto = new LisConfigManageInitDto();
|
||||
initDto.setDeviceDefs(deviceDefinitionService.list());
|
||||
initDto.setObservationDefs(observationDefinitionService.list());
|
||||
initDto.setSpecimenDefs(specimenDefinitionService.list());
|
||||
if (searchKey == null || searchKey.isEmpty()) {
|
||||
// 如果searchKey为空,则查询所有
|
||||
return switch (type) {
|
||||
case "device" -> R.ok(deviceDefinitionService.list(new QueryWrapper<DeviceDefinition>().eq("status_enum",2)));
|
||||
case "observation" -> R.ok(observationDefinitionService.list(new QueryWrapper<ObservationDefinition>().eq("status_enum",2) ));
|
||||
case "specimen" -> R.ok(specimenDefinitionService.list(new QueryWrapper<SpecimenDefinition>().eq("status_enum",2)));
|
||||
default -> R.ok(initDto);
|
||||
};
|
||||
} else {
|
||||
// 如果searchKey不为空,则根据name模糊查询
|
||||
return switch (type) {
|
||||
case "device" ->
|
||||
R.ok(deviceDefinitionService.list((new QueryWrapper<DeviceDefinition>().like("name", searchKey).eq("status_enum",2))));
|
||||
case "observation" ->
|
||||
R.ok(observationDefinitionService.list((new QueryWrapper<ObservationDefinition>().like("name", searchKey).eq("status_enum",2))));
|
||||
case "specimen" ->
|
||||
R.ok(specimenDefinitionService.list((new QueryWrapper<SpecimenDefinition>().like("name", searchKey).eq("status_enum",2))));
|
||||
default -> R.ok();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public R<?> getInfoDetail(Long id) {
|
||||
LisConfigManageDto manageDto = new LisConfigManageDto();
|
||||
manageDto.setActivityDefDeviceDefs(activityDefDeviceDefMapper.selectList(new QueryWrapper<ActivityDefDeviceDef>().eq("activity_definition_id", id)));
|
||||
manageDto.setActivityDefObservationDefs(activityDefObservationDefMapper.selectList(new QueryWrapper<ActivityDefObservationDef>().eq("activity_definition_id", id)));
|
||||
manageDto.setActivityDefSpecimenDefs(activityDefSpecimenDefMapper.selectList(new QueryWrapper<ActivityDefSpecimenDef>().eq("activity_definition_id", id)));
|
||||
return R.ok(manageDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> saveAll(LisConfigManageDto manageDto) {
|
||||
//先全部删除项目下详情
|
||||
activityDefDeviceDefMapper.delete(new QueryWrapper<ActivityDefDeviceDef>().eq("activity_definition_id", manageDto.getId()));
|
||||
activityDefObservationDefMapper.delete(new QueryWrapper<ActivityDefObservationDef>().eq("activity_definition_id", manageDto.getId()));
|
||||
activityDefSpecimenDefMapper.delete(new QueryWrapper<ActivityDefSpecimenDef>().eq("activity_definition_id", manageDto.getId()));
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// 根据ID查询【诊疗目录】详情
|
||||
DiagnosisTreatmentDto diseaseTreatmentOne = activityDefinitionManageMapper.getDiseaseTreatmentOne(manageDto.getId(), tenantId);
|
||||
manageDto.getActivityDefDeviceDefs().forEach(activityDefDeviceDef -> {
|
||||
activityDefDeviceDef.setActivityDefinitionId(manageDto.getId());
|
||||
activityDefDeviceDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||
activityDefDeviceDefMapper.insert(activityDefDeviceDef);
|
||||
});
|
||||
manageDto.getActivityDefObservationDefs().forEach(activityDefObservationDef -> {
|
||||
activityDefObservationDef.setActivityDefinitionId(manageDto.getId());
|
||||
activityDefObservationDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||
activityDefObservationDefMapper.insert(activityDefObservationDef);
|
||||
});
|
||||
manageDto.getActivityDefSpecimenDefs().forEach(activityDefSpecimenDef -> {
|
||||
activityDefSpecimenDef.setActivityDefinitionId(manageDto.getId());
|
||||
activityDefSpecimenDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||
activityDefSpecimenDefMapper.insert(activityDefSpecimenDef);
|
||||
});
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> createAll(Long patientId,Long ServiceId, Long itemId) {
|
||||
// 根据ID查询检查项目详情
|
||||
List<ActivityDefDeviceDef> devices = activityDefDeviceDefMapper.selectList(new QueryWrapper<ActivityDefDeviceDef>().eq("activity_definition_id", itemId));
|
||||
List<ActivityDefObservationDef> observations= activityDefObservationDefMapper.selectList(new QueryWrapper<ActivityDefObservationDef>().eq("activity_definition_id", itemId));
|
||||
List<ActivityDefSpecimenDef> specimens = activityDefSpecimenDefMapper.selectList(new QueryWrapper<ActivityDefSpecimenDef>().eq("activity_definition_id", itemId));
|
||||
devices.forEach(activityDefDeviceDef -> {
|
||||
Device device = new Device();
|
||||
device.setDeviceDefId(activityDefDeviceDef.getDeviceDefinitionId());
|
||||
device.setName(activityDefDeviceDef.getDeviceDefinitionName());
|
||||
//TODO 器材实体待完善,生成器材请求
|
||||
|
||||
});
|
||||
observations.forEach(activityDefObservationDef -> {
|
||||
Observation observation = new Observation();
|
||||
//TODO 初始字段具体观测定义字段待完善
|
||||
observation.setPatientId(patientId);
|
||||
observation.setObservationDefinitionId(activityDefObservationDef.getObservationDefinitionId());
|
||||
observationService.save(observation);
|
||||
});
|
||||
specimens.forEach(activityDefSpecimenDef -> {
|
||||
Specimen specimen = new Specimen();
|
||||
//TODO 初始字段具体标本定义字段待完善
|
||||
specimen.setServiceId(ServiceId);
|
||||
specimen.setSpecimenDefinitionId(activityDefSpecimenDef.getSpecimenDefinitionId());
|
||||
specimen.setPatientId(patientId);
|
||||
specimen.setCollectionStatusEnum(SpecCollectStatus.PENDING.getValue());
|
||||
specimen.setSpecimenUnit(activityDefSpecimenDef.getSpecimenUnit());
|
||||
specimen.setSpecimenVolume(activityDefSpecimenDef.getSpecimenVolume());
|
||||
specimenService.save(specimen);
|
||||
});
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.openhis.web.Inspection.appservice.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.ObservationDefinition;
|
||||
import com.openhis.administration.mapper.ObservationDefinitionMapper;
|
||||
import com.openhis.administration.service.IInstrumentService;
|
||||
import com.openhis.administration.service.IObservationDefinitionService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.ObservationType;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.Inspection.appservice.IObservationManageAppService;
|
||||
import com.openhis.web.Inspection.dto.ObservationDefManageDto;
|
||||
import com.openhis.web.Inspection.dto.ObservationDefManageInitDto;
|
||||
import com.openhis.web.Inspection.dto.ObservationDefSelParam;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/23
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ObservationManageAppServiceImpl implements IObservationManageAppService
|
||||
{
|
||||
private final ObservationDefinitionMapper observationDefinitionMapper;
|
||||
|
||||
private final IObservationDefinitionService observationDefinitionService;
|
||||
|
||||
private final IInstrumentService instrumentService;
|
||||
|
||||
|
||||
@Override
|
||||
public R<?> getManageInit() {
|
||||
|
||||
ObservationDefManageInitDto observationDefManageInitDto = new ObservationDefManageInitDto();
|
||||
// 获取状态
|
||||
List<ObservationDefManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new ObservationDefManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
observationDefManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
//观测类型
|
||||
List<ObservationDefManageInitDto.ObservationTypeEnumOption> ObservationTypeEnumOptions = Stream.of(com.openhis.common.enums.ObservationType.values())
|
||||
.map(status -> new ObservationDefManageInitDto.ObservationTypeEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
observationDefManageInitDto.setObservationTypeList(ObservationTypeEnumOptions);
|
||||
//仪器列表
|
||||
List<ObservationDefManageInitDto.InstrumentEnumOption> InstrumentEnumOptions = instrumentService.list().stream()
|
||||
.map(status -> new ObservationDefManageInitDto.InstrumentEnumOption(status.getId(), status.getInstrumentName()))
|
||||
.collect(Collectors.toList());
|
||||
observationDefManageInitDto.setInstrumentEnumOptionList(InstrumentEnumOptions);
|
||||
return R.ok(observationDefManageInitDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getObservationDefPage(ObservationDefSelParam ObservationDefSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
QueryWrapper<ObservationDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(ObservationDefSelParam,
|
||||
searchKey, new HashSet<>(Arrays.asList( "name", "code")), request);
|
||||
Page<ObservationDefManageDto> ObservationPage = HisPageUtils.selectPage(observationDefinitionMapper, queryWrapper, pageNo, pageSize, ObservationDefManageDto.class);
|
||||
ObservationPage.getRecords().forEach(item -> {
|
||||
item.setInstrumentId_dictText(instrumentService.getById(item.getInstrumentId()).getInstrumentName());
|
||||
item.setStatusEnumText(EnumUtils.getInfoByValue(PublicationStatus.class, item.getStatusEnum()));
|
||||
item.setObservationTypeEnumText(EnumUtils.getInfoByValue(ObservationType.class, item.getObservationTypeEnum()));
|
||||
});
|
||||
|
||||
return R.ok(ObservationPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateOrAddObservationDef(ObservationDefinition Observation) {
|
||||
Observation.setDeleteFlag(DelFlag.NO.getCode());
|
||||
observationDefinitionService.saveOrUpdate(Observation);
|
||||
return R.ok(" 添加成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getObservationDefOne(Long id) {
|
||||
ObservationDefinition observationDefinition = observationDefinitionService.getById(id);
|
||||
ObservationDefManageDto dto = new ObservationDefManageDto();
|
||||
BeanUtils.copyProperties(observationDefinition,dto);
|
||||
return R.ok(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> editObservationDefStatus(List<Long> ids, Integer status) {
|
||||
List<ObservationDefinition> observationDefinitionList = new CopyOnWriteArrayList<>();
|
||||
for (Long detail : ids) {
|
||||
ObservationDefinition observationDefinition = new ObservationDefinition();
|
||||
observationDefinition.setId(detail);
|
||||
observationDefinition.setStatusEnum(status);
|
||||
observationDefinitionList.add(observationDefinition);
|
||||
}
|
||||
return observationDefinitionService.updateBatchById(observationDefinitionList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"观测信息"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.openhis.web.Inspection.appservice.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.SpecCollectStatus;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.lab.domain.Specimen;
|
||||
import com.openhis.lab.service.ISpecimenService;
|
||||
import com.openhis.web.Inspection.appservice.ISampleCollectAppManageAppService;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
|
||||
import com.openhis.web.Inspection.mapper.SampleCollectMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Description 样本采集
|
||||
* @Author
|
||||
* @Date 2025/10/16
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SampleCollectManageAppService implements ISampleCollectAppManageAppService {
|
||||
|
||||
private final SampleCollectMapper sampleCollectMapper;
|
||||
|
||||
private final ISpecimenService specimenService;
|
||||
|
||||
@Override
|
||||
public R<?> getSampleCollectList(SampleCollectManageDto sampleCollectManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
QueryWrapper<SampleCollectManageDto> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(sampleCollectManageDto,
|
||||
searchKey, new HashSet<>(Arrays.asList( "patient_name", "charge_name")), request);
|
||||
IPage<SampleCollectManageDto> sampleCollectList = sampleCollectMapper.getSampleCollectList(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
Long total = sampleCollectMapper.getSampleCollectListTotal(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
sampleCollectList.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 采集状态
|
||||
e.setCollectionStatusEnumText(EnumUtils.getInfoByValue(SpecCollectStatus.class, e.getCollectionStatusEnum()));
|
||||
});
|
||||
if(total == null){
|
||||
//总条数为null
|
||||
total = 0L;
|
||||
}
|
||||
sampleCollectList.setTotal(total);
|
||||
return R.ok(sampleCollectList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateSampleStatus(SampleCollectStatusRequest statusRequest) {
|
||||
// 根据状态类型设置对应的状态值
|
||||
Integer status = switch (statusRequest.getType()) {
|
||||
case "待采集" -> SpecCollectStatus.PENDING.getValue();
|
||||
case "已采集" -> SpecCollectStatus.COLLECTED.getValue();
|
||||
case "已接收" -> SpecCollectStatus.RECEIVED.getValue();
|
||||
default -> 0;
|
||||
};
|
||||
|
||||
// 批量更新样本状态
|
||||
specimenService.listByIds(statusRequest.getIds()).forEach(specimen -> {
|
||||
Integer currentStatus = specimen.getCollectionStatusEnum(); // 获取当前样本状态
|
||||
// 如果传入状态是已接收,但当前状态是待采集,跳过更新
|
||||
if (Objects.equals(status, SpecCollectStatus.RECEIVED.getValue()) && Objects.equals(currentStatus, SpecCollectStatus.PENDING.getValue())) {
|
||||
return;
|
||||
}
|
||||
// 构建更新条件
|
||||
UpdateWrapper<Specimen> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.in("id", statusRequest.getIds()) // 设置批量更新的条件
|
||||
.set("collection_status_enum", status); // 设置更新的状态字段
|
||||
// 如果状态为已采集,且采集日期不为空,跳过采集日期的更新,仅更新状态
|
||||
if (Objects.equals(status, SpecCollectStatus.COLLECTED.getValue())) {
|
||||
if (specimen.getCollectionDate() == null) {
|
||||
// 如果采集日期为空,则设置当前日期
|
||||
updateWrapper.set("collection_date", new Date());
|
||||
}
|
||||
updateWrapper.set("received_date", null);
|
||||
} else if (Objects.equals(status, SpecCollectStatus.PENDING.getValue())) {
|
||||
updateWrapper.set("collection_date", null); // 清空采集日期
|
||||
} else if (Objects.equals(status, SpecCollectStatus.RECEIVED.getValue())) {
|
||||
updateWrapper.set("received_date", new Date());
|
||||
}
|
||||
// 执行更新
|
||||
specimenService.update(updateWrapper);
|
||||
});
|
||||
if (Objects.equals(status, SpecCollectStatus.RECEIVED.getValue())) {
|
||||
// TODO 接收样本后续逻辑
|
||||
System.err.println("接收样本后!!");
|
||||
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.openhis.web.Inspection.appservice.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.SpecimenDefinition;
|
||||
import com.openhis.administration.mapper.SpecimenDefinitionMapper;
|
||||
import com.openhis.administration.service.ISpecimenDefinitionService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.enums.SpecimenType;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.Inspection.appservice.ISpecimenManageAppService;
|
||||
import com.openhis.web.Inspection.dto.SpecimenDefManageDto;
|
||||
import com.openhis.web.Inspection.dto.SpecimenDefManageInitDto;
|
||||
import com.openhis.web.Inspection.dto.SpecimenDefSelParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author
|
||||
* @Date 2025/9/9
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SpecimenManageAppServiceImpl implements ISpecimenManageAppService {
|
||||
|
||||
private final SpecimenDefinitionMapper specimenDefinitionMapper;
|
||||
|
||||
private final ISpecimenDefinitionService specimenDefinitionService;
|
||||
@Override
|
||||
public R<?> getManageInit() {
|
||||
SpecimenDefManageInitDto specimenDefManageInitDto = new SpecimenDefManageInitDto();
|
||||
|
||||
// 获取状态
|
||||
List<SpecimenDefManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new SpecimenDefManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
specimenDefManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
// 获取录种类
|
||||
List<SpecimenDefManageInitDto.SpecimenType> typeList = Stream.of(SpecimenType.values())
|
||||
.map(status -> new SpecimenDefManageInitDto.SpecimenType(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
specimenDefManageInitDto.setSpecimenTypeList(typeList);
|
||||
|
||||
|
||||
return R.ok(specimenDefManageInitDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 样本目录查询
|
||||
* @param SpecimenDefSelParam 查询条件
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param pageNo 查询条件
|
||||
* @param pageSize 查询条件
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R<?> getSpecimenPage(SpecimenDefSelParam SpecimenDefSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
QueryWrapper<SpecimenDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(SpecimenDefSelParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("custom_code", "specimen_name", "py_str", "wb_str")), request);
|
||||
Page<SpecimenDefManageDto> specimenPage = HisPageUtils.selectPage(specimenDefinitionMapper, queryWrapper, pageNo, pageSize, SpecimenDefManageDto.class);
|
||||
specimenPage.getRecords().forEach(specimenDefManageDto -> {
|
||||
specimenDefManageDto.setSpecimenTypeEnumText(EnumUtils.getInfoByValue(SpecimenType.class, specimenDefManageDto.getSpecimenTypeEnum())) ;
|
||||
specimenDefManageDto.setStatusEnumText(EnumUtils.getInfoByValue(PublicationStatus.class, specimenDefManageDto.getStatusEnum()));
|
||||
});
|
||||
return R.ok(specimenPage);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public R<?> updateOrAddSpecimen(SpecimenDefinition specimenDefinition) {
|
||||
specimenDefinitionService.saveOrUpdate(specimenDefinition);
|
||||
return R.ok(" 添加成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getSpecimenOne(Long id) {
|
||||
SpecimenDefinition specimenDefinition = specimenDefinitionService.getById(id);
|
||||
return R.ok(specimenDefinition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> editSpecimenStatus(List<Long> ids, Integer status) {
|
||||
List<SpecimenDefinition> specimenDefinitionList = new CopyOnWriteArrayList<>();
|
||||
for (Long detail : ids) {
|
||||
SpecimenDefinition specimenDefinition = new SpecimenDefinition();
|
||||
specimenDefinition.setId(detail);
|
||||
specimenDefinition.setStatusEnum(status);
|
||||
specimenDefinitionList.add(specimenDefinition);
|
||||
}
|
||||
return specimenDefinitionService.updateBatchById(specimenDefinitionList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"样本信息"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.openhis.web.Inspection.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.Instrument;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.web.Inspection.appservice.IInstrumentManageAppService;
|
||||
import com.openhis.web.Inspection.dto.InstrumentSelParam;
|
||||
import com.openhis.web.Inspection.dto.InstrumentStatusRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description 仪器器材信息
|
||||
* @Author
|
||||
* @Date 2025/9/18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inspection/instrument")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class InstrumentController {
|
||||
|
||||
|
||||
private final IInstrumentManageAppService appService;
|
||||
|
||||
|
||||
@GetMapping("/init")
|
||||
public R<?> getDiseaseTreatmentInit() {
|
||||
return appService.getManageInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询样本类型分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-page")
|
||||
public R<?> getInstrumentPage(InstrumentSelParam InstrumentSelParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return appService.getInstrumentPage(InstrumentSelParam,searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/information")
|
||||
public R<?> editInstrument(@Validated @RequestBody Instrument instrument) {
|
||||
instrument.setDeleteFlag(DelFlag.NO.getCode());
|
||||
|
||||
return appService.updateOrAddInstrument(instrument);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getInstrument(@RequestParam Long id) {
|
||||
return appService.getInstrumentOne(id);
|
||||
}
|
||||
|
||||
@PostMapping("/information-status")
|
||||
public R<?> updateInstrumentStatus( @RequestBody InstrumentStatusRequest InstrumentStatusRequest ) {
|
||||
//默认停用
|
||||
Integer status = PublicationStatus.RETIRED.getValue();
|
||||
if("启用".equals( InstrumentStatusRequest.getType())){
|
||||
status = PublicationStatus.ACTIVE.getValue();
|
||||
}
|
||||
return appService.editInstrumentStatus(InstrumentStatusRequest.getIds(),status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.openhis.web.Inspection.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.Inspection.appservice.ILaboratoryManageAppService;
|
||||
import com.openhis.web.Inspection.dto.ReportResultManageDto;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description 检测中心相关
|
||||
* @Author
|
||||
* @Date 2025/10/24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inspection/laboratory")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class LaboratoryController {
|
||||
private final ILaboratoryManageAppService appService;
|
||||
|
||||
@GetMapping("/information-page")
|
||||
public R<?> getReportResultPage(ReportResultManageDto reportResultManageDto, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
return appService.getReportResultList( reportResultManageDto, pageNo, pageSize, searchKey, request);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public R<?> getReportById(@PathVariable Long id) {
|
||||
// 调用 ReportService 获取报告数据
|
||||
return appService.getReportById(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.openhis.web.Inspection.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.Inspection.appservice.ILisConfigManageAppService;
|
||||
import com.openhis.web.Inspection.dto.LisConfigManageDto;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description 检验定义配置
|
||||
* @Author
|
||||
* @Date 2025/9/29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inspection/lisConfig")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class LisConfigController {
|
||||
|
||||
|
||||
private ILisConfigManageAppService lisConfigManageAppService;
|
||||
|
||||
/**
|
||||
* @Description 获取检验项目列表
|
||||
* @Author
|
||||
* @Date 2025/9/29
|
||||
*/
|
||||
@RequestMapping("/init-page")
|
||||
public R<?> getDiseaseTreatmentList(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
return lisConfigManageAppService.getDiseaseTreatmentPage(DiagnosisTreatmentSelParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据项目id获取详细
|
||||
* @return
|
||||
*/
|
||||
@GetMapping ("/info-detail")
|
||||
public R<?> getInfoDetail(Long id) {
|
||||
return lisConfigManageAppService.getInfoDetail(id);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping ("/init-list")
|
||||
public R<?> getInfoList(String searchKey,String type) {
|
||||
return lisConfigManageAppService.getInfoList(searchKey, type);
|
||||
|
||||
}
|
||||
/**
|
||||
* 修改检验配置
|
||||
* @param
|
||||
* @param manageDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/saveAll")
|
||||
public R<?> saveInfo(@RequestBody LisConfigManageDto manageDto) {
|
||||
|
||||
return lisConfigManageAppService.saveAll(manageDto);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.openhis.web.Inspection.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.ObservationDefinition;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.web.Inspection.appservice.IObservationManageAppService;
|
||||
import com.openhis.web.Inspection.dto.ObservationDefSelParam;
|
||||
import com.openhis.web.Inspection.dto.ObservationDefStatusRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description 仪器器材信息
|
||||
* @Author
|
||||
* @Date 2025/9/18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inspection/observation")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class ObservationDefController {
|
||||
|
||||
|
||||
private final IObservationManageAppService appService;
|
||||
|
||||
|
||||
@GetMapping("/init")
|
||||
public R<?> getTreatmentInit() {
|
||||
return appService.getManageInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询样本类型分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-page")
|
||||
public R<?> getObservationPage(ObservationDefSelParam observationDefSelParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return appService.getObservationDefPage(observationDefSelParam,searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/information")
|
||||
public R<?> editObservation(@Validated @RequestBody ObservationDefinition observation) {
|
||||
observation.setDeleteFlag(DelFlag.NO.getCode());
|
||||
|
||||
return appService.updateOrAddObservationDef(observation);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getObservation(@RequestParam Long id) {
|
||||
return appService.getObservationDefOne(id);
|
||||
}
|
||||
|
||||
@PostMapping("/information-status")
|
||||
public R<?> updateObservationStatus( @RequestBody ObservationDefStatusRequest observationDefStatusRequest) {
|
||||
//默认停用
|
||||
Integer status = PublicationStatus.RETIRED.getValue();
|
||||
if("启用".equals( observationDefStatusRequest.getType())){
|
||||
status = PublicationStatus.ACTIVE.getValue();
|
||||
}
|
||||
return appService.editObservationDefStatus(observationDefStatusRequest.getIds(),status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.openhis.web.Inspection.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.web.Inspection.appservice.ISampleCollectAppManageAppService;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description 样本采集
|
||||
* @Author
|
||||
* @Date 2025/10/16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inspection/collection")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class SampleCollectController {
|
||||
|
||||
private final ISampleCollectAppManageAppService appService;
|
||||
|
||||
|
||||
@GetMapping("/information-page")
|
||||
public R<?> getSampleCollectPage(SampleCollectManageDto sampleCollectManageDto,@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
return appService.getSampleCollectList( sampleCollectManageDto, pageNo, pageSize, searchKey, request);
|
||||
}
|
||||
|
||||
@PostMapping("/information-status")
|
||||
public R<?> editSampleCollectStatus(@RequestBody SampleCollectStatusRequest statusRequest) {
|
||||
return appService.updateSampleStatus(statusRequest);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.openhis.web.Inspection.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.SpecimenDefinition;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.web.Inspection.appservice.ISpecimenManageAppService;
|
||||
import com.openhis.web.Inspection.dto.SpecimenDefSelParam;
|
||||
import com.openhis.web.Inspection.dto.SpecimenDefStatusRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description 样本定义相关
|
||||
* @Author
|
||||
* @Date 2025/9/9
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inspection/specimen")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class SpecimenDefController {
|
||||
|
||||
private final ISpecimenManageAppService specimenManageAppService;
|
||||
|
||||
|
||||
@GetMapping("/init")
|
||||
public R<?> getDiseaseTreatmentInit() {
|
||||
return specimenManageAppService.getManageInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询样本类型分页列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-page")
|
||||
public R<?> getSpecimenPage(SpecimenDefSelParam specimenDefSelParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return specimenManageAppService.getSpecimenPage(specimenDefSelParam,searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/information")
|
||||
public R<?> editSpecimen(@Validated @RequestBody SpecimenDefinition specimenDefinition) {
|
||||
specimenDefinition.setStatusEnum( PublicationStatus.ACTIVE.getValue());
|
||||
specimenDefinition.setDeleteFlag(DelFlag.NO.getCode());
|
||||
return specimenManageAppService.updateOrAddSpecimen(specimenDefinition);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getSpecimen(@RequestParam Long id) {
|
||||
return specimenManageAppService.getSpecimenOne(id);
|
||||
}
|
||||
|
||||
@PostMapping("/information-status")
|
||||
public R<?> updateSpecimenStatus( @RequestBody SpecimenDefStatusRequest specimenDefStatusRequest) {
|
||||
//默认停用
|
||||
Integer status = PublicationStatus.RETIRED.getValue();
|
||||
if("启用".equals( specimenDefStatusRequest.getType())){
|
||||
status = PublicationStatus.ACTIVE.getValue();
|
||||
}
|
||||
return specimenManageAppService.editSpecimenStatus(specimenDefStatusRequest.getIds(),status);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description 分页返回
|
||||
* @Author
|
||||
* @Date 2025/9/17
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InstrumentManageDto {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 仪器编号,唯一且不能为空 */
|
||||
private String instrumentCode;
|
||||
|
||||
/** 仪器名称,必填项 */
|
||||
private String instrumentName;
|
||||
|
||||
/** 仪器主编号 */
|
||||
private String instrumentMainCode;
|
||||
|
||||
/** 仪器类型,选择项 */
|
||||
private Integer instrumentTypeEnum;
|
||||
private String instrumentTypeEnumText;
|
||||
|
||||
/** 仪器型号 */
|
||||
private String instrumentModel;
|
||||
|
||||
/** 生产厂家 */
|
||||
private String manufacturer;
|
||||
|
||||
/** 仪器序列号 */
|
||||
private String serialNumber;
|
||||
|
||||
/** 购买公司 */
|
||||
private String purchasingCompany;
|
||||
|
||||
/** 联系人员 */
|
||||
private String contactPerson;
|
||||
|
||||
/** 购买日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date purchaseDate;
|
||||
|
||||
/** 原价格 */
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
/** 成交价格 */
|
||||
private BigDecimal transactionPrice;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
/** 安装日期 */
|
||||
private Date installationDate;
|
||||
|
||||
/** 安装人员 */
|
||||
private String installationPerson;
|
||||
|
||||
/** 维护人员 */
|
||||
private String maintenancePerson;
|
||||
|
||||
/** 所属科室 */
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
private String orgId_dictText;
|
||||
|
||||
/** 鉴定人员 */
|
||||
private String identificationPerson;
|
||||
|
||||
/** 记录温度 */
|
||||
private String recordedTemperature;
|
||||
|
||||
/** 仪器附件 */
|
||||
private String accessories;
|
||||
|
||||
/** 仪器状态 */
|
||||
private Integer instrumentStatusEnum;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
/** 报损日期 */
|
||||
private Date damageReportDate;
|
||||
|
||||
/** 可复查仪器 是否 */
|
||||
private Integer recheckableInstrumentEnum;
|
||||
|
||||
/** 使用状态,是否 */
|
||||
private Integer usageStatusEnum;
|
||||
|
||||
/** 停用原因 */
|
||||
private String decommissionReason;
|
||||
|
||||
/** 备注 */
|
||||
private String remarks;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author
|
||||
* @date
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InstrumentManageInitDto {
|
||||
private List<statusEnumOption> statusFlagOptions;
|
||||
private List<InstrumentType> InstrumentTypeList;
|
||||
private List<InstrumentStatusEnumOption> InstrumentStatusEnumList;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Data
|
||||
public static class statusEnumOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
public statusEnumOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class InstrumentStatusEnumOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
public InstrumentStatusEnumOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class InstrumentType {
|
||||
private Integer value;
|
||||
private String info;
|
||||
public InstrumentType(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 样本定义分页检索条件
|
||||
*
|
||||
* @author lpt
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InstrumentSelParam {
|
||||
|
||||
/** 仪器类型 */
|
||||
private Integer instrumentTypeEnum;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/18
|
||||
*/
|
||||
@Data
|
||||
public class InstrumentStatusRequest {
|
||||
private List<Long> ids;
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.lab.domain.ActivityDefDeviceDef;
|
||||
import com.openhis.lab.domain.ActivityDefObservationDef;
|
||||
import com.openhis.lab.domain.ActivityDefSpecimenDef;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LisConfigManageDto {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
private List<ActivityDefDeviceDef> activityDefDeviceDefs;
|
||||
|
||||
private List<ActivityDefObservationDef> activityDefObservationDefs;
|
||||
|
||||
private List<ActivityDefSpecimenDef> activityDefSpecimenDefs;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.openhis.administration.domain.DeviceDefinition;
|
||||
import com.openhis.administration.domain.ObservationDefinition;
|
||||
import com.openhis.administration.domain.SpecimenDefinition;
|
||||
import com.openhis.web.datadictionary.dto.DeviceManageDto;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/10/10
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LisConfigManageInitDto {
|
||||
|
||||
private List <DeviceDefinition> deviceDefs;
|
||||
|
||||
private List<ObservationDefinition> observationDefs;
|
||||
|
||||
private List<SpecimenDefinition> specimenDefs;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description 分页返回
|
||||
* @Author
|
||||
* @Date 2025/9/17
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ObservationDefManageDto {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
|
||||
/** 观测名称,用于标识观测的具体名称 */
|
||||
private String name;
|
||||
|
||||
/** 观测代码,用于唯一标识一个观测项 */
|
||||
private String code;
|
||||
|
||||
/** 观测类型,例如:实验室、临床症状等 */
|
||||
private Integer observationTypeEnum;
|
||||
private String observationTypeEnumText;
|
||||
|
||||
/** 参考范围,例如:3.0-6.0 mg/dL,用于指示正常范围 */
|
||||
private String referenceRange;
|
||||
|
||||
@Dict(dictTable = "adm_instrument", dictCode = "id", dictText = "instrument_name")
|
||||
/** 观测仪器id */
|
||||
private Long instrumentId;
|
||||
private String instrumentId_dictText;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnumText;
|
||||
|
||||
/** 删除状态) */
|
||||
private String deleteFlag;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author
|
||||
* @date
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ObservationDefManageInitDto {
|
||||
private List<statusEnumOption> statusFlagOptions;
|
||||
private List<ObservationTypeEnumOption> ObservationTypeList;
|
||||
private List<InstrumentEnumOption> instrumentEnumOptionList;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Data
|
||||
public static class statusEnumOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
public statusEnumOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ObservationTypeEnumOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
public ObservationTypeEnumOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
@Data
|
||||
public static class InstrumentEnumOption {
|
||||
private Long value;
|
||||
private String info;
|
||||
public InstrumentEnumOption(Long value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 样本定义分页检索条件
|
||||
*
|
||||
* @author lpt
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ObservationDefSelParam {
|
||||
|
||||
/** 类型 */
|
||||
private Integer observationTypeEnum;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/18
|
||||
*/
|
||||
@Data
|
||||
public class ObservationDefStatusRequest {
|
||||
private List<Long> ids;
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/10/17
|
||||
*/
|
||||
@Data
|
||||
public class ReportResultManageDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long parentId;
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
private String patientName; // 患者名称
|
||||
private String chargeName; // 项目名称
|
||||
private String specimenName; // 样本名称
|
||||
private String doctorName; // 开单医生
|
||||
private String observationName;//观测定义名称
|
||||
private String observationResult; // 观测结果
|
||||
private String referenceRange; // 参考范围
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String observationDate;//观测时间
|
||||
private Integer genderEnum; // 性别
|
||||
private String genderEnumText;// 性别文本
|
||||
private String technicianName;// 检查人员
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String authoredTime; // 开单时间
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import com.core.common.core.domain.entity.SysMenu;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/10/17
|
||||
*/
|
||||
@Data
|
||||
public class SampleCollectManageDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long parentId;
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
private String patientName; // 患者名称
|
||||
private String chargeName; // 项目名称
|
||||
private String specimenName; // 样本名称
|
||||
private String doctorName; // 开单医生
|
||||
|
||||
private Integer specimenVolume; //样本量
|
||||
private String specimenUnit; //样本单位
|
||||
|
||||
private Integer genderEnum; // 性别
|
||||
private String genderEnumText;// 性别文本
|
||||
|
||||
private Integer collectionStatusEnum;//采集状态
|
||||
private String collectionStatusEnumText; // 采集状态文本
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date collectionDate; // 采集时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date receivedDate; // 接收时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String authoredTime; // 开单时间
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/10/23
|
||||
*/
|
||||
@Data
|
||||
public class SampleCollectStatusRequest {
|
||||
private List<Long> ids;
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description 分页返回
|
||||
* @Author
|
||||
* @Date 2025/9/17
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SpecimenDefManageDto {
|
||||
/** $column.columnComment */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 样本类型 */
|
||||
private Integer specimenTypeEnum;
|
||||
private String specimenTypeEnumText;
|
||||
|
||||
/** 样本名称 */
|
||||
private String specimenName;
|
||||
|
||||
/** 自定义码 */
|
||||
private String customCode;
|
||||
|
||||
/** 类型顺序 */
|
||||
private Integer typeOrder;
|
||||
|
||||
/** 外部代码 */
|
||||
private String externalCode;
|
||||
|
||||
/** 序号 */
|
||||
private Integer serialNumber;
|
||||
|
||||
/** 全网型 */
|
||||
private String globalType;
|
||||
|
||||
/** 拼音 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔 */
|
||||
private String wbStr;
|
||||
|
||||
/** 样本类 */
|
||||
private String specimenClass;
|
||||
|
||||
/** 扩展类型 */
|
||||
private String extendedType;
|
||||
|
||||
/** WHONET代码 */
|
||||
private String whonetCode;
|
||||
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnumText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author
|
||||
* @date
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SpecimenDefManageInitDto {
|
||||
private List<statusEnumOption> statusFlagOptions;
|
||||
private List<SpecimenType> SpecimenTypeList;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Data
|
||||
public static class statusEnumOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
public statusEnumOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SpecimenType {
|
||||
private Integer value;
|
||||
private String info;
|
||||
List<SpecimenType> children = new ArrayList<>();
|
||||
|
||||
public SpecimenType(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 样本定义分页检索条件
|
||||
*
|
||||
* @author lpt
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SpecimenDefSelParam {
|
||||
|
||||
/** 样本类型 */
|
||||
private Integer specimenTypeEnum;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/9/18
|
||||
*/
|
||||
@Data
|
||||
public class SpecimenDefStatusRequest {
|
||||
private List<Long> ids;
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.openhis.web.Inspection.mapper;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/10/24 16:40
|
||||
*/
|
||||
public interface GroupRecMapper {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.openhis.web.Inspection.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.Inspection.dto.ReportResultManageDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/11/5 9:36
|
||||
*/
|
||||
@Mapper
|
||||
public interface LisReportMapper {
|
||||
|
||||
IPage<ReportResultManageDto> getReportResultList(@Param("page") Page<ReportResultManageDto> page, @Param(Constants.WRAPPER) QueryWrapper<ReportResultManageDto> queryWrapper);
|
||||
|
||||
Long getReportResultListTotal (@Param("page")Page<ReportResultManageDto> page, @Param(Constants.WRAPPER) QueryWrapper<ReportResultManageDto> queryWrapper);
|
||||
List<ReportResultManageDto> getReportListById(@Param(Constants.WRAPPER) QueryWrapper<ReportResultManageDto> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.openhis.web.Inspection.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author
|
||||
* @Date 2025/10/17 11:27
|
||||
*/
|
||||
@Mapper
|
||||
public interface SampleCollectMapper {
|
||||
IPage<SampleCollectManageDto> getSampleCollectList(@Param("page")Page<SampleCollectManageDto> page, @Param(Constants.WRAPPER) QueryWrapper<SampleCollectManageDto> queryWrapper);
|
||||
|
||||
|
||||
Long getSampleCollectListTotal (@Param("page")Page<SampleCollectManageDto> page, @Param(Constants.WRAPPER) QueryWrapper<SampleCollectManageDto> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -18,7 +18,8 @@ public interface IOrganizationAppService {
|
||||
* @param request 请求数据
|
||||
* @return 机构树分页列表
|
||||
*/
|
||||
Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, String sortField, String sortOrder,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 机构信息详情
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.utils.*;
|
||||
import com.openhis.administration.domain.EncounterLocation;
|
||||
import com.openhis.administration.domain.Location;
|
||||
@@ -77,7 +78,9 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> enableLocation(List<Long> locationIdList) {
|
||||
List<Location> locationList = locationService.getLocationList(locationIdList);
|
||||
// 根据ID查询停用状态的
|
||||
List<Location> locationList = locationService.getLocationList(locationIdList,
|
||||
Collections.singletonList(LocationStatus.INACTIVE.getValue()));
|
||||
if (locationIdList != null && !locationIdList.isEmpty()) {
|
||||
for (Location location : locationList) {
|
||||
if (LocationForm.HOUSE.getValue().equals(location.getFormEnum())
|
||||
@@ -117,7 +120,8 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> deactivateLocation(List<Long> locationIdList) {
|
||||
List<Location> locationList = locationService.getLocationList(locationIdList);
|
||||
List<Location> locationList = locationService.getLocationList(locationIdList,
|
||||
Arrays.asList(LocationStatus.ACTIVE.getValue(), LocationStatus.IDLE.getValue()));
|
||||
if (locationIdList != null && !locationIdList.isEmpty()) {
|
||||
for (Location location : locationList) {
|
||||
if (LocationForm.BED.getValue().equals(location.getFormEnum())) {
|
||||
@@ -231,6 +235,23 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
// 启用停用
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
// 如果是查询病房
|
||||
if (LocationForm.HOUSE.getValue().equals(locationPageParam.getFormEnum())) {
|
||||
// 查询疗区
|
||||
LambdaQueryWrapper<Location> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Location::getFormEnum, LocationForm.WARD.getValue()).eq(Location::getDeleteFlag,
|
||||
DelFlag.NO.getCode());
|
||||
List<Location> list = locationService.list(wrapper);
|
||||
// 根据busNo拼接疗区
|
||||
HashMap<String, String> map = list.stream().collect(Collectors.toMap(Location::getBusNo, Location::getName,
|
||||
(oldValue, newValue) -> newValue, HashMap::new));
|
||||
locationPage.getRecords().forEach(e -> {
|
||||
String[] split = e.getBusNo().split("\\.");
|
||||
if (split.length == 2) {
|
||||
e.setParentName(map.get(split[0]));
|
||||
}
|
||||
});
|
||||
}
|
||||
return R.ok(locationPage);
|
||||
}
|
||||
|
||||
@@ -242,7 +263,16 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> addLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||
|
||||
// 不能为空
|
||||
if (StringUtils.isEmpty(locationAddOrEditDto.getName())) {
|
||||
return R.fail(false, "名称不能为空");
|
||||
}
|
||||
// 去除空格
|
||||
String name = locationAddOrEditDto.getName().replaceAll("[ ]", "");
|
||||
// 判断是否存在同名
|
||||
if (locationService.isExistName(name, locationAddOrEditDto.getBusNo(), locationAddOrEditDto.getId())) {
|
||||
return R.fail(false, "【" + name + "】已存在");
|
||||
}
|
||||
Location location = new Location();
|
||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||
location.setFormEnum(Integer.valueOf(locationAddOrEditDto.getFormEnum()));
|
||||
@@ -278,6 +308,16 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> editLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||
// 不能为空
|
||||
if (StringUtils.isEmpty(locationAddOrEditDto.getName())) {
|
||||
return R.fail(false, "名称不能为空");
|
||||
}
|
||||
// 去除空格
|
||||
String name = locationAddOrEditDto.getName().replaceAll("[ ]", "");
|
||||
// 判断是否存在同名
|
||||
if (locationService.isExistName(name, locationAddOrEditDto.getBusNo(), locationAddOrEditDto.getId())) {
|
||||
return R.fail(false, "【" + name + "】已存在");
|
||||
}
|
||||
Location location = new Location();
|
||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||
// 拼音码
|
||||
@@ -377,4 +417,4 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.web.basedatamanage.appservice.impl;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -9,6 +10,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
@@ -26,6 +28,8 @@ import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||
|
||||
import static com.baomidou.mybatisplus.core.toolkit.StringUtils.camelToUnderline;
|
||||
|
||||
@Service
|
||||
public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
|
||||
@@ -36,9 +40,25 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Override
|
||||
public Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
public Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, String sortField,
|
||||
String sortOrder, HttpServletRequest request) {
|
||||
// 查询机构列表
|
||||
Page<Organization> page = organizationService.page(new Page<>(pageNo, pageSize));
|
||||
// 创建Page对象
|
||||
Page<Organization> page = new Page<>(pageNo, pageSize);
|
||||
// 处理动态排序(仅当排序字段有效时才添加排序条件)
|
||||
if (sortField != null && !sortField.isEmpty()) {
|
||||
// 校验排序字段是否为Organization实体中的有效字段(防止非法字段)
|
||||
if (isValidField(Organization.class, sortField)) {
|
||||
// 驼峰转下划线处理
|
||||
String underlineField = camelToUnderline(sortField);
|
||||
// 默认为升序,若指定desc则按降序
|
||||
boolean isAsc = sortOrder == null || "asc".equalsIgnoreCase(sortOrder);
|
||||
page.addOrder(isAsc ? OrderItem.asc(underlineField) : OrderItem.desc(underlineField));
|
||||
}
|
||||
}
|
||||
// 执行分页查询(此时排序条件会被应用)
|
||||
page = organizationService.page(page);
|
||||
|
||||
List<Organization> organizationList = page.getRecords();
|
||||
// 将机构列表转为树结构
|
||||
List<OrganizationDto> orgTree = buildTree(organizationList);
|
||||
@@ -199,4 +219,21 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息停用"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验字段是否为指定类中的有效属性
|
||||
*/
|
||||
private boolean isValidField(Class<?> clazz, String fieldName) {
|
||||
if (clazz == null || fieldName == null || fieldName.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
// 获取类中所有声明的字段(包括私有)
|
||||
Field field = clazz.getDeclaredField(fieldName);
|
||||
return field != null;
|
||||
} catch (NoSuchFieldException e) {
|
||||
// 字段不存在
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -406,7 +406,8 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
if (1L == userId) {
|
||||
return R.fail(null, "admin不允许删除");
|
||||
}
|
||||
iBizUserService.remove(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserId, userId));
|
||||
// iBizUserService.remove(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserId, userId));
|
||||
practitionerAppAppMapper.delUser(userId);
|
||||
practitionerAppAppMapper.delUserRole(userId);
|
||||
Practitioner one =
|
||||
iPractitionerService.getOne(new LambdaQueryWrapper<Practitioner>().eq(Practitioner::getUserId, userId));
|
||||
|
||||
@@ -47,8 +47,11 @@ public class OrganizationController {
|
||||
*/
|
||||
@GetMapping(value = "/organization")
|
||||
public R<?> getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest request) {
|
||||
Page<OrganizationDto> organizationTree = iOrganizationAppService.getOrganizationTree(pageNo, pageSize, request);
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize,
|
||||
@RequestParam(value = "sortField", required = false) String sortField,
|
||||
@RequestParam(value = "sortOrder", required = false) String sortOrder, HttpServletRequest request) {
|
||||
Page<OrganizationDto> organizationTree =
|
||||
iOrganizationAppService.getOrganizationTree(pageNo, pageSize, sortField, sortOrder, request);
|
||||
return R.ok(organizationTree,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"机构信息"}));
|
||||
}
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
*/
|
||||
package com.openhis.web.basedatamanage.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -31,6 +30,9 @@ public class LocationInfoDto {
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 父名称 */
|
||||
private String parentName;
|
||||
|
||||
/** 状态编码 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
@@ -44,7 +46,7 @@ public class LocationInfoDto {
|
||||
private String formEnum_enumText;
|
||||
|
||||
/** 机构编码 */
|
||||
@Dict(dictCode = "id",dictText = "name",dictTable = "adm_organization")
|
||||
@Dict(dictCode = "id", dictText = "name", dictTable = "adm_organization")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
private String organizationId_dictText;
|
||||
|
||||
@@ -63,4 +63,9 @@ public class OrgLocQueryDto {
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
/**
|
||||
* 项目编码 | 药品:1 耗材:2
|
||||
*/
|
||||
private String itemCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -47,6 +47,13 @@ public interface PractitionerAppAppMapper {
|
||||
List<PractitionerOrgAndLocationDto>
|
||||
getOrgAndLocationDtoList(@Param("practitionerIdList") List<Long> practitionerIdList);
|
||||
|
||||
/**
|
||||
* 逻辑删除系统用户
|
||||
*
|
||||
* @param userId 系统用户id
|
||||
*/
|
||||
void delUser(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 物理删除系统用户与角色的关系
|
||||
*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.web.basicmanage.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
@@ -48,6 +49,7 @@ public class InvoiceController {
|
||||
|
||||
// 分页查询发票列表
|
||||
Page<Invoice> page = new Page<>(pageNo, pageSize);
|
||||
return R.ok(invoiceService.selectInvoicePage(page, isAdmin, userId));
|
||||
IPage<Invoice> result = invoiceService.selectInvoicePage(page, isAdmin, userId);
|
||||
return R.ok(result);
|
||||
}
|
||||
}
|
||||
@@ -90,4 +90,9 @@ public class HealthcareServiceFormData {
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
}
|
||||
@@ -53,7 +53,8 @@ public class PatientCardRenewalServiceImpl implements PatientCardRenewalService
|
||||
// 3. 直接使用患者ID作为查询条件
|
||||
Long patientId = Long.parseLong(request.getPatientId());
|
||||
// 4. 通过患者ID查询现有标识信息
|
||||
PatientIdentifier patientIdentifier = patientIdentifierService.selectByPatientId(patientId);
|
||||
List<PatientIdentifier> patientIdentifiers = patientIdentifierService.selectByPatientId(patientId);
|
||||
PatientIdentifier patientIdentifier = patientIdentifiers.isEmpty() ? null : patientIdentifiers.get(0);
|
||||
|
||||
if (patientIdentifier != null) {
|
||||
// 5. 只更新就诊卡号这一个参数
|
||||
|
||||
@@ -20,26 +20,32 @@ import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
|
||||
public interface IInpatientChargeAppService {
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
* 门诊收费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> inpatientChargeInit();
|
||||
|
||||
/**
|
||||
* 查询住院患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
* @return 住院患者分页列表
|
||||
*/
|
||||
R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
* 根据就诊id查询患者待结算信息
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
* @return 患者待结算信息
|
||||
*/
|
||||
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId, String startTime,
|
||||
String endTime);
|
||||
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId);
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
@@ -56,11 +62,4 @@ public interface IInpatientChargeAppService {
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> changeToMedicalInsurance(Long encounterId);
|
||||
|
||||
/**
|
||||
* 门诊收费页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> outpatientChargeInit();
|
||||
}
|
||||
|
||||
@@ -40,6 +40,14 @@ public interface IOutpatientChargeAppService {
|
||||
*/
|
||||
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId);
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表并新增字段:实收金额、应收金额、优惠金额、折扣率
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescriptionWithPrice(Long encounterId);
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -21,10 +22,7 @@ import com.openhis.administration.service.IAccountService;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.ChargeItemContext;
|
||||
import com.openhis.common.enums.ChargeItemStatus;
|
||||
import com.openhis.common.enums.EncounterClass;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.chargemanage.appservice.IInpatientChargeAppService;
|
||||
@@ -51,33 +49,32 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
|
||||
private IAccountService accountService;
|
||||
|
||||
/**
|
||||
* 门诊收费页面初始化
|
||||
* 住院结算页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> outpatientChargeInit() {
|
||||
public R<?> inpatientChargeInit() {
|
||||
OutpatientInitDto initDto = new OutpatientInitDto();
|
||||
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(),
|
||||
ChargeItemStatus.PLANNED.getInfo()));
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLABLE.getInfo()));
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.BILLED.getInfo()));
|
||||
initDto.setChargeItemStatusOptions(chargeItemStatusOptions);
|
||||
List<OutpatientInitDto.encounterStatusOption> encounterStatusOptions = new ArrayList<>();
|
||||
encounterStatusOptions
|
||||
.add(new OutpatientInitDto.encounterStatusOption(EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue(),
|
||||
EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getInfo()));
|
||||
encounterStatusOptions.add(new OutpatientInitDto.encounterStatusOption(
|
||||
EncounterZyStatus.ALREADY_SETTLED.getValue(), EncounterZyStatus.ALREADY_SETTLED.getInfo()));
|
||||
initDto.setEncounterStatusOptions(encounterStatusOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
* 查询住院患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
* @return 住院患者分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
@@ -90,14 +87,17 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = inpatientChargeAppMapper
|
||||
.selectEncounterPatientPage(EncounterClass.IMP.getValue(), new Page<>(pageNo, pageSize), queryWrapper);
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = inpatientChargeAppMapper.selectEncounterPatientPage(
|
||||
EncounterClass.IMP.getValue(), EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue(),
|
||||
EncounterZyStatus.ALREADY_SETTLED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
AccountType.PERSONAL_CASH_ACCOUNT.getCode(), new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
encounterPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
// 住院状态
|
||||
e.setEncounterStatus_enumText(EnumUtils.getInfoByValue(EncounterZyStatus.class, e.getEncounterStatus()));
|
||||
// 计算年龄
|
||||
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
|
||||
});
|
||||
@@ -105,36 +105,20 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
* 根据就诊id查询患者待结算信息
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
* @return 患者待结算信息
|
||||
*/
|
||||
@Override
|
||||
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId, String startTime,
|
||||
String endTime) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
|
||||
startTime = startTime + "000000";
|
||||
|
||||
endTime = endTime + "235959";
|
||||
|
||||
Date startDate = null;
|
||||
Date endDate = null;
|
||||
try {
|
||||
startDate = sdf.parse(startTime);
|
||||
endDate = sdf.parse(endTime);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId) {
|
||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList =
|
||||
inpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
||||
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
||||
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
|
||||
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(), startDate, endDate);
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue());
|
||||
prescriptionDtoList.forEach(e -> {
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@@ -26,6 +29,7 @@ import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.ChargeItemContext;
|
||||
import com.openhis.common.enums.ChargeItemStatus;
|
||||
import com.openhis.common.enums.EncounterClass;
|
||||
import com.openhis.common.enums.ybenums.YbPayment;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService;
|
||||
@@ -61,11 +65,11 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
OutpatientInitDto initDto = new OutpatientInitDto();
|
||||
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(),
|
||||
ChargeItemStatus.PLANNED.getInfo()));
|
||||
ChargeItemStatus.PLANNED.getInfo()));
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLABLE.getInfo()));
|
||||
ChargeItemStatus.BILLABLE.getInfo()));
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.BILLED.getInfo()));
|
||||
ChargeItemStatus.BILLED.getInfo()));
|
||||
initDto.setChargeItemStatusOptions(chargeItemStatusOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
@@ -82,17 +86,17 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<EncounterPatientPageParam> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = outpatientChargeAppMapper
|
||||
.selectEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.AMB.getValue());
|
||||
.selectEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.AMB.getValue());
|
||||
|
||||
encounterPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
@@ -113,13 +117,13 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
*/
|
||||
@Override
|
||||
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId) {
|
||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList =
|
||||
outpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
||||
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
||||
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
|
||||
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue());
|
||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList
|
||||
= outpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
||||
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
||||
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
|
||||
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue());
|
||||
prescriptionDtoList.forEach(e -> {
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
@@ -138,7 +142,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
// 获取就诊患者的自费账户id
|
||||
Long accountId = accountService.getSelfPayAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"自费账户"}));
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[]{"自费账户"}));
|
||||
}
|
||||
// 医保转自费
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
@@ -159,7 +163,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
// 获取就诊患者的医保账户id
|
||||
Long accountId = accountService.getMedicalInsuranceAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[]{"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
@@ -180,7 +184,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
// 获取就诊患者的学生自费账户id
|
||||
Long accountId = accountService.getStudentSelfAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[]{"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
@@ -201,7 +205,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
// 获取就诊患者的学生医保账户id
|
||||
Long accountId = accountService.getStudentYbAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[]{"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
@@ -210,4 +214,67 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表并新增字段:应收金额,实收金额,优惠金额,折扣率
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
@Override
|
||||
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescriptionWithPrice(Long encounterId) {
|
||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList = outpatientChargeAppMapper
|
||||
.selectEncounterPatientPrescriptionWithPrice(encounterId, ChargeItemContext.ACTIVITY.getValue(),
|
||||
ChargeItemContext.MEDICATION.getValue(), ChargeItemContext.DEVICE.getValue(),
|
||||
ChargeItemContext.REGISTER.getValue(), ChargeItemStatus.PLANNED.getValue(),
|
||||
ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.REFUNDING.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
ChargeItemStatus.PART_REFUND.getValue(), YbPayment.DISCOUNT_PAY.getValue(),
|
||||
YbPayment.SELF_CASH_VALUE.getValue(), YbPayment.SELF_CASH_VX_VALUE.getValue(),
|
||||
YbPayment.SELF_CASH_ALI_VALUE.getValue(), YbPayment.SELF_CASH_UNION_VALUE.getValue());
|
||||
prescriptionDtoList.forEach(e -> {
|
||||
// 应收金额
|
||||
BigDecimal receivableAmount = e.getReceivableAmount();
|
||||
// 实收金额
|
||||
BigDecimal receivedAmount = e.getReceivedAmount();
|
||||
// 计算折扣率
|
||||
BigDecimal discountRate = BigDecimal.ONE;
|
||||
if (receivableAmount.compareTo(BigDecimal.ZERO) > 0 && receivedAmount.compareTo(BigDecimal.ZERO) > 0
|
||||
&& receivableAmount.compareTo(receivedAmount) > 0) {
|
||||
discountRate = receivedAmount.divide(receivableAmount, 2, RoundingMode.HALF_UP);
|
||||
}
|
||||
e.setDiscountRate(this.returnDiscountRate(discountRate));
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
});
|
||||
return prescriptionDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调整折扣率
|
||||
*
|
||||
* @param discountRate 折扣率
|
||||
* @return 调整后的折扣率(0.05的倍数)
|
||||
*
|
||||
*/
|
||||
private String returnDiscountRate(BigDecimal discountRate) {
|
||||
BigDecimal compareValue = BigDecimal.valueOf(0.05);
|
||||
BigDecimal remainder = discountRate.remainder(compareValue);
|
||||
DecimalFormat df = new DecimalFormat();
|
||||
df.setMinimumFractionDigits(0);
|
||||
df.setMaximumFractionDigits(2);
|
||||
// 比较余数,若为0则数据为0.05倍数,否则需要再次四舍五入
|
||||
if (remainder.compareTo(BigDecimal.ZERO) == 0) {
|
||||
return df.format(discountRate);
|
||||
} else {
|
||||
// 再次四舍五入
|
||||
BigDecimal reActuarial = BigDecimal.ZERO;
|
||||
if (remainder.compareTo(BigDecimal.valueOf(CommonConstants.UtilMethodConstant.THRESHOLD_VALUE)) > 0) {
|
||||
reActuarial = discountRate.add(compareValue.subtract(remainder));
|
||||
} else {
|
||||
reActuarial = discountRate.subtract(remainder);
|
||||
}
|
||||
return df.format(reActuarial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class OutpatientPricingAppServiceImpl implements IOutpatientPricingAppSer
|
||||
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
Long organizationId, Integer pageNo, Integer pageSize) {
|
||||
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null,
|
||||
organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3));
|
||||
organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3), null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
@@ -80,8 +81,9 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
public R<?> outpatientRefundInit() {
|
||||
OutpatientInitDto initDto = new OutpatientInitDto();
|
||||
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.BILLED.getInfo()));
|
||||
// 门诊退费页面去掉已收费状态筛选
|
||||
// chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
|
||||
// ChargeItemStatus.BILLED.getInfo()));
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDING.getInfo()));
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDED.getValue(),
|
||||
@@ -122,11 +124,6 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
refundItemList.forEach(e -> {
|
||||
// 退费状态
|
||||
e.setRefundStatus_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getRefundStatus()));
|
||||
// 发放状态
|
||||
e.setDispenseStatus_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getDispenseStatus()));
|
||||
// 执行状态
|
||||
e.setServiceStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getServiceStatus()));
|
||||
|
||||
});
|
||||
refundItemList.sort(Comparator.comparing(RefundItemDto::getPaymentId));
|
||||
return R.ok(refundItemList);
|
||||
@@ -140,7 +137,6 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> refundPayment(List<RefundItemParam> refundItemList) {
|
||||
|
||||
// 未退费用项,生成新的请求发放费用项
|
||||
List<RefundItemParam> creatList = new ArrayList<>();
|
||||
for (RefundItemParam param : refundItemList) {
|
||||
@@ -149,7 +145,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
creatList.add(param);
|
||||
}
|
||||
}
|
||||
|
||||
// todo 半退逻辑需修改
|
||||
if (!creatList.isEmpty()) {
|
||||
// 未退费费用项id集合
|
||||
List<Long> creatChargeItemIdList =
|
||||
@@ -245,108 +241,232 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
// 退费费用项id集合
|
||||
List<Long> chargeItemIdList =
|
||||
refundItemList.stream().map(RefundItemParam::getChargeItemId).collect(Collectors.toList());
|
||||
|
||||
// 根据费用项id查询费用项请求发放信息
|
||||
List<RefundItemDto> chargeItemList = outpatientRefundAppMapper.selectRefundItem(chargeItemIdList,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
|
||||
|
||||
List<Long> medDisIdList = new ArrayList<>();
|
||||
List<Long> devDisIdList = new ArrayList<>();
|
||||
// 服务请求id集合
|
||||
List<Long> medReqIdList = new ArrayList<>();
|
||||
List<Long> devReqIdList = new ArrayList<>();
|
||||
List<Long> serReqIdList = new ArrayList<>();
|
||||
// 查询退费项目信息
|
||||
List<ChargeItem> chargeItemList = chargeItemService.listByIds(chargeItemIdList);
|
||||
if (chargeItemList != null && !chargeItemList.isEmpty()) {
|
||||
chargeItemList.forEach(item -> {
|
||||
switch (item.getServiceTable()) {
|
||||
case CommonConstants.TableName.MED_MEDICATION_REQUEST -> medReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_DEVICE_REQUEST -> devReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_SERVICE_REQUEST -> serReqIdList.add(item.getServiceId());
|
||||
}
|
||||
});
|
||||
}
|
||||
// 处理退药申请
|
||||
if (!medReqIdList.isEmpty()) {
|
||||
// 药品请求查询
|
||||
List<MedicationRequest> medicationRequests = medicationRequestService.listByIds(medReqIdList);
|
||||
// 药品发放查询
|
||||
List<MedicationDispense> medicationDispenses =
|
||||
medicationDispenseService.selectByRequestIdList(medReqIdList);
|
||||
// 根据请求id做map
|
||||
Map<Long, List<MedicationDispense>> medicationDispenseMap =
|
||||
medicationDispenses.stream().collect(Collectors.groupingBy(MedicationDispense::getMedReqId));
|
||||
for (MedicationRequest medicationRequest : medicationRequests) {
|
||||
// 根据请求匹配发放
|
||||
List<MedicationDispense> medicationDispenseList = medicationDispenseMap.get(medicationRequest.getId());
|
||||
// 判断是否是退药流程
|
||||
boolean isRefundFlow = false;
|
||||
if (medicationDispenseList != null) {
|
||||
for (MedicationDispense dispense : medicationDispenseList) {
|
||||
// 先判断是否包含“已完成/部分完成”的药品,这决定了是走“退药流程”还是“取消流程”
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(dispense.getStatusEnum())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(dispense.getStatusEnum())) {
|
||||
isRefundFlow = true;
|
||||
break; // 只要有一条是完成状态,整个单子即视为走退药流程
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (RefundItemDto dto : chargeItemList) {
|
||||
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(dto.getServiceTable())) {
|
||||
// 药品需要先退药
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
|
||||
// 药品请求查询
|
||||
MedicationRequest medicationRequest = medicationRequestService.getById(dto.getRequestId());
|
||||
if (isRefundFlow) {
|
||||
// ==================== 走退药流程 (生成新单据) ====================
|
||||
// 校验是否重复申请
|
||||
if (medicationRequest.getRefundMedicineId() != null) {
|
||||
throw new ServiceException("已申请退药,请勿重复申请");
|
||||
}
|
||||
// 生成药品请求(退药)
|
||||
medicationRequest.setId(null); // 药品请求id
|
||||
medicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码
|
||||
medicationRequest.setQuantity(dto.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
|
||||
medicationRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
|
||||
medicationRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
||||
medicationRequest.setRefundMedicineId(dto.getRequestId()); // 退药id
|
||||
medicationRequest.setPrescriptionNo(String.valueOf("T" + dto.getPrescriptionNo()));
|
||||
medicationRequestService.save(medicationRequest);
|
||||
MedicationRequest newRefundRequest = new MedicationRequest();
|
||||
BeanUtils.copyProperties(medicationRequest, newRefundRequest);
|
||||
newRefundRequest.setId(null); // 清空ID以新增
|
||||
newRefundRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||
newRefundRequest.setQuantity(medicationRequest.getQuantity().multiply(new BigDecimal("-1"))); // 数量取反
|
||||
newRefundRequest.setStatusEnum(RequestStatus.CANCELLED.getValue());
|
||||
newRefundRequest.setRefundMedicineId(medicationRequest.getId()); // 关联原ID
|
||||
newRefundRequest.setPrescriptionNo("T" + medicationRequest.getPrescriptionNo());
|
||||
medicationRequestService.save(newRefundRequest);
|
||||
Long newRequestId = newRefundRequest.getId();
|
||||
|
||||
} else {
|
||||
if (DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())
|
||||
&& NotPerformedReason.REFUND.getValue().equals(dto.getNotPerformedReason())) {
|
||||
throw new ServiceException("已申请退药,请勿重复申请");
|
||||
// 再生成对应的负向发药记录,并关联退药请求
|
||||
List<MedicationDispense> newDispensesToSave = new ArrayList<>();
|
||||
for (MedicationDispense originDispense : medicationDispenseList) {
|
||||
// 只处理已完成或部分完成的记录
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(originDispense.getStatusEnum())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(originDispense.getStatusEnum())) {
|
||||
MedicationDispense refundDispense = new MedicationDispense();
|
||||
BeanUtils.copyProperties(originDispense, refundDispense);
|
||||
refundDispense.setId(null); // ID置空
|
||||
refundDispense.setDispenseQuantity(BigDecimal.ZERO); // 已退数量
|
||||
refundDispense.setMedReqId(newRequestId); // 关联退药请求id
|
||||
refundDispense
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||
// 退药状态
|
||||
refundDispense.setStatusEnum(DispenseStatus.PENDING_REFUND.getValue());
|
||||
newDispensesToSave.add(refundDispense);
|
||||
}
|
||||
}
|
||||
|
||||
// 批量保存新的发药记录
|
||||
if (!newDispensesToSave.isEmpty()) {
|
||||
medicationDispenseService.saveBatch(newDispensesToSave);
|
||||
}
|
||||
} else {
|
||||
// ==================== 走直接取消流程 (修改原单据状态) ====================
|
||||
if (medicationDispenseList != null) {
|
||||
List<MedicationDispense> dispensesToUpdate = new ArrayList<>();
|
||||
for (MedicationDispense medicationDispense : medicationDispenseList) {
|
||||
// 检查是否已经是退药状态
|
||||
if (DispenseStatus.STOPPED.getValue().equals(medicationDispense.getStatusEnum())
|
||||
&& NotPerformedReason.REFUND.getValue().equals(medicationDispense.getStatusEnum())) {
|
||||
throw new ServiceException("已申请退药,请勿重复申请");
|
||||
}
|
||||
// 修改状态
|
||||
medicationDispense.setStatusEnum(DispenseStatus.STOPPED.getValue())
|
||||
.setNotPerformedReasonEnum(NotPerformedReason.REFUND.getValue());
|
||||
dispensesToUpdate.add(medicationDispense);
|
||||
}
|
||||
// 批量更新
|
||||
if (!dispensesToUpdate.isEmpty()) {
|
||||
medicationDispenseService.updateBatchById(dispensesToUpdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 处理退耗材申请
|
||||
if (!devReqIdList.isEmpty()) {
|
||||
// 耗材请求查询
|
||||
List<DeviceRequest> deviceRequests = deviceRequestService.listByIds(devReqIdList);
|
||||
// 耗材发放查询
|
||||
List<DeviceDispense> deviceDispenses = deviceDispenseService.selectByRequestIdList(devReqIdList);
|
||||
// 根据请求id做map
|
||||
Map<Long, List<DeviceDispense>> deviceDispenseMap =
|
||||
deviceDispenses.stream().collect(Collectors.groupingBy(DeviceDispense::getDeviceReqId));
|
||||
for (DeviceRequest deviceRequest : deviceRequests) {
|
||||
// 根据请求匹配发放
|
||||
List<DeviceDispense> deviceDispenseList = deviceDispenseMap.get(deviceRequest.getId());
|
||||
// 判断是否是退耗材流程
|
||||
boolean isRefundFlow = false;
|
||||
if (deviceDispenseList != null) {
|
||||
for (DeviceDispense dispense : deviceDispenseList) {
|
||||
// 先判断是否包含“已完成/部分完成”的耗材,这决定了是走“退耗材流程”还是“取消流程”
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(dispense.getStatusEnum())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(dispense.getStatusEnum())) {
|
||||
isRefundFlow = true;
|
||||
break; // 只要有一条是完成状态,整个单子即视为走退耗材流程
|
||||
}
|
||||
}
|
||||
medDisIdList.add(dto.getDispenseId());
|
||||
}
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(dto.getServiceTable())) {
|
||||
if (isRefundFlow) {
|
||||
// ==================== 走退耗材流程 (生成新单据) ====================
|
||||
// 校验是否重复申请
|
||||
if (deviceRequest.getRefundDeviceId() != null) {
|
||||
throw new ServiceException("已申请退耗材,请勿重复申请");
|
||||
}
|
||||
DeviceRequest newRefundRequest = new DeviceRequest();
|
||||
BeanUtils.copyProperties(deviceRequest, newRefundRequest);
|
||||
newRefundRequest.setId(null); // 清空ID以新增
|
||||
newRefundRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4));
|
||||
newRefundRequest.setQuantity(deviceRequest.getQuantity().multiply(new BigDecimal("-1"))); // 数量取反
|
||||
newRefundRequest.setStatusEnum(RequestStatus.CANCELLED.getValue());
|
||||
newRefundRequest.setRefundDeviceId(deviceRequest.getId()); // 关联原ID
|
||||
newRefundRequest.setPrescriptionNo("T" + deviceRequest.getPrescriptionNo());
|
||||
deviceRequestService.save(newRefundRequest);
|
||||
Long newRequestId = newRefundRequest.getId();
|
||||
|
||||
// 再生成对应的负向发耗材记录,并关联退耗材请求
|
||||
List<DeviceDispense> newDispensesToSave = new ArrayList<>();
|
||||
for (DeviceDispense originDispense : deviceDispenseList) {
|
||||
// 只处理已完成或部分完成的记录
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(originDispense.getStatusEnum())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(originDispense.getStatusEnum())) {
|
||||
DeviceDispense refundDispense = new DeviceDispense();
|
||||
BeanUtils.copyProperties(originDispense, refundDispense);
|
||||
refundDispense.setId(null); // ID置空
|
||||
refundDispense.setDispenseQuantity(BigDecimal.ZERO); // 已退数量
|
||||
refundDispense.setDeviceReqId(newRequestId); // 关联退耗材请求id
|
||||
refundDispense
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||
// 退耗材状态
|
||||
refundDispense.setStatusEnum(DispenseStatus.PENDING_REFUND.getValue());
|
||||
newDispensesToSave.add(refundDispense);
|
||||
}
|
||||
}
|
||||
|
||||
// 批量保存新的发耗材记录
|
||||
if (!newDispensesToSave.isEmpty()) {
|
||||
deviceDispenseService.saveBatch(newDispensesToSave);
|
||||
}
|
||||
} else {
|
||||
// ==================== 走直接取消流程 (修改原单据状态) ====================
|
||||
if (deviceDispenseList != null) {
|
||||
List<DeviceDispense> dispensesToUpdate = new ArrayList<>();
|
||||
for (DeviceDispense deviceDispense : deviceDispenseList) {
|
||||
// 检查是否已经是退耗材状态
|
||||
if (DispenseStatus.STOPPED.getValue().equals(deviceDispense.getStatusEnum())
|
||||
&& NotPerformedReason.REFUND.getValue().equals(deviceDispense.getStatusEnum())) {
|
||||
throw new ServiceException("已申请退耗材,请勿重复申请");
|
||||
}
|
||||
// 修改状态
|
||||
deviceDispense.setStatusEnum(DispenseStatus.STOPPED.getValue())
|
||||
.setNotPerformedReasonEnum(NotPerformedReason.REFUND.getValue());
|
||||
dispensesToUpdate.add(deviceDispense);
|
||||
}
|
||||
// 批量更新
|
||||
if (!dispensesToUpdate.isEmpty()) {
|
||||
deviceDispenseService.updateBatchById(dispensesToUpdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 处理退诊疗项目申请
|
||||
// 诊疗申请待更新id列表
|
||||
List<Long> serReqUpdateList = new ArrayList<>();
|
||||
if (!serReqIdList.isEmpty()) {
|
||||
// 查询诊疗申请
|
||||
List<ServiceRequest> serviceRequestList = serviceRequestService.listByIds(serReqIdList);
|
||||
for (ServiceRequest serviceRequest : serviceRequestList) {
|
||||
// 诊疗项目需医技科室同意退费
|
||||
if (RequestStatus.COMPLETED.getValue().equals(dto.getServiceStatus())) {
|
||||
// 服务请求查询
|
||||
ServiceRequest serviceRequest = serviceRequestService.getById(dto.getRequestId());
|
||||
if (RequestStatus.COMPLETED.getValue().equals(serviceRequest.getStatusEnum())) {
|
||||
if (serviceRequest.getRefundServiceId() != null) {
|
||||
throw new ServiceException("已申请退费,请勿重复申请");
|
||||
}
|
||||
// 生成服务请求(取消服务)
|
||||
serviceRequest.setId(null); // 服务请求id
|
||||
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
|
||||
serviceRequest.setQuantity(dto.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
|
||||
serviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
|
||||
serviceRequest.setQuantity(serviceRequest.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
|
||||
serviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
||||
serviceRequest.setRefundServiceId(dto.getRequestId()); // 退药id
|
||||
serviceRequest.setRefundServiceId(serviceRequest.getId());// 退id
|
||||
serviceRequest.setId(null); // 服务请求id
|
||||
serviceRequestService.save(serviceRequest);
|
||||
|
||||
} else {
|
||||
if (RequestStatus.STOPPED.getValue().equals(dto.getServiceStatus())) {
|
||||
if (RequestStatus.STOPPED.getValue().equals(serviceRequest.getStatusEnum())) {
|
||||
throw new ServiceException("已申请退费,请勿重复申请");
|
||||
}
|
||||
serReqIdList.add(dto.getServiceId());
|
||||
}
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(dto.getServiceTable())) {
|
||||
// 耗材需要先退药
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
|
||||
// 耗材请求查询
|
||||
DeviceRequest deviceRequest = deviceRequestService.getById(dto.getRequestId());
|
||||
if (deviceRequest.getRefundDeviceId() == null) {
|
||||
// 生成耗材请求(退耗材)
|
||||
deviceRequest.setId(null); // 耗材请求id
|
||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码
|
||||
deviceRequest.setQuantity(dto.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
|
||||
deviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
|
||||
deviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
||||
deviceRequest.setRefundDeviceId(dto.getRequestId()); // 退药id
|
||||
deviceRequestService.save(deviceRequest);
|
||||
}
|
||||
} else if (!DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())) {
|
||||
devDisIdList.add(dto.getDispenseId());
|
||||
serReqUpdateList.add(serviceRequest.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新收费状态:退费中
|
||||
chargeItemService.updateRefundChargeStatus(chargeItemIdList);
|
||||
|
||||
if (!medDisIdList.isEmpty()) {
|
||||
// 更新未发放药品状态:停止发放,停止原因:退费
|
||||
medicationDispenseService.updateStopDispenseStatus(medDisIdList, NotPerformedReason.REFUND.getValue());
|
||||
// 更新未执行诊疗状态:停止
|
||||
if (!serReqUpdateList.isEmpty()) {
|
||||
serviceRequestService.updateStopRequestStatus(serReqUpdateList);
|
||||
}
|
||||
if (!devDisIdList.isEmpty()) {
|
||||
// 更新未发放耗材状态:停止发放,停止原因:退费
|
||||
deviceDispenseService.updateStopDispenseStatus(devDisIdList, NotPerformedReason.REFUND.getValue());
|
||||
}
|
||||
if (!serReqIdList.isEmpty()) {
|
||||
// 更新未执行诊疗状态:停止
|
||||
serviceRequestService.updateStopRequestStatus(serReqIdList);
|
||||
}
|
||||
|
||||
// 返回退费成功信息
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"门诊退费"}));
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -228,7 +229,8 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
|
||||
CancelPaymentDto cancelPaymentDto = new CancelPaymentDto();
|
||||
BeanUtils.copyProperties(cancelRegPaymentDto, cancelPaymentDto);
|
||||
|
||||
//LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
//String string1 = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH);
|
||||
// 开通医保的处理
|
||||
if ("1".equals(SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))
|
||||
&& account != null && !CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(account.getContractNo())) {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
@@ -16,18 +16,18 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 门诊收费 controller
|
||||
* 住院收费 controller
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/charge-manage/inpa-charge")
|
||||
@RequestMapping("/charge-manage/inpatient-charge")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class InpatientChargeController {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private IInpatientChargeAppService inpatientChargeAppService;
|
||||
|
||||
/**
|
||||
@@ -36,39 +36,38 @@ public class InpatientChargeController {
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> outpatientChargeInit() {
|
||||
return inpatientChargeAppService.outpatientChargeInit();
|
||||
public R<?> inpatientChargeInit() {
|
||||
return inpatientChargeAppService.inpatientChargeInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
* 查询住院患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
* @return 住院患者分页列表
|
||||
*/
|
||||
@GetMapping(value = "/encounter-patient-page")
|
||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return R.ok(inpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
|
||||
pageSize, request));
|
||||
return inpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo, pageSize,
|
||||
request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表
|
||||
* 根据就诊id查询患者待结算信息
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
* @return 患者待结算信息
|
||||
*/
|
||||
@GetMapping(value = "/patient-prescription")
|
||||
public R<?> getEncounterPatientPrescription(@RequestParam Long encounterId, @RequestParam String startTime,
|
||||
@RequestParam String endTime) {
|
||||
return R.ok(inpatientChargeAppService.getEncounterPatientPrescription(encounterId, startTime, endTime));
|
||||
public R<?> getEncounterPatientPrescription(Long encounterId) {
|
||||
return R.ok(inpatientChargeAppService.getEncounterPatientPrescription(encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,6 @@ package com.openhis.web.chargemanage.controller;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
@@ -71,6 +70,17 @@ public class OutpatientChargeController {
|
||||
return R.ok(outpatientChargeAppService.getEncounterPatientPrescription(encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表并新增字段:实收金额、应收金额、优惠金额、折扣率
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
@GetMapping(value = "/patient-prescription-with-price")
|
||||
public R<?> getEncounterPatientPrescriptionWithPrice(@RequestParam Long encounterId) {
|
||||
return R.ok(outpatientChargeAppService.getEncounterPatientPrescriptionWithPrice(encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
|
||||
@@ -16,7 +16,9 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class CurrentDayEncounterDto {
|
||||
|
||||
/** 租户ID */
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Integer tenantId;
|
||||
|
||||
/**
|
||||
@@ -135,39 +137,4 @@ public class CurrentDayEncounterDto {
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 退号日期/时间
|
||||
*/
|
||||
private Date returnDate;
|
||||
|
||||
/**
|
||||
* 退号原因
|
||||
*/
|
||||
private String returnReason;
|
||||
|
||||
/**
|
||||
* 退号操作人
|
||||
*/
|
||||
private String operatorName;
|
||||
|
||||
/**
|
||||
* 退号操作工号(用户账号)
|
||||
*/
|
||||
private String operatorId;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 合同编码(费用性质代码)
|
||||
*/
|
||||
private String contractNo;
|
||||
|
||||
/**
|
||||
* 退款方式(多个支付方式用逗号分隔)
|
||||
*/
|
||||
private String refundMethod;
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -32,6 +31,10 @@ public class EncounterPatientPageDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 住院状态 */
|
||||
private Integer encounterStatus;
|
||||
private String encounterStatus_enumText;
|
||||
|
||||
/**
|
||||
* 患者
|
||||
*/
|
||||
|
||||
@@ -67,4 +67,9 @@ public class EncounterPatientPageParam {
|
||||
* 收费状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
/**
|
||||
* 患者状态
|
||||
*/
|
||||
private Integer encounterStatus;
|
||||
}
|
||||
|
||||
@@ -23,104 +23,191 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class EncounterPatientPrescriptionDto {
|
||||
|
||||
/** 收费项目类型 */
|
||||
/**
|
||||
* 收费项目类型
|
||||
*/
|
||||
private Integer contextEnum;
|
||||
private String contextEnum_enumText;
|
||||
|
||||
/** 收费状态 */
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 就诊ID */
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者id */
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** ID */
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 开立科室 */
|
||||
/**
|
||||
* 开立科室
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestingOrgId;
|
||||
|
||||
/** 数量 */
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long quantityValue;
|
||||
|
||||
/** 单位 */
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String quantityUnit;
|
||||
private String quantityUnit_dictText;
|
||||
|
||||
/** 单价 */
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 处方号 */
|
||||
/**
|
||||
* 处方号
|
||||
*/
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 业务编码 */
|
||||
/**
|
||||
* 业务编码
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/** 收款人ID */
|
||||
/**
|
||||
* 收款人ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictCode = "id", dictTable = "adm_practitioner", dictText = "name")
|
||||
private Long entererId;
|
||||
private String entererId_dictText;
|
||||
|
||||
/** 开立时间 */
|
||||
/**
|
||||
* 开立时间
|
||||
*/
|
||||
private Date enteredDate;
|
||||
|
||||
/** 收费时间 */
|
||||
/**
|
||||
* 收费时间
|
||||
*/
|
||||
private Date billDate;
|
||||
|
||||
/** 关联账户ID */
|
||||
/**
|
||||
* 关联账户ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 物品编码 */
|
||||
/**
|
||||
* 物品编码
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
/** 物品名称 */
|
||||
/**
|
||||
* 物品名称
|
||||
*/
|
||||
private String itemName;
|
||||
|
||||
/** 特病标识 */
|
||||
/**
|
||||
* 特病标识
|
||||
*/
|
||||
@Dict(dictCode = "med_type")
|
||||
private String medTypeCode;
|
||||
private String medTypeCode_dictText;
|
||||
/** 用法 */
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
@Dict(dictCode = "method_code")
|
||||
private String methodCode;
|
||||
private String methodCode_dictText;
|
||||
|
||||
/**
|
||||
* 剂量
|
||||
*/
|
||||
private String dose;
|
||||
|
||||
/**
|
||||
* 剂量单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String doseUnitCode;
|
||||
/** 单次剂量单位 */
|
||||
private String doseUnitCode_dictText;
|
||||
/** 频次 */
|
||||
|
||||
/**
|
||||
* 频次
|
||||
*/
|
||||
private String rateCode;
|
||||
/** 合同编码 */
|
||||
|
||||
/**
|
||||
* 合同编码
|
||||
*/
|
||||
private String contractNo;
|
||||
|
||||
/** 医保编码 */
|
||||
/**
|
||||
* 医保编码
|
||||
*/
|
||||
private String ybNo;
|
||||
|
||||
/** 合同名称 */
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/** 服务所在表 */
|
||||
/**
|
||||
* 服务所在表
|
||||
*/
|
||||
private String serviceTable;
|
||||
|
||||
/** 服务所在表对应的id */
|
||||
/**
|
||||
* 服务所在表对应的id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long serviceId;
|
||||
|
||||
/** 付款id */
|
||||
/**
|
||||
* 付款id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long paymentId;
|
||||
|
||||
/**
|
||||
* 实收金额
|
||||
*/
|
||||
private BigDecimal receivedAmount = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
private BigDecimal discountAmount = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 应收金额
|
||||
*/
|
||||
private BigDecimal receivableAmount = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 折扣率
|
||||
*/
|
||||
@Dict(dictCode = "charge_discount")
|
||||
private String discountRate = "0";
|
||||
private String discountRate_dictText;
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ public class OutpatientInitDto {
|
||||
|
||||
private List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions;
|
||||
|
||||
private List<OutpatientInitDto.encounterStatusOption> encounterStatusOptions;
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
@@ -33,4 +35,18 @@ public class OutpatientInitDto {
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
@Data
|
||||
public static class encounterStatusOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public encounterStatusOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +33,7 @@ public class PractitionerMetadata {
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 医生职称 */
|
||||
private String drProfttlCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,14 +3,15 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 退款项目 dto
|
||||
*
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -28,12 +27,18 @@ public interface InpatientChargeAppMapper {
|
||||
/**
|
||||
* 查询就诊患者分页列表
|
||||
*
|
||||
* @param classEnum 住院患者类型:住院
|
||||
* @param dischargedFromHospital 住院状态:已出院
|
||||
* @param alreadySettled 住院状态:已结算出院
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
Page<EncounterPatientPageDto> selectEncounterPatientPage(@Param("classEnum") Integer classEnum,
|
||||
@Param("page") Page<EncounterPatientPageDto> page,
|
||||
@Param("dischargedFromHospital") Integer dischargedFromHospital,
|
||||
@Param("alreadySettled") Integer alreadySettled, @Param("billable") Integer billable,
|
||||
@Param("billed") Integer billed, @Param("refunded") Integer refunded,
|
||||
@Param("personalCashAccount") String personalCashAccount, @Param("page") Page<EncounterPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper);
|
||||
|
||||
/**
|
||||
@@ -56,5 +61,5 @@ public interface InpatientChargeAppMapper {
|
||||
@Param("activity") Integer activity, @Param("medication") Integer medication, @Param("device") Integer device,
|
||||
@Param("register") Integer register, @Param("planned") Integer planned, @Param("billable") Integer billable,
|
||||
@Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
|
||||
@Param("partRefund") Integer partRefund, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
@Param("partRefund") Integer partRefund);
|
||||
}
|
||||
|
||||
@@ -57,4 +57,33 @@ public interface OutpatientChargeAppMapper {
|
||||
@Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
|
||||
@Param("partRefund") Integer partRefund);
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者处方列表并新增字段:应收金额,实收金额,优惠金额,折扣率
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param activity 项目
|
||||
* @param medication 药品
|
||||
* @param device 耗材
|
||||
* @param register 挂号费
|
||||
* @param planned 收费状态:待收费
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunding 收费状态:退费中
|
||||
* @param refunded 收费状态:全部退费
|
||||
* @param partRefund 收费状态:部分退费
|
||||
* @param discountCode 优惠枚举码
|
||||
* @param selfCode 现金枚举码
|
||||
* @param selfVxCode 微信枚举码
|
||||
* @param selfAliCode 支付宝枚举码
|
||||
* @param selfUnionCode 银联枚举码
|
||||
* @return 患者处方列表
|
||||
*/
|
||||
List<EncounterPatientPrescriptionDto> selectEncounterPatientPrescriptionWithPrice(
|
||||
@Param("encounterId") Long encounterId, @Param("activity") Integer activity,
|
||||
@Param("medication") Integer medication, @Param("device") Integer device, @Param("register") Integer register,
|
||||
@Param("planned") Integer planned, @Param("billable") Integer billable, @Param("billed") Integer billed,
|
||||
@Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
|
||||
@Param("partRefund") Integer partRefund, @Param("discountCode") Integer discountCode,
|
||||
@Param("self") Integer selfCode, @Param("selfVx") Integer selfVxCode, @Param("selfAli") Integer selfAliCode,
|
||||
@Param("selfUnion") Integer selfUnionCode);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public interface ICommonService {
|
||||
* @return 库存项目信息
|
||||
*/
|
||||
R<?> getInventoryItemList(InventoryItemParam inventoryItemParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize);
|
||||
Integer pageSize);
|
||||
|
||||
/**
|
||||
* 根据项目相关信息查询项目库存相关信息
|
||||
@@ -188,4 +188,19 @@ public interface ICommonService {
|
||||
* @return 诊疗项目
|
||||
*/
|
||||
R<?> getActivityDefinition();
|
||||
|
||||
/**
|
||||
* 查询备份单号
|
||||
*
|
||||
* @return 备份单号列表
|
||||
*/
|
||||
R<?> getBackupNoList();
|
||||
|
||||
/**
|
||||
* 批号匹配
|
||||
*
|
||||
* @param encounterIdList 就诊id列表
|
||||
* @return 处理结果
|
||||
*/
|
||||
R<?> lotNumberMatch(List<Long> encounterIdList);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
package com.openhis.web.common.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -16,7 +18,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
@@ -33,13 +37,20 @@ import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.document.domain.DocInventoryItemStatic;
|
||||
import com.openhis.document.service.IDocInventoryItemStaticService;
|
||||
import com.openhis.financial.domain.Contract;
|
||||
import com.openhis.financial.mapper.ContractMapper;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.web.chargemanage.dto.ContractMetadata;
|
||||
import com.openhis.web.common.appservice.ICommonService;
|
||||
import com.openhis.web.common.dto.*;
|
||||
import com.openhis.web.common.mapper.CommonAppMapper;
|
||||
import com.openhis.web.pharmacymanage.dto.InventoryDetailDto;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
|
||||
/**
|
||||
@@ -51,6 +62,9 @@ import com.openhis.workflow.service.IInventoryItemService;
|
||||
@Service
|
||||
public class CommonServiceImpl implements ICommonService {
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Resource
|
||||
private TraceNoManageMapper traceNoManageMapper;
|
||||
|
||||
@@ -75,6 +89,15 @@ public class CommonServiceImpl implements ICommonService {
|
||||
@Resource
|
||||
private ISupplierService supplierService;
|
||||
|
||||
@Resource
|
||||
private IDocInventoryItemStaticService iDocInventoryItemStaticService;
|
||||
|
||||
@Resource
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
|
||||
@Resource
|
||||
private IDeviceDispenseService deviceDispenseService;
|
||||
|
||||
/**
|
||||
* 获取药房列表
|
||||
*
|
||||
@@ -93,7 +116,6 @@ public class CommonServiceImpl implements ICommonService {
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
|
||||
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
@@ -241,20 +263,20 @@ public class CommonServiceImpl implements ICommonService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getInventoryItemList(InventoryItemParam inventoryItemParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize) {
|
||||
Integer pageSize) {
|
||||
Integer purchaseFlag = inventoryItemParam.getPurchaseFlag();
|
||||
inventoryItemParam.setPurchaseFlag(null);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<InventoryItemParam> queryWrapper = HisQueryUtils.buildQueryWrapper(inventoryItemParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr,
|
||||
CommonConstants.FieldName.WbStr)),
|
||||
null);
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr,
|
||||
CommonConstants.FieldName.WbStr)),
|
||||
null);
|
||||
// 查询库存项目信息
|
||||
IPage<InventoryItemDto> inventoryItems = commonAppMapper.selectInventoryItemList(new Page<>(pageNo, pageSize),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
ItemType.MEDICINE.getValue(), ItemType.DEVICE.getValue(), purchaseFlag, ConditionCode.PURCHASE.getCode(),
|
||||
PublicationStatus.RETIRED.getValue(), queryWrapper);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
ItemType.MEDICINE.getValue(), ItemType.DEVICE.getValue(), purchaseFlag, ConditionCode.PURCHASE.getCode(),
|
||||
PublicationStatus.RETIRED.getValue(), queryWrapper);
|
||||
List<InventoryItemDto> inventoryItemDtoList = inventoryItems.getRecords();
|
||||
inventoryItemDtoList.forEach(e -> {
|
||||
// 项目类型
|
||||
@@ -281,9 +303,9 @@ public class CommonServiceImpl implements ICommonService {
|
||||
public R<?> getInventoryItemInfo(InventoryItemParam inventoryItemParam) {
|
||||
// 查询项目库存相关信息
|
||||
List<LocationInventoryDto> locationInventoryDtoList = commonAppMapper.selectInventoryItemInfo(
|
||||
inventoryItemParam.getOrgLocationId(), CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, inventoryItemParam.getObjLocationId(),
|
||||
inventoryItemParam.getLotNumber(), inventoryItemParam.getItemId(), ConditionCode.PURCHASE.getCode());
|
||||
inventoryItemParam.getOrgLocationId(), CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, inventoryItemParam.getObjLocationId(),
|
||||
inventoryItemParam.getLotNumber(), inventoryItemParam.getItemId(), ConditionCode.PURCHASE.getCode());
|
||||
|
||||
// 医保编码和生产厂家校验
|
||||
for (LocationInventoryDto dto : locationInventoryDtoList) {
|
||||
@@ -327,7 +349,7 @@ public class CommonServiceImpl implements ICommonService {
|
||||
if (traceNo != null && !StringUtils.isEmpty(traceNo)) {
|
||||
// 数据源更改
|
||||
InventoryItem inventoryItem = inventoryItemService.getOne(
|
||||
new LambdaQueryWrapper<InventoryItem>().like(InventoryItem::getTraceNo, traceNo).last("LIMIT 1"));
|
||||
new LambdaQueryWrapper<InventoryItem>().like(InventoryItem::getTraceNo, traceNo).last("LIMIT 1"));
|
||||
if (inventoryItem != null) {
|
||||
String itemId = inventoryItem.getItemId().toString();
|
||||
// TraceNoManage traceNoManage = commonAppMapper.getInfoByTraceNo("%" + traceNo + "%");
|
||||
@@ -361,11 +383,11 @@ public class CommonServiceImpl implements ICommonService {
|
||||
// 判断传入的是药品还是耗材,查询追溯码状态只有进的数据
|
||||
if (searchTraceNoParam.getItemType().equals(ItemType.MEDICINE.getValue())) {
|
||||
traceNoManageList = traceNoManageMapper.getItemTraceNoInfo(
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, searchTraceNoParam.getItemId(),
|
||||
searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, searchTraceNoParam.getItemId(),
|
||||
searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
} else if (searchTraceNoParam.getItemType().equals(ItemType.DEVICE.getValue())) {
|
||||
traceNoManageList = traceNoManageMapper.getItemTraceNoInfo(CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
searchTraceNoParam.getItemId(), searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
searchTraceNoParam.getItemId(), searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
}
|
||||
if (traceNoManageList != null) {
|
||||
for (TraceNoManage traceNoItem : traceNoManageList) {
|
||||
@@ -383,8 +405,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
@Override
|
||||
public R<?> getContractMetadata() {
|
||||
// TODO: Contract表的基础数据维护还没做,具体不知道状态字段的取值是什么,先查询默认值为0的数据
|
||||
List<Contract> ContractList =
|
||||
contractMapper.selectList(new LambdaQueryWrapper<Contract>().eq(Contract::getStatusEnum, 0));
|
||||
List<Contract> ContractList
|
||||
= contractMapper.selectList(new LambdaQueryWrapper<Contract>().eq(Contract::getStatusEnum, 0));
|
||||
// 复制同名字段并 return
|
||||
return R.ok(ContractList.stream().map(contract -> {
|
||||
ContractMetadata metadata = new ContractMetadata();
|
||||
@@ -421,8 +443,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
Location location = locationService.getById(locationId);
|
||||
// 查询所有子集位置
|
||||
List<Location> childLocations = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.likeRight(Location::getBusNo, location.getBusNo()).eq(Location::getFormEnum, locationForm)
|
||||
.ne(Location::getStatusEnum, LocationStatus.INACTIVE.getValue()));
|
||||
.likeRight(Location::getBusNo, location.getBusNo()).eq(Location::getFormEnum, locationForm)
|
||||
.ne(Location::getStatusEnum, LocationStatus.INACTIVE.getValue()));
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location childLocation : childLocations) {
|
||||
@@ -444,7 +466,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
// 查询当前登录者管理的病区
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
List<Long> locationIds = practitionerRoleService.getLocationIdsByPractitionerId(practitionerId);
|
||||
List<Location> locationList = locationService.getLocationList(locationIds);
|
||||
List<Location> locationList
|
||||
= locationService.getLocationList(locationIds, Collections.singletonList(LocationStatus.ACTIVE.getValue()));
|
||||
List<Location> wardList = new ArrayList<>();
|
||||
for (Location ward : locationList) {
|
||||
if (LocationForm.WARD.getValue().equals(ward.getFormEnum())) {
|
||||
@@ -490,12 +513,16 @@ public class CommonServiceImpl implements ICommonService {
|
||||
advicePrintInfoDto = commonAppMapper.selectTreatmentPrintInfo(requestIds);
|
||||
}
|
||||
advicePrintInfoDto
|
||||
.setAge(advicePrintInfoDto.getBirthDate() != null
|
||||
? AgeCalculatorUtil.getAge(advicePrintInfoDto.getBirthDate()) : "")
|
||||
.setGenderEnum_enumText(
|
||||
EnumUtils.getInfoByValue(AdministrativeGender.class, advicePrintInfoDto.getGenderEnum()))
|
||||
.setEncounterYbClass_enumText(
|
||||
EnumUtils.getInfoByValue(EncounterYbClass.class, advicePrintInfoDto.getEncounterYbClass()));
|
||||
.setAge(advicePrintInfoDto.getBirthDate() != null
|
||||
? AgeCalculatorUtil.getAge(advicePrintInfoDto.getBirthDate()) : "")
|
||||
.setGenderEnum_enumText(
|
||||
EnumUtils.getInfoByValue(AdministrativeGender.class, advicePrintInfoDto.getGenderEnum()))
|
||||
.setEncounterYbClass_enumText(
|
||||
EnumUtils.getInfoByValue(EncounterYbClass.class, advicePrintInfoDto.getEncounterYbClass()));
|
||||
if (advicePrintInfoDto.getChrgitmLv() != null) {
|
||||
advicePrintInfoDto
|
||||
.setChrgitmLv_enumText(EnumUtils.getInfoByValue(InsuranceLevel.class, advicePrintInfoDto.getChrgitmLv()));
|
||||
}
|
||||
return R.ok(advicePrintInfoDto);
|
||||
}
|
||||
|
||||
@@ -518,8 +545,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
@Override
|
||||
public R<?> getSupplierList() {
|
||||
return R.ok(supplierService.list(new LambdaQueryWrapper<Supplier>().select(Supplier::getId, Supplier::getName)
|
||||
.eq(Supplier::getTypeEnum, SupplierType.SUPPLIER.getValue())
|
||||
.eq(Supplier::getDeleteFlag, DelFlag.NO.getCode()).eq(Supplier::getActiveFlag, Whether.YES.getValue())));
|
||||
.eq(Supplier::getTypeEnum, SupplierType.SUPPLIER.getValue())
|
||||
.eq(Supplier::getDeleteFlag, DelFlag.NO.getCode()).eq(Supplier::getActiveFlag, Whether.YES.getValue())));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -532,4 +559,264 @@ public class CommonServiceImpl implements ICommonService {
|
||||
return R.ok(commonAppMapper.getActivityDefinition(PublicationStatus.ACTIVE.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询备份单号
|
||||
*
|
||||
* @return 备份单号列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getBackupNoList() {
|
||||
List<DocInventoryItemStatic> docInventoryItemStaticList
|
||||
= iDocInventoryItemStaticService.list(new LambdaQueryWrapper<DocInventoryItemStatic>()
|
||||
.eq(DocInventoryItemStatic::getDeleteFlag, DelFlag.NO.getCode())
|
||||
.eq(DocInventoryItemStatic::getTenantId, SecurityUtils.getLoginUser().getTenantId()));
|
||||
if (docInventoryItemStaticList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 直接去重并按BusNo倒序排序
|
||||
List<String> busNoList = docInventoryItemStaticList.stream().map(DocInventoryItemStatic::getBusNo).distinct() // 去重
|
||||
.sorted(Comparator.reverseOrder()).collect(Collectors.toList());
|
||||
return R.ok(busNoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批号匹配
|
||||
*
|
||||
* @param encounterIdList 就诊id列表
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> lotNumberMatch(List<Long> encounterIdList) {
|
||||
// 查询患者待发放的药品信息
|
||||
List<MedicationDispense> medicationDispenseList = medicationDispenseService
|
||||
.list(new LambdaQueryWrapper<MedicationDispense>().in(MedicationDispense::getEncounterId, encounterIdList)
|
||||
.eq(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
// 药品批号匹配
|
||||
if (medicationDispenseList != null && !medicationDispenseList.isEmpty()) {
|
||||
// 获取待发放的药品id
|
||||
List<Long> medicationIdList
|
||||
= medicationDispenseList.stream().map(MedicationDispense::getMedicationId).distinct().toList();
|
||||
// 获取发药药房
|
||||
List<Long> locationIdList
|
||||
= medicationDispenseList.stream().map(MedicationDispense::getLocationId).distinct().toList();
|
||||
|
||||
// 查询待发放药品的库存明细
|
||||
List<InventoryDetailDto> inventoryDetailList = commonAppMapper
|
||||
.selectMedicineInventoryDetail(medicationIdList, locationIdList, PublicationStatus.ACTIVE.getValue());
|
||||
if (inventoryDetailList == null || inventoryDetailList.isEmpty()) {
|
||||
return R.fail("发药单生成失败,请检查药品库存");
|
||||
}
|
||||
// 将库存信息根据药品id和库房id进行分组
|
||||
Map<String, List<InventoryDetailDto>> inventoryDetailMap = inventoryDetailList.stream()
|
||||
.collect(Collectors.groupingBy(x -> x.getItemId() + CommonConstants.Common.DASH + x.getLocationId()));
|
||||
// 按照效期排序(先进先出)
|
||||
for (List<InventoryDetailDto> inventoryList : inventoryDetailMap.values()) {
|
||||
inventoryList.sort(Comparator.comparing(InventoryDetailDto::getExpirationDate));
|
||||
}
|
||||
|
||||
// 使用索引循环,以便处理后续添加的拆分单
|
||||
int currentIndex = 0;
|
||||
while (currentIndex < medicationDispenseList.size()) {
|
||||
MedicationDispense medicationDispense = medicationDispenseList.get(currentIndex);
|
||||
currentIndex++;
|
||||
// 根据发放药品和发放药房做key
|
||||
String inventoryKey = medicationDispense.getMedicationId() + CommonConstants.Common.DASH
|
||||
+ medicationDispense.getLocationId();
|
||||
// 查询对应的库存信息
|
||||
if (!inventoryDetailMap.containsKey(inventoryKey)) {
|
||||
return R.fail("药品库存不存在,药品ID: " + medicationDispense.getMedicationId());
|
||||
}
|
||||
List<InventoryDetailDto> inventoryList = inventoryDetailMap.get(inventoryKey);
|
||||
|
||||
// 获取发药数量
|
||||
BigDecimal dispenseQuantity = medicationDispense.getQuantity();
|
||||
// 循环库存信息
|
||||
for (InventoryDetailDto inventoryDetailDto : inventoryList) {
|
||||
// 发药数量不能小于等于0
|
||||
if (dispenseQuantity.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
break;
|
||||
}
|
||||
// 库存剩余数量不能小于等于0
|
||||
if (inventoryDetailDto.getInventoryQuantity().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
continue;
|
||||
}
|
||||
// 发药数量单位转换
|
||||
if (!inventoryDetailDto.getInventoryUnitCode().equals(medicationDispense.getUnitCode())) {
|
||||
dispenseQuantity = dispenseQuantity.multiply(inventoryDetailDto.getPartPercent());
|
||||
}
|
||||
|
||||
// 获取库存剩余数量
|
||||
BigDecimal remainingInventoryQuantity
|
||||
= inventoryDetailDto.getInventoryQuantity().subtract(dispenseQuantity);
|
||||
// 如果剩余库存数量大于等于0,则说明当前批号库存充足
|
||||
if (remainingInventoryQuantity.compareTo(BigDecimal.ZERO) >= 0) {
|
||||
medicationDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
|
||||
// 将该批号的库存数量重置为剩余数量
|
||||
inventoryDetailDto.setInventoryQuantity(remainingInventoryQuantity);
|
||||
} else {
|
||||
// 发药数量单位转换
|
||||
if (!inventoryDetailDto.getInventoryUnitCode().equals(medicationDispense.getUnitCode())) {
|
||||
// 发药数量取库存大单位数量
|
||||
dispenseQuantity = inventoryDetailDto.getInventoryQuantity()
|
||||
.divide(inventoryDetailDto.getPartPercent(), 0, RoundingMode.HALF_UP);
|
||||
// 大单位数量不足则跳出循环
|
||||
if (dispenseQuantity.compareTo(BigDecimal.ZERO) == 0) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// 发药数量取该批号剩余数量
|
||||
dispenseQuantity = inventoryDetailDto.getInventoryQuantity();
|
||||
}
|
||||
|
||||
// 如果剩余数量不足则进行拆分
|
||||
MedicationDispense splitMedicationDispense = new MedicationDispense();
|
||||
BeanUtils.copyProperties(medicationDispense, splitMedicationDispense);
|
||||
// 数量拆分
|
||||
splitMedicationDispense.setQuantity(medicationDispense.getQuantity().subtract(dispenseQuantity))
|
||||
// 重置id与批号
|
||||
.setId(null).setLotNumber(null)
|
||||
// 重新生成发药单编码
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||
// 将拆分出来的发药单添加到原发药单列表中
|
||||
medicationDispenseList.add(splitMedicationDispense);
|
||||
|
||||
// 更新原发药单
|
||||
medicationDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
|
||||
medicationDispense.setQuantity(dispenseQuantity);
|
||||
// 将该批号的库存数量重置为0
|
||||
inventoryDetailDto.setInventoryQuantity(BigDecimal.ZERO);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 校验药品库存
|
||||
for (MedicationDispense medicationDispense : medicationDispenseList) {
|
||||
if (medicationDispense.getLotNumber() == null) {
|
||||
return R.fail("药品:" + medicationDispense.getMedicationId() + "库存不足,请检查药品库存");
|
||||
}
|
||||
}
|
||||
// 新增或更新发药单
|
||||
boolean result = medicationDispenseService.saveOrUpdateBatch(medicationDispenseList);
|
||||
if (!result) {
|
||||
return R.fail("发药单生成失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
// 查询患者待发放的耗材信息
|
||||
List<DeviceDispense> deviceDispenseList = deviceDispenseService
|
||||
.list(new LambdaQueryWrapper<DeviceDispense>().in(DeviceDispense::getEncounterId, encounterIdList)
|
||||
.eq(DeviceDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
// 耗材批号匹配
|
||||
if (deviceDispenseList != null && !deviceDispenseList.isEmpty()) {
|
||||
// 获取待发放的耗材id
|
||||
List<Long> deviceIdList
|
||||
= deviceDispenseList.stream().map(DeviceDispense::getDeviceDefId).distinct().toList();
|
||||
// 获取发耗材房
|
||||
List<Long> locationIdList
|
||||
= deviceDispenseList.stream().map(DeviceDispense::getLocationId).distinct().toList();
|
||||
|
||||
// 查询待发放耗材的库存明细
|
||||
List<InventoryDetailDto> inventoryDetailList = commonAppMapper.selectDeviceInventoryDetail(deviceIdList,
|
||||
locationIdList, PublicationStatus.ACTIVE.getValue());
|
||||
if (inventoryDetailList == null || inventoryDetailList.isEmpty()) {
|
||||
return R.fail("发耗材单生成失败,请检查耗材库存");
|
||||
}
|
||||
// 将库存信息根据耗材id和库房id进行分组
|
||||
Map<String, List<InventoryDetailDto>> inventoryDetailMap = inventoryDetailList.stream()
|
||||
.collect(Collectors.groupingBy(x -> x.getItemId() + CommonConstants.Common.DASH + x.getLocationId()));
|
||||
// 按照效期排序(先进先出)
|
||||
for (List<InventoryDetailDto> inventoryList : inventoryDetailMap.values()) {
|
||||
inventoryList.sort(Comparator.comparing(InventoryDetailDto::getExpirationDate));
|
||||
}
|
||||
|
||||
// 使用索引循环,以便处理后续添加的拆分单
|
||||
int currentIndex = 0;
|
||||
while (currentIndex < deviceDispenseList.size()) {
|
||||
DeviceDispense deviceDispense = deviceDispenseList.get(currentIndex);
|
||||
currentIndex++;
|
||||
// 根据发放耗材和发放耗材房做key
|
||||
String inventoryKey
|
||||
= deviceDispense.getDeviceDefId() + CommonConstants.Common.DASH + deviceDispense.getLocationId();
|
||||
// 查询对应的库存信息
|
||||
if (!inventoryDetailMap.containsKey(inventoryKey)) {
|
||||
return R.fail("耗材库存不存在,耗材ID: " + deviceDispense.getDeviceDefId());
|
||||
}
|
||||
List<InventoryDetailDto> inventoryList = inventoryDetailMap.get(inventoryKey);
|
||||
|
||||
// 获取发耗材数量
|
||||
BigDecimal dispenseQuantity = deviceDispense.getQuantity();
|
||||
// 循环库存信息
|
||||
for (InventoryDetailDto inventoryDetailDto : inventoryList) {
|
||||
// 发耗材数量不能小于等于0
|
||||
if (dispenseQuantity.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
break;
|
||||
}
|
||||
// 库存剩余数量不能小于等于0
|
||||
if (inventoryDetailDto.getInventoryQuantity().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
continue;
|
||||
}
|
||||
// 发耗材数量单位转换
|
||||
if (!inventoryDetailDto.getInventoryUnitCode().equals(deviceDispense.getUnitCode())) {
|
||||
dispenseQuantity = dispenseQuantity.multiply(inventoryDetailDto.getPartPercent());
|
||||
}
|
||||
|
||||
// 获取库存剩余数量
|
||||
BigDecimal remainingInventoryQuantity
|
||||
= inventoryDetailDto.getInventoryQuantity().subtract(dispenseQuantity);
|
||||
// 如果剩余库存数量大于等于0,则说明当前批号库存充足
|
||||
if (remainingInventoryQuantity.compareTo(BigDecimal.ZERO) >= 0) {
|
||||
deviceDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
|
||||
// 将该批号的库存数量重置为剩余数量
|
||||
inventoryDetailDto.setInventoryQuantity(remainingInventoryQuantity);
|
||||
} else {
|
||||
// 发耗材数量单位转换
|
||||
if (!inventoryDetailDto.getInventoryUnitCode().equals(deviceDispense.getUnitCode())) {
|
||||
// 发耗材数量取库存大单位数量
|
||||
dispenseQuantity = inventoryDetailDto.getInventoryQuantity()
|
||||
.divide(inventoryDetailDto.getPartPercent(), 0, RoundingMode.HALF_UP);
|
||||
// 大单位数量不足则跳出循环
|
||||
if (dispenseQuantity.compareTo(BigDecimal.ZERO) == 0) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// 发耗材数量取该批号剩余数量
|
||||
dispenseQuantity = inventoryDetailDto.getInventoryQuantity();
|
||||
}
|
||||
|
||||
// 如果剩余数量不足则进行拆分
|
||||
DeviceDispense splitDeviceDispense = new DeviceDispense();
|
||||
BeanUtils.copyProperties(deviceDispense, splitDeviceDispense);
|
||||
// 数量拆分
|
||||
splitDeviceDispense.setQuantity(deviceDispense.getQuantity().subtract(dispenseQuantity))
|
||||
// 重置id与批号
|
||||
.setId(null).setLotNumber(null)
|
||||
// 重新生成发耗材单编码
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||
// 将拆分出来的发耗材单添加到原发耗材单列表中
|
||||
deviceDispenseList.add(splitDeviceDispense);
|
||||
|
||||
// 更新原发耗材单
|
||||
deviceDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
|
||||
deviceDispense.setQuantity(dispenseQuantity);
|
||||
// 将该批号的库存数量重置为0
|
||||
inventoryDetailDto.setInventoryQuantity(BigDecimal.ZERO);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 校验耗材库存
|
||||
for (DeviceDispense deviceDispense : deviceDispenseList) {
|
||||
if (deviceDispense.getLotNumber() == null) {
|
||||
return R.fail("耗材:" + deviceDispense.getDeviceDefId() + "库存不足,请检查耗材库存");
|
||||
}
|
||||
}
|
||||
// 新增或更新发耗材单
|
||||
boolean result = deviceDispenseService.saveOrUpdateBatch(deviceDispenseList);
|
||||
if (!result) {
|
||||
return R.fail("发耗材单生成失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class CommonAppController {
|
||||
/**
|
||||
* 病区列表
|
||||
*
|
||||
* @return 病区列表
|
||||
* @return 病区列表
|
||||
*/
|
||||
@GetMapping(value = "/ward-list")
|
||||
public R<?> getWardList(@RequestParam(value = "orgId", required = false) Long orgId) {
|
||||
@@ -103,7 +103,7 @@ public class CommonAppController {
|
||||
*/
|
||||
@GetMapping(value = "/department-list")
|
||||
public R<?> getDepartmentList() {
|
||||
return commonService.getDepartmentList();
|
||||
return commonService.getDepartmentList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,9 +117,9 @@ public class CommonAppController {
|
||||
*/
|
||||
@GetMapping(value = "/inventory-item")
|
||||
public R<?> getInventoryItemList(InventoryItemParam inventoryItemParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "50") Integer pageSize) {
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "50") Integer pageSize) {
|
||||
return commonService.getInventoryItemList(inventoryItemParam, searchKey, pageNo, pageSize);
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class CommonAppController {
|
||||
|
||||
/**
|
||||
* 查询参与者下拉列表
|
||||
*
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @return 参与者下拉列表
|
||||
*/
|
||||
@@ -224,7 +224,7 @@ public class CommonAppController {
|
||||
|
||||
/**
|
||||
* 查询参与者签名
|
||||
*
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
* @return 参与者签名
|
||||
*/
|
||||
@@ -253,4 +253,24 @@ public class CommonAppController {
|
||||
return commonService.getActivityDefinition();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询备份单号
|
||||
*
|
||||
* @return 备份单号列表
|
||||
*/
|
||||
@GetMapping(value = "/backup-list")
|
||||
public R<?> getBackupNoList() {
|
||||
return commonService.getBackupNoList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批号匹配
|
||||
*
|
||||
* @param encounterIdList 就诊id列表
|
||||
* @return 处理结果
|
||||
*/
|
||||
@GetMapping("/lot-number-match")
|
||||
public R<?> lotNumberMatch(@RequestParam(value = "encounterIdList") List<Long> encounterIdList) {
|
||||
return commonService.lotNumberMatch(encounterIdList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,4 +92,19 @@ public class AdviceItemPrintInfoDto {
|
||||
* 排序号
|
||||
*/
|
||||
private Integer sortNumber;
|
||||
|
||||
/**
|
||||
* 中药付数
|
||||
*/
|
||||
private BigDecimal chineseHerbsDoseQuantity;
|
||||
|
||||
/**
|
||||
* 医保等级甲乙类
|
||||
*/
|
||||
private String chrgitmLv;
|
||||
|
||||
/**
|
||||
* 是否基药
|
||||
*/
|
||||
private Integer basicFlag;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
@@ -93,6 +91,22 @@ public class AdvicePrintInfoDto {
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/**
|
||||
* 医保等级
|
||||
*/
|
||||
private Integer chrgitmLv;
|
||||
private String chrgitmLv_enumText;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
private String patientId;
|
||||
|
||||
/**
|
||||
* 医嘱项目打印列表
|
||||
*/
|
||||
|
||||
@@ -30,10 +30,14 @@ public class PerformRecordDto {
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 执行时间 */
|
||||
/** 预计执行时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 实际执行时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date recordedTime;
|
||||
|
||||
/** 执行位置 */
|
||||
private String locationName;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.administration.domain.TraceNoManage;
|
||||
import com.openhis.web.common.dto.*;
|
||||
import com.openhis.web.pharmacymanage.dto.InventoryDetailDto;
|
||||
|
||||
/**
|
||||
* app常用接口 mapper
|
||||
@@ -37,10 +38,10 @@ public interface CommonAppMapper {
|
||||
* @return 库存项目信息
|
||||
*/
|
||||
IPage<InventoryItemDto> selectInventoryItemList(@Param("page") Page<InventoryItemDto> page,
|
||||
@Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName,
|
||||
@Param("medicine") Integer medicine, @Param("device") Integer device,
|
||||
@Param("purchaseFlag") Integer purchaseFlag, @Param("purchase") String purchase,
|
||||
@Param("retired") Integer retired, @Param(Constants.WRAPPER) QueryWrapper<InventoryItemParam> queryWrapper);
|
||||
@Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName,
|
||||
@Param("medicine") Integer medicine, @Param("device") Integer device,
|
||||
@Param("purchaseFlag") Integer purchaseFlag, @Param("purchase") String purchase,
|
||||
@Param("retired") Integer retired, @Param(Constants.WRAPPER) QueryWrapper<InventoryItemParam> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询项目库存相关信息
|
||||
@@ -53,9 +54,9 @@ public interface CommonAppMapper {
|
||||
* @return 项目库存相关信息
|
||||
*/
|
||||
List<LocationInventoryDto> selectInventoryItemInfo(@Param("orgLocationId") Long orgLocationId,
|
||||
@Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName,
|
||||
@Param("objLocationId") Long objLocationId, @Param("lotNumber") String lotNumber, @Param("itemId") Long itemId,
|
||||
@Param("purchase") String purchase);
|
||||
@Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName,
|
||||
@Param("objLocationId") Long objLocationId, @Param("lotNumber") String lotNumber, @Param("itemId") Long itemId,
|
||||
@Param("purchase") String purchase);
|
||||
|
||||
/**
|
||||
* 查询追溯码信息
|
||||
@@ -99,9 +100,31 @@ public interface CommonAppMapper {
|
||||
|
||||
/**
|
||||
* 查询所有诊疗项目
|
||||
*
|
||||
*
|
||||
* @param statusEnum 启用状态
|
||||
* @return 诊疗项目
|
||||
*/
|
||||
List<ActivityDefinitionDto> getActivityDefinition(@Param("statusEnum") Integer statusEnum);
|
||||
|
||||
/**
|
||||
* 查询药品库存详细信息
|
||||
*
|
||||
* @param medicationIdList 药品id列表
|
||||
* @param locationIdList 库房id列表
|
||||
* @param active 库存状态:启用
|
||||
* @return 库存详细信息
|
||||
*/
|
||||
List<InventoryDetailDto> selectMedicineInventoryDetail(@Param("medicationIdList") List<Long> medicationIdList,
|
||||
@Param("locationIdList") List<Long> locationIdList, @Param("active") Integer active);
|
||||
|
||||
/**
|
||||
* 查询耗材库存详细信息
|
||||
*
|
||||
* @param deviceIdList 耗材id列表
|
||||
* @param locationIdList 库房id列表
|
||||
* @param active 库存状态:启用
|
||||
* @return 库存详细信息
|
||||
*/
|
||||
List<InventoryDetailDto> selectDeviceInventoryDetail(@Param("deviceIdList") List<Long> deviceIdList,
|
||||
@Param("locationIdList") List<Long> locationIdList, @Param("active") Integer active);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.core.common.enums.DelFlag;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -25,7 +26,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.core.common.enums.DeleteFlag;
|
||||
import com.core.common.utils.*;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
@@ -111,8 +111,8 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
|
||||
// 获取状态
|
||||
List<DeviceManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
|
||||
// // 获取执行科室
|
||||
@@ -128,28 +128,27 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// .map(category -> new DeviceManageInitDto.deviceCategory(category.getValue(), category.getInfo()))
|
||||
// .collect(Collectors.toList());
|
||||
// deviceManageInitDto.setDeviceCategories(deviceCategories);
|
||||
|
||||
// 获取器材
|
||||
List<SysDictData> deviceList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DEVICE_CATEGORY_CODE);
|
||||
List<SysDictData> deviceList
|
||||
= sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DEVICE_CATEGORY_CODE);
|
||||
// 从字典中获取器材分类
|
||||
List<DeviceManageInitDto.dictCategoryCode> deviceCategories = deviceList.stream()
|
||||
.map(category -> new DeviceManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
.map(category -> new DeviceManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setDeviceCategories(deviceCategories);
|
||||
|
||||
// 获取医保是否对码
|
||||
List<DeviceManageInitDto.statusEnumOption> statusYBWeatherOption = Stream.of(Whether.values())
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setStatusYBWeatherOptions(statusYBWeatherOption);
|
||||
|
||||
// 查询供应商列表
|
||||
List<Supplier> supplierList = supplierService.getList();
|
||||
// 供应商信息
|
||||
List<DeviceManageInitDto.supplierListOption> supplierListOptions = supplierList.stream()
|
||||
.map(supplier -> new DeviceManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
.map(supplier -> new DeviceManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setSupplierListOptions(supplierListOptions);
|
||||
|
||||
return R.ok(deviceManageInitDto);
|
||||
@@ -166,15 +165,15 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDevicePage(DeviceManageSelParam deviceManageSelParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DeviceManageDto> queryWrapper = HisQueryUtils.buildQueryWrapper(deviceManageSelParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
|
||||
// 分页查询
|
||||
IPage<DeviceManageDto> deviceManagePage =
|
||||
deviceManageMapper.getDevicePage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
IPage<DeviceManageDto> deviceManagePage
|
||||
= deviceManageMapper.getDevicePage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
deviceManagePage.getRecords().forEach(e -> {
|
||||
// 高值器材标志枚举类回显赋值
|
||||
@@ -216,8 +215,8 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(deviceDefinition.getYbNo())) {
|
||||
R<?> r =
|
||||
ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
R<?> r
|
||||
= ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
@@ -225,29 +224,29 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(deviceManageDto.getYbType()).setTypeCode(deviceManageDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageDto.getRetailPrice())
|
||||
.setChargeName(deviceManageDto.getName());;
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageDto.getRetailPrice())
|
||||
.setChargeName(deviceManageDto.getName());;
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
// 更新价格表
|
||||
boolean upItemDef = itemDefinitionServic.updateItem(chargeItemDefinition);
|
||||
|
||||
// 更新子表,修改购入价,条件:采购
|
||||
boolean upItemDetail1 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
deviceManageDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
deviceManageDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail2 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
deviceManageDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
deviceManageDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail3 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
deviceManageDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
deviceManageDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
|
||||
// 更新价格表
|
||||
return upItemDef && upItemDetail1 && upItemDetail2 && upItemDetail3
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
@@ -285,12 +284,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
|
||||
// 更新器材信息
|
||||
return deviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -311,12 +310,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
|
||||
// 更新器材信息
|
||||
return deviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,27 +340,27 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(deviceDefinition.getYbNo())) {
|
||||
R<?> r =
|
||||
ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
R<?> r
|
||||
= ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.INSERT.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(deviceManageUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setTypeCode(deviceManageUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(deviceManageUpDto.getName())
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageUpDto.getRetailPrice());
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(deviceManageUpDto.getName())
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageUpDto.getRetailPrice());
|
||||
|
||||
return itemDefinitionServic.addItem(itemUpFromDirectoryDto)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
@@ -388,21 +387,21 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 查询机构ID、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId));
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
|
||||
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
|
||||
Map<String, List<Location>> locationNameMap =
|
||||
locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
Map<String, List<Location>> locationNameMap
|
||||
= locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
// 创建表数据
|
||||
for (DeviceImportDto importDto : importDtoList) {
|
||||
// 创建器材定义
|
||||
DeviceDefinition deviceDefinition =
|
||||
createDeviceDefinitionEntity(importDto, orgId, defaultLocationId, locationNameMap);
|
||||
DeviceDefinition deviceDefinition
|
||||
= createDeviceDefinitionEntity(importDto, orgId, defaultLocationId, locationNameMap);
|
||||
deviceDefinitionService.save(deviceDefinition);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -429,7 +428,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
List<DeviceRequest> deviceRequestList = deviceRequestService.getDevRequestByDeviceId(deviceId);
|
||||
if (!deviceRequestList.isEmpty()) {
|
||||
if (deviceRequestList.stream()
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
return R.ok(1, "医生开过该耗材,不可编辑");
|
||||
} else {
|
||||
// 校验是否可以编辑
|
||||
@@ -555,7 +554,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
@@ -564,12 +563,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<DeviceImportDto>> importDtoGroupList = new ArrayList<>(importDtoList.stream()
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getSize())).values());
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getSize())).values());
|
||||
for (List<DeviceImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList.add(
|
||||
"■ 第" + importDtoGroup.stream().map(DeviceImportDto::getLineNumber).sorted().map(Object::toString)
|
||||
.collect(Collectors.joining(",")) + "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
"■ 第" + importDtoGroup.stream().map(DeviceImportDto::getLineNumber).sorted().map(Object::toString)
|
||||
.collect(Collectors.joining(",")) + "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -579,12 +578,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (DeviceImportDto importDto : importDtoList) {
|
||||
List<DeviceDefinition> deviceDefinitionList = deviceDefinitionService
|
||||
.list(new LambdaQueryWrapper<DeviceDefinition>().eq(DeviceDefinition::getName, importDto.getName())
|
||||
.eq(DeviceDefinition::getManufacturerText, importDto.getManufacturerText())
|
||||
.eq(DeviceDefinition::getSize, importDto.getSize()));
|
||||
.list(new LambdaQueryWrapper<DeviceDefinition>().eq(DeviceDefinition::getName, importDto.getName())
|
||||
.eq(DeviceDefinition::getManufacturerText, importDto.getManufacturerText())
|
||||
.eq(DeviceDefinition::getSize, importDto.getSize()));
|
||||
if (!deviceDefinitionList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
if (!dbRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -603,7 +602,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
* @return 器材定义实体
|
||||
*/
|
||||
private DeviceDefinition createDeviceDefinitionEntity(DeviceImportDto importDto, Long orgId, Long defaultLocationId,
|
||||
Map<String, List<Location>> locationNameMap) {
|
||||
Map<String, List<Location>> locationNameMap) {
|
||||
DeviceDefinition deviceDefinition = new DeviceDefinition();
|
||||
// 根据输入的所在位置名称获取位置ID
|
||||
List<Location> mapLocationList = locationNameMap.get(importDto.getLocationName());
|
||||
@@ -613,20 +612,20 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
deviceDefinition.setLocationId(mapLocationList.get(0).getId());
|
||||
}
|
||||
deviceDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_NUM.getPrefix(), 10))
|
||||
.setName(importDto.getName()).setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setTypeCode(importDto.getTypeCode())
|
||||
.setUnitCode(importDto.getUnitCode()).setSize(importDto.getSize())
|
||||
.setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity())
|
||||
.setPartPercent(importDto.getPartPercent()).setMinUnitCode(importDto.getMinUnitCode()).setOrgId(orgId)
|
||||
.setHvcmFlag(CommonUtil.tryParseInt(importDto.getHvcmFlag())).setSalesUnitCode(importDto.getSalesUnitCode())
|
||||
.setApprovalNumber(importDto.getApprovalNumber()).setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag()))
|
||||
.setYbNo(importDto.getYbNo()).setYbOrgNo(importDto.getYbOrgNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue()).setManufacturerText(importDto.getManufacturerText())
|
||||
.setAllergenFlag(CommonUtil.tryParseInt(importDto.getAllergenFlag()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag()));
|
||||
.setName(importDto.getName()).setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setTypeCode(importDto.getTypeCode())
|
||||
.setUnitCode(importDto.getUnitCode()).setSize(importDto.getSize())
|
||||
.setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity())
|
||||
.setPartPercent(importDto.getPartPercent()).setMinUnitCode(importDto.getMinUnitCode()).setOrgId(orgId)
|
||||
.setHvcmFlag(CommonUtil.tryParseInt(importDto.getHvcmFlag())).setSalesUnitCode(importDto.getSalesUnitCode())
|
||||
.setApprovalNumber(importDto.getApprovalNumber()).setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag()))
|
||||
.setYbNo(importDto.getYbNo()).setYbOrgNo(importDto.getYbOrgNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue()).setManufacturerText(importDto.getManufacturerText())
|
||||
.setAllergenFlag(CommonUtil.tryParseInt(importDto.getAllergenFlag()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag()));
|
||||
return deviceDefinition;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,26 +87,26 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
DiagnosisTreatmentInitDto diagnosisTreatmentInitDto = new DiagnosisTreatmentInitDto();
|
||||
// 获取状态
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
// 获取执行科室
|
||||
LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Organization::getTypeEnum, OrganizationType.DEPARTMENT);
|
||||
List<Organization> organizations = organizationService.list(queryWrapper);
|
||||
List<DiagnosisTreatmentInitDto.exeOrganization> exeOrganizations = organizations.stream()
|
||||
.map(exeOrg -> new DiagnosisTreatmentInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName()))
|
||||
.collect(Collectors.toList());
|
||||
.map(exeOrg -> new DiagnosisTreatmentInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setExeOrganizations(exeOrganizations);
|
||||
|
||||
// 获取诊目录疗分类
|
||||
List<SysDictData> diagnosisList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DIAGNOSIS_CATEGORY_CODE);
|
||||
List<SysDictData> diagnosisList
|
||||
= sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DIAGNOSIS_CATEGORY_CODE);
|
||||
// 获取诊疗录疗分类
|
||||
List<DiagnosisTreatmentInitDto.dictCategoryCode> diagnosisCategories = diagnosisList.stream()
|
||||
.map(category -> new DiagnosisTreatmentInitDto.dictCategoryCode(category.getDictValue(),
|
||||
.map(category -> new DiagnosisTreatmentInitDto.dictCategoryCode(category.getDictValue(),
|
||||
category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setDiagnosisCategoryOptions(diagnosisCategories);
|
||||
|
||||
// // 查询医疗服务项类型
|
||||
@@ -143,18 +143,17 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
// diseaseTreatmentCategories.add(diseaseTreatmentCategory2);
|
||||
//
|
||||
// diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories);
|
||||
|
||||
// 获取类型
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> typeEnumOptions = Stream.of(ActivityType.values())
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setTypeEnumOptions(typeEnumOptions);
|
||||
|
||||
// 获取是/否 列表
|
||||
// 获取状态
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> statusWeatherOption = Stream.of(Whether.values())
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setStatusWeatherOption(statusWeatherOption);
|
||||
|
||||
return R.ok(diagnosisTreatmentInitDto);
|
||||
@@ -171,15 +170,15 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DiagnosisTreatmentDto> queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
|
||||
// 分页查询
|
||||
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage =
|
||||
activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<DiagnosisTreatmentDto>(pageNo, pageSize), queryWrapper);
|
||||
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage
|
||||
= activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<DiagnosisTreatmentDto>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
diseaseTreatmentPage.getRecords().forEach(e -> {
|
||||
// 医保标记枚举类回显赋值
|
||||
@@ -237,7 +236,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
activityDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
@@ -245,27 +244,27 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(diagnosisTreatmentUpDto.getYbType())
|
||||
.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setInstanceId(diagnosisTreatmentUpDto.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setChargeName(diagnosisTreatmentUpDto.getName());
|
||||
.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setInstanceId(diagnosisTreatmentUpDto.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode()).setChargeName(diagnosisTreatmentUpDto.getName());
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
|
||||
// 更新价格表
|
||||
boolean upItemDef = itemDefinitionService.updateItem(chargeItemDefinition);
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail1 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||
diagnosisTreatmentUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
diagnosisTreatmentUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail2 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
|
||||
// 更新价格表
|
||||
return upItemDef && upItemDetail1 && upItemDetail2
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
@@ -291,11 +290,11 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
// 更新诊疗信息
|
||||
return activityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
}
|
||||
|
||||
@@ -319,11 +318,11 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
// 更新诊疗信息
|
||||
return activityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
}
|
||||
|
||||
@@ -359,27 +358,28 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
activityDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.INSERT.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setUnitCode(diagnosisTreatmentUpDto.getPermittedUnitCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(diagnosisTreatmentUpDto.getName())
|
||||
.setInstanceId(activityDefinition.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice());
|
||||
.setUnitCode(diagnosisTreatmentUpDto.getPermittedUnitCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(diagnosisTreatmentUpDto.getName())
|
||||
.setInstanceId(activityDefinition.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode());
|
||||
|
||||
return itemDefinitionService.addItem(itemUpFromDirectoryDto)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
@@ -395,8 +395,8 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
@Override
|
||||
public R<?> importData(MultipartFile file) {
|
||||
// 读取文件
|
||||
R<List<DiagnosisTreatmentImportDto>> readResult =
|
||||
CommonUtil.readImportedExcelFile(file, DiagnosisTreatmentImportDto.class);
|
||||
R<List<DiagnosisTreatmentImportDto>> readResult
|
||||
= CommonUtil.readImportedExcelFile(file, DiagnosisTreatmentImportDto.class);
|
||||
if (R.SUCCESS != readResult.getCode()) {
|
||||
return readResult;
|
||||
}
|
||||
@@ -415,9 +415,9 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
activityDefinitionService.save(activityDefinition);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getPermittedUnitCode(), null, importDto.getRetailPrice(),
|
||||
importDto.getMaximumRetailPrice(), orgId, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
importDto.getYbType(), importDto.getPermittedUnitCode(), null, importDto.getRetailPrice(),
|
||||
importDto.getMaximumRetailPrice(), orgId, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -445,8 +445,8 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
List<ServiceRequest> serviceRequestList = serviceRequestService.getServiceRequestByActivityId(activityId);
|
||||
if (!serviceRequestList.isEmpty()) {
|
||||
if (serviceRequestList.stream().anyMatch(
|
||||
serviceRequest -> RequestStatus.COMPLETED.getValue().equals(serviceRequest.getStatusEnum()))) {
|
||||
return R.ok(1,"医生开过该诊疗项目,不可编辑");
|
||||
serviceRequest -> RequestStatus.COMPLETED.getValue().equals(serviceRequest.getStatusEnum()))) {
|
||||
return R.ok(1, "医生开过该诊疗项目,不可编辑");
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
@@ -513,7 +513,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
@@ -522,13 +522,13 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<DiagnosisTreatmentImportDto>> importDtoGroupList = new ArrayList<>(
|
||||
importDtoList.stream().collect(Collectors.groupingBy(DiagnosisTreatmentImportDto::getName)).values());
|
||||
importDtoList.stream().collect(Collectors.groupingBy(DiagnosisTreatmentImportDto::getName)).values());
|
||||
for (List<DiagnosisTreatmentImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList.add("■ 第"
|
||||
+ importDtoGroup.stream().map(DiagnosisTreatmentImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
+ importDtoGroup.stream().map(DiagnosisTreatmentImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -538,10 +538,10 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (DiagnosisTreatmentImportDto importDto : importDtoList) {
|
||||
List<ActivityDefinition> deviceDefinitionList = activityDefinitionService.list(
|
||||
new LambdaQueryWrapper<ActivityDefinition>().eq(ActivityDefinition::getName, importDto.getName()));
|
||||
new LambdaQueryWrapper<ActivityDefinition>().eq(ActivityDefinition::getName, importDto.getName()));
|
||||
if (!deviceDefinitionList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
if (!dbRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -560,14 +560,14 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
private ActivityDefinition createActivityDefinitionEntity(DiagnosisTreatmentImportDto importDto, Long orgId) {
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
activityDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10))
|
||||
.setName(importDto.getName()).setCategoryCode(importDto.getCategoryCode())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setPermittedUnitCode(importDto.getPermittedUnitCode()).setOrgId(orgId)
|
||||
.setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag())).setYbNo(importDto.getYbNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()));
|
||||
.setName(importDto.getName()).setCategoryCode(importDto.getCategoryCode())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setPermittedUnitCode(importDto.getPermittedUnitCode()).setOrgId(orgId)
|
||||
.setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag())).setYbNo(importDto.getYbNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()));
|
||||
return activityDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +109,7 @@ public class ItemDefinitionServiceImpl implements IItemDefinitionService {
|
||||
.set(ChargeItemDefinition::getYbType, chargeItemDefinition.getYbType())
|
||||
.set(ChargeItemDefinition::getTypeCode, chargeItemDefinition.getTypeCode())
|
||||
.set(ChargeItemDefinition::getPrice, chargeItemDefinition.getPrice())
|
||||
.set(ChargeItemDefinition::getPriceCode, chargeItemDefinition.getPriceCode())
|
||||
.set(ChargeItemDefinition::getChargeName, chargeItemDefinition.getChargeName());
|
||||
|
||||
return chargeItemDefinitionService.update(null, updateWrapper);
|
||||
|
||||
@@ -12,6 +12,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.core.common.enums.DelFlag;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -24,7 +25,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.core.common.enums.DeleteFlag;
|
||||
import com.core.common.utils.*;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
@@ -115,53 +115,53 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto();
|
||||
// 获取状态,从枚举里面取下拉值
|
||||
List<MedicationManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
// 获取适用范围
|
||||
List<MedicationManageInitDto.domainEnumOption> domainEnumOptions = Stream.of(ApplicableScope.values())
|
||||
.map(domain -> new MedicationManageInitDto.domainEnumOption(domain.getValue(), domain.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(domain -> new MedicationManageInitDto.domainEnumOption(domain.getValue(), domain.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
// 查询供应商列表
|
||||
List<Supplier> supplierList = supplierService.getList();
|
||||
// 供应商信息
|
||||
List<MedicationManageInitDto.supplierListOption> supplierListOptions = supplierList.stream()
|
||||
.map(supplier -> new MedicationManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
.map(supplier -> new MedicationManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取药品分类
|
||||
List<SysDictData> medicalList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.MED_CATEGORY_CODE);
|
||||
List<SysDictData> medicalList
|
||||
= sysDictTypeService.selectDictDataByType(CommonConstants.DictName.MED_CATEGORY_CODE);
|
||||
// 获取药品分类
|
||||
List<MedicationManageInitDto.dictCategoryCode> medicationCategories = medicalList.stream().map(
|
||||
category -> new MedicationManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
category -> new MedicationManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取是/否 列表
|
||||
// 获取状态
|
||||
List<MedicationManageInitDto.statusEnumOption> statusWeatherOption = Stream.of(Whether.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 权限限制
|
||||
List<MedicationManageInitDto.statusEnumOption> statusRestrictedOptions = Stream.of(PermissionLimit.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 拆分属性
|
||||
List<MedicationManageInitDto.statusEnumOption> partAttributeEnumOptions = Stream.of(SplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 住院临时医嘱拆分属性的枚举
|
||||
List<MedicationManageInitDto.statusEnumOption> tempOrderSplitPropertyOptions =
|
||||
Stream.of(TempOrderSplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 权限限制
|
||||
List<MedicationManageInitDto.statusEnumOption> statusRestrictedOptions = Stream.of(PermissionLimit.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 拆分属性
|
||||
List<MedicationManageInitDto.statusEnumOption> partAttributeEnumOptions = Stream.of(SplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 住院临时医嘱拆分属性的枚举
|
||||
List<MedicationManageInitDto.statusEnumOption> tempOrderSplitPropertyOptions
|
||||
= Stream.of(TempOrderSplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 医保等级List
|
||||
List<MedicationManageInitDto.statusEnumOption> chrgitmLvOptions = Stream.of(InsuranceLevel.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
medicationManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
medicationManageInitDto.setDomainFlagOptions(domainEnumOptions);
|
||||
@@ -187,18 +187,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicationList(MedicationSearchParam medicationSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<MedicationManageDto> queryWrapper = HisQueryUtils.buildQueryWrapper(medicationSearchParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("name", "name_en", "merchandise_name", "bus_no", "py_str", "wb_str",
|
||||
"merchandise_py_str", "merchandise_wb_str")),
|
||||
null);
|
||||
searchKey, new HashSet<>(Arrays.asList("name", "name_en", "merchandise_name", "bus_no", "py_str", "wb_str",
|
||||
"merchandise_py_str", "merchandise_wb_str")),
|
||||
null);
|
||||
|
||||
IPage<MedicationManageDto> medicationManageDtoPage =
|
||||
medicationManageSearchMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
IPage<MedicationManageDto> medicationManageDtoPage
|
||||
= medicationManageSearchMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
// 枚举类回显赋值
|
||||
medicationManageDtoPage.getRecords().forEach(e -> {
|
||||
@@ -229,10 +229,10 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
e.setBasicFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getBasicFlag()));
|
||||
// 拆分分属性
|
||||
e.setPartAttributeEnum_enumText(
|
||||
EnumUtils.getInfoByValue(SplitPropertyCode.class, e.getPartAttributeEnum()));
|
||||
EnumUtils.getInfoByValue(SplitPropertyCode.class, e.getPartAttributeEnum()));
|
||||
// 住院临时医嘱拆分属性
|
||||
e.setThoPartAttributeEnum_enumText(
|
||||
EnumUtils.getInfoByValue(TempOrderSplitPropertyCode.class, e.getThoPartAttributeEnum()));
|
||||
EnumUtils.getInfoByValue(TempOrderSplitPropertyCode.class, e.getThoPartAttributeEnum()));
|
||||
// // 活动标记
|
||||
// e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||
|
||||
@@ -260,18 +260,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 拼音码
|
||||
medicationDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getName()));
|
||||
medicationDefinition
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
// 五笔码
|
||||
medicationDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getName()));
|
||||
medicationDefinition
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(medicationManageUpDto.getYbType())
|
||||
.setTypeCode(medicationManageUpDto.getTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setInstanceId(medicationManageUpDto.getMedicationDefId()).setPrice(medicationManageUpDto.getRetailPrice())
|
||||
.setChargeName(medicationManageUpDto.getName());
|
||||
.setTypeCode(medicationManageUpDto.getTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setInstanceId(medicationManageUpDto.getMedicationDefId()).setPrice(medicationManageUpDto.getRetailPrice())
|
||||
.setChargeName(medicationManageUpDto.getName());
|
||||
|
||||
// 更新子表药品信息
|
||||
if (medicationService.updateById(medication)) {
|
||||
@@ -279,11 +279,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
boolean updateMedicationDefinition = medicationDefinitionService.updateById(medicationDefinition);
|
||||
if (updateMedicationDefinition) {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch =
|
||||
SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
String ybSwitch
|
||||
= SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(medicationDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
medicationDefinition.getId());
|
||||
medicationDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
@@ -292,24 +292,24 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medication);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medication);
|
||||
// Todo:封装一个价格初始话的方法给app层调用
|
||||
// 更新价格表
|
||||
boolean updateChargeItemDefinition = itemDefinitionServic.updateItem(chargeItemDefinition);
|
||||
// 更新子表,修改购入价,条件:采购
|
||||
boolean upItemDetail1 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
medicationManageUpDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
medicationManageUpDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail2 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
medicationManageUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
medicationManageUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail3 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
medicationManageUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
medicationManageUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
|
||||
return (updateMedicationDefinition && updateChargeItemDefinition && upItemDetail1 && upItemDetail2
|
||||
&& upItemDetail3)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
&& upItemDetail3)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
} else {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
@@ -353,11 +353,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// TODO:别用三元,日志在业务代码以后记录
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
// 更新药品信息
|
||||
return medicationService.updateBatchById(medicationList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,11 +379,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
// 更新药品信息
|
||||
return medicationService.updateBatchById(medicationList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,11 +403,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 拼音码
|
||||
medicationDetail.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getName()));
|
||||
medicationDetail
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
// 五笔码
|
||||
medicationDetail.setWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getName()));
|
||||
medicationDetail
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
|
||||
// 新增主表外来药品目录
|
||||
if (medicationDefinitionService.addMedication(medicationDetail)) {
|
||||
@@ -415,31 +415,31 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(medicationDetail.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
medicationDetail.getId());
|
||||
medicationDetail.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.INSERT.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDetail);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDetail);
|
||||
// 新增子表外来药品目录
|
||||
boolean insertMedicationSuccess = medicationService.addMedication(medicationDetail);
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(medicationManageUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setInstanceId(medicationDetail.getMedicationDefId())
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setOrgId(SecurityUtils.getLoginUser().getOrgId())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(medicationDetail.getName())
|
||||
.setPrice(medicationManageUpDto.getRetailPrice());
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setOrgId(SecurityUtils.getLoginUser().getOrgId())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(medicationDetail.getName())
|
||||
.setPrice(medicationManageUpDto.getRetailPrice());
|
||||
|
||||
// 添加药品成功后,添加相应的条件价格表信息
|
||||
boolean insertItemDefinitionSuccess = itemDefinitionServic.addItem(itemUpFromDirectoryDto);
|
||||
|
||||
return (insertMedicationSuccess && insertItemDefinitionSuccess)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
} else {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
@@ -447,11 +447,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
@Override
|
||||
public R<?> exportMedication(String searchKey, Integer ybMatchFlag, Integer statusEnum, String categoryCode,
|
||||
HttpServletResponse response) {
|
||||
HttpServletResponse response) {
|
||||
// 获取租户ID
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
List<MedicationManageDto> list =
|
||||
medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
List<MedicationManageDto> list
|
||||
= medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
ExcelUtil<MedicationManageDto> util = new ExcelUtil<>(MedicationManageDto.class);
|
||||
util.exportExcel(response, list, "药品目录");
|
||||
return null;
|
||||
@@ -479,24 +479,24 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 查询机构ID、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId));
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
|
||||
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
|
||||
Map<String, List<Location>> locationNameMap =
|
||||
locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
Map<String, List<Location>> locationNameMap
|
||||
= locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
// 创建表数据
|
||||
for (MedicationImportDto importDto : importDtoList) {
|
||||
// 创建药品定义
|
||||
MedicationDefinition medicationDefinition = createMedicationDefinitionEntity(importDto);
|
||||
medicationDefinitionService.save(medicationDefinition);
|
||||
// 创建药品
|
||||
Medication medication =
|
||||
createMedicationEntity(importDto, medicationDefinition.getId(), defaultLocationId, locationNameMap);
|
||||
Medication medication
|
||||
= createMedicationEntity(importDto, medicationDefinition.getId(), defaultLocationId, locationNameMap);
|
||||
medicationService.save(medication);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDefinition.getId());
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -520,11 +520,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> validateMedicationEdit(Long medicationId) {
|
||||
List<MedicationRequest> medicationRequestList =
|
||||
medicationRequestService.getMedRequestByMedicationId(medicationId);
|
||||
List<MedicationRequest> medicationRequestList
|
||||
= medicationRequestService.getMedRequestByMedicationId(medicationId);
|
||||
if (!medicationRequestList.isEmpty()) {
|
||||
if (medicationRequestList.stream()
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
return R.ok(1, "医生开过该药品,不可编辑");
|
||||
} else {
|
||||
// 校验是否可以编辑
|
||||
@@ -539,7 +539,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
/**
|
||||
* 导入信息校验
|
||||
*
|
||||
*
|
||||
* @param importDtoList 药品目录导入数据列表
|
||||
*/
|
||||
private R<?> validateImportDtoList(List<MedicationImportDto> importDtoList) {
|
||||
@@ -556,9 +556,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
lineValidateMsgList.add("药品分类必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getYbMatchFlag())
|
||||
&& !MedCategoryCode.TRADITIONAL_CHINESE_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.WESTERN_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.CHINESE_HERBAL_MEDICINE.getValue().equals(importDto.getCategoryCode())) {
|
||||
&& !MedCategoryCode.TRADITIONAL_CHINESE_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.WESTERN_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.CHINESE_HERBAL_MEDICINE.getValue().equals(importDto.getCategoryCode())) {
|
||||
lineValidateMsgList.add("医保药的药品分类只能选择中成药、西药或中草药;");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getMerchandiseName())) {
|
||||
@@ -602,7 +602,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
lineValidateMsgList.add("是否限制使用必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getRestrictedFlag())
|
||||
&& StringUtils.isEmpty(importDto.getRestrictedScope())) {
|
||||
&& StringUtils.isEmpty(importDto.getRestrictedScope())) {
|
||||
lineValidateMsgList.add("限制使用时,限制使用范围必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getChildrenFlag())) {
|
||||
@@ -615,7 +615,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
lineValidateMsgList.add("是否抗生素必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getAntibioticFlag())
|
||||
&& StringUtils.isEmpty(importDto.getAntibioticCode())) {
|
||||
&& StringUtils.isEmpty(importDto.getAntibioticCode())) {
|
||||
lineValidateMsgList.add("为抗生素时,抗生素分类必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getSelfFlag())) {
|
||||
@@ -728,7 +728,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
@@ -737,15 +737,15 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<MedicationImportDto>> importDtoGroupList = new ArrayList<>(importDtoList.stream()
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getTotalVolume())).values());
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getTotalVolume())).values());
|
||||
for (List<MedicationImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList
|
||||
.add(
|
||||
"■ 第"
|
||||
+ importDtoGroup.stream().map(MedicationImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
.add(
|
||||
"■ 第"
|
||||
+ importDtoGroup.stream().map(MedicationImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -755,18 +755,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (MedicationImportDto importDto : importDtoList) {
|
||||
List<MedicationDefinition> medicationDefinitionList = medicationDefinitionService.list(
|
||||
new LambdaQueryWrapper<MedicationDefinition>().eq(MedicationDefinition::getName, importDto.getName())
|
||||
.eq(MedicationDefinition::getManufacturerText, importDto.getManufacturerText()));
|
||||
new LambdaQueryWrapper<MedicationDefinition>().eq(MedicationDefinition::getName, importDto.getName())
|
||||
.eq(MedicationDefinition::getManufacturerText, importDto.getManufacturerText()));
|
||||
if (!medicationDefinitionList.isEmpty()) {
|
||||
List<Medication> medicationList =
|
||||
medicationService.list(new LambdaQueryWrapper<Medication>()
|
||||
.in(Medication::getMedicationDefId,
|
||||
medicationDefinitionList.stream().map(MedicationDefinition::getId)
|
||||
.collect(Collectors.toList()))
|
||||
.eq(Medication::getTotalVolume, importDto.getTotalVolume()));
|
||||
List<Medication> medicationList
|
||||
= medicationService.list(new LambdaQueryWrapper<Medication>()
|
||||
.in(Medication::getMedicationDefId,
|
||||
medicationDefinitionList.stream().map(MedicationDefinition::getId)
|
||||
.collect(Collectors.toList()))
|
||||
.eq(Medication::getTotalVolume, importDto.getTotalVolume()));
|
||||
if (!medicationList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -778,48 +778,48 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
/**
|
||||
* 创建药品定义实体
|
||||
*
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @return 药品定义实体
|
||||
*/
|
||||
private MedicationDefinition createMedicationDefinitionEntity(MedicationImportDto importDto) {
|
||||
MedicationDefinition medicationDefinition = new MedicationDefinition();
|
||||
medicationDefinition.setName(importDto.getName())
|
||||
.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_NUM.getPrefix(), 10)).setDomainEnum(1)
|
||||
.setVersion(importDto.getVersion()).setNameEn(importDto.getNameEn())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setMerchandiseName(importDto.getMerchandiseName())
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setUnitCode(importDto.getUnitCode()).setMinUnitCode(importDto.getMinUnitCode())
|
||||
.setPartPercent(importDto.getPartPercent()).setDoseFrom(CommonUtil.tryParseInt(importDto.getDoseFrom()))
|
||||
.setApprovalNumber(importDto.getApprovalNumber())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())).setYbNo(importDto.getYbNo())
|
||||
.setPharmacologyCategoryCode(importDto.getPharmacologyCategoryCode())
|
||||
.setSkinTestFlag(CommonUtil.tryParseInt(importDto.getSkinTestFlag()))
|
||||
.setInjectFlag(CommonUtil.tryParseInt(importDto.getInjectFlag()))
|
||||
.setManufacturerText(importDto.getManufacturerText())
|
||||
.setRestrictedFlag(CommonUtil.tryParseInt(importDto.getRestrictedFlag()))
|
||||
.setRestrictedScope(importDto.getRestrictedScope()).setActiveFlag(Whether.YES.getValue())
|
||||
.setChildrenFlag(CommonUtil.tryParseInt(importDto.getChildrenFlag()))
|
||||
.setNationalDrugCode(importDto.getNationalDrugCode())
|
||||
.setPartAttributeEnum(CommonUtil.tryParseInt(importDto.getPartAttributeEnum()))
|
||||
.setAntibioticCode(importDto.getAntibioticCode())
|
||||
.setSelfFlag(CommonUtil.tryParseInt(importDto.getSelfFlag()))
|
||||
.setAntibioticFlag(CommonUtil.tryParseInt(importDto.getAntibioticFlag()))
|
||||
.setBasicFlag(CommonUtil.tryParseInt(importDto.getBasicFlag()))
|
||||
.setThoPartAttributeEnum(CommonUtil.tryParseInt(importDto.getThoPartAttributeEnum()))
|
||||
.setUnitConversionRatio(importDto.getUnitConversionRatio())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag())).setItemMinQuantity(importDto.getItemMinQuantity())
|
||||
.setItemMaxQuantity(importDto.getItemMaxQuantity());
|
||||
.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_NUM.getPrefix(), 10)).setDomainEnum(1)
|
||||
.setVersion(importDto.getVersion()).setNameEn(importDto.getNameEn())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setMerchandiseName(importDto.getMerchandiseName())
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setUnitCode(importDto.getUnitCode()).setMinUnitCode(importDto.getMinUnitCode())
|
||||
.setPartPercent(importDto.getPartPercent()).setDoseFrom(CommonUtil.tryParseInt(importDto.getDoseFrom()))
|
||||
.setApprovalNumber(importDto.getApprovalNumber())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())).setYbNo(importDto.getYbNo())
|
||||
.setPharmacologyCategoryCode(importDto.getPharmacologyCategoryCode())
|
||||
.setSkinTestFlag(CommonUtil.tryParseInt(importDto.getSkinTestFlag()))
|
||||
.setInjectFlag(CommonUtil.tryParseInt(importDto.getInjectFlag()))
|
||||
.setManufacturerText(importDto.getManufacturerText())
|
||||
.setRestrictedFlag(CommonUtil.tryParseInt(importDto.getRestrictedFlag()))
|
||||
.setRestrictedScope(importDto.getRestrictedScope()).setActiveFlag(Whether.YES.getValue())
|
||||
.setChildrenFlag(CommonUtil.tryParseInt(importDto.getChildrenFlag()))
|
||||
.setNationalDrugCode(importDto.getNationalDrugCode())
|
||||
.setPartAttributeEnum(CommonUtil.tryParseInt(importDto.getPartAttributeEnum()))
|
||||
.setAntibioticCode(importDto.getAntibioticCode())
|
||||
.setSelfFlag(CommonUtil.tryParseInt(importDto.getSelfFlag()))
|
||||
.setAntibioticFlag(CommonUtil.tryParseInt(importDto.getAntibioticFlag()))
|
||||
.setBasicFlag(CommonUtil.tryParseInt(importDto.getBasicFlag()))
|
||||
.setThoPartAttributeEnum(CommonUtil.tryParseInt(importDto.getThoPartAttributeEnum()))
|
||||
.setUnitConversionRatio(importDto.getUnitConversionRatio())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag())).setItemMinQuantity(importDto.getItemMinQuantity())
|
||||
.setItemMaxQuantity(importDto.getItemMaxQuantity());
|
||||
return medicationDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建药品基本实体
|
||||
*
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @param medicationDefId 药品定义ID
|
||||
* @param defaultLocationId 默认位置ID
|
||||
@@ -827,7 +827,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
* @return 药品基本实体
|
||||
*/
|
||||
private Medication createMedicationEntity(MedicationImportDto importDto, Long medicationDefId,
|
||||
Long defaultLocationId, Map<String, List<Location>> locationNameMap) {
|
||||
Long defaultLocationId, Map<String, List<Location>> locationNameMap) {
|
||||
Medication medication = new Medication();
|
||||
// 根据输入的所在位置名称获取位置ID
|
||||
List<Location> mapLocationList = locationNameMap.get(importDto.getLocationName());
|
||||
@@ -837,10 +837,10 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
medication.setLocationId(mapLocationList.get(0).getId());
|
||||
}
|
||||
medication.setMedicationDefId(medicationDefId).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setDoseFormCode(importDto.getDoseFrom()).setTotalVolume(importDto.getTotalVolume())
|
||||
.setActiveFlag(Whether.YES.getValue()).setMethodCode(importDto.getMethodCode())
|
||||
.setRateCode(importDto.getRateCode()).setDose(importDto.getDose())
|
||||
.setDoseUnitCode(importDto.getDoseUnitCode()).setMaxUnit(importDto.getMaxUnit());
|
||||
.setDoseFormCode(importDto.getDoseFrom()).setTotalVolume(importDto.getTotalVolume())
|
||||
.setActiveFlag(Whether.YES.getValue()).setMethodCode(importDto.getMethodCode())
|
||||
.setRateCode(importDto.getRateCode()).setDose(importDto.getDose())
|
||||
.setDoseUnitCode(importDto.getDoseUnitCode()).setMaxUnit(importDto.getMaxUnit());
|
||||
return medication;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.SupplierType;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
|
||||
@@ -24,4 +24,14 @@ public class ActivityChildJsonDto {
|
||||
*/
|
||||
private BigDecimal childrenRequestNum;
|
||||
|
||||
/**
|
||||
* 售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/**
|
||||
* 诊疗名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,14 +5,10 @@ import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import com.openhis.common.enums.DeviceCategory;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 器材目录分页检索
|
||||
*
|
||||
@@ -118,7 +114,7 @@ public class DeviceManageDto {
|
||||
|
||||
/** 供应商 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_supplier",dictCode = "id",dictText = "name")
|
||||
@Dict(dictTable = "adm_supplier", dictCode = "id", dictText = "name")
|
||||
private Long supplyId;
|
||||
private String supplyId_dictText;
|
||||
|
||||
|
||||
@@ -3,12 +3,10 @@ package com.openhis.web.datadictionary.dto;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import com.openhis.common.enums.DeviceCategory;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -136,7 +134,7 @@ public class DeviceManageUpDto {
|
||||
|
||||
/** 医保类别 */
|
||||
private String ybType;
|
||||
|
||||
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
package com.openhis.web.datadictionary.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import com.openhis.common.enums.ActivityDefCategory;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 诊疗目录分页检索
|
||||
*
|
||||
@@ -105,8 +102,8 @@ public class DiagnosisTreatmentDto {
|
||||
private String ybType;
|
||||
private String ybType_dictText;
|
||||
|
||||
// /** 购入价 */
|
||||
// private BigDecimal purchasePrice;
|
||||
// /** 购入价 */
|
||||
// private BigDecimal purchasePrice;
|
||||
|
||||
/** 零售价 */
|
||||
private BigDecimal retailPrice;
|
||||
@@ -124,4 +121,9 @@ public class DiagnosisTreatmentDto {
|
||||
private Integer pricingFlag;
|
||||
private String pricingFlag_enumText;
|
||||
|
||||
/**
|
||||
* 物价编码
|
||||
*/
|
||||
private String priceCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
package com.openhis.web.datadictionary.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import com.openhis.common.enums.ActivityDefCategory;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 诊疗目录分页更新
|
||||
*
|
||||
@@ -111,4 +109,9 @@ public class DiagnosisTreatmentUpDto {
|
||||
/** 划价标记 */
|
||||
private Integer pricingFlag;
|
||||
|
||||
/**
|
||||
* 物价编码
|
||||
*/
|
||||
private String priceCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.openhis.web.datadictionary.dto;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -71,4 +70,9 @@ public class ItemUpFromDirectoryDto {
|
||||
/** 价格 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 物价编码
|
||||
*/
|
||||
private String priceCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -22,271 +22,414 @@ import javax.validation.constraints.NotNull;
|
||||
@Accessors(chain = true)
|
||||
public class MedicationManageDto {
|
||||
|
||||
/** ID */
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 药品编码 */
|
||||
/**
|
||||
* 药品编码
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long medicationDefId;
|
||||
|
||||
/** 药品状态 */
|
||||
/**
|
||||
* 药品状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 所属科室 */
|
||||
/**
|
||||
* 所属科室
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
private String orgId_dictText;
|
||||
|
||||
/** 所在位置 */
|
||||
/**
|
||||
* 所在位置
|
||||
*/
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
/** 剂型 */
|
||||
/**
|
||||
* 剂型
|
||||
*/
|
||||
@Dict(dictCode = "dose_form_code")
|
||||
private String doseFormCode;
|
||||
private String doseFormCode_dictText;
|
||||
|
||||
/** 规格 */
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String totalVolume;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredientItem;
|
||||
|
||||
/** 是否为活性 */
|
||||
/**
|
||||
* 是否为活性
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
private String activeFlag_enumText;
|
||||
|
||||
/** 批次号 */
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
/** 生效日期 */
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 到期日期 */
|
||||
/**
|
||||
* 到期日期
|
||||
*/
|
||||
private Date expirationDate;
|
||||
|
||||
/** 用法 */
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
@Dict(dictCode = "method_code")
|
||||
private String methodCode;
|
||||
private String methodCode_dictText;
|
||||
|
||||
/** 用药频次 */
|
||||
/**
|
||||
* 用药频次
|
||||
*/
|
||||
@Dict(dictCode = "rate_code")
|
||||
private String rateCode;
|
||||
private String rateCode_dictText;
|
||||
|
||||
/** 单次剂量 */
|
||||
/**
|
||||
* 单次剂量
|
||||
*/
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
/**
|
||||
* 剂量单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
/**
|
||||
* 单次最大剂量
|
||||
*/
|
||||
private BigDecimal maxUnit;
|
||||
|
||||
/** 药品定义 */
|
||||
/**
|
||||
* 药品定义
|
||||
*/
|
||||
private String definition;
|
||||
|
||||
/** 用量限定 */
|
||||
/**
|
||||
* 用量限定
|
||||
*/
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
/** DDD值 */
|
||||
/**
|
||||
* DDD值
|
||||
*/
|
||||
@Dict(dictCode = "ddd_code")
|
||||
private String dddCode;
|
||||
private String dddCode_dictText;
|
||||
|
||||
/** DDD单位 */
|
||||
/**
|
||||
* DDD单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String dddUnitCode;
|
||||
private String dddUnitCode_dictText;
|
||||
|
||||
/** 药品编号 */
|
||||
/**
|
||||
* 药品编号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/** 药品名称 */
|
||||
/**
|
||||
* 药品名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/** 适用范围 */
|
||||
/**
|
||||
* 适用范围
|
||||
*/
|
||||
private Integer domainEnum;
|
||||
private String domainEnum_enumText;
|
||||
|
||||
/** 药品版本 */
|
||||
/**
|
||||
* 药品版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/** 英文药名 */
|
||||
/**
|
||||
* 英文药名
|
||||
*/
|
||||
private String nameEn;
|
||||
|
||||
/** 药品名称拼音码 */
|
||||
/**
|
||||
* 药品名称拼音码
|
||||
*/
|
||||
private String pyStr;
|
||||
|
||||
/** 药品五笔码 */
|
||||
/**
|
||||
* 药品五笔码
|
||||
*/
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
/**
|
||||
* 药品分类
|
||||
*/
|
||||
@Dict(dictCode = "med_category_code")
|
||||
private String categoryCode;
|
||||
private String categoryCode_dictText;
|
||||
|
||||
/** 商品名称 */
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String merchandiseName;
|
||||
|
||||
/** 商品名称拼音码 */
|
||||
/**
|
||||
* 商品名称拼音码
|
||||
*/
|
||||
private String merchandisePyStr;
|
||||
|
||||
/** 商品五笔码 */
|
||||
/**
|
||||
* 商品五笔码
|
||||
*/
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
/**
|
||||
* 药品单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
/**
|
||||
* 最小单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/** 所含耗材 */
|
||||
/**
|
||||
* 所含耗材
|
||||
*/
|
||||
private String comprisedText;
|
||||
|
||||
/** 拆零比 */
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 剂量形式 */
|
||||
/**
|
||||
* 剂量形式
|
||||
*/
|
||||
@Dict(dictCode = "dose_form_code")
|
||||
private Integer doseFrom;
|
||||
private String doseFrom_dictText;
|
||||
|
||||
/** 批准文号 */
|
||||
/**
|
||||
* 批准文号
|
||||
*/
|
||||
private String approvalNumber;
|
||||
|
||||
/** 医保是否对码 */
|
||||
/**
|
||||
* 医保是否对码
|
||||
*/
|
||||
private Integer ybMatchFlag;
|
||||
private String ybMatchFlag_enumText;;
|
||||
private String ybMatchFlag_enumText;
|
||||
;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 药理作用分类 */
|
||||
/**
|
||||
* 药理作用分类
|
||||
*/
|
||||
private String pharmacologyCategoryCode;
|
||||
|
||||
/** 是否皮试 */
|
||||
/**
|
||||
* 是否皮试
|
||||
*/
|
||||
private Integer skinTestFlag;
|
||||
private String skinTestFlag_enumText;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
/**
|
||||
* 是否为注射药物
|
||||
*/
|
||||
private Integer injectFlag;
|
||||
private String injectFlag_enumText;
|
||||
|
||||
/** 生产厂家 */
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long manufacturerId;
|
||||
|
||||
/** 供应商 */
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@Dict(dictTable = "adm_supplier", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long supplyId;
|
||||
private String supplyId_dictText;
|
||||
|
||||
/** 是否限制使用 */
|
||||
/**
|
||||
* 是否限制使用
|
||||
*/
|
||||
private Integer restrictedFlag;
|
||||
private String restrictedFlag_enumText;
|
||||
|
||||
/** 限制使用范围 */
|
||||
/**
|
||||
* 限制使用范围
|
||||
*/
|
||||
private String restrictedScope;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
/**
|
||||
* 儿童用药标志
|
||||
*/
|
||||
private Integer childrenFlag;
|
||||
private String childrenFlag_enumText;
|
||||
|
||||
/** 产品特性 */
|
||||
/**
|
||||
* 产品特性
|
||||
*/
|
||||
private Integer characteristic;
|
||||
private String characteristic_enumText;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
/**
|
||||
* 贯标国家编码
|
||||
*/
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 拆分属性 */
|
||||
/**
|
||||
* 拆分属性
|
||||
*/
|
||||
private Integer partAttributeEnum;
|
||||
private String partAttributeEnum_enumText;
|
||||
|
||||
/** 抗生素分类 */
|
||||
/**
|
||||
* 抗生素分类
|
||||
*/
|
||||
@Dict(dictCode = "antibiotic_type_code")
|
||||
private String antibioticCode;
|
||||
private String antibioticCode_dictText;
|
||||
|
||||
/** 权限限制 */
|
||||
/**
|
||||
* 权限限制
|
||||
*/
|
||||
private Integer restrictedEnum;
|
||||
private String restrictedEnum_enumText;
|
||||
|
||||
/** 是否自制 */
|
||||
/**
|
||||
* 是否自制
|
||||
*/
|
||||
private Integer selfFlag;
|
||||
private String selfFlag_enumText;
|
||||
|
||||
/** 是否抗生素 */
|
||||
/**
|
||||
* 是否抗生素
|
||||
*/
|
||||
private Integer antibioticFlag;
|
||||
private String antibioticFlag_enumText;
|
||||
|
||||
/** 基药标识 */
|
||||
/**
|
||||
* 基药标识
|
||||
*/
|
||||
private Integer basicFlag;
|
||||
private String basicFlag_enumText;
|
||||
|
||||
/** 生产厂商文本 */
|
||||
/**
|
||||
* 生产厂商文本
|
||||
*/
|
||||
private String manufacturerText;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最小库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最大库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
/** 售价 */
|
||||
/**
|
||||
* 售价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/** 单次最小用药频次 */
|
||||
/**
|
||||
* 单次最小用药频次
|
||||
*/
|
||||
private String minRateCode;
|
||||
|
||||
/** 单次最大用药频次 */
|
||||
/**
|
||||
* 单次最大用药频次
|
||||
*/
|
||||
private String maxRateCode;
|
||||
|
||||
/** 医保类别 */
|
||||
/**
|
||||
* 医保类别
|
||||
*/
|
||||
private String ybType;
|
||||
|
||||
/** 财务类别 */
|
||||
/**
|
||||
* 财务类别
|
||||
*/
|
||||
@Dict(dictCode = "fin_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredient;
|
||||
|
||||
/** 购入价 */
|
||||
/**
|
||||
* 购入价
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 零售价 */
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 最高零售价 */
|
||||
/**
|
||||
* 最高零售价
|
||||
*/
|
||||
private BigDecimal maximumRetailPrice;
|
||||
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
/**
|
||||
* 住院临时医嘱拆分属性
|
||||
*/
|
||||
private Integer thoPartAttributeEnum;
|
||||
private String thoPartAttributeEnum_enumText;
|
||||
|
||||
/** 剂量单位换算比 */
|
||||
/**
|
||||
* 剂量单位换算比
|
||||
*/
|
||||
private BigDecimal unitConversionRatio;
|
||||
|
||||
/** 医保等级 */
|
||||
/**
|
||||
* 医保等级
|
||||
*/
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 处方标志 */
|
||||
/**
|
||||
* 处方标志
|
||||
*/
|
||||
private Integer rxFlag;
|
||||
|
||||
/**
|
||||
@@ -294,4 +437,9 @@ public class MedicationManageDto {
|
||||
*/
|
||||
private String dosageInstruction;
|
||||
|
||||
/**
|
||||
* 药品69码
|
||||
*/
|
||||
private String drug69Code;
|
||||
|
||||
}
|
||||
|
||||
@@ -24,238 +24,380 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class MedicationManageUpDto {
|
||||
|
||||
/** ID */
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 药品编码 */
|
||||
/**
|
||||
* 药品编码
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long medicationDefId;
|
||||
|
||||
/** 所属科室 */
|
||||
/**
|
||||
* 所属科室
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
/**
|
||||
* 所在位置
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 剂型 */
|
||||
/**
|
||||
* 剂型
|
||||
*/
|
||||
private String doseFormCode;
|
||||
|
||||
/** 规格 */
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String totalVolume;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredientItem;
|
||||
|
||||
/** 是否为活性 */
|
||||
/**
|
||||
* 是否为活性
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 批次号 */
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
/** 生效日期 */
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 到期日期 */
|
||||
/**
|
||||
* 到期日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date expirationDate;
|
||||
|
||||
/** 用法 */
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
private String methodCode;
|
||||
|
||||
/** 用药频次 */
|
||||
/**
|
||||
* 用药频次
|
||||
*/
|
||||
private String rateCode;
|
||||
|
||||
/** 单次剂量 */
|
||||
/**
|
||||
* 单次剂量
|
||||
*/
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
/**
|
||||
* 剂量单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
@NotBlank(message = "剂量单位不能为空")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
/**
|
||||
* 单次最大剂量
|
||||
*/
|
||||
private BigDecimal maxUnit;
|
||||
|
||||
/** 药品定义 */
|
||||
/**
|
||||
* 药品定义
|
||||
*/
|
||||
private String definition;
|
||||
|
||||
/** 药品编号 */
|
||||
/**
|
||||
* 药品编号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/** 药品名称 */
|
||||
/**
|
||||
* 药品名称
|
||||
*/
|
||||
@NotBlank(message = "药品名称不能为空")
|
||||
private String name;
|
||||
|
||||
/** 适用范围 */
|
||||
/**
|
||||
* 适用范围
|
||||
*/
|
||||
private Integer domainEnum;
|
||||
|
||||
/** 药品版本 */
|
||||
/**
|
||||
* 药品版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/** 英文药名 */
|
||||
/**
|
||||
* 英文药名
|
||||
*/
|
||||
private String nameEn;
|
||||
|
||||
/** 药品名称拼音码 */
|
||||
/**
|
||||
* 药品名称拼音码
|
||||
*/
|
||||
private String pyStr;
|
||||
|
||||
/** 药品五笔码 */
|
||||
/**
|
||||
* 药品五笔码
|
||||
*/
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
/**
|
||||
* 药品分类
|
||||
*/
|
||||
private String categoryCode;
|
||||
|
||||
/** 商品名称 */
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String merchandiseName;
|
||||
|
||||
/** 商品名称拼音码 */
|
||||
/**
|
||||
* 商品名称拼音码
|
||||
*/
|
||||
private String merchandisePyStr;
|
||||
|
||||
/** 商品五笔码 */
|
||||
/**
|
||||
* 商品五笔码
|
||||
*/
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
/**
|
||||
* 药品单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
/**
|
||||
* 最小单位
|
||||
*/
|
||||
private String minUnitCode;
|
||||
|
||||
/** 所含耗材 */
|
||||
/**
|
||||
* 所含耗材
|
||||
*/
|
||||
private String comprisedText;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredient;
|
||||
|
||||
/** 拆零比 */
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 剂量形式 */
|
||||
/**
|
||||
* 剂量形式
|
||||
*/
|
||||
@Dict(dictCode = "dose_form_code")
|
||||
private Integer doseFrom;
|
||||
private String doseFrom_dictText;
|
||||
|
||||
/** 批准文号 */
|
||||
/**
|
||||
* 批准文号
|
||||
*/
|
||||
private String approvalNumber;
|
||||
|
||||
/** 医保是否对码 */
|
||||
/**
|
||||
* 医保是否对码
|
||||
*/
|
||||
private Integer ybMatchFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
/**
|
||||
* 医保编码
|
||||
*/
|
||||
private String ybNo;
|
||||
|
||||
/** 药理作用分类 */
|
||||
/**
|
||||
* 药理作用分类
|
||||
*/
|
||||
private String pharmacologyCategoryCode;
|
||||
|
||||
/** 是否皮试 */
|
||||
/**
|
||||
* 是否皮试
|
||||
*/
|
||||
private Integer skinTestFlag;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
/**
|
||||
* 是否为注射药物
|
||||
*/
|
||||
private Integer injectFlag;
|
||||
|
||||
/** 生产厂家 */
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long manufacturerId;
|
||||
|
||||
/** 生产厂商文本 */
|
||||
/**
|
||||
* 生产厂商文本
|
||||
*/
|
||||
private String manufacturerText;
|
||||
|
||||
/** 供应商 */
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long supplyId;
|
||||
|
||||
/** 是否限制使用 */
|
||||
/**
|
||||
* 是否限制使用
|
||||
*/
|
||||
private Integer restrictedFlag;
|
||||
|
||||
/** 限制使用范围 */
|
||||
/**
|
||||
* 限制使用范围
|
||||
*/
|
||||
private String restrictedScope;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
/**
|
||||
* 儿童用药标志
|
||||
*/
|
||||
private Integer childrenFlag;
|
||||
|
||||
/** 产品特性 */
|
||||
/**
|
||||
* 产品特性
|
||||
*/
|
||||
private Integer characteristic;
|
||||
|
||||
/** 购入价 */
|
||||
/**
|
||||
* 购入价
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 零售价 */
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 最高零售价 */
|
||||
/**
|
||||
* 最高零售价
|
||||
*/
|
||||
private BigDecimal maximumRetailPrice;
|
||||
|
||||
/** 医保类别 */
|
||||
/**
|
||||
* 医保类别
|
||||
*/
|
||||
private String ybType;
|
||||
|
||||
/** 财务类别 */
|
||||
/**
|
||||
* 财务类别
|
||||
*/
|
||||
@Dict(dictCode = "fin_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/** 单次最小用药频次 */
|
||||
/**
|
||||
* 单次最小用药频次
|
||||
*/
|
||||
private String minRateCode;
|
||||
|
||||
/** 单次最大用药频次 */
|
||||
/**
|
||||
* 单次最大用药频次
|
||||
*/
|
||||
private String maxRateCode;
|
||||
|
||||
/** 药品状态 */
|
||||
/**
|
||||
* 药品状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 拆分属性 */
|
||||
/**
|
||||
* 拆分属性
|
||||
*/
|
||||
private Integer partAttributeEnum;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
/**
|
||||
* 贯标国家编码
|
||||
*/
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 是否抗生素 */
|
||||
/**
|
||||
* 是否抗生素
|
||||
*/
|
||||
private Integer antibioticFlag;
|
||||
|
||||
/** 是否自制 */
|
||||
/**
|
||||
* 是否自制
|
||||
*/
|
||||
private Integer selfFlag;
|
||||
|
||||
/** DDD值 */
|
||||
/**
|
||||
* DDD值
|
||||
*/
|
||||
private String dddCode;
|
||||
|
||||
/** DDD单位 */
|
||||
/**
|
||||
* DDD单位
|
||||
*/
|
||||
private String dddUnitCode;
|
||||
|
||||
/** 用量限定 */
|
||||
/**
|
||||
* 用量限定
|
||||
*/
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
/** 抗生素分类 */
|
||||
/**
|
||||
* 抗生素分类
|
||||
*/
|
||||
@Dict(dictCode = "antibiotic_type_code")
|
||||
private String antibioticCode;
|
||||
private String antibioticCode_dictText;
|
||||
|
||||
/** 权限限制 */
|
||||
/**
|
||||
* 权限限制
|
||||
*/
|
||||
private Integer restrictedEnum;
|
||||
|
||||
/** 基药标识 */
|
||||
/**
|
||||
* 基药标识
|
||||
*/
|
||||
private Integer basicFlag;
|
||||
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
/**
|
||||
* 住院临时医嘱拆分属性
|
||||
*/
|
||||
private Integer thoPartAttributeEnum;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最小库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最大库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
/** 剂量单位换算比 */
|
||||
/**
|
||||
* 剂量单位换算比
|
||||
*/
|
||||
private BigDecimal unitConversionRatio;
|
||||
|
||||
/** 医保等级 */
|
||||
/**
|
||||
* 医保等级
|
||||
*/
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 处方标志 */
|
||||
/**
|
||||
* 处方标志
|
||||
*/
|
||||
private Integer rxFlag;
|
||||
|
||||
/**
|
||||
@@ -263,4 +405,9 @@ public class MedicationManageUpDto {
|
||||
*/
|
||||
private String dosageInstruction;
|
||||
|
||||
/**
|
||||
* 药品69码
|
||||
*/
|
||||
private String drug69Code;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -36,17 +35,20 @@ public class DepartmentIssuanceOrderServiceImpl implements IDepartmentIssuanceOr
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Resource
|
||||
private ISupplyRequestService supplyRequestService;
|
||||
|
||||
@Resource
|
||||
private ISupplyDeliveryService supplyDeliveryService;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private IDepartmentCommonService departmentCommonService;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private DepartmentCommonMapper departmentCommonMapper;
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private DepartmentIssuanceOrderMapper departmentIssuanceOrderMapper;
|
||||
|
||||
/**
|
||||
@@ -87,8 +89,8 @@ public class DepartmentIssuanceOrderServiceImpl implements IDepartmentIssuanceOr
|
||||
@Override
|
||||
public R<?> getDetailPage(String busNo, Integer pageNo, Integer pageSize) {
|
||||
|
||||
Page<DepartmentDetailDto> issuanceOrderDtoDetailPage =
|
||||
departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo);
|
||||
Page<DepartmentDetailDto> issuanceOrderDtoDetailPage
|
||||
= departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo);
|
||||
|
||||
issuanceOrderDtoDetailPage.getRecords().forEach(e -> {
|
||||
// 单据分类
|
||||
@@ -117,15 +119,14 @@ public class DepartmentIssuanceOrderServiceImpl implements IDepartmentIssuanceOr
|
||||
* @param dispenseIdList 耗材发放id
|
||||
* @return 操作结果
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean addOrEditIssuanceOrder(List<Long> dispenseIdList) {
|
||||
|
||||
// 获取单据号
|
||||
String busNo = this.getBusNo();
|
||||
// 获取更表所需信息
|
||||
List<DepartmentDetailDto> detailDto =
|
||||
departmentIssuanceOrderMapper.getInfo(dispenseIdList, DispenseStatus.COMPLETED.getValue());
|
||||
List<DepartmentDetailDto> detailDto
|
||||
= departmentIssuanceOrderMapper.getInfo(dispenseIdList, DispenseStatus.COMPLETED.getValue());
|
||||
|
||||
List<SupplyRequest> supplyRequestList = new ArrayList<>();
|
||||
SupplyRequest supplyRequest;
|
||||
@@ -134,24 +135,24 @@ public class DepartmentIssuanceOrderServiceImpl implements IDepartmentIssuanceOr
|
||||
for (DepartmentDetailDto item : detailDto) {
|
||||
// 供应申请
|
||||
supplyRequest = new SupplyRequest().setBusNo(busNo).setTypeEnum(SupplyType.DISPENSING_ORDER.getValue())
|
||||
.setStatusEnum(SupplyStatus.AGREE.getValue()).setCategoryEnum(item.getCategoryEnum())
|
||||
.setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId())
|
||||
.setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity())
|
||||
.setLotNumber(item.getLotNumber()).setSourceTypeEnum(LocationForm.CABINET.getValue())
|
||||
.setSourceLocationId(item.getSourceLocationId()).setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue())
|
||||
.setPurposeLocationId(item.getPurposeLocationId()).setApplicantId(item.getApplicantId())
|
||||
.setApplyTime(item.getApplyTime()).setApproverId(item.getApproverId())
|
||||
.setApprovalTime(item.getApprovalTime());
|
||||
.setStatusEnum(SupplyStatus.AGREE.getValue()).setCategoryEnum(item.getCategoryEnum())
|
||||
.setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId())
|
||||
.setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity())
|
||||
.setLotNumber(item.getLotNumber()).setSourceTypeEnum(LocationForm.CABINET.getValue())
|
||||
.setSourceLocationId(item.getSourceLocationId()).setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue())
|
||||
.setPurposeLocationId(item.getPurposeLocationId()).setApplicantId(item.getApplicantId())
|
||||
.setApplyTime(item.getApplyTime()).setApproverId(item.getApproverId())
|
||||
.setApprovalTime(item.getApprovalTime());
|
||||
supplyRequestList.add(supplyRequest);
|
||||
// 供应发放
|
||||
supplyDelivery = new SupplyDelivery().setRequestId(supplyRequest.getId())
|
||||
.setStatusEnum(DispenseStatus.COMPLETED.getValue()).setTypeEnum(supplyRequest.getTypeEnum())
|
||||
.setItemTable(supplyRequest.getItemTable()).setItemId(supplyRequest.getItemId())
|
||||
.setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE).setBasedOnIds(item.getDispenseIds())
|
||||
.setUnitCode(supplyRequest.getUnitCode()).setQuantity(supplyRequest.getItemQuantity())
|
||||
.setLotNumber(supplyRequest.getLotNumber()).setPractitionerId(supplyRequest.getApplicantId())
|
||||
.setOccurrenceTime(supplyRequest.getApprovalTime()).setReceiverId(supplyRequest.getPurposeLocationId())
|
||||
.setReceiveTime(supplyRequest.getApprovalTime());
|
||||
.setStatusEnum(DispenseStatus.COMPLETED.getValue()).setTypeEnum(supplyRequest.getTypeEnum())
|
||||
.setItemTable(supplyRequest.getItemTable()).setItemId(supplyRequest.getItemId())
|
||||
.setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE).setBasedOnIds(item.getDispenseIds())
|
||||
.setUnitCode(supplyRequest.getUnitCode()).setQuantity(supplyRequest.getItemQuantity())
|
||||
.setLotNumber(supplyRequest.getLotNumber()).setPractitionerId(supplyRequest.getApplicantId())
|
||||
.setOccurrenceTime(supplyRequest.getApprovalTime()).setReceiverId(supplyRequest.getPurposeLocationId())
|
||||
.setReceiveTime(supplyRequest.getApprovalTime());
|
||||
|
||||
supplyDeliveryList.add(supplyDelivery);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.doctorstation.dto.*;
|
||||
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
|
||||
import com.openhis.web.doctorstation.dto.AdviceSaveParam;
|
||||
import com.openhis.web.doctorstation.dto.OrderBindInfoDto;
|
||||
import com.openhis.web.doctorstation.dto.UpdateGroupIdParam;
|
||||
|
||||
/**
|
||||
* 医生站-医嘱/处方 应用Service
|
||||
@@ -23,11 +26,12 @@ public interface IDoctorStationAdviceAppService {
|
||||
* @param pageSize 每页多少条
|
||||
* @param pricingFlag 划价标记
|
||||
* @param adviceTypes 医嘱类型参数集合
|
||||
* @param orderPricing 医嘱定价来源 | 定时任务调用时传参
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes);
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes, String orderPricing);
|
||||
|
||||
/**
|
||||
* 查询医嘱绑定信息
|
||||
@@ -87,4 +91,29 @@ public interface IDoctorStationAdviceAppService {
|
||||
* @return 就诊费用性质
|
||||
*/
|
||||
R<?> getEncounterContract(Long encounterId);
|
||||
|
||||
/**
|
||||
* 查询检验检查开立历史(近30天)
|
||||
*
|
||||
* @param patientId 患者id
|
||||
* @param adviceDefinitionId 医嘱定义id
|
||||
* @return 检验检查开立历史
|
||||
*/
|
||||
R<?> getProofAndTestHistory(Long patientId, Long adviceDefinitionId);
|
||||
|
||||
/**
|
||||
* 查询检验url相关参数
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 检验url相关参数
|
||||
*/
|
||||
R<?> getProofResult(Long encounterId);
|
||||
|
||||
/**
|
||||
* 查询检查url相关参数
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 检查url相关参数
|
||||
*/
|
||||
R<?> getTestResult(Long encounterId);
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.openhis.web.doctorstation.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.doctorstation.dto.AllergyIntoInfoDto;
|
||||
|
||||
/**
|
||||
* 医生站-患者过敏与不耐受管理的应用类
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/4/10
|
||||
*/
|
||||
public interface IDoctorStationAllergyIntolAppService {
|
||||
|
||||
/**
|
||||
* 患者过敏与不耐受数据初始化
|
||||
*
|
||||
* @return 基础数据
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
R<?> init();
|
||||
|
||||
/**
|
||||
* 查询患者过敏与不耐受信息
|
||||
*
|
||||
* @param patientId 患者Id
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 患者过敏与不耐受信息
|
||||
*/
|
||||
R<?> getAllergyIntoleranceInfo(Long patientId, Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 作废当条患者过敏与不耐受信息
|
||||
*
|
||||
* @param allergyIntoInfoDto 患者过敏与不耐受信息
|
||||
* @return
|
||||
*/
|
||||
R<?> invalidateAllergyIntolerance(AllergyIntoInfoDto allergyIntoInfoDto);
|
||||
|
||||
/**
|
||||
* 新增患者过敏与不耐受信息
|
||||
*
|
||||
* @param allergyIntoInfoDto 患者过敏与不耐受信息
|
||||
* @return
|
||||
*/
|
||||
R<?> addAllergyIntoleranceInfo(AllergyIntoInfoDto allergyIntoInfoDto);
|
||||
|
||||
}
|
||||
@@ -43,6 +43,15 @@ public interface IDoctorStationChineseMedicalAppService {
|
||||
*/
|
||||
R<?> saveTcmDiagnosis(SaveDiagnosisParam saveDiagnosisParam);
|
||||
|
||||
|
||||
/**
|
||||
* 保存中医诊断
|
||||
*
|
||||
* @param saveDiagnosisParam 诊断信息
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> updateTcmDiagnosis(SaveDiagnosisParam saveDiagnosisParam);
|
||||
|
||||
/**
|
||||
* 查询中医就诊诊断信息
|
||||
*
|
||||
|
||||
@@ -69,6 +69,14 @@ public interface IDoctorStationDiagnosisAppService {
|
||||
*/
|
||||
R<?> saveDoctorDiagnosis(SaveDiagnosisParam saveDiagnosisParam);
|
||||
|
||||
/**
|
||||
* 医生保存诊断
|
||||
*
|
||||
* @param saveDiagnosisParam 诊断信息
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> saveDoctorDiagnosisNew(SaveDiagnosisParam saveDiagnosisParam);
|
||||
|
||||
/**
|
||||
* 查询诊断定义业务分类数据
|
||||
*
|
||||
@@ -101,4 +109,13 @@ public interface IDoctorStationDiagnosisAppService {
|
||||
* @return 查询结果
|
||||
*/
|
||||
R<?> getDiagnosisList(String searchKey, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询诊断信息
|
||||
*
|
||||
* @param searchKey 目标字符
|
||||
* @param encounterId 请求
|
||||
* @return 查询结果
|
||||
*/
|
||||
R<?> getEncounterDiagnosisByEncounterId(Long encounterId, String searchKey);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.core.common.core.domain.R;
|
||||
import com.openhis.web.doctorstation.dto.PatientInfoDto;
|
||||
import com.openhis.web.doctorstation.dto.PrescriptionInfoBaseDto;
|
||||
import com.openhis.web.doctorstation.dto.PrescriptionInfoDetailDto;
|
||||
import com.openhis.web.doctorstation.dto.ReceptionStatisticsDto;
|
||||
|
||||
/**
|
||||
* 医生站-主页面 应用Service
|
||||
@@ -70,7 +71,7 @@ public interface IDoctorStationMainAppService {
|
||||
* @return 处方号列表信息
|
||||
*/
|
||||
IPage<PrescriptionInfoBaseDto> getPrescriptionPageInfo(PrescriptionInfoBaseDto prescriptionInfoBaseDto,
|
||||
String searchKey, Integer pageNo, Integer pageSize);
|
||||
String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 查询处方详情
|
||||
@@ -80,4 +81,14 @@ public interface IDoctorStationMainAppService {
|
||||
*/
|
||||
List<PrescriptionInfoDetailDto> getPrescriptionDetailInfo(String prescriptionNo);
|
||||
|
||||
/**
|
||||
* 查询接诊统计
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param practitionerId 参与者id
|
||||
* @return 接诊统计
|
||||
*/
|
||||
List<ReceptionStatisticsDto> getReceptionStatistics(String startTime,String endTime,Long practitionerId);
|
||||
|
||||
}
|
||||
|
||||
@@ -72,7 +72,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
// @Resource
|
||||
// IOrganizationLocationService iOrganizationLocationService;
|
||||
|
||||
@Resource
|
||||
IMedicationDispenseService iMedicationDispenseService;
|
||||
|
||||
@@ -90,35 +89,44 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
// @Resource
|
||||
// OutpatientRegistrationAppMapper outpatientRegistrationAppMapper;
|
||||
|
||||
@Resource
|
||||
DoctorStationSendApplyUtil doctorStationSendApplyUtil;
|
||||
|
||||
/**
|
||||
* 查询医嘱信息
|
||||
*
|
||||
* @param adviceBaseDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param locationId 药房id
|
||||
* @param adviceBaseDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param locationId 药房id
|
||||
* @param adviceDefinitionIdParamList 医嘱定义id参数集合
|
||||
* @param organizationId 患者挂号对应的科室id
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param pricingFlag 划价标记
|
||||
* @param adviceTypes 医嘱类型参数集合
|
||||
* @param organizationId 患者挂号对应的科室id
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param pricingFlag 划价标记
|
||||
* @param adviceTypes 医嘱类型参数集合
|
||||
* @param orderPricing 医嘱定价来源 | 定时任务调用时传参
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
@Override
|
||||
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes) {
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes, String orderPricing) {
|
||||
// 设置默认科室 (不取前端传的了)
|
||||
organizationId = SecurityUtils.getLoginUser().getOrgId();
|
||||
|
||||
// 医嘱定价来源
|
||||
String orderPricingSource = TenantOptionUtil.getOptionContent(TenantOptionDict.ORDER_PRICING_SOURCE);
|
||||
// 如果配置为空,使用retailPrice作为默认值
|
||||
if (StringUtils.isEmpty(orderPricingSource)) {
|
||||
// throw new ServiceException("租户配置项【医嘱定价来源】未配置");
|
||||
orderPricingSource = "retailPrice";
|
||||
if (StringUtils.isEmpty(orderPricingSource) && StringUtils.isEmpty(orderPricing)) {
|
||||
throw new ServiceException("租户配置项【医嘱定价来源】未配置");
|
||||
} else if (StringUtils.isNotEmpty(orderPricing)) {
|
||||
orderPricingSource = orderPricing;
|
||||
}
|
||||
// 开药时药房允许多选开关
|
||||
String pharmacyMultipleChoiceSwitch
|
||||
= TenantOptionUtil.getOptionContent(TenantOptionDict.PHARMACY_MULTIPLE_CHOICE_SWITCH);
|
||||
// 药房允许多选
|
||||
boolean pharmacyMultipleChoice = Whether.YES.getCode().equals(pharmacyMultipleChoiceSwitch);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<AdviceBaseDto> queryWrapper = HisQueryUtils.buildQueryWrapper(adviceBaseDto, searchKey,
|
||||
new HashSet<>(Arrays.asList("advice_name", "py_str", "wb_str")), null);
|
||||
@@ -128,23 +136,29 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, pricingFlag, adviceDefinitionIdParamList, adviceTypes,
|
||||
queryWrapper);
|
||||
List<AdviceBaseDto> adviceBaseDtoList = adviceBaseInfo.getRecords();
|
||||
|
||||
// 如果searchKey不为null,对查询结果进行排序:adviceName以searchKey开头的排在前面
|
||||
if (searchKey != null && !searchKey.trim().isEmpty()) {
|
||||
sortAdviceListBySearchKey(adviceBaseDtoList, searchKey.trim());
|
||||
}
|
||||
|
||||
// 医嘱定义ID集合
|
||||
List<Long> adviceDefinitionIdList =
|
||||
adviceBaseDtoList.stream().map(AdviceBaseDto::getAdviceDefinitionId).collect(Collectors.toList());
|
||||
List<Long> adviceDefinitionIdList
|
||||
= adviceBaseDtoList.stream().map(AdviceBaseDto::getAdviceDefinitionId).collect(Collectors.toList());
|
||||
// 费用定价主表ID集合
|
||||
List<Long> chargeItemDefinitionIdList =
|
||||
adviceBaseDtoList.stream().map(AdviceBaseDto::getChargeItemDefinitionId).collect(Collectors.toList());
|
||||
List<Long> chargeItemDefinitionIdList
|
||||
= adviceBaseDtoList.stream().map(AdviceBaseDto::getChargeItemDefinitionId).collect(Collectors.toList());
|
||||
// 医嘱库存集合
|
||||
List<AdviceInventoryDto> adviceInventoryList =
|
||||
doctorStationAdviceAppMapper.getAdviceInventory(locationId, adviceDefinitionIdList,
|
||||
List<AdviceInventoryDto> adviceInventoryList
|
||||
= doctorStationAdviceAppMapper.getAdviceInventory(locationId, adviceDefinitionIdList,
|
||||
CommonConstants.SqlCondition.ABOUT_INVENTORY_TABLE_STR, PublicationStatus.ACTIVE.getValue());
|
||||
// 待发放个数信息
|
||||
List<AdviceInventoryDto> adviceDraftInventoryList = doctorStationAdviceAppMapper.getAdviceDraftInventory(
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
DispenseStatus.DRAFT.getValue(), DispenseStatus.PREPARATION.getValue());
|
||||
// 预减库存
|
||||
List<AdviceInventoryDto> adviceInventory =
|
||||
adviceUtils.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
|
||||
List<AdviceInventoryDto> adviceInventory
|
||||
= adviceUtils.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
|
||||
// 查询取药科室配置
|
||||
List<AdviceInventoryDto> medLocationConfig = doctorStationAdviceAppMapper.getMedLocationConfig(organizationId);
|
||||
// 将配置转为 {categoryCode -> 允许的locationId集合}
|
||||
@@ -155,15 +169,15 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
continue;
|
||||
}
|
||||
allowedLocByCategory.computeIfAbsent(String.valueOf(cfg.getCategoryCode()), k -> new HashSet<>())
|
||||
.add(cfg.getLocationId());
|
||||
.add(cfg.getLocationId());
|
||||
}
|
||||
}
|
||||
// 费用定价子表信息
|
||||
List<AdvicePriceDto> childCharge = doctorStationAdviceAppMapper
|
||||
.getChildCharge(ConditionCode.LOT_NUMBER_PRICE.getCode(), chargeItemDefinitionIdList);
|
||||
// 费用定价主表信息
|
||||
List<AdvicePriceDto> mainCharge =
|
||||
doctorStationAdviceAppMapper.getMainCharge(chargeItemDefinitionIdList, PublicationStatus.ACTIVE.getValue());
|
||||
List<AdvicePriceDto> mainCharge
|
||||
= doctorStationAdviceAppMapper.getMainCharge(chargeItemDefinitionIdList, PublicationStatus.ACTIVE.getValue());
|
||||
String unitCode = ""; // 包装单位
|
||||
Long chargeItemDefinitionId; // 费用定价主表ID
|
||||
for (AdviceBaseDto baseDto : adviceBaseDtoList) {
|
||||
@@ -176,12 +190,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
baseDto.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, baseDto.getInjectFlag()));
|
||||
case CommonConstants.TableName.ADM_DEVICE_DEFINITION: // 耗材
|
||||
// 每一条医嘱的库存集合信息 , 包装单位库存前端计算
|
||||
List<
|
||||
AdviceInventoryDto> inventoryList =
|
||||
adviceInventory.stream()
|
||||
.filter(e -> baseDto.getAdviceDefinitionId().equals(e.getItemId())
|
||||
&& baseDto.getAdviceTableName().equals(e.getItemTable()))
|
||||
.collect(Collectors.toList());
|
||||
List<AdviceInventoryDto> inventoryList = adviceInventory.stream().filter(e -> baseDto
|
||||
.getAdviceDefinitionId().equals(e.getItemId())
|
||||
&& baseDto.getAdviceTableName().equals(e.getItemTable())
|
||||
&& (pharmacyMultipleChoice
|
||||
|| (baseDto.getPositionId() == null || baseDto.getPositionId().equals(e.getLocationId()))))
|
||||
.collect(Collectors.toList());
|
||||
// 库存信息
|
||||
baseDto.setInventoryList(inventoryList);
|
||||
// 设置默认产品批号
|
||||
@@ -208,6 +222,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unitCode = baseDto.getUnitCode();
|
||||
chargeItemDefinitionId = baseDto.getChargeItemDefinitionId();
|
||||
List<AdvicePriceDto> priceDtoList = new ArrayList<>();
|
||||
@@ -218,7 +233,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
// 从定价子表取价格(适用于批次售卖场景)
|
||||
List<AdvicePriceDto> childPrice = childCharge.stream()
|
||||
.filter(e -> e.getDefinitionId().equals(finalChargeItemDefinitionId)
|
||||
&& e.getConditionValue().equals(adviceInventoryDto.getLotNumber()))
|
||||
&& e.getConditionValue().equals(adviceInventoryDto.getLotNumber()))
|
||||
.peek(e -> e.setUnitCode(finalUnitCode)) // 设置 unitCode
|
||||
.collect(Collectors.toList());
|
||||
// 从定价主表取价格(适用于统一零售价场景)
|
||||
@@ -236,8 +251,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
baseDto.setPriceList(priceDtoList);
|
||||
break;
|
||||
case CommonConstants.TableName.WOR_ACTIVITY_DEFINITION: // 诊疗
|
||||
List<AdvicePriceDto> priceList =
|
||||
mainCharge.stream().filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
|
||||
List<AdvicePriceDto> priceList
|
||||
= mainCharge.stream().filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
|
||||
.collect(Collectors.toList());
|
||||
// 价格信息
|
||||
baseDto.setPriceList(priceList);
|
||||
@@ -256,7 +271,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
* 查询医嘱绑定信息
|
||||
*
|
||||
* @param typeCode 1:用法绑东西 2:诊疗绑东西
|
||||
* @param itemNo 用法的code 或者 诊疗定义id
|
||||
* @param itemNo 用法的code 或者 诊疗定义id
|
||||
* @return 医嘱绑定信息
|
||||
*/
|
||||
@Override
|
||||
@@ -268,7 +283,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
* 门诊保存/签发医嘱
|
||||
*
|
||||
* @param adviceSaveParam 医嘱表单信息
|
||||
* @param adviceOpType 医嘱操作类型
|
||||
* @param adviceOpType 医嘱操作类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@@ -291,9 +306,21 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
* 保存时,校验库存
|
||||
*/
|
||||
if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
|
||||
List<AdviceSaveDto> needCheckList =
|
||||
adviceSaveList.stream().filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())
|
||||
&& !ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
List<AdviceSaveDto> medUpdateList
|
||||
= medicineList.stream().filter(e -> e.getRequestId() != null).collect(Collectors.toList());
|
||||
List<AdviceSaveDto> devUpdateList
|
||||
= deviceList.stream().filter(e -> e.getRequestId() != null).collect(Collectors.toList());
|
||||
// 编辑时,释放本身占用的库存发放
|
||||
for (AdviceSaveDto adviceSaveDto : medUpdateList) {
|
||||
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
|
||||
}
|
||||
for (AdviceSaveDto adviceSaveDto : devUpdateList) {
|
||||
iDeviceDispenseService.deleteDeviceDispense(adviceSaveDto.getRequestId());
|
||||
}
|
||||
|
||||
List<AdviceSaveDto> needCheckList
|
||||
= adviceSaveList.stream().filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())
|
||||
&& !ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
// 校验库存
|
||||
String tipRes = adviceUtils.checkInventory(needCheckList);
|
||||
if (tipRes != null) {
|
||||
@@ -308,7 +335,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
/**
|
||||
* 处理药品请求
|
||||
*/
|
||||
this.handMedication(medicineList, curDate, adviceOpType, organizationId, signCode);
|
||||
List<String> medRequestIdList
|
||||
= this.handMedication(medicineList, curDate, adviceOpType, organizationId, signCode);
|
||||
|
||||
/**
|
||||
* 处理诊疗项目请求
|
||||
@@ -335,14 +363,15 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
.in(ChargeItem::getServiceId, requestIds));
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"门诊医嘱"}));
|
||||
return R.ok(medRequestIdList,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"门诊医嘱"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理药品
|
||||
*/
|
||||
private void handMedication(List<AdviceSaveDto> medicineList, Date curDate, String adviceOpType,
|
||||
Long organizationId, String signCode) {
|
||||
private List<String> handMedication(List<AdviceSaveDto> medicineList, Date curDate, String adviceOpType,
|
||||
Long organizationId, String signCode) {
|
||||
// 当前登录账号的科室id
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
// 保存操作
|
||||
@@ -354,9 +383,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
// 声明费用项
|
||||
ChargeItem chargeItem;
|
||||
// 新增 + 修改
|
||||
List<AdviceSaveDto> insertOrUpdateList =
|
||||
medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
List<AdviceSaveDto> insertOrUpdateList
|
||||
= medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
// 删除
|
||||
List<AdviceSaveDto> deleteList = medicineList.stream()
|
||||
.filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||
@@ -391,7 +420,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
prescriptionUtils.generatePrescriptionNumbers(insertOrUpdateList);
|
||||
}
|
||||
|
||||
List<String> medRequestIdList = new ArrayList<>();
|
||||
for (AdviceSaveDto adviceSaveDto : insertOrUpdateList) {
|
||||
boolean firstTimeSave = false;// 第一次保存
|
||||
medicationRequest = new MedicationRequest();
|
||||
medicationRequest.setId(adviceSaveDto.getRequestId()); // 主键id
|
||||
medicationRequest.setStatusEnum(is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue()); // 请求状态
|
||||
@@ -432,12 +463,17 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
medicationRequest.setInfusionFlag(adviceSaveDto.getInjectFlag()); // 输液标志
|
||||
medicationRequest.setSortNumber(adviceSaveDto.getSortNumber()); // 排序号
|
||||
}
|
||||
if (medicationRequest.getId() == null) {
|
||||
firstTimeSave = true;
|
||||
}
|
||||
iMedicationRequestService.saveOrUpdate(medicationRequest);
|
||||
|
||||
if (firstTimeSave) {
|
||||
medRequestIdList.add(medicationRequest.getId().toString());
|
||||
}
|
||||
if (is_save) {
|
||||
// 处理药品发放
|
||||
Long dispenseId =
|
||||
iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
|
||||
Long dispenseId
|
||||
= iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
|
||||
|
||||
// 保存药品费用项
|
||||
chargeItem = new ChargeItem();
|
||||
@@ -472,6 +508,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
}
|
||||
}
|
||||
return medRequestIdList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -488,9 +525,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
// 声明费用项
|
||||
ChargeItem chargeItem;
|
||||
// 新增 + 修改
|
||||
List<AdviceSaveDto> insertOrUpdateList =
|
||||
deviceList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
List<AdviceSaveDto> insertOrUpdateList
|
||||
= deviceList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
// 删除
|
||||
List<AdviceSaveDto> deleteList = deviceList.stream()
|
||||
.filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||
@@ -548,8 +585,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
iDeviceRequestService.saveOrUpdate(deviceRequest);
|
||||
if (is_save) {
|
||||
// 处理耗材发放
|
||||
Long dispenseId =
|
||||
iDeviceDispenseService.handleDeviceDispense(deviceRequest, adviceSaveDto.getDbOpType());
|
||||
Long dispenseId
|
||||
= iDeviceDispenseService.handleDeviceDispense(deviceRequest, adviceSaveDto.getDbOpType());
|
||||
|
||||
// 保存耗材费用项
|
||||
chargeItem = new ChargeItem();
|
||||
@@ -588,7 +625,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
* 处理诊疗
|
||||
*/
|
||||
private void handService(List<AdviceSaveDto> activityList, Date curDate, String adviceOpType, Long organizationId,
|
||||
String signCode) {
|
||||
String signCode) {
|
||||
// 当前登录账号的科室id
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
// 保存操作
|
||||
@@ -599,9 +636,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
// 声明费用项
|
||||
ChargeItem chargeItem;
|
||||
// 新增 + 修改
|
||||
List<AdviceSaveDto> insertOrUpdateList =
|
||||
activityList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
List<AdviceSaveDto> insertOrUpdateList
|
||||
= activityList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
// 删除
|
||||
List<AdviceSaveDto> deleteList = activityList.stream()
|
||||
.filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||
@@ -652,6 +689,13 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
serviceRequest.setYbClassEnum(adviceSaveDto.getYbClassEnum());// 类别医保编码
|
||||
serviceRequest.setConditionId(adviceSaveDto.getConditionId()); // 诊断id
|
||||
serviceRequest.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
||||
|
||||
// 基于皮试药品生成的皮试检查
|
||||
if (adviceSaveDto.getBasedOnId() != null) {
|
||||
serviceRequest.setBasedOnId(adviceSaveDto.getBasedOnId());
|
||||
serviceRequest.setBasedOnTable(CommonConstants.TableName.MED_MEDICATION_REQUEST);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
iServiceRequestService.saveOrUpdate(serviceRequest);
|
||||
@@ -687,8 +731,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
// 第一次保存时,处理诊疗套餐的子项信息
|
||||
if (adviceSaveDto.getRequestId() == null) {
|
||||
ActivityDefinition activityDefinition =
|
||||
iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
|
||||
ActivityDefinition activityDefinition
|
||||
= iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
|
||||
String childrenJson = activityDefinition.getChildrenJson();
|
||||
if (childrenJson != null) {
|
||||
// 诊疗子项参数类
|
||||
@@ -699,6 +743,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
activityChildrenJsonParams.setAccountId(chargeItem.getAccountId()); // 账户id
|
||||
activityChildrenJsonParams.setChargeItemId(chargeItem.getId()); // 费用项id
|
||||
activityChildrenJsonParams.setParentId(serviceRequest.getId());// 子项诊疗的父id
|
||||
activityChildrenJsonParams.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId());
|
||||
adviceUtils.handleActivityChild(childrenJson, organizationId, activityChildrenJsonParams);
|
||||
}
|
||||
}
|
||||
@@ -710,8 +755,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
adviceSaveDto.setRequestId(serviceRequest.getId());
|
||||
try {
|
||||
// 查询诊疗定义
|
||||
ActivityDefinition activityDefinition =
|
||||
iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
|
||||
ActivityDefinition activityDefinition
|
||||
= iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
|
||||
if (activityDefinition != null) {
|
||||
// 检验 或 检查
|
||||
if (ActivityType.PROOF.getValue().equals(activityDefinition.getTypeEnum())
|
||||
@@ -786,9 +831,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
chargeItemList.forEach(item -> {
|
||||
switch (item.getServiceTable()) {
|
||||
case CommonConstants.TableName.MED_MEDICATION_REQUEST -> medReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_DEVICE_REQUEST -> devReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_SERVICE_REQUEST -> serReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.MED_MEDICATION_REQUEST ->
|
||||
medReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_DEVICE_REQUEST ->
|
||||
devReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_SERVICE_REQUEST ->
|
||||
serReqIdList.add(item.getServiceId());
|
||||
}
|
||||
});
|
||||
List<Long> chargeItemIdList = chargeItemList.stream().map(ChargeItem::getId).collect(Collectors.toList());
|
||||
@@ -815,7 +863,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
/**
|
||||
* 查询历史医嘱请求数据
|
||||
*
|
||||
* @param patientId 病人id
|
||||
* @param patientId 病人id
|
||||
* @param encounterId 就诊id
|
||||
* @return 历史医嘱请求数据
|
||||
*/
|
||||
@@ -887,4 +935,121 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
return R.ok(doctorStationAdviceAppMapper.getEncounterContract(encounterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检验检查开立历史(近30天)
|
||||
*
|
||||
* @param patientId 患者id
|
||||
* @param adviceDefinitionId 医嘱定义id
|
||||
* @return 检验检查开立历史
|
||||
*/
|
||||
@Override
|
||||
public R<?> getProofAndTestHistory(Long patientId, Long adviceDefinitionId) {
|
||||
return R.ok(doctorStationAdviceAppMapper.getProofAndTestHistory(patientId, adviceDefinitionId,
|
||||
RequestStatus.COMPLETED.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检验url相关参数
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 检验url相关参数
|
||||
*/
|
||||
@Override
|
||||
public R<?> getProofResult(Long encounterId) {
|
||||
// LIS查看报告地址
|
||||
String lisReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_REPORT_URL);
|
||||
if (StringUtils.isEmpty(lisReportUrl)) {
|
||||
throw new ServiceException("租户配置项【LIS查看报告地址】未配置");
|
||||
}
|
||||
List<ProofAndTestResultDto> proofResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
|
||||
RequestStatus.DRAFT.getValue(), ActivityType.PROOF.getValue());
|
||||
for (ProofAndTestResultDto proofAndTestResultDto : proofResult) {
|
||||
proofAndTestResultDto.setRequestUrl(lisReportUrl.concat(proofAndTestResultDto.getBusNo()));
|
||||
}
|
||||
|
||||
return R.ok(proofResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检查url相关参数
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 检查url相关参数
|
||||
*/
|
||||
@Override
|
||||
public R<?> getTestResult(Long encounterId) {
|
||||
// PACS查看报告地址
|
||||
String pacsReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.PACS_REPORT_URL);
|
||||
if (StringUtils.isEmpty(pacsReportUrl)) {
|
||||
throw new ServiceException("租户配置项【PACS查看报告地址】未配置");
|
||||
}
|
||||
List<ProofAndTestResultDto> testResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
|
||||
RequestStatus.DRAFT.getValue(), ActivityType.TEST.getValue());
|
||||
for (ProofAndTestResultDto proofAndTestResultDto : testResult) {
|
||||
proofAndTestResultDto.setRequestUrl(pacsReportUrl.concat(proofAndTestResultDto.getBusNo()));
|
||||
}
|
||||
return R.ok(testResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据searchKey对医嘱列表进行排序:adviceName以searchKey(汉字)开头的排在前面 |
|
||||
* pyStr以searchKey(字母)开头的排在前面
|
||||
*
|
||||
* @param adviceList 医嘱列表
|
||||
* @param searchKey 搜索关键字
|
||||
*/
|
||||
private void sortAdviceListBySearchKey(List<AdviceBaseDto> adviceList, String searchKey) {
|
||||
if (adviceList == null || adviceList.isEmpty() || searchKey == null || searchKey.trim().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 判断searchKey是否包含字母(拼音)
|
||||
boolean isPinyinSearch = isPinyinKey(searchKey);
|
||||
|
||||
adviceList.sort((a, b) -> {
|
||||
// 根据searchKey类型选择不同的字段
|
||||
String aValue
|
||||
= isPinyinSearch ? (a.getPyStr() != null ? a.getPyStr() : a.getAdviceName()) : a.getAdviceName();
|
||||
String bValue
|
||||
= isPinyinSearch ? (b.getPyStr() != null ? b.getPyStr() : b.getAdviceName()) : b.getAdviceName();
|
||||
|
||||
// 处理可能的null值
|
||||
if (aValue == null && bValue == null) {
|
||||
return 0;
|
||||
}
|
||||
if (aValue == null) {
|
||||
return 1;
|
||||
}
|
||||
if (bValue == null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 判断两个值是否以searchKey开头
|
||||
boolean aStartsWith = aValue.toLowerCase().startsWith(searchKey.toLowerCase());
|
||||
boolean bStartsWith = bValue.toLowerCase().startsWith(searchKey.toLowerCase());
|
||||
|
||||
// 如果a以searchKey开头,而b不是,a排在前面
|
||||
if (aStartsWith && !bStartsWith) {
|
||||
return -1;
|
||||
}
|
||||
// 如果b以searchKey开头,而a不是,b排在前面
|
||||
if (bStartsWith && !aStartsWith) {
|
||||
return 1;
|
||||
}
|
||||
// 如果两者都以searchKey开头或都不以searchKey开头,保持原有顺序
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断searchKey是否为拼音(是否只包含字母)
|
||||
*/
|
||||
private boolean isPinyinKey(String searchKey) {
|
||||
if (searchKey == null || searchKey.trim().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
// 判断字符串是否只包含字母(拼音通常只包含字母)
|
||||
return searchKey.matches("[a-zA-Z]+");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
package com.openhis.web.doctorstation.appservice.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.clinical.domain.AllergyIntolerance;
|
||||
import com.openhis.clinical.mapper.AllergyIntoleranceMapper;
|
||||
import com.openhis.clinical.service.IAllergyIntoleranceService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.ClinicalStatus;
|
||||
import com.openhis.common.enums.Criticality;
|
||||
import com.openhis.common.enums.Severity;
|
||||
import com.openhis.common.enums.VerificationStatus;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.doctorstation.appservice.IDoctorStationAllergyIntolAppService;
|
||||
import com.openhis.web.doctorstation.dto.AllergyIntoInfoDto;
|
||||
import com.openhis.web.doctorstation.dto.AllergyIntoInitDto;
|
||||
|
||||
/**
|
||||
* 医生站-患者过敏与不耐受管理的实现
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/4/10
|
||||
*/
|
||||
@Service
|
||||
public class DoctorStationAllergyIntolAppServiceImpl implements IDoctorStationAllergyIntolAppService {
|
||||
|
||||
@Autowired
|
||||
private IAllergyIntoleranceService allergyIntoleranceService;
|
||||
|
||||
@Autowired
|
||||
private AllergyIntoleranceMapper allergyIntoleranceMapper;
|
||||
|
||||
/**
|
||||
* 患者过敏与不耐受数据初始化
|
||||
*
|
||||
* @return 基础数据
|
||||
*/
|
||||
@Override
|
||||
public R<?> init() {
|
||||
|
||||
AllergyIntoInitDto initDto = new AllergyIntoInitDto();
|
||||
|
||||
// 获取临床状况列表
|
||||
List<AllergyIntoInitDto.statusEnumOption> statusEnumOption1 = Stream.of(ClinicalStatus.values())
|
||||
.map(status -> new AllergyIntoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setClinicalStatusOptions(statusEnumOption1);
|
||||
|
||||
// 获取临床状况列表
|
||||
List<AllergyIntoInitDto.statusEnumOption> statusEnumOption2 = Stream.of(VerificationStatus.values())
|
||||
.map(status -> new AllergyIntoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setVerificationStatusOptions(statusEnumOption2);
|
||||
|
||||
// 获取危险程度列表
|
||||
List<AllergyIntoInitDto.statusEnumOption> statusEnumOption3 = Stream.of(Criticality.values())
|
||||
.map(status -> new AllergyIntoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setCriticalityOptions(statusEnumOption3);
|
||||
|
||||
// 获取严重程度列表
|
||||
List<AllergyIntoInitDto.statusEnumOption> statusEnumOption4 = Stream.of(Severity.values())
|
||||
.map(status -> new AllergyIntoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setSeverityOptions(statusEnumOption4);
|
||||
|
||||
return R.ok(initDto);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询患者过敏与不耐受信息
|
||||
*
|
||||
* @param patientId 患者Id
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 患者过敏与不耐受信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAllergyIntoleranceInfo(Long patientId, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<AllergyIntolerance> queryWrapper = HisQueryUtils.buildQueryWrapper(null, null, null, request);
|
||||
|
||||
// 根据患者ID查询过敏与不耐受记录
|
||||
queryWrapper.eq(CommonConstants.FieldName.PatientId, patientId);
|
||||
// 设置排序
|
||||
queryWrapper.orderByAsc(CommonConstants.FieldName.CreateTime);
|
||||
// 分页查询
|
||||
Page<AllergyIntoInfoDto> allergyIntolerancePage =
|
||||
HisPageUtils.selectPage(allergyIntoleranceMapper, queryWrapper, pageNo, pageSize, AllergyIntoInfoDto.class);
|
||||
|
||||
allergyIntolerancePage.getRecords().forEach(e -> {
|
||||
// 临床状况回显赋值
|
||||
e.setClinicalStatusEnum_enumText(EnumUtils.getInfoByValue(ClinicalStatus.class, e.getClinicalStatusEnum()));
|
||||
// 验证状态回显赋值
|
||||
e.setVerificationStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(VerificationStatus.class, e.getVerificationStatusEnum()));
|
||||
// 危险程度回显赋值
|
||||
e.setCriticalityEnum_enumText(EnumUtils.getInfoByValue(Criticality.class, e.getCriticalityEnum()));
|
||||
// 严重程度回显赋值
|
||||
e.setSeverityEnum_enumText(EnumUtils.getInfoByValue(Severity.class, e.getSeverityEnum()));
|
||||
|
||||
});
|
||||
|
||||
// 返回【患者过敏与不耐受信息】分页
|
||||
return R.ok(allergyIntolerancePage);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废当条患者过敏与不耐受信息
|
||||
*
|
||||
* @param allergyIntoInfoDto 患者过敏与不耐受信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R<?> invalidateAllergyIntolerance(AllergyIntoInfoDto allergyIntoInfoDto) {
|
||||
|
||||
AllergyIntolerance allergyIntolerance = new AllergyIntolerance();
|
||||
|
||||
// 获取当前登录账号的参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
|
||||
allergyIntolerance.setId(allergyIntoInfoDto.getId()).setClinicalStatusEnum(ClinicalStatus.RESOLVED.getValue())
|
||||
.setVerificationStatusEnum(VerificationStatus.REFUTED.getValue())
|
||||
.setTypeEnum(allergyIntoInfoDto.getTypeEnum()).setCategoryCode(allergyIntoInfoDto.getCategoryCode())
|
||||
.setCriticalityEnum(allergyIntoInfoDto.getCriticalityEnum()).setCode(allergyIntoInfoDto.getCode())
|
||||
.setPatientId(allergyIntoInfoDto.getPatientId()).setDescription(allergyIntoInfoDto.getDescription())
|
||||
.setSeverityEnum(allergyIntoInfoDto.getSeverityEnum())
|
||||
.setOnsetDateTime(allergyIntoInfoDto.getOnsetDateTime()).setCheckPractitionerId(practitionerId)
|
||||
.setLastReactionOccurrence(allergyIntoInfoDto.getLastReactionOccurrence())
|
||||
.setNote(allergyIntoInfoDto.getNote());
|
||||
|
||||
boolean result = allergyIntoleranceService.saveOrUpdateAllergyIntolerance(allergyIntolerance);
|
||||
|
||||
if (result) {
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"过敏与不耐受"}));
|
||||
} else {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增患者过敏与不耐受信息
|
||||
*
|
||||
* @param allergyIntoInfoDto 患者过敏与不耐受信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R<?> addAllergyIntoleranceInfo(AllergyIntoInfoDto allergyIntoInfoDto) {
|
||||
|
||||
AllergyIntolerance allergyIntolerance = new AllergyIntolerance();
|
||||
// 获取当前登录账号的参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
|
||||
allergyIntolerance.setId(allergyIntoInfoDto.getId()).setClinicalStatusEnum(ClinicalStatus.ACTIVE.getValue())
|
||||
.setVerificationStatusEnum(VerificationStatus.CONFIRMED.getValue())
|
||||
.setTypeEnum(allergyIntoInfoDto.getTypeEnum()).setCategoryCode(allergyIntoInfoDto.getCategoryCode())
|
||||
.setCriticalityEnum(allergyIntoInfoDto.getCriticalityEnum()).setCode(allergyIntoInfoDto.getCode())
|
||||
.setPatientId(allergyIntoInfoDto.getPatientId()).setDescription(allergyIntoInfoDto.getDescription())
|
||||
.setSeverityEnum(allergyIntoInfoDto.getSeverityEnum())
|
||||
.setOnsetDateTime(allergyIntoInfoDto.getOnsetDateTime()).setPractitionerId(practitionerId)
|
||||
.setRecordedDate(DateUtils.getNowDate())
|
||||
.setLastReactionOccurrence(allergyIntoInfoDto.getLastReactionOccurrence())
|
||||
.setNote(allergyIntoInfoDto.getNote());
|
||||
|
||||
boolean result = allergyIntoleranceService.saveOrUpdateAllergyIntolerance(allergyIntolerance);
|
||||
|
||||
if (result) {
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"过敏与不耐受"}));
|
||||
} else {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -99,12 +99,12 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
// 中医诊断
|
||||
conditionDefinition.setSourceEnum(ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_DIAGNOSIS.getValue());
|
||||
QueryWrapper<ConditionDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(conditionDefinition, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
// 设置排序
|
||||
queryWrapper.orderByDesc("update_time");
|
||||
// 诊断信息
|
||||
Page<ConditionDefinitionMetadata> conditionDefinitionMetadataPage = HisPageUtils
|
||||
.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, ConditionDefinitionMetadata.class);
|
||||
.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, ConditionDefinitionMetadata.class);
|
||||
conditionDefinitionMetadataPage.getRecords().forEach(e -> {
|
||||
// 所属分类
|
||||
e.setSourceEnum_enumText(EnumUtils.getInfoByValue(ConditionDefinitionSource.class, e.getSourceEnum()));
|
||||
@@ -134,14 +134,14 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
conditionDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||
// 中医证候
|
||||
conditionDefinition
|
||||
.setSourceEnum(ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue());
|
||||
.setSourceEnum(ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue());
|
||||
QueryWrapper<ConditionDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(conditionDefinition, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
// 设置排序
|
||||
queryWrapper.orderByDesc("update_time");
|
||||
// 诊断信息
|
||||
Page<ConditionDefinitionMetadata> conditionDefinitionMetadataPage = HisPageUtils
|
||||
.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, ConditionDefinitionMetadata.class);
|
||||
.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, ConditionDefinitionMetadata.class);
|
||||
conditionDefinitionMetadataPage.getRecords().forEach(e -> {
|
||||
// 所属分类
|
||||
e.setSourceEnum_enumText(EnumUtils.getInfoByValue(ConditionDefinitionSource.class, e.getSourceEnum()));
|
||||
@@ -186,21 +186,98 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
}
|
||||
// 保存就诊诊断
|
||||
EncounterDiagnosis encounterDiagnosis;
|
||||
|
||||
// 中医获取排序号起始值
|
||||
int startNo = 0;
|
||||
List<EncounterDiagnosis> diagnosisList = iEncounterDiagnosisService.getDiagnosisList(encounterId);
|
||||
List<EncounterDiagnosis> newdiagnosisList = new ArrayList<>();
|
||||
|
||||
newdiagnosisList
|
||||
= diagnosisList.stream().filter(diagno -> diagno.getDeleteFlag().equals("0") && diagno.getDiagSrtNo() != null)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
newdiagnosisList = newdiagnosisList.stream().sorted((d1, d2) -> d2.getDiagSrtNo().compareTo(d1.getDiagSrtNo())) // 降序
|
||||
.collect(Collectors.toList());
|
||||
if (newdiagnosisList == null || newdiagnosisList.size() == 0) {
|
||||
startNo = 1;
|
||||
} else {
|
||||
startNo = newdiagnosisList.get(0).getDiagSrtNo() + 1;
|
||||
}
|
||||
int i = 0;// 循环计数 用来区分 同组的 病 证
|
||||
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
||||
encounterDiagnosis = new EncounterDiagnosis();
|
||||
encounterDiagnosis.setId(saveDiagnosisChildParam.getEncounterDiagnosisId());
|
||||
if (saveDiagnosisChildParam.getDiagSrtNo() != null) {
|
||||
startNo = saveDiagnosisChildParam.getDiagSrtNo().intValue();
|
||||
}
|
||||
encounterDiagnosis.setEncounterId(encounterId);
|
||||
encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
||||
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
||||
encounterDiagnosis.setDiagSrtNo(saveDiagnosisChildParam.getDiagSrtNo()); // 排序号
|
||||
encounterDiagnosis.setDiagSrtNo(startNo); // 排序号
|
||||
encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
|
||||
encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
|
||||
encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
|
||||
encounterDiagnosis.setTcmFlag(Whether.YES.getValue());// 中医标识
|
||||
encounterDiagnosis.setSyndromeGroupNo(saveDiagnosisChildParam.getSyndromeGroupNo());// 中医证候组号
|
||||
iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
|
||||
if (saveDiagnosisChildParam.getDiagSrtNo() == null) {
|
||||
if (i == 1) {
|
||||
startNo++;
|
||||
i--;
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"中医诊断"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"中医诊断"}));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateTcmDiagnosis(SaveDiagnosisParam saveDiagnosisParam) {
|
||||
// 患者id
|
||||
Long patientId = saveDiagnosisParam.getPatientId();
|
||||
// 就诊ID
|
||||
Long encounterId = saveDiagnosisParam.getEncounterId();
|
||||
// 诊断定义集合
|
||||
List<SaveDiagnosisChildParam> diagnosisChildList = saveDiagnosisParam.getDiagnosisChildList();
|
||||
// 保存诊断管理
|
||||
Condition condition;
|
||||
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
||||
condition = new Condition();
|
||||
condition.setId(saveDiagnosisChildParam.getConditionId());
|
||||
condition.setVerificationStatusEnum(saveDiagnosisChildParam.getVerificationStatusEnum());
|
||||
condition.setPatientId(patientId);
|
||||
condition.setDefinitionId(saveDiagnosisChildParam.getDefinitionId());
|
||||
condition.setYbNo(saveDiagnosisChildParam.getYbNo());
|
||||
condition.setTcmFlag(Whether.YES.getValue());// 中医标识
|
||||
condition.setRecordedDatetime(new Date());
|
||||
condition.setRecorderId(SecurityUtils.getLoginUser().getPractitionerId());// 记录人
|
||||
iConditionService.saveOrUpdate(condition);
|
||||
saveDiagnosisChildParam.setConditionId(condition.getId());
|
||||
}
|
||||
// 保存就诊诊断
|
||||
EncounterDiagnosis encounterDiagnosis;
|
||||
|
||||
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
||||
if (saveDiagnosisChildParam.getUpdateId() != null) {
|
||||
String updateId = saveDiagnosisChildParam.getUpdateId();
|
||||
encounterDiagnosis = new EncounterDiagnosis();
|
||||
encounterDiagnosis.setId(Long.parseLong(updateId));
|
||||
encounterDiagnosis.setEncounterId(encounterId);
|
||||
encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
||||
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
||||
encounterDiagnosis.setDiagSrtNo(saveDiagnosisChildParam.getDiagSrtNo()); // 排序号
|
||||
encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
|
||||
encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
|
||||
encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
|
||||
iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"中医诊断"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,17 +290,17 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
public R<?> getTcmEncounterDiagnosis(Long encounterId) {
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
// 中医就诊诊断信息
|
||||
List<DiagnosisQueryDto> tcmEncounterDiagnosis =
|
||||
doctorStationChineseMedicalAppMapper.getTcmEncounterDiagnosis(encounterId);
|
||||
List<DiagnosisQueryDto> tcmEncounterDiagnosis
|
||||
= doctorStationChineseMedicalAppMapper.getTcmEncounterDiagnosis(encounterId);
|
||||
// 病
|
||||
List<DiagnosisQueryDto> illness = tcmEncounterDiagnosis.stream().filter(
|
||||
e -> ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_DIAGNOSIS.getValue().equals(e.getSourceEnum()))
|
||||
.collect(Collectors.toList());
|
||||
e -> ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_DIAGNOSIS.getValue().equals(e.getSourceEnum()))
|
||||
.collect(Collectors.toList());
|
||||
// 症
|
||||
List<DiagnosisQueryDto> symptom = tcmEncounterDiagnosis.stream()
|
||||
.filter(e -> ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue()
|
||||
.filter(e -> ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue()
|
||||
.equals(e.getSourceEnum()))
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
resultMap.put("illness", illness);
|
||||
resultMap.put("symptom", symptom);
|
||||
return R.ok(resultMap);
|
||||
@@ -244,12 +321,12 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
*/
|
||||
@Override
|
||||
public IPage<AdviceBaseDto> getTcmAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag) {
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag) {
|
||||
adviceBaseDto.setAdviceType(1); // 医嘱类型为药品
|
||||
adviceBaseDto.setCategoryCode(MedCategoryCode.CHINESE_HERBAL_MEDICINE.getValue());// 中草药
|
||||
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId,
|
||||
adviceDefinitionIdParamList, organizationId, pageNo, pageSize, pricingFlag, List.of(1, 2, 3));
|
||||
adviceDefinitionIdParamList, organizationId, pageNo, pageSize, pricingFlag, List.of(1, 2, 3), null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -263,6 +340,11 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
public R<?> saveOrSignTcmAdvice(AdviceSaveParam adviceSaveParam, String adviceOpType) {
|
||||
// 医嘱分类信息 (中草药)
|
||||
List<AdviceSaveDto> medicineList = adviceSaveParam.getAdviceSaveList();
|
||||
if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
|
||||
// 保存时——中医处方去掉不修改的药方
|
||||
medicineList = medicineList.stream().filter(e -> e.getAdviceDefinitionId() != null)
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
}
|
||||
// 保存操作
|
||||
boolean is_save = AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType);
|
||||
// 签发操作
|
||||
@@ -276,12 +358,18 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
// 是否代煎
|
||||
Integer sufferingFlag = adviceSaveParam.getSufferingFlag();
|
||||
// 中药代煎定义id
|
||||
Long sufferingDefinitionId =
|
||||
iActivityDefinitionService.getAppointActivityDefinitionId(CommonConstants.BusinessName.SUFFERING_TCM);
|
||||
Long sufferingDefinitionId
|
||||
= iActivityDefinitionService.getAppointActivityDefinitionId(CommonConstants.BusinessName.SUFFERING_TCM);
|
||||
// 保存时,校验库存
|
||||
if (is_save) {
|
||||
List<AdviceSaveDto> medUpdateList
|
||||
= medicineList.stream().filter(e -> e.getRequestId() != null).collect(Collectors.toList());
|
||||
// 编辑时,释放本身占用的库存发放
|
||||
for (AdviceSaveDto adviceSaveDto : medUpdateList) {
|
||||
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
|
||||
}
|
||||
List<AdviceSaveDto> needCheckList = medicineList.stream()
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||
// 校验库存
|
||||
String tipRes = adviceUtils.checkInventory(needCheckList);
|
||||
if (tipRes != null) {
|
||||
@@ -293,40 +381,40 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
// 费用项
|
||||
ChargeItem chargeItem;
|
||||
// 新增 + 修改
|
||||
List<AdviceSaveDto> insertOrUpdateList =
|
||||
medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
List<AdviceSaveDto> insertOrUpdateList
|
||||
= medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
// 删除
|
||||
List<AdviceSaveDto> deleteList = medicineList.stream()
|
||||
.filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||
.filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
||||
iMedicationRequestService.removeById(adviceSaveDto.getRequestId());
|
||||
// 删除已经产生的药品发放信息
|
||||
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
|
||||
// 删除费用项
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.MED_MEDICATION_REQUEST,
|
||||
adviceSaveDto.getRequestId());
|
||||
adviceSaveDto.getRequestId());
|
||||
// 删除代煎费
|
||||
iChargeItemService.remove(new LambdaQueryWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getPrescriptionNo, adviceSaveDto.getPrescriptionNo())
|
||||
.eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
.eq(ChargeItem::getPrescriptionNo, adviceSaveDto.getPrescriptionNo())
|
||||
.eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
|
||||
}
|
||||
|
||||
if (is_sign) {
|
||||
// 按groupId分组
|
||||
Map<Long, List<AdviceSaveDto>> groupMap =
|
||||
insertOrUpdateList.stream().collect(Collectors.groupingBy(AdviceSaveDto::getGroupId));
|
||||
Map<Long, List<AdviceSaveDto>> groupMap
|
||||
= insertOrUpdateList.stream().collect(Collectors.groupingBy(AdviceSaveDto::getGroupId));
|
||||
// 为每个分组生成唯一的处方号
|
||||
groupMap.forEach((groupId, groupList) -> {
|
||||
// 先查询当前groupId是否已经被签发生成过处方号
|
||||
List<MedicationRequest> list = iMedicationRequestService
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().eq(MedicationRequest::getGroupId, groupId));
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().eq(MedicationRequest::getGroupId, groupId));
|
||||
if (!list.isEmpty() && StringUtils.isNotEmpty(list.get(0).getPrescriptionNo())) {
|
||||
groupList.forEach(dto -> dto.setPrescriptionNo(list.get(0).getPrescriptionNo()));
|
||||
} else {
|
||||
String prescriptionNo =
|
||||
assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_CHINESE_HERBAL_MEDICINE.getPrefix(), 8);
|
||||
String prescriptionNo
|
||||
= assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_CHINESE_HERBAL_MEDICINE.getPrefix(), 8);
|
||||
groupList.forEach(dto -> dto.setPrescriptionNo(prescriptionNo));
|
||||
}
|
||||
});
|
||||
@@ -371,7 +459,7 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
medicationRequest.setRateCode(adviceSaveDto.getRateCode()); // 用药频次
|
||||
medicationRequest.setDose(adviceSaveDto.getDose()); // 单次剂量
|
||||
medicationRequest.setDoseUnitCode(adviceSaveDto.getDoseUnitCode()); // 剂量单位
|
||||
// medicationRequest.setDispensePerDuration(adviceSaveDto.getDispensePerDuration()); // 每次发药供应天数
|
||||
medicationRequest.setDispensePerDuration(adviceSaveDto.getDispensePerDuration()); // 每次发药供应天数
|
||||
medicationRequest.setContentJson(adviceSaveDto.getContentJson()); // 请求内容json
|
||||
medicationRequest.setYbClassEnum(adviceSaveDto.getYbClassEnum());// 类别医保编码
|
||||
medicationRequest.setDosageInstruction(adviceSaveDto.getDosageInstruction()); // 用药说明 , 即煎法
|
||||
@@ -379,8 +467,8 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
iMedicationRequestService.saveOrUpdate(medicationRequest);
|
||||
if (is_save) {
|
||||
// 处理药品发放
|
||||
Long dispenseId =
|
||||
iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
|
||||
Long dispenseId
|
||||
= iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
|
||||
|
||||
// 保存药品费用项
|
||||
chargeItem = new ChargeItem();
|
||||
@@ -441,11 +529,11 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
|
||||
// 先删除中药代煎的账单
|
||||
iChargeItemService.remove(new LambdaQueryWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getPrescriptionNo, prescriptionNo).eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
.eq(ChargeItem::getPrescriptionNo, prescriptionNo).eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
|
||||
// 对应的诊疗医嘱信息
|
||||
AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null,
|
||||
null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(3)).getRecords().get(0);
|
||||
null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(3), null).getRecords().get(0);
|
||||
if (activityAdviceBaseDto != null) {
|
||||
// 费用定价
|
||||
AdvicePriceDto advicePriceDto = activityAdviceBaseDto.getPriceList().get(0);
|
||||
@@ -483,23 +571,23 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
} else if (Whether.NO.getValue().equals(sufferingFlag)) {
|
||||
// 删除中药代煎的账单
|
||||
iChargeItemService.remove(new LambdaQueryWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getPrescriptionNo, prescriptionNo).eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
.eq(ChargeItem::getPrescriptionNo, prescriptionNo).eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
}
|
||||
|
||||
// 签发时,把草稿状态的账单更新为待收费[中医]
|
||||
if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !medicineList.isEmpty()) {
|
||||
// 签发的医嘱id集合
|
||||
List<Long> requestIds = medicineList.stream()
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType()) && e.getRequestId() != null)
|
||||
.collect(Collectors.toList()).stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType()) && e.getRequestId() != null)
|
||||
.collect(Collectors.toList()).stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
|
||||
iChargeItemService.update(new LambdaUpdateWrapper<ChargeItem>()
|
||||
.set(ChargeItem::getStatusEnum, ChargeItemStatus.PLANNED.getValue())
|
||||
.eq(ChargeItem::getEncounterId, encounterId)
|
||||
.eq(ChargeItem::getStatusEnum, ChargeItemStatus.DRAFT.getValue())
|
||||
.in(ChargeItem::getServiceId, requestIds));
|
||||
.set(ChargeItem::getStatusEnum, ChargeItemStatus.PLANNED.getValue())
|
||||
.eq(ChargeItem::getEncounterId, encounterId)
|
||||
.eq(ChargeItem::getStatusEnum, ChargeItemStatus.DRAFT.getValue())
|
||||
.in(ChargeItem::getServiceId, requestIds));
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"门诊中医医嘱"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"门诊中医医嘱"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -513,16 +601,16 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 医嘱请求数据
|
||||
List<RequestBaseDto> requestBaseInfo = doctorStationChineseMedicalAppMapper.getTcmRequestBaseInfo(encounterId,
|
||||
null, CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
null, CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||
// 请求状态
|
||||
requestBaseDto
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
// 收费状态
|
||||
requestBaseDto.setChargeStatus_enumText(
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
}
|
||||
return R.ok(requestBaseInfo);
|
||||
}
|
||||
@@ -540,16 +628,16 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 医嘱请求数据
|
||||
List<RequestBaseDto> requestBaseInfo = doctorStationChineseMedicalAppMapper.getTcmRequestHistoryInfo(
|
||||
encounterId, patientId, CommonConstants.TableName.MED_MEDICATION_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId,
|
||||
Whether.YES.getCode(), GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
encounterId, patientId, CommonConstants.TableName.MED_MEDICATION_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId,
|
||||
Whether.YES.getCode(), GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||
// 请求状态
|
||||
requestBaseDto
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
// 收费状态
|
||||
requestBaseDto.setChargeStatus_enumText(
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
}
|
||||
return R.ok(requestBaseInfo);
|
||||
}
|
||||
@@ -573,8 +661,8 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
for (Long conditionId : conditionIds) {
|
||||
iConditionService.removeById(conditionId);
|
||||
iEncounterDiagnosisService.remove(
|
||||
new LambdaQueryWrapper<EncounterDiagnosis>().eq(EncounterDiagnosis::getConditionId, conditionId));
|
||||
new LambdaQueryWrapper<EncounterDiagnosis>().eq(EncounterDiagnosis::getConditionId, conditionId));
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"就诊诊断信息"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[]{"就诊诊断信息"}));
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user