药品目录更新
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package com.openhis.web.datadictionary.appservice;
|
||||
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.DeviceDefinition;
|
||||
import com.openhis.medication.domain.MedicationDetail;
|
||||
import com.openhis.web.datadictionary.dto.DeviceManageUpDto;
|
||||
import com.openhis.web.datadictionary.dto.MedicationManageUpDto;
|
||||
|
||||
/**
|
||||
@@ -19,4 +22,20 @@ public interface IItemDefinitionService {
|
||||
*/
|
||||
boolean addItem(MedicationManageUpDto medicationManageUpDto, MedicationDetail medicationDetail);
|
||||
|
||||
|
||||
// /**
|
||||
// * 添加器材的项目定价
|
||||
// *
|
||||
// * @param deviceManageUpDto 器材目录信息
|
||||
// * @param deviceDefinition 器材信息
|
||||
// */
|
||||
// boolean addItem(DeviceManageUpDto deviceManageUpDto, DeviceDefinition deviceDefinition);
|
||||
|
||||
/**
|
||||
* 修改项目定价表
|
||||
*
|
||||
* @param chargeItemDefinition 项目定价表信息
|
||||
*/
|
||||
boolean updateItem(ChargeItemDefinition chargeItemDefinition);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.openhis.web.datadictionary.dto.MedicationSearchParam;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -32,14 +33,11 @@ public interface IMedicationManageAppService {
|
||||
* 药品目录查询
|
||||
*
|
||||
* @param searchKey 查询条件
|
||||
* @param ybMatchFlag 查询条件-是否对码
|
||||
* @param statusEnum 查询条件-状态
|
||||
* @param categoryCode 查询条件-药品分类
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 药品目录查询结果
|
||||
*/
|
||||
R<?> getMedicationList(String searchKey, Integer ybMatchFlag, Integer statusEnum, String categoryCode,
|
||||
R<?> getMedicationList(MedicationSearchParam medicationSearchParam,String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.openhis.web.datadictionary.appservice.impl;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.openhis.common.enums.ConditionCode;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -34,6 +36,7 @@ public class ItemDefinitionServiceImpl implements IItemDefinitionService {
|
||||
@Autowired
|
||||
IChargeItemDefDetailService chargeItemDefDetailService;
|
||||
|
||||
|
||||
/**
|
||||
* 添加项目定价
|
||||
*
|
||||
@@ -52,7 +55,7 @@ public class ItemDefinitionServiceImpl implements IItemDefinitionService {
|
||||
// .setOrgId(SecurityUtils.getLoginUser().getOrgId())
|
||||
.setOrgId(1l)// todo 没数据先写死
|
||||
// 财务类别
|
||||
.setTypeCode(medicationManageUpDto.getMinimalFee())
|
||||
.setTypeCode(medicationManageUpDto.getTypeCode())
|
||||
// 医保类别
|
||||
.setYbType(medicationManageUpDto.getYbType()).setConditionFlag(Whether.YES.getValue())
|
||||
.setPrice(medicationManageUpDto.getRetailPrice());
|
||||
@@ -62,17 +65,17 @@ public class ItemDefinitionServiceImpl implements IItemDefinitionService {
|
||||
List<ChargeItemDefDetail> shargeItemDefDetails = new ArrayList<>();
|
||||
ChargeItemDefDetail chargeItemDefDetail1 = new ChargeItemDefDetail();
|
||||
chargeItemDefDetail1.setDefinitionId(chargeItemDefinition.getId())
|
||||
// 单位+批次(unit,pici) 用,符号拼装
|
||||
.setConditionCode(StringUtils.joinStrings(
|
||||
medicationManageUpDto.getDoseUnitCode_dictText() + "," + medicationManageUpDto.getLotNumber()))
|
||||
// 条件:采购
|
||||
.setConditionCode(ConditionCode.PROCUREMENT.getCode())
|
||||
// 购入价
|
||||
.setAmount(medicationManageUpDto.getPurchasePrice());
|
||||
|
||||
ChargeItemDefDetail chargeItemDefDetail2 = new ChargeItemDefDetail();
|
||||
chargeItemDefDetail2.setDefinitionId(chargeItemDefinition.getId())
|
||||
// 单位+批次(unit,pici) 用,符号拼装
|
||||
.setConditionCode(StringUtils.joinStrings(
|
||||
medicationManageUpDto.getDoseUnitCode_dictText() + "," + medicationManageUpDto.getLotNumber()))
|
||||
// 条件:单位
|
||||
.setConditionCode(ConditionCode.UNIT.getCode())
|
||||
//单位枚举
|
||||
.setConditionValue(medicationManageUpDto.getUnitCode())
|
||||
// 零售价
|
||||
.setAmount(medicationManageUpDto.getRetailPrice());
|
||||
|
||||
@@ -80,9 +83,8 @@ public class ItemDefinitionServiceImpl implements IItemDefinitionService {
|
||||
|
||||
ChargeItemDefDetail chargeItemDefDetail3 = new ChargeItemDefDetail();
|
||||
chargeItemDefDetail3.setDefinitionId(chargeItemDefinition.getId())
|
||||
// 单位+批次(unit,pici) 用,符号拼装
|
||||
.setConditionCode(StringUtils.joinStrings(
|
||||
medicationManageUpDto.getDoseUnitCode_dictText() + "," + medicationManageUpDto.getLotNumber()))
|
||||
// 条件:限制
|
||||
.setConditionCode(ConditionCode.LIMIT.getCode())
|
||||
// 最高零售价
|
||||
.setAmount(medicationManageUpDto.getMaximumRetailPrice());
|
||||
|
||||
@@ -94,4 +96,22 @@ public class ItemDefinitionServiceImpl implements IItemDefinitionService {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目定价表
|
||||
*
|
||||
* @param chargeItemDefinition 项目定价表信息
|
||||
*/
|
||||
@Override
|
||||
public boolean updateItem(ChargeItemDefinition chargeItemDefinition) {
|
||||
|
||||
// 关联项目和代码位为key,更新表
|
||||
LambdaUpdateWrapper<ChargeItemDefinition> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(ChargeItemDefinition::getInstanceId, chargeItemDefinition.getInstanceId());
|
||||
updateWrapper.eq(ChargeItemDefinition::getInstanceTable, chargeItemDefinition.getInstanceTable())
|
||||
.set(ChargeItemDefinition::getYbType, chargeItemDefinition.getYbType())
|
||||
.set(ChargeItemDefinition::getTypeCode, chargeItemDefinition.getTypeCode());
|
||||
|
||||
return chargeItemDefinitionService.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
package com.openhis.web.datadictionary.appservice.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -14,10 +16,11 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
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.core.domain.entity.SysDictData;
|
||||
@@ -27,6 +30,7 @@ import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
import com.core.system.service.ISysDictTypeService;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
@@ -36,6 +40,7 @@ import com.openhis.common.enums.PermissionLimit;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.medication.domain.MedicationDefinition;
|
||||
import com.openhis.medication.domain.MedicationDetail;
|
||||
@@ -46,6 +51,7 @@ import com.openhis.web.datadictionary.appservice.IMedicationManageAppService;
|
||||
import com.openhis.web.datadictionary.dto.MedicationManageDto;
|
||||
import com.openhis.web.datadictionary.dto.MedicationManageInitDto;
|
||||
import com.openhis.web.datadictionary.dto.MedicationManageUpDto;
|
||||
import com.openhis.web.datadictionary.dto.MedicationSearchParam;
|
||||
import com.openhis.web.datadictionary.mapper.MedicationManageSearchMapper;
|
||||
|
||||
/**
|
||||
@@ -137,26 +143,19 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
* @return 药品目录查询结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicationList(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag,
|
||||
@RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum,
|
||||
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode,
|
||||
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) {
|
||||
|
||||
// 分页设置
|
||||
Integer offset = (pageNo - 1) * pageSize;
|
||||
// 获取租户ID
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// 查询药品目录列表
|
||||
List<MedicationManageDto> medicationDetailList = medicationManageSearchMapper.getPage(searchKey, ybMatchFlag,
|
||||
statusEnum, categoryCode, tenantId, pageSize, offset);
|
||||
// 查询总记录数
|
||||
long total =
|
||||
medicationManageSearchMapper.getPageCount(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
// 创建Page对象并设置属性
|
||||
Page<MedicationManageDto> medicationManageDtoPage = new Page<>(pageNo, pageSize, total);
|
||||
medicationManageDtoPage.setRecords(medicationDetailList);
|
||||
// 构建查询条件
|
||||
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);
|
||||
|
||||
IPage<MedicationManageDto> medicationManageDtoPage =
|
||||
medicationManageSearchMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
// 枚举类回显赋值
|
||||
medicationManageDtoPage.getRecords().forEach(e -> {
|
||||
@@ -216,10 +215,21 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
medicationDefinition
|
||||
.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());
|
||||
|
||||
// 更新子表药品信息
|
||||
if (medicationService.updateById(medication)) {
|
||||
|
||||
// 更新主表药品信息
|
||||
return medicationDefinitionService.updateById(medicationDefinition)
|
||||
boolean updateMedicationDefinition = medicationDefinitionService.updateById(medicationDefinition);
|
||||
// 更新价格表
|
||||
boolean updateChargeItemDefinition = itemDefinitionServic.updateItem(chargeItemDefinition);
|
||||
|
||||
return (updateMedicationDefinition && updateChargeItemDefinition)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
} else {
|
||||
@@ -317,7 +327,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 添加药品成功后,添加相应的条件价格表信息
|
||||
boolean insertItemDefinitionSuccess = itemDefinitionServic.addItem(medicationManageUpDto, medicationDetail);
|
||||
|
||||
return (insertMedicationSuccess || insertItemDefinitionSuccess)
|
||||
return (insertMedicationSuccess && insertItemDefinitionSuccess)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
} else {
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.openhis.web.datadictionary.dto.MedicationSearchParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -44,22 +45,18 @@ public class MedicationManageController {
|
||||
/**
|
||||
* 查询药品目录分页列表
|
||||
*
|
||||
* @param searchKey 查询条件
|
||||
* @param statusEnum 查询条件-状态
|
||||
* @param ybMatchFlag 查询条件-是否对码
|
||||
* @param categoryCode 查询条件-药品分类
|
||||
* @param medicationSearchParam 查询条件
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-page")
|
||||
public R<?> getMedicationList(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag,
|
||||
@RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum,
|
||||
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode,
|
||||
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) {
|
||||
return medicationManageAppService.getMedicationList(searchKey, ybMatchFlag, statusEnum, categoryCode, pageNo,
|
||||
return medicationManageAppService.getMedicationList(medicationSearchParam,searchKey,pageNo,
|
||||
pageSize, request);
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,9 @@ public class MedicationManageDto {
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
@@ -156,8 +158,9 @@ public class MedicationManageDto {
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 剂量形式 */
|
||||
@Dict(dictCode = "dose_from_code")
|
||||
private Integer doseFrom;
|
||||
private String doseFrom_enumText;
|
||||
private String doseFrom_dictText;
|
||||
|
||||
/** 批准文号 */
|
||||
private String approvalNumber;
|
||||
@@ -236,11 +239,6 @@ public class MedicationManageDto {
|
||||
/** 生产厂家名称 */
|
||||
private String manufacturerName;
|
||||
|
||||
/** 常规单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String baseUnitCode;
|
||||
private String baseUnitCode_dictText;
|
||||
|
||||
/** 当前库存数量(常规单位) */
|
||||
private String baseQuantity;
|
||||
|
||||
@@ -256,5 +254,12 @@ public class MedicationManageDto {
|
||||
/** 单次最大用药频次 */
|
||||
private String maxRateCode;
|
||||
|
||||
/** 医保类别 */
|
||||
private String ybType;
|
||||
|
||||
/** 财务类别 */
|
||||
@Dict(dictCode = "fin_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
}
|
||||
|
||||
@@ -121,7 +121,9 @@ public class MedicationManageUpDto {
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
private String minUnitCode;
|
||||
@@ -136,7 +138,9 @@ public class MedicationManageUpDto {
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 剂量形式 */
|
||||
@Dict(dictCode = "dose_from_code")
|
||||
private Integer doseFrom;
|
||||
private String doseFrom_dictText;
|
||||
|
||||
/** 批准文号 */
|
||||
private String approvalNumber;
|
||||
@@ -194,8 +198,10 @@ public class MedicationManageUpDto {
|
||||
/** 医保类别 */
|
||||
private String ybType;
|
||||
|
||||
/** 最小费用 */
|
||||
private String minimalFee;
|
||||
/** 财务类别 */
|
||||
@Dict(dictCode = "fin_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/** 单次最小用药频次 */
|
||||
private String minRateCode;
|
||||
@@ -205,6 +211,7 @@ public class MedicationManageUpDto {
|
||||
|
||||
/** 药品状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 拆分属性 */
|
||||
private Integer partAttributeEnum;
|
||||
@@ -227,5 +234,7 @@ public class MedicationManageUpDto {
|
||||
/** 用量限定 */
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
|
||||
|
||||
/** 系统类别???? */
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.datadictionary.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 药品查询信息
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/3/27
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MedicationSearchParam {
|
||||
|
||||
/** 医保是否对码 */
|
||||
private Integer ybMatchFlag;
|
||||
/** 药品状态 */
|
||||
private Integer statusEnum;
|
||||
/** 药品分类 */
|
||||
private String categoryCode;
|
||||
}
|
||||
@@ -2,6 +2,11 @@ package com.openhis.web.datadictionary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.outpatientmanage.dto.OutpatientInfusionRecordDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -17,35 +22,18 @@ import com.openhis.web.datadictionary.dto.MedicationManageDto;
|
||||
*/
|
||||
@Repository
|
||||
public interface MedicationManageSearchMapper extends BaseMapper<ChargeItemDefinition> {
|
||||
/**
|
||||
* 药品目录分页查询
|
||||
*
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param ybMatchFlag 是否对码
|
||||
* @param statusEnum 状态
|
||||
* @param categoryCode 分类
|
||||
* @param tenantId 租户
|
||||
* @param pageSize
|
||||
* @param offset
|
||||
* @return
|
||||
*/
|
||||
List<MedicationManageDto> getPage(@Param("searchKey") String searchKey, @Param("ybMatchFlag") Integer ybMatchFlag,
|
||||
@Param("statusEnum") Integer statusEnum, @Param("categoryCode") String categoryCode,
|
||||
@Param("tenantId") Integer tenantId, @Param("pageSize") Integer pageSize, @Param("offset") Integer offset);
|
||||
|
||||
/**
|
||||
* 药品目录分页查询
|
||||
*
|
||||
* @param searchKey 模糊查询条件
|
||||
* @param ybMatchFlag 是否对码
|
||||
* @param statusEnum 状态
|
||||
* @param categoryCode 分类
|
||||
* @param tenantId 租户
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @return
|
||||
*/
|
||||
Long getPageCount(@Param("searchKey") String searchKey, @Param("ybMatchFlag") Integer ybMatchFlag,
|
||||
@Param("statusEnum") Integer statusEnum, @Param("categoryCode") String categoryCode,
|
||||
@Param("tenantId") Integer tenantId);
|
||||
IPage<MedicationManageDto> getPage(
|
||||
@Param("page") Page<OutpatientInfusionRecordDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<MedicationManageDto> queryWrapper);
|
||||
|
||||
|
||||
/**
|
||||
* 药品详情
|
||||
|
||||
@@ -1,8 +1,81 @@
|
||||
<?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.datadictionary.mapper.MedicationManageSearchMapper">
|
||||
<!-- 药品信息分页查询-->
|
||||
<select id="getPage" parameterType="java.util.Map"
|
||||
resultType="com.openhis.web.datadictionary.dto.MedicationManageDto">
|
||||
SELECT
|
||||
T6.id,
|
||||
T6.medication_def_id,
|
||||
T6.status_enum,
|
||||
T6.org_id,
|
||||
T6.location_id,
|
||||
T6.dose_form_code,
|
||||
T6.total_volume,
|
||||
T6.ingredient_item,
|
||||
T6.active_flag,
|
||||
T6.lot_number,
|
||||
T6.effective_date,
|
||||
T6.expiration_date,
|
||||
T6.method_code,
|
||||
T6.rate_code,
|
||||
T6.dose,
|
||||
T6.dose_unit_code,
|
||||
T6.max_unit,
|
||||
T6.definition,
|
||||
T6.usage_limit,
|
||||
T6.ddd_code,
|
||||
T6.ddd_unit_code,
|
||||
T6.min_rate_code,
|
||||
T6.max_rate_code,
|
||||
T6.bus_no,
|
||||
T6.name,
|
||||
T6.domain_enum,
|
||||
T6.version,
|
||||
T6.name_en,
|
||||
T6.py_str,
|
||||
T6.wb_str,
|
||||
T6.category_code,
|
||||
T6.merchandise_name,
|
||||
T6.merchandise_py_str,
|
||||
T6.merchandise_wb_str,
|
||||
T6.unit_code,
|
||||
T6.comprised_text,
|
||||
T6.ingredient,
|
||||
T6.part_percent,
|
||||
T6.dose_from,
|
||||
T6.approval_number,
|
||||
T6.yb_match_flag,
|
||||
T6.yb_no,
|
||||
T6.pharmacology_category_code,
|
||||
T6.skin_test_flag,
|
||||
T6.inject_flag,
|
||||
T6.manufacturer_id,
|
||||
T6.supply_id,
|
||||
T6.restricted_flag,
|
||||
T6.restricted_scope,
|
||||
T6.children_flag,
|
||||
T6.characteristic,
|
||||
T6.national_drug_code,
|
||||
T6.part_attribute_enum,
|
||||
T6.antibiotic_code,
|
||||
T6.restricted_enum,
|
||||
T6.self_flag,
|
||||
T6.antibiotic_flag,
|
||||
T6.basic_flag,
|
||||
T6.remark,
|
||||
T6.manufacturer_name,
|
||||
T6.base_unit_code,
|
||||
T6.base_quantity,
|
||||
T6.min_unit_code,
|
||||
T6.min_quantity,
|
||||
T6.yb_type,
|
||||
T6.retail_price,
|
||||
T6.purchase_price,
|
||||
T6.retail_price,
|
||||
T6.tenant_id
|
||||
FROM
|
||||
(
|
||||
SELECT T2.id,
|
||||
T2.medication_def_id,
|
||||
T2.status_enum,
|
||||
@@ -24,6 +97,8 @@
|
||||
T2.usage_limit,
|
||||
T2.ddd_code,
|
||||
T2.ddd_unit_code,
|
||||
T2.min_rate_code,
|
||||
T2.max_rate_code,
|
||||
T1.bus_no,
|
||||
T1.name,
|
||||
T1.domain_enum,
|
||||
@@ -65,7 +140,20 @@
|
||||
T4.base_quantity,
|
||||
T4.min_unit_code,
|
||||
T4.min_quantity,
|
||||
T5.price
|
||||
T5.yb_type,
|
||||
T1.tenant_id,
|
||||
T5.price as retail_price,--零售价
|
||||
(SELECT T7.amount
|
||||
FROM adm_charge_item_definition T5
|
||||
LEFT JOIN adm_charge_item_def_detail T7 ON T7.definition_id = T5.id
|
||||
WHERE T7.condition_code = '2'--2:采购价
|
||||
) as purchase_price,--购入价
|
||||
(
|
||||
SELECT T7.amount
|
||||
FROM adm_charge_item_definition T5
|
||||
LEFT JOIN adm_charge_item_def_detail T7 ON T7.definition_id = T5.id
|
||||
WHERE T7.condition_code = '4'--4:限制
|
||||
) as maximum_retail_price--最高零售价
|
||||
FROM med_medication_definition T1
|
||||
LEFT JOIN med_medication T2 ON T1.id = T2.medication_def_id
|
||||
LEFT JOIN adm_supplier T3 ON T1.manufacturer_id = T3.id
|
||||
@@ -74,31 +162,9 @@
|
||||
<where>
|
||||
T1.delete_flag = '0'
|
||||
AND T5.instance_table = 'med_medication_definition'
|
||||
<if test="searchKey!=null and searchKey!='' ">
|
||||
AND ( T1.name LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.name_en LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.merchandise_name LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.bus_no LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.py_str LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.wb_str LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.merchandise_py_str LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.merchandise_wb_str LIKE CONCAT(CONCAT('%', #{searchKey}),'%'))
|
||||
</if>
|
||||
<if test="ybMatchFlag!= -1">
|
||||
AND T1.yb_match_flag = #{ybMatchFlag}
|
||||
</if>
|
||||
<if test="statusEnum!= -1">
|
||||
AND T2.status_enum = #{statusEnum}
|
||||
</if>
|
||||
<if test="categoryCode!=null and categoryCode!='' ">
|
||||
AND T1.category_code = #{categoryCode}
|
||||
</if>
|
||||
<if test="tenantId!= null">
|
||||
AND T1.tenant_id = #{tenantId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY T1.bus_no
|
||||
LIMIT #{pageSize} OFFSET #{offset}
|
||||
) AS T6
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getOne" resultType="com.openhis.web.datadictionary.dto.MedicationManageDto">
|
||||
@@ -106,6 +172,7 @@
|
||||
T2.medication_def_id,
|
||||
T2.status_enum,
|
||||
T2.org_id,
|
||||
T2.location_id,
|
||||
T2.dose_form_code,
|
||||
T2.total_volume,
|
||||
T2.ingredient_item,
|
||||
@@ -119,6 +186,11 @@
|
||||
T2.dose_unit_code,
|
||||
T2.max_unit,
|
||||
T2.definition,
|
||||
T2.usage_limit,
|
||||
T2.ddd_code,
|
||||
T2.ddd_unit_code,
|
||||
T2.min_rate_code,
|
||||
T2.max_rate_code,
|
||||
T1.bus_no,
|
||||
T1.name,
|
||||
T1.domain_enum,
|
||||
@@ -143,48 +215,40 @@
|
||||
T1.skin_test_flag,
|
||||
T1.inject_flag,
|
||||
T1.manufacturer_id,
|
||||
T1.manufacturer_text,
|
||||
T1.supply_id,
|
||||
T1.restricted_flag,
|
||||
T1.restricted_scope,
|
||||
T1.children_flag,
|
||||
T1.characteristic
|
||||
T1.characteristic,
|
||||
T1.national_drug_code,
|
||||
T1.part_attribute_enum,
|
||||
T1.antibiotic_code,
|
||||
T1.restricted_enum,
|
||||
T1.self_flag,
|
||||
T1.antibiotic_flag,
|
||||
T1.basic_flag,
|
||||
T3.type_code,
|
||||
T3.yb_type,
|
||||
T3.price as retail_price,--零售价
|
||||
(SELECT T4.amount
|
||||
FROM adm_charge_item_definition T3
|
||||
LEFT JOIN adm_charge_item_def_detail T4 ON T4.definition_id = T3.id
|
||||
WHERE T4.condition_code = '2'--2:采购价
|
||||
) as purchase_price,--购入价
|
||||
(
|
||||
SELECT T4.amount
|
||||
FROM adm_charge_item_definition T3
|
||||
LEFT JOIN adm_charge_item_def_detail T4 ON T4.definition_id = T3.id
|
||||
WHERE T4.condition_code = '4'--4:限制
|
||||
) as maximum_retail_price--最高零售价
|
||||
FROM med_medication_definition T1
|
||||
LEFT JOIN med_medication T2 on T1.id = T2.medication_def_id
|
||||
LEFT JOIN adm_charge_item_definition T3 ON T2.medication_def_id = T3.instance_id
|
||||
<where>
|
||||
T1.delete_flag = '0'
|
||||
<if test="id!= 0">
|
||||
AND T1.id = #{id}
|
||||
</if>
|
||||
<if test="tenantId!= null">
|
||||
AND T1.tenant_id = #{tenantId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getPageCount" resultType="java.lang.Long">
|
||||
SELECT COUNT(*)
|
||||
FROM med_medication_definition T1
|
||||
LEFT JOIN med_medication T2 on T1.id = T2.medication_def_id
|
||||
<where>
|
||||
T1.delete_flag = '0'
|
||||
<if test="searchKey!=null and searchKey!='' ">
|
||||
AND ( T1.name LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.name_en LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.merchandise_name LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.bus_no LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.py_str LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.wb_str LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.merchandise_py_str LIKE CONCAT(CONCAT('%', #{searchKey}),'%') OR
|
||||
T1.merchandise_wb_str LIKE CONCAT(CONCAT('%', #{searchKey}),'%'))
|
||||
</if>
|
||||
<if test="ybMatchFlag!= -1">
|
||||
AND T1.yb_match_flag = #{ybMatchFlag}
|
||||
</if>
|
||||
<if test="statusEnum!= -1">
|
||||
AND T2.status_enum = #{statusEnum}
|
||||
</if>
|
||||
<if test="categoryCode!=null and categoryCode!='' ">
|
||||
AND T1.category_code = #{categoryCode}
|
||||
<if test="id!= null">
|
||||
AND T2.id = #{id}
|
||||
</if>
|
||||
<if test="tenantId!= null">
|
||||
AND T1.tenant_id = #{tenantId}
|
||||
|
||||
Reference in New Issue
Block a user