发药功能上传
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.pharmacymanage.appservice;
|
||||
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新增药品发放草稿 应用实现接口
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025/3/14
|
||||
*/
|
||||
public interface IDispenseAddAppService {
|
||||
|
||||
/**
|
||||
* 新增药品发放草稿
|
||||
*
|
||||
* @param medicationRequestList
|
||||
* @return 无
|
||||
*/
|
||||
boolean addMedicationDispense(List<MedicationRequest> medicationRequestList);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.openhis.web.pharmacymanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.pharmacymanage.dto.EncounterInfoSearchParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 处方管理 应用实现接口
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025/3/18
|
||||
*/
|
||||
public interface IWesternMedicineDispenseAppService {
|
||||
|
||||
/**
|
||||
* 页面初始化
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> init();
|
||||
|
||||
/**
|
||||
* 分页查询就诊病人列表
|
||||
*
|
||||
* @param encounterInfoSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 就诊病人分页列表
|
||||
*/
|
||||
R<?> getEncounterInfoListPage(EncounterInfoSearchParam encounterInfoSearchParam,
|
||||
Integer pageNo,
|
||||
Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
|
||||
/**
|
||||
* 查询处方单列表
|
||||
* @param encounterId 就诊号
|
||||
* @return 处方单列表
|
||||
*/
|
||||
R<?> getPrescriptionInfo(Long encounterId);
|
||||
|
||||
/**
|
||||
* 处方单核对发药
|
||||
* @param prescriptionNo 处方号
|
||||
* @return 处理结果
|
||||
*/
|
||||
R<?> medicineDispense(String prescriptionNo);
|
||||
|
||||
|
||||
/**
|
||||
* 处方单作废
|
||||
* @param prescriptionNo 处方号
|
||||
* @param notPerformedReasonEnum 未发药原因
|
||||
* @return 处理结果
|
||||
*/
|
||||
R<?> medicineCancel(String prescriptionNo,
|
||||
Integer notPerformedReasonEnum);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.openhis.web.pharmacymanage.appservice.impl;
|
||||
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.web.pharmacymanage.appservice.IDispenseAddAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 西药发放 应用实现类
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025/3/14
|
||||
*/
|
||||
@Service
|
||||
public class IDispenseAddAppServiceImpl implements IDispenseAddAppService {
|
||||
|
||||
@Resource
|
||||
IMedicationDispenseService iMedicationDispenseService;
|
||||
|
||||
/**
|
||||
* 新增药品发放草稿
|
||||
*
|
||||
* @param medicationRequestList 药品请求数据
|
||||
* @return 无
|
||||
*/
|
||||
@Override
|
||||
public boolean addMedicationDispense(List<MedicationRequest> medicationRequestList) {
|
||||
|
||||
List<MedicationDispense> medicationDispenseList = new ArrayList<>();
|
||||
MedicationDispense medicationDispense;
|
||||
|
||||
for (MedicationRequest medicationRequest : medicationRequestList) {
|
||||
|
||||
medicationDispense = new MedicationDispense();
|
||||
|
||||
// 药品发放id
|
||||
medicationDispense.setBusNo(medicationRequest.getBusNo());
|
||||
// 药品发放状态
|
||||
medicationDispense.setStatusEnum(DispenseStatus.DRAFT.getValue());
|
||||
// 状态变更时间
|
||||
medicationDispense.setStatusChangedTime(DateUtils.getNowDate());
|
||||
// 发药类型
|
||||
medicationDispense.setDispenseEnum(medicationRequest.getCategoryEnum());
|
||||
// 药品编码
|
||||
medicationDispense.setMedicationId(medicationRequest.getMedicationId());
|
||||
// 请求数量
|
||||
medicationDispense.setQuantity(medicationRequest.getQuantity());
|
||||
// 请求单位编码
|
||||
medicationDispense.setUnitCode(medicationRequest.getUnitCode());
|
||||
// 产品批号
|
||||
medicationDispense.setLotNumber(medicationRequest.getLotNumber());
|
||||
// 患者id
|
||||
medicationDispense.setPatientId(medicationRequest.getPatientId());
|
||||
// 就诊id
|
||||
medicationDispense.setEncounterId(medicationRequest.getEncounterId());
|
||||
// 支持用药信息
|
||||
medicationDispense.setSupportInfo(medicationRequest.getSupportInfo());
|
||||
// 发药人
|
||||
medicationDispense.setPractitionerId(0L);
|
||||
// 发放药房
|
||||
medicationDispense.setLocationId(medicationRequest.getPerformOrg());
|
||||
// 药品请求id
|
||||
medicationDispense.setMedReqId(medicationRequest.getId());
|
||||
// 已发药数量
|
||||
medicationDispense.setDispenseQuantity(0);
|
||||
// 用法
|
||||
medicationDispense.setMethodCode(medicationRequest.getMethodCode());
|
||||
// 用药频次
|
||||
medicationDispense.setFrequencyCode(medicationRequest.getRateCode());
|
||||
// 单次剂量
|
||||
medicationDispense.setDose(medicationRequest.getDose());
|
||||
// 剂量单位
|
||||
medicationDispense.setDoseUnitCode(medicationRequest.getDoseUnitCode());
|
||||
// 单次最大剂量
|
||||
medicationDispense.setMaxUnit(medicationRequest.getMaxDose());
|
||||
|
||||
medicationDispenseList.add(medicationDispense);
|
||||
}
|
||||
return iMedicationDispenseService.saveBatch(medicationDispenseList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
package com.openhis.web.pharmacymanage.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.DateUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.DispenseStatusEnum;
|
||||
import com.openhis.common.enums.NotPerformedReasonEnum;
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.web.pharmacymanage.appservice.IWesternMedicineDispenseAppService;
|
||||
import com.openhis.web.pharmacymanage.dto.*;
|
||||
import com.openhis.web.pharmacymanage.mapper.WesternMedicineDispenseMapper;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 西药发放 应用实现类
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025/3/14
|
||||
*/
|
||||
@Service
|
||||
public class IWesternMedicineDispenseAppServiceImpl implements IWesternMedicineDispenseAppService {
|
||||
|
||||
@Autowired
|
||||
private IOrganizationService iOrganizationService;
|
||||
|
||||
@Autowired
|
||||
IMedicationDispenseService iMedicationDispenseService;
|
||||
|
||||
@Autowired
|
||||
IInventoryItemService iInventoryItemService;
|
||||
|
||||
@Autowired
|
||||
WesternMedicineDispenseMapper westernMedicineDispenseMapper;
|
||||
|
||||
/**
|
||||
* 获取页面初始化信息
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> init() {
|
||||
|
||||
PageInitDto initDto = new PageInitDto();
|
||||
|
||||
// 获取科室下拉选列表
|
||||
List<Organization> organizationList = iOrganizationService.getList(OrganizationClass.CLINIC.getValue());
|
||||
List<PageInitDto.DepartmentOption> organizationOptions = organizationList.stream()
|
||||
.map(organization -> new PageInitDto.DepartmentOption(organization.getId(),
|
||||
organization.getName())).collect(Collectors.toList());
|
||||
|
||||
// 未发药原因下拉选列表
|
||||
List<PageInitDto.NotPerformedReasonOption> notPerformedReasonOptions =
|
||||
Stream.of(NotPerformedReasonEnum.values()).map(notPerformedReason ->
|
||||
new PageInitDto.NotPerformedReasonOption(notPerformedReason.getValue(),
|
||||
notPerformedReason.getInfo())).collect(Collectors.toList());
|
||||
|
||||
initDto.setDepartmentOptions(organizationOptions).setNotPerformedReasonOptions(notPerformedReasonOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询就诊病人列表
|
||||
*
|
||||
* @param encounterInfoSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 就诊病人列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEncounterInfoListPage(EncounterInfoSearchParam encounterInfoSearchParam,
|
||||
Integer pageNo,
|
||||
Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
|
||||
// 查询条件设定
|
||||
String condition = encounterInfoSearchParam.getCondition();
|
||||
if (!condition.isEmpty()){
|
||||
Pattern pattern = Pattern.compile(".*\\d.*");
|
||||
Matcher matcher = pattern.matcher(encounterInfoSearchParam.getCondition());
|
||||
encounterInfoSearchParam.setIdCard(matcher.find() ? condition:"");
|
||||
encounterInfoSearchParam.setPatientName(!matcher.find() ? condition:"");
|
||||
}
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<EncounterInfoSearchParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(encounterInfoSearchParam,null,null, request);
|
||||
|
||||
// 查询就诊病人列表
|
||||
Page<EncounterInfoPageDto> encounterInfoPageDto = westernMedicineDispenseMapper.selectEncounterInfoListPage(
|
||||
new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
return R.ok(encounterInfoPageDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询处方单列表
|
||||
* @param encounterId 就诊号
|
||||
* @return 处方单列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPrescriptionInfo(Long encounterId) {
|
||||
|
||||
// 患者基本信息查询
|
||||
PrescriptionPatientInfoDto prescriptionPatientInfoDto = westernMedicineDispenseMapper.
|
||||
selectPrescriptionPatientInfo(encounterId);
|
||||
|
||||
// 处方单信息查询
|
||||
List<PrescriptionMedicineInfoDto> prescriptionMedicineInfoList = westernMedicineDispenseMapper.
|
||||
selectPrescriptionMedicineInfoList(encounterId);
|
||||
|
||||
// 计算合计金额
|
||||
if(!prescriptionMedicineInfoList.isEmpty()) {
|
||||
BigDecimal totalPrice = new BigDecimal(0);
|
||||
for (PrescriptionMedicineInfoDto item : prescriptionMedicineInfoList) {
|
||||
totalPrice.add(item.getTotal_price());
|
||||
}
|
||||
prescriptionPatientInfoDto.setTotalPrice(totalPrice);
|
||||
}
|
||||
|
||||
PrescriptionInfoDto prescriptionInfoDto = new PrescriptionInfoDto();
|
||||
prescriptionInfoDto.setPrescriptionPatientInfoDto(prescriptionPatientInfoDto);
|
||||
prescriptionInfoDto.setPrescriptionMedicineInfoDtoList(prescriptionMedicineInfoList);
|
||||
|
||||
return R.ok(prescriptionInfoDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处方单核对发药
|
||||
* @param prescriptionNo 处方号
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> medicineDispense(String prescriptionNo) {
|
||||
|
||||
List<MedicationDispense> medicationDispenseList = new ArrayList<>();
|
||||
List<InventoryItem> inventoryItemList = new ArrayList<>();
|
||||
boolean iMedicationDispenseUpdFlg = true;
|
||||
boolean iInventoryItemUpdFlg = true;
|
||||
|
||||
// 获取药品待发放和库存信息
|
||||
List<DispenseInventoryDto> dispenseInventoryList = westernMedicineDispenseMapper.
|
||||
selectDispenseInventoryInfoByPrescriptionNo(prescriptionNo);
|
||||
if(!dispenseInventoryList.isEmpty()){
|
||||
MedicationDispense medicationDispense;
|
||||
InventoryItem inventoryItem;
|
||||
for (DispenseInventoryDto dispenseInventoryDto : dispenseInventoryList) {
|
||||
|
||||
// 药品发放表项目设定
|
||||
medicationDispense = new MedicationDispense();
|
||||
// id
|
||||
medicationDispense.setId(dispenseInventoryDto.getDispenseId());
|
||||
// 药品发放状态
|
||||
medicationDispense.setStatusEnum(DispenseStatusEnum.COMPLETED.getValue());
|
||||
// 状态变更时间
|
||||
medicationDispense.setStatusChangedTime(DateUtils.getNowDate());
|
||||
// 发药人
|
||||
medicationDispense.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId());
|
||||
// 已发药数量
|
||||
medicationDispense.setDispenseQuantity(dispenseInventoryDto.getDispenseQuantity());
|
||||
// 配药时间
|
||||
medicationDispense.setPrepareTime(DateUtils.getNowDate());
|
||||
// 发药时间
|
||||
medicationDispense.setDispenseTime(DateUtils.getNowDate());
|
||||
medicationDispenseList.add(medicationDispense);
|
||||
|
||||
// 库存表项目设定
|
||||
inventoryItem = new InventoryItem();
|
||||
// 库存数量
|
||||
if (dispenseInventoryDto.getDispenseUnitCode().equals(dispenseInventoryDto.
|
||||
getInventoryBaseUnitCode())) {
|
||||
|
||||
// id
|
||||
inventoryItem.setId(dispenseInventoryDto.getInventoryId());
|
||||
// 包装数量
|
||||
inventoryItem.setBaseQuantity(new BigDecimal(dispenseInventoryDto.getDispenseQuantity()));
|
||||
// 拆零数量(拆零比×包装数量)
|
||||
inventoryItem.setMinQuantity(dispenseInventoryDto.getPartPercent().
|
||||
multiply(new BigDecimal(dispenseInventoryDto.getDispenseQuantity())));
|
||||
} else if (dispenseInventoryDto.getDispenseUnitCode().equals(dispenseInventoryDto.
|
||||
getInventoryMinUnitCode())) {
|
||||
// 拆零数量
|
||||
inventoryItem.setMinQuantity(new BigDecimal(dispenseInventoryDto.getDispenseQuantity()));
|
||||
// 包装数量(拆零数量÷拆零比)
|
||||
inventoryItem.setBaseQuantity(new BigDecimal(dispenseInventoryDto.getDispenseQuantity()).
|
||||
divide(dispenseInventoryDto.getPartPercent(),RoundingMode.HALF_UP));
|
||||
}
|
||||
inventoryItemList.add(inventoryItem);
|
||||
}
|
||||
// 药品发放更新
|
||||
iMedicationDispenseUpdFlg = iMedicationDispenseService.updateBatchById(medicationDispenseList);
|
||||
|
||||
// 库存更新
|
||||
iInventoryItemUpdFlg = iInventoryItemService.updateBatchById(inventoryItemList);
|
||||
}
|
||||
return iMedicationDispenseUpdFlg && iInventoryItemUpdFlg ?
|
||||
R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废
|
||||
* @param prescriptionNo 处方号
|
||||
* @param notPerformedReasonEnum 未发药原因
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> medicineCancel(String prescriptionNo,
|
||||
Integer notPerformedReasonEnum) {
|
||||
|
||||
List<MedicationDispense> medicationDispenseList = new ArrayList<>();
|
||||
boolean iMedicationDispenseUpdFlg = true;
|
||||
|
||||
// 获取药品待发放记录
|
||||
List<DispenseInventoryDto> dispenseInventoryList = westernMedicineDispenseMapper.
|
||||
selectDispenseInventoryInfoByPrescriptionNo(prescriptionNo);
|
||||
if(!dispenseInventoryList.isEmpty()){
|
||||
MedicationDispense medicationDispense;
|
||||
for (DispenseInventoryDto dispenseInventoryDto : dispenseInventoryList) {
|
||||
|
||||
// 药品发放表项目设定
|
||||
medicationDispense = new MedicationDispense();
|
||||
// id
|
||||
medicationDispense.setId(dispenseInventoryDto.getDispenseId());
|
||||
// 药品发放状态
|
||||
medicationDispense.setStatusEnum(DispenseStatusEnum.DECLINED.getValue());
|
||||
// 未发药原因
|
||||
medicationDispense.setNotPerformedReasonEnum(notPerformedReasonEnum);
|
||||
// 状态变更时间
|
||||
medicationDispense.setStatusChangedTime(DateUtils.getNowDate());
|
||||
// 发药人
|
||||
medicationDispense.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId());
|
||||
medicationDispenseList.add(medicationDispense);
|
||||
}
|
||||
// 药品发放更新
|
||||
iMedicationDispenseUpdFlg = iMedicationDispenseService.updateBatchById(medicationDispenseList);
|
||||
}
|
||||
return iMedicationDispenseUpdFlg?
|
||||
R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.openhis.web.pharmacymanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.pharmacymanage.appservice.IWesternMedicineDispenseAppService;
|
||||
import com.openhis.web.pharmacymanage.dto.EncounterInfoSearchParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 西药发药
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025/3/14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pharmacy-manage/western-medicine-dispense")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class WesternMedicineDispenseController {
|
||||
|
||||
@Autowired
|
||||
public IWesternMedicineDispenseAppService iWesternMedicineDispenseService;
|
||||
|
||||
/**
|
||||
* 获取页面初始化信息
|
||||
*
|
||||
* @return 初始化信息
|
||||
*/
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> medicineDispenseInit() {
|
||||
return iWesternMedicineDispenseService.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询就诊病人列表
|
||||
*
|
||||
* @param encounterInfoSearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 就诊病人列表
|
||||
*/
|
||||
@GetMapping("/encounter-list")
|
||||
public R<?> getEncounterInfoList(EncounterInfoSearchParam encounterInfoSearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
return iWesternMedicineDispenseService.getEncounterInfoListPage(encounterInfoSearchParam,
|
||||
pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处方单查询
|
||||
*
|
||||
* @param encounterId 就诊Id
|
||||
*/
|
||||
@GetMapping("/prescription-list")
|
||||
public R<?> getPatientInfoList(@RequestParam(value = "encounterId") Long encounterId) {
|
||||
return iWesternMedicineDispenseService.getPrescriptionInfo(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 核对发药
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
*/
|
||||
@GetMapping("/medicine-dispense")
|
||||
public R<?> medicineDispense(@RequestParam(value = "prescriptionNo") String prescriptionNo) {
|
||||
return iWesternMedicineDispenseService.medicineDispense(prescriptionNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @param notPerformedReasonEnum 未发药原因
|
||||
*/
|
||||
@GetMapping("/medicine-cancel")
|
||||
public R<?> medicineCancel(@RequestParam(value = "prescriptionNo") String prescriptionNo,
|
||||
@RequestParam(value = "prescriptionNo") Integer notPerformedReasonEnum) {
|
||||
return iWesternMedicineDispenseService.medicineCancel(prescriptionNo,notPerformedReasonEnum);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 药品发放和库存表连接信息
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DispenseInventoryDto {
|
||||
|
||||
/** 药品发放表主键ID */
|
||||
private Long dispenseId;
|
||||
|
||||
/** 请求单位编码 */
|
||||
private String dispenseUnitCode;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer dispenseQuantity;
|
||||
|
||||
/** 库存项目表主键ID */
|
||||
private Long inventoryId;
|
||||
|
||||
/** 常规单位 */
|
||||
private String inventoryBaseUnitCode;
|
||||
|
||||
/** 当前库存数量(常规单位) */
|
||||
private BigDecimal inventoryBaseQuantity;
|
||||
|
||||
/** 最小单位 */
|
||||
private String inventoryMinUnitCode;
|
||||
|
||||
/** 当前库存数量(最小单位数量) */
|
||||
private BigDecimal inventoryMinQuantity;
|
||||
|
||||
/** 拆零比 */
|
||||
private BigDecimal partPercent;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 就诊人员列表
|
||||
*
|
||||
* @author WangYang
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterInfoPageDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 就诊ID */
|
||||
private Long encounterId;
|
||||
|
||||
/** 科室 */
|
||||
private String departmentName;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 性别 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 就诊日期 */
|
||||
private String encounterDate;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 处方列表查询条件
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterInfoSearchParam implements Serializable {
|
||||
|
||||
/** 科室 */
|
||||
private long departmentId;
|
||||
|
||||
/** 患者姓名或者证件号 */
|
||||
private String condition;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 证件号 */
|
||||
private String idCard;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PageInitDto {
|
||||
|
||||
/** 科室列表 */
|
||||
private List<DepartmentOption> departmentOptions;
|
||||
|
||||
/** 未发药原因 */
|
||||
private List<NotPerformedReasonOption> notPerformedReasonOptions;
|
||||
|
||||
@Data
|
||||
public static class DepartmentOption {
|
||||
|
||||
private Long value;
|
||||
private String label;
|
||||
|
||||
public DepartmentOption(Long value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class NotPerformedReasonOption {
|
||||
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public NotPerformedReasonOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 处方信息
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PrescriptionInfoDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 患者基本信息 */
|
||||
private PrescriptionPatientInfoDto prescriptionPatientInfoDto;
|
||||
|
||||
/** 处方药品信息 */
|
||||
List<PrescriptionMedicineInfoDto> prescriptionMedicineInfoDtoList;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 就诊人员列表
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PrescriptionMedicineInfoDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 科室 */
|
||||
private String departmentName;
|
||||
|
||||
/** 开单医生 */
|
||||
private String doctorName;
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 药品名称 */
|
||||
private String medicineName;
|
||||
|
||||
/** 规格 */
|
||||
private String totalVolume;
|
||||
|
||||
/** 单次剂量 */
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 用药频次 */
|
||||
private String rateCode;
|
||||
|
||||
/** 用法 */
|
||||
private String methodCode;
|
||||
|
||||
/** 剂量单位 */
|
||||
private String doseUnitCode;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
private BigDecimal maxDose;
|
||||
|
||||
/** 首次用量 */
|
||||
private BigDecimal firstDose;
|
||||
|
||||
/** 首次持续时间 */
|
||||
private String firstDuration;
|
||||
|
||||
/** 给药间隔 */
|
||||
private String dispenseInterval;
|
||||
|
||||
/** 单次发药数 */
|
||||
private Integer dispensePerQuantity;
|
||||
|
||||
/** 每次发药供应天数 */
|
||||
private Integer dispensePerDuration;
|
||||
|
||||
/** 数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 金额 */
|
||||
private BigDecimal total_price;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 患者基本信息
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PrescriptionPatientInfoDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 性别 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
private Date birth_date;
|
||||
|
||||
/** 年龄 */
|
||||
private String age;
|
||||
|
||||
/** 合同类型 */
|
||||
private Integer categoryEnum;
|
||||
private String categoryEnum_enumText;
|
||||
|
||||
/** 证件号 */
|
||||
private String idCard;
|
||||
|
||||
/** 就诊科室 */
|
||||
private String organizationName;
|
||||
|
||||
/** 就诊日期 */
|
||||
private String encounterDate;
|
||||
|
||||
/** 门诊诊断 */
|
||||
private String diagnoseName;
|
||||
|
||||
/** 总金额 */
|
||||
private BigDecimal totalPrice;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.pharmacymanage.dto.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface WesternMedicineDispenseMapper {
|
||||
|
||||
/**
|
||||
* 就诊病人列表分页查询
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 就诊病人列表
|
||||
*/
|
||||
Page<EncounterInfoPageDto> selectEncounterInfoListPage(@Param("page") Page<EncounterInfoPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<EncounterInfoSearchParam> queryWrapper);
|
||||
|
||||
/**
|
||||
* 患者基本信息查询
|
||||
* @param encounterId 就诊号
|
||||
* @return 患者基本信息
|
||||
*/
|
||||
PrescriptionPatientInfoDto selectPrescriptionPatientInfo(@Param("encounterId") Long encounterId);
|
||||
|
||||
|
||||
/**
|
||||
* 处方单查询
|
||||
* @param encounterId 就诊号
|
||||
* @return 处方单列表
|
||||
*/
|
||||
List<PrescriptionMedicineInfoDto> selectPrescriptionMedicineInfoList(@Param("encounterId") Long encounterId);
|
||||
|
||||
/**
|
||||
* 待发药和库存信息查询
|
||||
* @param prescriptionNo 处方号
|
||||
* @return 待发药信息
|
||||
*/
|
||||
List<DispenseInventoryDto> selectDispenseInventoryInfoByPrescriptionNo(@Param("prescriptionNo") String prescriptionNo);
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.web.pharmacymanage.mapper.WesternMedicineDispenseMapper">
|
||||
<select id="selectEncounterInfoListPage" resultType="com.openhis.web.pharmacymanage.dto.EncounterInfoPageDto">
|
||||
SELECT
|
||||
encounter_id,
|
||||
organization_id,
|
||||
department_name,
|
||||
id_card,
|
||||
patient_name,
|
||||
gender_enum,
|
||||
encounter_date
|
||||
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
DISTINCT
|
||||
T2.id AS encounter_id,
|
||||
TO_CHAR(T2.start_time,'YYYY-MM-DD') AS encounter_date,
|
||||
T2.organization_id,
|
||||
T3.gender_enum,
|
||||
T3.name AS patient_name,
|
||||
T3.id_card,
|
||||
T6.name AS department_name
|
||||
|
||||
FROM med_medication_dispense AS T1
|
||||
|
||||
INNER JOIN adm_encounter AS T2
|
||||
ON T1.encounter_id = T2.id
|
||||
|
||||
INNER JOIN adm_patient AS T3
|
||||
ON T1.patient_id = T3.id
|
||||
|
||||
INNER JOIN med_medication AS T4
|
||||
ON T1.medication_id = T4.id
|
||||
|
||||
INNER JOIN med_medication_definition AS T5
|
||||
ON T4.medication_def_id = T5.id
|
||||
AND T5.category_code IN ('1','2')
|
||||
|
||||
INNER JOIN adm_organization AS T6
|
||||
ON T2.organization_id = T6.id
|
||||
|
||||
WHERE
|
||||
T1.status_enum = 3
|
||||
|
||||
ORDER BY
|
||||
T2.start_time desc,
|
||||
T2.organization_id
|
||||
)
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="selectPrescriptionPatientInfo" resultType="com.openhis.web.pharmacymanage.dto.PrescriptionPatientInfoDto">
|
||||
SELECT
|
||||
DISTINCT
|
||||
T1.name AS patient_name,
|
||||
T1.gender_enum,
|
||||
T1.birth_date,
|
||||
T4.category_enum,
|
||||
T1.id_card,
|
||||
T5.name AS organization_name,
|
||||
TO_CHAR(T2.start_time,'YYYY-MM-DD') AS encounter_date
|
||||
|
||||
FROM adm_encounter AS T1
|
||||
|
||||
INNER JOIN adm_patient AS T2
|
||||
ON T1.id = T2.encounter_id
|
||||
|
||||
INNER JOIN med_medication_request AS T3
|
||||
ON T1.id = T3.encounter_id
|
||||
|
||||
INNER JOIN fin_contract AS T4
|
||||
ON T3.contract_no = T4.bus_no
|
||||
|
||||
INNER JOIN adm_organization AS T5
|
||||
ON T1.organization_id = T5.id
|
||||
|
||||
WHERE
|
||||
T1.id = #{encounterId}
|
||||
</select>
|
||||
<select id="selectPrescriptionMedicineInfoList" resultType="com.openhis.web.pharmacymanage.dto.PrescriptionMedicineInfoDto">
|
||||
SELECT
|
||||
T7.name AS department_name,
|
||||
T8.name AS doctor_name,
|
||||
T1.prescription_no,
|
||||
T3.name AS medicine_name,
|
||||
T2.total_volume,
|
||||
T1.dose,
|
||||
T1.rate_code,
|
||||
T1.method_code,
|
||||
T1.dose_unit_code,
|
||||
T1.max_dose,
|
||||
T1.first_dose,
|
||||
T1.first_duration,
|
||||
T1.dispense_interval,
|
||||
T1.dispense_per_quantity,
|
||||
T1.dispense_per_duration,
|
||||
T1.quantity,
|
||||
T4.unit_price,
|
||||
T4.total_price
|
||||
|
||||
FROM med_medication_request AS T1
|
||||
|
||||
INNER JOIN med_medication AS T2
|
||||
ON T1.medication_id = T2.id
|
||||
|
||||
INNER JOIN med_medication_definition AS T3
|
||||
ON T2.medication_def_id = T3.id
|
||||
AND T3.category_code IN ('1','2')
|
||||
|
||||
INNER JOIN adm_charge_item AS T4
|
||||
ON T1.id = T4.service_id
|
||||
|
||||
INNER JOIN med_medication_dispense AS T5
|
||||
ON T1.id = T5.med_req_id
|
||||
|
||||
INNER JOIN adm_encounter AS T6
|
||||
ON T1.encounter_id = T6.id
|
||||
|
||||
INNER JOIN adm_organization AS T7
|
||||
ON T6.organization_id = T7.id
|
||||
|
||||
INNER JOIN adm_practitioner AS T8
|
||||
ON T1.practitioner_id = T8.id
|
||||
|
||||
WHERE
|
||||
T1.encountId = #{encounterId}
|
||||
AND T5.status_enum = 3
|
||||
|
||||
ORDER BY
|
||||
T1.prescription_no,
|
||||
T1.medication_id
|
||||
</select>
|
||||
<select id="selectDispenseInventoryInfoByPrescriptionNo" resultType="com.openhis.web.pharmacymanage.dto.DispenseInventoryDto">
|
||||
SELECT
|
||||
T1.id AS dispense_id,
|
||||
T1.unit_code AS dispense_unit_code,
|
||||
T1.quantity AS dispense_quantity,
|
||||
T3.Id AS inventory_id,
|
||||
T3.base_unit_code AS inventory_base_unit_code,
|
||||
T3.base_quantity AS inventory_base_quantity,
|
||||
T3.min_unit_code AS inventory_min_unit_code,
|
||||
T3.min_quantity AS inventory_min_quantity,
|
||||
T5.part_percent
|
||||
|
||||
FROM med_medication_dispense AS T1
|
||||
|
||||
INNER JOIN med_medication_request AS T2
|
||||
ON T1.med_req_id = T2.id
|
||||
|
||||
INNER JOIN wor_inventory_item AS T3
|
||||
ON T1.medication_id = T3.item_id
|
||||
AND T1.item_table = 'med_medication_definition'
|
||||
|
||||
INNER JOIN med_medication AS T4
|
||||
ON T1.medication_id = T4.id
|
||||
|
||||
INNER JOIN med_medication_definition AS T5
|
||||
ON T4.medication_def_id = T5.id
|
||||
|
||||
WHERE
|
||||
T2.prescription_no = #{prescriptionNo}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 药品请求状态
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DispenseStatusEnum implements HisEnumInterface {
|
||||
|
||||
/**
|
||||
* 草稿
|
||||
*/
|
||||
DRAFT(0, "DR", "草稿"),
|
||||
|
||||
/**
|
||||
* 待配药
|
||||
*/
|
||||
PREPARATION(1, "PR", "待配药"),
|
||||
|
||||
/**
|
||||
* 待发药
|
||||
*/
|
||||
IN_PROGRESS(2, "IN", "待发药"),
|
||||
|
||||
/**
|
||||
* 已发药
|
||||
*/
|
||||
COMPLETED(3, "CO", "已发药"),
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
*/
|
||||
ON_HOLD(4, "ON", "暂停"),
|
||||
|
||||
/**
|
||||
* 停止
|
||||
*/
|
||||
STOPPED(5, "ST", "停止"),
|
||||
|
||||
/**
|
||||
* 未知
|
||||
*/
|
||||
UNKNOWN(6, "UN", "未知"),
|
||||
|
||||
/**
|
||||
* 拒绝发药 已汇总,部分发药,部分退药,已退药
|
||||
*/
|
||||
DECLINED(7, "DE", "拒绝发药 已汇总,部分发药,部分退药,已退药");
|
||||
|
||||
private Integer value;
|
||||
private String code;
|
||||
private String info;
|
||||
|
||||
public static DispenseStatusEnum getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (DispenseStatusEnum val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 药品请求状态
|
||||
*
|
||||
* @author wangyang
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum NotPerformedReasonEnum implements HisEnumInterface {
|
||||
|
||||
/**
|
||||
* 订单已停止
|
||||
*/
|
||||
ORDER_STOPPED(1,"OS", "订单已停止"),
|
||||
|
||||
/**
|
||||
* 过时订单
|
||||
*/
|
||||
OUTDATED_ORDER(2, "OO", "过时订单"),
|
||||
|
||||
/**
|
||||
* 不完整的数据
|
||||
*/
|
||||
INCOMPLETE_DATA(3, "ID", "不完整的数据"),
|
||||
|
||||
/**
|
||||
* 产品不可用
|
||||
*/
|
||||
PRODUCT_NOT_AVAILABLE(4, "PNA", "产品不可用"),
|
||||
|
||||
/**
|
||||
* 道德/宗教
|
||||
*/
|
||||
MORAL_RELIGIOUS(5, "MR", "道德/宗教"),
|
||||
|
||||
/**
|
||||
* 无法提供护理
|
||||
*/
|
||||
UNABLE_PROVIDE(6, "UP", "无法提供护理"),
|
||||
|
||||
/**
|
||||
* 先尝试其他治疗方法
|
||||
*/
|
||||
OTHER_TREATMENT(7, "OT", "先尝试其他治疗方法"),
|
||||
|
||||
/**
|
||||
* 处方/请求需要澄清
|
||||
*/
|
||||
PRESCRIPTION_REQUEST_CLARIFICATION(8, "PRC", "处方/请求需要澄清"),
|
||||
|
||||
/**
|
||||
* 药物水平过高
|
||||
*/
|
||||
EXCESSIVE_DRUG_LEVELS(9, "EDL", "药物水平过高"),
|
||||
|
||||
/**
|
||||
* 入院
|
||||
*/
|
||||
HOSPITALIZED(10, "HO", "入院"),
|
||||
|
||||
/**
|
||||
* 实验室干扰问题
|
||||
*/
|
||||
LABORATORY_INTERFERENCE_ISSUE(11, "LII", "实验室干扰问题"),
|
||||
|
||||
/**
|
||||
* 患者不可用
|
||||
*/
|
||||
PATIENT_UNAVAILABLE(12, "PU", "患者不可用"),
|
||||
|
||||
/**
|
||||
* 患者怀孕或哺乳
|
||||
*/
|
||||
PATIENT_PREGNANT_BREASTFEEDING(13, "PPB", "患者怀孕或哺乳"),
|
||||
|
||||
/**
|
||||
* 过敏
|
||||
*/
|
||||
ALLERGY(14, "AL", "过敏"),
|
||||
|
||||
/**
|
||||
* 药物与另一种药物相互作用
|
||||
*/
|
||||
ANOTHER_DRUG(15, "AD", "药物与另一种药物相互作用"),
|
||||
|
||||
/**
|
||||
* 重复治疗
|
||||
*/
|
||||
REPEAT_TREATMENT(16, "RT", "重复治疗"),
|
||||
|
||||
/**
|
||||
* 疑似不耐受
|
||||
*/
|
||||
SUSPECTED_INTOLERANCE(17, "SI", "疑似不耐受"),
|
||||
|
||||
/**
|
||||
* 计划手术的患者
|
||||
*/
|
||||
PATIENTS_PLANNING_SURGERY(18, "PPS", "计划手术的患者"),
|
||||
|
||||
/**
|
||||
* 冲洗
|
||||
*/
|
||||
WASH(19, "WA", "冲洗"),
|
||||
|
||||
/**
|
||||
* 药物缺货
|
||||
*/
|
||||
DRUG_SHORTAGE(20, "DS", "药物缺货"),
|
||||
|
||||
/**
|
||||
* 药物不可用
|
||||
*/
|
||||
MEDICATION_NOT_AVAILABLE(21, "MNA", "药物不可用");
|
||||
|
||||
private Integer value;
|
||||
private String code;
|
||||
private String info;
|
||||
|
||||
public static NotPerformedReasonEnum getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (NotPerformedReasonEnum val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.openhis.administration.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机构管理Service接口
|
||||
*
|
||||
@@ -27,4 +29,11 @@ public interface IOrganizationService extends IService<Organization> {
|
||||
*/
|
||||
boolean inactiveOrg(Long orgId);
|
||||
|
||||
/**
|
||||
* 获取机构下拉列表
|
||||
*
|
||||
* @param classEnum 机构分类
|
||||
* @return 机构下拉列表
|
||||
*/
|
||||
List<Organization> getList(Integer classEnum);
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.mapper.OrganizationMapper;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机构管理Service业务层处理
|
||||
@@ -45,4 +47,15 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构下拉列表
|
||||
*
|
||||
* @param classEnum 机构分类
|
||||
* @return 机构下拉列表
|
||||
*/
|
||||
@Override
|
||||
public List<Organization> getList(Integer classEnum) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<Organization>().select(Organization::getId, Organization::getName)
|
||||
.eq(Organization::getClassEnum, classEnum));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user